diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 14:36:22 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 15:32:53 +0200 |
commit | f4cf9fe05bb3f32fabea4e54dd92d368967a80da (patch) | |
tree | 487180fa9866985ea7b28e625651765d86f515c3 /meta/recipes-qt | |
download | poky-f4cf9fe05bb3f32fabea4e54dd92d368967a80da.tar.gz |
initial commit for Enea Linux 4.0
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-qt')
71 files changed, 8083 insertions, 0 deletions
diff --git a/meta/recipes-qt/images/qt4e-demo-image.bb b/meta/recipes-qt/images/qt4e-demo-image.bb new file mode 100644 index 0000000000..4451848656 --- /dev/null +++ b/meta/recipes-qt/images/qt4e-demo-image.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | DESCRIPTION = "An image that will launch into the demo application for the embedded (not based on X11) version of Qt." | ||
2 | LICENSE = "MIT" | ||
3 | PR = "r3" | ||
4 | |||
5 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ | ||
6 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
7 | |||
8 | IMAGE_INSTALL += "\ | ||
9 | ${CORE_IMAGE_BASE_INSTALL} \ | ||
10 | packagegroup-core-qt4e \ | ||
11 | " | ||
12 | |||
13 | inherit core-image | ||
14 | |||
diff --git a/meta/recipes-qt/meta/meta-toolchain-qt.bb b/meta/recipes-qt/meta/meta-toolchain-qt.bb new file mode 100644 index 0000000000..a10103a39f --- /dev/null +++ b/meta/recipes-qt/meta/meta-toolchain-qt.bb | |||
@@ -0,0 +1,5 @@ | |||
1 | # Qt toolchain | ||
2 | QTNAME = "qt" | ||
3 | QT_DIR_NAME = "qt4" | ||
4 | |||
5 | require meta-toolchain-qt.inc | ||
diff --git a/meta/recipes-qt/meta/meta-toolchain-qt.inc b/meta/recipes-qt/meta/meta-toolchain-qt.inc new file mode 100644 index 0000000000..c9bdeae9ac --- /dev/null +++ b/meta/recipes-qt/meta/meta-toolchain-qt.inc | |||
@@ -0,0 +1,32 @@ | |||
1 | TOOLCHAIN_HOST_TASK = "nativesdk-packagegroup-${QTNAME}-toolchain-host packagegroup-cross-canadian-${MACHINE}" | ||
2 | TOOLCHAIN_TARGET_TASK = "packagegroup-${QTNAME}-toolchain-target" | ||
3 | TOOLCHAIN_OUTPUTNAME = "${SDK_NAME}-toolchain-${QTNAME}-${DISTRO_VERSION}" | ||
4 | |||
5 | require recipes-core/meta/meta-toolchain.bb | ||
6 | |||
7 | QT_TOOLS_PREFIX = "${SDKPATHNATIVE}${bindir_nativesdk}" | ||
8 | |||
9 | toolchain_create_sdk_env_script_append() { | ||
10 | echo 'export OE_QMAKE_CFLAGS="$CFLAGS"' >> $script | ||
11 | echo 'export OE_QMAKE_CXXFLAGS="$CXXFLAGS"' >> $script | ||
12 | echo 'export OE_QMAKE_LDFLAGS="$LDFLAGS"' >> $script | ||
13 | echo 'export OE_QMAKE_CC=$CC' >> $script | ||
14 | echo 'export OE_QMAKE_CXX=$CXX' >> $script | ||
15 | echo 'export OE_QMAKE_LINK=$CXX' >> $script | ||
16 | echo 'export OE_QMAKE_AR=$AR' >> $script | ||
17 | echo 'export OE_QMAKE_LIBDIR_QT=${SDKTARGETSYSROOT}/${libdir}' >> $script | ||
18 | echo 'export OE_QMAKE_INCDIR_QT=${SDKTARGETSYSROOT}/${includedir}/${QT_DIR_NAME}' >> $script | ||
19 | echo 'export OE_QMAKE_MOC=${QT_TOOLS_PREFIX}/moc4' >> $script | ||
20 | echo 'export OE_QMAKE_UIC=${QT_TOOLS_PREFIX}/uic4' >> $script | ||
21 | echo 'export OE_QMAKE_UIC3=${QT_TOOLS_PREFIX}/uic34' >> $script | ||
22 | echo 'export OE_QMAKE_RCC=${QT_TOOLS_PREFIX}/rcc4' >> $script | ||
23 | echo 'export OE_QMAKE_QDBUSCPP2XML=${QT_TOOLS_PREFIX}/qdbuscpp2xml4' >> $script | ||
24 | echo 'export OE_QMAKE_QDBUSXML2CPP=${QT_TOOLS_PREFIX}/qdbusxml2cpp4' >> $script | ||
25 | echo 'export OE_QMAKE_QT_CONFIG=${SDKTARGETSYSROOT}/${datadir}/${QT_DIR_NAME}/mkspecs/qconfig.pri' >> $script | ||
26 | echo 'export QMAKESPEC=${SDKTARGETSYSROOT}/${datadir}/${QT_DIR_NAME}/mkspecs/linux-g++' >> $script | ||
27 | echo 'export QT_CONF_PATH=${SDKPATHNATIVE}/${sysconfdir}/qt.conf' >> $script | ||
28 | |||
29 | # make a symbolic link to mkspecs for compatibility with Nokia's SDK | ||
30 | # and QTCreator | ||
31 | (cd ${SDK_OUTPUT}/${QT_TOOLS_PREFIX}/..; ln -s ${SDKTARGETSYSROOT}/usr/share/${QT_DIR_NAME}/mkspecs mkspecs;) | ||
32 | } | ||
diff --git a/meta/recipes-qt/meta/meta-toolchain-qte.bb b/meta/recipes-qt/meta/meta-toolchain-qte.bb new file mode 100644 index 0000000000..9113f48ed8 --- /dev/null +++ b/meta/recipes-qt/meta/meta-toolchain-qte.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | # Qt Embedded toolchain | ||
2 | PR = "r6" | ||
3 | QTNAME = "qte" | ||
4 | QT_DIR_NAME = "qtopia" | ||
5 | |||
6 | require meta-toolchain-qt.inc | ||
diff --git a/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.bb b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.bb new file mode 100644 index 0000000000..b95cc5e594 --- /dev/null +++ b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.bb | |||
@@ -0,0 +1,3 @@ | |||
1 | require nativesdk-packagegroup-qt-toolchain-host.inc | ||
2 | |||
3 | SUMMARY = "Host packages for Qt SDK" | ||
diff --git a/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.inc b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.inc new file mode 100644 index 0000000000..a3c275fd97 --- /dev/null +++ b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.inc | |||
@@ -0,0 +1,6 @@ | |||
1 | require recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb | ||
2 | |||
3 | DESCRIPTION = "Host packages for Qt Embedded SDK" | ||
4 | LICENSE = "MIT" | ||
5 | |||
6 | RDEPENDS_${PN} += "nativesdk-qt4-tools" | ||
diff --git a/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qte-toolchain-host.bb b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qte-toolchain-host.bb new file mode 100644 index 0000000000..296e4b803c --- /dev/null +++ b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qte-toolchain-host.bb | |||
@@ -0,0 +1,3 @@ | |||
1 | require nativesdk-packagegroup-qt-toolchain-host.inc | ||
2 | |||
3 | SUMMARY = "Host packages for Qt Embedded SDK" | ||
diff --git a/meta/recipes-qt/packagegroups/packagegroup-core-qt.bb b/meta/recipes-qt/packagegroups/packagegroup-core-qt.bb new file mode 100644 index 0000000000..15dec8eef2 --- /dev/null +++ b/meta/recipes-qt/packagegroups/packagegroup-core-qt.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | # | ||
2 | # Copyright (C) 2010 Intel Corporation. All rights reserved | ||
3 | # | ||
4 | |||
5 | SUMMARY = "Qt package groups" | ||
6 | LICENSE = "MIT" | ||
7 | PR = "r4" | ||
8 | |||
9 | # Qt4 could NOT be built on MIPS64 with 64 bits userspace | ||
10 | COMPATIBLE_HOST_mips64 = "mips64.*-linux-gnun32" | ||
11 | |||
12 | inherit packagegroup | ||
13 | |||
14 | PACKAGES = "${PN}-demoapps" | ||
15 | |||
16 | # For backwards compatibility after rename | ||
17 | RPROVIDES_${PN}-demoapps = "task-core-qt-demos" | ||
18 | RREPLACES_${PN}-demoapps = "task-core-qt-demos" | ||
19 | RCONFLICTS_${PN}-demoapps = "task-core-qt-demos" | ||
20 | |||
21 | QTDEMOS ?= "quicky ${COMMERCIAL_QT} fotowall" | ||
22 | |||
23 | SUMMARY_${PN}-demoapps = "Qt demo applications" | ||
24 | RDEPENDS_${PN}-demoapps = "${QTDEMOS}" | ||
diff --git a/meta/recipes-qt/packagegroups/packagegroup-core-qt4e.bb b/meta/recipes-qt/packagegroups/packagegroup-core-qt4e.bb new file mode 100644 index 0000000000..6ef844fc7c --- /dev/null +++ b/meta/recipes-qt/packagegroups/packagegroup-core-qt4e.bb | |||
@@ -0,0 +1,57 @@ | |||
1 | SUMMARY = "Qt for Embedded Linux (Qt without X11)" | ||
2 | PR = "r2" | ||
3 | LICENSE = "MIT" | ||
4 | |||
5 | # Qt4 could NOT be built on MIPS64 with 64 bits userspace | ||
6 | COMPATIBLE_HOST_mips64 = "mips64.*-linux-gnun32" | ||
7 | |||
8 | inherit packagegroup | ||
9 | |||
10 | # For backwards compatibility after rename | ||
11 | RPROVIDES_${PN} = "task-qt4e-base" | ||
12 | RREPLACES_${PN} = "task-qt4e-base" | ||
13 | RCONFLICTS_${PN} = "task-qt4e-base" | ||
14 | |||
15 | TOUCH = ' ${@base_contains("MACHINE_FEATURES", "touchscreen", "tslib tslib-calibrate tslib-tests", "",d)}' | ||
16 | |||
17 | RDEPENDS_${PN} = " \ | ||
18 | qt4-embedded \ | ||
19 | libqt-embedded3support4 \ | ||
20 | libqt-embeddedclucene4 \ | ||
21 | libqt-embeddedcore4 \ | ||
22 | libqt-embeddeddbus4 \ | ||
23 | libqt-embeddedgui4 \ | ||
24 | libqt-embeddedhelp4 \ | ||
25 | libqt-embeddedmultimedia4 \ | ||
26 | libqt-embeddednetwork4 \ | ||
27 | libqt-embeddedscript4 \ | ||
28 | libqt-embeddedscripttools4 \ | ||
29 | libqt-embeddedsql4 \ | ||
30 | libqt-embeddedsvg4 \ | ||
31 | libqt-embeddedtest4 \ | ||
32 | libqt-embeddedwebkit4 \ | ||
33 | libqt-embeddedxml4 \ | ||
34 | qt4-embedded-fonts-ttf-dejavu \ | ||
35 | qt4-embedded-fonts-ttf-vera \ | ||
36 | qt4-embedded-plugin-iconengine-svgicon \ | ||
37 | qt4-embedded-plugin-imageformat-gif \ | ||
38 | qt4-embedded-plugin-imageformat-ico \ | ||
39 | qt4-embedded-plugin-imageformat-jpeg \ | ||
40 | qt4-embedded-plugin-imageformat-mng \ | ||
41 | qt4-embedded-plugin-imageformat-svg \ | ||
42 | qt4-embedded-plugin-imageformat-tiff \ | ||
43 | qt4-embedded-plugin-mousedriver-tslib \ | ||
44 | qt4-embedded-plugin-phonon-backend-gstreamer \ | ||
45 | qt4-embedded-plugin-script-dbus \ | ||
46 | qt4-embedded-plugin-sqldriver-sqlite \ | ||
47 | ${TOUCH} \ | ||
48 | qt4-embedded-demos \ | ||
49 | qt4-embedded-examples \ | ||
50 | qt-demo-init \ | ||
51 | qt4-embedded-assistant \ | ||
52 | " | ||
53 | |||
54 | RRECOMMENDS_${PN} = " \ | ||
55 | libqt-embeddedxmlpatterns4 \ | ||
56 | " | ||
57 | |||
diff --git a/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.bb b/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.bb new file mode 100644 index 0000000000..c6aa753575 --- /dev/null +++ b/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.bb | |||
@@ -0,0 +1,11 @@ | |||
1 | SUMMARY = "Target packages for Qt SDK" | ||
2 | |||
3 | QTLIBPREFIX = "" | ||
4 | |||
5 | require packagegroup-qt-toolchain-target.inc | ||
6 | |||
7 | RDEPENDS_${PN} += " \ | ||
8 | qt4-x11-free-dev \ | ||
9 | ${@base_contains('DISTRO_FEATURES', 'opengl', 'libqtopengl4-dev', '', d)} \ | ||
10 | ${@base_contains('DISTRO_FEATURES', 'openvg', 'libqtopenvg4-dev', '', d)} \ | ||
11 | " | ||
diff --git a/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.inc b/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.inc new file mode 100644 index 0000000000..fc1ccba9a7 --- /dev/null +++ b/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.inc | |||
@@ -0,0 +1,36 @@ | |||
1 | LICENSE = "MIT" | ||
2 | |||
3 | # Qt4 could NOT be built on MIPS64 with 64 bits userspace | ||
4 | COMPATIBLE_HOST_mips64 = "mips64.*-linux-gnun32" | ||
5 | |||
6 | inherit packagegroup | ||
7 | |||
8 | PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1" | ||
9 | |||
10 | RDEPENDS_${PN} += " \ | ||
11 | packagegroup-core-standalone-sdk-target \ | ||
12 | qt4${QTLIBPREFIX}-mkspecs \ | ||
13 | libqt${QTLIBPREFIX}multimedia4-dev \ | ||
14 | libqt${QTLIBPREFIX}phonon4-dev \ | ||
15 | libqt${QTLIBPREFIX}3support4-dev \ | ||
16 | libqt${QTLIBPREFIX}clucene4-dev \ | ||
17 | libqt${QTLIBPREFIX}core4-dev \ | ||
18 | libqt${QTLIBPREFIX}dbus4-dev \ | ||
19 | libqt${QTLIBPREFIX}designercomponents4-dev \ | ||
20 | libqt${QTLIBPREFIX}designer4-dev \ | ||
21 | libqt${QTLIBPREFIX}uitools4-dev \ | ||
22 | libqt${QTLIBPREFIX}gui4-dev \ | ||
23 | libqt${QTLIBPREFIX}help4-dev \ | ||
24 | libqt${QTLIBPREFIX}network4-dev \ | ||
25 | libqt${QTLIBPREFIX}script4-dev \ | ||
26 | libqt${QTLIBPREFIX}scripttools4-dev \ | ||
27 | libqt${QTLIBPREFIX}sql4-dev \ | ||
28 | libqt${QTLIBPREFIX}svg4-dev \ | ||
29 | libqt${QTLIBPREFIX}test4-dev \ | ||
30 | libqt${QTLIBPREFIX}webkit4-dev \ | ||
31 | libqt${QTLIBPREFIX}xml4-dev \ | ||
32 | libqt${QTLIBPREFIX}declarative4-dev \ | ||
33 | libqt${QTLIBPREFIX}xmlpatterns4-dev \ | ||
34 | libsqlite3-dev \ | ||
35 | expat-dev \ | ||
36 | " | ||
diff --git a/meta/recipes-qt/packagegroups/packagegroup-qte-toolchain-target.bb b/meta/recipes-qt/packagegroups/packagegroup-qte-toolchain-target.bb new file mode 100644 index 0000000000..92ed237d3b --- /dev/null +++ b/meta/recipes-qt/packagegroups/packagegroup-qte-toolchain-target.bb | |||
@@ -0,0 +1,7 @@ | |||
1 | SUMMARY = "Target packages for Qt Embedded SDK" | ||
2 | |||
3 | PR = "r7" | ||
4 | |||
5 | QTLIBPREFIX = "-embedded" | ||
6 | |||
7 | require packagegroup-qt-toolchain-target.inc | ||
diff --git a/meta/recipes-qt/qt-apps/fotowall/ExportWizard-depends-on-ui_wizard.patch b/meta/recipes-qt/qt-apps/fotowall/ExportWizard-depends-on-ui_wizard.patch new file mode 100644 index 0000000000..d8b2b2347b --- /dev/null +++ b/meta/recipes-qt/qt-apps/fotowall/ExportWizard-depends-on-ui_wizard.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | App/ExportWizard.cpp depends on wizard.h which depends on ui_wizard. The last one | ||
2 | should be already generated before compiling ExportWizard.cpp. | ||
3 | |||
4 | Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> | ||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Index: Fotowall-0.9/App/ExportWizard.cpp | ||
8 | =================================================================== | ||
9 | --- Fotowall-0.9.orig/App/ExportWizard.cpp 2009-11-30 13:21:31.000000000 +0200 | ||
10 | +++ Fotowall-0.9/App/ExportWizard.cpp 2012-05-10 17:12:06.765230830 +0300 | ||
11 | @@ -23,6 +23,7 @@ | ||
12 | #include "imageloaderqt.h" | ||
13 | #include "posterazorcore.h" | ||
14 | #include "wizard.h" | ||
15 | +#include "ui_wizard.h" | ||
16 | |||
17 | #include <QDesktopServices> | ||
18 | #include <QDesktopWidget> | ||
diff --git a/meta/recipes-qt/qt-apps/fotowall_0.9.bb b/meta/recipes-qt/qt-apps/fotowall_0.9.bb new file mode 100644 index 0000000000..48dcc02e2a --- /dev/null +++ b/meta/recipes-qt/qt-apps/fotowall_0.9.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | SUMMARY = "Creative photo display application" | ||
2 | DESCRIPTION = "Fotowall is a creative tool that allows you to layout your photos or pictures \ | ||
3 | in a personal way. You can add pictures, then resize, move, change colors, text, shadows, etc.." | ||
4 | |||
5 | HOMEPAGE = "http://www.enricoros.com/opensource/fotowall" | ||
6 | LICENSE = "GPLv2+" | ||
7 | LIC_FILES_CHKSUM = "file://GPL_V2;md5=79808397c3355f163c012616125c9e26 \ | ||
8 | file://main.cpp;beginline=6;endline=11;md5=b569acc2bf8974a3082b58fc53b9d8dc" | ||
9 | SECTION = "x11/apps" | ||
10 | |||
11 | PR = "r4" | ||
12 | |||
13 | SRC_URI = "http://qt-apps.org/CONTENT/content-files/71316-Fotowall-0.9.tar.bz2 \ | ||
14 | file://ExportWizard-depends-on-ui_wizard.patch \ | ||
15 | " | ||
16 | |||
17 | SRC_URI[md5sum] = "142ef697332e0777c6d22c5bc96cc438" | ||
18 | SRC_URI[sha256sum] = "e4d0c005d2cb1d7c09438bfc3098eadebc08946e4fbc0655b7fc8b046de3810d" | ||
19 | |||
20 | S = "${WORKDIR}/Fotowall-${PV}" | ||
21 | |||
22 | inherit qt4x11 | ||
23 | |||
24 | EXTRA_QMAKEVARS_PRE = "CONFIG+=no-webcam" | ||
25 | |||
26 | do_install() { | ||
27 | oe_runmake INSTALL_ROOT=${D} install | ||
28 | } | ||
29 | |||
30 | # Ensure we have some plugins for some useful image formats | ||
31 | RRECOMMENDS_${PN} += "qt4-plugin-imageformat-gif qt4-plugin-imageformat-jpeg qt4-plugin-imageformat-tiff" | ||
diff --git a/meta/recipes-qt/qt-apps/qmmp/no-host-paths.patch b/meta/recipes-qt/qt-apps/qmmp/no-host-paths.patch new file mode 100644 index 0000000000..2bb5bb11cc --- /dev/null +++ b/meta/recipes-qt/qt-apps/qmmp/no-host-paths.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Do not include /usr/include host paths | ||
2 | |||
3 | These were added upstream apparently for freebsd support, but trigger | ||
4 | compiler warnings during the build and could be dangerous, so remove | ||
5 | them. | ||
6 | |||
7 | Upstream-Status: Inappropriate [cross] | ||
8 | |||
9 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
10 | |||
11 | Update patch for version 0.7.4. | ||
12 | |||
13 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
14 | |||
15 | --- qmmp-0.7.4/CMakeLists.txt 2014-01-10 09:59:44.971837746 +0800 | ||
16 | +++ qmmp-0.7.4/CMakeLists.txt.new 2014-01-10 10:24:51.855837566 +0800 | ||
17 | @@ -1,9 +1,5 @@ | ||
18 | cmake_minimum_required(VERSION 2.6.0) | ||
19 | |||
20 | -#freebsd support | ||
21 | -include_directories(SYSTEM /usr/local/include) | ||
22 | -SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} /usr/local/include) | ||
23 | - | ||
24 | #extract version from qmmp.h | ||
25 | FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/src/qmmp/qmmp.h" | ||
26 | QMMP_VERSION_DATA REGEX "^#define[ \t]+QMMP_VERSION_[A-Z]+[ \t]+[0-9]+.*$") | ||
diff --git a/meta/recipes-qt/qt-apps/qmmp_0.7.5.bb b/meta/recipes-qt/qt-apps/qmmp_0.7.5.bb new file mode 100644 index 0000000000..910e7c2b31 --- /dev/null +++ b/meta/recipes-qt/qt-apps/qmmp_0.7.5.bb | |||
@@ -0,0 +1,77 @@ | |||
1 | SUMMARY = "Qt-based Multimedia Player" | ||
2 | DESCRIPTION = "Qmmp is an audio player, written with the help of the Qt library. The user interface is similar to Winamp or XMMS." | ||
3 | HOMEPAGE = "http://qmmp.ylsoftware.com" | ||
4 | LICENSE = "GPLv2" | ||
5 | LICENSE_FLAGS = "commercial" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
7 | SECTION = "multimedia" | ||
8 | |||
9 | DEPENDS = "taglib libmad libvorbis libogg alsa-lib libsndfile1 libsamplerate0 curl" | ||
10 | |||
11 | SRC_URI = "http://qmmp.ylsoftware.com/files/${BPN}-${PV}.tar.bz2 \ | ||
12 | file://no-host-paths.patch \ | ||
13 | " | ||
14 | |||
15 | SRC_URI[md5sum] = "dcc3c9ecd4dfbf0ced91c59cb894d460" | ||
16 | SRC_URI[sha256sum] = "6066aea939813667dae7cf32ff1d6eb9913894977d132c2cd729fea22d24cf67" | ||
17 | |||
18 | inherit cmake qt4x11 | ||
19 | |||
20 | QMMP_PLUGIN_OPTIONS ??= "\ | ||
21 | -DUSE_MMS:BOOL=FALSE \ | ||
22 | -DUSE_MPC:BOOL=FALSE \ | ||
23 | -DUSE_MODPLUG:BOOL=FALSE \ | ||
24 | -DUSE_WAVPACK:BOOL=FALSE \ | ||
25 | -DUSE_FFMPEG:BOOL=FALSE \ | ||
26 | -DUSE_AAC:BOOL=FALSE \ | ||
27 | -DUSE_CDA:BOOL=FALSE \ | ||
28 | -DUSE_MIDI:BOOL=FALSE \ | ||
29 | -DUSE_GME:BOOL=FALSE \ | ||
30 | -DUSE_OSS4:BOOL=FALSE \ | ||
31 | -DUSE_JACK:BOOL=FALSE \ | ||
32 | -DUSE_BS2B:BOOL=FALSE \ | ||
33 | -DUSE_PROJECTM:BOOL=FALSE \ | ||
34 | -DUSE_ENCA:BOOL=FALSE \ | ||
35 | " | ||
36 | |||
37 | export EXTRA_OECMAKE = "-DQT_QMAKE_EXECUTABLE=${OE_QMAKE_QMAKE} \ | ||
38 | -DQT_LRELEASE_EXECUTABLE=${OE_QMAKE_LRELEASE} \ | ||
39 | -DQT_MOC_EXECUTABLE=${OE_QMAKE_MOC} \ | ||
40 | -DQT_UIC_EXECUTABLE=${OE_QMAKE_UIC} \ | ||
41 | -DQT_RCC_EXECUTABLE=${OE_QMAKE_RCC} \ | ||
42 | -DQT_LIBRARY_DIR=${OE_QMAKE_LIBDIR_QT} \ | ||
43 | -DQT_HEADERS_DIR=${OE_QMAKE_INCDIR_QT} \ | ||
44 | -DQT_QTCORE_INCLUDE_DIR=${OE_QMAKE_INCDIR_QT}/QtCore \ | ||
45 | ${QMMP_PLUGIN_OPTIONS} \ | ||
46 | " | ||
47 | |||
48 | do_configure() { | ||
49 | # Ensure we get the cmake configure and not qmake | ||
50 | cmake_do_configure | ||
51 | } | ||
52 | |||
53 | PACKAGES_DYNAMIC += "^qmmp-plugin-.* " | ||
54 | |||
55 | python populate_packages_prepend () { | ||
56 | qmmp_libdir = d.expand('${libdir}/qmmp') | ||
57 | gd = d.expand('${D}/${libdir}/qmmp') | ||
58 | plug_dirs = os.listdir(gd) | ||
59 | |||
60 | for plug_dir in plug_dirs: | ||
61 | g_plug_dir = os.path.join(qmmp_libdir,plug_dir) | ||
62 | do_split_packages(d, g_plug_dir, '^lib(.*)\.so$', 'qmmp-plugin-' + plug_dir.lower() + '-%s', 'Qmmp ' + plug_dir + ' plugin for %s') | ||
63 | } | ||
64 | |||
65 | FILES_${PN} = "\ | ||
66 | ${bindir}/qmmp \ | ||
67 | ${libdir}/lib*${SOLIBS} \ | ||
68 | ${datadir}/icons/* \ | ||
69 | ${datadir}/qmmp/images/* \ | ||
70 | ${datadir}/applications/* \ | ||
71 | " | ||
72 | |||
73 | FILES_${PN}-dbg += "\ | ||
74 | ${libdir}/qmmp/*/.debug/* \ | ||
75 | " | ||
76 | |||
77 | RDEPENDS_${PN} += "taglib alsa-lib libmad curl" | ||
diff --git a/meta/recipes-qt/qt-apps/quicky_0.4.bb b/meta/recipes-qt/qt-apps/quicky_0.4.bb new file mode 100644 index 0000000000..bcaa562dbe --- /dev/null +++ b/meta/recipes-qt/qt-apps/quicky_0.4.bb | |||
@@ -0,0 +1,19 @@ | |||
1 | SUMMARY = "A simple note-taking application with Wiki-style syntax and behaviour" | ||
2 | HOMEPAGE = "http://qt-apps.org/content/show.php/Quicky?content=80325" | ||
3 | LICENSE = "GPLv2+" | ||
4 | LIC_FILES_CHKSUM = "file://version.h;endline=19;md5=878bdaff438dab86298301fd1a210e14" | ||
5 | SECTION = "x11/apps" | ||
6 | |||
7 | PR = "r2" | ||
8 | |||
9 | SRC_URI = "http://qt-apps.org/CONTENT/content-files/80325-quicky-0.4.tar.gz" | ||
10 | |||
11 | SRC_URI[md5sum] = "824d9e477ee9c4994f73a3cb215161d9" | ||
12 | SRC_URI[sha256sum] = "9c66376e0035d44547612bf629890769a6178c3e7eafbcf95f1c6207ac0f352a" | ||
13 | |||
14 | inherit qt4x11 | ||
15 | |||
16 | do_install() { | ||
17 | install -d ${D}${bindir} | ||
18 | install -m 0755 ${S}/${BPN} ${D}${bindir} | ||
19 | } | ||
diff --git a/meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init b/meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init new file mode 100644 index 0000000000..3a1f2cb1b2 --- /dev/null +++ b/meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init | |||
@@ -0,0 +1,55 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e | ||
4 | |||
5 | if [ -f /usr/bin/qtdemo ]; then | ||
6 | QTDEMO="qtdemo > /var/log/Xsession.log 2> &1" | ||
7 | else | ||
8 | QTDEMO="qtdemoE -qws" | ||
9 | fi | ||
10 | |||
11 | case "$1" in | ||
12 | start) | ||
13 | echo "Starting qtdemo" | ||
14 | if [ -f /etc/profile.d/tslib.sh ]; then | ||
15 | . /etc/profile.d/tslib.sh | ||
16 | fi | ||
17 | if [ -e "$TSLIB_TSDEVICE" ]; then | ||
18 | if [ ! -f /etc/pointercal ]; then | ||
19 | /usr/bin/ts_calibrate | ||
20 | fi | ||
21 | if [ "$QTDEMO" = qtdemo ]; then | ||
22 | Xorg & | ||
23 | export DISPLAY=:0 | ||
24 | $QTDEMO & | ||
25 | else | ||
26 | QWS_MOUSE_PROTO=tslib:$TSLIB_TSDEVICE $QTDEMO & | ||
27 | fi | ||
28 | else | ||
29 | if [ "$QTDEMO" = qtdemo ]; then | ||
30 | Xorg & | ||
31 | export DISPLAY=:0 | ||
32 | fi | ||
33 | $QTDEMO & | ||
34 | fi | ||
35 | ;; | ||
36 | stop) | ||
37 | echo "Stopping qtdemo" | ||
38 | if [ "$QTDEMO" = qtdemo ]; then | ||
39 | killall Xorg | ||
40 | killall qtdemo | ||
41 | else | ||
42 | killall qtdemoE | ||
43 | fi | ||
44 | ;; | ||
45 | restart) | ||
46 | $0 stop | ||
47 | $0 start | ||
48 | ;; | ||
49 | *) | ||
50 | echo "usage: $0 { start | stop | restart }" >&2 | ||
51 | exit 1 | ||
52 | ;; | ||
53 | esac | ||
54 | |||
55 | exit 0 | ||
diff --git a/meta/recipes-qt/qt-demo/qt-demo-init_0.1.bb b/meta/recipes-qt/qt-demo/qt-demo-init_0.1.bb new file mode 100644 index 0000000000..fff3620b09 --- /dev/null +++ b/meta/recipes-qt/qt-demo/qt-demo-init_0.1.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | SUMMARY = "Init script for qtdemo" | ||
2 | LICENSE = "MIT" | ||
3 | SRC_URI = "file://qtdemo-init" | ||
4 | PR = "r3" | ||
5 | |||
6 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ | ||
7 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
8 | |||
9 | do_install() { | ||
10 | install -d ${D}${sysconfdir}/init.d/ | ||
11 | install -m 0755 ${WORKDIR}/qtdemo-init ${D}${sysconfdir}/init.d/qtdemo | ||
12 | } | ||
13 | |||
14 | inherit update-rc.d allarch | ||
15 | |||
16 | INITSCRIPT_NAME = "qtdemo" | ||
17 | INITSCRIPT_PARAMS = "start 99 5 2 . stop 19 0 1 6 ." | ||
diff --git a/meta/recipes-qt/qt4-graphics-system/qt4-graphics-system_1.0.bb b/meta/recipes-qt/qt4-graphics-system/qt4-graphics-system_1.0.bb new file mode 100644 index 0000000000..ff3f3da2bd --- /dev/null +++ b/meta/recipes-qt/qt4-graphics-system/qt4-graphics-system_1.0.bb | |||
@@ -0,0 +1,25 @@ | |||
1 | SUMMARY = "Sets default Qt4 Graphics System to ${QT_GRAPHICS_SYSTEM}" | ||
2 | SECTION = "x11/base" | ||
3 | LICENSE = "MIT-X" | ||
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
5 | |||
6 | PR = "r1" | ||
7 | |||
8 | QT_GRAPHICS_SYSTEM ?= "raster" | ||
9 | |||
10 | def _get_extra_rdepends(d): | ||
11 | gs = d.getVar('QT_GRAPHICS_SYSTEM', True) | ||
12 | if gs == "opengl": | ||
13 | return "qt4-plugin-graphicssystems-glgraphicssystem" | ||
14 | |||
15 | return "" | ||
16 | |||
17 | do_install () { | ||
18 | install -d ${D}/${sysconfdir}/profile.d/ | ||
19 | cfg_file=${D}/${sysconfdir}/profile.d/qt-graphicssystem | ||
20 | echo "export QT_GRAPHICSSYSTEM=${QT_GRAPHICS_SYSTEM}" > $cfg_file | ||
21 | } | ||
22 | |||
23 | RDEPENDS_${PN} = "${@_get_extra_rdepends(d)}" | ||
24 | |||
25 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
diff --git a/meta/recipes-qt/qt4/nativesdk-qt4-tools.inc b/meta/recipes-qt/qt4/nativesdk-qt4-tools.inc new file mode 100644 index 0000000000..1c9ee2e6ea --- /dev/null +++ b/meta/recipes-qt/qt4/nativesdk-qt4-tools.inc | |||
@@ -0,0 +1,127 @@ | |||
1 | SUMMARY = "SDK tools for Qt version 4.x" | ||
2 | DEPENDS = "nativesdk-zlib nativesdk-dbus nativesdk-libx11 qt4-native" | ||
3 | SECTION = "libs" | ||
4 | HOMEPAGE = "http://qt-project.org/" | ||
5 | LICENSE = "LGPLv2.1 | GPLv3" | ||
6 | |||
7 | INC_PR = "r13" | ||
8 | |||
9 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/qt4-${PV}:" | ||
10 | |||
11 | inherit nativesdk qmake2 | ||
12 | |||
13 | SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-everywhere-opensource-src-${PV}.tar.gz \ | ||
14 | file://0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \ | ||
15 | file://0004-configure-qmake-is-already-built-in-qt4-tools-native.patch \ | ||
16 | file://0005-configure-set-LFLAGS-to-pick-up-zlib-from-staging.patch \ | ||
17 | file://0006-configure-Use-OE_QMAKE_-values-to-specify-Qt-utility.patch \ | ||
18 | file://0007-dbus-Remove-const-usage-that-causes-compile-failure-.patch \ | ||
19 | file://0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch \ | ||
20 | file://g++.conf \ | ||
21 | file://linux.conf" | ||
22 | |||
23 | S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}" | ||
24 | |||
25 | LIC_FILES_CHKSUM = "file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24 \ | ||
26 | file://LICENSE.GPL3;md5=6e1694ee338db410417517884918d4d2 \ | ||
27 | file://LGPL_EXCEPTION.txt;md5=0145c4d1b6f96a661c2c139dfb268fb6" | ||
28 | |||
29 | require qt4_arch.inc | ||
30 | |||
31 | # FIXME: make it work with "${STAGING_BINDIR_NATIVE}/pkg-config --cflags dbus-1" | ||
32 | EXTRA_OECONF = "-prefix ${prefix} \ | ||
33 | -qt-libjpeg -system-zlib \ | ||
34 | -no-libjpeg -no-libpng -no-libmng -no-libtiff \ | ||
35 | -no-accessibility \ | ||
36 | -no-cups \ | ||
37 | -no-exceptions \ | ||
38 | -no-nas-sound \ | ||
39 | -no-nis -no-openssl \ | ||
40 | -verbose -release -fast -static \ | ||
41 | -platform ${TARGET_OS}-oe-g++ \ | ||
42 | -xplatform ${TARGET_OS}-oe-g++ \ | ||
43 | -arch ${QT_ARCH} \ | ||
44 | -embedded -no-freetype -no-glib -no-iconv \ | ||
45 | -qt3support \ | ||
46 | -I${STAGING_DIR_HOST}${SDKPATHNATIVE}/usr/include/dbus-1.0 \ | ||
47 | -I${STAGING_DIR_HOST}${SDKPATHNATIVE}/usr/lib/dbus-1.0/include" | ||
48 | |||
49 | # yank default -e, otherwise we get the following error: | ||
50 | # moc_qbuffer.cpp: No such file or directory | ||
51 | EXTRA_OEMAKE = " " | ||
52 | |||
53 | do_configure() { | ||
54 | # Avoid problems with Qt 4.8.0 configure setting QMAKE_LINK from LD (since we want the linker to be g++) | ||
55 | unset LD | ||
56 | |||
57 | if [ ! -e mkspecs/${TARGET_OS}-oe-g++ ]; then | ||
58 | ln -sf linux-g++ mkspecs/${TARGET_OS}-oe-g++ | ||
59 | fi | ||
60 | |||
61 | cp ../g++.conf mkspecs/common | ||
62 | cp ../linux.conf mkspecs/common | ||
63 | |||
64 | if [ -f mkspecs/common/g++-base.conf ] ; then | ||
65 | # don't use host g++ even during configure (4.8.0+) | ||
66 | sed -i -e "s#= g++#= ${CXX}#" mkspecs/common/g++-base.conf | ||
67 | sed -i -e "s#= gcc#= ${CC}#" mkspecs/common/g++-base.conf | ||
68 | fi | ||
69 | |||
70 | # Use qmake from qt4-native for building | ||
71 | if [ ! -e bin/qmake ]; then | ||
72 | ln -sf ${STAGING_BINDIR_NATIVE}/qmake2 bin/qmake | ||
73 | fi | ||
74 | set_arch | ||
75 | (echo o; echo yes) | CC="${CC}" CXX="${CXX}" ./configure ${EXTRA_OECONF} || die "Configuring qt failed. EXTRA_OECONF was ${EXTRA_OECONF}" | ||
76 | } | ||
77 | |||
78 | TOBUILD = "\ | ||
79 | src/tools/bootstrap \ | ||
80 | src/tools/moc \ | ||
81 | src/corelib \ | ||
82 | src/sql \ | ||
83 | src/dbus \ | ||
84 | src/qt3support \ | ||
85 | src/xml \ | ||
86 | src/tools/uic \ | ||
87 | src/tools/rcc \ | ||
88 | src/network \ | ||
89 | src/gui \ | ||
90 | src/tools/uic3 \ | ||
91 | tools/linguist/lrelease \ | ||
92 | tools/linguist/lupdate \ | ||
93 | tools/qdbus \ | ||
94 | " | ||
95 | |||
96 | do_compile() { | ||
97 | for i in ${TOBUILD}; do | ||
98 | cd ${S}/$i && oe_runmake CC="${CC}" CXX="${CXX}" | ||
99 | done | ||
100 | |||
101 | # Build nativesdk qmake | ||
102 | export QMAKESPEC="${S}/mkspecs/${TARGET_OS}-oe-g++" | ||
103 | cd ${S}/qmake | ||
104 | ${OE_QMAKE_QMAKE} | ||
105 | oe_runmake CC="${CC}" CXX="${CXX}" | ||
106 | cd ${S} | ||
107 | } | ||
108 | |||
109 | do_install() { | ||
110 | install -d ${D}${bindir} | ||
111 | install -m 0755 bin/qmake2 ${D}${bindir}/qmake2 | ||
112 | for i in moc uic uic3 rcc lrelease lupdate qdbuscpp2xml qdbusxml2cpp; do | ||
113 | install -m 0755 bin/${i} ${D}${bindir}/${i}4 | ||
114 | done | ||
115 | |||
116 | (cd ${D}${bindir}; \ | ||
117 | ln -s qmake2 qmake; \ | ||
118 | for i in moc uic uic3 rcc lrelease lupdate qdbuscpp2xml qdbusxml2cpp; do \ | ||
119 | ln -s ${i}4 ${i}; \ | ||
120 | done) | ||
121 | |||
122 | install -d ${D}${sysconfdir} | ||
123 | cat >${D}${sysconfdir}/qt.conf <<EOF | ||
124 | [Paths] | ||
125 | Prefix = ${prefix} | ||
126 | EOF | ||
127 | } | ||
diff --git a/meta/recipes-qt/qt4/nativesdk-qt4-tools_4.8.5.bb b/meta/recipes-qt/qt4/nativesdk-qt4-tools_4.8.5.bb new file mode 100644 index 0000000000..9e5743bb43 --- /dev/null +++ b/meta/recipes-qt/qt4/nativesdk-qt4-tools_4.8.5.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | require nativesdk-qt4-tools.inc | ||
2 | |||
3 | SRC_URI += "file://0009-qmake-fix-source-file-references-in-qmake.pri.patch" | ||
4 | |||
5 | SRC_URI[md5sum] = "1864987bdbb2f58f8ae8b350dfdbe133" | ||
6 | SRC_URI[sha256sum] = "eb728f8268831dc4373be6403b7dd5d5dde03c169ad6882f9a8cb560df6aa138" | ||
diff --git a/meta/recipes-qt/qt4/qt-mobility-1.2.0/0001-fix-embedded-usage-doesn-t-work-outside-of-Qt.patch b/meta/recipes-qt/qt4/qt-mobility-1.2.0/0001-fix-embedded-usage-doesn-t-work-outside-of-Qt.patch new file mode 100644 index 0000000000..d8d88c2cfc --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility-1.2.0/0001-fix-embedded-usage-doesn-t-work-outside-of-Qt.patch | |||
@@ -0,0 +1,73 @@ | |||
1 | From de2b568a4f14f38ae26960f543277bd2ac57c9d6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alex <qt-info@nokia.com> | ||
3 | Date: Tue, 10 May 2011 14:54:49 +1000 | ||
4 | Subject: [PATCH] fix !embedded usage (doesn't work outside of Qt) | ||
5 | |||
6 | embedded is part of QT_CONFIG and not CONFIG | ||
7 | |||
8 | Task-number: QTMOBILITY-1586 | ||
9 | --- | ||
10 | Upstream-Status: Backport | ||
11 | https://qt.gitorious.org/qt-mobility/qt-mobility/commit/de2b568a4f14f38ae26960f543277bd2ac57c9d6 | ||
12 | EB: refreshed the patch for it to apply properly | ||
13 | |||
14 | plugins/multimedia/gstreamer/gstreamer.pro | 2 +- | ||
15 | src/systeminfo/systeminfo.pro | 6 +++--- | ||
16 | tests/auto/auto.pro | 2 +- | ||
17 | 3 files changed, 5 insertions(+), 5 deletions(-) | ||
18 | |||
19 | Index: qt-mobility-opensource-src-1.2.0/plugins/multimedia/gstreamer/gstreamer.pro | ||
20 | =================================================================== | ||
21 | --- qt-mobility-opensource-src-1.2.0.orig/plugins/multimedia/gstreamer/gstreamer.pro 2013-09-19 10:34:40.880862884 +0200 | ||
22 | +++ qt-mobility-opensource-src-1.2.0/plugins/multimedia/gstreamer/gstreamer.pro 2013-09-19 10:35:22.844862550 +0200 | ||
23 | @@ -85,7 +85,7 @@ | ||
24 | qgstutils.cpp | ||
25 | |||
26 | |||
27 | -!win32:!embedded:!mac:!symbian:!simulator:!contains(QT_CONFIG, qpa) { | ||
28 | +!win32:!contains(QT_CONFIG,embedded):!mac:!symbian:!simulator:!contains(QT_CONFIG, qpa) { | ||
29 | LIBS += -lXv -lX11 -lXext | ||
30 | |||
31 | HEADERS += \ | ||
32 | Index: qt-mobility-opensource-src-1.2.0/src/systeminfo/systeminfo.pro | ||
33 | =================================================================== | ||
34 | --- qt-mobility-opensource-src-1.2.0.orig/src/systeminfo/systeminfo.pro 2013-09-19 10:34:40.884862884 +0200 | ||
35 | +++ qt-mobility-opensource-src-1.2.0/src/systeminfo/systeminfo.pro 2013-09-19 10:36:05.480862210 +0200 | ||
36 | @@ -101,7 +101,7 @@ | ||
37 | LIBS += -lblkid | ||
38 | } | ||
39 | |||
40 | - !embedded:!contains(QT_CONFIG,qpa): { | ||
41 | + !contains(QT_CONFIG,embedded):!contains(QT_CONFIG,qpa): { | ||
42 | LIBS += -lX11 -lXrandr | ||
43 | } | ||
44 | |||
45 | @@ -154,7 +154,7 @@ | ||
46 | #for now... udisks | ||
47 | } else { | ||
48 | DEFINES += QT_NO_UDISKS | ||
49 | - !embedded:!contains(QT_CONFIG,qpa): LIBS += -lX11 -lXrandr | ||
50 | + !contains(QT_CONFIG,embedded):!contains(QT_CONFIG,qpa): LIBS += -lX11 -lXrandr | ||
51 | } | ||
52 | |||
53 | contains(connman_enabled, yes): { | ||
54 | @@ -165,7 +165,7 @@ | ||
55 | } | ||
56 | } else { | ||
57 | DEFINES += QT_NO_NETWORKMANAGER QT_NO_UDISKS QT_NO_CONNMAN | ||
58 | - !embedded:!contains(QT_CONFIG,qpa): LIBS += -lX11 -lXrandr | ||
59 | + !contains(QT_CONFIG,embedded):!contains(QT_CONFIG,qpa): LIBS += -lX11 -lXrandr | ||
60 | } | ||
61 | } | ||
62 | |||
63 | Index: qt-mobility-opensource-src-1.2.0/tests/auto/auto.pro | ||
64 | =================================================================== | ||
65 | --- qt-mobility-opensource-src-1.2.0.orig/tests/auto/auto.pro 2013-09-19 10:34:40.884862884 +0200 | ||
66 | +++ qt-mobility-opensource-src-1.2.0/tests/auto/auto.pro 2013-09-19 10:35:22.844862550 +0200 | ||
67 | @@ -21,5 +21,5 @@ | ||
68 | # which require that the autotest is run on the same machine | ||
69 | # doing the build - i.e. cross-compilation is not allowed. | ||
70 | win32|mac|linux-g++* { | ||
71 | - !embedded:!maemo5:!maemo6:SUBDIRS+=host.pro | ||
72 | + !contains(QT_CONFIG,embedded):!maemo5:!maemo6:SUBDIRS+=host.pro | ||
73 | } | ||
diff --git a/meta/recipes-qt/qt4/qt-mobility-1.2.0/0001-gstvideoconnector-fixed-buffers-allocation.patch b/meta/recipes-qt/qt4/qt-mobility-1.2.0/0001-gstvideoconnector-fixed-buffers-allocation.patch new file mode 100644 index 0000000000..2df76fc778 --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility-1.2.0/0001-gstvideoconnector-fixed-buffers-allocation.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | Upstream-Status: Submitted [QTMOBILITY-1611] | ||
2 | |||
3 | From b308508b49afa9a129b4e4589c57cd107d1320b8 Mon Sep 17 00:00:00 2001 | ||
4 | From: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> | ||
5 | Date: Fri, 6 May 2011 10:35:11 +1000 | ||
6 | Subject: [PATCH] gstvideoconnector: fixed buffers allocation | ||
7 | |||
8 | It should not be necessary, but at least theora video decoder doesn't | ||
9 | iniatilize *buf, while gst_pad_alloc_buffer relies on buf being NULL. | ||
10 | |||
11 | Task-number: QTMOBILITY-1611 | ||
12 | Reviewed-by: Michael Goddard | ||
13 | --- | ||
14 | plugins/multimedia/gstreamer/gstvideoconnector.c | 4 ++++ | ||
15 | 1 files changed, 4 insertions(+), 0 deletions(-) | ||
16 | |||
17 | diff --git a/plugins/multimedia/gstreamer/gstvideoconnector.c b/plugins/multimedia/gstreamer/gstvideoconnector.c | ||
18 | index ddf68e0..9f8ceae 100644 | ||
19 | --- a/plugins/multimedia/gstreamer/gstvideoconnector.c | ||
20 | +++ b/plugins/multimedia/gstreamer/gstvideoconnector.c | ||
21 | @@ -186,6 +186,10 @@ gst_video_connector_buffer_alloc (GstPad * pad, guint64 offset, guint size, | ||
22 | GstFlowReturn res = GST_FLOW_OK; | ||
23 | element = GST_VIDEO_CONNECTOR (GST_PAD_PARENT (pad)); | ||
24 | |||
25 | + if (!buf) | ||
26 | + return GST_FLOW_ERROR; | ||
27 | + *buf = NULL; | ||
28 | + | ||
29 | GST_OBJECT_LOCK (element); | ||
30 | gst_object_ref(element->srcpad); | ||
31 | GST_OBJECT_UNLOCK (element); | ||
32 | -- | ||
33 | 1.7.4.1 | ||
34 | |||
diff --git a/meta/recipes-qt/qt4/qt-mobility-1.2.0/0002-Remove-unnecessary-rpaths-from-qml_device-example.patch b/meta/recipes-qt/qt4/qt-mobility-1.2.0/0002-Remove-unnecessary-rpaths-from-qml_device-example.patch new file mode 100644 index 0000000000..a411640b73 --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility-1.2.0/0002-Remove-unnecessary-rpaths-from-qml_device-example.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 92e0c611f4969c716616d64df64831387e5b1632 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Fri, 16 Mar 2012 10:24:00 +0000 | ||
4 | Subject: [PATCH] Remove unnecessary rpaths from qml_device example | ||
5 | |||
6 | These can't be valid in any case. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
11 | --- | ||
12 | examples/declarative-systeminfo/device/device.pro | 3 --- | ||
13 | 1 files changed, 0 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/examples/declarative-systeminfo/device/device.pro b/examples/declarative-systeminfo/device/device.pro | ||
16 | index 698e5fb..05be9b7 100644 | ||
17 | --- a/examples/declarative-systeminfo/device/device.pro | ||
18 | +++ b/examples/declarative-systeminfo/device/device.pro | ||
19 | @@ -17,6 +17,3 @@ symbian { | ||
20 | } | ||
21 | RESOURCES += device.qrc | ||
22 | |||
23 | -QMAKE_LFLAGS_DEBUG += "-Wl,-rpath,/home/user/qt/lib" | ||
24 | -QMAKE_LFLAGS_RPATH += "-Wl,-rpath,/home/user/qt/lib" | ||
25 | -QMAKE_LFLAGS_RELEASE += "-Wl,-rpath,/home/user/qt/lib" | ||
26 | -- | ||
27 | 1.7.5.4 | ||
28 | |||
diff --git a/meta/recipes-qt/qt4/qt-mobility-1.2.0/fix_metaobjectbuilder_build_err.patch b/meta/recipes-qt/qt4/qt-mobility-1.2.0/fix_metaobjectbuilder_build_err.patch new file mode 100644 index 0000000000..cffb06706f --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility-1.2.0/fix_metaobjectbuilder_build_err.patch | |||
@@ -0,0 +1,4707 @@ | |||
1 | Fix metaobjectbuilder build errors against Qt 4.8 and 4.7 | ||
2 | |||
3 | Error message: | ||
4 | ipc/qmetaobjectbuilder.cpp:803:65: error: invalid conversion from \ | ||
5 | 'QMetaObjectExtraData::StaticMetacallFunction {aka void (*)(QObject*, \ | ||
6 | QMetaObject::Call, int, void**)}' to 'QtMobility::QMetaObjectBuilder:: \ | ||
7 | StaticMetacallFunction {aka int (*)(QMetaObject::Call, int, void**)} | ||
8 | |||
9 | Upstream-commit: | ||
10 | http://qt.gitorious.org/qt-mobility/qt-mobility/commit/f102053b28009b3094b0e5777177208afa6097c5 | ||
11 | |||
12 | Task-number: QTMOBILITY-1990 | ||
13 | |||
14 | Upstream-Status: Backport | ||
15 | |||
16 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | ||
17 | ------------------------------------------------------ | ||
18 | diff --git a/plugins/declarative/common/dynamicproperties.pri b/plugins/declarative/common/dynamicproperties.pri | ||
19 | index 52737a3..4bd06de 100644 | ||
20 | --- a/plugins/declarative/common/dynamicproperties.pri | ||
21 | +++ b/plugins/declarative/common/dynamicproperties.pri | ||
22 | @@ -1,6 +1,8 @@ | ||
23 | INCLUDEPATH += ../../../plugins/declarative/common/dynamicproperties/ | ||
24 | -HEADERS += ../../../plugins/declarative/common/dynamicproperties/qdeclarativeopenmetaobject_p.h \ | ||
25 | - ../../../plugins/declarative/common/dynamicproperties/qmetaobjectbuilder_p.h | ||
26 | -SOURCES += ../../../plugins/declarative/common/dynamicproperties/qdeclarativeopenmetaobject.cpp \ | ||
27 | - ../../../src/serviceframework/ipc/qmetaobjectbuilder.cpp | ||
28 | - | ||
29 | +HEADERS += ../../../plugins/declarative/common/dynamicproperties/qdeclarativeopenmetaobject_p.h | ||
30 | +SOURCES += ../../../plugins/declarative/common/dynamicproperties/qdeclarativeopenmetaobject.cpp | ||
31 | +include(../../../src/serviceframework/ipc/metaobjectbuilder.pri) | ||
32 | +INCLUDEPATH += ../../../src/serviceframework/$$OBJECTBUILDER_INCLUDEPATH | ||
33 | +DEPENDPATH += ../../../src/serviceframework/$$OBJECTBUILDER_DEPENDPATH | ||
34 | +HEADERS += ../../../src/serviceframework/$$OBJECTBUILDER_HEADERS | ||
35 | +SOURCES += ../../../src/serviceframework/$$OBJECTBUILDER_SOURCES | ||
36 | diff --git a/plugins/declarative/common/dynamicproperties/qdeclarativeopenmetaobject.cpp b/plugins/declarative/common/dynamicproperties/qdeclarativeopenmetaobject.cpp | ||
37 | index 79a2064..9eb6810 100644 | ||
38 | --- a/plugins/declarative/common/dynamicproperties/qdeclarativeopenmetaobject.cpp | ||
39 | +++ b/plugins/declarative/common/dynamicproperties/qdeclarativeopenmetaobject.cpp | ||
40 | @@ -65,8 +65,7 @@ public: | ||
41 | { | ||
42 | int id = mob.propertyCount(); | ||
43 | mob.addSignal("__" + QByteArray::number(id) + "()"); | ||
44 | - QMetaPropertyBuilder build = mob.addProperty(name, type, id); | ||
45 | - build.setDynamic(true); | ||
46 | + mob.addProperty(name, type, id); | ||
47 | qFree(mem); | ||
48 | mem = mob.toMetaObject(); | ||
49 | |||
50 | diff --git a/plugins/declarative/common/dynamicproperties/qmetaobjectbuilder_p.h b/plugins/declarative/common/dynamicproperties/qmetaobjectbuilder_p.h | ||
51 | deleted file mode 100644 | ||
52 | index bd937e4..0000000 | ||
53 | --- a/plugins/declarative/common/dynamicproperties/qmetaobjectbuilder_p.h | ||
54 | +++ /dev/null | ||
55 | @@ -1,48 +0,0 @@ | ||
56 | -/**************************************************************************** | ||
57 | -** | ||
58 | -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | ||
59 | -** All rights reserved. | ||
60 | -** Contact: Nokia Corporation (qt-info@nokia.com) | ||
61 | -** | ||
62 | -** This file is part of the Qt Mobility Components. | ||
63 | -** | ||
64 | -** $QT_BEGIN_LICENSE:LGPL$ | ||
65 | -** No Commercial Usage | ||
66 | -** This file contains pre-release code and may not be distributed. | ||
67 | -** You may use this file in accordance with the terms and conditions | ||
68 | -** contained in the Technology Preview License Agreement accompanying | ||
69 | -** this package. | ||
70 | -** | ||
71 | -** GNU Lesser General Public License Usage | ||
72 | -** Alternatively, this file may be used under the terms of the GNU Lesser | ||
73 | -** General Public License version 2.1 as published by the Free Software | ||
74 | -** Foundation and appearing in the file LICENSE.LGPL included in the | ||
75 | -** packaging of this file. Please review the following information to | ||
76 | -** ensure the GNU Lesser General Public License version 2.1 requirements | ||
77 | -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
78 | -** | ||
79 | -** In addition, as a special exception, Nokia gives you certain additional | ||
80 | -** rights. These rights are described in the Nokia Qt LGPL Exception | ||
81 | -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
82 | -** | ||
83 | -** If you have questions regarding the use of this file, please contact | ||
84 | -** Nokia at qt-info@nokia.com. | ||
85 | -** | ||
86 | -** | ||
87 | -** | ||
88 | -** | ||
89 | -** | ||
90 | -** | ||
91 | -** | ||
92 | -** | ||
93 | -** $QT_END_LICENSE$ | ||
94 | -** | ||
95 | -****************************************************************************/ | ||
96 | - | ||
97 | -/* | ||
98 | -This header gets used in a number of different QML plugins | ||
99 | -and also in the source tree of Mobility itself. | ||
100 | - | ||
101 | -So this header is just a wrapper to grab it from there. | ||
102 | -*/ | ||
103 | -#include "../../../../src/serviceframework/ipc/qmetaobjectbuilder_p.h" | ||
104 | diff --git a/src/serviceframework/ipc/ipc.pri b/src/serviceframework/ipc/ipc.pri | ||
105 | index 28b910f..d809f59 100644 | ||
106 | --- a/src/serviceframework/ipc/ipc.pri | ||
107 | +++ b/src/serviceframework/ipc/ipc.pri | ||
108 | @@ -25,9 +25,14 @@ else { | ||
109 | } | ||
110 | } | ||
111 | |||
112 | +include(metaobjectbuilder.pri) | ||
113 | +INCLUDEPATH += $$OBJECTBUILDER_INCLUDEPATH | ||
114 | +DEPENDPATH += $$OBJECTBUILDER_DEPENDPATH | ||
115 | +PRIVATE_HEADERS += $$OBJECTBUILDER_HEADERS | ||
116 | +SOURCES += $$OBJECTBUILDER_SOURCES | ||
117 | + | ||
118 | PRIVATE_HEADERS += ipc/qslotinvoker_p.h \ | ||
119 | ipc/qsignalintercepter_p.h \ | ||
120 | - ipc/qmetaobjectbuilder_p.h \ | ||
121 | ipc/instancemanager_p.h \ | ||
122 | ipc/qservicepackage_p.h \ | ||
123 | ipc/proxyobject_p.h \ | ||
124 | @@ -37,7 +42,6 @@ PRIVATE_HEADERS += ipc/qslotinvoker_p.h \ | ||
125 | |||
126 | SOURCES += ipc/qslotinvoker.cpp \ | ||
127 | ipc/qsignalintercepter.cpp \ | ||
128 | - ipc/qmetaobjectbuilder.cpp \ | ||
129 | ipc/instancemanager.cpp \ | ||
130 | ipc/qservicepackage.cpp \ | ||
131 | ipc/proxyobject.cpp \ | ||
132 | diff --git a/src/serviceframework/ipc/metaobjectbuilder.pri b/src/serviceframework/ipc/metaobjectbuilder.pri | ||
133 | new file mode 100644 | ||
134 | index 0000000..cc905f9 | ||
135 | --- /dev/null | ||
136 | +++ b/src/serviceframework/ipc/metaobjectbuilder.pri | ||
137 | @@ -0,0 +1,12 @@ | ||
138 | +#check version for 4.7 ... | ||
139 | +contains(QT_MAJOR_VERSION, 4):lessThan(QT_MINOR_VERSION, 8) { | ||
140 | + OBJECTBUILDER_INCLUDEPATH += ipc | ||
141 | + OBJECTBUILDER_DEPENDPATH += ipc | ||
142 | + OBJECTBUILDER_HEADERS += ipc/qmetaobjectbuilder_47_p.h | ||
143 | + OBJECTBUILDER_SOURCES += ipc/qmetaobjectbuilder_47.cpp | ||
144 | +} else { | ||
145 | + OBJECTBUILDER_INCLUDEPATH += ipc | ||
146 | + OBJECTBUILDER_DEPENDPATH += ipc | ||
147 | + OBJECTBUILDER_HEADERS += ipc/qmetaobjectbuilder_p.h | ||
148 | + OBJECTBUILDER_SOURCES += ipc/qmetaobjectbuilder.cpp | ||
149 | +} | ||
150 | diff --git a/src/serviceframework/ipc/qmetaobjectbuilder.cpp b/src/serviceframework/ipc/qmetaobjectbuilder.cpp | ||
151 | index b19eb1a..6ffaa20 100644 | ||
152 | --- a/src/serviceframework/ipc/qmetaobjectbuilder.cpp | ||
153 | +++ b/src/serviceframework/ipc/qmetaobjectbuilder.cpp | ||
154 | @@ -117,6 +117,8 @@ enum PropertyFlags { | ||
155 | EnumOrFlag = 0x00000008, | ||
156 | StdCppSet = 0x00000100, | ||
157 | // Override = 0x00000200, | ||
158 | + Constant = 0x00000400, | ||
159 | + Final = 0x00000800, | ||
160 | Designable = 0x00001000, | ||
161 | ResolveDesignable = 0x00002000, | ||
162 | Scriptable = 0x00004000, | ||
163 | @@ -128,7 +130,7 @@ enum PropertyFlags { | ||
164 | User = 0x00100000, | ||
165 | ResolveUser = 0x00200000, | ||
166 | Notify = 0x00400000, | ||
167 | - Dynamic = 0x00800000 | ||
168 | + Revisioned = 0x00800000 | ||
169 | }; | ||
170 | |||
171 | enum MethodFlags { | ||
172 | @@ -145,7 +147,8 @@ enum MethodFlags { | ||
173 | |||
174 | MethodCompatibility = 0x10, | ||
175 | MethodCloned = 0x20, | ||
176 | - MethodScriptable = 0x40 | ||
177 | + MethodScriptable = 0x40, | ||
178 | + MethodRevisioned = 0x80 | ||
179 | }; | ||
180 | |||
181 | struct QMetaObjectPrivate | ||
182 | @@ -623,6 +626,8 @@ QMetaPropertyBuilder QMetaObjectBuilder::addProperty(const QMetaProperty& protot | ||
183 | property.setUser(prototype.isUser()); | ||
184 | property.setStdCppSet(prototype.hasStdCppSet()); | ||
185 | property.setEnumOrFlag(prototype.isEnumType()); | ||
186 | + property.setConstant(prototype.isConstant()); | ||
187 | + property.setFinal(prototype.isFinal()); | ||
188 | if (prototype.hasNotifySignal()) { | ||
189 | // Find an existing method for the notify signal, or add a new one. | ||
190 | QMetaMethod method = prototype.notifySignal(); | ||
191 | @@ -796,7 +801,7 @@ void QMetaObjectBuilder::addMetaObject | ||
192 | } | ||
193 | |||
194 | if ((members & StaticMetacall) != 0) { | ||
195 | - if (priv(prototype->d.data)->revision >= 2) { | ||
196 | + if (priv(prototype->d.data)->revision >= 6) { | ||
197 | const QMetaObjectExtraData *extra = | ||
198 | (const QMetaObjectExtraData *)(prototype->d.extradata); | ||
199 | if (extra && extra->static_metacall) | ||
200 | @@ -1266,8 +1271,8 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf, | ||
201 | char *str = reinterpret_cast<char *>(buf + size); | ||
202 | if (buf) { | ||
203 | if (relocatable) { | ||
204 | - meta->d.stringdata = reinterpret_cast<const char *>((intptr_t)size); | ||
205 | - meta->d.data = reinterpret_cast<uint *>((intptr_t)pmetaSize); | ||
206 | + meta->d.stringdata = reinterpret_cast<const char *>((quintptr)size); | ||
207 | + meta->d.data = reinterpret_cast<uint *>((quintptr)pmetaSize); | ||
208 | } else { | ||
209 | meta->d.stringdata = str; | ||
210 | meta->d.data = reinterpret_cast<uint *>(data); | ||
211 | @@ -1504,8 +1509,8 @@ void QMetaObjectBuilder::fromRelocatableData(QMetaObject *output, | ||
212 | const char *buf = data.constData(); | ||
213 | const QMetaObject *dataMo = reinterpret_cast<const QMetaObject *>(buf); | ||
214 | |||
215 | - intptr_t stringdataOffset = (intptr_t)dataMo->d.stringdata; | ||
216 | - intptr_t dataOffset = (intptr_t)dataMo->d.data; | ||
217 | + quintptr stringdataOffset = (quintptr)dataMo->d.stringdata; | ||
218 | + quintptr dataOffset = (quintptr)dataMo->d.data; | ||
219 | |||
220 | output->d.superdata = superclass; | ||
221 | output->d.stringdata = buf + stringdataOffset; | ||
222 | @@ -2289,16 +2294,27 @@ bool QMetaPropertyBuilder::isEnumOrFlag() const | ||
223 | } | ||
224 | |||
225 | /*! | ||
226 | - Returns true if the property has the dynamic flag set; | ||
227 | - otherwise returns false. The default value is false. | ||
228 | + Returns true if the property is constant; otherwise returns false. | ||
229 | + The default value is false. | ||
230 | +*/ | ||
231 | +bool QMetaPropertyBuilder::isConstant() const | ||
232 | +{ | ||
233 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
234 | + if (d) | ||
235 | + return d->flag(Constant); | ||
236 | + else | ||
237 | + return false; | ||
238 | +} | ||
239 | |||
240 | - \sa setDynamic() | ||
241 | +/*! | ||
242 | + Returns true if the property is final; otherwise returns false. | ||
243 | + The default value is false. | ||
244 | */ | ||
245 | -bool QMetaPropertyBuilder::isDynamic() const | ||
246 | +bool QMetaPropertyBuilder::isFinal() const | ||
247 | { | ||
248 | QMetaPropertyBuilderPrivate *d = d_func(); | ||
249 | if (d) | ||
250 | - return d->flag(Dynamic); | ||
251 | + return d->flag(Final); | ||
252 | else | ||
253 | return false; | ||
254 | } | ||
255 | @@ -2427,16 +2443,27 @@ void QMetaPropertyBuilder::setEnumOrFlag(bool value) | ||
256 | } | ||
257 | |||
258 | /*! | ||
259 | - Sets this property to have the dynamic flag if \a value is | ||
260 | - true. | ||
261 | + Sets the \c CONSTANT flag on this property to \a value. | ||
262 | + | ||
263 | + \sa isConstant() | ||
264 | +*/ | ||
265 | +void QMetaPropertyBuilder::setConstant(bool value) | ||
266 | +{ | ||
267 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
268 | + if (d) | ||
269 | + d->setFlag(Constant, value); | ||
270 | +} | ||
271 | + | ||
272 | +/*! | ||
273 | + Sets the \c FINAL flag on this property to \a value. | ||
274 | |||
275 | - \sa isDynamic() | ||
276 | + \sa isFinal() | ||
277 | */ | ||
278 | -void QMetaPropertyBuilder::setDynamic(bool value) | ||
279 | +void QMetaPropertyBuilder::setFinal(bool value) | ||
280 | { | ||
281 | QMetaPropertyBuilderPrivate *d = d_func(); | ||
282 | if (d) | ||
283 | - d->setFlag(Dynamic, value); | ||
284 | + d->setFlag(Final, value); | ||
285 | } | ||
286 | |||
287 | /*! | ||
288 | diff --git a/src/serviceframework/ipc/qmetaobjectbuilder_47.cpp b/src/serviceframework/ipc/qmetaobjectbuilder_47.cpp | ||
289 | new file mode 100644 | ||
290 | index 0000000..509d6c6 | ||
291 | --- /dev/null | ||
292 | +++ b/src/serviceframework/ipc/qmetaobjectbuilder_47.cpp | ||
293 | @@ -0,0 +1,2583 @@ | ||
294 | +/**************************************************************************** | ||
295 | +** | ||
296 | +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | ||
297 | +** All rights reserved. | ||
298 | +** Contact: Nokia Corporation (qt-info@nokia.com) | ||
299 | +** | ||
300 | +** This file is part of the QtDeclarative module of the Qt Toolkit. | ||
301 | +** | ||
302 | +** $QT_BEGIN_LICENSE:LGPL$ | ||
303 | +** No Commercial Usage | ||
304 | +** This file contains pre-release code and may not be distributed. | ||
305 | +** You may use this file in accordance with the terms and conditions | ||
306 | +** contained in the Technology Preview License Agreement accompanying | ||
307 | +** this package. | ||
308 | +** | ||
309 | +** GNU Lesser General Public License Usage | ||
310 | +** Alternatively, this file may be used under the terms of the GNU Lesser | ||
311 | +** General Public License version 2.1 as published by the Free Software | ||
312 | +** Foundation and appearing in the file LICENSE.LGPL included in the | ||
313 | +** packaging of this file. Please review the following information to | ||
314 | +** ensure the GNU Lesser General Public License version 2.1 requirements | ||
315 | +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
316 | +** | ||
317 | +** In addition, as a special exception, Nokia gives you certain additional | ||
318 | +** rights. These rights are described in the Nokia Qt LGPL Exception | ||
319 | +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
320 | +** | ||
321 | +** If you have questions regarding the use of this file, please contact | ||
322 | +** Nokia at qt-info@nokia.com. | ||
323 | +** | ||
324 | +** | ||
325 | +** | ||
326 | +** | ||
327 | +** | ||
328 | +** | ||
329 | +** | ||
330 | +** | ||
331 | +** $QT_END_LICENSE$ | ||
332 | +** | ||
333 | +****************************************************************************/ | ||
334 | + | ||
335 | +#include "qmetaobjectbuilder_47_p.h" | ||
336 | +#include <QDebug> | ||
337 | + | ||
338 | +#ifndef Q_OS_WIN | ||
339 | +#include <stdint.h> | ||
340 | +#endif | ||
341 | + | ||
342 | +QTM_BEGIN_NAMESPACE | ||
343 | + | ||
344 | +/*! | ||
345 | + \class QMetaObjectBuilder | ||
346 | + \internal | ||
347 | + \brief The QMetaObjectBuilder class supports building QMetaObject objects at runtime. | ||
348 | + \since 1.1 | ||
349 | + | ||
350 | +*/ | ||
351 | + | ||
352 | +/*! | ||
353 | + \enum QMetaObjectBuilder::AddMember | ||
354 | + This enum defines which members of QMetaObject should be copied by QMetaObjectBuilder::addMetaObject() | ||
355 | + | ||
356 | + \value ClassName Add the class name. | ||
357 | + \value SuperClass Add the super class. | ||
358 | + \value Methods Add methods that aren't signals or slots. | ||
359 | + \value Signals Add signals. | ||
360 | + \value Slots Add slots. | ||
361 | + \value Constructors Add constructors. | ||
362 | + \value Properties Add properties. | ||
363 | + \value Enumerators Add enumerators. | ||
364 | + \value ClassInfos Add items of class information. | ||
365 | + \value RelatedMetaObjects Add related meta objects. | ||
366 | + \value StaticMetacall Add the static metacall function. | ||
367 | + \value PublicMethods Add public methods (ignored for signals). | ||
368 | + \value ProtectedMethods Add protected methods (ignored for signals). | ||
369 | + \value PrivateMethods All private methods (ignored for signals). | ||
370 | + \value AllMembers Add all members. | ||
371 | + \value AllPrimaryMembers Add everything except the class name, super class, and static metacall function. | ||
372 | +*/ | ||
373 | + | ||
374 | +// copied from moc's generator.cpp | ||
375 | +uint qvariant_nameToType(const char* name) | ||
376 | +{ | ||
377 | + if (!name) | ||
378 | + return 0; | ||
379 | + | ||
380 | + if (strcmp(name, "QVariant") == 0) | ||
381 | + return 0xffffffff; | ||
382 | + if (strcmp(name, "QCString") == 0) | ||
383 | + return QMetaType::QByteArray; | ||
384 | + if (strcmp(name, "Q_LLONG") == 0) | ||
385 | + return QMetaType::LongLong; | ||
386 | + if (strcmp(name, "Q_ULLONG") == 0) | ||
387 | + return QMetaType::ULongLong; | ||
388 | + if (strcmp(name, "QIconSet") == 0) | ||
389 | + return QMetaType::QIcon; | ||
390 | + | ||
391 | + uint tp = QMetaType::type(name); | ||
392 | + return tp < QMetaType::User ? tp : 0; | ||
393 | +} | ||
394 | + | ||
395 | +/* | ||
396 | + Returns true if the type is a QVariant types. | ||
397 | +*/ | ||
398 | +bool isVariantType(const char* type) | ||
399 | +{ | ||
400 | + return qvariant_nameToType(type) != 0; | ||
401 | +} | ||
402 | + | ||
403 | +// copied from qmetaobject.cpp | ||
404 | +// do not touch without touching the moc as well | ||
405 | +enum PropertyFlags { | ||
406 | + Invalid = 0x00000000, | ||
407 | + Readable = 0x00000001, | ||
408 | + Writable = 0x00000002, | ||
409 | + Resettable = 0x00000004, | ||
410 | + EnumOrFlag = 0x00000008, | ||
411 | + StdCppSet = 0x00000100, | ||
412 | +// Override = 0x00000200, | ||
413 | + Designable = 0x00001000, | ||
414 | + ResolveDesignable = 0x00002000, | ||
415 | + Scriptable = 0x00004000, | ||
416 | + ResolveScriptable = 0x00008000, | ||
417 | + Stored = 0x00010000, | ||
418 | + ResolveStored = 0x00020000, | ||
419 | + Editable = 0x00040000, | ||
420 | + ResolveEditable = 0x00080000, | ||
421 | + User = 0x00100000, | ||
422 | + ResolveUser = 0x00200000, | ||
423 | + Notify = 0x00400000, | ||
424 | + Dynamic = 0x00800000 | ||
425 | +}; | ||
426 | + | ||
427 | +enum MethodFlags { | ||
428 | + AccessPrivate = 0x00, | ||
429 | + AccessProtected = 0x01, | ||
430 | + AccessPublic = 0x02, | ||
431 | + AccessMask = 0x03, //mask | ||
432 | + | ||
433 | + MethodMethod = 0x00, | ||
434 | + MethodSignal = 0x04, | ||
435 | + MethodSlot = 0x08, | ||
436 | + MethodConstructor = 0x0c, | ||
437 | + MethodTypeMask = 0x0c, | ||
438 | + | ||
439 | + MethodCompatibility = 0x10, | ||
440 | + MethodCloned = 0x20, | ||
441 | + MethodScriptable = 0x40 | ||
442 | +}; | ||
443 | + | ||
444 | +struct QMetaObjectPrivate | ||
445 | +{ | ||
446 | + int revision; | ||
447 | + int className; | ||
448 | + int classInfoCount, classInfoData; | ||
449 | + int methodCount, methodData; | ||
450 | + int propertyCount, propertyData; | ||
451 | + int enumeratorCount, enumeratorData; | ||
452 | + int constructorCount, constructorData; | ||
453 | + int flags; | ||
454 | +}; | ||
455 | + | ||
456 | +static inline const QMetaObjectPrivate *priv(const uint* data) | ||
457 | +{ return reinterpret_cast<const QMetaObjectPrivate*>(data); } | ||
458 | +// end of copied lines from qmetaobject.cpp | ||
459 | + | ||
460 | +class QMetaMethodBuilderPrivate | ||
461 | +{ | ||
462 | +public: | ||
463 | + QMetaMethodBuilderPrivate | ||
464 | + (QMetaMethod::MethodType _methodType, | ||
465 | + const QByteArray& _signature, | ||
466 | + const QByteArray& _returnType = QByteArray(), | ||
467 | + QMetaMethod::Access _access = QMetaMethod::Public) | ||
468 | + : signature(QMetaObject::normalizedSignature(_signature.constData())), | ||
469 | + returnType(QMetaObject::normalizedType(_returnType)), | ||
470 | + attributes(((int)_access) | (((int)_methodType) << 2)) | ||
471 | + { | ||
472 | + } | ||
473 | + | ||
474 | + QByteArray signature; | ||
475 | + QByteArray returnType; | ||
476 | + QList<QByteArray> parameterNames; | ||
477 | + QByteArray tag; | ||
478 | + int attributes; | ||
479 | + | ||
480 | + QMetaMethod::MethodType methodType() const | ||
481 | + { | ||
482 | + return (QMetaMethod::MethodType)((attributes & MethodTypeMask) >> 2); | ||
483 | + } | ||
484 | + | ||
485 | + QMetaMethod::Access access() const | ||
486 | + { | ||
487 | + return (QMetaMethod::Access)(attributes & AccessMask); | ||
488 | + } | ||
489 | + | ||
490 | + void setAccess(QMetaMethod::Access value) | ||
491 | + { | ||
492 | + attributes = ((attributes & ~AccessMask) | (int)value); | ||
493 | + } | ||
494 | +}; | ||
495 | + | ||
496 | +class QMetaPropertyBuilderPrivate | ||
497 | +{ | ||
498 | +public: | ||
499 | + QMetaPropertyBuilderPrivate | ||
500 | + (const QByteArray& _name, const QByteArray& _type, int notifierIdx=-1) | ||
501 | + : name(_name), | ||
502 | + type(QMetaObject::normalizedType(_type.constData())), | ||
503 | + flags(Readable | Writable | Scriptable), notifySignal(-1) | ||
504 | + { | ||
505 | + if (notifierIdx >= 0) { | ||
506 | + flags |= Notify; | ||
507 | + notifySignal = notifierIdx; | ||
508 | + } | ||
509 | + } | ||
510 | + | ||
511 | + QByteArray name; | ||
512 | + QByteArray type; | ||
513 | + int flags; | ||
514 | + int notifySignal; | ||
515 | + | ||
516 | + bool flag(int f) const | ||
517 | + { | ||
518 | + return ((flags & f) != 0); | ||
519 | + } | ||
520 | + | ||
521 | + void setFlag(int f, bool value) | ||
522 | + { | ||
523 | + if (value) | ||
524 | + flags |= f; | ||
525 | + else | ||
526 | + flags &= ~f; | ||
527 | + } | ||
528 | +}; | ||
529 | + | ||
530 | +class QMetaEnumBuilderPrivate | ||
531 | +{ | ||
532 | +public: | ||
533 | + QMetaEnumBuilderPrivate(const QByteArray& _name) | ||
534 | + : name(_name), isFlag(false) | ||
535 | + { | ||
536 | + } | ||
537 | + | ||
538 | + QByteArray name; | ||
539 | + bool isFlag; | ||
540 | + QList<QByteArray> keys; | ||
541 | + QList<int> values; | ||
542 | +}; | ||
543 | + | ||
544 | +class QMetaObjectBuilderPrivate | ||
545 | +{ | ||
546 | +public: | ||
547 | + QMetaObjectBuilderPrivate() | ||
548 | + : flags(0) | ||
549 | + { | ||
550 | + superClass = &QObject::staticMetaObject; | ||
551 | + staticMetacallFunction = 0; | ||
552 | + } | ||
553 | + | ||
554 | + QByteArray className; | ||
555 | + const QMetaObject *superClass; | ||
556 | + QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction; | ||
557 | + QList<QMetaMethodBuilderPrivate> methods; | ||
558 | + QList<QMetaMethodBuilderPrivate> constructors; | ||
559 | + QList<QMetaPropertyBuilderPrivate> properties; | ||
560 | + QList<QByteArray> classInfoNames; | ||
561 | + QList<QByteArray> classInfoValues; | ||
562 | + QList<QMetaEnumBuilderPrivate> enumerators; | ||
563 | +#ifdef Q_NO_DATA_RELOCATION | ||
564 | + QList<QMetaObjectAccessor> relatedMetaObjects; | ||
565 | +#else | ||
566 | + QList<const QMetaObject *> relatedMetaObjects; | ||
567 | +#endif | ||
568 | + int flags; | ||
569 | +}; | ||
570 | + | ||
571 | +/*! | ||
572 | + Constructs a new QMetaObjectBuilder. | ||
573 | +*/ | ||
574 | +QMetaObjectBuilder::QMetaObjectBuilder() | ||
575 | +{ | ||
576 | + d = new QMetaObjectBuilderPrivate(); | ||
577 | +} | ||
578 | + | ||
579 | +/*! | ||
580 | + Constructs a new QMetaObjectBuilder which is a copy of the | ||
581 | + meta object information in \a prototype. Note: the super class | ||
582 | + contents for \a prototype are not copied, only the immediate | ||
583 | + class that is defined by \a prototype. | ||
584 | + | ||
585 | + The \a members parameter indicates which members of \a prototype | ||
586 | + should be added. The default is AllMembers. | ||
587 | + | ||
588 | + \sa addMetaObject() | ||
589 | +*/ | ||
590 | +QMetaObjectBuilder::QMetaObjectBuilder | ||
591 | + (const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members) | ||
592 | +{ | ||
593 | + d = new QMetaObjectBuilderPrivate(); | ||
594 | + addMetaObject(prototype, members); | ||
595 | +} | ||
596 | + | ||
597 | +/*! | ||
598 | + Destroys this meta object builder. | ||
599 | +*/ | ||
600 | +QMetaObjectBuilder::~QMetaObjectBuilder() | ||
601 | +{ | ||
602 | + delete d; | ||
603 | +} | ||
604 | + | ||
605 | +/*! | ||
606 | + Returns the name of the class being constructed by this | ||
607 | + meta object builder. The default value is an empty QByteArray. | ||
608 | + | ||
609 | + \sa setClassName(), superClass() | ||
610 | +*/ | ||
611 | +QByteArray QMetaObjectBuilder::className() const | ||
612 | +{ | ||
613 | + return d->className; | ||
614 | +} | ||
615 | + | ||
616 | +/*! | ||
617 | + Sets the \a name of the class being constructed by this | ||
618 | + meta object builder. | ||
619 | + | ||
620 | + \sa className(), setSuperClass() | ||
621 | +*/ | ||
622 | +void QMetaObjectBuilder::setClassName(const QByteArray& name) | ||
623 | +{ | ||
624 | + d->className = name; | ||
625 | +} | ||
626 | + | ||
627 | +/*! | ||
628 | + Returns the superclass meta object of the class being constructed | ||
629 | + by this meta object builder. The default value is the meta object | ||
630 | + for QObject. | ||
631 | + | ||
632 | + \sa setSuperClass(), className() | ||
633 | +*/ | ||
634 | +const QMetaObject *QMetaObjectBuilder::superClass() const | ||
635 | +{ | ||
636 | + return d->superClass; | ||
637 | +} | ||
638 | + | ||
639 | +/*! | ||
640 | + Sets the superclass meta object of the class being constructed | ||
641 | + by this meta object builder to \a meta. The \a meta parameter | ||
642 | + must not be null. | ||
643 | + | ||
644 | + \sa superClass(), setClassName() | ||
645 | +*/ | ||
646 | +void QMetaObjectBuilder::setSuperClass(const QMetaObject *meta) | ||
647 | +{ | ||
648 | + Q_ASSERT(meta); | ||
649 | + d->superClass = meta; | ||
650 | +} | ||
651 | + | ||
652 | +/*! | ||
653 | + Returns the flags of the class being constructed by this meta object | ||
654 | + builder. | ||
655 | + | ||
656 | + \sa setFlags() | ||
657 | +*/ | ||
658 | +QMetaObjectBuilder::MetaObjectFlags QMetaObjectBuilder::flags() const | ||
659 | +{ | ||
660 | + return (QMetaObjectBuilder::MetaObjectFlags)d->flags; | ||
661 | +} | ||
662 | + | ||
663 | +/*! | ||
664 | + Sets the \a flags of the class being constructed by this meta object | ||
665 | + builder. | ||
666 | + | ||
667 | + \sa flags() | ||
668 | +*/ | ||
669 | +void QMetaObjectBuilder::setFlags(MetaObjectFlags flags) | ||
670 | +{ | ||
671 | + d->flags = flags; | ||
672 | +} | ||
673 | + | ||
674 | +/*! | ||
675 | + Returns the number of methods in this class, excluding the number | ||
676 | + of methods in the base class. These include signals and slots | ||
677 | + as well as normal member functions. | ||
678 | + | ||
679 | + \sa addMethod(), method(), removeMethod(), indexOfMethod() | ||
680 | +*/ | ||
681 | +int QMetaObjectBuilder::methodCount() const | ||
682 | +{ | ||
683 | + return d->methods.size(); | ||
684 | +} | ||
685 | + | ||
686 | +/*! | ||
687 | + Returns the number of constructors in this class. | ||
688 | + | ||
689 | + \sa addConstructor(), constructor(), removeConstructor(), indexOfConstructor() | ||
690 | +*/ | ||
691 | +int QMetaObjectBuilder::constructorCount() const | ||
692 | +{ | ||
693 | + return d->constructors.size(); | ||
694 | +} | ||
695 | + | ||
696 | +/*! | ||
697 | + Returns the number of properties in this class, excluding the number | ||
698 | + of properties in the base class. | ||
699 | + | ||
700 | + \sa addProperty(), property(), removeProperty(), indexOfProperty() | ||
701 | +*/ | ||
702 | +int QMetaObjectBuilder::propertyCount() const | ||
703 | +{ | ||
704 | + return d->properties.size(); | ||
705 | +} | ||
706 | + | ||
707 | +/*! | ||
708 | + Returns the number of enumerators in this class, excluding the | ||
709 | + number of enumerators in the base class. | ||
710 | + | ||
711 | + \sa addEnumerator(), enumerator(), removeEnumerator() | ||
712 | + \sa indexOfEnumerator() | ||
713 | +*/ | ||
714 | +int QMetaObjectBuilder::enumeratorCount() const | ||
715 | +{ | ||
716 | + return d->enumerators.size(); | ||
717 | +} | ||
718 | + | ||
719 | +/*! | ||
720 | + Returns the number of items of class information in this class, | ||
721 | + exclusing the number of items of class information in the base class. | ||
722 | + | ||
723 | + \sa addClassInfo(), classInfoName(), classInfoValue(), removeClassInfo() | ||
724 | + \sa indexOfClassInfo() | ||
725 | +*/ | ||
726 | +int QMetaObjectBuilder::classInfoCount() const | ||
727 | +{ | ||
728 | + return d->classInfoNames.size(); | ||
729 | +} | ||
730 | + | ||
731 | +/*! | ||
732 | + Returns the number of related meta objects that are associated | ||
733 | + with this class. | ||
734 | + | ||
735 | + Related meta objects are used when resolving the enumerated type | ||
736 | + associated with a property, where the enumerated type is in a | ||
737 | + different class from the property. | ||
738 | + | ||
739 | + \sa addRelatedMetaObject(), relatedMetaObject() | ||
740 | + \sa removeRelatedMetaObject() | ||
741 | +*/ | ||
742 | +int QMetaObjectBuilder::relatedMetaObjectCount() const | ||
743 | +{ | ||
744 | + return d->relatedMetaObjects.size(); | ||
745 | +} | ||
746 | + | ||
747 | +/*! | ||
748 | + Adds a new public method to this class with the specified \a signature. | ||
749 | + Returns an object that can be used to adjust the other attributes | ||
750 | + of the method. The \a signature will be normalized before it is | ||
751 | + added to the class. | ||
752 | + | ||
753 | + \sa method(), methodCount(), removeMethod(), indexOfMethod() | ||
754 | +*/ | ||
755 | +QMetaMethodBuilder QMetaObjectBuilder::addMethod(const QByteArray& signature) | ||
756 | +{ | ||
757 | + int index = d->methods.size(); | ||
758 | + d->methods.append(QMetaMethodBuilderPrivate(QMetaMethod::Method, signature)); | ||
759 | + return QMetaMethodBuilder(this, index); | ||
760 | +} | ||
761 | + | ||
762 | +/*! | ||
763 | + Adds a new public method to this class with the specified | ||
764 | + \a signature and \a returnType. Returns an object that can be | ||
765 | + used to adjust the other attributes of the method. The \a signature | ||
766 | + and \a returnType will be normalized before they are added to | ||
767 | + the class. If \a returnType is empty, then it indicates that | ||
768 | + the method has \c{void} as its return type. | ||
769 | + | ||
770 | + \sa method(), methodCount(), removeMethod(), indexOfMethod() | ||
771 | +*/ | ||
772 | +QMetaMethodBuilder QMetaObjectBuilder::addMethod | ||
773 | + (const QByteArray& signature, const QByteArray& returnType) | ||
774 | +{ | ||
775 | + int index = d->methods.size(); | ||
776 | + d->methods.append(QMetaMethodBuilderPrivate | ||
777 | + (QMetaMethod::Method, signature, returnType)); | ||
778 | + return QMetaMethodBuilder(this, index); | ||
779 | +} | ||
780 | + | ||
781 | +/*! | ||
782 | + Adds a new public method to this class that has the same information as | ||
783 | + \a prototype. This is used to clone the methods of an existing | ||
784 | + QMetaObject. Returns an object that can be used to adjust the | ||
785 | + attributes of the method. | ||
786 | + | ||
787 | + This function will detect if \a prototype is an ordinary method, | ||
788 | + signal, slot, or constructor and act accordingly. | ||
789 | + | ||
790 | + \sa method(), methodCount(), removeMethod(), indexOfMethod() | ||
791 | +*/ | ||
792 | +QMetaMethodBuilder QMetaObjectBuilder::addMethod(const QMetaMethod& prototype) | ||
793 | +{ | ||
794 | + QMetaMethodBuilder method; | ||
795 | + if (prototype.methodType() == QMetaMethod::Method) | ||
796 | + method = addMethod(prototype.signature()); | ||
797 | + else if (prototype.methodType() == QMetaMethod::Signal) | ||
798 | + method = addSignal(prototype.signature()); | ||
799 | + else if (prototype.methodType() == QMetaMethod::Slot) | ||
800 | + method = addSlot(prototype.signature()); | ||
801 | + else if (prototype.methodType() == QMetaMethod::Constructor) | ||
802 | + method = addConstructor(prototype.signature()); | ||
803 | + method.setReturnType(prototype.typeName()); | ||
804 | + method.setParameterNames(prototype.parameterNames()); | ||
805 | + method.setTag(prototype.tag()); | ||
806 | + method.setAccess(prototype.access()); | ||
807 | + method.setAttributes(prototype.attributes()); | ||
808 | + return method; | ||
809 | +} | ||
810 | + | ||
811 | +/*! | ||
812 | + Adds a new public slot to this class with the specified \a signature. | ||
813 | + Returns an object that can be used to adjust the other attributes | ||
814 | + of the slot. The \a signature will be normalized before it is | ||
815 | + added to the class. | ||
816 | + | ||
817 | + \sa addMethod(), addSignal(), indexOfSlot() | ||
818 | +*/ | ||
819 | +QMetaMethodBuilder QMetaObjectBuilder::addSlot(const QByteArray& signature) | ||
820 | +{ | ||
821 | + int index = d->methods.size(); | ||
822 | + d->methods.append(QMetaMethodBuilderPrivate(QMetaMethod::Slot, signature)); | ||
823 | + return QMetaMethodBuilder(this, index); | ||
824 | +} | ||
825 | + | ||
826 | +/*! | ||
827 | + Adds a new signal to this class with the specified \a signature. | ||
828 | + Returns an object that can be used to adjust the other attributes | ||
829 | + of the signal. The \a signature will be normalized before it is | ||
830 | + added to the class. | ||
831 | + | ||
832 | + \sa addMethod(), addSlot(), indexOfSignal() | ||
833 | +*/ | ||
834 | +QMetaMethodBuilder QMetaObjectBuilder::addSignal(const QByteArray& signature) | ||
835 | +{ | ||
836 | + int index = d->methods.size(); | ||
837 | + d->methods.append(QMetaMethodBuilderPrivate | ||
838 | + (QMetaMethod::Signal, signature, QByteArray(), QMetaMethod::Protected)); | ||
839 | + return QMetaMethodBuilder(this, index); | ||
840 | +} | ||
841 | + | ||
842 | +/*! | ||
843 | + Adds a new constructor to this class with the specified \a signature. | ||
844 | + Returns an object that can be used to adjust the other attributes | ||
845 | + of the constructor. The \a signature will be normalized before it is | ||
846 | + added to the class. | ||
847 | + | ||
848 | + \sa constructor(), constructorCount(), removeConstructor() | ||
849 | + \sa indexOfConstructor() | ||
850 | +*/ | ||
851 | +QMetaMethodBuilder QMetaObjectBuilder::addConstructor(const QByteArray& signature) | ||
852 | +{ | ||
853 | + int index = d->constructors.size(); | ||
854 | + d->constructors.append(QMetaMethodBuilderPrivate(QMetaMethod::Constructor, signature)); | ||
855 | + return QMetaMethodBuilder(this, -(index + 1)); | ||
856 | +} | ||
857 | + | ||
858 | +/*! | ||
859 | + Adds a new constructor to this class that has the same information as | ||
860 | + \a prototype. This is used to clone the constructors of an existing | ||
861 | + QMetaObject. Returns an object that can be used to adjust the | ||
862 | + attributes of the constructor. | ||
863 | + | ||
864 | + This function requires that \a prototype be a constructor. | ||
865 | + | ||
866 | + \sa constructor(), constructorCount(), removeConstructor() | ||
867 | + \sa indexOfConstructor() | ||
868 | +*/ | ||
869 | +QMetaMethodBuilder QMetaObjectBuilder::addConstructor(const QMetaMethod& prototype) | ||
870 | +{ | ||
871 | + Q_ASSERT(prototype.methodType() == QMetaMethod::Constructor); | ||
872 | + QMetaMethodBuilder ctor = addConstructor(prototype.signature()); | ||
873 | + ctor.setReturnType(prototype.typeName()); | ||
874 | + ctor.setParameterNames(prototype.parameterNames()); | ||
875 | + ctor.setTag(prototype.tag()); | ||
876 | + ctor.setAccess(prototype.access()); | ||
877 | + ctor.setAttributes(prototype.attributes()); | ||
878 | + return ctor; | ||
879 | +} | ||
880 | + | ||
881 | +/*! | ||
882 | + Adds a new readable/writable property to this class with the | ||
883 | + specified \a name and \a type. Returns an object that can be used | ||
884 | + to adjust the other attributes of the property. The \a type will | ||
885 | + be normalized before it is added to the class. \a notifierId will | ||
886 | + be registered as the property's \e notify signal. | ||
887 | + | ||
888 | + \sa property(), propertyCount(), removeProperty(), indexOfProperty() | ||
889 | +*/ | ||
890 | +QMetaPropertyBuilder QMetaObjectBuilder::addProperty | ||
891 | + (const QByteArray& name, const QByteArray& type, int notifierId) | ||
892 | +{ | ||
893 | + int index = d->properties.size(); | ||
894 | + d->properties.append(QMetaPropertyBuilderPrivate(name, type, notifierId)); | ||
895 | + return QMetaPropertyBuilder(this, index); | ||
896 | +} | ||
897 | + | ||
898 | +/*! | ||
899 | + Adds a new property to this class that has the same information as | ||
900 | + \a prototype. This is used to clone the properties of an existing | ||
901 | + QMetaObject. Returns an object that can be used to adjust the | ||
902 | + attributes of the property. | ||
903 | + | ||
904 | + \sa property(), propertyCount(), removeProperty(), indexOfProperty() | ||
905 | +*/ | ||
906 | +QMetaPropertyBuilder QMetaObjectBuilder::addProperty(const QMetaProperty& prototype) | ||
907 | +{ | ||
908 | + QMetaPropertyBuilder property = addProperty(prototype.name(), prototype.typeName()); | ||
909 | + property.setReadable(prototype.isReadable()); | ||
910 | + property.setWritable(prototype.isWritable()); | ||
911 | + property.setResettable(prototype.isResettable()); | ||
912 | + property.setDesignable(prototype.isDesignable()); | ||
913 | + property.setScriptable(prototype.isScriptable()); | ||
914 | + property.setStored(prototype.isStored()); | ||
915 | + property.setEditable(prototype.isEditable()); | ||
916 | + property.setUser(prototype.isUser()); | ||
917 | + property.setStdCppSet(prototype.hasStdCppSet()); | ||
918 | + property.setEnumOrFlag(prototype.isEnumType()); | ||
919 | + if (prototype.hasNotifySignal()) { | ||
920 | + // Find an existing method for the notify signal, or add a new one. | ||
921 | + QMetaMethod method = prototype.notifySignal(); | ||
922 | + int index = indexOfMethod(method.signature()); | ||
923 | + if (index == -1) | ||
924 | + index = addMethod(method).index(); | ||
925 | + d->properties[property._index].notifySignal = index; | ||
926 | + d->properties[property._index].setFlag(Notify, true); | ||
927 | + } | ||
928 | + return property; | ||
929 | +} | ||
930 | + | ||
931 | +/*! | ||
932 | + Adds a new enumerator to this class with the specified | ||
933 | + \a name. Returns an object that can be used to adjust | ||
934 | + the other attributes of the enumerator. | ||
935 | + | ||
936 | + \sa enumerator(), enumeratorCount(), removeEnumerator(), | ||
937 | + \sa indexOfEnumerator() | ||
938 | +*/ | ||
939 | +QMetaEnumBuilder QMetaObjectBuilder::addEnumerator(const QByteArray& name) | ||
940 | +{ | ||
941 | + int index = d->enumerators.size(); | ||
942 | + d->enumerators.append(QMetaEnumBuilderPrivate(name)); | ||
943 | + return QMetaEnumBuilder(this, index); | ||
944 | +} | ||
945 | + | ||
946 | +/*! | ||
947 | + Adds a new enumerator to this class that has the same information as | ||
948 | + \a prototype. This is used to clone the enumerators of an existing | ||
949 | + QMetaObject. Returns an object that can be used to adjust the | ||
950 | + attributes of the enumerator. | ||
951 | + | ||
952 | + \sa enumerator(), enumeratorCount(), removeEnumerator(), | ||
953 | + \sa indexOfEnumerator() | ||
954 | +*/ | ||
955 | +QMetaEnumBuilder QMetaObjectBuilder::addEnumerator(const QMetaEnum& prototype) | ||
956 | +{ | ||
957 | + QMetaEnumBuilder en = addEnumerator(prototype.name()); | ||
958 | + en.setIsFlag(prototype.isFlag()); | ||
959 | + int count = prototype.keyCount(); | ||
960 | + for (int index = 0; index < count; ++index) | ||
961 | + en.addKey(prototype.key(index), prototype.value(index)); | ||
962 | + return en; | ||
963 | +} | ||
964 | + | ||
965 | +/*! | ||
966 | + Adds \a name and \a value as an item of class information to this class. | ||
967 | + Returns the index of the new item of class information. | ||
968 | + | ||
969 | + \sa classInfoCount(), classInfoName(), classInfoValue(), removeClassInfo() | ||
970 | + \sa indexOfClassInfo() | ||
971 | +*/ | ||
972 | +int QMetaObjectBuilder::addClassInfo(const QByteArray& name, const QByteArray& value) | ||
973 | +{ | ||
974 | + int index = d->classInfoNames.size(); | ||
975 | + d->classInfoNames += name; | ||
976 | + d->classInfoValues += value; | ||
977 | + return index; | ||
978 | +} | ||
979 | + | ||
980 | +/*! | ||
981 | + Adds \a meta to this class as a related meta object. Returns | ||
982 | + the index of the new related meta object entry. | ||
983 | + | ||
984 | + Related meta objects are used when resolving the enumerated type | ||
985 | + associated with a property, where the enumerated type is in a | ||
986 | + different class from the property. | ||
987 | + | ||
988 | + \sa relatedMetaObjectCount(), relatedMetaObject() | ||
989 | + \sa removeRelatedMetaObject() | ||
990 | +*/ | ||
991 | +#ifdef Q_NO_DATA_RELOCATION | ||
992 | +int QMetaObjectBuilder::addRelatedMetaObject(const QMetaObjectAccessor &meta) | ||
993 | +#else | ||
994 | +int QMetaObjectBuilder::addRelatedMetaObject(const QMetaObject *meta) | ||
995 | +#endif | ||
996 | +{ | ||
997 | + Q_ASSERT(meta); | ||
998 | + int index = d->relatedMetaObjects.size(); | ||
999 | + d->relatedMetaObjects.append(meta); | ||
1000 | + return index; | ||
1001 | +} | ||
1002 | + | ||
1003 | +/*! | ||
1004 | + Adds the contents of \a prototype to this meta object builder. | ||
1005 | + This function is useful for cloning the contents of an existing QMetaObject. | ||
1006 | + | ||
1007 | + The \a members parameter indicates which members of \a prototype | ||
1008 | + should be added. The default is AllMembers. | ||
1009 | +*/ | ||
1010 | +void QMetaObjectBuilder::addMetaObject | ||
1011 | + (const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members) | ||
1012 | +{ | ||
1013 | + Q_ASSERT(prototype); | ||
1014 | + int index; | ||
1015 | + | ||
1016 | + if ((members & ClassName) != 0) | ||
1017 | + d->className = prototype->className(); | ||
1018 | + | ||
1019 | + if ((members & SuperClass) != 0) | ||
1020 | + d->superClass = prototype->superClass(); | ||
1021 | + | ||
1022 | + if ((members & (Methods | Signals | Slots)) != 0) { | ||
1023 | + for (index = prototype->methodOffset(); index < prototype->methodCount(); ++index) { | ||
1024 | + QMetaMethod method = prototype->method(index); | ||
1025 | + if (method.methodType() != QMetaMethod::Signal) { | ||
1026 | + if (method.access() == QMetaMethod::Public && (members & PublicMethods) == 0) | ||
1027 | + continue; | ||
1028 | + if (method.access() == QMetaMethod::Private && (members & PrivateMethods) == 0) | ||
1029 | + continue; | ||
1030 | + if (method.access() == QMetaMethod::Protected && (members & ProtectedMethods) == 0) | ||
1031 | + continue; | ||
1032 | + } | ||
1033 | + if (method.methodType() == QMetaMethod::Method && (members & Methods) != 0) { | ||
1034 | + addMethod(method); | ||
1035 | + } else if (method.methodType() == QMetaMethod::Signal && | ||
1036 | + (members & Signals) != 0) { | ||
1037 | + addMethod(method); | ||
1038 | + } else if (method.methodType() == QMetaMethod::Slot && | ||
1039 | + (members & Slots) != 0) { | ||
1040 | + addMethod(method); | ||
1041 | + } | ||
1042 | + } | ||
1043 | + } | ||
1044 | + | ||
1045 | + if ((members & Constructors) != 0) { | ||
1046 | + for (index = 0; index < prototype->constructorCount(); ++index) | ||
1047 | + addConstructor(prototype->constructor(index)); | ||
1048 | + } | ||
1049 | + | ||
1050 | + if ((members & Properties) != 0) { | ||
1051 | + for (index = prototype->propertyOffset(); index < prototype->propertyCount(); ++index) | ||
1052 | + addProperty(prototype->property(index)); | ||
1053 | + } | ||
1054 | + | ||
1055 | + if ((members & Enumerators) != 0) { | ||
1056 | + for (index = prototype->enumeratorOffset(); index < prototype->enumeratorCount(); ++index) | ||
1057 | + addEnumerator(prototype->enumerator(index)); | ||
1058 | + } | ||
1059 | + | ||
1060 | + if ((members & ClassInfos) != 0) { | ||
1061 | + for (index = prototype->classInfoOffset(); index < prototype->classInfoCount(); ++index) { | ||
1062 | + QMetaClassInfo ci = prototype->classInfo(index); | ||
1063 | + addClassInfo(ci.name(), ci.value()); | ||
1064 | + } | ||
1065 | + } | ||
1066 | + | ||
1067 | + if ((members & RelatedMetaObjects) != 0) { | ||
1068 | +#ifdef Q_NO_DATA_RELOCATION | ||
1069 | + const QMetaObjectAccessor *objects = 0; | ||
1070 | +#else | ||
1071 | + const QMetaObject **objects; | ||
1072 | + if (priv(prototype->d.data)->revision < 2) { | ||
1073 | + objects = (const QMetaObject **)(prototype->d.extradata); | ||
1074 | + } else | ||
1075 | +#endif | ||
1076 | + { | ||
1077 | + const QMetaObjectExtraData *extra = (const QMetaObjectExtraData *)(prototype->d.extradata); | ||
1078 | + if (extra) | ||
1079 | + objects = extra->objects; | ||
1080 | + else | ||
1081 | + objects = 0; | ||
1082 | + } | ||
1083 | + if (objects) { | ||
1084 | + while (*objects != 0) { | ||
1085 | + addRelatedMetaObject(*objects); | ||
1086 | + ++objects; | ||
1087 | + } | ||
1088 | + } | ||
1089 | + } | ||
1090 | + | ||
1091 | + if ((members & StaticMetacall) != 0) { | ||
1092 | + if (priv(prototype->d.data)->revision >= 2) { | ||
1093 | + const QMetaObjectExtraData *extra = | ||
1094 | + (const QMetaObjectExtraData *)(prototype->d.extradata); | ||
1095 | + if (extra && extra->static_metacall) | ||
1096 | + setStaticMetacallFunction(extra->static_metacall); | ||
1097 | + } | ||
1098 | + } | ||
1099 | +} | ||
1100 | + | ||
1101 | +/*! | ||
1102 | + Returns the method at \a index in this class. | ||
1103 | + | ||
1104 | + \sa methodCount(), addMethod(), removeMethod(), indexOfMethod() | ||
1105 | +*/ | ||
1106 | +QMetaMethodBuilder QMetaObjectBuilder::method(int index) const | ||
1107 | +{ | ||
1108 | + if (index >= 0 && index < d->methods.size()) | ||
1109 | + return QMetaMethodBuilder(this, index); | ||
1110 | + else | ||
1111 | + return QMetaMethodBuilder(); | ||
1112 | +} | ||
1113 | + | ||
1114 | +/*! | ||
1115 | + Returns the constructor at \a index in this class. | ||
1116 | + | ||
1117 | + \sa methodCount(), addMethod(), removeMethod(), indexOfConstructor() | ||
1118 | +*/ | ||
1119 | +QMetaMethodBuilder QMetaObjectBuilder::constructor(int index) const | ||
1120 | +{ | ||
1121 | + if (index >= 0 && index < d->constructors.size()) | ||
1122 | + return QMetaMethodBuilder(this, -(index + 1)); | ||
1123 | + else | ||
1124 | + return QMetaMethodBuilder(); | ||
1125 | +} | ||
1126 | + | ||
1127 | +/*! | ||
1128 | + Returns the property at \a index in this class. | ||
1129 | + | ||
1130 | + \sa methodCount(), addMethod(), removeMethod(), indexOfProperty() | ||
1131 | +*/ | ||
1132 | +QMetaPropertyBuilder QMetaObjectBuilder::property(int index) const | ||
1133 | +{ | ||
1134 | + if (index >= 0 && index < d->properties.size()) | ||
1135 | + return QMetaPropertyBuilder(this, index); | ||
1136 | + else | ||
1137 | + return QMetaPropertyBuilder(); | ||
1138 | +} | ||
1139 | + | ||
1140 | +/*! | ||
1141 | + Returns the enumerator at \a index in this class. | ||
1142 | + | ||
1143 | + \sa enumeratorCount(), addEnumerator(), removeEnumerator() | ||
1144 | + \sa indexOfEnumerator() | ||
1145 | +*/ | ||
1146 | +QMetaEnumBuilder QMetaObjectBuilder::enumerator(int index) const | ||
1147 | +{ | ||
1148 | + if (index >= 0 && index < d->enumerators.size()) | ||
1149 | + return QMetaEnumBuilder(this, index); | ||
1150 | + else | ||
1151 | + return QMetaEnumBuilder(); | ||
1152 | +} | ||
1153 | + | ||
1154 | +/*! | ||
1155 | + Returns the related meta object at \a index in this class. | ||
1156 | + | ||
1157 | + Related meta objects are used when resolving the enumerated type | ||
1158 | + associated with a property, where the enumerated type is in a | ||
1159 | + different class from the property. | ||
1160 | + | ||
1161 | + \sa relatedMetaObjectCount(), addRelatedMetaObject() | ||
1162 | + \sa removeRelatedMetaObject() | ||
1163 | +*/ | ||
1164 | +const QMetaObject *QMetaObjectBuilder::relatedMetaObject(int index) const | ||
1165 | +{ | ||
1166 | + if (index >= 0 && index < d->relatedMetaObjects.size()) | ||
1167 | +#ifdef Q_NO_DATA_RELOCATION | ||
1168 | + return &((*(d->relatedMetaObjects[index]))()); | ||
1169 | +#else | ||
1170 | + return d->relatedMetaObjects[index]; | ||
1171 | +#endif | ||
1172 | + else | ||
1173 | + return 0; | ||
1174 | +} | ||
1175 | + | ||
1176 | +/*! | ||
1177 | + Returns the name of the item of class information at \a index | ||
1178 | + in this class. | ||
1179 | + | ||
1180 | + \sa classInfoCount(), addClassInfo(), classInfoValue(), removeClassInfo() | ||
1181 | + \sa indexOfClassInfo() | ||
1182 | +*/ | ||
1183 | +QByteArray QMetaObjectBuilder::classInfoName(int index) const | ||
1184 | +{ | ||
1185 | + if (index >= 0 && index < d->classInfoNames.size()) | ||
1186 | + return d->classInfoNames[index]; | ||
1187 | + else | ||
1188 | + return QByteArray(); | ||
1189 | +} | ||
1190 | + | ||
1191 | +/*! | ||
1192 | + Returns the value of the item of class information at \a index | ||
1193 | + in this class. | ||
1194 | + | ||
1195 | + \sa classInfoCount(), addClassInfo(), classInfoName(), removeClassInfo() | ||
1196 | + \sa indexOfClassInfo() | ||
1197 | +*/ | ||
1198 | +QByteArray QMetaObjectBuilder::classInfoValue(int index) const | ||
1199 | +{ | ||
1200 | + if (index >= 0 && index < d->classInfoValues.size()) | ||
1201 | + return d->classInfoValues[index]; | ||
1202 | + else | ||
1203 | + return QByteArray(); | ||
1204 | +} | ||
1205 | + | ||
1206 | +/*! | ||
1207 | + Removes the method at \a index from this class. The indices of | ||
1208 | + all following methods will be adjusted downwards by 1. If the | ||
1209 | + method is registered as a notify signal on a property, then the | ||
1210 | + notify signal will be removed from the property. | ||
1211 | + | ||
1212 | + \sa methodCount(), addMethod(), method(), indexOfMethod() | ||
1213 | +*/ | ||
1214 | +void QMetaObjectBuilder::removeMethod(int index) | ||
1215 | +{ | ||
1216 | + if (index >= 0 && index < d->methods.size()) { | ||
1217 | + d->methods.removeAt(index); | ||
1218 | + for (int prop = 0; prop < d->properties.size(); ++prop) { | ||
1219 | + // Adjust the indices of property notify signal references. | ||
1220 | + if (d->properties[prop].notifySignal == index) { | ||
1221 | + d->properties[prop].notifySignal = -1; | ||
1222 | + d->properties[prop].setFlag(Notify, false); | ||
1223 | + } else if (d->properties[prop].notifySignal > index) | ||
1224 | + (d->properties[prop].notifySignal)--; | ||
1225 | + } | ||
1226 | + } | ||
1227 | +} | ||
1228 | + | ||
1229 | +/*! | ||
1230 | + Removes the constructor at \a index from this class. The indices of | ||
1231 | + all following constructors will be adjusted downwards by 1. | ||
1232 | + | ||
1233 | + \sa constructorCount(), addConstructor(), constructor() | ||
1234 | + \sa indexOfConstructor() | ||
1235 | +*/ | ||
1236 | +void QMetaObjectBuilder::removeConstructor(int index) | ||
1237 | +{ | ||
1238 | + if (index >= 0 && index < d->constructors.size()) | ||
1239 | + d->constructors.removeAt(index); | ||
1240 | +} | ||
1241 | + | ||
1242 | +/*! | ||
1243 | + Removes the property at \a index from this class. The indices of | ||
1244 | + all following properties will be adjusted downwards by 1. | ||
1245 | + | ||
1246 | + \sa propertyCount(), addProperty(), property(), indexOfProperty() | ||
1247 | +*/ | ||
1248 | +void QMetaObjectBuilder::removeProperty(int index) | ||
1249 | +{ | ||
1250 | + if (index >= 0 && index < d->properties.size()) | ||
1251 | + d->properties.removeAt(index); | ||
1252 | +} | ||
1253 | + | ||
1254 | +/*! | ||
1255 | + Removes the enumerator at \a index from this class. The indices of | ||
1256 | + all following enumerators will be adjusted downwards by 1. | ||
1257 | + | ||
1258 | + \sa enumertorCount(), addEnumerator(), enumerator() | ||
1259 | + \sa indexOfEnumerator() | ||
1260 | +*/ | ||
1261 | +void QMetaObjectBuilder::removeEnumerator(int index) | ||
1262 | +{ | ||
1263 | + if (index >= 0 && index < d->enumerators.size()) | ||
1264 | + d->enumerators.removeAt(index); | ||
1265 | +} | ||
1266 | + | ||
1267 | +/*! | ||
1268 | + Removes the item of class information at \a index from this class. | ||
1269 | + The indices of all following items will be adjusted downwards by 1. | ||
1270 | + | ||
1271 | + \sa classInfoCount(), addClassInfo(), classInfoName(), classInfoValue() | ||
1272 | + \sa indexOfClassInfo() | ||
1273 | +*/ | ||
1274 | +void QMetaObjectBuilder::removeClassInfo(int index) | ||
1275 | +{ | ||
1276 | + if (index >= 0 && index < d->classInfoNames.size()) { | ||
1277 | + d->classInfoNames.removeAt(index); | ||
1278 | + d->classInfoValues.removeAt(index); | ||
1279 | + } | ||
1280 | +} | ||
1281 | + | ||
1282 | +/*! | ||
1283 | + Removes the related meta object at \a index from this class. | ||
1284 | + The indices of all following related meta objects will be adjusted | ||
1285 | + downwards by 1. | ||
1286 | + | ||
1287 | + Related meta objects are used when resolving the enumerated type | ||
1288 | + associated with a property, where the enumerated type is in a | ||
1289 | + different class from the property. | ||
1290 | + | ||
1291 | + \sa relatedMetaObjectCount(), addRelatedMetaObject() | ||
1292 | + \sa relatedMetaObject() | ||
1293 | +*/ | ||
1294 | +void QMetaObjectBuilder::removeRelatedMetaObject(int index) | ||
1295 | +{ | ||
1296 | + if (index >= 0 && index < d->relatedMetaObjects.size()) | ||
1297 | + d->relatedMetaObjects.removeAt(index); | ||
1298 | +} | ||
1299 | + | ||
1300 | +/*! | ||
1301 | + Finds a method with the specified \a signature and returns its index; | ||
1302 | + otherwise returns -1. The \a signature will be normalized by this method. | ||
1303 | + | ||
1304 | + \sa method(), methodCount(), addMethod(), removeMethod() | ||
1305 | +*/ | ||
1306 | +int QMetaObjectBuilder::indexOfMethod(const QByteArray& signature) | ||
1307 | +{ | ||
1308 | + QByteArray sig = QMetaObject::normalizedSignature(signature); | ||
1309 | + for (int index = 0; index < d->methods.size(); ++index) { | ||
1310 | + if (sig == d->methods[index].signature) | ||
1311 | + return index; | ||
1312 | + } | ||
1313 | + return -1; | ||
1314 | +} | ||
1315 | + | ||
1316 | +/*! | ||
1317 | + Finds a signal with the specified \a signature and returns its index; | ||
1318 | + otherwise returns -1. The \a signature will be normalized by this method. | ||
1319 | + | ||
1320 | + \sa indexOfMethod(), indexOfSlot() | ||
1321 | +*/ | ||
1322 | +int QMetaObjectBuilder::indexOfSignal(const QByteArray& signature) | ||
1323 | +{ | ||
1324 | + QByteArray sig = QMetaObject::normalizedSignature(signature); | ||
1325 | + for (int index = 0; index < d->methods.size(); ++index) { | ||
1326 | + if (sig == d->methods[index].signature && | ||
1327 | + d->methods[index].methodType() == QMetaMethod::Signal) | ||
1328 | + return index; | ||
1329 | + } | ||
1330 | + return -1; | ||
1331 | +} | ||
1332 | + | ||
1333 | +/*! | ||
1334 | + Finds a slot with the specified \a signature and returns its index; | ||
1335 | + otherwise returns -1. The \a signature will be normalized by this method. | ||
1336 | + | ||
1337 | + \sa indexOfMethod(), indexOfSignal() | ||
1338 | +*/ | ||
1339 | +int QMetaObjectBuilder::indexOfSlot(const QByteArray& signature) | ||
1340 | +{ | ||
1341 | + QByteArray sig = QMetaObject::normalizedSignature(signature); | ||
1342 | + for (int index = 0; index < d->methods.size(); ++index) { | ||
1343 | + if (sig == d->methods[index].signature && | ||
1344 | + d->methods[index].methodType() == QMetaMethod::Slot) | ||
1345 | + return index; | ||
1346 | + } | ||
1347 | + return -1; | ||
1348 | +} | ||
1349 | + | ||
1350 | +/*! | ||
1351 | + Finds a constructor with the specified \a signature and returns its index; | ||
1352 | + otherwise returns -1. The \a signature will be normalized by this method. | ||
1353 | + | ||
1354 | + \sa constructor(), constructorCount(), addConstructor(), removeConstructor() | ||
1355 | +*/ | ||
1356 | +int QMetaObjectBuilder::indexOfConstructor(const QByteArray& signature) | ||
1357 | +{ | ||
1358 | + QByteArray sig = QMetaObject::normalizedSignature(signature); | ||
1359 | + for (int index = 0; index < d->constructors.size(); ++index) { | ||
1360 | + if (sig == d->constructors[index].signature) | ||
1361 | + return index; | ||
1362 | + } | ||
1363 | + return -1; | ||
1364 | +} | ||
1365 | + | ||
1366 | +/*! | ||
1367 | + Finds a property with the specified \a name and returns its index; | ||
1368 | + otherwise returns -1. | ||
1369 | + | ||
1370 | + \sa property(), propertyCount(), addProperty(), removeProperty() | ||
1371 | +*/ | ||
1372 | +int QMetaObjectBuilder::indexOfProperty(const QByteArray& name) | ||
1373 | +{ | ||
1374 | + for (int index = 0; index < d->properties.size(); ++index) { | ||
1375 | + if (name == d->properties[index].name) | ||
1376 | + return index; | ||
1377 | + } | ||
1378 | + return -1; | ||
1379 | +} | ||
1380 | + | ||
1381 | +/*! | ||
1382 | + Finds an enumerator with the specified \a name and returns its index; | ||
1383 | + otherwise returns -1. | ||
1384 | + | ||
1385 | + \sa enumertor(), enumeratorCount(), addEnumerator(), removeEnumerator() | ||
1386 | +*/ | ||
1387 | +int QMetaObjectBuilder::indexOfEnumerator(const QByteArray& name) | ||
1388 | +{ | ||
1389 | + for (int index = 0; index < d->enumerators.size(); ++index) { | ||
1390 | + if (name == d->enumerators[index].name) | ||
1391 | + return index; | ||
1392 | + } | ||
1393 | + return -1; | ||
1394 | +} | ||
1395 | + | ||
1396 | +/*! | ||
1397 | + Finds an item of class information with the specified \a name and | ||
1398 | + returns its index; otherwise returns -1. | ||
1399 | + | ||
1400 | + \sa classInfoName(), classInfoValue(), classInfoCount(), addClassInfo() | ||
1401 | + \sa removeClassInfo() | ||
1402 | +*/ | ||
1403 | +int QMetaObjectBuilder::indexOfClassInfo(const QByteArray& name) | ||
1404 | +{ | ||
1405 | + for (int index = 0; index < d->classInfoNames.size(); ++index) { | ||
1406 | + if (name == d->classInfoNames[index]) | ||
1407 | + return index; | ||
1408 | + } | ||
1409 | + return -1; | ||
1410 | +} | ||
1411 | + | ||
1412 | +// Align on a specific type boundary. | ||
1413 | +#define ALIGN(size,type) \ | ||
1414 | + (size) = ((size) + sizeof(type) - 1) & ~(sizeof(type) - 1) | ||
1415 | + | ||
1416 | +// Build a string into a QMetaObject representation. Returns the | ||
1417 | +// position in the string table where the string was placed. | ||
1418 | +static int buildString | ||
1419 | + (char *buf, char *str, int *offset, const QByteArray& value, int empty) | ||
1420 | +{ | ||
1421 | + if (value.size() == 0 && empty >= 0) | ||
1422 | + return empty; | ||
1423 | + if (buf) { | ||
1424 | + memcpy(str + *offset, value.constData(), value.size()); | ||
1425 | + str[*offset + value.size()] = '\0'; | ||
1426 | + } | ||
1427 | + int posn = *offset; | ||
1428 | + *offset += value.size() + 1; | ||
1429 | + return posn; | ||
1430 | +} | ||
1431 | + | ||
1432 | +// Build the parameter array string for a method. | ||
1433 | +static QByteArray buildParameterNames | ||
1434 | + (const QByteArray& signature, const QList<QByteArray>& parameterNames) | ||
1435 | +{ | ||
1436 | + // If the parameter name list is specified, then concatenate them. | ||
1437 | + if (!parameterNames.isEmpty()) { | ||
1438 | + QByteArray names; | ||
1439 | + bool first = true; | ||
1440 | + foreach (const QByteArray &name, parameterNames) { | ||
1441 | + if (first) | ||
1442 | + first = false; | ||
1443 | + else | ||
1444 | + names += (char)','; | ||
1445 | + names += name; | ||
1446 | + } | ||
1447 | + return names; | ||
1448 | + } | ||
1449 | + | ||
1450 | + // Count commas in the signature, excluding those inside template arguments. | ||
1451 | + int index = signature.indexOf('('); | ||
1452 | + if (index < 0) | ||
1453 | + return QByteArray(); | ||
1454 | + ++index; | ||
1455 | + if (index >= signature.size()) | ||
1456 | + return QByteArray(); | ||
1457 | + if (signature[index] == ')') | ||
1458 | + return QByteArray(); | ||
1459 | + int count = 1; | ||
1460 | + int brackets = 0; | ||
1461 | + while (index < signature.size() && signature[index] != ',') { | ||
1462 | + char ch = signature[index++]; | ||
1463 | + if (ch == '<') | ||
1464 | + ++brackets; | ||
1465 | + else if (ch == '>') | ||
1466 | + --brackets; | ||
1467 | + else if (ch == ',' && brackets <= 0) | ||
1468 | + ++count; | ||
1469 | + } | ||
1470 | + return QByteArray(count - 1, ','); | ||
1471 | +} | ||
1472 | + | ||
1473 | +// Build a QMetaObject in "buf" based on the information in "d". | ||
1474 | +// If "buf" is null, then return the number of bytes needed to | ||
1475 | +// build the QMetaObject. Returns -1 if the metaobject if | ||
1476 | +// relocatable is set, but the metaobject contains extradata. | ||
1477 | +static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf, | ||
1478 | + bool relocatable) | ||
1479 | +{ | ||
1480 | + int size = 0; | ||
1481 | + int dataIndex; | ||
1482 | + int enumIndex; | ||
1483 | + int index; | ||
1484 | + bool hasNotifySignals = false; | ||
1485 | + | ||
1486 | + if (relocatable && | ||
1487 | + (d->relatedMetaObjects.size() > 0 || d->staticMetacallFunction)) | ||
1488 | + return -1; | ||
1489 | + | ||
1490 | + // Create the main QMetaObject structure at the start of the buffer. | ||
1491 | + QMetaObject *meta = reinterpret_cast<QMetaObject *>(buf); | ||
1492 | + size += sizeof(QMetaObject); | ||
1493 | + ALIGN(size, int); | ||
1494 | + if (buf) { | ||
1495 | + if (!relocatable) meta->d.superdata = d->superClass; | ||
1496 | + meta->d.extradata = 0; | ||
1497 | + } | ||
1498 | + | ||
1499 | + // Populate the QMetaObjectPrivate structure. | ||
1500 | + QMetaObjectPrivate *pmeta | ||
1501 | + = reinterpret_cast<QMetaObjectPrivate *>(buf + size); | ||
1502 | + int pmetaSize = size; | ||
1503 | + dataIndex = 13; // Number of fields in the QMetaObjectPrivate. | ||
1504 | + for (index = 0; index < d->properties.size(); ++index) { | ||
1505 | + if (d->properties[index].notifySignal != -1) { | ||
1506 | + hasNotifySignals = true; | ||
1507 | + break; | ||
1508 | + } | ||
1509 | + } | ||
1510 | + if (buf) { | ||
1511 | + pmeta->revision = 3; | ||
1512 | + pmeta->flags = d->flags; | ||
1513 | + pmeta->className = 0; // Class name is always the first string. | ||
1514 | + | ||
1515 | + pmeta->classInfoCount = d->classInfoNames.size(); | ||
1516 | + pmeta->classInfoData = dataIndex; | ||
1517 | + dataIndex += 2 * d->classInfoNames.size(); | ||
1518 | + | ||
1519 | + pmeta->methodCount = d->methods.size(); | ||
1520 | + pmeta->methodData = dataIndex; | ||
1521 | + dataIndex += 5 * d->methods.size(); | ||
1522 | + | ||
1523 | + pmeta->propertyCount = d->properties.size(); | ||
1524 | + pmeta->propertyData = dataIndex; | ||
1525 | + dataIndex += 3 * d->properties.size(); | ||
1526 | + if (hasNotifySignals) | ||
1527 | + dataIndex += d->properties.size(); | ||
1528 | + | ||
1529 | + pmeta->enumeratorCount = d->enumerators.size(); | ||
1530 | + pmeta->enumeratorData = dataIndex; | ||
1531 | + dataIndex += 4 * d->enumerators.size(); | ||
1532 | + | ||
1533 | + pmeta->constructorCount = d->constructors.size(); | ||
1534 | + pmeta->constructorData = dataIndex; | ||
1535 | + dataIndex += 5 * d->constructors.size(); | ||
1536 | + } else { | ||
1537 | + dataIndex += 2 * d->classInfoNames.size(); | ||
1538 | + dataIndex += 5 * d->methods.size(); | ||
1539 | + dataIndex += 3 * d->properties.size(); | ||
1540 | + if (hasNotifySignals) | ||
1541 | + dataIndex += d->properties.size(); | ||
1542 | + dataIndex += 4 * d->enumerators.size(); | ||
1543 | + dataIndex += 5 * d->constructors.size(); | ||
1544 | + } | ||
1545 | + | ||
1546 | + // Allocate space for the enumerator key names and values. | ||
1547 | + enumIndex = dataIndex; | ||
1548 | + for (index = 0; index < d->enumerators.size(); ++index) { | ||
1549 | + QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]); | ||
1550 | + dataIndex += 2 * enumerator->keys.size(); | ||
1551 | + } | ||
1552 | + | ||
1553 | + // Zero terminator at the end of the data offset table. | ||
1554 | + ++dataIndex; | ||
1555 | + | ||
1556 | + // Find the start of the data and string tables. | ||
1557 | + int *data = reinterpret_cast<int *>(pmeta); | ||
1558 | + size += dataIndex * sizeof(int); | ||
1559 | + char *str = reinterpret_cast<char *>(buf + size); | ||
1560 | + if (buf) { | ||
1561 | + if (relocatable) { | ||
1562 | + meta->d.stringdata = reinterpret_cast<const char *>((intptr_t)size); | ||
1563 | + meta->d.data = reinterpret_cast<uint *>((intptr_t)pmetaSize); | ||
1564 | + } else { | ||
1565 | + meta->d.stringdata = str; | ||
1566 | + meta->d.data = reinterpret_cast<uint *>(data); | ||
1567 | + } | ||
1568 | + } | ||
1569 | + | ||
1570 | + // Reset the current data position to just past the QMetaObjectPrivate. | ||
1571 | + dataIndex = 13; | ||
1572 | + | ||
1573 | + // Add the class name to the string table. | ||
1574 | + int offset = 0; | ||
1575 | + buildString(buf, str, &offset, d->className, -1); | ||
1576 | + | ||
1577 | + // Add a common empty string, which is used to indicate "void" | ||
1578 | + // method returns, empty tag strings, etc. | ||
1579 | + int empty = buildString(buf, str, &offset, QByteArray(), -1); | ||
1580 | + | ||
1581 | + // Output the class infos, | ||
1582 | + for (index = 0; index < d->classInfoNames.size(); ++index) { | ||
1583 | + int name = buildString(buf, str, &offset, d->classInfoNames[index], empty); | ||
1584 | + int value = buildString(buf, str, &offset, d->classInfoValues[index], empty); | ||
1585 | + if (buf) { | ||
1586 | + data[dataIndex] = name; | ||
1587 | + data[dataIndex + 1] = value; | ||
1588 | + } | ||
1589 | + dataIndex += 2; | ||
1590 | + } | ||
1591 | + | ||
1592 | + // Output the methods in the class. | ||
1593 | + for (index = 0; index < d->methods.size(); ++index) { | ||
1594 | + QMetaMethodBuilderPrivate *method = &(d->methods[index]); | ||
1595 | + int sig = buildString(buf, str, &offset, method->signature, empty); | ||
1596 | + int params; | ||
1597 | + QByteArray names = buildParameterNames | ||
1598 | + (method->signature, method->parameterNames); | ||
1599 | + params = buildString(buf, str, &offset, names, empty); | ||
1600 | + int ret = buildString(buf, str, &offset, method->returnType, empty); | ||
1601 | + int tag = buildString(buf, str, &offset, method->tag, empty); | ||
1602 | + int attrs = method->attributes; | ||
1603 | + if (buf) { | ||
1604 | + data[dataIndex] = sig; | ||
1605 | + data[dataIndex + 1] = params; | ||
1606 | + data[dataIndex + 2] = ret; | ||
1607 | + data[dataIndex + 3] = tag; | ||
1608 | + data[dataIndex + 4] = attrs; | ||
1609 | + } | ||
1610 | + dataIndex += 5; | ||
1611 | + } | ||
1612 | + | ||
1613 | + // Output the properties in the class. | ||
1614 | + for (index = 0; index < d->properties.size(); ++index) { | ||
1615 | + QMetaPropertyBuilderPrivate *prop = &(d->properties[index]); | ||
1616 | + int name = buildString(buf, str, &offset, prop->name, empty); | ||
1617 | + int type = buildString(buf, str, &offset, prop->type, empty); | ||
1618 | + int flags = prop->flags; | ||
1619 | + | ||
1620 | + if (!isVariantType(prop->type)) { | ||
1621 | + flags |= EnumOrFlag; | ||
1622 | + } else { | ||
1623 | + flags |= qvariant_nameToType(prop->type) << 24; | ||
1624 | + } | ||
1625 | + | ||
1626 | + if (buf) { | ||
1627 | + data[dataIndex] = name; | ||
1628 | + data[dataIndex + 1] = type; | ||
1629 | + data[dataIndex + 2] = flags; | ||
1630 | + } | ||
1631 | + dataIndex += 3; | ||
1632 | + } | ||
1633 | + if (hasNotifySignals) { | ||
1634 | + for (index = 0; index < d->properties.size(); ++index) { | ||
1635 | + QMetaPropertyBuilderPrivate *prop = &(d->properties[index]); | ||
1636 | + if (buf) { | ||
1637 | + if (prop->notifySignal != -1) | ||
1638 | + data[dataIndex] = prop->notifySignal; | ||
1639 | + else | ||
1640 | + data[dataIndex] = 0; | ||
1641 | + } | ||
1642 | + ++dataIndex; | ||
1643 | + } | ||
1644 | + } | ||
1645 | + | ||
1646 | + // Output the enumerators in the class. | ||
1647 | + for (index = 0; index < d->enumerators.size(); ++index) { | ||
1648 | + QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]); | ||
1649 | + int name = buildString(buf, str, &offset, enumerator->name, empty); | ||
1650 | + int isFlag = (int)(enumerator->isFlag); | ||
1651 | + int count = enumerator->keys.size(); | ||
1652 | + int enumOffset = enumIndex; | ||
1653 | + if (buf) { | ||
1654 | + data[dataIndex] = name; | ||
1655 | + data[dataIndex + 1] = isFlag; | ||
1656 | + data[dataIndex + 2] = count; | ||
1657 | + data[dataIndex + 3] = enumOffset; | ||
1658 | + } | ||
1659 | + for (int key = 0; key < count; ++key) { | ||
1660 | + int keyIndex = buildString(buf, str, &offset, enumerator->keys[key], empty); | ||
1661 | + if (buf) { | ||
1662 | + data[enumOffset++] = keyIndex; | ||
1663 | + data[enumOffset++] = enumerator->values[key]; | ||
1664 | + } | ||
1665 | + } | ||
1666 | + dataIndex += 4; | ||
1667 | + enumIndex += 2 * count; | ||
1668 | + } | ||
1669 | + | ||
1670 | + // Output the constructors in the class. | ||
1671 | + for (index = 0; index < d->constructors.size(); ++index) { | ||
1672 | + QMetaMethodBuilderPrivate *method = &(d->constructors[index]); | ||
1673 | + int sig = buildString(buf, str, &offset, method->signature, empty); | ||
1674 | + int params; | ||
1675 | + QByteArray names = buildParameterNames | ||
1676 | + (method->signature, method->parameterNames); | ||
1677 | + params = buildString(buf, str, &offset, names, empty); | ||
1678 | + int ret = buildString(buf, str, &offset, method->returnType, empty); | ||
1679 | + int tag = buildString(buf, str, &offset, method->tag, empty); | ||
1680 | + int attrs = method->attributes; | ||
1681 | + if (buf) { | ||
1682 | + data[dataIndex] = sig; | ||
1683 | + data[dataIndex + 1] = params; | ||
1684 | + data[dataIndex + 2] = ret; | ||
1685 | + data[dataIndex + 3] = tag; | ||
1686 | + data[dataIndex + 4] = attrs; | ||
1687 | + } | ||
1688 | + dataIndex += 5; | ||
1689 | + } | ||
1690 | + | ||
1691 | + // One more empty string to act as a terminator. | ||
1692 | + buildString(buf, str, &offset, QByteArray(), -1); | ||
1693 | + size += offset; | ||
1694 | + | ||
1695 | + // Output the zero terminator in the data array. | ||
1696 | + if (buf) | ||
1697 | + data[enumIndex] = 0; | ||
1698 | + | ||
1699 | + // Create the extradata block if we need one. | ||
1700 | + if (d->relatedMetaObjects.size() > 0 || d->staticMetacallFunction) { | ||
1701 | + ALIGN(size, QMetaObject **); | ||
1702 | + ALIGN(size, QMetaObjectBuilder::StaticMetacallFunction); | ||
1703 | + QMetaObjectExtraData *extra = | ||
1704 | + reinterpret_cast<QMetaObjectExtraData *>(buf + size); | ||
1705 | + size += sizeof(QMetaObjectExtraData); | ||
1706 | + ALIGN(size, QMetaObject *); | ||
1707 | +#ifdef Q_NO_DATA_RELOCATION | ||
1708 | + QMetaObjectAccessor *objects = | ||
1709 | + reinterpret_cast<QMetaObjectAccessor *>(buf + size); | ||
1710 | +#else | ||
1711 | + const QMetaObject **objects = | ||
1712 | + reinterpret_cast<const QMetaObject **>(buf + size); | ||
1713 | +#endif | ||
1714 | + if (buf) { | ||
1715 | + if (d->relatedMetaObjects.size() > 0) { | ||
1716 | + extra->objects = objects; | ||
1717 | + for (index = 0; index < d->relatedMetaObjects.size(); ++index) | ||
1718 | + objects[index] = d->relatedMetaObjects[index]; | ||
1719 | + objects[index] = 0; | ||
1720 | + } else { | ||
1721 | + extra->objects = 0; | ||
1722 | + } | ||
1723 | + extra->static_metacall = d->staticMetacallFunction; | ||
1724 | + meta->d.extradata = reinterpret_cast<void *>(extra); | ||
1725 | + } | ||
1726 | + if (d->relatedMetaObjects.size() > 0) | ||
1727 | + size += sizeof(QMetaObject *) * (d->relatedMetaObjects.size() + 1); | ||
1728 | + } | ||
1729 | + | ||
1730 | + // Align the final size and return it. | ||
1731 | + ALIGN(size, void *); | ||
1732 | + return size; | ||
1733 | +} | ||
1734 | + | ||
1735 | +/*! | ||
1736 | + Converts this meta object builder into a concrete QMetaObject. | ||
1737 | + The return value should be deallocated using qFree() once it | ||
1738 | + is no longer needed. | ||
1739 | + | ||
1740 | + The returned meta object is a snapshot of the state of the | ||
1741 | + QMetaObjectBuilder. Any further modifications to the QMetaObjectBuilder | ||
1742 | + will not be reflected in previous meta objects returned by | ||
1743 | + this method. | ||
1744 | +*/ | ||
1745 | +QMetaObject *QMetaObjectBuilder::toMetaObject() const | ||
1746 | +{ | ||
1747 | + int size = buildMetaObject(d, 0, false); | ||
1748 | + char *buf = reinterpret_cast<char *>(qMalloc(size)); | ||
1749 | + buildMetaObject(d, buf, false); | ||
1750 | + return reinterpret_cast<QMetaObject *>(buf); | ||
1751 | +} | ||
1752 | + | ||
1753 | +/* | ||
1754 | + \internal | ||
1755 | + | ||
1756 | + Converts this meta object builder into relocatable data. This data can | ||
1757 | + be stored, copied and later passed to fromRelocatableData() to create a | ||
1758 | + concrete QMetaObject. | ||
1759 | + | ||
1760 | + The data is specific to the architecture on which it was created, but is not | ||
1761 | + specific to the process that created it. Not all meta object builder's can | ||
1762 | + be converted to data in this way. If \a ok is provided, it will be set to | ||
1763 | + true if the conversion succeeds, and false otherwise. If a | ||
1764 | + staticMetacallFunction() or any relatedMetaObject()'s are specified the | ||
1765 | + conversion to relocatable data will fail. | ||
1766 | +*/ | ||
1767 | +QByteArray QMetaObjectBuilder::toRelocatableData(bool *ok) const | ||
1768 | +{ | ||
1769 | + int size = buildMetaObject(d, 0, true); | ||
1770 | + if (size == -1) { | ||
1771 | + if (ok) *ok = false; | ||
1772 | + return QByteArray(); | ||
1773 | + } | ||
1774 | + | ||
1775 | + QByteArray data; | ||
1776 | + data.resize(size); | ||
1777 | + char *buf = data.data(); | ||
1778 | + buildMetaObject(d, buf, true); | ||
1779 | + if (ok) *ok = true; | ||
1780 | + return data; | ||
1781 | +} | ||
1782 | + | ||
1783 | +/* | ||
1784 | + \internal | ||
1785 | + | ||
1786 | + Sets the \a data returned from toRelocatableData() onto a concrete | ||
1787 | + QMetaObject instance, \a output. As the meta object's super class is not | ||
1788 | + saved in the relocatable data, it must be passed as \a superClass. | ||
1789 | +*/ | ||
1790 | +void QMetaObjectBuilder::fromRelocatableData(QMetaObject *output, | ||
1791 | + const QMetaObject *superclass, | ||
1792 | + const QByteArray &data) | ||
1793 | +{ | ||
1794 | + if (!output) | ||
1795 | + return; | ||
1796 | + | ||
1797 | + const char *buf = data.constData(); | ||
1798 | + const QMetaObject *dataMo = reinterpret_cast<const QMetaObject *>(buf); | ||
1799 | + | ||
1800 | + intptr_t stringdataOffset = (intptr_t)dataMo->d.stringdata; | ||
1801 | + intptr_t dataOffset = (intptr_t)dataMo->d.data; | ||
1802 | + | ||
1803 | + output->d.superdata = superclass; | ||
1804 | + output->d.stringdata = buf + stringdataOffset; | ||
1805 | + output->d.data = reinterpret_cast<const uint *>(buf + dataOffset); | ||
1806 | +} | ||
1807 | + | ||
1808 | +/*! | ||
1809 | + \typedef QMetaObjectBuilder::StaticMetacallFunction | ||
1810 | + | ||
1811 | + Typedef for static metacall functions. The three parameters are | ||
1812 | + the call type value, the constructor index, and the | ||
1813 | + array of parameters. | ||
1814 | +*/ | ||
1815 | + | ||
1816 | +/*! | ||
1817 | + Returns the static metacall function to use to construct objects | ||
1818 | + of this class. The default value is null. | ||
1819 | + | ||
1820 | + \sa setStaticMetacallFunction() | ||
1821 | +*/ | ||
1822 | +QMetaObjectBuilder::StaticMetacallFunction QMetaObjectBuilder::staticMetacallFunction() const | ||
1823 | +{ | ||
1824 | + return d->staticMetacallFunction; | ||
1825 | +} | ||
1826 | + | ||
1827 | +/*! | ||
1828 | + Sets the static metacall function to use to construct objects | ||
1829 | + of this class to \a value. The default value is null. | ||
1830 | + | ||
1831 | + \sa staticMetacallFunction() | ||
1832 | +*/ | ||
1833 | +void QMetaObjectBuilder::setStaticMetacallFunction | ||
1834 | + (QMetaObjectBuilder::StaticMetacallFunction value) | ||
1835 | +{ | ||
1836 | + d->staticMetacallFunction = value; | ||
1837 | +} | ||
1838 | + | ||
1839 | +#ifndef QT_NO_DATASTREAM | ||
1840 | + | ||
1841 | +/*! | ||
1842 | + Serializes the contents of the meta object builder onto \a stream. | ||
1843 | + | ||
1844 | + \sa deserialize() | ||
1845 | +*/ | ||
1846 | +void QMetaObjectBuilder::serialize(QDataStream& stream) const | ||
1847 | +{ | ||
1848 | + int index; | ||
1849 | + | ||
1850 | + // Write the class and super class names. | ||
1851 | + stream << d->className; | ||
1852 | + if (d->superClass) | ||
1853 | + stream << QByteArray(d->superClass->className()); | ||
1854 | + else | ||
1855 | + stream << QByteArray(); | ||
1856 | + | ||
1857 | + // Write the counts for each type of class member. | ||
1858 | + stream << d->classInfoNames.size(); | ||
1859 | + stream << d->methods.size(); | ||
1860 | + stream << d->properties.size(); | ||
1861 | + stream << d->enumerators.size(); | ||
1862 | + stream << d->constructors.size(); | ||
1863 | + stream << d->relatedMetaObjects.size(); | ||
1864 | + | ||
1865 | + // Write the items of class information. | ||
1866 | + for (index = 0; index < d->classInfoNames.size(); ++index) { | ||
1867 | + stream << d->classInfoNames[index]; | ||
1868 | + stream << d->classInfoValues[index]; | ||
1869 | + } | ||
1870 | + | ||
1871 | + // Write the methods. | ||
1872 | + for (index = 0; index < d->methods.size(); ++index) { | ||
1873 | + const QMetaMethodBuilderPrivate *method = &(d->methods[index]); | ||
1874 | + stream << method->signature; | ||
1875 | + stream << method->returnType; | ||
1876 | + stream << method->parameterNames; | ||
1877 | + stream << method->tag; | ||
1878 | + stream << method->attributes; | ||
1879 | + } | ||
1880 | + | ||
1881 | + // Write the properties. | ||
1882 | + for (index = 0; index < d->properties.size(); ++index) { | ||
1883 | + const QMetaPropertyBuilderPrivate *property = &(d->properties[index]); | ||
1884 | + stream << property->name; | ||
1885 | + stream << property->type; | ||
1886 | + stream << property->flags; | ||
1887 | + stream << property->notifySignal; | ||
1888 | + } | ||
1889 | + | ||
1890 | + // Write the enumerators. | ||
1891 | + for (index = 0; index < d->enumerators.size(); ++index) { | ||
1892 | + const QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]); | ||
1893 | + stream << enumerator->name; | ||
1894 | + stream << enumerator->isFlag; | ||
1895 | + stream << enumerator->keys; | ||
1896 | + stream << enumerator->values; | ||
1897 | + } | ||
1898 | + | ||
1899 | + // Write the constructors. | ||
1900 | + for (index = 0; index < d->constructors.size(); ++index) { | ||
1901 | + const QMetaMethodBuilderPrivate *method = &(d->constructors[index]); | ||
1902 | + stream << method->signature; | ||
1903 | + stream << method->returnType; | ||
1904 | + stream << method->parameterNames; | ||
1905 | + stream << method->tag; | ||
1906 | + stream << method->attributes; | ||
1907 | + } | ||
1908 | + | ||
1909 | + // Write the related meta objects. | ||
1910 | +#ifdef Q_NO_DATA_RELOCATION | ||
1911 | + //the related meta objects will be function pointers | ||
1912 | + //which you have to add to the builder manually. | ||
1913 | + //e.g. | ||
1914 | + //builder2.addRelatedMetaObject(QLocale::getStaticMetaObject); | ||
1915 | +#else | ||
1916 | + for (index = 0; index < d->relatedMetaObjects.size(); ++index) { | ||
1917 | + const QMetaObject *meta = d->relatedMetaObjects[index]; | ||
1918 | + stream << QByteArray(meta->className()); | ||
1919 | + } | ||
1920 | +#endif | ||
1921 | + | ||
1922 | + // Add an extra empty QByteArray for additional data in future versions. | ||
1923 | + // This should help maintain backwards compatibility, allowing older | ||
1924 | + // versions to read newer data. | ||
1925 | + stream << QByteArray(); | ||
1926 | +} | ||
1927 | + | ||
1928 | +// Resolve a class name using the name reference map. | ||
1929 | +static const QMetaObject *resolveClassName | ||
1930 | + (const QMap<QByteArray, const QMetaObject *>& references, | ||
1931 | + const QByteArray& name) | ||
1932 | +{ | ||
1933 | + if (name == QByteArray("QObject")) | ||
1934 | + return &QObject::staticMetaObject; | ||
1935 | + else | ||
1936 | + return references.value(name, 0); | ||
1937 | +} | ||
1938 | + | ||
1939 | +/*! | ||
1940 | + Deserializes a meta object builder from \a stream into | ||
1941 | + this meta object builder. | ||
1942 | + | ||
1943 | + The \a references parameter specifies a mapping from class names | ||
1944 | + to QMetaObject instances for resolving the super class name and | ||
1945 | + related meta objects in the object that is deserialized. | ||
1946 | + The meta object for QObject is implicitly added to \a references | ||
1947 | + and does not need to be supplied. | ||
1948 | + | ||
1949 | + The QDataStream::status() value on \a stream will be set to | ||
1950 | + QDataStream::ReadCorruptData if the input data is corrupt. | ||
1951 | + The status will be set to QDataStream::ReadPastEnd if the | ||
1952 | + input was exhausted before the full meta object was read. | ||
1953 | + | ||
1954 | + \sa serialize() | ||
1955 | +*/ | ||
1956 | +void QMetaObjectBuilder::deserialize | ||
1957 | + (QDataStream& stream, | ||
1958 | + const QMap<QByteArray, const QMetaObject *>& references) | ||
1959 | +{ | ||
1960 | + QByteArray name; | ||
1961 | + const QMetaObject *cl; | ||
1962 | + int index; | ||
1963 | + | ||
1964 | + // Clear all members in the builder to their default states. | ||
1965 | + d->className.clear(); | ||
1966 | + d->superClass = &QObject::staticMetaObject; | ||
1967 | + d->classInfoNames.clear(); | ||
1968 | + d->classInfoValues.clear(); | ||
1969 | + d->methods.clear(); | ||
1970 | + d->properties.clear(); | ||
1971 | + d->enumerators.clear(); | ||
1972 | + d->constructors.clear(); | ||
1973 | + d->relatedMetaObjects.clear(); | ||
1974 | + d->staticMetacallFunction = 0; | ||
1975 | + | ||
1976 | + // Read the class and super class names. | ||
1977 | + stream >> d->className; | ||
1978 | + stream >> name; | ||
1979 | + if (name.isEmpty()) { | ||
1980 | + d->superClass = 0; | ||
1981 | + } else if ((cl = resolveClassName(references, name)) != 0) { | ||
1982 | + d->superClass = cl; | ||
1983 | + } else { | ||
1984 | + stream.setStatus(QDataStream::ReadCorruptData); | ||
1985 | + return; | ||
1986 | + } | ||
1987 | + | ||
1988 | + // Read the counts for each type of class member. | ||
1989 | + int classInfoCount, methodCount, propertyCount; | ||
1990 | + int enumeratorCount, constructorCount, relatedMetaObjectCount; | ||
1991 | + stream >> classInfoCount; | ||
1992 | + stream >> methodCount; | ||
1993 | + stream >> propertyCount; | ||
1994 | + stream >> enumeratorCount; | ||
1995 | + stream >> constructorCount; | ||
1996 | + stream >> relatedMetaObjectCount; | ||
1997 | + if (classInfoCount < 0 || methodCount < 0 || | ||
1998 | + propertyCount < 0 || enumeratorCount < 0 || | ||
1999 | + constructorCount < 0 || relatedMetaObjectCount < 0) { | ||
2000 | + stream.setStatus(QDataStream::ReadCorruptData); | ||
2001 | + return; | ||
2002 | + } | ||
2003 | + | ||
2004 | + // Read the items of class information. | ||
2005 | + for (index = 0; index < classInfoCount; ++index) { | ||
2006 | + if (stream.status() != QDataStream::Ok) | ||
2007 | + return; | ||
2008 | + QByteArray value; | ||
2009 | + stream >> name; | ||
2010 | + stream >> value; | ||
2011 | + addClassInfo(name, value); | ||
2012 | + } | ||
2013 | + | ||
2014 | + // Read the member methods. | ||
2015 | + for (index = 0; index < methodCount; ++index) { | ||
2016 | + if (stream.status() != QDataStream::Ok) | ||
2017 | + return; | ||
2018 | + stream >> name; | ||
2019 | + addMethod(name); | ||
2020 | + QMetaMethodBuilderPrivate *method = &(d->methods[index]); | ||
2021 | + stream >> method->returnType; | ||
2022 | + stream >> method->parameterNames; | ||
2023 | + stream >> method->tag; | ||
2024 | + stream >> method->attributes; | ||
2025 | + if (method->methodType() == QMetaMethod::Constructor) { | ||
2026 | + // Cannot add a constructor in this set of methods. | ||
2027 | + stream.setStatus(QDataStream::ReadCorruptData); | ||
2028 | + return; | ||
2029 | + } | ||
2030 | + } | ||
2031 | + | ||
2032 | + // Read the properties. | ||
2033 | + for (index = 0; index < propertyCount; ++index) { | ||
2034 | + if (stream.status() != QDataStream::Ok) | ||
2035 | + return; | ||
2036 | + QByteArray type; | ||
2037 | + stream >> name; | ||
2038 | + stream >> type; | ||
2039 | + addProperty(name, type); | ||
2040 | + QMetaPropertyBuilderPrivate *property = &(d->properties[index]); | ||
2041 | + stream >> property->flags; | ||
2042 | + stream >> property->notifySignal; | ||
2043 | + if (property->notifySignal < -1 || | ||
2044 | + property->notifySignal >= d->methods.size()) { | ||
2045 | + // Notify signal method index is out of range. | ||
2046 | + stream.setStatus(QDataStream::ReadCorruptData); | ||
2047 | + return; | ||
2048 | + } | ||
2049 | + if (property->notifySignal >= 0 && | ||
2050 | + d->methods[property->notifySignal].methodType() != QMetaMethod::Signal) { | ||
2051 | + // Notify signal method index does not refer to a signal. | ||
2052 | + stream.setStatus(QDataStream::ReadCorruptData); | ||
2053 | + return; | ||
2054 | + } | ||
2055 | + } | ||
2056 | + | ||
2057 | + // Read the enumerators. | ||
2058 | + for (index = 0; index < enumeratorCount; ++index) { | ||
2059 | + if (stream.status() != QDataStream::Ok) | ||
2060 | + return; | ||
2061 | + stream >> name; | ||
2062 | + addEnumerator(name); | ||
2063 | + QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]); | ||
2064 | + stream >> enumerator->isFlag; | ||
2065 | + stream >> enumerator->keys; | ||
2066 | + stream >> enumerator->values; | ||
2067 | + if (enumerator->keys.size() != enumerator->values.size()) { | ||
2068 | + // Mismatch between number of keys and number of values. | ||
2069 | + stream.setStatus(QDataStream::ReadCorruptData); | ||
2070 | + return; | ||
2071 | + } | ||
2072 | + } | ||
2073 | + | ||
2074 | + // Read the constructor methods. | ||
2075 | + for (index = 0; index < constructorCount; ++index) { | ||
2076 | + if (stream.status() != QDataStream::Ok) | ||
2077 | + return; | ||
2078 | + stream >> name; | ||
2079 | + addConstructor(name); | ||
2080 | + QMetaMethodBuilderPrivate *method = &(d->constructors[index]); | ||
2081 | + stream >> method->returnType; | ||
2082 | + stream >> method->parameterNames; | ||
2083 | + stream >> method->tag; | ||
2084 | + stream >> method->attributes; | ||
2085 | + if (method->methodType() != QMetaMethod::Constructor) { | ||
2086 | + // The type must be Constructor. | ||
2087 | + stream.setStatus(QDataStream::ReadCorruptData); | ||
2088 | + return; | ||
2089 | + } | ||
2090 | + } | ||
2091 | + | ||
2092 | + // Read the related meta objects. | ||
2093 | +#ifdef Q_NO_DATA_RELOCATION | ||
2094 | + //the related meta objects will be function pointers | ||
2095 | + //which you have to add to the builder manually. | ||
2096 | + //e.g. | ||
2097 | + //builder2.addRelatedMetaObject(QLocale::getStaticMetaObject); | ||
2098 | +#else | ||
2099 | + for (index = 0; index < relatedMetaObjectCount; ++index) { | ||
2100 | + if (stream.status() != QDataStream::Ok) | ||
2101 | + return; | ||
2102 | + stream >> name; | ||
2103 | + cl = resolveClassName(references, name); | ||
2104 | + if (!cl) { | ||
2105 | + stream.setStatus(QDataStream::ReadCorruptData); | ||
2106 | + return; | ||
2107 | + } | ||
2108 | + addRelatedMetaObject(cl); | ||
2109 | + } | ||
2110 | +#endif | ||
2111 | + | ||
2112 | + // Read the extra data block, which is reserved for future use. | ||
2113 | + stream >> name; | ||
2114 | +} | ||
2115 | + | ||
2116 | +#endif // !QT_NO_DATASTREAM | ||
2117 | + | ||
2118 | +/*! | ||
2119 | + \class QMetaMethodBuilder | ||
2120 | + \internal | ||
2121 | + \brief The QMetaMethodBuilder class enables modifications to a method definition on a meta object builder. | ||
2122 | +*/ | ||
2123 | + | ||
2124 | +QMetaMethodBuilderPrivate *QMetaMethodBuilder::d_func() const | ||
2125 | +{ | ||
2126 | + // Positive indices indicate methods, negative indices indicate constructors. | ||
2127 | + if (_mobj && _index >= 0 && _index < _mobj->d->methods.size()) | ||
2128 | + return &(_mobj->d->methods[_index]); | ||
2129 | + else if (_mobj && -_index >= 1 && -_index <= _mobj->d->constructors.size()) | ||
2130 | + return &(_mobj->d->constructors[(-_index) - 1]); | ||
2131 | + else | ||
2132 | + return 0; | ||
2133 | +} | ||
2134 | + | ||
2135 | +/*! | ||
2136 | + \fn QMetaMethodBuilder::QMetaMethodBuilder() | ||
2137 | + \internal | ||
2138 | +*/ | ||
2139 | + | ||
2140 | +/*! | ||
2141 | + Returns the index of this method within its QMetaObjectBuilder. | ||
2142 | +*/ | ||
2143 | +int QMetaMethodBuilder::index() const | ||
2144 | +{ | ||
2145 | + if (_index >= 0) | ||
2146 | + return _index; // Method, signal, or slot | ||
2147 | + else | ||
2148 | + return (-_index) - 1; // Constructor | ||
2149 | +} | ||
2150 | + | ||
2151 | +/*! | ||
2152 | + Returns the type of this method (signal, slot, method, or constructor). | ||
2153 | +*/ | ||
2154 | +QMetaMethod::MethodType QMetaMethodBuilder::methodType() const | ||
2155 | +{ | ||
2156 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2157 | + if (d) | ||
2158 | + return d->methodType(); | ||
2159 | + else | ||
2160 | + return QMetaMethod::Method; | ||
2161 | +} | ||
2162 | + | ||
2163 | +/*! | ||
2164 | + Returns the signature of this method. | ||
2165 | + | ||
2166 | + \sa parameterNames(), returnType() | ||
2167 | +*/ | ||
2168 | +QByteArray QMetaMethodBuilder::signature() const | ||
2169 | +{ | ||
2170 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2171 | + if (d) | ||
2172 | + return d->signature; | ||
2173 | + else | ||
2174 | + return QByteArray(); | ||
2175 | +} | ||
2176 | + | ||
2177 | +/*! | ||
2178 | + Returns the return type for this method; empty if the method's | ||
2179 | + return type is \c{void}. | ||
2180 | + | ||
2181 | + \sa setReturnType(), signature() | ||
2182 | +*/ | ||
2183 | +QByteArray QMetaMethodBuilder::returnType() const | ||
2184 | +{ | ||
2185 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2186 | + if (d) | ||
2187 | + return d->returnType; | ||
2188 | + else | ||
2189 | + return QByteArray(); | ||
2190 | +} | ||
2191 | + | ||
2192 | +/*! | ||
2193 | + Sets the return type for this method to \a value. If \a value | ||
2194 | + is empty, then the method's return type is \c{void}. The \a value | ||
2195 | + will be normalized before it is added to the method. | ||
2196 | + | ||
2197 | + \sa returnType(), signature() | ||
2198 | +*/ | ||
2199 | +void QMetaMethodBuilder::setReturnType(const QByteArray& value) | ||
2200 | +{ | ||
2201 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2202 | + if (d) | ||
2203 | + d->returnType = QMetaObject::normalizedType(value); | ||
2204 | +} | ||
2205 | + | ||
2206 | +/*! | ||
2207 | + Returns the list of parameter names for this method. | ||
2208 | + | ||
2209 | + \sa setParameterNames() | ||
2210 | +*/ | ||
2211 | +QList<QByteArray> QMetaMethodBuilder::parameterNames() const | ||
2212 | +{ | ||
2213 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2214 | + if (d) | ||
2215 | + return d->parameterNames; | ||
2216 | + else | ||
2217 | + return QList<QByteArray>(); | ||
2218 | +} | ||
2219 | + | ||
2220 | +/*! | ||
2221 | + Sets the list of parameter names for this method to \a value. | ||
2222 | + | ||
2223 | + \sa parameterNames() | ||
2224 | +*/ | ||
2225 | +void QMetaMethodBuilder::setParameterNames(const QList<QByteArray>& value) | ||
2226 | +{ | ||
2227 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2228 | + if (d) | ||
2229 | + d->parameterNames = value; | ||
2230 | +} | ||
2231 | + | ||
2232 | +/*! | ||
2233 | + Returns the tag associated with this method. | ||
2234 | + | ||
2235 | + \sa setTag() | ||
2236 | +*/ | ||
2237 | +QByteArray QMetaMethodBuilder::tag() const | ||
2238 | +{ | ||
2239 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2240 | + if (d) | ||
2241 | + return d->tag; | ||
2242 | + else | ||
2243 | + return QByteArray(); | ||
2244 | +} | ||
2245 | + | ||
2246 | +/*! | ||
2247 | + Sets the tag associated with this method to \a value. | ||
2248 | + | ||
2249 | + \sa setTag() | ||
2250 | +*/ | ||
2251 | +void QMetaMethodBuilder::setTag(const QByteArray& value) | ||
2252 | +{ | ||
2253 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2254 | + if (d) | ||
2255 | + d->tag = value; | ||
2256 | +} | ||
2257 | + | ||
2258 | +/*! | ||
2259 | + Returns the access specification of this method (private, protected, | ||
2260 | + or public). The default value is QMetaMethod::Public for methods, | ||
2261 | + slots, and constructors. The default value is QMetaMethod::Protected | ||
2262 | + for signals. | ||
2263 | + | ||
2264 | + \sa setAccess() | ||
2265 | +*/ | ||
2266 | +QMetaMethod::Access QMetaMethodBuilder::access() const | ||
2267 | +{ | ||
2268 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2269 | + if (d) | ||
2270 | + return d->access(); | ||
2271 | + else | ||
2272 | + return QMetaMethod::Public; | ||
2273 | +} | ||
2274 | + | ||
2275 | +/*! | ||
2276 | + Sets the access specification of this method (private, protected, | ||
2277 | + or public) to \a value. If the method is a signal, this function | ||
2278 | + will be ignored. | ||
2279 | + | ||
2280 | + \sa access() | ||
2281 | +*/ | ||
2282 | +void QMetaMethodBuilder::setAccess(QMetaMethod::Access value) | ||
2283 | +{ | ||
2284 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2285 | + if (d && d->methodType() != QMetaMethod::Signal) | ||
2286 | + d->setAccess(value); | ||
2287 | +} | ||
2288 | + | ||
2289 | +/*! | ||
2290 | + Returns the additional attributes for this method. | ||
2291 | + | ||
2292 | + \sa setAttributes() | ||
2293 | +*/ | ||
2294 | +int QMetaMethodBuilder::attributes() const | ||
2295 | +{ | ||
2296 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2297 | + if (d) | ||
2298 | + return (d->attributes >> 4); | ||
2299 | + else | ||
2300 | + return 0; | ||
2301 | +} | ||
2302 | + | ||
2303 | +/*! | ||
2304 | + Sets the additional attributes for this method to \a value. | ||
2305 | + | ||
2306 | + \sa attributes() | ||
2307 | +*/ | ||
2308 | +void QMetaMethodBuilder::setAttributes(int value) | ||
2309 | +{ | ||
2310 | + QMetaMethodBuilderPrivate *d = d_func(); | ||
2311 | + if (d) | ||
2312 | + d->attributes = ((d->attributes & 0x0f) | (value << 4)); | ||
2313 | +} | ||
2314 | + | ||
2315 | +/*! | ||
2316 | + \class QMetaPropertyBuilder | ||
2317 | + \internal | ||
2318 | + \brief The QMetaPropertyBuilder class enables modifications to a property definition on a meta object builder. | ||
2319 | +*/ | ||
2320 | + | ||
2321 | +QMetaPropertyBuilderPrivate *QMetaPropertyBuilder::d_func() const | ||
2322 | +{ | ||
2323 | + if (_mobj && _index >= 0 && _index < _mobj->d->properties.size()) | ||
2324 | + return &(_mobj->d->properties[_index]); | ||
2325 | + else | ||
2326 | + return 0; | ||
2327 | +} | ||
2328 | + | ||
2329 | +/*! | ||
2330 | + \fn QMetaPropertyBuilder::QMetaPropertyBuilder() | ||
2331 | + \internal | ||
2332 | +*/ | ||
2333 | + | ||
2334 | +/*! | ||
2335 | + \fn int QMetaPropertyBuilder::index() const | ||
2336 | + | ||
2337 | + Returns the index of this property within its QMetaObjectBuilder. | ||
2338 | +*/ | ||
2339 | + | ||
2340 | +/*! | ||
2341 | + Returns the name associated with this property. | ||
2342 | + | ||
2343 | + \sa type() | ||
2344 | +*/ | ||
2345 | +QByteArray QMetaPropertyBuilder::name() const | ||
2346 | +{ | ||
2347 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2348 | + if (d) | ||
2349 | + return d->name; | ||
2350 | + else | ||
2351 | + return QByteArray(); | ||
2352 | +} | ||
2353 | + | ||
2354 | +/*! | ||
2355 | + Returns the type associated with this property. | ||
2356 | + | ||
2357 | + \sa name() | ||
2358 | +*/ | ||
2359 | +QByteArray QMetaPropertyBuilder::type() const | ||
2360 | +{ | ||
2361 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2362 | + if (d) | ||
2363 | + return d->type; | ||
2364 | + else | ||
2365 | + return QByteArray(); | ||
2366 | +} | ||
2367 | + | ||
2368 | +/*! | ||
2369 | + Returns true if this property has a notify signal; false otherwise. | ||
2370 | + | ||
2371 | + \sa notifySignal(), setNotifySignal(), removeNotifySignal() | ||
2372 | +*/ | ||
2373 | +bool QMetaPropertyBuilder::hasNotifySignal() const | ||
2374 | +{ | ||
2375 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2376 | + if (d) | ||
2377 | + return d->flag(Notify); | ||
2378 | + else | ||
2379 | + return false; | ||
2380 | +} | ||
2381 | + | ||
2382 | +/*! | ||
2383 | + Returns the notify signal associated with this property. | ||
2384 | + | ||
2385 | + \sa hasNotifySignal(), setNotifySignal(), removeNotifySignal() | ||
2386 | +*/ | ||
2387 | +QMetaMethodBuilder QMetaPropertyBuilder::notifySignal() const | ||
2388 | +{ | ||
2389 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2390 | + if (d && d->notifySignal >= 0) | ||
2391 | + return QMetaMethodBuilder(_mobj, d->notifySignal); | ||
2392 | + else | ||
2393 | + return QMetaMethodBuilder(); | ||
2394 | +} | ||
2395 | + | ||
2396 | +/*! | ||
2397 | + Sets the notify signal associated with this property to \a value. | ||
2398 | + | ||
2399 | + \sa hasNotifySignal(), notifySignal(), removeNotifySignal() | ||
2400 | +*/ | ||
2401 | +void QMetaPropertyBuilder::setNotifySignal(const QMetaMethodBuilder& value) | ||
2402 | +{ | ||
2403 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2404 | + if (d) { | ||
2405 | + if (value._mobj) { | ||
2406 | + d->notifySignal = value._index; | ||
2407 | + d->setFlag(Notify, true); | ||
2408 | + } else { | ||
2409 | + d->notifySignal = -1; | ||
2410 | + d->setFlag(Notify, false); | ||
2411 | + } | ||
2412 | + } | ||
2413 | +} | ||
2414 | + | ||
2415 | +/*! | ||
2416 | + Removes the notify signal from this property. | ||
2417 | + | ||
2418 | + \sa hasNotifySignal(), notifySignal(), setNotifySignal() | ||
2419 | +*/ | ||
2420 | +void QMetaPropertyBuilder::removeNotifySignal() | ||
2421 | +{ | ||
2422 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2423 | + if (d) { | ||
2424 | + d->notifySignal = -1; | ||
2425 | + d->setFlag(Notify, false); | ||
2426 | + } | ||
2427 | +} | ||
2428 | + | ||
2429 | +/*! | ||
2430 | + Returns true if this property is readable; otherwise returns false. | ||
2431 | + The default value is true. | ||
2432 | + | ||
2433 | + \sa setReadable(), isWritable() | ||
2434 | +*/ | ||
2435 | +bool QMetaPropertyBuilder::isReadable() const | ||
2436 | +{ | ||
2437 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2438 | + if (d) | ||
2439 | + return d->flag(Readable); | ||
2440 | + else | ||
2441 | + return false; | ||
2442 | +} | ||
2443 | + | ||
2444 | +/*! | ||
2445 | + Returns true if this property is writable; otherwise returns false. | ||
2446 | + The default value is true. | ||
2447 | + | ||
2448 | + \sa setWritable(), isReadable() | ||
2449 | +*/ | ||
2450 | +bool QMetaPropertyBuilder::isWritable() const | ||
2451 | +{ | ||
2452 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2453 | + if (d) | ||
2454 | + return d->flag(Writable); | ||
2455 | + else | ||
2456 | + return false; | ||
2457 | +} | ||
2458 | + | ||
2459 | +/*! | ||
2460 | + Returns true if this property can be reset to a default value; otherwise | ||
2461 | + returns false. The default value is false. | ||
2462 | + | ||
2463 | + \sa setResettable() | ||
2464 | +*/ | ||
2465 | +bool QMetaPropertyBuilder::isResettable() const | ||
2466 | +{ | ||
2467 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2468 | + if (d) | ||
2469 | + return d->flag(Resettable); | ||
2470 | + else | ||
2471 | + return false; | ||
2472 | +} | ||
2473 | + | ||
2474 | +/*! | ||
2475 | + Returns true if this property is designable; otherwise returns false. | ||
2476 | + This default value is false. | ||
2477 | + | ||
2478 | + \sa setDesignable(), isScriptable(), isStored() | ||
2479 | +*/ | ||
2480 | +bool QMetaPropertyBuilder::isDesignable() const | ||
2481 | +{ | ||
2482 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2483 | + if (d) | ||
2484 | + return d->flag(Designable); | ||
2485 | + else | ||
2486 | + return false; | ||
2487 | +} | ||
2488 | + | ||
2489 | +/*! | ||
2490 | + Returns true if the property is scriptable; otherwise returns false. | ||
2491 | + This default value is true. | ||
2492 | + | ||
2493 | + \sa setScriptable(), isDesignable(), isStored() | ||
2494 | +*/ | ||
2495 | +bool QMetaPropertyBuilder::isScriptable() const | ||
2496 | +{ | ||
2497 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2498 | + if (d) | ||
2499 | + return d->flag(Scriptable); | ||
2500 | + else | ||
2501 | + return false; | ||
2502 | +} | ||
2503 | + | ||
2504 | +/*! | ||
2505 | + Returns true if the property is stored; otherwise returns false. | ||
2506 | + This default value is false. | ||
2507 | + | ||
2508 | + \sa setStored(), isDesignable(), isScriptable() | ||
2509 | +*/ | ||
2510 | +bool QMetaPropertyBuilder::isStored() const | ||
2511 | +{ | ||
2512 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2513 | + if (d) | ||
2514 | + return d->flag(Stored); | ||
2515 | + else | ||
2516 | + return false; | ||
2517 | +} | ||
2518 | + | ||
2519 | +/*! | ||
2520 | + Returns true if the property is editable; otherwise returns false. | ||
2521 | + This default value is false. | ||
2522 | + | ||
2523 | + \sa setEditable(), isDesignable(), isScriptable(), isStored() | ||
2524 | +*/ | ||
2525 | +bool QMetaPropertyBuilder::isEditable() const | ||
2526 | +{ | ||
2527 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2528 | + if (d) | ||
2529 | + return d->flag(Editable); | ||
2530 | + else | ||
2531 | + return false; | ||
2532 | +} | ||
2533 | + | ||
2534 | +/*! | ||
2535 | + Returns true if this property is designated as the \c USER | ||
2536 | + property, i.e., the one that the user can edit or that is | ||
2537 | + significant in some other way. Otherwise it returns | ||
2538 | + false. This default value is false. | ||
2539 | + | ||
2540 | + \sa setUser(), isDesignable(), isScriptable() | ||
2541 | +*/ | ||
2542 | +bool QMetaPropertyBuilder::isUser() const | ||
2543 | +{ | ||
2544 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2545 | + if (d) | ||
2546 | + return d->flag(User); | ||
2547 | + else | ||
2548 | + return false; | ||
2549 | +} | ||
2550 | + | ||
2551 | +/*! | ||
2552 | + Returns true if the property has a C++ setter function that | ||
2553 | + follows Qt's standard "name" / "setName" pattern. Designer and uic | ||
2554 | + query hasStdCppSet() in order to avoid expensive | ||
2555 | + QObject::setProperty() calls. All properties in Qt [should] follow | ||
2556 | + this pattern. The default value is false. | ||
2557 | + | ||
2558 | + \sa setStdCppSet() | ||
2559 | +*/ | ||
2560 | +bool QMetaPropertyBuilder::hasStdCppSet() const | ||
2561 | +{ | ||
2562 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2563 | + if (d) | ||
2564 | + return d->flag(StdCppSet); | ||
2565 | + else | ||
2566 | + return false; | ||
2567 | +} | ||
2568 | + | ||
2569 | +/*! | ||
2570 | + Returns true if the property is an enumerator or flag type; | ||
2571 | + otherwise returns false. This default value is false. | ||
2572 | + | ||
2573 | + \sa setEnumOrFlag() | ||
2574 | +*/ | ||
2575 | +bool QMetaPropertyBuilder::isEnumOrFlag() const | ||
2576 | +{ | ||
2577 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2578 | + if (d) | ||
2579 | + return d->flag(EnumOrFlag); | ||
2580 | + else | ||
2581 | + return false; | ||
2582 | +} | ||
2583 | + | ||
2584 | +/*! | ||
2585 | + Returns true if the property has the dynamic flag set; | ||
2586 | + otherwise returns false. The default value is false. | ||
2587 | + | ||
2588 | + \sa setDynamic() | ||
2589 | +*/ | ||
2590 | +bool QMetaPropertyBuilder::isDynamic() const | ||
2591 | +{ | ||
2592 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2593 | + if (d) | ||
2594 | + return d->flag(Dynamic); | ||
2595 | + else | ||
2596 | + return false; | ||
2597 | +} | ||
2598 | + | ||
2599 | +/*! | ||
2600 | + Sets this property to readable if \a value is true. | ||
2601 | + | ||
2602 | + \sa isReadable(), setWritable() | ||
2603 | +*/ | ||
2604 | +void QMetaPropertyBuilder::setReadable(bool value) | ||
2605 | +{ | ||
2606 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2607 | + if (d) | ||
2608 | + d->setFlag(Readable, value); | ||
2609 | +} | ||
2610 | + | ||
2611 | +/*! | ||
2612 | + Sets this property to writable if \a value is true. | ||
2613 | + | ||
2614 | + \sa isWritable(), setReadable() | ||
2615 | +*/ | ||
2616 | +void QMetaPropertyBuilder::setWritable(bool value) | ||
2617 | +{ | ||
2618 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2619 | + if (d) | ||
2620 | + d->setFlag(Writable, value); | ||
2621 | +} | ||
2622 | + | ||
2623 | +/*! | ||
2624 | + Sets this property to resettable if \a value is true. | ||
2625 | + | ||
2626 | + \sa isResettable() | ||
2627 | +*/ | ||
2628 | +void QMetaPropertyBuilder::setResettable(bool value) | ||
2629 | +{ | ||
2630 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2631 | + if (d) | ||
2632 | + d->setFlag(Resettable, value); | ||
2633 | +} | ||
2634 | + | ||
2635 | +/*! | ||
2636 | + Sets this property to designable if \a value is true. | ||
2637 | + | ||
2638 | + \sa isDesignable(), setScriptable(), setStored() | ||
2639 | +*/ | ||
2640 | +void QMetaPropertyBuilder::setDesignable(bool value) | ||
2641 | +{ | ||
2642 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2643 | + if (d) | ||
2644 | + d->setFlag(Designable, value); | ||
2645 | +} | ||
2646 | + | ||
2647 | +/*! | ||
2648 | + Sets this property to scriptable if \a value is true. | ||
2649 | + | ||
2650 | + \sa isScriptable(), setDesignable(), setStored() | ||
2651 | +*/ | ||
2652 | +void QMetaPropertyBuilder::setScriptable(bool value) | ||
2653 | +{ | ||
2654 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2655 | + if (d) | ||
2656 | + d->setFlag(Scriptable, value); | ||
2657 | +} | ||
2658 | + | ||
2659 | +/*! | ||
2660 | + Sets this property to storable if \a value is true. | ||
2661 | + | ||
2662 | + \sa isStored(), setDesignable(), setScriptable() | ||
2663 | +*/ | ||
2664 | +void QMetaPropertyBuilder::setStored(bool value) | ||
2665 | +{ | ||
2666 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2667 | + if (d) | ||
2668 | + d->setFlag(Stored, value); | ||
2669 | +} | ||
2670 | + | ||
2671 | +/*! | ||
2672 | + Sets this property to editable if \a value is true. | ||
2673 | + | ||
2674 | + \sa isEditable(), setDesignable(), setScriptable(), setStored() | ||
2675 | +*/ | ||
2676 | +void QMetaPropertyBuilder::setEditable(bool value) | ||
2677 | +{ | ||
2678 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2679 | + if (d) | ||
2680 | + d->setFlag(Editable, value); | ||
2681 | +} | ||
2682 | + | ||
2683 | +/*! | ||
2684 | + Sets the \c USER flag on this property to \a value. | ||
2685 | + | ||
2686 | + \sa isUser(), setDesignable(), setScriptable() | ||
2687 | +*/ | ||
2688 | +void QMetaPropertyBuilder::setUser(bool value) | ||
2689 | +{ | ||
2690 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2691 | + if (d) | ||
2692 | + d->setFlag(User, value); | ||
2693 | +} | ||
2694 | + | ||
2695 | +/*! | ||
2696 | + Sets the C++ setter flag on this property to \a value, which is | ||
2697 | + true if the property has a C++ setter function that follows Qt's | ||
2698 | + standard "name" / "setName" pattern. | ||
2699 | + | ||
2700 | + \sa hasStdCppSet() | ||
2701 | +*/ | ||
2702 | +void QMetaPropertyBuilder::setStdCppSet(bool value) | ||
2703 | +{ | ||
2704 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2705 | + if (d) | ||
2706 | + d->setFlag(StdCppSet, value); | ||
2707 | +} | ||
2708 | + | ||
2709 | +/*! | ||
2710 | + Sets this property to be of an enumerator or flag type if | ||
2711 | + \a value is true. | ||
2712 | + | ||
2713 | + \sa isEnumOrFlag() | ||
2714 | +*/ | ||
2715 | +void QMetaPropertyBuilder::setEnumOrFlag(bool value) | ||
2716 | +{ | ||
2717 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2718 | + if (d) | ||
2719 | + d->setFlag(EnumOrFlag, value); | ||
2720 | +} | ||
2721 | + | ||
2722 | +/*! | ||
2723 | + Sets this property to have the dynamic flag if \a value is | ||
2724 | + true. | ||
2725 | + | ||
2726 | + \sa isDynamic() | ||
2727 | +*/ | ||
2728 | +void QMetaPropertyBuilder::setDynamic(bool value) | ||
2729 | +{ | ||
2730 | + QMetaPropertyBuilderPrivate *d = d_func(); | ||
2731 | + if (d) | ||
2732 | + d->setFlag(Dynamic, value); | ||
2733 | +} | ||
2734 | + | ||
2735 | +/*! | ||
2736 | + \class QMetaEnumBuilder | ||
2737 | + \internal | ||
2738 | + \brief The QMetaEnumBuilder class enables modifications to an enumerator definition on a meta object builder. | ||
2739 | +*/ | ||
2740 | + | ||
2741 | +QMetaEnumBuilderPrivate *QMetaEnumBuilder::d_func() const | ||
2742 | +{ | ||
2743 | + if (_mobj && _index >= 0 && _index < _mobj->d->enumerators.size()) | ||
2744 | + return &(_mobj->d->enumerators[_index]); | ||
2745 | + else | ||
2746 | + return 0; | ||
2747 | +} | ||
2748 | + | ||
2749 | +/*! | ||
2750 | + \fn QMetaEnumBuilder::QMetaEnumBuilder() | ||
2751 | + \internal | ||
2752 | +*/ | ||
2753 | + | ||
2754 | +/*! | ||
2755 | + \fn int QMetaEnumBuilder::index() const | ||
2756 | + | ||
2757 | + Returns the index of this enumerator within its QMetaObjectBuilder. | ||
2758 | +*/ | ||
2759 | + | ||
2760 | +/*! | ||
2761 | + Returns the name of the enumerator (without the scope). | ||
2762 | +*/ | ||
2763 | +QByteArray QMetaEnumBuilder::name() const | ||
2764 | +{ | ||
2765 | + QMetaEnumBuilderPrivate *d = d_func(); | ||
2766 | + if (d) | ||
2767 | + return d->name; | ||
2768 | + else | ||
2769 | + return QByteArray(); | ||
2770 | +} | ||
2771 | + | ||
2772 | +/*! | ||
2773 | + Returns true if this enumerator is used as a flag; otherwise returns | ||
2774 | + false. | ||
2775 | + | ||
2776 | + \sa setIsFlag() | ||
2777 | +*/ | ||
2778 | +bool QMetaEnumBuilder::isFlag() const | ||
2779 | +{ | ||
2780 | + QMetaEnumBuilderPrivate *d = d_func(); | ||
2781 | + if (d) | ||
2782 | + return d->isFlag; | ||
2783 | + else | ||
2784 | + return false; | ||
2785 | +} | ||
2786 | + | ||
2787 | +/*! | ||
2788 | + Sets this enumerator to be used as a flag if \a value is true. | ||
2789 | + | ||
2790 | + \sa isFlag() | ||
2791 | +*/ | ||
2792 | +void QMetaEnumBuilder::setIsFlag(bool value) | ||
2793 | +{ | ||
2794 | + QMetaEnumBuilderPrivate *d = d_func(); | ||
2795 | + if (d) | ||
2796 | + d->isFlag = value; | ||
2797 | +} | ||
2798 | + | ||
2799 | +/*! | ||
2800 | + Returns the number of keys. | ||
2801 | + | ||
2802 | + \sa key(), addKey() | ||
2803 | +*/ | ||
2804 | +int QMetaEnumBuilder::keyCount() const | ||
2805 | +{ | ||
2806 | + QMetaEnumBuilderPrivate *d = d_func(); | ||
2807 | + if (d) | ||
2808 | + return d->keys.size(); | ||
2809 | + else | ||
2810 | + return 0; | ||
2811 | +} | ||
2812 | + | ||
2813 | +/*! | ||
2814 | + Returns the key with the given \a index, or an empty QByteArray | ||
2815 | + if no such key exists. | ||
2816 | + | ||
2817 | + \sa keyCount(), addKey(), value() | ||
2818 | +*/ | ||
2819 | +QByteArray QMetaEnumBuilder::key(int index) const | ||
2820 | +{ | ||
2821 | + QMetaEnumBuilderPrivate *d = d_func(); | ||
2822 | + if (d && index >= 0 && index < d->keys.size()) | ||
2823 | + return d->keys[index]; | ||
2824 | + else | ||
2825 | + return QByteArray(); | ||
2826 | +} | ||
2827 | + | ||
2828 | +/*! | ||
2829 | + Returns the value with the given \a index; or returns -1 if there | ||
2830 | + is no such value. | ||
2831 | + | ||
2832 | + \sa keyCount(), addKey(), key() | ||
2833 | +*/ | ||
2834 | +int QMetaEnumBuilder::value(int index) const | ||
2835 | +{ | ||
2836 | + QMetaEnumBuilderPrivate *d = d_func(); | ||
2837 | + if (d && index >= 0 && index < d->keys.size()) | ||
2838 | + return d->values[index]; | ||
2839 | + else | ||
2840 | + return -1; | ||
2841 | +} | ||
2842 | + | ||
2843 | +/*! | ||
2844 | + Adds a new key called \a name to this enumerator, associated | ||
2845 | + with \a value. Returns the index of the new key. | ||
2846 | + | ||
2847 | + \sa keyCount(), key(), value(), removeKey() | ||
2848 | +*/ | ||
2849 | +int QMetaEnumBuilder::addKey(const QByteArray& name, int value) | ||
2850 | +{ | ||
2851 | + QMetaEnumBuilderPrivate *d = d_func(); | ||
2852 | + if (d) { | ||
2853 | + int index = d->keys.size(); | ||
2854 | + d->keys += name; | ||
2855 | + d->values += value; | ||
2856 | + return index; | ||
2857 | + } else { | ||
2858 | + return -1; | ||
2859 | + } | ||
2860 | +} | ||
2861 | + | ||
2862 | +/*! | ||
2863 | + Removes the key at \a index from this enumerator. | ||
2864 | + | ||
2865 | + \sa addKey() | ||
2866 | +*/ | ||
2867 | +void QMetaEnumBuilder::removeKey(int index) | ||
2868 | +{ | ||
2869 | + QMetaEnumBuilderPrivate *d = d_func(); | ||
2870 | + if (d && index >= 0 && index < d->keys.size()) { | ||
2871 | + d->keys.removeAt(index); | ||
2872 | + d->values.removeAt(index); | ||
2873 | + } | ||
2874 | +} | ||
2875 | + | ||
2876 | +QTM_END_NAMESPACE | ||
2877 | diff --git a/src/serviceframework/ipc/qmetaobjectbuilder_47_p.h b/src/serviceframework/ipc/qmetaobjectbuilder_47_p.h | ||
2878 | new file mode 100644 | ||
2879 | index 0000000..5f25e0f | ||
2880 | --- /dev/null | ||
2881 | +++ b/src/serviceframework/ipc/qmetaobjectbuilder_47_p.h | ||
2882 | @@ -0,0 +1,338 @@ | ||
2883 | +/**************************************************************************** | ||
2884 | +** | ||
2885 | +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | ||
2886 | +** All rights reserved. | ||
2887 | +** Contact: Nokia Corporation (qt-info@nokia.com) | ||
2888 | +** | ||
2889 | +** This file is part of the Qt Mobility Components. | ||
2890 | +** | ||
2891 | +** $QT_BEGIN_LICENSE:LGPL$ | ||
2892 | +** No Commercial Usage | ||
2893 | +** This file contains pre-release code and may not be distributed. | ||
2894 | +** You may use this file in accordance with the terms and conditions | ||
2895 | +** contained in the Technology Preview License Agreement accompanying | ||
2896 | +** this package. | ||
2897 | +** | ||
2898 | +** GNU Lesser General Public License Usage | ||
2899 | +** Alternatively, this file may be used under the terms of the GNU Lesser | ||
2900 | +** General Public License version 2.1 as published by the Free Software | ||
2901 | +** Foundation and appearing in the file LICENSE.LGPL included in the | ||
2902 | +** packaging of this file. Please review the following information to | ||
2903 | +** ensure the GNU Lesser General Public License version 2.1 requirements | ||
2904 | +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
2905 | +** | ||
2906 | +** In addition, as a special exception, Nokia gives you certain additional | ||
2907 | +** rights. These rights are described in the Nokia Qt LGPL Exception | ||
2908 | +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
2909 | +** | ||
2910 | +** If you have questions regarding the use of this file, please contact | ||
2911 | +** Nokia at qt-info@nokia.com. | ||
2912 | +** | ||
2913 | +** | ||
2914 | +** | ||
2915 | +** | ||
2916 | +** | ||
2917 | +** | ||
2918 | +** | ||
2919 | +** | ||
2920 | +** $QT_END_LICENSE$ | ||
2921 | +** | ||
2922 | +****************************************************************************/ | ||
2923 | + | ||
2924 | +#ifndef QMETAOBJECTBUILDER_H | ||
2925 | +#define QMETAOBJECTBUILDER_H | ||
2926 | + | ||
2927 | +// | ||
2928 | +// W A R N I N G | ||
2929 | +// ------------- | ||
2930 | +// | ||
2931 | +// This file is not part of the Qt API. It exists for the convenience | ||
2932 | +// of moc. This header file may change from version to version without notice, | ||
2933 | +// or even be removed. | ||
2934 | +// | ||
2935 | +// We mean it. | ||
2936 | +// | ||
2937 | + | ||
2938 | +#include <qmobilityglobal.h> | ||
2939 | +#include <QtCore/qobject.h> | ||
2940 | +#include <QtCore/qmetaobject.h> | ||
2941 | +#include <QtCore/qdatastream.h> | ||
2942 | +#include <QtCore/qmap.h> | ||
2943 | + | ||
2944 | +QTM_BEGIN_NAMESPACE | ||
2945 | + | ||
2946 | +class QMetaObjectBuilderPrivate; | ||
2947 | +class QMetaMethodBuilder; | ||
2948 | +class QMetaMethodBuilderPrivate; | ||
2949 | +class QMetaPropertyBuilder; | ||
2950 | +class QMetaPropertyBuilderPrivate; | ||
2951 | +class QMetaEnumBuilder; | ||
2952 | +class QMetaEnumBuilderPrivate; | ||
2953 | + | ||
2954 | +#ifdef IGNORE_METAOBJECTBUILDER_EXPORT | ||
2955 | + class QMetaObjectBuilder | ||
2956 | +#else | ||
2957 | + class QM_AUTOTEST_EXPORT QMetaObjectBuilder | ||
2958 | +#endif | ||
2959 | +{ | ||
2960 | +public: | ||
2961 | + enum AddMember | ||
2962 | + { | ||
2963 | + ClassName = 0x00000001, | ||
2964 | + SuperClass = 0x00000002, | ||
2965 | + Methods = 0x00000004, | ||
2966 | + Signals = 0x00000008, | ||
2967 | + Slots = 0x00000010, | ||
2968 | + Constructors = 0x00000020, | ||
2969 | + Properties = 0x00000040, | ||
2970 | + Enumerators = 0x00000080, | ||
2971 | + ClassInfos = 0x00000100, | ||
2972 | + RelatedMetaObjects = 0x00000200, | ||
2973 | + StaticMetacall = 0x00000400, | ||
2974 | + PublicMethods = 0x00000800, | ||
2975 | + ProtectedMethods = 0x00001000, | ||
2976 | + PrivateMethods = 0x00002000, | ||
2977 | + AllMembers = 0x7FFFFFFF, | ||
2978 | + AllPrimaryMembers = 0x7FFFFBFC | ||
2979 | + }; | ||
2980 | + Q_DECLARE_FLAGS(AddMembers, AddMember) | ||
2981 | + | ||
2982 | + enum MetaObjectFlag { | ||
2983 | + DynamicMetaObject = 0x01 | ||
2984 | + }; | ||
2985 | + Q_DECLARE_FLAGS(MetaObjectFlags, MetaObjectFlag) | ||
2986 | + | ||
2987 | + QMetaObjectBuilder(); | ||
2988 | + explicit QMetaObjectBuilder(const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members = AllMembers); | ||
2989 | + virtual ~QMetaObjectBuilder(); | ||
2990 | + | ||
2991 | + QByteArray className() const; | ||
2992 | + void setClassName(const QByteArray& name); | ||
2993 | + | ||
2994 | + const QMetaObject *superClass() const; | ||
2995 | + void setSuperClass(const QMetaObject *meta); | ||
2996 | + | ||
2997 | + MetaObjectFlags flags() const; | ||
2998 | + void setFlags(MetaObjectFlags); | ||
2999 | + | ||
3000 | + int methodCount() const; | ||
3001 | + int constructorCount() const; | ||
3002 | + int propertyCount() const; | ||
3003 | + int enumeratorCount() const; | ||
3004 | + int classInfoCount() const; | ||
3005 | + int relatedMetaObjectCount() const; | ||
3006 | + | ||
3007 | + QMetaMethodBuilder addMethod(const QByteArray& signature); | ||
3008 | + QMetaMethodBuilder addMethod(const QByteArray& signature, const QByteArray& returnType); | ||
3009 | + QMetaMethodBuilder addMethod(const QMetaMethod& prototype); | ||
3010 | + | ||
3011 | + QMetaMethodBuilder addSlot(const QByteArray& signature); | ||
3012 | + QMetaMethodBuilder addSignal(const QByteArray& signature); | ||
3013 | + | ||
3014 | + QMetaMethodBuilder addConstructor(const QByteArray& signature); | ||
3015 | + QMetaMethodBuilder addConstructor(const QMetaMethod& prototype); | ||
3016 | + | ||
3017 | + QMetaPropertyBuilder addProperty(const QByteArray& name, const QByteArray& type, int notifierId=-1); | ||
3018 | + QMetaPropertyBuilder addProperty(const QMetaProperty& prototype); | ||
3019 | + | ||
3020 | + QMetaEnumBuilder addEnumerator(const QByteArray& name); | ||
3021 | + QMetaEnumBuilder addEnumerator(const QMetaEnum& prototype); | ||
3022 | + | ||
3023 | + int addClassInfo(const QByteArray& name, const QByteArray& value); | ||
3024 | + | ||
3025 | +#ifdef Q_NO_DATA_RELOCATION | ||
3026 | + int addRelatedMetaObject(const QMetaObjectAccessor &meta); | ||
3027 | +#else | ||
3028 | + int addRelatedMetaObject(const QMetaObject *meta); | ||
3029 | +#endif | ||
3030 | + | ||
3031 | + void addMetaObject(const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members = AllMembers); | ||
3032 | + | ||
3033 | + QMetaMethodBuilder method(int index) const; | ||
3034 | + QMetaMethodBuilder constructor(int index) const; | ||
3035 | + QMetaPropertyBuilder property(int index) const; | ||
3036 | + QMetaEnumBuilder enumerator(int index) const; | ||
3037 | + const QMetaObject *relatedMetaObject(int index) const; | ||
3038 | + | ||
3039 | + QByteArray classInfoName(int index) const; | ||
3040 | + QByteArray classInfoValue(int index) const; | ||
3041 | + | ||
3042 | + void removeMethod(int index); | ||
3043 | + void removeConstructor(int index); | ||
3044 | + void removeProperty(int index); | ||
3045 | + void removeEnumerator(int index); | ||
3046 | + void removeClassInfo(int index); | ||
3047 | + void removeRelatedMetaObject(int index); | ||
3048 | + | ||
3049 | + int indexOfMethod(const QByteArray& signature); | ||
3050 | + int indexOfSignal(const QByteArray& signature); | ||
3051 | + int indexOfSlot(const QByteArray& signature); | ||
3052 | + int indexOfConstructor(const QByteArray& signature); | ||
3053 | + int indexOfProperty(const QByteArray& name); | ||
3054 | + int indexOfEnumerator(const QByteArray& name); | ||
3055 | + int indexOfClassInfo(const QByteArray& name); | ||
3056 | + | ||
3057 | + typedef int (*StaticMetacallFunction)(QMetaObject::Call, int, void **); | ||
3058 | + | ||
3059 | + QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction() const; | ||
3060 | + void setStaticMetacallFunction(QMetaObjectBuilder::StaticMetacallFunction value); | ||
3061 | + | ||
3062 | + QMetaObject *toMetaObject() const; | ||
3063 | + QByteArray toRelocatableData(bool * = 0) const; | ||
3064 | + static void fromRelocatableData(QMetaObject *, const QMetaObject *, const QByteArray &); | ||
3065 | + | ||
3066 | +#ifndef QT_NO_DATASTREAM | ||
3067 | + void serialize(QDataStream& stream) const; | ||
3068 | + void deserialize | ||
3069 | + (QDataStream& stream, | ||
3070 | + const QMap<QByteArray, const QMetaObject *>& references); | ||
3071 | +#endif | ||
3072 | + | ||
3073 | +private: | ||
3074 | + Q_DISABLE_COPY(QMetaObjectBuilder) | ||
3075 | + | ||
3076 | + QMetaObjectBuilderPrivate *d; | ||
3077 | + | ||
3078 | + friend class QMetaMethodBuilder; | ||
3079 | + friend class QMetaPropertyBuilder; | ||
3080 | + friend class QMetaEnumBuilder; | ||
3081 | +}; | ||
3082 | + | ||
3083 | +#ifdef IGNORE_METAOBJECTBUILDER_EXPORT | ||
3084 | + class QMetaMethodBuilder | ||
3085 | +#else | ||
3086 | + class QM_AUTOTEST_EXPORT QMetaMethodBuilder | ||
3087 | +#endif | ||
3088 | +{ | ||
3089 | +public: | ||
3090 | + QMetaMethodBuilder() : _mobj(0), _index(0) {} | ||
3091 | + | ||
3092 | + int index() const; | ||
3093 | + | ||
3094 | + QMetaMethod::MethodType methodType() const; | ||
3095 | + QByteArray signature() const; | ||
3096 | + | ||
3097 | + QByteArray returnType() const; | ||
3098 | + void setReturnType(const QByteArray& value); | ||
3099 | + | ||
3100 | + QList<QByteArray> parameterNames() const; | ||
3101 | + void setParameterNames(const QList<QByteArray>& value); | ||
3102 | + | ||
3103 | + QByteArray tag() const; | ||
3104 | + void setTag(const QByteArray& value); | ||
3105 | + | ||
3106 | + QMetaMethod::Access access() const; | ||
3107 | + void setAccess(QMetaMethod::Access value); | ||
3108 | + | ||
3109 | + int attributes() const; | ||
3110 | + void setAttributes(int value); | ||
3111 | + | ||
3112 | +private: | ||
3113 | + const QMetaObjectBuilder *_mobj; | ||
3114 | + int _index; | ||
3115 | + | ||
3116 | + friend class QMetaObjectBuilder; | ||
3117 | + friend class QMetaPropertyBuilder; | ||
3118 | + | ||
3119 | + QMetaMethodBuilder(const QMetaObjectBuilder *mobj, int index) | ||
3120 | + : _mobj(mobj), _index(index) {} | ||
3121 | + | ||
3122 | + QMetaMethodBuilderPrivate *d_func() const; | ||
3123 | +}; | ||
3124 | + | ||
3125 | +#ifdef IGNORE_METAOBJECTBUILDER_EXPORT | ||
3126 | + class QMetaPropertyBuilder | ||
3127 | +#else | ||
3128 | + class QM_AUTOTEST_EXPORT QMetaPropertyBuilder | ||
3129 | +#endif | ||
3130 | +{ | ||
3131 | +public: | ||
3132 | + QMetaPropertyBuilder() : _mobj(0), _index(0) {} | ||
3133 | + | ||
3134 | + int index() const { return _index; } | ||
3135 | + | ||
3136 | + QByteArray name() const; | ||
3137 | + QByteArray type() const; | ||
3138 | + | ||
3139 | + bool hasNotifySignal() const; | ||
3140 | + QMetaMethodBuilder notifySignal() const; | ||
3141 | + void setNotifySignal(const QMetaMethodBuilder& value); | ||
3142 | + void removeNotifySignal(); | ||
3143 | + | ||
3144 | + bool isReadable() const; | ||
3145 | + bool isWritable() const; | ||
3146 | + bool isResettable() const; | ||
3147 | + bool isDesignable() const; | ||
3148 | + bool isScriptable() const; | ||
3149 | + bool isStored() const; | ||
3150 | + bool isEditable() const; | ||
3151 | + bool isUser() const; | ||
3152 | + bool hasStdCppSet() const; | ||
3153 | + bool isEnumOrFlag() const; | ||
3154 | + bool isDynamic() const; | ||
3155 | + | ||
3156 | + void setReadable(bool value); | ||
3157 | + void setWritable(bool value); | ||
3158 | + void setResettable(bool value); | ||
3159 | + void setDesignable(bool value); | ||
3160 | + void setScriptable(bool value); | ||
3161 | + void setStored(bool value); | ||
3162 | + void setEditable(bool value); | ||
3163 | + void setUser(bool value); | ||
3164 | + void setStdCppSet(bool value); | ||
3165 | + void setEnumOrFlag(bool value); | ||
3166 | + void setDynamic(bool value); | ||
3167 | + | ||
3168 | +private: | ||
3169 | + const QMetaObjectBuilder *_mobj; | ||
3170 | + int _index; | ||
3171 | + | ||
3172 | + friend class QMetaObjectBuilder; | ||
3173 | + | ||
3174 | + QMetaPropertyBuilder(const QMetaObjectBuilder *mobj, int index) | ||
3175 | + : _mobj(mobj), _index(index) {} | ||
3176 | + | ||
3177 | + QMetaPropertyBuilderPrivate *d_func() const; | ||
3178 | +}; | ||
3179 | + | ||
3180 | +#ifdef IGNORE_METAOBJECTBUILDER_EXPORT | ||
3181 | + class QMetaEnumBuilder | ||
3182 | +#else | ||
3183 | + class QM_AUTOTEST_EXPORT QMetaEnumBuilder | ||
3184 | +#endif | ||
3185 | +{ | ||
3186 | +public: | ||
3187 | + QMetaEnumBuilder() : _mobj(0), _index(0) {} | ||
3188 | + | ||
3189 | + int index() const { return _index; } | ||
3190 | + | ||
3191 | + QByteArray name() const; | ||
3192 | + | ||
3193 | + bool isFlag() const; | ||
3194 | + void setIsFlag(bool value); | ||
3195 | + | ||
3196 | + int keyCount() const; | ||
3197 | + QByteArray key(int index) const; | ||
3198 | + int value(int index) const; | ||
3199 | + | ||
3200 | + int addKey(const QByteArray& name, int value); | ||
3201 | + void removeKey(int index); | ||
3202 | + | ||
3203 | +private: | ||
3204 | + const QMetaObjectBuilder *_mobj; | ||
3205 | + int _index; | ||
3206 | + | ||
3207 | + friend class QMetaObjectBuilder; | ||
3208 | + | ||
3209 | + QMetaEnumBuilder(const QMetaObjectBuilder *mobj, int index) | ||
3210 | + : _mobj(mobj), _index(index) {} | ||
3211 | + | ||
3212 | + QMetaEnumBuilderPrivate *d_func() const; | ||
3213 | +}; | ||
3214 | + | ||
3215 | +Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaObjectBuilder::AddMembers) | ||
3216 | +Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaObjectBuilder::MetaObjectFlags) | ||
3217 | + | ||
3218 | +QTM_END_NAMESPACE | ||
3219 | + | ||
3220 | +#endif | ||
3221 | diff --git a/src/serviceframework/ipc/qmetaobjectbuilder_p.h b/src/serviceframework/ipc/qmetaobjectbuilder_p.h | ||
3222 | index 5f25e0f..7f29ddc 100644 | ||
3223 | --- a/src/serviceframework/ipc/qmetaobjectbuilder_p.h | ||
3224 | +++ b/src/serviceframework/ipc/qmetaobjectbuilder_p.h | ||
3225 | @@ -69,6 +69,8 @@ class QMetaPropertyBuilderPrivate; | ||
3226 | class QMetaEnumBuilder; | ||
3227 | class QMetaEnumBuilderPrivate; | ||
3228 | |||
3229 | +typedef const QMetaObject& (*QMetaObjectAccessor)(); | ||
3230 | + | ||
3231 | #ifdef IGNORE_METAOBJECTBUILDER_EXPORT | ||
3232 | class QMetaObjectBuilder | ||
3233 | #else | ||
3234 | @@ -172,7 +174,7 @@ public: | ||
3235 | int indexOfEnumerator(const QByteArray& name); | ||
3236 | int indexOfClassInfo(const QByteArray& name); | ||
3237 | |||
3238 | - typedef int (*StaticMetacallFunction)(QMetaObject::Call, int, void **); | ||
3239 | + typedef QMetaObjectExtraData::StaticMetacallFunction StaticMetacallFunction; | ||
3240 | |||
3241 | QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction() const; | ||
3242 | void setStaticMetacallFunction(QMetaObjectBuilder::StaticMetacallFunction value); | ||
3243 | @@ -269,7 +271,8 @@ public: | ||
3244 | bool isUser() const; | ||
3245 | bool hasStdCppSet() const; | ||
3246 | bool isEnumOrFlag() const; | ||
3247 | - bool isDynamic() const; | ||
3248 | + bool isConstant() const; | ||
3249 | + bool isFinal() const; | ||
3250 | |||
3251 | void setReadable(bool value); | ||
3252 | void setWritable(bool value); | ||
3253 | @@ -281,7 +284,8 @@ public: | ||
3254 | void setUser(bool value); | ||
3255 | void setStdCppSet(bool value); | ||
3256 | void setEnumOrFlag(bool value); | ||
3257 | - void setDynamic(bool value); | ||
3258 | + void setConstant(bool value); | ||
3259 | + void setFinal(bool value); | ||
3260 | |||
3261 | private: | ||
3262 | const QMetaObjectBuilder *_mobj; | ||
3263 | diff --git a/tests/auto/qmetaobjectbuilder/qmetaobjectbuilder.pro b/tests/auto/qmetaobjectbuilder/qmetaobjectbuilder.pro | ||
3264 | index 4cbc03a..fa6123b 100644 | ||
3265 | --- a/tests/auto/qmetaobjectbuilder/qmetaobjectbuilder.pro | ||
3266 | +++ b/tests/auto/qmetaobjectbuilder/qmetaobjectbuilder.pro | ||
3267 | @@ -9,7 +9,11 @@ QT = core | ||
3268 | include(../../../common.pri) | ||
3269 | |||
3270 | # Input | ||
3271 | -SOURCES += tst_qmetaobjectbuilder.cpp | ||
3272 | +contains(QT_MAJOR_VERSION, 4):lessThan(QT_MINOR_VERSION, 8) { | ||
3273 | + SOURCES += tst_qmetaobjectbuilder_47.cpp | ||
3274 | +} else { | ||
3275 | + SOURCES += tst_qmetaobjectbuilder.cpp | ||
3276 | +} | ||
3277 | |||
3278 | CONFIG += mobility | ||
3279 | MOBILITY = serviceframework | ||
3280 | diff --git a/tests/auto/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp | ||
3281 | index 48ba43c..470d9e5 100644 | ||
3282 | --- a/tests/auto/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp | ||
3283 | +++ b/tests/auto/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp | ||
3284 | @@ -149,9 +149,9 @@ void tst_QMetaObjectBuilder::mocVersionCheck() | ||
3285 | // whenenver moc changes. Once QMetaObjectBuilder has been | ||
3286 | // updated, this test can be changed to check for the next version. | ||
3287 | int version = int(QObject::staticMetaObject.d.data[0]); | ||
3288 | - QVERIFY(version == 4 || version == 5); | ||
3289 | + QVERIFY(version == 4 || version == 5 || version == 6); | ||
3290 | version = int(staticMetaObject.d.data[0]); | ||
3291 | - QVERIFY(version == 4 || version == 5); | ||
3292 | + QVERIFY(version == 4 || version == 5 || version == 6); | ||
3293 | } | ||
3294 | |||
3295 | void tst_QMetaObjectBuilder::create() | ||
3296 | @@ -555,7 +555,8 @@ void tst_QMetaObjectBuilder::property() | ||
3297 | QVERIFY(!nullProp.isUser()); | ||
3298 | QVERIFY(!nullProp.hasStdCppSet()); | ||
3299 | QVERIFY(!nullProp.isEnumOrFlag()); | ||
3300 | - QVERIFY(!nullProp.isDynamic()); | ||
3301 | + QVERIFY(!nullProp.isConstant()); | ||
3302 | + QVERIFY(!nullProp.isFinal()); | ||
3303 | QCOMPARE(nullProp.index(), 0); | ||
3304 | |||
3305 | // Add a property and check its attributes. | ||
3306 | @@ -573,7 +574,8 @@ void tst_QMetaObjectBuilder::property() | ||
3307 | QVERIFY(!prop1.isUser()); | ||
3308 | QVERIFY(!prop1.hasStdCppSet()); | ||
3309 | QVERIFY(!prop1.isEnumOrFlag()); | ||
3310 | - QVERIFY(!prop1.isDynamic()); | ||
3311 | + QVERIFY(!prop1.isConstant()); | ||
3312 | + QVERIFY(!prop1.isFinal()); | ||
3313 | QCOMPARE(prop1.index(), 0); | ||
3314 | QCOMPARE(builder.propertyCount(), 1); | ||
3315 | |||
3316 | @@ -592,7 +594,8 @@ void tst_QMetaObjectBuilder::property() | ||
3317 | QVERIFY(!prop2.isUser()); | ||
3318 | QVERIFY(!prop2.hasStdCppSet()); | ||
3319 | QVERIFY(!prop2.isEnumOrFlag()); | ||
3320 | - QVERIFY(!prop2.isDynamic()); | ||
3321 | + QVERIFY(!prop2.isConstant()); | ||
3322 | + QVERIFY(!prop2.isFinal()); | ||
3323 | QCOMPARE(prop2.index(), 1); | ||
3324 | QCOMPARE(builder.propertyCount(), 2); | ||
3325 | |||
3326 | @@ -614,7 +617,8 @@ void tst_QMetaObjectBuilder::property() | ||
3327 | prop1.setUser(true); | ||
3328 | prop1.setStdCppSet(true); | ||
3329 | prop1.setEnumOrFlag(true); | ||
3330 | - prop1.setDynamic(true); | ||
3331 | + prop1.setConstant(true); | ||
3332 | + prop1.setFinal(true); | ||
3333 | |||
3334 | // Check that prop1 is changed, but prop2 is not. | ||
3335 | QCOMPARE(prop1.name(), QByteArray("foo")); | ||
3336 | @@ -629,7 +633,8 @@ void tst_QMetaObjectBuilder::property() | ||
3337 | QVERIFY(prop1.isUser()); | ||
3338 | QVERIFY(prop1.hasStdCppSet()); | ||
3339 | QVERIFY(prop1.isEnumOrFlag()); | ||
3340 | - QVERIFY(prop1.isDynamic()); | ||
3341 | + QVERIFY(prop1.isConstant()); | ||
3342 | + QVERIFY(prop1.isFinal()); | ||
3343 | QVERIFY(prop2.isReadable()); | ||
3344 | QVERIFY(prop2.isWritable()); | ||
3345 | QCOMPARE(prop2.name(), QByteArray("bar")); | ||
3346 | @@ -642,7 +647,8 @@ void tst_QMetaObjectBuilder::property() | ||
3347 | QVERIFY(!prop2.isUser()); | ||
3348 | QVERIFY(!prop2.hasStdCppSet()); | ||
3349 | QVERIFY(!prop2.isEnumOrFlag()); | ||
3350 | - QVERIFY(!prop2.isDynamic()); | ||
3351 | + QVERIFY(!prop2.isConstant()); | ||
3352 | + QVERIFY(!prop2.isFinal()); | ||
3353 | |||
3354 | // Remove prop1 and check that prop2 becomes index 0. | ||
3355 | builder.removeProperty(0); | ||
3356 | @@ -658,7 +664,8 @@ void tst_QMetaObjectBuilder::property() | ||
3357 | QVERIFY(!prop2.isUser()); | ||
3358 | QVERIFY(!prop2.hasStdCppSet()); | ||
3359 | QVERIFY(!prop2.isEnumOrFlag()); | ||
3360 | - QVERIFY(!prop2.isDynamic()); | ||
3361 | + QVERIFY(!prop2.isConstant()); | ||
3362 | + QVERIFY(!prop2.isFinal()); | ||
3363 | QCOMPARE(prop2.index(), 0); | ||
3364 | |||
3365 | // Perform index-based lookup again. | ||
3366 | @@ -682,7 +689,8 @@ void tst_QMetaObjectBuilder::property() | ||
3367 | prop2.setUser(false); \ | ||
3368 | prop2.setStdCppSet(false); \ | ||
3369 | prop2.setEnumOrFlag(false); \ | ||
3370 | - prop2.setDynamic(false); \ | ||
3371 | + prop2.setConstant(false); \ | ||
3372 | + prop2.setFinal(false); \ | ||
3373 | } while (0) | ||
3374 | #define COUNT_FLAGS() \ | ||
3375 | ((prop2.isReadable() ? 1 : 0) + \ | ||
3376 | @@ -695,7 +703,8 @@ void tst_QMetaObjectBuilder::property() | ||
3377 | (prop2.isUser() ? 1 : 0) + \ | ||
3378 | (prop2.hasStdCppSet() ? 1 : 0) + \ | ||
3379 | (prop2.isEnumOrFlag() ? 1 : 0) + \ | ||
3380 | - (prop2.isDynamic() ? 1 : 0)) | ||
3381 | + (prop2.isConstant() ? 1 : 0) + \ | ||
3382 | + (prop2.isFinal() ? 1 : 0)) | ||
3383 | #define CHECK_FLAG(setFunc,isFunc) \ | ||
3384 | do { \ | ||
3385 | CLEAR_FLAGS(); \ | ||
3386 | @@ -714,7 +723,8 @@ void tst_QMetaObjectBuilder::property() | ||
3387 | CHECK_FLAG(setUser, isUser); | ||
3388 | CHECK_FLAG(setStdCppSet, hasStdCppSet); | ||
3389 | CHECK_FLAG(setEnumOrFlag, isEnumOrFlag); | ||
3390 | - CHECK_FLAG(setDynamic, isDynamic); | ||
3391 | + CHECK_FLAG(setConstant, isConstant); | ||
3392 | + CHECK_FLAG(setFinal, isFinal); | ||
3393 | |||
3394 | // Check that nothing else changed. | ||
3395 | QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Properties)); | ||
3396 | @@ -958,9 +968,9 @@ void tst_QMetaObjectBuilder::relatedMetaObject() | ||
3397 | QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::RelatedMetaObjects)); | ||
3398 | } | ||
3399 | |||
3400 | -static int smetacall(QMetaObject::Call, int, void **) | ||
3401 | +static void smetacall(QObject *, QMetaObject::Call, int, void **) | ||
3402 | { | ||
3403 | - return 0; | ||
3404 | + return; | ||
3405 | } | ||
3406 | |||
3407 | void tst_QMetaObjectBuilder::staticMetacall() | ||
3408 | @@ -1263,8 +1273,8 @@ bool tst_QMetaObjectBuilder::sameMetaObject | ||
3409 | if (extra1 && extra2) { | ||
3410 | if (extra1->static_metacall != extra2->static_metacall) | ||
3411 | return false; | ||
3412 | - //objects1 = extra1->objects; | ||
3413 | - //objects2 = extra1->objects; | ||
3414 | + objects1 = extra1->objects; | ||
3415 | + objects2 = extra1->objects; | ||
3416 | } | ||
3417 | } else if (meta1->d.data[0] == meta2->d.data[0] && meta1->d.data[0] == 1) { | ||
3418 | objects1 = (const QMetaObject **)(meta1->d.extradata); | ||
3419 | diff --git a/tests/auto/qmetaobjectbuilder/tst_qmetaobjectbuilder_47.cpp b/tests/auto/qmetaobjectbuilder/tst_qmetaobjectbuilder_47.cpp | ||
3420 | new file mode 100644 | ||
3421 | index 0000000..96a7eca | ||
3422 | --- /dev/null | ||
3423 | +++ b/tests/auto/qmetaobjectbuilder/tst_qmetaobjectbuilder_47.cpp | ||
3424 | @@ -0,0 +1,1283 @@ | ||
3425 | +/**************************************************************************** | ||
3426 | +** | ||
3427 | +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | ||
3428 | +** All rights reserved. | ||
3429 | +** Contact: Nokia Corporation (qt-info@nokia.com) | ||
3430 | +** | ||
3431 | +** This file is part of the test suite of the Qt Toolkit. | ||
3432 | +** | ||
3433 | +** $QT_BEGIN_LICENSE:LGPL$ | ||
3434 | +** No Commercial Usage | ||
3435 | +** This file contains pre-release code and may not be distributed. | ||
3436 | +** You may use this file in accordance with the terms and conditions | ||
3437 | +** contained in the Technology Preview License Agreement accompanying | ||
3438 | +** this package. | ||
3439 | +** | ||
3440 | +** GNU Lesser General Public License Usage | ||
3441 | +** Alternatively, this file may be used under the terms of the GNU Lesser | ||
3442 | +** General Public License version 2.1 as published by the Free Software | ||
3443 | +** Foundation and appearing in the file LICENSE.LGPL included in the | ||
3444 | +** packaging of this file. Please review the following information to | ||
3445 | +** ensure the GNU Lesser General Public License version 2.1 requirements | ||
3446 | +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
3447 | +** | ||
3448 | +** In addition, as a special exception, Nokia gives you certain additional | ||
3449 | +** rights. These rights are described in the Nokia Qt LGPL Exception | ||
3450 | +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
3451 | +** | ||
3452 | +** If you have questions regarding the use of this file, please contact | ||
3453 | +** Nokia at qt-info@nokia.com. | ||
3454 | +** | ||
3455 | +** | ||
3456 | +** | ||
3457 | +** | ||
3458 | +** | ||
3459 | +** | ||
3460 | +** | ||
3461 | +** | ||
3462 | +** $QT_END_LICENSE$ | ||
3463 | +** | ||
3464 | +****************************************************************************/ | ||
3465 | + | ||
3466 | +//TESTED_COMPONENT=src/serviceframework | ||
3467 | + | ||
3468 | +#include <qmobilityglobal.h> | ||
3469 | +#include <QtTest/QtTest> | ||
3470 | +#include <QtCore/qlocale.h> | ||
3471 | +#include <qmetaobjectbuilder_47_p.h> | ||
3472 | + | ||
3473 | +QTM_USE_NAMESPACE | ||
3474 | + | ||
3475 | +class tst_QMetaObjectBuilder : public QObject | ||
3476 | +{ | ||
3477 | + Q_OBJECT | ||
3478 | +public: | ||
3479 | + tst_QMetaObjectBuilder() {} | ||
3480 | + ~tst_QMetaObjectBuilder() {} | ||
3481 | + | ||
3482 | +private slots: | ||
3483 | + void mocVersionCheck(); | ||
3484 | + void create(); | ||
3485 | + void className(); | ||
3486 | + void superClass(); | ||
3487 | + void flags(); | ||
3488 | + void method(); | ||
3489 | + void slot(); | ||
3490 | + void signal(); | ||
3491 | + void constructor(); | ||
3492 | + void property(); | ||
3493 | + void notifySignal(); | ||
3494 | + void enumerator(); | ||
3495 | + void classInfo(); | ||
3496 | + void relatedMetaObject(); | ||
3497 | + void staticMetacall(); | ||
3498 | + void copyMetaObject(); | ||
3499 | + void serialize(); | ||
3500 | + void removeNotifySignal(); | ||
3501 | + | ||
3502 | +private: | ||
3503 | + static bool checkForSideEffects | ||
3504 | + (const QMetaObjectBuilder& builder, | ||
3505 | + QMetaObjectBuilder::AddMembers members); | ||
3506 | + static bool sameMetaObject | ||
3507 | + (const QMetaObject *meta1, const QMetaObject *meta2); | ||
3508 | +}; | ||
3509 | + | ||
3510 | +#ifdef Q_NO_DATA_RELOCATION | ||
3511 | +const QMetaObject *meta; | ||
3512 | +#endif | ||
3513 | + | ||
3514 | +// Dummy class that has something of every type of thing moc can generate. | ||
3515 | +class SomethingOfEverything : public QObject | ||
3516 | +{ | ||
3517 | + Q_OBJECT | ||
3518 | + Q_CLASSINFO("ci_foo", "ABC") | ||
3519 | + Q_CLASSINFO("ci_bar", "DEF") | ||
3520 | + Q_PROPERTY(QString prop READ prop WRITE setProp NOTIFY propChanged) | ||
3521 | + Q_PROPERTY(QString prop2 READ prop WRITE setProp) | ||
3522 | + Q_PROPERTY(SomethingEnum eprop READ eprop) | ||
3523 | + Q_PROPERTY(SomethingFlagEnum fprop READ fprop) | ||
3524 | + Q_PROPERTY(QLocale::Language language READ language) | ||
3525 | + Q_ENUMS(SomethingEnum) | ||
3526 | + Q_FLAGS(SomethingFlagEnum) | ||
3527 | +public: | ||
3528 | + Q_INVOKABLE SomethingOfEverything() {} | ||
3529 | + ~SomethingOfEverything() {} | ||
3530 | + | ||
3531 | + enum SomethingEnum | ||
3532 | + { | ||
3533 | + GHI, | ||
3534 | + JKL = 10 | ||
3535 | + }; | ||
3536 | + | ||
3537 | + enum SomethingFlagEnum | ||
3538 | + { | ||
3539 | + XYZ = 1, | ||
3540 | + UVW = 8 | ||
3541 | + }; | ||
3542 | + | ||
3543 | + Q_INVOKABLE Q_SCRIPTABLE void method1() {} | ||
3544 | + | ||
3545 | + QString prop() const { return QString(); } | ||
3546 | + void setProp(const QString& v) { Q_UNUSED(v); } | ||
3547 | + | ||
3548 | + SomethingOfEverything::SomethingEnum eprop() const { return GHI; } | ||
3549 | + SomethingOfEverything::SomethingFlagEnum fprop() const { return XYZ; } | ||
3550 | + QLocale::Language language() const { return QLocale::English; } | ||
3551 | + | ||
3552 | +public slots: | ||
3553 | + void slot1(const QString&) {} | ||
3554 | + void slot2(int, const QString&) {} | ||
3555 | + | ||
3556 | +private slots: | ||
3557 | + void slot3() {} | ||
3558 | + | ||
3559 | +protected slots: | ||
3560 | + Q_SCRIPTABLE void slot4(int) {} | ||
3561 | + void slot5(int a, const QString& b) { Q_UNUSED(a); Q_UNUSED(b); } | ||
3562 | + | ||
3563 | +signals: | ||
3564 | + void sig1(); | ||
3565 | + void sig2(int x, const QString& y); | ||
3566 | + void propChanged(const QString&); | ||
3567 | +}; | ||
3568 | + | ||
3569 | +void tst_QMetaObjectBuilder::mocVersionCheck() | ||
3570 | +{ | ||
3571 | + // This test will fail when the moc version number is changed. | ||
3572 | + // It is intended as a reminder to also update QMetaObjectBuilder | ||
3573 | + // whenenver moc changes. Once QMetaObjectBuilder has been | ||
3574 | + // updated, this test can be changed to check for the next version. | ||
3575 | + int version = int(QObject::staticMetaObject.d.data[0]); | ||
3576 | + QVERIFY(version == 4 || version == 5 || version == 6); | ||
3577 | + version = int(staticMetaObject.d.data[0]); | ||
3578 | + QVERIFY(version == 4 || version == 5 || version == 6); | ||
3579 | +} | ||
3580 | + | ||
3581 | +void tst_QMetaObjectBuilder::create() | ||
3582 | +{ | ||
3583 | + QMetaObjectBuilder builder; | ||
3584 | + QVERIFY(builder.className().isEmpty()); | ||
3585 | + QVERIFY(builder.superClass() == &QObject::staticMetaObject); | ||
3586 | + QCOMPARE(builder.methodCount(), 0); | ||
3587 | + QCOMPARE(builder.constructorCount(), 0); | ||
3588 | + QCOMPARE(builder.propertyCount(), 0); | ||
3589 | + QCOMPARE(builder.enumeratorCount(), 0); | ||
3590 | + QCOMPARE(builder.classInfoCount(), 0); | ||
3591 | + QCOMPARE(builder.relatedMetaObjectCount(), 0); | ||
3592 | + QVERIFY(builder.staticMetacallFunction() == 0); | ||
3593 | +} | ||
3594 | + | ||
3595 | +void tst_QMetaObjectBuilder::className() | ||
3596 | +{ | ||
3597 | + QMetaObjectBuilder builder; | ||
3598 | + | ||
3599 | + // Change the class name. | ||
3600 | + builder.setClassName("Foo"); | ||
3601 | + QCOMPARE(builder.className(), QByteArray("Foo")); | ||
3602 | + | ||
3603 | + // Change it again. | ||
3604 | + builder.setClassName("Bar"); | ||
3605 | + QCOMPARE(builder.className(), QByteArray("Bar")); | ||
3606 | + | ||
3607 | + // Clone the class name off a static QMetaObject. | ||
3608 | + builder.addMetaObject(&QObject::staticMetaObject, QMetaObjectBuilder::ClassName); | ||
3609 | + QCOMPARE(builder.className(), QByteArray("QObject")); | ||
3610 | + | ||
3611 | + // Check that nothing else changed. | ||
3612 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::ClassName)); | ||
3613 | +} | ||
3614 | + | ||
3615 | +void tst_QMetaObjectBuilder::superClass() | ||
3616 | +{ | ||
3617 | + QMetaObjectBuilder builder; | ||
3618 | + | ||
3619 | + // Change the super class. | ||
3620 | + builder.setSuperClass(&QObject::staticMetaObject); | ||
3621 | + QVERIFY(builder.superClass() == &QObject::staticMetaObject); | ||
3622 | + | ||
3623 | + // Change it again. | ||
3624 | + builder.setSuperClass(&staticMetaObject); | ||
3625 | + QVERIFY(builder.superClass() == &staticMetaObject); | ||
3626 | + | ||
3627 | + // Clone the super class off a static QMetaObject. | ||
3628 | + builder.addMetaObject(&QObject::staticMetaObject, QMetaObjectBuilder::SuperClass); | ||
3629 | + QVERIFY(builder.superClass() == 0); | ||
3630 | + builder.addMetaObject(&staticMetaObject, QMetaObjectBuilder::SuperClass); | ||
3631 | + QVERIFY(builder.superClass() == staticMetaObject.superClass()); | ||
3632 | + | ||
3633 | + // Check that nothing else changed. | ||
3634 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::SuperClass)); | ||
3635 | +} | ||
3636 | + | ||
3637 | +void tst_QMetaObjectBuilder::flags() | ||
3638 | +{ | ||
3639 | + QMetaObjectBuilder builder; | ||
3640 | + | ||
3641 | + // Check default | ||
3642 | + QVERIFY(builder.flags() == 0); | ||
3643 | + | ||
3644 | + // Set flags | ||
3645 | + builder.setFlags(QMetaObjectBuilder::DynamicMetaObject); | ||
3646 | + QVERIFY(builder.flags() == QMetaObjectBuilder::DynamicMetaObject); | ||
3647 | +} | ||
3648 | + | ||
3649 | +void tst_QMetaObjectBuilder::method() | ||
3650 | +{ | ||
3651 | + QMetaObjectBuilder builder; | ||
3652 | + | ||
3653 | + // Check null method | ||
3654 | + QMetaMethodBuilder nullMethod; | ||
3655 | + QCOMPARE(nullMethod.signature(), QByteArray()); | ||
3656 | + QVERIFY(nullMethod.methodType() == QMetaMethod::Method); | ||
3657 | + QVERIFY(nullMethod.returnType().isEmpty()); | ||
3658 | + QVERIFY(nullMethod.parameterNames().isEmpty()); | ||
3659 | + QVERIFY(nullMethod.tag().isEmpty()); | ||
3660 | + QVERIFY(nullMethod.access() == QMetaMethod::Public); | ||
3661 | + QCOMPARE(nullMethod.attributes(), 0); | ||
3662 | + QCOMPARE(nullMethod.index(), 0); | ||
3663 | + | ||
3664 | + // Add a method and check its attributes. | ||
3665 | + QMetaMethodBuilder method1 = builder.addMethod("foo(const QString&, int)"); | ||
3666 | + QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); | ||
3667 | + QVERIFY(method1.methodType() == QMetaMethod::Method); | ||
3668 | + QVERIFY(method1.returnType().isEmpty()); | ||
3669 | + QVERIFY(method1.parameterNames().isEmpty()); | ||
3670 | + QVERIFY(method1.tag().isEmpty()); | ||
3671 | + QVERIFY(method1.access() == QMetaMethod::Public); | ||
3672 | + QCOMPARE(method1.attributes(), 0); | ||
3673 | + QCOMPARE(method1.index(), 0); | ||
3674 | + QCOMPARE(builder.methodCount(), 1); | ||
3675 | + | ||
3676 | + // Add another method and check again. | ||
3677 | + QMetaMethodBuilder method2 = builder.addMethod("bar(QString)", "int"); | ||
3678 | + QCOMPARE(method2.signature(), QByteArray("bar(QString)")); | ||
3679 | + QVERIFY(method2.methodType() == QMetaMethod::Method); | ||
3680 | + QCOMPARE(method2.returnType(), QByteArray("int")); | ||
3681 | + QVERIFY(method2.parameterNames().isEmpty()); | ||
3682 | + QVERIFY(method2.tag().isEmpty()); | ||
3683 | + QVERIFY(method2.access() == QMetaMethod::Public); | ||
3684 | + QCOMPARE(method2.attributes(), 0); | ||
3685 | + QCOMPARE(method2.index(), 1); | ||
3686 | + QCOMPARE(builder.methodCount(), 2); | ||
3687 | + | ||
3688 | + // Perform index-based lookup. | ||
3689 | + QCOMPARE(builder.indexOfMethod("foo(const QString&, int)"), 0); | ||
3690 | + QCOMPARE(builder.indexOfMethod("bar(QString)"), 1); | ||
3691 | + QCOMPARE(builder.indexOfMethod("baz()"), -1); | ||
3692 | + | ||
3693 | + // Modify the attributes on method1. | ||
3694 | + method1.setReturnType("int"); | ||
3695 | + method1.setParameterNames(QList<QByteArray>() << "a" << "b"); | ||
3696 | + method1.setTag("tag"); | ||
3697 | + method1.setAccess(QMetaMethod::Private); | ||
3698 | + method1.setAttributes(42); | ||
3699 | + | ||
3700 | + // Check that method1 is changed, but method2 is not. | ||
3701 | + QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); | ||
3702 | + QVERIFY(method1.methodType() == QMetaMethod::Method); | ||
3703 | + QCOMPARE(method1.returnType(), QByteArray("int")); | ||
3704 | + QCOMPARE(method1.parameterNames(), QList<QByteArray>() << "a" << "b"); | ||
3705 | + QCOMPARE(method1.tag(), QByteArray("tag")); | ||
3706 | + QVERIFY(method1.access() == QMetaMethod::Private); | ||
3707 | + QCOMPARE(method1.attributes(), 42); | ||
3708 | + QCOMPARE(method1.index(), 0); | ||
3709 | + QCOMPARE(method2.signature(), QByteArray("bar(QString)")); | ||
3710 | + QVERIFY(method2.methodType() == QMetaMethod::Method); | ||
3711 | + QCOMPARE(method2.returnType(), QByteArray("int")); | ||
3712 | + QVERIFY(method2.parameterNames().isEmpty()); | ||
3713 | + QVERIFY(method2.tag().isEmpty()); | ||
3714 | + QVERIFY(method2.access() == QMetaMethod::Public); | ||
3715 | + QCOMPARE(method2.attributes(), 0); | ||
3716 | + QCOMPARE(method2.index(), 1); | ||
3717 | + QCOMPARE(builder.methodCount(), 2); | ||
3718 | + | ||
3719 | + // Modify the attributes on method2. | ||
3720 | + method2.setReturnType("QString"); | ||
3721 | + method2.setParameterNames(QList<QByteArray>() << "c"); | ||
3722 | + method2.setTag("Q_FOO"); | ||
3723 | + method2.setAccess(QMetaMethod::Protected); | ||
3724 | + method2.setAttributes(24); | ||
3725 | + | ||
3726 | + // This time check that only method2 changed. | ||
3727 | + QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); | ||
3728 | + QVERIFY(method1.methodType() == QMetaMethod::Method); | ||
3729 | + QCOMPARE(method1.returnType(), QByteArray("int")); | ||
3730 | + QCOMPARE(method1.parameterNames(), QList<QByteArray>() << "a" << "b"); | ||
3731 | + QCOMPARE(method1.tag(), QByteArray("tag")); | ||
3732 | + QVERIFY(method1.access() == QMetaMethod::Private); | ||
3733 | + QCOMPARE(method1.attributes(), 42); | ||
3734 | + QCOMPARE(method1.index(), 0); | ||
3735 | + QCOMPARE(method2.signature(), QByteArray("bar(QString)")); | ||
3736 | + QVERIFY(method2.methodType() == QMetaMethod::Method); | ||
3737 | + QCOMPARE(method2.returnType(), QByteArray("QString")); | ||
3738 | + QCOMPARE(method2.parameterNames(), QList<QByteArray>() << "c"); | ||
3739 | + QCOMPARE(method2.tag(), QByteArray("Q_FOO")); | ||
3740 | + QVERIFY(method2.access() == QMetaMethod::Protected); | ||
3741 | + QCOMPARE(method2.attributes(), 24); | ||
3742 | + QCOMPARE(method2.index(), 1); | ||
3743 | + QCOMPARE(builder.methodCount(), 2); | ||
3744 | + | ||
3745 | + // Remove method1 and check that method2 becomes index 0. | ||
3746 | + builder.removeMethod(0); | ||
3747 | + QCOMPARE(builder.methodCount(), 1); | ||
3748 | + method2 = builder.method(0); | ||
3749 | + QCOMPARE(method2.signature(), QByteArray("bar(QString)")); | ||
3750 | + QVERIFY(method2.methodType() == QMetaMethod::Method); | ||
3751 | + QCOMPARE(method2.returnType(), QByteArray("QString")); | ||
3752 | + QCOMPARE(method2.parameterNames(), QList<QByteArray>() << "c"); | ||
3753 | + QCOMPARE(method2.tag(), QByteArray("Q_FOO")); | ||
3754 | + QVERIFY(method2.access() == QMetaMethod::Protected); | ||
3755 | + QCOMPARE(method2.attributes(), 24); | ||
3756 | + QCOMPARE(method2.index(), 0); | ||
3757 | + | ||
3758 | + // Perform index-based lookup again. | ||
3759 | + QCOMPARE(builder.indexOfMethod("foo(const QString&, int)"), -1); | ||
3760 | + QCOMPARE(builder.indexOfMethod("bar(QString)"), 0); | ||
3761 | + QCOMPARE(builder.indexOfMethod("baz()"), -1); | ||
3762 | + QCOMPARE(builder.method(0).signature(), QByteArray("bar(QString)")); | ||
3763 | + QCOMPARE(builder.method(9).signature(), QByteArray()); | ||
3764 | + | ||
3765 | + // Check that nothing else changed. | ||
3766 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Methods)); | ||
3767 | +} | ||
3768 | + | ||
3769 | +void tst_QMetaObjectBuilder::slot() | ||
3770 | +{ | ||
3771 | + QMetaObjectBuilder builder; | ||
3772 | + | ||
3773 | + // Add a slot and check its attributes. | ||
3774 | + QMetaMethodBuilder method1 = builder.addSlot("foo(const QString&, int)"); | ||
3775 | + QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); | ||
3776 | + QVERIFY(method1.methodType() == QMetaMethod::Slot); | ||
3777 | + QVERIFY(method1.returnType().isEmpty()); | ||
3778 | + QVERIFY(method1.parameterNames().isEmpty()); | ||
3779 | + QVERIFY(method1.tag().isEmpty()); | ||
3780 | + QVERIFY(method1.access() == QMetaMethod::Public); | ||
3781 | + QCOMPARE(method1.attributes(), 0); | ||
3782 | + QCOMPARE(method1.index(), 0); | ||
3783 | + QCOMPARE(builder.methodCount(), 1); | ||
3784 | + | ||
3785 | + // Add another slot and check again. | ||
3786 | + QMetaMethodBuilder method2 = builder.addSlot("bar(QString)"); | ||
3787 | + QCOMPARE(method2.signature(), QByteArray("bar(QString)")); | ||
3788 | + QVERIFY(method2.methodType() == QMetaMethod::Slot); | ||
3789 | + QVERIFY(method2.returnType().isEmpty()); | ||
3790 | + QVERIFY(method2.parameterNames().isEmpty()); | ||
3791 | + QVERIFY(method2.tag().isEmpty()); | ||
3792 | + QVERIFY(method2.access() == QMetaMethod::Public); | ||
3793 | + QCOMPARE(method2.attributes(), 0); | ||
3794 | + QCOMPARE(method2.index(), 1); | ||
3795 | + QCOMPARE(builder.methodCount(), 2); | ||
3796 | + | ||
3797 | + // Perform index-based lookup | ||
3798 | + QCOMPARE(builder.indexOfSlot("foo(const QString &, int)"), 0); | ||
3799 | + QCOMPARE(builder.indexOfSlot("bar(QString)"), 1); | ||
3800 | + QCOMPARE(builder.indexOfSlot("baz()"), -1); | ||
3801 | + | ||
3802 | + // Check that nothing else changed. | ||
3803 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Methods)); | ||
3804 | +} | ||
3805 | + | ||
3806 | +void tst_QMetaObjectBuilder::signal() | ||
3807 | +{ | ||
3808 | + QMetaObjectBuilder builder; | ||
3809 | + | ||
3810 | + // Add a signal and check its attributes. | ||
3811 | + QMetaMethodBuilder method1 = builder.addSignal("foo(const QString&, int)"); | ||
3812 | + QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); | ||
3813 | + QVERIFY(method1.methodType() == QMetaMethod::Signal); | ||
3814 | + QVERIFY(method1.returnType().isEmpty()); | ||
3815 | + QVERIFY(method1.parameterNames().isEmpty()); | ||
3816 | + QVERIFY(method1.tag().isEmpty()); | ||
3817 | + QVERIFY(method1.access() == QMetaMethod::Protected); | ||
3818 | + QCOMPARE(method1.attributes(), 0); | ||
3819 | + QCOMPARE(method1.index(), 0); | ||
3820 | + QCOMPARE(builder.methodCount(), 1); | ||
3821 | + | ||
3822 | + // Add another signal and check again. | ||
3823 | + QMetaMethodBuilder method2 = builder.addSignal("bar(QString)"); | ||
3824 | + QCOMPARE(method2.signature(), QByteArray("bar(QString)")); | ||
3825 | + QVERIFY(method2.methodType() == QMetaMethod::Signal); | ||
3826 | + QVERIFY(method2.returnType().isEmpty()); | ||
3827 | + QVERIFY(method2.parameterNames().isEmpty()); | ||
3828 | + QVERIFY(method2.tag().isEmpty()); | ||
3829 | + QVERIFY(method2.access() == QMetaMethod::Protected); | ||
3830 | + QCOMPARE(method2.attributes(), 0); | ||
3831 | + QCOMPARE(method2.index(), 1); | ||
3832 | + QCOMPARE(builder.methodCount(), 2); | ||
3833 | + | ||
3834 | + // Perform index-based lookup | ||
3835 | + QCOMPARE(builder.indexOfSignal("foo(const QString &, int)"), 0); | ||
3836 | + QCOMPARE(builder.indexOfSignal("bar(QString)"), 1); | ||
3837 | + QCOMPARE(builder.indexOfSignal("baz()"), -1); | ||
3838 | + | ||
3839 | + // Check that nothing else changed. | ||
3840 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Methods)); | ||
3841 | +} | ||
3842 | + | ||
3843 | +void tst_QMetaObjectBuilder::constructor() | ||
3844 | +{ | ||
3845 | + QMetaObjectBuilder builder; | ||
3846 | + | ||
3847 | + // Add a constructor and check its attributes. | ||
3848 | + QMetaMethodBuilder ctor1 = builder.addConstructor("foo(const QString&, int)"); | ||
3849 | + QCOMPARE(ctor1.signature(), QByteArray("foo(QString,int)")); | ||
3850 | + QVERIFY(ctor1.methodType() == QMetaMethod::Constructor); | ||
3851 | + QVERIFY(ctor1.returnType().isEmpty()); | ||
3852 | + QVERIFY(ctor1.parameterNames().isEmpty()); | ||
3853 | + QVERIFY(ctor1.tag().isEmpty()); | ||
3854 | + QVERIFY(ctor1.access() == QMetaMethod::Public); | ||
3855 | + QCOMPARE(ctor1.attributes(), 0); | ||
3856 | + QCOMPARE(ctor1.index(), 0); | ||
3857 | + QCOMPARE(builder.constructorCount(), 1); | ||
3858 | + | ||
3859 | + // Add another constructor and check again. | ||
3860 | + QMetaMethodBuilder ctor2 = builder.addConstructor("bar(QString)"); | ||
3861 | + QCOMPARE(ctor2.signature(), QByteArray("bar(QString)")); | ||
3862 | + QVERIFY(ctor2.methodType() == QMetaMethod::Constructor); | ||
3863 | + QVERIFY(ctor2.returnType().isEmpty()); | ||
3864 | + QVERIFY(ctor2.parameterNames().isEmpty()); | ||
3865 | + QVERIFY(ctor2.tag().isEmpty()); | ||
3866 | + QVERIFY(ctor2.access() == QMetaMethod::Public); | ||
3867 | + QCOMPARE(ctor2.attributes(), 0); | ||
3868 | + QCOMPARE(ctor2.index(), 1); | ||
3869 | + QCOMPARE(builder.constructorCount(), 2); | ||
3870 | + | ||
3871 | + // Perform index-based lookup. | ||
3872 | + QCOMPARE(builder.indexOfConstructor("foo(const QString&, int)"), 0); | ||
3873 | + QCOMPARE(builder.indexOfConstructor("bar(QString)"), 1); | ||
3874 | + QCOMPARE(builder.indexOfConstructor("baz()"), -1); | ||
3875 | + QCOMPARE(builder.constructor(1).signature(), QByteArray("bar(QString)")); | ||
3876 | + QCOMPARE(builder.constructor(9).signature(), QByteArray()); | ||
3877 | + | ||
3878 | + // Modify the attributes on ctor1. | ||
3879 | + ctor1.setReturnType("int"); | ||
3880 | + ctor1.setParameterNames(QList<QByteArray>() << "a" << "b"); | ||
3881 | + ctor1.setTag("tag"); | ||
3882 | + ctor1.setAccess(QMetaMethod::Private); | ||
3883 | + ctor1.setAttributes(42); | ||
3884 | + | ||
3885 | + // Check that ctor1 is changed, but ctor2 is not. | ||
3886 | + QCOMPARE(ctor1.signature(), QByteArray("foo(QString,int)")); | ||
3887 | + QVERIFY(ctor1.methodType() == QMetaMethod::Constructor); | ||
3888 | + QCOMPARE(ctor1.returnType(), QByteArray("int")); | ||
3889 | + QCOMPARE(ctor1.parameterNames(), QList<QByteArray>() << "a" << "b"); | ||
3890 | + QCOMPARE(ctor1.tag(), QByteArray("tag")); | ||
3891 | + QVERIFY(ctor1.access() == QMetaMethod::Private); | ||
3892 | + QCOMPARE(ctor1.attributes(), 42); | ||
3893 | + QCOMPARE(ctor1.index(), 0); | ||
3894 | + QCOMPARE(ctor2.signature(), QByteArray("bar(QString)")); | ||
3895 | + QVERIFY(ctor2.methodType() == QMetaMethod::Constructor); | ||
3896 | + QVERIFY(ctor2.returnType().isEmpty()); | ||
3897 | + QVERIFY(ctor2.parameterNames().isEmpty()); | ||
3898 | + QVERIFY(ctor2.tag().isEmpty()); | ||
3899 | + QVERIFY(ctor2.access() == QMetaMethod::Public); | ||
3900 | + QCOMPARE(ctor2.attributes(), 0); | ||
3901 | + QCOMPARE(ctor2.index(), 1); | ||
3902 | + QCOMPARE(builder.constructorCount(), 2); | ||
3903 | + | ||
3904 | + // Modify the attributes on ctor2. | ||
3905 | + ctor2.setReturnType("QString"); | ||
3906 | + ctor2.setParameterNames(QList<QByteArray>() << "c"); | ||
3907 | + ctor2.setTag("Q_FOO"); | ||
3908 | + ctor2.setAccess(QMetaMethod::Protected); | ||
3909 | + ctor2.setAttributes(24); | ||
3910 | + | ||
3911 | + // This time check that only ctor2 changed. | ||
3912 | + QCOMPARE(ctor1.signature(), QByteArray("foo(QString,int)")); | ||
3913 | + QVERIFY(ctor1.methodType() == QMetaMethod::Constructor); | ||
3914 | + QCOMPARE(ctor1.returnType(), QByteArray("int")); | ||
3915 | + QCOMPARE(ctor1.parameterNames(), QList<QByteArray>() << "a" << "b"); | ||
3916 | + QCOMPARE(ctor1.tag(), QByteArray("tag")); | ||
3917 | + QVERIFY(ctor1.access() == QMetaMethod::Private); | ||
3918 | + QCOMPARE(ctor1.attributes(), 42); | ||
3919 | + QCOMPARE(ctor1.index(), 0); | ||
3920 | + QCOMPARE(ctor2.signature(), QByteArray("bar(QString)")); | ||
3921 | + QVERIFY(ctor2.methodType() == QMetaMethod::Constructor); | ||
3922 | + QCOMPARE(ctor2.returnType(), QByteArray("QString")); | ||
3923 | + QCOMPARE(ctor2.parameterNames(), QList<QByteArray>() << "c"); | ||
3924 | + QCOMPARE(ctor2.tag(), QByteArray("Q_FOO")); | ||
3925 | + QVERIFY(ctor2.access() == QMetaMethod::Protected); | ||
3926 | + QCOMPARE(ctor2.attributes(), 24); | ||
3927 | + QCOMPARE(ctor2.index(), 1); | ||
3928 | + QCOMPARE(builder.constructorCount(), 2); | ||
3929 | + | ||
3930 | + // Remove ctor1 and check that ctor2 becomes index 0. | ||
3931 | + builder.removeConstructor(0); | ||
3932 | + QCOMPARE(builder.constructorCount(), 1); | ||
3933 | + ctor2 = builder.constructor(0); | ||
3934 | + QCOMPARE(ctor2.signature(), QByteArray("bar(QString)")); | ||
3935 | + QVERIFY(ctor2.methodType() == QMetaMethod::Constructor); | ||
3936 | + QCOMPARE(ctor2.returnType(), QByteArray("QString")); | ||
3937 | + QCOMPARE(ctor2.parameterNames(), QList<QByteArray>() << "c"); | ||
3938 | + QCOMPARE(ctor2.tag(), QByteArray("Q_FOO")); | ||
3939 | + QVERIFY(ctor2.access() == QMetaMethod::Protected); | ||
3940 | + QCOMPARE(ctor2.attributes(), 24); | ||
3941 | + QCOMPARE(ctor2.index(), 0); | ||
3942 | + | ||
3943 | + // Perform index-based lookup again. | ||
3944 | + QCOMPARE(builder.indexOfConstructor("foo(const QString&, int)"), -1); | ||
3945 | + QCOMPARE(builder.indexOfConstructor("bar(QString)"), 0); | ||
3946 | + QCOMPARE(builder.indexOfConstructor("baz()"), -1); | ||
3947 | + | ||
3948 | + // Add constructor from prototype | ||
3949 | + QMetaMethod prototype = SomethingOfEverything::staticMetaObject.constructor(0); | ||
3950 | + QMetaMethodBuilder prototypeConstructor = builder.addMethod(prototype); | ||
3951 | + QCOMPARE(builder.constructorCount(), 2); | ||
3952 | + | ||
3953 | + QCOMPARE(prototypeConstructor.signature(), QByteArray("SomethingOfEverything()")); | ||
3954 | + QVERIFY(prototypeConstructor.methodType() == QMetaMethod::Constructor); | ||
3955 | + QCOMPARE(prototypeConstructor.returnType(), QByteArray()); | ||
3956 | + QVERIFY(prototypeConstructor.access() == QMetaMethod::Public); | ||
3957 | + QCOMPARE(prototypeConstructor.index(), 1); | ||
3958 | + | ||
3959 | + // Check that nothing else changed. | ||
3960 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Constructors)); | ||
3961 | +} | ||
3962 | + | ||
3963 | +void tst_QMetaObjectBuilder::property() | ||
3964 | +{ | ||
3965 | + QMetaObjectBuilder builder; | ||
3966 | + | ||
3967 | + // Null property builder | ||
3968 | + QMetaPropertyBuilder nullProp; | ||
3969 | + QCOMPARE(nullProp.name(), QByteArray()); | ||
3970 | + QCOMPARE(nullProp.type(), QByteArray()); | ||
3971 | + QVERIFY(!nullProp.hasNotifySignal()); | ||
3972 | + QVERIFY(!nullProp.isReadable()); | ||
3973 | + QVERIFY(!nullProp.isWritable()); | ||
3974 | + QVERIFY(!nullProp.isResettable()); | ||
3975 | + QVERIFY(!nullProp.isDesignable()); | ||
3976 | + QVERIFY(!nullProp.isScriptable()); | ||
3977 | + QVERIFY(!nullProp.isStored()); | ||
3978 | + QVERIFY(!nullProp.isEditable()); | ||
3979 | + QVERIFY(!nullProp.isUser()); | ||
3980 | + QVERIFY(!nullProp.hasStdCppSet()); | ||
3981 | + QVERIFY(!nullProp.isEnumOrFlag()); | ||
3982 | + QCOMPARE(nullProp.index(), 0); | ||
3983 | + | ||
3984 | + // Add a property and check its attributes. | ||
3985 | + QMetaPropertyBuilder prop1 = builder.addProperty("foo", "const QString &"); | ||
3986 | + QCOMPARE(prop1.name(), QByteArray("foo")); | ||
3987 | + QCOMPARE(prop1.type(), QByteArray("QString")); | ||
3988 | + QVERIFY(!prop1.hasNotifySignal()); | ||
3989 | + QVERIFY(prop1.isReadable()); | ||
3990 | + QVERIFY(prop1.isWritable()); | ||
3991 | + QVERIFY(!prop1.isResettable()); | ||
3992 | + QVERIFY(!prop1.isDesignable()); | ||
3993 | + QVERIFY(prop1.isScriptable()); | ||
3994 | + QVERIFY(!prop1.isStored()); | ||
3995 | + QVERIFY(!prop1.isEditable()); | ||
3996 | + QVERIFY(!prop1.isUser()); | ||
3997 | + QVERIFY(!prop1.hasStdCppSet()); | ||
3998 | + QVERIFY(!prop1.isEnumOrFlag()); | ||
3999 | + | ||
4000 | + QCOMPARE(prop1.index(), 0); | ||
4001 | + QCOMPARE(builder.propertyCount(), 1); | ||
4002 | + | ||
4003 | + // Add another property and check again. | ||
4004 | + QMetaPropertyBuilder prop2 = builder.addProperty("bar", "int"); | ||
4005 | + QCOMPARE(prop2.name(), QByteArray("bar")); | ||
4006 | + QCOMPARE(prop2.type(), QByteArray("int")); | ||
4007 | + QVERIFY(!prop2.hasNotifySignal()); | ||
4008 | + QVERIFY(prop2.isReadable()); | ||
4009 | + QVERIFY(prop2.isWritable()); | ||
4010 | + QVERIFY(!prop2.isResettable()); | ||
4011 | + QVERIFY(!prop2.isDesignable()); | ||
4012 | + QVERIFY(prop2.isScriptable()); | ||
4013 | + QVERIFY(!prop2.isStored()); | ||
4014 | + QVERIFY(!prop2.isEditable()); | ||
4015 | + QVERIFY(!prop2.isUser()); | ||
4016 | + QVERIFY(!prop2.hasStdCppSet()); | ||
4017 | + QVERIFY(!prop2.isEnumOrFlag()); | ||
4018 | + | ||
4019 | + QCOMPARE(prop2.index(), 1); | ||
4020 | + QCOMPARE(builder.propertyCount(), 2); | ||
4021 | + | ||
4022 | + // Perform index-based lookup. | ||
4023 | + QCOMPARE(builder.indexOfProperty("foo"), 0); | ||
4024 | + QCOMPARE(builder.indexOfProperty("bar"), 1); | ||
4025 | + QCOMPARE(builder.indexOfProperty("baz"), -1); | ||
4026 | + QCOMPARE(builder.property(1).name(), QByteArray("bar")); | ||
4027 | + QCOMPARE(builder.property(9).name(), QByteArray()); | ||
4028 | + | ||
4029 | + // Modify the attributes on prop1. | ||
4030 | + prop1.setReadable(false); | ||
4031 | + prop1.setWritable(false); | ||
4032 | + prop1.setResettable(true); | ||
4033 | + prop1.setDesignable(true); | ||
4034 | + prop1.setScriptable(false); | ||
4035 | + prop1.setStored(true); | ||
4036 | + prop1.setEditable(true); | ||
4037 | + prop1.setUser(true); | ||
4038 | + prop1.setStdCppSet(true); | ||
4039 | + prop1.setEnumOrFlag(true); | ||
4040 | + | ||
4041 | + // Check that prop1 is changed, but prop2 is not. | ||
4042 | + QCOMPARE(prop1.name(), QByteArray("foo")); | ||
4043 | + QCOMPARE(prop1.type(), QByteArray("QString")); | ||
4044 | + QVERIFY(!prop1.isReadable()); | ||
4045 | + QVERIFY(!prop1.isWritable()); | ||
4046 | + QVERIFY(prop1.isResettable()); | ||
4047 | + QVERIFY(prop1.isDesignable()); | ||
4048 | + QVERIFY(!prop1.isScriptable()); | ||
4049 | + QVERIFY(prop1.isStored()); | ||
4050 | + QVERIFY(prop1.isEditable()); | ||
4051 | + QVERIFY(prop1.isUser()); | ||
4052 | + QVERIFY(prop1.hasStdCppSet()); | ||
4053 | + QVERIFY(prop1.isEnumOrFlag()); | ||
4054 | + QVERIFY(prop2.isReadable()); | ||
4055 | + QVERIFY(prop2.isWritable()); | ||
4056 | + QCOMPARE(prop2.name(), QByteArray("bar")); | ||
4057 | + QCOMPARE(prop2.type(), QByteArray("int")); | ||
4058 | + QVERIFY(!prop2.isResettable()); | ||
4059 | + QVERIFY(!prop2.isDesignable()); | ||
4060 | + QVERIFY(prop2.isScriptable()); | ||
4061 | + QVERIFY(!prop2.isStored()); | ||
4062 | + QVERIFY(!prop2.isEditable()); | ||
4063 | + QVERIFY(!prop2.isUser()); | ||
4064 | + QVERIFY(!prop2.hasStdCppSet()); | ||
4065 | + QVERIFY(!prop2.isEnumOrFlag()); | ||
4066 | + | ||
4067 | + // Remove prop1 and check that prop2 becomes index 0. | ||
4068 | + builder.removeProperty(0); | ||
4069 | + QCOMPARE(builder.propertyCount(), 1); | ||
4070 | + prop2 = builder.property(0); | ||
4071 | + QCOMPARE(prop2.name(), QByteArray("bar")); | ||
4072 | + QCOMPARE(prop2.type(), QByteArray("int")); | ||
4073 | + QVERIFY(!prop2.isResettable()); | ||
4074 | + QVERIFY(!prop2.isDesignable()); | ||
4075 | + QVERIFY(prop2.isScriptable()); | ||
4076 | + QVERIFY(!prop2.isStored()); | ||
4077 | + QVERIFY(!prop2.isEditable()); | ||
4078 | + QVERIFY(!prop2.isUser()); | ||
4079 | + QVERIFY(!prop2.hasStdCppSet()); | ||
4080 | + QVERIFY(!prop2.isEnumOrFlag()); | ||
4081 | + QCOMPARE(prop2.index(), 0); | ||
4082 | + | ||
4083 | + // Perform index-based lookup again. | ||
4084 | + QCOMPARE(builder.indexOfProperty("foo"), -1); | ||
4085 | + QCOMPARE(builder.indexOfProperty("bar"), 0); | ||
4086 | + QCOMPARE(builder.indexOfProperty("baz"), -1); | ||
4087 | + | ||
4088 | + // Check for side-effects between the flags on prop2. | ||
4089 | + // Setting a flag to true shouldn't set any of the others to true. | ||
4090 | + // This checks for cut-and-paste bugs in the implementation where | ||
4091 | + // the flag code was pasted but the flag name was not changed. | ||
4092 | +#define CLEAR_FLAGS() \ | ||
4093 | + do { \ | ||
4094 | + prop2.setReadable(false); \ | ||
4095 | + prop2.setWritable(false); \ | ||
4096 | + prop2.setResettable(false); \ | ||
4097 | + prop2.setDesignable(false); \ | ||
4098 | + prop2.setScriptable(false); \ | ||
4099 | + prop2.setStored(false); \ | ||
4100 | + prop2.setEditable(false); \ | ||
4101 | + prop2.setUser(false); \ | ||
4102 | + prop2.setStdCppSet(false); \ | ||
4103 | + prop2.setEnumOrFlag(false); \ | ||
4104 | + } while (0) | ||
4105 | +#define COUNT_FLAGS() \ | ||
4106 | + ((prop2.isReadable() ? 1 : 0) + \ | ||
4107 | + (prop2.isWritable() ? 1 : 0) + \ | ||
4108 | + (prop2.isResettable() ? 1 : 0) + \ | ||
4109 | + (prop2.isDesignable() ? 1 : 0) + \ | ||
4110 | + (prop2.isScriptable() ? 1 : 0) + \ | ||
4111 | + (prop2.isStored() ? 1 : 0) + \ | ||
4112 | + (prop2.isEditable() ? 1 : 0) + \ | ||
4113 | + (prop2.isUser() ? 1 : 0) + \ | ||
4114 | + (prop2.hasStdCppSet() ? 1 : 0) + \ | ||
4115 | + (prop2.isEnumOrFlag() ? 1 : 0)) | ||
4116 | +#define CHECK_FLAG(setFunc,isFunc) \ | ||
4117 | + do { \ | ||
4118 | + CLEAR_FLAGS(); \ | ||
4119 | + QCOMPARE(COUNT_FLAGS(), 0); \ | ||
4120 | + prop2.setFunc(true); \ | ||
4121 | + QVERIFY(prop2.isFunc()); \ | ||
4122 | + QCOMPARE(COUNT_FLAGS(), 1); \ | ||
4123 | + } while (0) | ||
4124 | + CHECK_FLAG(setReadable, isReadable); | ||
4125 | + CHECK_FLAG(setWritable, isWritable); | ||
4126 | + CHECK_FLAG(setResettable, isResettable); | ||
4127 | + CHECK_FLAG(setDesignable, isDesignable); | ||
4128 | + CHECK_FLAG(setScriptable, isScriptable); | ||
4129 | + CHECK_FLAG(setStored, isStored); | ||
4130 | + CHECK_FLAG(setEditable, isEditable); | ||
4131 | + CHECK_FLAG(setUser, isUser); | ||
4132 | + CHECK_FLAG(setStdCppSet, hasStdCppSet); | ||
4133 | + CHECK_FLAG(setEnumOrFlag, isEnumOrFlag); | ||
4134 | + | ||
4135 | + // Check that nothing else changed. | ||
4136 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Properties)); | ||
4137 | + | ||
4138 | + // Add property from prototype | ||
4139 | + QMetaProperty prototype = SomethingOfEverything::staticMetaObject.property(1); | ||
4140 | + QVERIFY(prototype.name() == QByteArray("prop")); | ||
4141 | + QMetaPropertyBuilder prototypeProp = builder.addProperty(prototype); | ||
4142 | + QCOMPARE(prototypeProp.name(), QByteArray("prop")); | ||
4143 | + QVERIFY(prototypeProp.hasNotifySignal()); | ||
4144 | + QCOMPARE(prototypeProp.notifySignal().signature(), QByteArray("propChanged(QString)")); | ||
4145 | + QCOMPARE(builder.methodCount(), 1); | ||
4146 | + QCOMPARE(builder.method(0).signature(), QByteArray("propChanged(QString)")); | ||
4147 | +} | ||
4148 | + | ||
4149 | +void tst_QMetaObjectBuilder::notifySignal() | ||
4150 | +{ | ||
4151 | + QMetaObjectBuilder builder; | ||
4152 | + | ||
4153 | + QMetaPropertyBuilder prop = builder.addProperty("foo", "const QString &"); | ||
4154 | + builder.addSlot("setFoo(QString)"); | ||
4155 | + QMetaMethodBuilder notify = builder.addSignal("fooChanged(QString)"); | ||
4156 | + | ||
4157 | + QVERIFY(!prop.hasNotifySignal()); | ||
4158 | + QCOMPARE(prop.notifySignal().index(), 0); | ||
4159 | + | ||
4160 | + prop.setNotifySignal(notify); | ||
4161 | + QVERIFY(prop.hasNotifySignal()); | ||
4162 | + QCOMPARE(prop.notifySignal().index(), 1); | ||
4163 | + | ||
4164 | + prop.setNotifySignal(QMetaMethodBuilder()); | ||
4165 | + QVERIFY(!prop.hasNotifySignal()); | ||
4166 | + QCOMPARE(prop.notifySignal().index(), 0); | ||
4167 | + | ||
4168 | + prop.setNotifySignal(notify); | ||
4169 | + prop.removeNotifySignal(); | ||
4170 | + QVERIFY(!prop.hasNotifySignal()); | ||
4171 | + QCOMPARE(prop.notifySignal().index(), 0); | ||
4172 | + | ||
4173 | + QCOMPARE(builder.methodCount(), 2); | ||
4174 | + QCOMPARE(builder.propertyCount(), 1); | ||
4175 | + | ||
4176 | + // Check that nothing else changed except methods and properties. | ||
4177 | + QVERIFY(checkForSideEffects | ||
4178 | + (builder, QMetaObjectBuilder::Methods | QMetaObjectBuilder::Properties)); | ||
4179 | +} | ||
4180 | + | ||
4181 | +void tst_QMetaObjectBuilder::enumerator() | ||
4182 | +{ | ||
4183 | + QMetaObjectBuilder builder; | ||
4184 | + | ||
4185 | + // Add an enumerator and check its attributes. | ||
4186 | + QMetaEnumBuilder enum1 = builder.addEnumerator("foo"); | ||
4187 | + QCOMPARE(enum1.name(), QByteArray("foo")); | ||
4188 | + QVERIFY(!enum1.isFlag()); | ||
4189 | + QCOMPARE(enum1.keyCount(), 0); | ||
4190 | + QCOMPARE(enum1.index(), 0); | ||
4191 | + QCOMPARE(builder.enumeratorCount(), 1); | ||
4192 | + | ||
4193 | + // Add another enumerator and check again. | ||
4194 | + QMetaEnumBuilder enum2 = builder.addEnumerator("bar"); | ||
4195 | + QCOMPARE(enum2.name(), QByteArray("bar")); | ||
4196 | + QVERIFY(!enum2.isFlag()); | ||
4197 | + QCOMPARE(enum2.keyCount(), 0); | ||
4198 | + QCOMPARE(enum2.index(), 1); | ||
4199 | + QCOMPARE(builder.enumeratorCount(), 2); | ||
4200 | + | ||
4201 | + // Perform index-based lookup. | ||
4202 | + QCOMPARE(builder.indexOfEnumerator("foo"), 0); | ||
4203 | + QCOMPARE(builder.indexOfEnumerator("bar"), 1); | ||
4204 | + QCOMPARE(builder.indexOfEnumerator("baz"), -1); | ||
4205 | + QCOMPARE(builder.enumerator(1).name(), QByteArray("bar")); | ||
4206 | + QCOMPARE(builder.enumerator(9).name(), QByteArray()); | ||
4207 | + | ||
4208 | + // Modify the attributes on enum1. | ||
4209 | + enum1.setIsFlag(true); | ||
4210 | + QCOMPARE(enum1.addKey("ABC", 0), 0); | ||
4211 | + QCOMPARE(enum1.addKey("DEF", 1), 1); | ||
4212 | + QCOMPARE(enum1.addKey("GHI", -1), 2); | ||
4213 | + | ||
4214 | + // Check that enum1 is changed, but enum2 is not. | ||
4215 | + QCOMPARE(enum1.name(), QByteArray("foo")); | ||
4216 | + QVERIFY(enum1.isFlag()); | ||
4217 | + QCOMPARE(enum1.keyCount(), 3); | ||
4218 | + QCOMPARE(enum1.index(), 0); | ||
4219 | + QCOMPARE(enum1.key(0), QByteArray("ABC")); | ||
4220 | + QCOMPARE(enum1.key(1), QByteArray("DEF")); | ||
4221 | + QCOMPARE(enum1.key(2), QByteArray("GHI")); | ||
4222 | + QCOMPARE(enum1.key(3), QByteArray()); | ||
4223 | + QCOMPARE(enum1.value(0), 0); | ||
4224 | + QCOMPARE(enum1.value(1), 1); | ||
4225 | + QCOMPARE(enum1.value(2), -1); | ||
4226 | + QCOMPARE(enum2.name(), QByteArray("bar")); | ||
4227 | + QVERIFY(!enum2.isFlag()); | ||
4228 | + QCOMPARE(enum2.keyCount(), 0); | ||
4229 | + QCOMPARE(enum2.index(), 1); | ||
4230 | + | ||
4231 | + // Modify the attributes on enum2. | ||
4232 | + enum2.setIsFlag(true); | ||
4233 | + QCOMPARE(enum2.addKey("XYZ", 10), 0); | ||
4234 | + QCOMPARE(enum2.addKey("UVW", 19), 1); | ||
4235 | + | ||
4236 | + // This time check that only method2 changed. | ||
4237 | + QCOMPARE(enum1.name(), QByteArray("foo")); | ||
4238 | + QVERIFY(enum1.isFlag()); | ||
4239 | + QCOMPARE(enum1.keyCount(), 3); | ||
4240 | + QCOMPARE(enum1.index(), 0); | ||
4241 | + QCOMPARE(enum1.key(0), QByteArray("ABC")); | ||
4242 | + QCOMPARE(enum1.key(1), QByteArray("DEF")); | ||
4243 | + QCOMPARE(enum1.key(2), QByteArray("GHI")); | ||
4244 | + QCOMPARE(enum1.key(3), QByteArray()); | ||
4245 | + QCOMPARE(enum1.value(0), 0); | ||
4246 | + QCOMPARE(enum1.value(1), 1); | ||
4247 | + QCOMPARE(enum1.value(2), -1); | ||
4248 | + QCOMPARE(enum2.name(), QByteArray("bar")); | ||
4249 | + QVERIFY(enum2.isFlag()); | ||
4250 | + QCOMPARE(enum2.keyCount(), 2); | ||
4251 | + QCOMPARE(enum2.index(), 1); | ||
4252 | + QCOMPARE(enum2.key(0), QByteArray("XYZ")); | ||
4253 | + QCOMPARE(enum2.key(1), QByteArray("UVW")); | ||
4254 | + QCOMPARE(enum2.key(2), QByteArray()); | ||
4255 | + QCOMPARE(enum2.value(0), 10); | ||
4256 | + QCOMPARE(enum2.value(1), 19); | ||
4257 | + | ||
4258 | + // Remove enum1 key | ||
4259 | + enum1.removeKey(2); | ||
4260 | + QCOMPARE(enum1.name(), QByteArray("foo")); | ||
4261 | + QVERIFY(enum1.isFlag()); | ||
4262 | + QCOMPARE(enum1.keyCount(), 2); | ||
4263 | + QCOMPARE(enum1.index(), 0); | ||
4264 | + QCOMPARE(enum1.key(0), QByteArray("ABC")); | ||
4265 | + QCOMPARE(enum1.key(1), QByteArray("DEF")); | ||
4266 | + QCOMPARE(enum1.key(2), QByteArray()); | ||
4267 | + QCOMPARE(enum1.value(0), 0); | ||
4268 | + QCOMPARE(enum1.value(1), 1); | ||
4269 | + QCOMPARE(enum1.value(2), -1); | ||
4270 | + QCOMPARE(enum2.name(), QByteArray("bar")); | ||
4271 | + QVERIFY(enum2.isFlag()); | ||
4272 | + QCOMPARE(enum2.keyCount(), 2); | ||
4273 | + QCOMPARE(enum2.index(), 1); | ||
4274 | + QCOMPARE(enum2.key(0), QByteArray("XYZ")); | ||
4275 | + QCOMPARE(enum2.key(1), QByteArray("UVW")); | ||
4276 | + QCOMPARE(enum2.key(2), QByteArray()); | ||
4277 | + QCOMPARE(enum2.value(0), 10); | ||
4278 | + QCOMPARE(enum2.value(1), 19); | ||
4279 | + | ||
4280 | + // Remove enum1 and check that enum2 becomes index 0. | ||
4281 | + builder.removeEnumerator(0); | ||
4282 | + QCOMPARE(builder.enumeratorCount(), 1); | ||
4283 | + enum2 = builder.enumerator(0); | ||
4284 | + QCOMPARE(enum2.name(), QByteArray("bar")); | ||
4285 | + QVERIFY(enum2.isFlag()); | ||
4286 | + QCOMPARE(enum2.keyCount(), 2); | ||
4287 | + QCOMPARE(enum2.index(), 0); | ||
4288 | + QCOMPARE(enum2.key(0), QByteArray("XYZ")); | ||
4289 | + QCOMPARE(enum2.key(1), QByteArray("UVW")); | ||
4290 | + QCOMPARE(enum2.key(2), QByteArray()); | ||
4291 | + QCOMPARE(enum2.value(0), 10); | ||
4292 | + QCOMPARE(enum2.value(1), 19); | ||
4293 | + | ||
4294 | + // Perform index-based lookup again. | ||
4295 | + QCOMPARE(builder.indexOfEnumerator("foo"), -1); | ||
4296 | + QCOMPARE(builder.indexOfEnumerator("bar"), 0); | ||
4297 | + QCOMPARE(builder.indexOfEnumerator("baz"), -1); | ||
4298 | + | ||
4299 | + // Check that nothing else changed. | ||
4300 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Enumerators)); | ||
4301 | +} | ||
4302 | + | ||
4303 | +void tst_QMetaObjectBuilder::classInfo() | ||
4304 | +{ | ||
4305 | + QMetaObjectBuilder builder; | ||
4306 | + | ||
4307 | + // Add two items of class information and check their attributes. | ||
4308 | + QCOMPARE(builder.addClassInfo("foo", "value1"), 0); | ||
4309 | + QCOMPARE(builder.addClassInfo("bar", "value2"), 1); | ||
4310 | + QCOMPARE(builder.classInfoName(0), QByteArray("foo")); | ||
4311 | + QCOMPARE(builder.classInfoValue(0), QByteArray("value1")); | ||
4312 | + QCOMPARE(builder.classInfoName(1), QByteArray("bar")); | ||
4313 | + QCOMPARE(builder.classInfoValue(1), QByteArray("value2")); | ||
4314 | + QCOMPARE(builder.classInfoName(9), QByteArray()); | ||
4315 | + QCOMPARE(builder.classInfoValue(9), QByteArray()); | ||
4316 | + QCOMPARE(builder.classInfoCount(), 2); | ||
4317 | + | ||
4318 | + // Perform index-based lookup. | ||
4319 | + QCOMPARE(builder.indexOfClassInfo("foo"), 0); | ||
4320 | + QCOMPARE(builder.indexOfClassInfo("bar"), 1); | ||
4321 | + QCOMPARE(builder.indexOfClassInfo("baz"), -1); | ||
4322 | + | ||
4323 | + // Remove the first one and check again. | ||
4324 | + builder.removeClassInfo(0); | ||
4325 | + QCOMPARE(builder.classInfoName(0), QByteArray("bar")); | ||
4326 | + QCOMPARE(builder.classInfoValue(0), QByteArray("value2")); | ||
4327 | + QCOMPARE(builder.classInfoCount(), 1); | ||
4328 | + | ||
4329 | + // Perform index-based lookup again. | ||
4330 | + QCOMPARE(builder.indexOfClassInfo("foo"), -1); | ||
4331 | + QCOMPARE(builder.indexOfClassInfo("bar"), 0); | ||
4332 | + QCOMPARE(builder.indexOfClassInfo("baz"), -1); | ||
4333 | + | ||
4334 | + // Check that nothing else changed. | ||
4335 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::ClassInfos)); | ||
4336 | +} | ||
4337 | + | ||
4338 | +#ifdef Q_NO_DATA_RELOCATION | ||
4339 | +const QMetaObject& staticMetaObjectGlobal() | ||
4340 | +{ | ||
4341 | + return QObject::staticMetaObject; | ||
4342 | +} | ||
4343 | + | ||
4344 | +const QMetaObject& staticMetaObjectLocal() | ||
4345 | +{ | ||
4346 | + return *meta; | ||
4347 | +} | ||
4348 | +#endif | ||
4349 | + | ||
4350 | + | ||
4351 | +void tst_QMetaObjectBuilder::relatedMetaObject() | ||
4352 | +{ | ||
4353 | + QMetaObjectBuilder builder; | ||
4354 | + | ||
4355 | + // Add two related meta objects and check their attributes. | ||
4356 | +#ifdef Q_NO_DATA_RELOCATION | ||
4357 | + meta = &staticMetaObject; | ||
4358 | + QCOMPARE(builder.addRelatedMetaObject(&staticMetaObjectGlobal), 0); | ||
4359 | + QCOMPARE(builder.addRelatedMetaObject(&staticMetaObjectLocal), 1); | ||
4360 | +#else | ||
4361 | + QCOMPARE(builder.addRelatedMetaObject(&QObject::staticMetaObject), 0); | ||
4362 | + QCOMPARE(builder.addRelatedMetaObject(&staticMetaObject), 1); | ||
4363 | +#endif | ||
4364 | + QVERIFY(builder.relatedMetaObject(0) == &QObject::staticMetaObject); | ||
4365 | + QVERIFY(builder.relatedMetaObject(1) == &staticMetaObject); | ||
4366 | + QCOMPARE(builder.relatedMetaObjectCount(), 2); | ||
4367 | + | ||
4368 | + // Remove the first one and check again. | ||
4369 | + builder.removeRelatedMetaObject(0); | ||
4370 | + QVERIFY(builder.relatedMetaObject(0) == &staticMetaObject); | ||
4371 | + QCOMPARE(builder.relatedMetaObjectCount(), 1); | ||
4372 | + | ||
4373 | + // Check that nothing else changed. | ||
4374 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::RelatedMetaObjects)); | ||
4375 | +} | ||
4376 | + | ||
4377 | +static int smetacall(QMetaObject::Call, int, void **) | ||
4378 | +{ | ||
4379 | + return 0; | ||
4380 | +} | ||
4381 | + | ||
4382 | +void tst_QMetaObjectBuilder::staticMetacall() | ||
4383 | +{ | ||
4384 | + QMetaObjectBuilder builder; | ||
4385 | + QVERIFY(!builder.staticMetacallFunction()); | ||
4386 | + builder.setStaticMetacallFunction(smetacall); | ||
4387 | + QVERIFY(builder.staticMetacallFunction() == smetacall); | ||
4388 | + QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::StaticMetacall)); | ||
4389 | +} | ||
4390 | + | ||
4391 | +// Copy the entire contents of a static QMetaObject and then check | ||
4392 | +// that QMetaObjectBuilder will produce an exact copy as output. | ||
4393 | +void tst_QMetaObjectBuilder::copyMetaObject() | ||
4394 | +{ | ||
4395 | + QMetaObjectBuilder builder(&QObject::staticMetaObject); | ||
4396 | + QMetaObject *meta = builder.toMetaObject(); | ||
4397 | + QVERIFY(sameMetaObject(meta, &QObject::staticMetaObject)); | ||
4398 | + qFree(meta); | ||
4399 | + | ||
4400 | + QMetaObjectBuilder builder2(&staticMetaObject); | ||
4401 | + meta = builder2.toMetaObject(); | ||
4402 | + QVERIFY(sameMetaObject(meta, &staticMetaObject)); | ||
4403 | + qFree(meta); | ||
4404 | + | ||
4405 | + QMetaObjectBuilder builder3(&SomethingOfEverything::staticMetaObject); | ||
4406 | + meta = builder3.toMetaObject(); | ||
4407 | + QVERIFY(sameMetaObject(meta, &SomethingOfEverything::staticMetaObject)); | ||
4408 | + qFree(meta); | ||
4409 | +} | ||
4410 | + | ||
4411 | +// Serialize and deserialize a meta object and check that | ||
4412 | +// it round-trips to the exact same value. | ||
4413 | +void tst_QMetaObjectBuilder::serialize() | ||
4414 | +{ | ||
4415 | + // Full QMetaObjectBuilder | ||
4416 | + { | ||
4417 | + QMetaObjectBuilder builder(&SomethingOfEverything::staticMetaObject); | ||
4418 | + QMetaObject *meta = builder.toMetaObject(); | ||
4419 | + | ||
4420 | + QByteArray data; | ||
4421 | + QDataStream stream(&data, QIODevice::WriteOnly | QIODevice::Append); | ||
4422 | + builder.serialize(stream); | ||
4423 | + | ||
4424 | + QMetaObjectBuilder builder2; | ||
4425 | + QDataStream stream2(data); | ||
4426 | + QMap<QByteArray, const QMetaObject *> references; | ||
4427 | + references.insert(QByteArray("QLocale"), &QLocale::staticMetaObject); | ||
4428 | + builder2.deserialize(stream2, references); | ||
4429 | +#ifdef Q_NO_DATA_RELOCATION | ||
4430 | + //the related meta objects will be function pointers | ||
4431 | + //which you have to add to the builder manually. | ||
4432 | + builder2.addRelatedMetaObject(QLocale::getStaticMetaObject); | ||
4433 | +#endif | ||
4434 | + builder2.setStaticMetacallFunction(builder.staticMetacallFunction()); | ||
4435 | + QMetaObject *meta2 = builder2.toMetaObject(); | ||
4436 | + | ||
4437 | + QVERIFY(sameMetaObject(meta, meta2)); | ||
4438 | + qFree(meta); | ||
4439 | + qFree(meta2); | ||
4440 | + } | ||
4441 | + | ||
4442 | + // Partial QMetaObjectBuilder | ||
4443 | + { | ||
4444 | + QMetaObjectBuilder builder; | ||
4445 | + builder.setClassName("Test"); | ||
4446 | + builder.addProperty("foo", "int"); | ||
4447 | + | ||
4448 | + QByteArray data; | ||
4449 | + QDataStream stream(&data, QIODevice::WriteOnly | QIODevice::Append); | ||
4450 | + builder.serialize(stream); | ||
4451 | + | ||
4452 | + QMetaObjectBuilder builder2; | ||
4453 | + QDataStream stream2(data); | ||
4454 | + builder2.deserialize(stream2, QMap<QByteArray, const QMetaObject *>()); | ||
4455 | + | ||
4456 | + QCOMPARE(builder.superClass(), builder2.superClass()); | ||
4457 | + QCOMPARE(builder.className(), builder2.className()); | ||
4458 | + QCOMPARE(builder.propertyCount(), builder2.propertyCount()); | ||
4459 | + QCOMPARE(builder.property(0).name(), builder2.property(0).name()); | ||
4460 | + QCOMPARE(builder.property(0).type(), builder2.property(0).type()); | ||
4461 | + } | ||
4462 | +} | ||
4463 | + | ||
4464 | +// Check that removing a method updates notify signals appropriately | ||
4465 | +void tst_QMetaObjectBuilder::removeNotifySignal() | ||
4466 | +{ | ||
4467 | + QMetaObjectBuilder builder; | ||
4468 | + | ||
4469 | + QMetaMethodBuilder method1 = builder.addSignal("foo(const QString&, int)"); | ||
4470 | + QMetaMethodBuilder method2 = builder.addSignal("bar(QString)"); | ||
4471 | + | ||
4472 | + // Setup property | ||
4473 | + QMetaPropertyBuilder prop = builder.addProperty("prop", "const QString &"); | ||
4474 | + prop.setNotifySignal(method2); | ||
4475 | + QVERIFY(prop.hasNotifySignal()); | ||
4476 | + QCOMPARE(prop.notifySignal().index(), 1); | ||
4477 | + | ||
4478 | + // Remove non-notify signal | ||
4479 | + builder.removeMethod(0); | ||
4480 | + QVERIFY(prop.hasNotifySignal()); | ||
4481 | + QCOMPARE(prop.notifySignal().index(), 0); | ||
4482 | + | ||
4483 | + // Remove notify signal | ||
4484 | + builder.removeMethod(0); | ||
4485 | + QVERIFY(!prop.hasNotifySignal()); | ||
4486 | +} | ||
4487 | + | ||
4488 | +// Check that the only changes to a "builder" relative to the default | ||
4489 | +// state is specified by "members". | ||
4490 | +bool tst_QMetaObjectBuilder::checkForSideEffects | ||
4491 | + (const QMetaObjectBuilder& builder, | ||
4492 | + QMetaObjectBuilder::AddMembers members) | ||
4493 | +{ | ||
4494 | + if ((members & QMetaObjectBuilder::ClassName) == 0) { | ||
4495 | + if (!builder.className().isEmpty()) | ||
4496 | + return false; | ||
4497 | + } | ||
4498 | + | ||
4499 | + if ((members & QMetaObjectBuilder::SuperClass) == 0) { | ||
4500 | + if (builder.superClass() != &QObject::staticMetaObject) | ||
4501 | + return false; | ||
4502 | + } | ||
4503 | + | ||
4504 | + if ((members & QMetaObjectBuilder::Methods) == 0) { | ||
4505 | + if (builder.methodCount() != 0) | ||
4506 | + return false; | ||
4507 | + } | ||
4508 | + | ||
4509 | + if ((members & QMetaObjectBuilder::Constructors) == 0) { | ||
4510 | + if (builder.constructorCount() != 0) | ||
4511 | + return false; | ||
4512 | + } | ||
4513 | + | ||
4514 | + if ((members & QMetaObjectBuilder::Properties) == 0) { | ||
4515 | + if (builder.propertyCount() != 0) | ||
4516 | + return false; | ||
4517 | + } | ||
4518 | + | ||
4519 | + if ((members & QMetaObjectBuilder::Enumerators) == 0) { | ||
4520 | + if (builder.enumeratorCount() != 0) | ||
4521 | + return false; | ||
4522 | + } | ||
4523 | + | ||
4524 | + if ((members & QMetaObjectBuilder::ClassInfos) == 0) { | ||
4525 | + if (builder.classInfoCount() != 0) | ||
4526 | + return false; | ||
4527 | + } | ||
4528 | + | ||
4529 | + if ((members & QMetaObjectBuilder::RelatedMetaObjects) == 0) { | ||
4530 | + if (builder.relatedMetaObjectCount() != 0) | ||
4531 | + return false; | ||
4532 | + } | ||
4533 | + | ||
4534 | + if ((members & QMetaObjectBuilder::StaticMetacall) == 0) { | ||
4535 | + if (builder.staticMetacallFunction() != 0) | ||
4536 | + return false; | ||
4537 | + } | ||
4538 | + | ||
4539 | + return true; | ||
4540 | +} | ||
4541 | + | ||
4542 | +static bool sameMethod(const QMetaMethod& method1, const QMetaMethod& method2) | ||
4543 | +{ | ||
4544 | + if (QByteArray(method1.signature()) != QByteArray(method2.signature())) | ||
4545 | + return false; | ||
4546 | + | ||
4547 | + if (QByteArray(method1.typeName()) != QByteArray(method2.typeName())) | ||
4548 | + return false; | ||
4549 | + | ||
4550 | + if (method1.parameterNames() != method2.parameterNames()) | ||
4551 | + return false; | ||
4552 | + | ||
4553 | + if (QByteArray(method1.tag()) != QByteArray(method2.tag())) | ||
4554 | + return false; | ||
4555 | + | ||
4556 | + if (method1.access() != method2.access()) | ||
4557 | + return false; | ||
4558 | + | ||
4559 | + if (method1.methodType() != method2.methodType()) | ||
4560 | + return false; | ||
4561 | + | ||
4562 | + if (method1.attributes() != method2.attributes()) | ||
4563 | + return false; | ||
4564 | + | ||
4565 | + return true; | ||
4566 | +} | ||
4567 | + | ||
4568 | +static bool sameProperty(const QMetaProperty& prop1, const QMetaProperty& prop2) | ||
4569 | +{ | ||
4570 | + if (QByteArray(prop1.name()) != QByteArray(prop2.name())) | ||
4571 | + return false; | ||
4572 | + | ||
4573 | + if (QByteArray(prop1.typeName()) != QByteArray(prop2.typeName())) | ||
4574 | + return false; | ||
4575 | + | ||
4576 | + if (prop1.isReadable() != prop2.isReadable() || | ||
4577 | + prop1.isWritable() != prop2.isWritable() || | ||
4578 | + prop1.isResettable() != prop2.isResettable() || | ||
4579 | + prop1.isDesignable() != prop2.isDesignable() || | ||
4580 | + prop1.isScriptable() != prop2.isScriptable() || | ||
4581 | + prop1.isStored() != prop2.isStored() || | ||
4582 | + prop1.isEditable() != prop2.isEditable() || | ||
4583 | + prop1.isUser() != prop2.isUser() || | ||
4584 | + prop1.isFlagType() != prop2.isFlagType() || | ||
4585 | + prop1.isEnumType() != prop2.isEnumType() || | ||
4586 | + prop1.hasNotifySignal() != prop2.hasNotifySignal() || | ||
4587 | + prop1.hasStdCppSet() != prop2.hasStdCppSet()) | ||
4588 | + return false; | ||
4589 | + | ||
4590 | + if (prop1.hasNotifySignal()) { | ||
4591 | + if (prop1.notifySignalIndex() != prop2.notifySignalIndex()) | ||
4592 | + return false; | ||
4593 | + } | ||
4594 | + | ||
4595 | + return true; | ||
4596 | +} | ||
4597 | + | ||
4598 | +static bool sameEnumerator(const QMetaEnum& enum1, const QMetaEnum& enum2) | ||
4599 | +{ | ||
4600 | + if (QByteArray(enum1.name()) != QByteArray(enum2.name())) | ||
4601 | + return false; | ||
4602 | + | ||
4603 | + if (enum1.isFlag() != enum2.isFlag()) | ||
4604 | + return false; | ||
4605 | + | ||
4606 | + if (enum1.keyCount() != enum2.keyCount()) | ||
4607 | + return false; | ||
4608 | + | ||
4609 | + for (int index = 0; index < enum1.keyCount(); ++index) { | ||
4610 | + if (QByteArray(enum1.key(index)) != QByteArray(enum2.key(index))) | ||
4611 | + return false; | ||
4612 | + if (enum1.value(index) != enum2.value(index)) | ||
4613 | + return false; | ||
4614 | + } | ||
4615 | + | ||
4616 | + if (QByteArray(enum1.scope()) != QByteArray(enum2.scope())) | ||
4617 | + return false; | ||
4618 | + | ||
4619 | + return true; | ||
4620 | +} | ||
4621 | + | ||
4622 | +// Determine if two meta objects are identical. | ||
4623 | +bool tst_QMetaObjectBuilder::sameMetaObject | ||
4624 | + (const QMetaObject *meta1, const QMetaObject *meta2) | ||
4625 | +{ | ||
4626 | + int index; | ||
4627 | + | ||
4628 | + if (strcmp(meta1->className(), meta2->className()) != 0) | ||
4629 | + return false; | ||
4630 | + | ||
4631 | + if (meta1->superClass() != meta2->superClass()) | ||
4632 | + return false; | ||
4633 | + | ||
4634 | + if (meta1->constructorCount() != meta2->constructorCount() || | ||
4635 | + meta1->methodCount() != meta2->methodCount() || | ||
4636 | + meta1->enumeratorCount() != meta2->enumeratorCount() || | ||
4637 | + meta1->propertyCount() != meta2->propertyCount() || | ||
4638 | + meta1->classInfoCount() != meta2->classInfoCount()) | ||
4639 | + return false; | ||
4640 | + | ||
4641 | + for (index = 0; index < meta1->constructorCount(); ++index) { | ||
4642 | + if (!sameMethod(meta1->constructor(index), meta2->constructor(index))) | ||
4643 | + return false; | ||
4644 | + } | ||
4645 | + | ||
4646 | + for (index = 0; index < meta1->methodCount(); ++index) { | ||
4647 | + if (!sameMethod(meta1->method(index), meta2->method(index))) | ||
4648 | + return false; | ||
4649 | + } | ||
4650 | + | ||
4651 | + for (index = 0; index < meta1->propertyCount(); ++index) { | ||
4652 | + if (!sameProperty(meta1->property(index), meta2->property(index))) | ||
4653 | + return false; | ||
4654 | + } | ||
4655 | + | ||
4656 | + for (index = 0; index < meta1->enumeratorCount(); ++index) { | ||
4657 | + if (!sameEnumerator(meta1->enumerator(index), meta2->enumerator(index))) | ||
4658 | + return false; | ||
4659 | + } | ||
4660 | + | ||
4661 | + for (index = 0; index < meta1->classInfoCount(); ++index) { | ||
4662 | + if (QByteArray(meta1->classInfo(index).name()) != | ||
4663 | + QByteArray(meta2->classInfo(index).name())) | ||
4664 | + return false; | ||
4665 | + if (QByteArray(meta1->classInfo(index).value()) != | ||
4666 | + QByteArray(meta2->classInfo(index).value())) | ||
4667 | + return false; | ||
4668 | + } | ||
4669 | + | ||
4670 | + const QMetaObject **objects1 = 0; | ||
4671 | + const QMetaObject **objects2 = 0; | ||
4672 | + if (meta1->d.data[0] == meta2->d.data[0] && meta1->d.data[0] >= 2) { | ||
4673 | + QMetaObjectExtraData *extra1 = (QMetaObjectExtraData *)(meta1->d.extradata); | ||
4674 | + QMetaObjectExtraData *extra2 = (QMetaObjectExtraData *)(meta2->d.extradata); | ||
4675 | + if (extra1 && !extra2) | ||
4676 | + return false; | ||
4677 | + if (extra2 && !extra1) | ||
4678 | + return false; | ||
4679 | + if (extra1 && extra2) { | ||
4680 | + if (extra1->static_metacall != extra2->static_metacall) | ||
4681 | + return false; | ||
4682 | + //objects1 = extra1->objects; | ||
4683 | + //objects2 = extra1->objects; | ||
4684 | + } | ||
4685 | + } else if (meta1->d.data[0] == meta2->d.data[0] && meta1->d.data[0] == 1) { | ||
4686 | + objects1 = (const QMetaObject **)(meta1->d.extradata); | ||
4687 | + objects2 = (const QMetaObject **)(meta2->d.extradata); | ||
4688 | + } | ||
4689 | + if (objects1 && !objects2) | ||
4690 | + return false; | ||
4691 | + if (objects2 && !objects1) | ||
4692 | + return false; | ||
4693 | + if (objects1 && objects2) { | ||
4694 | + while (*objects1 != 0 && *objects2 != 0) { | ||
4695 | + if (*objects1 != *objects2) | ||
4696 | + return false; | ||
4697 | + ++objects1; | ||
4698 | + ++objects2; | ||
4699 | + } | ||
4700 | + } | ||
4701 | + | ||
4702 | + return true; | ||
4703 | +} | ||
4704 | + | ||
4705 | +QTEST_MAIN(tst_QMetaObjectBuilder) | ||
4706 | + | ||
4707 | +#include "tst_qmetaobjectbuilder_47.moc" | ||
diff --git a/meta/recipes-qt/qt4/qt-mobility-1.2.0/gcc-scope.patch b/meta/recipes-qt/qt4/qt-mobility-1.2.0/gcc-scope.patch new file mode 100644 index 0000000000..f01ee9f4df --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility-1.2.0/gcc-scope.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | |||
2 | Fixes issues like below | ||
3 | |||
4 | | qaudiooutput_pulse.cpp: In member function 'bool QPulseAudioOutput::open()': | ||
5 | | qaudiooutput_pulse.cpp:255:75: error: '::getpid' has not been declared | ||
6 | | make[3]: *** [../../../build/Debug/qtmedia_pulse/qaudiooutput_pulse.o] Error 1 | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Index: qt-mobility-opensource-src-1.2.0/plugins/multimedia/pulseaudio/qaudiooutput_pulse.cpp | ||
13 | =================================================================== | ||
14 | --- qt-mobility-opensource-src-1.2.0.orig/plugins/multimedia/pulseaudio/qaudiooutput_pulse.cpp 2012-03-31 07:26:24.457018348 -0700 | ||
15 | +++ qt-mobility-opensource-src-1.2.0/plugins/multimedia/pulseaudio/qaudiooutput_pulse.cpp 2012-03-31 07:27:53.309022654 -0700 | ||
16 | @@ -46,7 +46,7 @@ | ||
17 | #include "qaudiodeviceinfo_pulse.h" | ||
18 | #include "qpulseaudioengine.h" | ||
19 | #include "qpulsehelpers.h" | ||
20 | - | ||
21 | +#include <unistd.h> | ||
22 | QT_BEGIN_NAMESPACE | ||
23 | |||
24 | const int PeriodTimeMs = 20; | ||
25 | Index: qt-mobility-opensource-src-1.2.0/plugins/multimedia/pulseaudio/qaudioinput_pulse.cpp | ||
26 | =================================================================== | ||
27 | --- qt-mobility-opensource-src-1.2.0.orig/plugins/multimedia/pulseaudio/qaudioinput_pulse.cpp 2012-03-31 07:29:19.997026831 -0700 | ||
28 | +++ qt-mobility-opensource-src-1.2.0/plugins/multimedia/pulseaudio/qaudioinput_pulse.cpp 2012-03-31 07:29:39.541027625 -0700 | ||
29 | @@ -46,6 +46,7 @@ | ||
30 | #include "qaudiodeviceinfo_pulse.h" | ||
31 | #include "qpulseaudioengine.h" | ||
32 | #include "qpulsehelpers.h" | ||
33 | +#include <unistd.h> | ||
34 | |||
35 | QT_BEGIN_NAMESPACE | ||
36 | |||
37 | Index: qt-mobility-opensource-src-1.2.0/plugins/multimedia/pulseaudio/qpulseaudioengine.cpp | ||
38 | =================================================================== | ||
39 | --- qt-mobility-opensource-src-1.2.0.orig/plugins/multimedia/pulseaudio/qpulseaudioengine.cpp 2012-03-31 07:33:24.805038719 -0700 | ||
40 | +++ qt-mobility-opensource-src-1.2.0/plugins/multimedia/pulseaudio/qpulseaudioengine.cpp 2012-03-31 07:33:46.889039783 -0700 | ||
41 | @@ -46,6 +46,7 @@ | ||
42 | #include "qaudiodeviceinfo_pulse.h" | ||
43 | #include "qaudiooutput_pulse.h" | ||
44 | #include "qpulsehelpers.h" | ||
45 | +#include <unistd.h> | ||
46 | |||
47 | QT_BEGIN_NAMESPACE | ||
48 | |||
diff --git a/meta/recipes-qt/qt4/qt-mobility-1.2.0/qt-mobility-configure.patch b/meta/recipes-qt/qt4/qt-mobility-1.2.0/qt-mobility-configure.patch new file mode 100644 index 0000000000..d61ec03341 --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility-1.2.0/qt-mobility-configure.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | When building qt-mobility, the qa_configure stage failed because the catalogue /usr/lib | ||
2 | is used in some Makefiles within configure tests. We manually removed this catalogue. | ||
3 | |||
4 | Upstream-Status: Inappropriate [embedded] | ||
5 | Signed-off-by: Dmitry Cherukhin <dima_ch@emcraft.com> | ||
6 | |||
7 | --- qt-mobility-opensource-src-1.2.0/configure.orig 2011-05-10 10:06:01.000000000 +0200 | ||
8 | +++ qt-mobility-opensource-src-1.2.0/configure 2011-11-08 12:34:56.347645968 +0100 | ||
9 | @@ -583,6 +583,8 @@ | ||
10 | fi | ||
11 | |||
12 | $QMAKE_EXEC $QMKSPEC "$relpath/config.tests/$2/$2.pro" 2>> "$CONFIG_LOG" >> "$CONFIG_LOG" | ||
13 | + cp Makefile Makefile.old | ||
14 | + sed -e 's@-L/usr/lib@@' <Makefile.old >Makefile | ||
15 | printf " ." | ||
16 | "$MAKE" clean >> "$CONFIG_LOG" | ||
17 | printf "." | ||
diff --git a/meta/recipes-qt/qt4/qt-mobility-1.2.0/qt-mobility-no-opengl.patch b/meta/recipes-qt/qt4/qt-mobility-1.2.0/qt-mobility-no-opengl.patch new file mode 100644 index 0000000000..1724995072 --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility-1.2.0/qt-mobility-no-opengl.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | diff --git a/examples/declarative-camera/declarative-camera.pro b/examples/declarative-camera/declarative-camera.pro | ||
4 | index 8164fbc..54fd8ad 100644 | ||
5 | --- a/examples/declarative-camera/declarative-camera.pro | ||
6 | +++ b/examples/declarative-camera/declarative-camera.pro | ||
7 | @@ -5,10 +5,10 @@ TEMPLATE=app | ||
8 | |||
9 | QT += declarative network | ||
10 | |||
11 | -!maemo5 { | ||
12 | - contains(QT_CONFIG, opengl) { | ||
13 | - QT += opengl | ||
14 | - } | ||
15 | +contains(QT_CONFIG, opengl): !maemo5 { | ||
16 | + QT += opengl | ||
17 | +} else { | ||
18 | + DEFINES += QT_NO_OPENGL | ||
19 | } | ||
20 | |||
21 | win32 { | ||
22 | diff --git a/examples/videographicsitem/videographicsitem.pro b/examples/videographicsitem/videographicsitem.pro | ||
23 | index 8461beb..eedee2f 100644 | ||
24 | --- a/examples/videographicsitem/videographicsitem.pro | ||
25 | +++ b/examples/videographicsitem/videographicsitem.pro | ||
26 | @@ -9,7 +9,11 @@ MOBILITY = multimedia | ||
27 | |||
28 | QMAKE_RPATHDIR += $$DESTDIR | ||
29 | |||
30 | -!symbian:contains(QT_CONFIG, opengl): QT += opengl | ||
31 | +contains(QT_CONFIG, opengl): !symbian { | ||
32 | + QT += opengl | ||
33 | +} else { | ||
34 | + DEFINES += QT_NO_OPENGL | ||
35 | +} | ||
36 | |||
37 | HEADERS += videoplayer.h \ | ||
38 | videoitem.h | ||
diff --git a/meta/recipes-qt/qt4/qt-mobility-1.2.0/qt-mobility-no-xvideo.patch b/meta/recipes-qt/qt4/qt-mobility-1.2.0/qt-mobility-no-xvideo.patch new file mode 100644 index 0000000000..6046752aa7 --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility-1.2.0/qt-mobility-no-xvideo.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | QMake pro files don't explicitly define QT_NO_XVIDEO if the | ||
2 | configuration lacks xvideo, but plugins code relies on this define. | ||
3 | |||
4 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
5 | Upstream-Status: Inappropriate [configuration] | ||
6 | --- | ||
7 | plugins/multimedia/gstreamer/gstreamer.pro | 4 ++++ | ||
8 | 1 file changed, 4 insertions(+) | ||
9 | |||
10 | diff --git a/plugins/multimedia/gstreamer/gstreamer.pro b/plugins/multimedia/gstreamer/gstreamer.pro | ||
11 | --- a/plugins/multimedia/gstreamer/gstreamer.pro | ||
12 | +++ b/plugins/multimedia/gstreamer/gstreamer.pro | ||
13 | @@ -19,6 +19,10 @@ LIBS += \ | ||
14 | -lasound | ||
15 | } | ||
16 | |||
17 | +unix:!contains(QT_CONFIG, xvideo) { | ||
18 | + DEFINES += QT_NO_XVIDEO | ||
19 | +} | ||
20 | + | ||
21 | CONFIG += link_pkgconfig | ||
22 | |||
23 | PKGCONFIG += \ | ||
24 | -- | ||
25 | 1.8.1.2 | ||
26 | |||
diff --git a/meta/recipes-qt/qt4/qt-mobility-embedded_1.2.0.bb b/meta/recipes-qt/qt4/qt-mobility-embedded_1.2.0.bb new file mode 100644 index 0000000000..998de2a055 --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility-embedded_1.2.0.bb | |||
@@ -0,0 +1,11 @@ | |||
1 | SUMMARY = "Mobile device API extensions for Qt/Embedded 4.x" | ||
2 | DEPENDS = "qt4-embedded" | ||
3 | SECTION = "libs" | ||
4 | qtm_embedded := "embedded" | ||
5 | qtm_dir = "qtopia" | ||
6 | qtm_glflags := "-=opengl" | ||
7 | qtm_extra_config := "gstreamer-photography_enabled = no" | ||
8 | |||
9 | inherit qt4e | ||
10 | require qt-mobility_${PV}.inc | ||
11 | |||
diff --git a/meta/recipes-qt/qt4/qt-mobility-x11_1.2.0.bb b/meta/recipes-qt/qt4/qt-mobility-x11_1.2.0.bb new file mode 100644 index 0000000000..5fe7bc98bd --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility-x11_1.2.0.bb | |||
@@ -0,0 +1,10 @@ | |||
1 | SUMMARY = "Mobile device API extensions for Qt/X11 4.x" | ||
2 | DEPENDS = "qt4-x11-free" | ||
3 | SECTION = "x11/libs" | ||
4 | qtm_embedded := "" | ||
5 | qtm_dir = "qt4" | ||
6 | qtm_glflags := "${@base_contains('DISTRO_FEATURES', 'opengl', '+=opengl', '-=opengl', d)} " | ||
7 | qtm_extra_config := "" | ||
8 | |||
9 | inherit qt4x11 | ||
10 | require qt-mobility_${PV}.inc | ||
diff --git a/meta/recipes-qt/qt4/qt-mobility_1.2.0.inc b/meta/recipes-qt/qt4/qt-mobility_1.2.0.inc new file mode 100644 index 0000000000..ff63d2b0d0 --- /dev/null +++ b/meta/recipes-qt/qt4/qt-mobility_1.2.0.inc | |||
@@ -0,0 +1,109 @@ | |||
1 | HOMEPAGE = "http://qt-project.org/" | ||
2 | DEPENDS = "gstreamer util-linux" | ||
3 | |||
4 | PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \ | ||
5 | ${@base_contains('DISTRO_FEATURES', 'bluetooth', 'bluetooth', '', d)}" | ||
6 | PACKAGECONFIG[bluetooth] = ",,bluez4" | ||
7 | PACKAGECONFIG[pulseaudio] = ",,pulseaudio" | ||
8 | |||
9 | LICENSE = "LGPLv2.1" | ||
10 | LIC_FILES_CHKSUM = "file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24 \ | ||
11 | file://LGPL_EXCEPTION.txt;md5=411080a56ff917a5a1aa08c98acae354" | ||
12 | |||
13 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/qt-mobility-${PV}:" | ||
14 | SRC_URI = "http://get.qt.nokia.com/qt/add-ons/qt-mobility-opensource-src-${PV}.tar.gz \ | ||
15 | file://qt-mobility-configure.patch \ | ||
16 | file://0001-gstvideoconnector-fixed-buffers-allocation.patch \ | ||
17 | file://0002-Remove-unnecessary-rpaths-from-qml_device-example.patch \ | ||
18 | file://qt-mobility-no-opengl.patch \ | ||
19 | file://gcc-scope.patch \ | ||
20 | file://qt-mobility-no-xvideo.patch \ | ||
21 | file://fix_metaobjectbuilder_build_err.patch \ | ||
22 | file://0001-fix-embedded-usage-doesn-t-work-outside-of-Qt.patch \ | ||
23 | " | ||
24 | |||
25 | SRC_URI[md5sum]="ea5db5a8d3dd4709c2926dceda646bd8" | ||
26 | SRC_URI[sha256sum]="ee3c88975e04139ac9589f76d4be646d44fcbc4c8c1cf2db621abc154cf0ba44" | ||
27 | |||
28 | PR = "r8" | ||
29 | |||
30 | S = "${WORKDIR}/qt-mobility-opensource-src-${PV}" | ||
31 | |||
32 | qtm_bin := "/usr/bin/${qtm_dir}" | ||
33 | qtm_lib := "/usr/lib" | ||
34 | qtm_include := "/usr/include/${qtm_dir}" | ||
35 | qtm_examples := "/usr/bin/${qtm_dir}/examples/QtMobility" | ||
36 | qtm_demos := "/usr/bin/${qtm_dir}/demos/QtMobility" | ||
37 | qtm_plugins := "/usr/lib/${qtm_dir}/plugins/QtMobility" | ||
38 | qtm_data := "/usr/share/${qtm_dir}" | ||
39 | qtm_imports := "/usr/lib/${qtm_dir}/imports" | ||
40 | |||
41 | QTM_MODULES_LIST ?= "bearer contacts gallery location publishsubscribe messaging multimedia \ | ||
42 | systeminfo serviceframework sensors versit organizer feedback connectivity" | ||
43 | |||
44 | do_configure_prepend() { | ||
45 | cp qtmobility.pro qtmobility.pro.old | ||
46 | sed -e 's@...QT_INSTALL_DATA.@${qtm_data}@' <qtmobility.pro.old >qtmobility.pro | ||
47 | for NAME in plugins/declarative/*/*.pro | ||
48 | do | ||
49 | cp $NAME $NAME.old | ||
50 | sed -e 's@...QT_INSTALL_IMPORTS.@${qtm_imports}@' <$NAME.old >$NAME | ||
51 | done | ||
52 | cp staticconfig.pri staticconfig.pri.old | ||
53 | echo "include(${STAGING_DATADIR}/${qtm_dir}/mkspecs/qconfig.pri)" >staticconfig.pri | ||
54 | cat staticconfig.pri.old >>staticconfig.pri | ||
55 | |||
56 | cat > features/platformconfig/oe.pri <<EOF | ||
57 | qmf_enabled = no | ||
58 | networkmanager_enabled = no | ||
59 | corewlan_enabled = no | ||
60 | immersion_enabled = no | ||
61 | meegotouchfeedback_enabled = no | ||
62 | maemo-icd_enabled = no | ||
63 | maemo-icd-network-wlan_enabled = no | ||
64 | maemo5-contacts_enabled = no | ||
65 | maemo5-calendar_enabled = no | ||
66 | maemo6-landmarks_enabled = no | ||
67 | bme_enabled = no | ||
68 | bluez_enabled = ${@base_contains('PACKAGECONFIG', 'bluetooth', 'yes', 'no', d)} | ||
69 | proj_enabled = no | ||
70 | gstreamer-photography_enabled = no | ||
71 | gstreamer-appsrc_enabled = yes | ||
72 | blkid_enabled = yes | ||
73 | pulseaudio_enabled = ${@base_contains('PACKAGECONFIG', 'pulseaudio', 'yes', 'no', d)} | ||
74 | udev_enabled = yes | ||
75 | iphb_enabled = no | ||
76 | nfc_symbian_enabled = no | ||
77 | sensord_enabled = no | ||
78 | geoclue-master_enabled = no | ||
79 | gypsy_enabled = no | ||
80 | ${qtm_extra_config} | ||
81 | EOF | ||
82 | |||
83 | ./configure -qmake-exec qmake2 -prefix /usr -staticconfig oe -examples -demos -modules "${QTM_MODULES_LIST}" | ||
84 | echo QT_MOBILITY_BIN = ${qtm_bin} >>./config.pri | ||
85 | echo QT_MOBILITY_LIB = ${qtm_lib} >>./config.pri | ||
86 | echo QT_MOBILITY_INCLUDE = ${qtm_include} >>./config.pri | ||
87 | echo QT_MOBILITY_PLUGINS = ${qtm_plugins} >>./config.pri | ||
88 | echo QT_MOBILITY_EXAMPLES = ${qtm_examples} >>./config.pri | ||
89 | echo QT_MOBILITY_DEMOS = ${qtm_demos} >>./config.pri | ||
90 | echo QT_CONFIG ${qtm_glflags} >>./config.pri | ||
91 | echo CONFIG += ${qtm_embedded} >>./config.pri | ||
92 | } | ||
93 | |||
94 | do_install() { | ||
95 | for NAME in */*.prf | ||
96 | do | ||
97 | cp $NAME $NAME.old | ||
98 | sed -e 's@/usr@${STAGING_BINDIR}/..@' <$NAME.old >$NAME | ||
99 | done | ||
100 | oe_runmake install INSTALL_ROOT=${D} | ||
101 | } | ||
102 | |||
103 | PACKAGES = "${PN}-dbg ${PN} ${PN}-dev" | ||
104 | |||
105 | FILES_${PN}-dbg = "${qtm_bin}/.debug ${qtm_examples}/.debug ${qtm_demos}/.debug \ | ||
106 | ${qtm_lib}/.debug ${qtm_plugins}/*/.debug ${qtm_imports}/*/.debug \ | ||
107 | ${qtm_imports}/*/*/.debug ${bindir}/.debug /usr/src/debug" | ||
108 | FILES_${PN} = "${qtm_bin} ${qtm_examples} ${qtm_demos} ${qtm_lib}/*.so.1* ${qtm_plugins} ${qtm_imports}" | ||
109 | FILES_${PN}-dev = "${exec_prefix}" | ||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5.inc b/meta/recipes-qt/qt4/qt4-4.8.5.inc new file mode 100644 index 0000000000..dcbf26ff12 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5.inc | |||
@@ -0,0 +1,63 @@ | |||
1 | LICENSE = "LGPLv2.1 | GPLv3" | ||
2 | LIC_FILES_CHKSUM = "file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24 \ | ||
3 | file://LICENSE.GPL3;md5=6e1694ee338db410417517884918d4d2 \ | ||
4 | file://LGPL_EXCEPTION.txt;md5=0145c4d1b6f96a661c2c139dfb268fb6" | ||
5 | |||
6 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/qt4-${PV}:" | ||
7 | |||
8 | SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-everywhere-opensource-src-${PV}.tar.gz \ | ||
9 | file://0003-webkit2-set-OUTPUT_DIR-value-if-empty.patch \ | ||
10 | file://0004-configure-qmake-is-already-built-in-qt4-tools-native.patch \ | ||
11 | file://0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch \ | ||
12 | file://0009-qmake-fix-source-file-references-in-qmake.pri.patch \ | ||
13 | file://0010-configure-Hack-to-not-use-the-pg_config-of-the-host-.patch \ | ||
14 | file://0011-freetype-host-includes.patch \ | ||
15 | file://0012-Add-2bpp-support.patch \ | ||
16 | file://0013-configure-add-crossarch-option.patch \ | ||
17 | file://0014-translations-fix-phony-translation-linking-error.patch \ | ||
18 | file://0015-configure-add-nostrip-for-debug-packages.patch \ | ||
19 | file://0016-configure-eval-QMAKE_CXX.patch \ | ||
20 | file://0017-configure-ensure-we-identify-the-compiler-as-g-in-co.patch \ | ||
21 | file://0018-configure-make-pulseaudio-a-configurable-option.patch \ | ||
22 | file://0019-Fixes-for-gcc-4.7.0-particularly-on-qemux86.patch \ | ||
23 | file://0020-webkit-disable-the-fuse-ld-gold-flag.patch \ | ||
24 | file://0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch \ | ||
25 | file://0023-QHttpMultiPart-fix-data-corruption-in-readData-metho.patch \ | ||
26 | file://0024-Ensure-lastPixel.y-is-also-initalized-to-1-when-nece.patch \ | ||
27 | file://0025-Fix-misaligned-selection-region-with-text-when-cente.patch \ | ||
28 | file://0027-tools.pro-disable-qmeegographicssystemhelper.patch \ | ||
29 | file://g++.conf \ | ||
30 | file://linux.conf \ | ||
31 | " | ||
32 | |||
33 | SRC_URI[md5sum] = "1864987bdbb2f58f8ae8b350dfdbe133" | ||
34 | SRC_URI[sha256sum] = "eb728f8268831dc4373be6403b7dd5d5dde03c169ad6882f9a8cb560df6aa138" | ||
35 | |||
36 | S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}" | ||
37 | |||
38 | FILES_${QT_BASE_NAME}-tools_append = " ${bindir}/qml ${bindir}/qmlplugindump" | ||
39 | FILES_${QT_BASE_NAME}-tools-dbg_append = " ${bindir}/.debug/qml ${bindir}/.debug/qmlplugindump" | ||
40 | |||
41 | PACKAGES_append = " ${QT_BASE_NAME}-tests-dbg ${QT_BASE_NAME}-tests" | ||
42 | FILES_${QT_BASE_NAME}-tests-dbg = "${prefix}/tests/qt4/*/.debug" | ||
43 | FILES_${QT_BASE_NAME}-tests = "${prefix}/tests/qt4/*" | ||
44 | |||
45 | do_configure_prepend() { | ||
46 | for pro in $(find ${S} -name "*.pro") ; do | ||
47 | sed -i \ | ||
48 | -e 's:$$QT_BUILD_TREE/bin/lrelease:${OE_QMAKE_LRELEASE}:g' \ | ||
49 | -e 's:qtPrepareTool(LRELEASE, lrelease):LRELEASE = ${OE_QMAKE_LRELEASE}:g' $pro | ||
50 | done | ||
51 | |||
52 | sed -i s:SEDME:${S}: ${WORKDIR}/linux.conf | ||
53 | sed -i \ | ||
54 | -e /QMAKE_MOC\ /d \ | ||
55 | -e /QMAKE_UIC\ /d \ | ||
56 | -e /QMAKE_UIC3\ /d \ | ||
57 | -e /QMAKE_RCC\ /d \ | ||
58 | ${S}/configure | ||
59 | |||
60 | # Avoid problems with Qt 4.8.0 configure setting QMAKE_LINK from LD (since we want the linker to be g++) | ||
61 | unset LD | ||
62 | } | ||
63 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch new file mode 100644 index 0000000000..d8b0a09d17 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 55097d27e8b746b3d5ff437939caf1fa43c0d62b Mon Sep 17 00:00:00 2001 | ||
2 | From: Holger Freyther <zecke@selfish.org> | ||
3 | Date: Wed, 26 Sep 2012 17:22:30 +0200 | ||
4 | Subject: [PATCH 01/21] qlibraryinfo: allow to set qt.conf from the outside | ||
5 | using the environment | ||
6 | |||
7 | Allow to set a qt.conf from the outside using the environment. This allows | ||
8 | to inject new prefixes and other paths into qmake. This is needed when using | ||
9 | the same qmake binary to build qt/x11 and qt/embedded | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
14 | --- | ||
15 | src/corelib/global/qlibraryinfo.cpp | 5 +++++ | ||
16 | 1 file changed, 5 insertions(+) | ||
17 | |||
18 | diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp | ||
19 | index 180dc39..4adad35 100644 | ||
20 | --- a/src/corelib/global/qlibraryinfo.cpp | ||
21 | +++ b/src/corelib/global/qlibraryinfo.cpp | ||
22 | @@ -54,6 +54,7 @@ | ||
23 | QT_BEGIN_NAMESPACE | ||
24 | extern QString qmake_libraryInfoFile(); | ||
25 | QT_END_NAMESPACE | ||
26 | +#include <stdlib.h> | ||
27 | #else | ||
28 | # include "qcoreapplication.h" | ||
29 | #endif | ||
30 | @@ -112,6 +113,10 @@ QSettings *QLibraryInfoPrivate::findConfiguration() | ||
31 | #ifdef BOOTSTRAPPING | ||
32 | if(!QFile::exists(qtconfig)) | ||
33 | qtconfig = qmake_libraryInfoFile(); | ||
34 | + if (!QFile::exists(qtconfig)) { | ||
35 | + QByteArray config = getenv("QT_CONF_PATH"); | ||
36 | + qtconfig = QFile::decodeName(config); | ||
37 | + } | ||
38 | #else | ||
39 | if (!QFile::exists(qtconfig) && QCoreApplication::instance()) { | ||
40 | #ifdef Q_OS_MAC | ||
41 | -- | ||
42 | 1.8.0 | ||
43 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0002-qkbdtty_qws-fix-build-with-old-kernel-headers.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0002-qkbdtty_qws-fix-build-with-old-kernel-headers.patch new file mode 100644 index 0000000000..98fc88738f --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0002-qkbdtty_qws-fix-build-with-old-kernel-headers.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 5e6b1051afa3099a02a758b0596236759d70670e Mon Sep 17 00:00:00 2001 | ||
2 | From: Wenzong Fan <wenzong.fan@windriver.com> | ||
3 | Date: Wed, 26 Sep 2012 20:18:08 +0200 | ||
4 | Subject: [PATCH 02/21] qkbdtty_qws: fix build with old kernel headers | ||
5 | |||
6 | This issue is that with C++ compiler process an old version of kernel | ||
7 | header file, coincidently that file has a variable named 'new': | ||
8 | |||
9 | * 'embedded/qkbdtty_qws.cpp' include 'linux/vt.h'; | ||
10 | * '/usr/include/linux/vt.h' has below code on SLED-11.x: | ||
11 | + unsigned int new; | ||
12 | |||
13 | On mostly hosts it has been changed to: new -> newev. | ||
14 | |||
15 | Upstream-Status: Pending | ||
16 | |||
17 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | ||
18 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
19 | --- | ||
20 | src/gui/embedded/qkbdtty_qws.cpp | 12 ++++++++++++ | ||
21 | 1 file changed, 12 insertions(+) | ||
22 | |||
23 | diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp | ||
24 | index a46811b..762138f 100644 | ||
25 | --- a/src/gui/embedded/qkbdtty_qws.cpp | ||
26 | +++ b/src/gui/embedded/qkbdtty_qws.cpp | ||
27 | @@ -54,8 +54,20 @@ | ||
28 | |||
29 | #if defined Q_OS_LINUX | ||
30 | # include <linux/kd.h> | ||
31 | + | ||
32 | +/* Workaround kernel headers using "new" as variable name. The problem | ||
33 | + is specific to SLED-11, other distros use "newev" rather than "new" */ | ||
34 | +#ifdef __cplusplus | ||
35 | +#warning "workaround kernel headers using new as variable name on SLED 11" | ||
36 | +#define new newev | ||
37 | +#endif | ||
38 | + | ||
39 | # include <linux/vt.h> //TODO: move vt handling somewhere else (QLinuxFbScreen?) | ||
40 | |||
41 | +#ifdef __cplusplus | ||
42 | +#undef new | ||
43 | +#endif | ||
44 | + | ||
45 | # include "qscreen_qws.h" | ||
46 | # include "qwindowsystem_qws.h" | ||
47 | # include "qapplication.h" | ||
48 | -- | ||
49 | 1.8.0 | ||
50 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0003-webkit2-set-OUTPUT_DIR-value-if-empty.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0003-webkit2-set-OUTPUT_DIR-value-if-empty.patch new file mode 100644 index 0000000000..ecaea51e08 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0003-webkit2-set-OUTPUT_DIR-value-if-empty.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From b6805e883c078f7647d9234aca4e3513ebd1c9bf Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Jansa <Martin.Jansa@gmail.com> | ||
3 | Date: Tue, 1 May 2012 07:48:15 +0200 | ||
4 | Subject: [PATCH 03/21] webkit2: set OUTPUT_DIR value if empty | ||
5 | |||
6 | Without this do_configure was trying to create /include/WebCore/libdummy.prl in root of build host filesystem | ||
7 | now it's in proper place ${WORKDIR}/qt-everywhere-opensource-src-4.8.1/src/3rdparty/webkit/include/WebCore/libdummy.prl | ||
8 | |||
9 | First reported here: | ||
10 | http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg24436.html | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
15 | --- | ||
16 | src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro | 2 ++ | ||
17 | 1 file changed, 2 insertions(+) | ||
18 | |||
19 | diff --git a/src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro b/src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro | ||
20 | index 006a88c..5e17193 100644 | ||
21 | --- a/src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro | ||
22 | +++ b/src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro | ||
23 | @@ -3,6 +3,8 @@ TARGET = dummy | ||
24 | |||
25 | CONFIG -= debug_and_release | ||
26 | |||
27 | +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../.. | ||
28 | + | ||
29 | CONFIG(standalone_package) { | ||
30 | isEmpty(WEBKIT2_GENERATED_SOURCES_DIR):WEBKIT2_GENERATED_SOURCES_DIR = $$PWD/generated | ||
31 | isEmpty(WC_GENERATED_SOURCES_DIR):WC_GENERATED_SOURCES_DIR = $$PWD/../WebCore/generated | ||
32 | -- | ||
33 | 1.8.0 | ||
34 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0004-configure-qmake-is-already-built-in-qt4-tools-native.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0004-configure-qmake-is-already-built-in-qt4-tools-native.patch new file mode 100644 index 0000000000..1eb8a5843a --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0004-configure-qmake-is-already-built-in-qt4-tools-native.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From af699c6e8cf9fb28d6f8b789bf33d53b47edaec7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Krelin <hacker@klever.net> | ||
3 | Date: Wed, 26 Sep 2012 20:24:20 +0200 | ||
4 | Subject: [PATCH 04/21] configure: qmake is already built in qt4-tools-native, | ||
5 | so disable it | ||
6 | |||
7 | Upstream-Status: Inappropriate [configuration] | ||
8 | |||
9 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
10 | --- | ||
11 | configure | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/configure b/configure | ||
15 | index e3d464b..cc04b27 100755 | ||
16 | --- a/configure | ||
17 | +++ b/configure | ||
18 | @@ -4899,7 +4899,7 @@ setBootstrapVariable() | ||
19 | } | ||
20 | |||
21 | # build qmake | ||
22 | -if true; then ###[ '!' -f "$outpath/bin/qmake" ]; | ||
23 | +if false; then ###[ '!' -f "$outpath/bin/qmake" ]; | ||
24 | echo "Creating qmake. Please wait..." | ||
25 | |||
26 | OLD_QCONFIG_H= | ||
27 | -- | ||
28 | 1.8.0 | ||
29 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0005-configure-set-LFLAGS-to-pick-up-zlib-from-staging.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0005-configure-set-LFLAGS-to-pick-up-zlib-from-staging.patch new file mode 100644 index 0000000000..1a8f2b7f94 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0005-configure-set-LFLAGS-to-pick-up-zlib-from-staging.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From ac93237bc90ea7773c0ef5275962baba01d4a9c7 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Jeremy=20Lain=C3=A9?= <jeremy.laine@m4x.org> | ||
3 | Date: Wed, 26 Sep 2012 20:27:44 +0200 | ||
4 | Subject: [PATCH 05/21] configure: set LFLAGS to pick up zlib from staging | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
9 | --- | ||
10 | configure | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/configure b/configure | ||
14 | index cc04b27..5a7c4ee 100755 | ||
15 | --- a/configure | ||
16 | +++ b/configure | ||
17 | @@ -690,7 +690,7 @@ fi | ||
18 | # initalize variables | ||
19 | #------------------------------------------------------------------------------- | ||
20 | |||
21 | -SYSTEM_VARIABLES="RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS" | ||
22 | +SYSTEM_VARIABLES="RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS LFLAGS" | ||
23 | for varname in $SYSTEM_VARIABLES; do | ||
24 | qmakevarname="${varname}" | ||
25 | # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS | ||
26 | -- | ||
27 | 1.8.0 | ||
28 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0006-configure-Use-OE_QMAKE_-values-to-specify-Qt-utility.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0006-configure-Use-OE_QMAKE_-values-to-specify-Qt-utility.patch new file mode 100644 index 0000000000..90ebf75095 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0006-configure-Use-OE_QMAKE_-values-to-specify-Qt-utility.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 0bc0db83812b5900dc4e6ffa96bdeab46b6adcae Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Wed, 26 Sep 2012 20:29:09 +0200 | ||
4 | Subject: [PATCH 06/21] configure: Use OE_QMAKE_* values to specify Qt utility | ||
5 | paths | ||
6 | |||
7 | Upstream-Status: Inappropriate [configuration] | ||
8 | |||
9 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
10 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
11 | --- | ||
12 | configure | 10 +++++----- | ||
13 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
14 | |||
15 | diff --git a/configure b/configure | ||
16 | index 5a7c4ee..db4d044 100755 | ||
17 | --- a/configure | ||
18 | +++ b/configure | ||
19 | @@ -8683,11 +8683,11 @@ QMAKE_ABSOLUTE_SOURCE_ROOT = \$\$QT_SOURCE_TREE | ||
20 | QMAKE_MOC_SRC = \$\$QT_BUILD_TREE/src/moc | ||
21 | |||
22 | #local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR | ||
23 | -QMAKE_MOC = \$\$QT_BUILD_TREE/bin/moc | ||
24 | -QMAKE_UIC = \$\$QT_BUILD_TREE/bin/uic | ||
25 | -QMAKE_UIC3 = \$\$QT_BUILD_TREE/bin/uic3 | ||
26 | -QMAKE_RCC = \$\$QT_BUILD_TREE/bin/rcc | ||
27 | -QMAKE_QDBUSXML2CPP = \$\$QT_BUILD_TREE/bin/qdbusxml2cpp | ||
28 | +QMAKE_MOC = \${OE_QMAKE_MOC} | ||
29 | +QMAKE_UIC = \${OE_QMAKE_UIC} | ||
30 | +QMAKE_UIC3 = \${OE_QMAKE_UIC3} | ||
31 | +QMAKE_RCC = \${OE_QMAKE_RCC} | ||
32 | +QMAKE_QDBUSXML2CPP = \${OE_QMAKE_QDBUSXML2CPP} | ||
33 | QMAKE_INCDIR_QT = \$\$QT_BUILD_TREE/include | ||
34 | QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib | ||
35 | |||
36 | -- | ||
37 | 1.8.0 | ||
38 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0007-dbus-Remove-const-usage-that-causes-compile-failure-.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0007-dbus-Remove-const-usage-that-causes-compile-failure-.patch new file mode 100644 index 0000000000..7d3b336f77 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0007-dbus-Remove-const-usage-that-causes-compile-failure-.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 2011bb8029480af1d1266f258e5a5f5cef7392d3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Pavel Heimlich <tropikhajma@gmail.com> | ||
3 | Date: Wed, 26 Sep 2012 20:31:10 +0200 | ||
4 | Subject: [PATCH 07/21] dbus: Remove "const" usage that causes compile failure | ||
5 | building nativesdk-qt4-tools | ||
6 | |||
7 | Patch has apparently been rejected upstream, not because it is invalid | ||
8 | but because the submitter did not submit a merge request for it, so the | ||
9 | validity of the patch upstream is uncertain. For further details see: | ||
10 | http://bugreports.qt.nokia.com/browse/QTBUG-17962 | ||
11 | |||
12 | Upstream-Status: Denied [possible retry] | ||
13 | |||
14 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
15 | --- | ||
16 | src/dbus/qdbusintegrator.cpp | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp | ||
20 | index 0f0b647..aa4cbab 100644 | ||
21 | --- a/src/dbus/qdbusintegrator.cpp | ||
22 | +++ b/src/dbus/qdbusintegrator.cpp | ||
23 | @@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE | ||
24 | static bool isDebugging; | ||
25 | #define qDBusDebug if (!::isDebugging); else qDebug | ||
26 | |||
27 | -Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS))) | ||
28 | +Q_GLOBAL_STATIC_WITH_ARGS(QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS))) | ||
29 | |||
30 | static inline QString dbusServiceString() | ||
31 | { return *orgFreedesktopDBusString(); } | ||
32 | -- | ||
33 | 1.8.0 | ||
34 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch new file mode 100644 index 0000000000..ec07f41403 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 64ce5d0e7c19436b928a2a0d9d192f56be3c9bb2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Wed, 26 Sep 2012 20:32:41 +0200 | ||
4 | Subject: [PATCH 08/21] qmake.pro: Allow building a separate qmake for the | ||
5 | target | ||
6 | |||
7 | Upstream-Status: Inappropriate [config] | ||
8 | |||
9 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
10 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
11 | --- | ||
12 | qmake/qmake.pro | 1 + | ||
13 | 1 file changed, 1 insertion(+) | ||
14 | |||
15 | diff --git a/qmake/qmake.pro b/qmake/qmake.pro | ||
16 | index 38e0fce..53b1ffb 100644 | ||
17 | --- a/qmake/qmake.pro | ||
18 | +++ b/qmake/qmake.pro | ||
19 | @@ -7,6 +7,7 @@ CONFIG += console bootstrap | ||
20 | CONFIG -= qt shared app_bundle uic | ||
21 | DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED | ||
22 | DESTDIR = ../bin/ | ||
23 | +TARGET = qmake2 | ||
24 | |||
25 | OBJECTS_DIR = . | ||
26 | MOC_DIR = . | ||
27 | -- | ||
28 | 1.8.0 | ||
29 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0009-qmake-fix-source-file-references-in-qmake.pri.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0009-qmake-fix-source-file-references-in-qmake.pri.patch new file mode 100644 index 0000000000..45b8c10fbe --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0009-qmake-fix-source-file-references-in-qmake.pri.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From e129dc0d6cde69dd15d1836c4111e0526fc29161 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Wed, 26 Sep 2012 20:33:49 +0200 | ||
4 | Subject: [PATCH 09/21] qmake: fix source file references in qmake.pri | ||
5 | |||
6 | Fix duplicate entries in SOURCES and HEADERS, and fix the source file | ||
7 | list for the split of qlocale.cpp. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
12 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
13 | --- | ||
14 | qmake/qmake.pri | 8 ++++---- | ||
15 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
16 | |||
17 | diff --git a/qmake/qmake.pri b/qmake/qmake.pri | ||
18 | index 31f67f4..9081669 100644 | ||
19 | --- a/qmake/qmake.pri | ||
20 | +++ b/qmake/qmake.pri | ||
21 | @@ -22,8 +22,7 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ | ||
22 | generators/symbian/initprojectdeploy_symbian.cpp \ | ||
23 | generators/integrity/gbuild.cpp \ | ||
24 | windows/registry.cpp \ | ||
25 | - symbian/epocroot.cpp \ | ||
26 | - generators/integrity/gbuild.cpp | ||
27 | + symbian/epocroot.cpp | ||
28 | |||
29 | HEADERS += project.h property.h generators/makefile.h \ | ||
30 | generators/unix/unixmake.h meta.h option.h cachekeys.h \ | ||
31 | @@ -40,8 +39,7 @@ HEADERS += project.h property.h generators/makefile.h \ | ||
32 | generators/symbian/initprojectdeploy_symbian.h \ | ||
33 | generators/integrity/gbuild.h \ | ||
34 | windows/registry_p.h \ | ||
35 | - symbian/epocroot_p.h \ | ||
36 | - generators/integrity/gbuild.h | ||
37 | + symbian/epocroot_p.h | ||
38 | |||
39 | contains(QT_EDITION, OpenSource) { | ||
40 | DEFINES += QMAKE_OPENSOURCE_EDITION | ||
41 | @@ -72,6 +70,8 @@ bootstrap { #Qt code | ||
42 | qlist.cpp \ | ||
43 | qlinkedlist.cpp \ | ||
44 | qlocale.cpp \ | ||
45 | + qlocale_tools.cpp \ | ||
46 | + qlocale_unix.cpp \ | ||
47 | qmalloc.cpp \ | ||
48 | qmap.cpp \ | ||
49 | qmetatype.cpp \ | ||
50 | -- | ||
51 | 1.8.0 | ||
52 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0010-configure-Hack-to-not-use-the-pg_config-of-the-host-.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0010-configure-Hack-to-not-use-the-pg_config-of-the-host-.patch new file mode 100644 index 0000000000..1d2ddab490 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0010-configure-Hack-to-not-use-the-pg_config-of-the-host-.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 4888791d1899f781af710dd8813887dea52fda59 Mon Sep 17 00:00:00 2001 | ||
2 | From: Holger Freyther <zecke@selfish.org> | ||
3 | Date: Wed, 26 Sep 2012 20:36:38 +0200 | ||
4 | Subject: [PATCH 10/21] configure: Hack to not use the pg_config of the host | ||
5 | system which will add /usr/include | ||
6 | |||
7 | pg_config is a native binary so using that when cross compiling | ||
8 | will always fail. The commented out fix would do, but for OE | ||
9 | our -platform and -xplatform is the same so we are actually not | ||
10 | really cross compiling. Just comment out the test, we are passing | ||
11 | the location to the postgres headers and if they are okay we | ||
12 | will pad. | ||
13 | |||
14 | Upstream-Status: Inappropriate [configuration] | ||
15 | |||
16 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
17 | --- | ||
18 | configure | 8 ++++---- | ||
19 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
20 | |||
21 | diff --git a/configure b/configure | ||
22 | index db4d044..35a8fe7 100755 | ||
23 | --- a/configure | ||
24 | +++ b/configure | ||
25 | @@ -5511,10 +5511,10 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do | ||
26 | psql) | ||
27 | if [ "$CFG_SQL_psql" != "no" ]; then | ||
28 | # Be careful not to use native pg_config when cross building. | ||
29 | - if [ "$XPLATFORM_MINGW" != "yes" ] && "$WHICH" pg_config >/dev/null 2>&1; then | ||
30 | - QT_CFLAGS_PSQL=`pg_config --includedir 2>/dev/null` | ||
31 | - QT_LFLAGS_PSQL=`pg_config --libdir 2>/dev/null` | ||
32 | - fi | ||
33 | +# if [ "$XPLATFORM_MINGW" != "yes" ] && "$WHICH" pg_config >/dev/null 2>&1; then | ||
34 | +# QT_CFLAGS_PSQL=`pg_config --includedir 2>/dev/null` | ||
35 | +# QT_LFLAGS_PSQL=`pg_config --libdir 2>/dev/null` | ||
36 | +# fi | ||
37 | [ -z "$QT_CFLAGS_PSQL" ] || QT_CFLAGS_PSQL="-I$QT_CFLAGS_PSQL" | ||
38 | [ -z "$QT_LFLAGS_PSQL" ] || QT_LFLAGS_PSQL="-L$QT_LFLAGS_PSQL" | ||
39 | # But, respect PSQL_LIBS if set | ||
40 | -- | ||
41 | 1.8.0 | ||
42 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0011-freetype-host-includes.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0011-freetype-host-includes.patch new file mode 100644 index 0000000000..e0879c5615 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0011-freetype-host-includes.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 3fcffa79e6a5f0448cbfe2bb33fe1218f5dae61d Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Krelin <hacker@klever.net> | ||
3 | Date: Mon, 4 Jun 2007 14:48:50 +0200 | ||
4 | Subject: [PATCH 11/21] freetype host includes | ||
5 | |||
6 | Host include path should not be used in cross compiling case. | ||
7 | |||
8 | Ported from OE by: Yu Ke <ke.yu@intel.com> | ||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
12 | --- | ||
13 | config.tests/unix/freetype/freetype.pri | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/config.tests/unix/freetype/freetype.pri b/config.tests/unix/freetype/freetype.pri | ||
17 | index 7ef1cf9..b362fcd 100644 | ||
18 | --- a/config.tests/unix/freetype/freetype.pri | ||
19 | +++ b/config.tests/unix/freetype/freetype.pri | ||
20 | @@ -1,5 +1,5 @@ | ||
21 | !cross_compile { | ||
22 | - TRY_INCLUDEPATHS = /include /usr/include $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH | ||
23 | + TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH | ||
24 | # LSB doesn't allow using headers from /include or /usr/include | ||
25 | linux-lsb-g++:TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH | ||
26 | for(p, TRY_INCLUDEPATHS) { | ||
27 | -- | ||
28 | 1.8.0 | ||
29 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0012-Add-2bpp-support.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0012-Add-2bpp-support.patch new file mode 100644 index 0000000000..8402eab635 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0012-Add-2bpp-support.patch | |||
@@ -0,0 +1,318 @@ | |||
1 | From 8744273fc452eb54bbeeb7d15823009ce926c6fa Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Jeremy=20Lain=C3=A9?= <jeremy.laine@m4x.org> | ||
3 | Date: Wed, 26 Sep 2012 20:39:21 +0200 | ||
4 | Subject: [PATCH 12/21] Add 2bpp support | ||
5 | |||
6 | Submitted upstream but rejected as being "out of scope": | ||
7 | http://bugreports.qt.nokia.com/browse/QTBUG-3468 | ||
8 | |||
9 | Upstream-Status: Denied | ||
10 | |||
11 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
12 | --- | ||
13 | configure | 5 +- | ||
14 | src/gui/embedded/qscreen_qws.cpp | 211 ++++++++++++++++++++++++++++++++ | ||
15 | src/gui/embedded/qscreenlinuxfb_qws.cpp | 4 +- | ||
16 | 3 files changed, 216 insertions(+), 4 deletions(-) | ||
17 | |||
18 | diff --git a/configure b/configure | ||
19 | index 35a8fe7..79c1c7b 100755 | ||
20 | --- a/configure | ||
21 | +++ b/configure | ||
22 | @@ -7063,6 +7063,7 @@ if [ "$CFG_QWS_DEPTHS" = "prompted" -a "$PROMPT_FOR_DEPTHS" = "yes" ]; then | ||
23 | echo "Choose pixel-depths to support:" | ||
24 | echo | ||
25 | echo " 1. 1bpp, black/white" | ||
26 | + echo " 2. 2bpp, grayscale" | ||
27 | echo " 4. 4bpp, grayscale" | ||
28 | echo " 8. 8bpp, paletted" | ||
29 | echo " 12. 12bpp, rgb 4-4-4" | ||
30 | @@ -7081,11 +7082,11 @@ if [ "$CFG_QWS_DEPTHS" = "prompted" -a "$PROMPT_FOR_DEPTHS" = "yes" ]; then | ||
31 | fi | ||
32 | if [ -n "$CFG_QWS_DEPTHS" -a "$PLATFORM_QWS" = "yes" ]; then | ||
33 | if [ "$CFG_QWS_DEPTHS" = "all" ]; then | ||
34 | - CFG_QWS_DEPTHS="1 4 8 12 15 16 18 24 32 generic" | ||
35 | + CFG_QWS_DEPTHS="1 2 4 8 12 15 16 18 24 32 generic" | ||
36 | fi | ||
37 | for D in `echo "$CFG_QWS_DEPTHS" | sed -e 's/,/ /g'`; do | ||
38 | case $D in | ||
39 | - 1|4|8|12|15|16|18|24|32) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_$D";; | ||
40 | + 1|2|4|8|12|15|16|18|24|32) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_$D";; | ||
41 | generic) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_GENERIC";; | ||
42 | esac | ||
43 | done | ||
44 | diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp | ||
45 | index b307bf2..88950b3 100644 | ||
46 | --- a/src/gui/embedded/qscreen_qws.cpp | ||
47 | +++ b/src/gui/embedded/qscreen_qws.cpp | ||
48 | @@ -469,6 +469,58 @@ static void solidFill_gray4(QScreen *screen, const QColor &color, | ||
49 | } | ||
50 | #endif // QT_QWS_DEPTH_4 | ||
51 | |||
52 | +#ifdef QT_QWS_DEPTH_2 | ||
53 | +static inline void qt_rectfill_gray2(quint8 *dest, quint8 value, | ||
54 | + int x, int y, int width, int height, | ||
55 | + int stride) | ||
56 | +{ | ||
57 | + const int pixelsPerByte = 4; | ||
58 | + const int alignWidth = qMin(width, (4 - (x & 3)) & 3); | ||
59 | + const int doAlign = (alignWidth > 0 ? 1 : 0); | ||
60 | + const int alignStart = pixelsPerByte - 1 - (x & 3); | ||
61 | + const int alignStop = alignStart - (alignWidth - 1); | ||
62 | + const quint8 alignMask = ((1 << (2 * alignWidth)) - 1) << (2 * alignStop); | ||
63 | + const int tailWidth = (width - alignWidth) & 3; | ||
64 | + const int doTail = (tailWidth > 0 ? 1 : 0); | ||
65 | + const quint8 tailMask = (1 << (2 * (pixelsPerByte - tailWidth))) - 1; | ||
66 | + const int width8 = (width - alignWidth) / pixelsPerByte; | ||
67 | + | ||
68 | + dest += y * stride + x / pixelsPerByte; | ||
69 | + stride -= (doAlign + width8); | ||
70 | + | ||
71 | + for (int j = 0; j < height; ++j) { | ||
72 | + if (doAlign) { | ||
73 | + *dest = (*dest & ~alignMask) | (value & alignMask); | ||
74 | + ++dest; | ||
75 | + } | ||
76 | + if (width8) { | ||
77 | + qt_memfill<quint8>(dest, value, width8); | ||
78 | + dest += width8; | ||
79 | + } | ||
80 | + if (doTail) | ||
81 | + *dest = (*dest & tailMask) | (value & ~tailMask); | ||
82 | + dest += stride; | ||
83 | + } | ||
84 | +} | ||
85 | + | ||
86 | +static void solidFill_gray2(QScreen *screen, const QColor &color, | ||
87 | + const QRegion ®ion) | ||
88 | +{ | ||
89 | + quint8 *dest = reinterpret_cast<quint8*>(screen->base()); | ||
90 | + const quint8 c = qGray(color.rgba()) >> 6; | ||
91 | + const quint8 c8 = (c << 6) | (c << 4) | (c << 2) | c; | ||
92 | + | ||
93 | + const int stride = screen->linestep(); | ||
94 | + const QVector<QRect> rects = region.rects(); | ||
95 | + | ||
96 | + for (int i = 0; i < rects.size(); ++i) { | ||
97 | + const QRect r = rects.at(i); | ||
98 | + qt_rectfill_gray2(dest, c8, r.x(), r.y(), r.width(), r.height(), | ||
99 | + stride); | ||
100 | + } | ||
101 | +} | ||
102 | +#endif // QT_QWS_DEPTH_2 | ||
103 | + | ||
104 | #ifdef QT_QWS_DEPTH_1 | ||
105 | static inline void qt_rectfill_mono(quint8 *dest, quint8 value, | ||
106 | int x, int y, int width, int height, | ||
107 | @@ -576,6 +628,11 @@ void qt_solidFill_setup(QScreen *screen, const QColor &color, | ||
108 | screen->d_ptr->solidFill = solidFill_gray4; | ||
109 | break; | ||
110 | #endif | ||
111 | +#ifdef QT_QWS_DEPTH_2 | ||
112 | + case 2: | ||
113 | + screen->d_ptr->solidFill = solidFill_gray2; | ||
114 | + break; | ||
115 | +#endif | ||
116 | #ifdef QT_QWS_DEPTH_1 | ||
117 | case 1: | ||
118 | screen->d_ptr->solidFill = solidFill_mono; | ||
119 | @@ -1006,6 +1063,149 @@ static void blit_4(QScreen *screen, const QImage &image, | ||
120 | } | ||
121 | #endif // QT_QWS_DEPTH_4 | ||
122 | |||
123 | +#ifdef QT_QWS_DEPTH_2 | ||
124 | + | ||
125 | +struct qgray2 { quint8 dummy; } Q_PACKED; | ||
126 | + | ||
127 | +template <typename SRC> | ||
128 | +static inline quint8 qt_convertToGray2(SRC color); | ||
129 | + | ||
130 | +template <> | ||
131 | +inline quint8 qt_convertToGray2(quint32 color) | ||
132 | +{ | ||
133 | + return qGray(color) >> 6; | ||
134 | +} | ||
135 | + | ||
136 | +template <> | ||
137 | +inline quint8 qt_convertToGray2(quint16 color) | ||
138 | +{ | ||
139 | + const int r = (color & 0xf800) >> 11; | ||
140 | + const int g = (color & 0x07e0) >> 6; // only keep 5 bit | ||
141 | + const int b = (color & 0x001f); | ||
142 | + return (r * 11 + g * 16 + b * 5) >> 8; | ||
143 | +} | ||
144 | + | ||
145 | +template <> | ||
146 | +inline quint8 qt_convertToGray2(qrgb444 color) | ||
147 | +{ | ||
148 | + return qt_convertToGray2(quint32(color)); | ||
149 | +} | ||
150 | + | ||
151 | +template <> | ||
152 | +inline quint8 qt_convertToGray2(qargb4444 color) | ||
153 | +{ | ||
154 | + return qt_convertToGray2(quint32(color)); | ||
155 | +} | ||
156 | + | ||
157 | +template <typename SRC> | ||
158 | +static inline void qt_rectconvert_gray2(qgray2 *dest2, const SRC *src, | ||
159 | + int x, int y, int width, int height, | ||
160 | + int dstStride, int srcStride) | ||
161 | +{ | ||
162 | + const int pixelsPerByte = 4; | ||
163 | + quint8 *dest8 = reinterpret_cast<quint8*>(dest2) | ||
164 | + + y * dstStride + x / pixelsPerByte; | ||
165 | + const int alignWidth = qMin(width, (4 - (x & 3)) & 3); | ||
166 | + const int doAlign = (alignWidth > 0 ? 1 : 0); | ||
167 | + const int alignStart = pixelsPerByte - 1 - (x & 3); | ||
168 | + const int alignStop = alignStart - (alignWidth - 1); | ||
169 | + const quint8 alignMask = ((1 << (2 * alignWidth)) - 1) << (2 * alignStop); | ||
170 | + const int tailWidth = (width - alignWidth) & 3; | ||
171 | + const int doTail = (tailWidth > 0 ? 1 : 0); | ||
172 | + const quint8 tailMask = (1 << (2 * (pixelsPerByte - tailWidth))) - 1; | ||
173 | + const int width8 = (width - alignWidth) / pixelsPerByte; | ||
174 | + | ||
175 | + srcStride = srcStride / sizeof(SRC) - (width8 * pixelsPerByte + alignWidth); | ||
176 | + dstStride -= (width8 + doAlign); | ||
177 | + | ||
178 | + for (int j = 0; j < height; ++j) { | ||
179 | + if (doAlign) { | ||
180 | + quint8 d = *dest8 & ~alignMask; | ||
181 | + for (int i = alignStart; i >= alignStop; --i) | ||
182 | + d |= qt_convertToGray2<SRC>(*src++) << (2 * i); | ||
183 | + *dest8++ = d; | ||
184 | + } | ||
185 | + for (int i = 0; i < width8; ++i) { | ||
186 | + *dest8 = (qt_convertToGray2<SRC>(src[0]) << 6) | ||
187 | + | (qt_convertToGray2<SRC>(src[1]) << 4) | ||
188 | + | (qt_convertToGray2<SRC>(src[2]) << 2) | ||
189 | + | (qt_convertToGray2<SRC>(src[3])); | ||
190 | + src += 4; | ||
191 | + ++dest8; | ||
192 | + } | ||
193 | + if (doTail) { | ||
194 | + quint8 d = *dest8 & tailMask; | ||
195 | + switch (tailWidth) { | ||
196 | + case 3: d |= qt_convertToGray2<SRC>(src[2]) << 2; | ||
197 | + case 2: d |= qt_convertToGray2<SRC>(src[1]) << 4; | ||
198 | + case 1: d |= qt_convertToGray2<SRC>(src[0]) << 6; | ||
199 | + } | ||
200 | + *dest8 = d; | ||
201 | + } | ||
202 | + | ||
203 | + dest8 += dstStride; | ||
204 | + src += srcStride; | ||
205 | + } | ||
206 | +} | ||
207 | + | ||
208 | +template <> | ||
209 | +void qt_rectconvert(qgray2 *dest, const quint32 *src, | ||
210 | + int x, int y, int width, int height, | ||
211 | + int dstStride, int srcStride) | ||
212 | +{ | ||
213 | + qt_rectconvert_gray2<quint32>(dest, src, x, y, width, height, | ||
214 | + dstStride, srcStride); | ||
215 | +} | ||
216 | + | ||
217 | +template <> | ||
218 | +void qt_rectconvert(qgray2 *dest, const quint16 *src, | ||
219 | + int x, int y, int width, int height, | ||
220 | + int dstStride, int srcStride) | ||
221 | +{ | ||
222 | + qt_rectconvert_gray2<quint16>(dest, src, x, y, width, height, | ||
223 | + dstStride, srcStride); | ||
224 | +} | ||
225 | + | ||
226 | +template <> | ||
227 | +void qt_rectconvert(qgray2 *dest, const qrgb444 *src, | ||
228 | + int x, int y, int width, int height, | ||
229 | + int dstStride, int srcStride) | ||
230 | +{ | ||
231 | + qt_rectconvert_gray2<qrgb444>(dest, src, x, y, width, height, | ||
232 | + dstStride, srcStride); | ||
233 | +} | ||
234 | + | ||
235 | +template <> | ||
236 | +void qt_rectconvert(qgray2 *dest, const qargb4444 *src, | ||
237 | + int x, int y, int width, int height, | ||
238 | + int dstStride, int srcStride) | ||
239 | +{ | ||
240 | + qt_rectconvert_gray2<qargb4444>(dest, src, x, y, width, height, | ||
241 | + dstStride, srcStride); | ||
242 | +} | ||
243 | + | ||
244 | +static void blit_2(QScreen *screen, const QImage &image, | ||
245 | + const QPoint &topLeft, const QRegion ®ion) | ||
246 | +{ | ||
247 | + switch (image.format()) { | ||
248 | + case QImage::Format_ARGB32_Premultiplied: | ||
249 | + blit_template<qgray2, quint32>(screen, image, topLeft, region); | ||
250 | + return; | ||
251 | + case QImage::Format_RGB16: | ||
252 | + blit_template<qgray2, quint16>(screen, image, topLeft, region); | ||
253 | + return; | ||
254 | + case QImage::Format_RGB444: | ||
255 | + blit_template<qgray2, qrgb444>(screen, image, topLeft, region); | ||
256 | + return; | ||
257 | + case QImage::Format_ARGB4444_Premultiplied: | ||
258 | + blit_template<qgray2, qargb4444>(screen, image, topLeft, region); | ||
259 | + return; | ||
260 | + default: | ||
261 | + qCritical("blit_2(): Image format %d not supported!", image.format()); | ||
262 | + } | ||
263 | +} | ||
264 | +#endif // QT_QWS_DEPTH_2 | ||
265 | + | ||
266 | #ifdef QT_QWS_DEPTH_1 | ||
267 | |||
268 | struct qmono { quint8 dummy; } Q_PACKED; | ||
269 | @@ -1259,6 +1459,11 @@ void qt_blit_setup(QScreen *screen, const QImage &image, | ||
270 | screen->d_ptr->blit = blit_4; | ||
271 | break; | ||
272 | #endif | ||
273 | +#ifdef QT_QWS_DEPTH_2 | ||
274 | + case 2: | ||
275 | + screen->d_ptr->blit = blit_2; | ||
276 | + break; | ||
277 | +#endif | ||
278 | #ifdef QT_QWS_DEPTH_1 | ||
279 | case 1: | ||
280 | screen->d_ptr->blit = blit_1; | ||
281 | @@ -2146,6 +2351,8 @@ int QScreen::alloc(unsigned int r,unsigned int g,unsigned int b) | ||
282 | } | ||
283 | } else if (d == 4) { | ||
284 | ret = qGray(r, g, b) >> 4; | ||
285 | + } else if (d == 2) { | ||
286 | + ret = qGray(r, g, b) >> 6; | ||
287 | } else if (d == 1) { | ||
288 | ret = qGray(r, g, b) >= 128; | ||
289 | } else { | ||
290 | @@ -2216,6 +2423,10 @@ bool QScreen::supportsDepth(int d) const | ||
291 | } else if(d==1) { | ||
292 | return true; | ||
293 | #endif | ||
294 | +#ifdef QT_QWS_DEPTH_2 | ||
295 | + } else if(d==2) { | ||
296 | + return true; | ||
297 | +#endif | ||
298 | #ifdef QT_QWS_DEPTH_4 | ||
299 | } else if(d==4) { | ||
300 | return true; | ||
301 | diff --git a/src/gui/embedded/qscreenlinuxfb_qws.cpp b/src/gui/embedded/qscreenlinuxfb_qws.cpp | ||
302 | index 6f3caad..14159ee 100644 | ||
303 | --- a/src/gui/embedded/qscreenlinuxfb_qws.cpp | ||
304 | +++ b/src/gui/embedded/qscreenlinuxfb_qws.cpp | ||
305 | @@ -466,8 +466,8 @@ bool QLinuxFbScreen::connect(const QString &displaySpec) | ||
306 | setupOffScreen(); | ||
307 | |||
308 | // Now read in palette | ||
309 | - if((vinfo.bits_per_pixel==8) || (vinfo.bits_per_pixel==4)) { | ||
310 | - screencols= (vinfo.bits_per_pixel==8) ? 256 : 16; | ||
311 | + if((vinfo.bits_per_pixel==8) || (vinfo.bits_per_pixel==4) || (vinfo.bits_per_pixel==2)) { | ||
312 | + screencols= 1 << vinfo.bits_per_pixel; | ||
313 | int loopc; | ||
314 | ::fb_cmap startcmap; | ||
315 | startcmap.start=0; | ||
316 | -- | ||
317 | 1.8.0 | ||
318 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0013-configure-add-crossarch-option.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0013-configure-add-crossarch-option.patch new file mode 100644 index 0000000000..aa464fd1ed --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0013-configure-add-crossarch-option.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 549342fa380ed2a9ad41be3d04ee2f0585f6a465 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Lauer <mickey@vanille-media.de> | ||
3 | Date: Wed, 26 Sep 2012 20:41:32 +0200 | ||
4 | Subject: [PATCH 13/21] configure: add "-crossarch" option | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
9 | --- | ||
10 | configure | 7 ++++++- | ||
11 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/configure b/configure | ||
14 | index 79c1c7b..7983c3d 100755 | ||
15 | --- a/configure | ||
16 | +++ b/configure | ||
17 | @@ -1153,7 +1153,7 @@ while [ "$#" -gt 0 ]; do | ||
18 | shift | ||
19 | VAL=$1 | ||
20 | ;; | ||
21 | - -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-device-option|-buildkey|-sdk|-arch|-host-arch|-mysql_config|-sysroot) | ||
22 | + -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-device-option|-buildkey|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-crossarch) | ||
23 | VAR=`echo $1 | sed "s,^-\(.*\),\1,"` | ||
24 | shift | ||
25 | VAL="$1" | ||
26 | @@ -1709,6 +1709,9 @@ while [ "$#" -gt 0 ]; do | ||
27 | DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"` | ||
28 | DeviceVar set $DEV_VAR $DEV_VAL | ||
29 | ;; | ||
30 | + crossarch) | ||
31 | + CROSSARCH="$VAL" | ||
32 | + ;; | ||
33 | debug-and-release) | ||
34 | if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then | ||
35 | CFG_DEBUG_RELEASE="$VAL" | ||
36 | @@ -3324,6 +3327,8 @@ arm*) | ||
37 | ;; | ||
38 | esac | ||
39 | |||
40 | +CFG_ARCH="$CROSSARCH" | ||
41 | + | ||
42 | if [ -d "$relpath/src/corelib/arch/$CFG_ARCH" ]; then | ||
43 | if [ "$OPT_VERBOSE" = "yes" ]; then | ||
44 | echo " '$CFG_ARCH' is supported" | ||
45 | -- | ||
46 | 1.8.0 | ||
47 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0014-translations-fix-phony-translation-linking-error.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0014-translations-fix-phony-translation-linking-error.patch new file mode 100644 index 0000000000..66724a8ecf --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0014-translations-fix-phony-translation-linking-error.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 21af8f6d21b28a53041affb11b58d6316023fa92 Mon Sep 17 00:00:00 2001 | ||
2 | From: Otavio Salvador <otavio@ossystems.com.br> | ||
3 | Date: Wed, 26 Sep 2012 20:45:10 +0200 | ||
4 | Subject: [PATCH 14/21] translations: fix phony translation linking error | ||
5 | |||
6 | | .../usr/lib/crt1.o: In function `_start': | ||
7 | | .../../sysdeps/i386/elf/start.S:115: undefined reference to `main' | ||
8 | | collect2: ld returned 1 exit status | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
13 | --- | ||
14 | translations/translations.pro | 4 ++-- | ||
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/translations/translations.pro b/translations/translations.pro | ||
18 | index dc99beb..0d98829 100644 | ||
19 | --- a/translations/translations.pro | ||
20 | +++ b/translations/translations.pro | ||
21 | @@ -101,7 +101,7 @@ updateqm.name = LRELEASE ${QMAKE_FILE_IN} | ||
22 | updateqm.CONFIG += no_link | ||
23 | QMAKE_EXTRA_COMPILERS += updateqm | ||
24 | |||
25 | -isEmpty(vcproj) { | ||
26 | +!isEmpty(vcproj) { | ||
27 | QMAKE_LINK = @: IGNORE THIS LINE | ||
28 | OBJECTS_DIR = | ||
29 | win32:CONFIG -= embed_manifest_exe | ||
30 | @@ -111,7 +111,7 @@ isEmpty(vcproj) { | ||
31 | phony_src.input = PHONY_DEPS | ||
32 | phony_src.output = phony.c | ||
33 | phony_src.variable_out = GENERATED_SOURCES | ||
34 | - phony_src.commands = echo int main() { return 0; } > phony.c | ||
35 | + phony_src.commands = echo \"int main() { return 0; }\" > phony.c | ||
36 | phony_src.name = CREATE phony.c | ||
37 | phony_src.CONFIG += combine | ||
38 | QMAKE_EXTRA_COMPILERS += phony_src | ||
39 | -- | ||
40 | 1.8.0 | ||
41 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0015-configure-add-nostrip-for-debug-packages.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0015-configure-add-nostrip-for-debug-packages.patch new file mode 100644 index 0000000000..b5db49128c --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0015-configure-add-nostrip-for-debug-packages.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 9250fed086a4a8a645a972764a9bf34e4566ec2e Mon Sep 17 00:00:00 2001 | ||
2 | From: Fathi Boudra <fabo@debian.org> | ||
3 | Date: Wed, 26 Sep 2012 20:46:14 +0200 | ||
4 | Subject: [PATCH 15/21] configure: add nostrip for debug packages | ||
5 | |||
6 | Qt is built in release mode and strip files by default. | ||
7 | Set CONFIG+=nostrip to avoid the stripping and | ||
8 | let dh_strip do it to generate debug packages. | ||
9 | |||
10 | Upstream-Status: Inappropriate [Configuration] | ||
11 | |||
12 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
13 | --- | ||
14 | configure | 2 ++ | ||
15 | 1 file changed, 2 insertions(+) | ||
16 | |||
17 | diff --git a/configure b/configure | ||
18 | index 7983c3d..d02824b 100755 | ||
19 | --- a/configure | ||
20 | +++ b/configure | ||
21 | @@ -710,6 +710,8 @@ mkdir -p "$outpath/config.tests" | ||
22 | rm -f "$outpath/config.tests/.qmake.cache" | ||
23 | cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache" | ||
24 | |||
25 | +QMakeVar add CONFIG nostrip | ||
26 | + | ||
27 | QMakeVar add styles "cde mac motif plastique cleanlooks windows" | ||
28 | QMakeVar add decorations "default windows styled" | ||
29 | QMakeVar add mouse-drivers "pc" | ||
30 | -- | ||
31 | 1.8.0 | ||
32 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0016-configure-eval-QMAKE_CXX.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0016-configure-eval-QMAKE_CXX.patch new file mode 100644 index 0000000000..9c3de47b4b --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0016-configure-eval-QMAKE_CXX.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 8403634a71f067eec514b6d2193cf41e281dff8e Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Wed, 26 Sep 2012 20:47:08 +0200 | ||
4 | Subject: [PATCH 16/21] configure: eval QMAKE_CXX | ||
5 | |||
6 | Allow expansion of $(...) references in QMAKE_CXX (currently its value | ||
7 | is $(OE_QMAKE_CXX)) in order to allow compiler version check to succeed | ||
8 | which allows WebKit to be enabled. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
13 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
14 | |||
15 | Conflicts: | ||
16 | configure | ||
17 | --- | ||
18 | configure | 3 ++- | ||
19 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/configure b/configure | ||
22 | index d02824b..891d6e7 100755 | ||
23 | --- a/configure | ||
24 | +++ b/configure | ||
25 | @@ -3409,7 +3409,8 @@ else | ||
26 | CFG_FRAMEWORK=no | ||
27 | fi | ||
28 | |||
29 | -QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX` | ||
30 | +QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX | sed -n 's/$[(]\([0-9a-zA-Z_]*\)[)]/$\1/pg'` | ||
31 | +QMAKE_CONF_COMPILER=`eval "echo $QMAKE_CONF_COMPILER"` | ||
32 | TEST_COMPILER="$CXX" | ||
33 | |||
34 | [ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER | ||
35 | -- | ||
36 | 1.8.0 | ||
37 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0017-configure-ensure-we-identify-the-compiler-as-g-in-co.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0017-configure-ensure-we-identify-the-compiler-as-g-in-co.patch new file mode 100644 index 0000000000..9471966660 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0017-configure-ensure-we-identify-the-compiler-as-g-in-co.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From d2bb701b551402f0befddd0e906423596bdc0df7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Wed, 26 Sep 2012 20:48:37 +0200 | ||
4 | Subject: [PATCH 17/21] configure: ensure we identify the compiler as g++ in | ||
5 | configure | ||
6 | |||
7 | Our PLATFORM in OE is ${TARGET_OS}-oe-g++, and previously the configure | ||
8 | script was interpreting from this that the compiler was "oe-g++" and | ||
9 | thus | ||
10 | g++ specific checks were not being run since this string did not match; | ||
11 | among other things this resulted in a compiler version check in the | ||
12 | QtWebKit build code not working, and hence the following error at build | ||
13 | time: | ||
14 | |||
15 | ./wtf/NullPtr.h:48:1: error: identifier 'nullptr' will become a keyword | ||
16 | in C++0x [-Werror=c++0x-compat] | ||
17 | |||
18 | The easiest thing since our PLATFORM is entirely artificial is to just | ||
19 | force COMPILER to "g++" in the configure script if it is detected as | ||
20 | "oe-g++". | ||
21 | |||
22 | Upstream-Status: Inappropriate [configuration] | ||
23 | |||
24 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
25 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
26 | --- | ||
27 | configure | 3 +++ | ||
28 | 1 file changed, 3 insertions(+) | ||
29 | |||
30 | diff --git a/configure b/configure | ||
31 | index 891d6e7..7031898 100755 | ||
32 | --- a/configure | ||
33 | +++ b/configure | ||
34 | @@ -7592,6 +7592,9 @@ elif [ "$XPLATFORM" != "$PLATFORM" ]; then | ||
35 | else | ||
36 | COMPILER=`echo $PLATFORM | cut -f 2- -d-` | ||
37 | fi | ||
38 | +case $COMPILER in | ||
39 | + *oe-g++) COMPILER="g++" ;; | ||
40 | +esac | ||
41 | if [ "$CFG_EXCEPTIONS" = "unspecified" -a "$PLATFORM_QWS" = "yes" ]; then | ||
42 | CFG_EXCEPTIONS=no | ||
43 | fi | ||
44 | -- | ||
45 | 1.8.0 | ||
46 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0018-configure-make-pulseaudio-a-configurable-option.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0018-configure-make-pulseaudio-a-configurable-option.patch new file mode 100644 index 0000000000..19cdd4c57d --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0018-configure-make-pulseaudio-a-configurable-option.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From d6dc1a7d6594d7e395347732a3e553fc82ccab3d Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Tue, 28 Feb 2012 15:10:24 +0000 | ||
4 | Subject: [PATCH 18/21] configure: make pulseaudio a configurable option | ||
5 | |||
6 | Allows disabling pulseaudio support within phonon at configure time. | ||
7 | (This is the Qt 4.8.0 version.) | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
12 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
13 | --- | ||
14 | configure | 9 ++++++++- | ||
15 | 1 file changed, 8 insertions(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/configure b/configure | ||
18 | index 7031898..a4a42f1 100755 | ||
19 | --- a/configure | ||
20 | +++ b/configure | ||
21 | @@ -1139,7 +1139,7 @@ while [ "$#" -gt 0 ]; do | ||
22 | VAL=no | ||
23 | ;; | ||
24 | #Qt style yes options | ||
25 | - -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu) | ||
26 | + -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-pulseaudio|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu) | ||
27 | VAR=`echo $1 | sed "s,^-\(.*\),\1,"` | ||
28 | VAL=yes | ||
29 | ;; | ||
30 | @@ -2120,6 +2120,13 @@ while [ "$#" -gt 0 ]; do | ||
31 | UNKNOWN_OPT=yes | ||
32 | fi | ||
33 | ;; | ||
34 | + pulseaudio) | ||
35 | + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then | ||
36 | + CFG_PULSEAUDIO="$VAL" | ||
37 | + else | ||
38 | + UNKNOWN_OPT=yes | ||
39 | + fi | ||
40 | + ;; | ||
41 | gtkstyle) | ||
42 | if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then | ||
43 | CFG_QGTKSTYLE="$VAL" | ||
44 | -- | ||
45 | 1.8.0 | ||
46 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0019-Fixes-for-gcc-4.7.0-particularly-on-qemux86.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0019-Fixes-for-gcc-4.7.0-particularly-on-qemux86.patch new file mode 100644 index 0000000000..a83d2470a1 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0019-Fixes-for-gcc-4.7.0-particularly-on-qemux86.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | From 1f1da2f24d3028b250dbc2e98e2b7e37862b3771 Mon Sep 17 00:00:00 2001 | ||
2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
3 | Date: Wed, 26 Sep 2012 20:54:38 +0200 | ||
4 | Subject: [PATCH 19/21] Fixes for gcc 4.7.0, particularly on qemux86 | ||
5 | |||
6 | Origin: upstream, http://trac.webkit.org/changeset/93631 | ||
7 | Origin: upstream, http://trac.webkit.org/changeset/113848 | ||
8 | |||
9 | Bug: https://bugs.webkit.org/show_bug.cgi?id=62168 | ||
10 | Bug: https://bugs.webkit.org/show_bug.cgi?id=83584 | ||
11 | |||
12 | RP 2012/04/30 | ||
13 | |||
14 | Upstream-Status: Backport | ||
15 | |||
16 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
17 | --- | ||
18 | src/3rdparty/webkit/Source/WebCore/dom/Element.cpp | 2 +- | ||
19 | src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp | 2 +- | ||
20 | .../webkit/Source/WebCore/platform/graphics/TiledBackingStoreClient.h | 1 + | ||
21 | 3 files changed, 3 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/src/3rdparty/webkit/Source/WebCore/dom/Element.cpp b/src/3rdparty/webkit/Source/WebCore/dom/Element.cpp | ||
24 | index 32e47ca..b8e7389 100644 | ||
25 | --- a/src/3rdparty/webkit/Source/WebCore/dom/Element.cpp | ||
26 | +++ b/src/3rdparty/webkit/Source/WebCore/dom/Element.cpp | ||
27 | @@ -1080,7 +1080,7 @@ void Element::recalcStyle(StyleChange change) | ||
28 | { | ||
29 | // Ref currentStyle in case it would otherwise be deleted when setRenderStyle() is called. | ||
30 | RefPtr<RenderStyle> currentStyle(renderStyle()); | ||
31 | - bool hasParentStyle = parentNodeForRenderingAndStyle() ? parentNodeForRenderingAndStyle()->renderStyle() : false; | ||
32 | + bool hasParentStyle = parentNodeForRenderingAndStyle() ? static_cast<bool>(parentNodeForRenderingAndStyle()->renderStyle()) : false; | ||
33 | bool hasDirectAdjacentRules = currentStyle && currentStyle->childrenAffectedByDirectAdjacentRules(); | ||
34 | bool hasIndirectAdjacentRules = currentStyle && currentStyle->childrenAffectedByForwardPositionalRules(); | ||
35 | |||
36 | diff --git a/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp b/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp | ||
37 | index d66075e..ab8f111 100644 | ||
38 | --- a/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp | ||
39 | +++ b/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp | ||
40 | @@ -74,7 +74,7 @@ PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document* | ||
41 | RefPtr<HTMLImageElement> image = adoptRef(new HTMLImageElement(imgTag, document)); | ||
42 | if (optionalWidth) | ||
43 | image->setWidth(*optionalWidth); | ||
44 | - if (optionalHeight > 0) | ||
45 | + if (optionalHeight) | ||
46 | image->setHeight(*optionalHeight); | ||
47 | return image.release(); | ||
48 | } | ||
49 | diff --git a/src/3rdparty/webkit/Source/WebCore/platform/graphics/TiledBackingStoreClient.h b/src/3rdparty/webkit/Source/WebCore/platform/graphics/TiledBackingStoreClient.h | ||
50 | index 6087ec3..6d748f6 100644 | ||
51 | --- a/src/3rdparty/webkit/Source/WebCore/platform/graphics/TiledBackingStoreClient.h | ||
52 | +++ b/src/3rdparty/webkit/Source/WebCore/platform/graphics/TiledBackingStoreClient.h | ||
53 | @@ -25,6 +25,7 @@ namespace WebCore { | ||
54 | #if ENABLE(TILED_BACKING_STORE) | ||
55 | class TiledBackingStoreClient { | ||
56 | public: | ||
57 | + virtual ~TiledBackingStoreClient() { } | ||
58 | virtual void tiledBackingStorePaintBegin() = 0; | ||
59 | virtual void tiledBackingStorePaint(GraphicsContext*, const IntRect&) = 0; | ||
60 | virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea) = 0; | ||
61 | -- | ||
62 | 1.8.0 | ||
63 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0020-webkit-disable-the-fuse-ld-gold-flag.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0020-webkit-disable-the-fuse-ld-gold-flag.patch new file mode 100644 index 0000000000..92eddebaec --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0020-webkit-disable-the-fuse-ld-gold-flag.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From d90b496f9ffdc828928ef84afad43260ea67ec1f Mon Sep 17 00:00:00 2001 | ||
2 | From: Ken Werner <ken.werner@linaro.org> | ||
3 | Date: Wed, 26 Sep 2012 20:55:21 +0200 | ||
4 | Subject: [PATCH 20/21] webkit: disable the -fuse-ld=gold flag | ||
5 | |||
6 | This option is a Debian/Ubuntu specific extension to the g++ and causes upstream GCC to throw an error. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Ken Werner <ken.werner@linaro.org> | ||
11 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
12 | --- | ||
13 | src/3rdparty/webkit/Source/common.pri | 12 ++++++------ | ||
14 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
15 | |||
16 | diff --git a/src/3rdparty/webkit/Source/common.pri b/src/3rdparty/webkit/Source/common.pri | ||
17 | index 0f62e14..d81a1f0 100644 | ||
18 | --- a/src/3rdparty/webkit/Source/common.pri | ||
19 | +++ b/src/3rdparty/webkit/Source/common.pri | ||
20 | @@ -3,12 +3,12 @@ | ||
21 | contains(JAVASCRIPTCORE_JIT,yes): DEFINES+=ENABLE_JIT=1 | ||
22 | contains(JAVASCRIPTCORE_JIT,no): DEFINES+=ENABLE_JIT=0 | ||
23 | |||
24 | -linux-g++ { | ||
25 | -isEmpty($$(SBOX_DPKG_INST_ARCH)):exists(/usr/bin/ld.gold) { | ||
26 | - message(Using gold linker) | ||
27 | - QMAKE_LFLAGS+=-fuse-ld=gold | ||
28 | -} | ||
29 | -} | ||
30 | +#linux-g++ { | ||
31 | +#isEmpty($$(SBOX_DPKG_INST_ARCH)):exists(/usr/bin/ld.gold) { | ||
32 | +# message(Using gold linker) | ||
33 | +# QMAKE_LFLAGS+=-fuse-ld=gold | ||
34 | +#} | ||
35 | +#} | ||
36 | |||
37 | # We use this flag on production branches | ||
38 | # See https://bugs.webkit.org/show_bug.cgi?id=60824 | ||
39 | -- | ||
40 | 1.8.0 | ||
41 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0021-configure-make-qt4-native-work-with-long-building-pa.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0021-configure-make-qt4-native-work-with-long-building-pa.patch new file mode 100644 index 0000000000..dbc90227a5 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0021-configure-make-qt4-native-work-with-long-building-pa.patch | |||
@@ -0,0 +1,95 @@ | |||
1 | From 6742ac7ea6fd1e9c82ecb5305f84e721242f857d Mon Sep 17 00:00:00 2001 | ||
2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
3 | Date: Wed, 5 Dec 2012 07:48:15 +0200 | ||
4 | Subject: [PATCH 21/21] configure: make qt4-native work with long building | ||
5 | path. | ||
6 | |||
7 | Upstream-Status: Submitted | ||
8 | |||
9 | Reference: https://bugreports.qt-project.org/browse/QTBUG-28292 | ||
10 | |||
11 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
12 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
13 | --- | ||
14 | configure | 52 ++++++++++++++++++++++++++-------------------------- | ||
15 | 1 file changed, 26 insertions(+), 26 deletions(-) | ||
16 | |||
17 | diff --git a/configure b/configure | ||
18 | index a4a42f1..2358563 100755 | ||
19 | --- a/configure | ||
20 | +++ b/configure | ||
21 | @@ -4779,8 +4779,8 @@ DEMOS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_demopath=$QT_INST | ||
22 | TODAY=`date +%Y-%m-%d` | ||
23 | cat > "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF | ||
24 | /* License Info */ | ||
25 | -static const char qt_configure_licensee_str [256 + 12] = "$LICENSE_USER_STR"; | ||
26 | -static const char qt_configure_licensed_products_str [256 + 12] = "$LICENSE_PRODUCTS_STR"; | ||
27 | +static const char qt_configure_licensee_str [512 + 12] = "$LICENSE_USER_STR"; | ||
28 | +static const char qt_configure_licensed_products_str [512 + 12] = "$LICENSE_PRODUCTS_STR"; | ||
29 | |||
30 | /* Installation date */ | ||
31 | static const char qt_configure_installation [12+11] = "qt_instdate=$TODAY"; | ||
32 | @@ -4805,36 +4805,36 @@ if [ ! -z "$QT_HOST_PREFIX" ]; then | ||
33 | |||
34 | #if defined(QT_BOOTSTRAPPED) || defined(QT_BUILD_QMAKE) | ||
35 | /* Installation Info */ | ||
36 | -static const char qt_configure_prefix_path_str [256 + 12] = "$HOSTPREFIX_PATH_STR"; | ||
37 | -static const char qt_configure_documentation_path_str[256 + 12] = "$HOSTDOCUMENTATION_PATH_STR"; | ||
38 | -static const char qt_configure_headers_path_str [256 + 12] = "$HOSTHEADERS_PATH_STR"; | ||
39 | -static const char qt_configure_libraries_path_str [256 + 12] = "$HOSTLIBRARIES_PATH_STR"; | ||
40 | -static const char qt_configure_binaries_path_str [256 + 12] = "$HOSTBINARIES_PATH_STR"; | ||
41 | -static const char qt_configure_plugins_path_str [256 + 12] = "$HOSTPLUGINS_PATH_STR"; | ||
42 | -static const char qt_configure_imports_path_str [256 + 12] = "$HOSTIMPORTS_PATH_STR"; | ||
43 | -static const char qt_configure_data_path_str [256 + 12] = "$HOSTDATA_PATH_STR"; | ||
44 | -static const char qt_configure_translations_path_str [256 + 12] = "$HOSTTRANSLATIONS_PATH_STR"; | ||
45 | -static const char qt_configure_settings_path_str [256 + 12] = "$HOSTSETTINGS_PATH_STR"; | ||
46 | -static const char qt_configure_examples_path_str [256 + 12] = "$HOSTEXAMPLES_PATH_STR"; | ||
47 | -static const char qt_configure_demos_path_str [256 + 12] = "$HOSTDEMOS_PATH_STR"; | ||
48 | +static const char qt_configure_prefix_path_str [512 + 12] = "$HOSTPREFIX_PATH_STR"; | ||
49 | +static const char qt_configure_documentation_path_str[512 + 12] = "$HOSTDOCUMENTATION_PATH_STR"; | ||
50 | +static const char qt_configure_headers_path_str [512 + 12] = "$HOSTHEADERS_PATH_STR"; | ||
51 | +static const char qt_configure_libraries_path_str [512 + 12] = "$HOSTLIBRARIES_PATH_STR"; | ||
52 | +static const char qt_configure_binaries_path_str [512 + 12] = "$HOSTBINARIES_PATH_STR"; | ||
53 | +static const char qt_configure_plugins_path_str [512 + 12] = "$HOSTPLUGINS_PATH_STR"; | ||
54 | +static const char qt_configure_imports_path_str [512 + 12] = "$HOSTIMPORTS_PATH_STR"; | ||
55 | +static const char qt_configure_data_path_str [512 + 12] = "$HOSTDATA_PATH_STR"; | ||
56 | +static const char qt_configure_translations_path_str [512 + 12] = "$HOSTTRANSLATIONS_PATH_STR"; | ||
57 | +static const char qt_configure_settings_path_str [512 + 12] = "$HOSTSETTINGS_PATH_STR"; | ||
58 | +static const char qt_configure_examples_path_str [512 + 12] = "$HOSTEXAMPLES_PATH_STR"; | ||
59 | +static const char qt_configure_demos_path_str [512 + 12] = "$HOSTDEMOS_PATH_STR"; | ||
60 | #else // QT_BOOTSTRAPPED | ||
61 | EOF | ||
62 | fi | ||
63 | |||
64 | cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF | ||
65 | /* Installation Info */ | ||
66 | -static const char qt_configure_prefix_path_str [256 + 12] = "$PREFIX_PATH_STR"; | ||
67 | -static const char qt_configure_documentation_path_str[256 + 12] = "$DOCUMENTATION_PATH_STR"; | ||
68 | -static const char qt_configure_headers_path_str [256 + 12] = "$HEADERS_PATH_STR"; | ||
69 | -static const char qt_configure_libraries_path_str [256 + 12] = "$LIBRARIES_PATH_STR"; | ||
70 | -static const char qt_configure_binaries_path_str [256 + 12] = "$BINARIES_PATH_STR"; | ||
71 | -static const char qt_configure_plugins_path_str [256 + 12] = "$PLUGINS_PATH_STR"; | ||
72 | -static const char qt_configure_imports_path_str [256 + 12] = "$IMPORTS_PATH_STR"; | ||
73 | -static const char qt_configure_data_path_str [256 + 12] = "$DATA_PATH_STR"; | ||
74 | -static const char qt_configure_translations_path_str [256 + 12] = "$TRANSLATIONS_PATH_STR"; | ||
75 | -static const char qt_configure_settings_path_str [256 + 12] = "$SETTINGS_PATH_STR"; | ||
76 | -static const char qt_configure_examples_path_str [256 + 12] = "$EXAMPLES_PATH_STR"; | ||
77 | -static const char qt_configure_demos_path_str [256 + 12] = "$DEMOS_PATH_STR"; | ||
78 | +static const char qt_configure_prefix_path_str [512 + 12] = "$PREFIX_PATH_STR"; | ||
79 | +static const char qt_configure_documentation_path_str[512 + 12] = "$DOCUMENTATION_PATH_STR"; | ||
80 | +static const char qt_configure_headers_path_str [512 + 12] = "$HEADERS_PATH_STR"; | ||
81 | +static const char qt_configure_libraries_path_str [512 + 12] = "$LIBRARIES_PATH_STR"; | ||
82 | +static const char qt_configure_binaries_path_str [512 + 12] = "$BINARIES_PATH_STR"; | ||
83 | +static const char qt_configure_plugins_path_str [512 + 12] = "$PLUGINS_PATH_STR"; | ||
84 | +static const char qt_configure_imports_path_str [512 + 12] = "$IMPORTS_PATH_STR"; | ||
85 | +static const char qt_configure_data_path_str [512 + 12] = "$DATA_PATH_STR"; | ||
86 | +static const char qt_configure_translations_path_str [512 + 12] = "$TRANSLATIONS_PATH_STR"; | ||
87 | +static const char qt_configure_settings_path_str [512 + 12] = "$SETTINGS_PATH_STR"; | ||
88 | +static const char qt_configure_examples_path_str [512 + 12] = "$EXAMPLES_PATH_STR"; | ||
89 | +static const char qt_configure_demos_path_str [512 + 12] = "$DEMOS_PATH_STR"; | ||
90 | EOF | ||
91 | |||
92 | if [ ! -z "$QT_HOST_PREFIX" ]; then | ||
93 | -- | ||
94 | 1.8.0 | ||
95 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch new file mode 100644 index 0000000000..ad45dd0511 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch | |||
@@ -0,0 +1,148 @@ | |||
1 | From b7029fbd12c32e851ed7d81b692197176eb71d9e Mon Sep 17 00:00:00 2001 | ||
2 | From: Gunnar Sletta <gunnar.sletta@digia.com> | ||
3 | Date: Thu, 4 Jul 2013 16:20:40 +1000 | ||
4 | Subject: [PATCH] Fix drawing of 0-width polylines from outside the devicerect. | ||
5 | |||
6 | This was broken by a previous fix which aimed to fix gaps in | ||
7 | polylines with tiny line segments. The result was that we | ||
8 | skipped updating the origin point when stroke() didn't produce | ||
9 | pixels which accidentally included the case of the line | ||
10 | being completely outside the deviceRect. I fixed this | ||
11 | by returning the value of clipLine in drawLine to the caller | ||
12 | so we could still update the origin for this case. | ||
13 | |||
14 | Upstream-Status: Accepted [https://codereview.qt-project.org/#change,60427] | ||
15 | Signed-off-by: Jonathan Liu <net147@gmail.com> | ||
16 | |||
17 | Task-number: QTBUG-31579 | ||
18 | Change-Id: Iac29436f042da7658bbeaf9370351dc6f2c95065 | ||
19 | (cherry picked from qtbase/900cccfd459fcbdbc4aa3d313afe12cfbf68fd87) | ||
20 | --- | ||
21 | src/gui/painting/qcosmeticstroker.cpp | 42 ++++++++++++++++++++++------------- | ||
22 | src/gui/painting/qcosmeticstroker_p.h | 2 +- | ||
23 | 2 files changed, 27 insertions(+), 17 deletions(-) | ||
24 | |||
25 | diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp | ||
26 | index 0061ecb..4413170 100644 | ||
27 | --- a/src/gui/painting/qcosmeticstroker.cpp | ||
28 | +++ b/src/gui/painting/qcosmeticstroker.cpp | ||
29 | @@ -133,10 +133,15 @@ struct NoDasher { | ||
30 | |||
31 | }; | ||
32 | |||
33 | +/* | ||
34 | + * The return value is the result of the clipLine() call performed at the start | ||
35 | + * of each of the two functions, aka "false" means completely outside the devices | ||
36 | + * rect. | ||
37 | + */ | ||
38 | template<DrawPixel drawPixel, class Dasher> | ||
39 | -static void drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); | ||
40 | +static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); | ||
41 | template<DrawPixel drawPixel, class Dasher> | ||
42 | -static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); | ||
43 | +static bool drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); | ||
44 | |||
45 | inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage) | ||
46 | { | ||
47 | @@ -602,17 +607,20 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) | ||
48 | caps |= CapEnd; | ||
49 | |||
50 | QCosmeticStroker::Point last = this->lastPixel; | ||
51 | - stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); | ||
52 | + bool unclipped = stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); | ||
53 | |||
54 | /* fix for gaps in polylines with fastpen and aliased in a sequence | ||
55 | of points with small distances: if current point p2 has been dropped | ||
56 | - out, keep last non dropped point p. */ | ||
57 | - if (fastPenAliased) { | ||
58 | - if (last.x != lastPixel.x || last.y != lastPixel.y || | ||
59 | - points == begin + 2 || points == end - 2 ) { | ||
60 | - { | ||
61 | - p = p2; | ||
62 | - } | ||
63 | + out, keep last non dropped point p. | ||
64 | + | ||
65 | + However, if the line was completely outside the devicerect, we | ||
66 | + still need to update p to avoid drawing the line after this one from | ||
67 | + a bad starting position. | ||
68 | + */ | ||
69 | + if (fastPenAliased && unclipped) { | ||
70 | + if (last.x != lastPixel.x || last.y != lastPixel.y | ||
71 | + || points == begin + 2 || points == end - 2) { | ||
72 | + p = p2; | ||
73 | } | ||
74 | } else { | ||
75 | p = p2; | ||
76 | @@ -720,10 +728,10 @@ static inline void capAdjust(int caps, int &x1, int &x2, int &y, int yinc) | ||
77 | the drawing shifts from horizontal to vertical or back. | ||
78 | */ | ||
79 | template<DrawPixel drawPixel, class Dasher> | ||
80 | -static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) | ||
81 | +static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) | ||
82 | { | ||
83 | if (stroker->clipLine(rx1, ry1, rx2, ry2)) | ||
84 | - return; | ||
85 | + return false; | ||
86 | |||
87 | static const int half = 31; | ||
88 | int x1 = toF26Dot6(rx1) + half; | ||
89 | @@ -813,7 +821,7 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, | ||
90 | } else { | ||
91 | // horizontal | ||
92 | if (!dx) | ||
93 | - return; | ||
94 | + return true; | ||
95 | |||
96 | QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; | ||
97 | |||
98 | @@ -886,14 +894,15 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, | ||
99 | } | ||
100 | } | ||
101 | stroker->lastPixel = last; | ||
102 | + return true; | ||
103 | } | ||
104 | |||
105 | |||
106 | template<DrawPixel drawPixel, class Dasher> | ||
107 | -static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) | ||
108 | +static bool drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) | ||
109 | { | ||
110 | if (stroker->clipLine(rx1, ry1, rx2, ry2)) | ||
111 | - return; | ||
112 | + return false; | ||
113 | |||
114 | int x1 = toF26Dot6(rx1); | ||
115 | int y1 = toF26Dot6(ry1); | ||
116 | @@ -967,7 +976,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx | ||
117 | } else { | ||
118 | // horizontal | ||
119 | if (!dx) | ||
120 | - return; | ||
121 | + return true; | ||
122 | |||
123 | int yinc = F16Dot16FixedDiv(dy, dx); | ||
124 | |||
125 | @@ -1029,6 +1038,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx | ||
126 | drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6); | ||
127 | } | ||
128 | } | ||
129 | + return true; | ||
130 | } | ||
131 | |||
132 | QT_END_NAMESPACE | ||
133 | diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h | ||
134 | index 870738b..3216856 100644 | ||
135 | --- a/src/gui/painting/qcosmeticstroker_p.h | ||
136 | +++ b/src/gui/painting/qcosmeticstroker_p.h | ||
137 | @@ -56,7 +56,7 @@ QT_MODULE(Gui) | ||
138 | class QCosmeticStroker; | ||
139 | |||
140 | |||
141 | -typedef void (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); | ||
142 | +typedef bool (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); | ||
143 | |||
144 | class QCosmeticStroker | ||
145 | { | ||
146 | -- | ||
147 | 1.8.3.2 | ||
148 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0023-QHttpMultiPart-fix-data-corruption-in-readData-metho.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0023-QHttpMultiPart-fix-data-corruption-in-readData-metho.patch new file mode 100644 index 0000000000..c3c002e8a1 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0023-QHttpMultiPart-fix-data-corruption-in-readData-metho.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 1f40ed553e618c3b0511c7db4b4fd26c2d2b65bf Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Hartmann <phartmann@blackberry.com> | ||
3 | Date: Thu, 25 Jul 2013 12:05:29 -0400 | ||
4 | Subject: [PATCH] QHttpMultiPart: fix data corruption in readData method | ||
5 | |||
6 | When readData() is called repeatedly, we need to keep track which | ||
7 | part of the multipart message we are currently reading from. | ||
8 | Hereby we also need to take the boundary size into account, and not | ||
9 | only the size of the multipart; otherwise we would skip a not | ||
10 | completely read part. This would then later lead to advancing the | ||
11 | read pointer by negative indexes and data loss. | ||
12 | |||
13 | Upstream-Status: Accepted [https://codereview.qt-project.org/#change,61861] | ||
14 | Signed-off-by: Jonathan Liu <net147@gmail.com> | ||
15 | |||
16 | Task-number: QTBUG-32534 | ||
17 | Change-Id: Ibb6dff16adaf4ea67181d23d1d0c8459e33a0ed0 | ||
18 | Reviewed-by: Jonathan Liu <net147@gmail.com> | ||
19 | Reviewed-by: Shane Kearns <shane.kearns@accenture.com> | ||
20 | (cherry picked from qtbase/af96c6fed931564c95037539f07e9c8e33c69529) | ||
21 | Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> | ||
22 | --- | ||
23 | src/network/access/qhttpmultipart.cpp | 3 +- | ||
24 | tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 44 ++++++++++++++++++++++++++ | ||
25 | 2 files changed, 46 insertions(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/src/network/access/qhttpmultipart.cpp b/src/network/access/qhttpmultipart.cpp | ||
28 | index 635129a..b25e917 100644 | ||
29 | --- a/src/network/access/qhttpmultipart.cpp | ||
30 | +++ b/src/network/access/qhttpmultipart.cpp | ||
31 | @@ -488,7 +488,8 @@ qint64 QHttpMultiPartIODevice::readData(char *data, qint64 maxSize) | ||
32 | |||
33 | // skip the parts we have already read | ||
34 | while (index < multiPart->parts.count() && | ||
35 | - readPointer >= partOffsets.at(index) + multiPart->parts.at(index).d->size()) | ||
36 | + readPointer >= partOffsets.at(index) + multiPart->parts.at(index).d->size() | ||
37 | + + multiPart->boundary.count() + 6) // 6 == 2 boundary dashes, \r\n after boundary, \r\n after multipart | ||
38 | index++; | ||
39 | |||
40 | // read the data | ||
41 | -- | ||
42 | 1.8.3.4 | ||
43 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0024-Ensure-lastPixel.y-is-also-initalized-to-1-when-nece.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0024-Ensure-lastPixel.y-is-also-initalized-to-1-when-nece.patch new file mode 100644 index 0000000000..7825205310 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0024-Ensure-lastPixel.y-is-also-initalized-to-1-when-nece.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From 0726127285413829f58618b5b82fb3e2da0c3a74 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andy Shaw <andy.shaw@digia.com> | ||
3 | Date: Tue, 8 Oct 2013 15:45:42 +0200 | ||
4 | Subject: [PATCH] Ensure lastPixel.y is also initalized to -1 when necessary | ||
5 | |||
6 | Task-number: QTBUG-31579 | ||
7 | |||
8 | Upstream-Status: Accepted [https://codereview.qt-project.org/#change,67624] | ||
9 | Signed-off-by: Jonathan Liu <net147@gmail.com> | ||
10 | |||
11 | Change-Id: Ia4916ac0d384ea523bbfad0dafbc90044da7ec3e | ||
12 | Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> | ||
13 | (cherry picked from qtbase/f0b950144dde85b65df0c3cf83f7c8df0e94bbbf) | ||
14 | --- | ||
15 | src/gui/painting/qcosmeticstroker.cpp | 3 +++ | ||
16 | 1 file changed, 3 insertions(+) | ||
17 | |||
18 | diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp | ||
19 | index 4413170..36616d4 100644 | ||
20 | --- a/src/gui/painting/qcosmeticstroker.cpp | ||
21 | +++ b/src/gui/painting/qcosmeticstroker.cpp | ||
22 | @@ -305,6 +305,7 @@ void QCosmeticStroker::setup() | ||
23 | ymax = deviceRect.bottom() + 2; | ||
24 | |||
25 | lastPixel.x = -1; | ||
26 | + lastPixel.y = -1; | ||
27 | } | ||
28 | |||
29 | // returns true if the whole line gets clipped away | ||
30 | @@ -533,6 +534,7 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) | ||
31 | QPointF p = QPointF(points[0], points[1]) * state->matrix; | ||
32 | patternOffset = state->lastPen.dashOffset()*64; | ||
33 | lastPixel.x = -1; | ||
34 | + lastPixel.y = -1; | ||
35 | |||
36 | bool closed; | ||
37 | const QPainterPath::ElementType *e = subPath(type, end, points, &closed); | ||
38 | @@ -587,6 +589,7 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) | ||
39 | QPointF movedTo = p; | ||
40 | patternOffset = state->lastPen.dashOffset()*64; | ||
41 | lastPixel.x = -1; | ||
42 | + lastPixel.y = -1; | ||
43 | |||
44 | const qreal *begin = points; | ||
45 | const qreal *end = points + 2*path.elementCount(); | ||
46 | -- | ||
47 | 1.8.4 | ||
48 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0025-Fix-misaligned-selection-region-with-text-when-cente.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0025-Fix-misaligned-selection-region-with-text-when-cente.patch new file mode 100644 index 0000000000..964bcf8efb --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0025-Fix-misaligned-selection-region-with-text-when-cente.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | From c368cbad3a505d44894ff150dc25c74d0174ca15 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jonathan Liu <net147@gmail.com> | ||
3 | Date: Wed, 23 Oct 2013 00:28:17 +1100 | ||
4 | Subject: [PATCH] Fix misaligned selection region with text when centered | ||
5 | |||
6 | If the text is centered, the x/y position in the selection QRectF may | ||
7 | be a multiple of 0.5 which is rounded up. This rounding causes | ||
8 | misalignment of the selection region with the text. | ||
9 | |||
10 | The alignment is fixed by using qFloor on the x and y components. | ||
11 | |||
12 | Upstream-Status: Accepted [https://codereview.qt-project.org/#change,68935] | ||
13 | Signed-off-by: Jonathan Liu <net147@gmail.com> | ||
14 | |||
15 | Task-number: QTBUG-34218 | ||
16 | Task-number: QTBUG-34234 | ||
17 | Change-Id: I4f2fadeb38602f62a93773c6e5faecf03b28069f | ||
18 | Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> | ||
19 | (cherry picked from qtbase/5d8a882c11201a29475c5ea71cfb76c9de6573f5) | ||
20 | --- | ||
21 | src/gui/text/qtextlayout.cpp | 19 ++++++++++++++----- | ||
22 | 1 file changed, 14 insertions(+), 5 deletions(-) | ||
23 | |||
24 | diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp | ||
25 | index 3d340cb..8d652ea 100644 | ||
26 | --- a/src/gui/text/qtextlayout.cpp | ||
27 | +++ b/src/gui/text/qtextlayout.cpp | ||
28 | @@ -44,6 +44,7 @@ | ||
29 | |||
30 | #include <qfont.h> | ||
31 | #include <qapplication.h> | ||
32 | +#include <qmath.h> | ||
33 | #include <qpainter.h> | ||
34 | #include <qvarlengtharray.h> | ||
35 | #include <qtextformat.h> | ||
36 | @@ -979,15 +980,23 @@ static void addSelectedRegionsToPath(QTextEngine *eng, int lineNumber, const QPo | ||
37 | continue; | ||
38 | } | ||
39 | |||
40 | - if (lastSelectionWidth > 0) | ||
41 | - region->addRect(boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight)); | ||
42 | + if (lastSelectionWidth > 0) { | ||
43 | + QRectF rect = boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight); | ||
44 | + rect.moveLeft(qFloor(rect.left())); | ||
45 | + rect.moveTop(qFloor(rect.top())); | ||
46 | + region->addRect(rect); | ||
47 | + } | ||
48 | |||
49 | lastSelectionX = selectionX; | ||
50 | lastSelectionWidth = selectionWidth; | ||
51 | } | ||
52 | } | ||
53 | - if (lastSelectionWidth > 0) | ||
54 | - region->addRect(boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight)); | ||
55 | + if (lastSelectionWidth > 0) { | ||
56 | + QRectF rect = boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight); | ||
57 | + rect.moveLeft(qFloor(rect.left())); | ||
58 | + rect.moveTop(qFloor(rect.top())); | ||
59 | + region->addRect(rect); | ||
60 | + } | ||
61 | } | ||
62 | |||
63 | static inline QRectF clipIfValid(const QRectF &rect, const QRectF &clip) | ||
64 | @@ -2081,7 +2090,7 @@ static void setPenAndDrawBackground(QPainter *p, const QPen &defaultPen, const Q | ||
65 | |||
66 | QBrush bg = chf.background(); | ||
67 | if (bg.style() != Qt::NoBrush && !chf.property(SuppressBackground).toBool()) | ||
68 | - p->fillRect(r, bg); | ||
69 | + p->fillRect(QRectF(qFloor(r.x()), qFloor(r.y()), r.width(), r.height()), bg); | ||
70 | if (c.style() != Qt::NoBrush) { | ||
71 | p->setPen(QPen(c, 0)); | ||
72 | } | ||
73 | -- | ||
74 | 1.8.4 | ||
75 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0027-tools.pro-disable-qmeegographicssystemhelper.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0027-tools.pro-disable-qmeegographicssystemhelper.patch new file mode 100644 index 0000000000..6e30aeed02 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/0027-tools.pro-disable-qmeegographicssystemhelper.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 0460e2a5f13aaf0081c3c9fec89280046842ddbb Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Wed, 3 Jul 2013 17:48:30 +0100 | ||
4 | Subject: [PATCH] tools.pro: disable qmeegographicssystemhelper | ||
5 | |||
6 | We don't want this enabled just because we have EGL and OpenGL ES 2.0 | ||
7 | enabled. | ||
8 | |||
9 | Upstream-Status: Inappropriate [config] | ||
10 | |||
11 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
12 | --- | ||
13 | tools/tools.pro | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/tools/tools.pro b/tools/tools.pro | ||
17 | index 0e27053..2d3f36d 100644 | ||
18 | --- a/tools/tools.pro | ||
19 | +++ b/tools/tools.pro | ||
20 | @@ -49,4 +49,4 @@ QTDIR_build:REQUIRES = "contains(QT_CONFIG, full-config)" | ||
21 | |||
22 | !win32:!embedded:!mac:!symbian:CONFIG += x11 | ||
23 | |||
24 | -x11:contains(QT_CONFIG, opengles2):contains(QT_CONFIG, egl):SUBDIRS += qmeegographicssystemhelper | ||
25 | +#x11:contains(QT_CONFIG, opengles2):contains(QT_CONFIG, egl):SUBDIRS += qmeegographicssystemhelper | ||
26 | -- | ||
27 | 1.8.1.2 | ||
28 | |||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/g++.conf b/meta/recipes-qt/qt4/qt4-4.8.5/g++.conf new file mode 100644 index 0000000000..8755031017 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/g++.conf | |||
@@ -0,0 +1,61 @@ | |||
1 | # | ||
2 | # qmake configuration for common gcc | ||
3 | # | ||
4 | |||
5 | QMAKE_COMPILER = gcc | ||
6 | |||
7 | QMAKE_CC = $(OE_QMAKE_CC) | ||
8 | QMAKE_CFLAGS += -pipe $(OE_QMAKE_CFLAGS) | ||
9 | QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $(OE_QMAKE_CFLAGS) | ||
10 | QMAKE_CFLAGS_DEPS += -M | ||
11 | QMAKE_CFLAGS_WARN_ON += -Wall -W | ||
12 | QMAKE_CFLAGS_WARN_OFF += -w | ||
13 | QMAKE_CFLAGS_RELEASE += | ||
14 | QMAKE_CFLAGS_DEBUG += -g | ||
15 | QMAKE_CFLAGS_SHLIB += -fPIC | ||
16 | QMAKE_CFLAGS_STATIC_LIB += -fPIC | ||
17 | QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses | ||
18 | QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden | ||
19 | QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} | ||
20 | QMAKE_CFLAGS_USE_PRECOMPILE += -include ${QMAKE_PCH_OUTPUT_BASE} | ||
21 | |||
22 | QMAKE_CXX = $(OE_QMAKE_CXX) | ||
23 | QMAKE_CXXFLAGS += $$QMAKE_CFLAGS $(OE_QMAKE_CXXFLAGS) | ||
24 | QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS | ||
25 | QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON | ||
26 | QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF | ||
27 | QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE | ||
28 | QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO | ||
29 | QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG | ||
30 | QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB | ||
31 | QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB | ||
32 | QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC | ||
33 | QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden | ||
34 | QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} | ||
35 | QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE | ||
36 | |||
37 | QMAKE_LINK = $(OE_QMAKE_LINK) | ||
38 | QMAKE_LINK_SHLIB = $(OE_QMAKE_LINK) | ||
39 | QMAKE_LINK_C = $(OE_QMAKE_LINK) | ||
40 | QMAKE_LINK_C_SHLIB = $(OE_QMAKE_LINK) | ||
41 | QMAKE_LFLAGS += $(OE_QMAKE_LDFLAGS) | ||
42 | QMAKE_LFLAGS_RELEASE += | ||
43 | QMAKE_LFLAGS_DEBUG += | ||
44 | QMAKE_LFLAGS_APP += | ||
45 | QMAKE_LFLAGS_NOUNDEF += -Wl,--no-undefined | ||
46 | QMAKE_LFLAGS_RPATH = -Wl,-rpath-link, | ||
47 | |||
48 | QMAKE_PCH_OUTPUT_EXT = .gch | ||
49 | |||
50 | # -Bsymbolic-functions (ld) support | ||
51 | QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions | ||
52 | QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, | ||
53 | |||
54 | # do not depend on gdb | ||
55 | CONFIG -= gdb_dwarf_index | ||
56 | |||
57 | # some linking helper... | ||
58 | CONFIG += rpath_libdirs | ||
59 | |||
60 | # for the SDK | ||
61 | isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $(OE_QMAKE_QT_CONFIG) | ||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/linux.conf b/meta/recipes-qt/qt4/qt4-4.8.5/linux.conf new file mode 100644 index 0000000000..86703813ca --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/linux.conf | |||
@@ -0,0 +1,66 @@ | |||
1 | # | ||
2 | # qmake configuration for common linux | ||
3 | # | ||
4 | |||
5 | QMAKE_CFLAGS_THREAD += -D_REENTRANT | ||
6 | QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD | ||
7 | |||
8 | QMAKE_INCDIR = | ||
9 | QMAKE_LIBDIR = | ||
10 | QMAKE_INCDIR_X11 = | ||
11 | QMAKE_LIBDIR_X11 = | ||
12 | QMAKE_INCDIR_QT = $(OE_QMAKE_INCDIR_QT) | ||
13 | QMAKE_LIBDIR_QT = $(OE_QMAKE_LIBDIR_QT) | ||
14 | QMAKE_INCDIR_OPENGL = | ||
15 | QMAKE_LIBDIR_OPENGL = | ||
16 | QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL | ||
17 | QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL | ||
18 | QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL | ||
19 | QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL | ||
20 | QMAKE_INCDIR_EGL = | ||
21 | QMAKE_LIBDIR_EGL = | ||
22 | QMAKE_INCDIR_OPENVG = | ||
23 | QMAKE_LIBDIR_OPENVG = | ||
24 | |||
25 | |||
26 | QMAKE_LIBS = | ||
27 | QMAKE_LIBS_DYNLOAD = -ldl | ||
28 | QMAKE_LIBS_X11 = $(OE_QMAKE_LIBS_X11) | ||
29 | QMAKE_LIBS_X11SM = $(OE_QMAKE_LIBS_X11SM) | ||
30 | QMAKE_LIBS_NIS = -lnsl | ||
31 | QMAKE_LIBS_EGL = -lEGL | ||
32 | QMAKE_LIBS_OPENGL = -lGL | ||
33 | QMAKE_LIBS_OPENGL_QT = -lGL | ||
34 | QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM | ||
35 | QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 | ||
36 | QMAKE_LIBS_OPENVG = -lOpenVG | ||
37 | QMAKE_LIBS_THREAD = -lpthread | ||
38 | |||
39 | QMAKE_MOC = $(OE_QMAKE_MOC) | ||
40 | QMAKE_UIC = $(OE_QMAKE_UIC) | ||
41 | QMAKE_UIC3 = $(OE_QMAKE_UIC3) | ||
42 | QMAKE_RCC = $(OE_QMAKE_RCC) | ||
43 | QMAKE_QDBUSCPP2XML = $(OE_QMAKE_QDBUSCPP2XML) | ||
44 | QMAKE_QDBUSXML2CPP = $(OE_QMAKE_QDBUSXML2CPP) | ||
45 | |||
46 | QMAKE_AR = $(OE_QMAKE_AR) cqs | ||
47 | QMAKE_OBJCOPY = objcopy | ||
48 | QMAKE_RANLIB = | ||
49 | |||
50 | QMAKE_TAR = tar -cf | ||
51 | QMAKE_GZIP = gzip -9f | ||
52 | |||
53 | QMAKE_COPY = cp -f | ||
54 | QMAKE_COPY_FILE = $(COPY) | ||
55 | QMAKE_COPY_DIR = $(COPY) -r | ||
56 | QMAKE_MOVE = mv -f | ||
57 | QMAKE_DEL_FILE = rm -f | ||
58 | QMAKE_DEL_DIR = rmdir | ||
59 | QMAKE_STRIP = $(OE_QMAKE_STRIP) | ||
60 | QMAKE_STRIPFLAGS_LIB += --strip-unneeded | ||
61 | QMAKE_CHK_DIR_EXISTS = test -d | ||
62 | QMAKE_MKDIR = mkdir -p | ||
63 | QMAKE_INSTALL_FILE = install -m 644 -p | ||
64 | QMAKE_INSTALL_PROGRAM = install -m 755 -p | ||
65 | |||
66 | include(unix.conf) | ||
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/qte.sh b/meta/recipes-qt/qt4/qt4-4.8.5/qte.sh new file mode 100644 index 0000000000..21d6ecbd6a --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-4.8.5/qte.sh | |||
@@ -0,0 +1,7 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ -e /dev/input/touchscreen0 ] | ||
4 | then | ||
5 | QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0 | ||
6 | export QWS_MOUSE_PROTO | ||
7 | fi | ||
diff --git a/meta/recipes-qt/qt4/qt4-embedded.inc b/meta/recipes-qt/qt4/qt4-embedded.inc new file mode 100644 index 0000000000..e87de4b379 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-embedded.inc | |||
@@ -0,0 +1,73 @@ | |||
1 | SUMMARY = "Cross-platform UI toolkit and application framework (framebuffer version)" | ||
2 | DESCRIPTION = "Qt is a versatile cross-platform application framework -- this is the embedded (framebuffer) version." | ||
3 | SECTION = "libs" | ||
4 | HOMEPAGE = "http://qt-project.org/" | ||
5 | DEPENDS += "directfb tslib" | ||
6 | INC_PR = "r52" | ||
7 | |||
8 | QT4EDEPENDS = "" | ||
9 | QT_BASE_LIB ?= "libqt-embedded" | ||
10 | |||
11 | # Set necessary variables in the profile | ||
12 | SRC_URI += "file://qte.sh" | ||
13 | |||
14 | QT_EMBEDDED_FLAGS ?= " \ | ||
15 | -embedded $QT_ARCH \ | ||
16 | -qtlibinfix ${QT_LIBINFIX} \ | ||
17 | " | ||
18 | QT_EMBEDDED_EXTRA_FLAGS ?= " \ | ||
19 | -plugin-gfx-transformed -plugin-gfx-qvfb -plugin-gfx-vnc -plugin-gfx-directfb \ | ||
20 | -plugin-mouse-tslib -qt-mouse-pc -qt-mouse-qvfb -qt-mouse-linuxinput \ | ||
21 | -qt-kbd-tty -qt-kbd-linuxinput \ | ||
22 | " | ||
23 | QT_EMBEDDED_KEYPAD_FLAGS ?= " \ | ||
24 | -DQT_KEYPAD_NAVIGATION \ | ||
25 | " | ||
26 | |||
27 | QT_CONFIG_FLAGS += "${QT_EMBEDDED_FLAGS} ${QT_EMBEDDED_EXTRA_FLAGS} ${QT_EMBEDDED_KEYPAD_FLAGS}" | ||
28 | |||
29 | require qt4.inc | ||
30 | |||
31 | do_install_append() { | ||
32 | install -d ${D}/${libdir}/fonts | ||
33 | touch ${D}/${libdir}/fonts/fontdir | ||
34 | |||
35 | install -d ${D}${sysconfdir}/profile.d/ | ||
36 | install -m 0755 ${WORKDIR}/qte.sh ${D}${sysconfdir}/profile.d/ | ||
37 | } | ||
38 | |||
39 | # We put the qte profile into it's own package as we don't want to install all qt stuff | ||
40 | # with depending on the global package qt4-embedded | ||
41 | PACKAGES += " ${PN}-conf" | ||
42 | FILES_${PN}-conf += " ${sysconfdir}/profile.d/qte.sh" | ||
43 | RRECOMMENDS_${PN} += " ${PN}-conf" | ||
44 | |||
45 | OTHER_PACKAGES += "\ | ||
46 | ${QT_BASE_NAME}-fonts \ | ||
47 | ${QT_BASE_NAME}-fonts-ttf-vera \ | ||
48 | ${QT_BASE_NAME}-fonts-ttf-dejavu \ | ||
49 | ${QT_BASE_NAME}-fonts-pfa \ | ||
50 | ${QT_BASE_NAME}-fonts-pfb \ | ||
51 | ${QT_BASE_NAME}-fonts-qpf" | ||
52 | |||
53 | RRECOMMENDS_${QT_BASE_NAME}-fonts = " \ | ||
54 | ${QT_BASE_NAME}-fonts-ttf-vera \ | ||
55 | ${QT_BASE_NAME}-fonts-ttf-dejavu \ | ||
56 | ${QT_BASE_NAME}-fonts-pfa \ | ||
57 | ${QT_BASE_NAME}-fonts-pfb \ | ||
58 | ${QT_BASE_NAME}-fonts-qpf" | ||
59 | RRECOMMENDS_${QT_BASE_NAME}-demos += " \ | ||
60 | ${QT_BASE_NAME}-fonts" | ||
61 | |||
62 | ALLOW_EMPTY_${QT_BASE_NAME}-fonts = "1" | ||
63 | PACKAGES_DYNAMIC += "^${QT_BASE_NAME}-fonts-.*" | ||
64 | |||
65 | FILES_${QT_BASE_NAME}-fonts-ttf-vera = "${libdir}/fonts/Vera*.ttf" | ||
66 | FILES_${QT_BASE_NAME}-fonts-ttf-dejavu = "${libdir}/fonts/DejaVu*.ttf" | ||
67 | FILES_${QT_BASE_NAME}-fonts-pfa = "${libdir}/fonts/*.pfa" | ||
68 | FILES_${QT_BASE_NAME}-fonts-pfb = "${libdir}/fonts/*.pfb" | ||
69 | FILES_${QT_BASE_NAME}-fonts-qpf = "${libdir}/fonts/*.qpf*" | ||
70 | FILES_${QT_BASE_NAME}-fonts = "${libdir}/fonts/README ${libdir}/fonts/fontdir" | ||
71 | |||
72 | inherit qt4e | ||
73 | |||
diff --git a/meta/recipes-qt/qt4/qt4-embedded_4.8.5.bb b/meta/recipes-qt/qt4/qt4-embedded_4.8.5.bb new file mode 100644 index 0000000000..1435d857ce --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-embedded_4.8.5.bb | |||
@@ -0,0 +1,9 @@ | |||
1 | require qt4-${PV}.inc | ||
2 | require qt4-embedded.inc | ||
3 | |||
4 | QT_CONFIG_FLAGS_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " -no-neon" ,d)}" | ||
5 | |||
6 | QT_CONFIG_FLAGS += " \ | ||
7 | -exceptions \ | ||
8 | " | ||
9 | |||
diff --git a/meta/recipes-qt/qt4/qt4-native.inc b/meta/recipes-qt/qt4/qt4-native.inc new file mode 100644 index 0000000000..bb16da666a --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-native.inc | |||
@@ -0,0 +1,114 @@ | |||
1 | SUMMARY = "Qt version 4 tools and support files for the build host" | ||
2 | DEPENDS = "zlib-native dbus-native" | ||
3 | SECTION = "libs" | ||
4 | HOMEPAGE = "http://qt-project.org/" | ||
5 | PROVIDES = "qt4-tools-native" | ||
6 | |||
7 | LICENSE = "LGPLv2.1 | GPLv3" | ||
8 | LIC_FILES_CHKSUM = "file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24 \ | ||
9 | file://LICENSE.GPL3;md5=6e1694ee338db410417517884918d4d2 \ | ||
10 | file://LGPL_EXCEPTION.txt;md5=0145c4d1b6f96a661c2c139dfb268fb6" | ||
11 | |||
12 | INC_PR = "r20" | ||
13 | |||
14 | inherit native | ||
15 | |||
16 | SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-everywhere-opensource-src-${PV}.tar.gz \ | ||
17 | file://0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \ | ||
18 | file://0002-qkbdtty_qws-fix-build-with-old-kernel-headers.patch \ | ||
19 | file://0003-webkit2-set-OUTPUT_DIR-value-if-empty.patch \ | ||
20 | file://0021-configure-make-qt4-native-work-with-long-building-pa.patch \ | ||
21 | file://g++.conf \ | ||
22 | file://linux.conf \ | ||
23 | " | ||
24 | S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}" | ||
25 | |||
26 | EXTRA_OECONF = "-prefix ${prefix} \ | ||
27 | -bindir ${bindir} \ | ||
28 | -libdir ${libdir} \ | ||
29 | -datadir ${datadir}/qt4 \ | ||
30 | -sysconfdir ${sysconfdir}/qt4 \ | ||
31 | -docdir ${docdir}/qt4 \ | ||
32 | -headerdir ${includedir}/qt4 \ | ||
33 | -plugindir ${libdir}/qt4/plugins \ | ||
34 | -importdir ${libdir}/qt4/imports \ | ||
35 | -translationdir ${datadir}/qt4/translations \ | ||
36 | -examplesdir ${bindir}/qt4/examples \ | ||
37 | -demosdir ${bindir}/qt4/demos \ | ||
38 | -L ${STAGING_LIBDIR_NATIVE} \ | ||
39 | -I ${STAGING_INCDIR_NATIVE} \ | ||
40 | -qt-libjpeg -system-zlib \ | ||
41 | -no-libjpeg -no-libpng -no-libmng -no-libtiff \ | ||
42 | -no-accessibility \ | ||
43 | -no-cups \ | ||
44 | -no-nas-sound \ | ||
45 | -no-nis -no-openssl \ | ||
46 | -verbose -release \ | ||
47 | -embedded -no-freetype -no-glib -no-iconv \ | ||
48 | -exceptions -xmlpatterns \ | ||
49 | -qt3support \ | ||
50 | -no-fast -silent -no-rpath" | ||
51 | |||
52 | # yank default -e, otherwise we get the following error: | ||
53 | # moc_qbuffer.cpp: No such file or directory | ||
54 | EXTRA_OEMAKE = " " | ||
55 | |||
56 | do_configure() { | ||
57 | # Avoid problems with Qt 4.8.0 configure setting QMAKE_LINK from LD (since we want the linker to be g++) | ||
58 | unset LD | ||
59 | |||
60 | (echo o; echo yes) | ./configure ${EXTRA_OECONF} || die "Configuring qt failed. EXTRA_OECONF was ${EXTRA_OECONF}" | ||
61 | } | ||
62 | |||
63 | TOBUILD = "\ | ||
64 | src/tools/moc \ | ||
65 | src/corelib \ | ||
66 | src/sql \ | ||
67 | src/xml \ | ||
68 | src/network \ | ||
69 | src/tools/uic \ | ||
70 | src/tools/rcc \ | ||
71 | src/xmlpatterns \ | ||
72 | src/dbus \ | ||
73 | src/gui \ | ||
74 | src/testlib \ | ||
75 | src/qt3support \ | ||
76 | src/tools/uic3 \ | ||
77 | tools/linguist/lconvert \ | ||
78 | tools/linguist/lrelease \ | ||
79 | tools/linguist/lupdate \ | ||
80 | tools/qdbus/qdbuscpp2xml \ | ||
81 | tools/qdbus/qdbusxml2cpp \ | ||
82 | tools/xmlpatterns \ | ||
83 | " | ||
84 | |||
85 | do_compile() { | ||
86 | for i in ${TOBUILD}; do | ||
87 | cd ${S}/$i && oe_runmake CC="${CC}" CXX="${CXX}" | ||
88 | done | ||
89 | } | ||
90 | |||
91 | do_install() { | ||
92 | install -d ${D}${bindir}/ | ||
93 | install -m 0755 bin/qmake ${D}${bindir}/qmake2 | ||
94 | for i in moc uic uic3 rcc lconvert lrelease lupdate qdbuscpp2xml qdbusxml2cpp xmlpatterns; do | ||
95 | install -m 0755 bin/${i} ${D}${bindir}/${i}4 | ||
96 | done | ||
97 | |||
98 | install -d ${D}${datadir}/qt4/ | ||
99 | cp -PfR mkspecs ${D}${datadir}/qt4/ | ||
100 | ln -sf linux-g++ ${D}${datadir}/qt4/mkspecs/${BUILD_OS}-oe-g++ | ||
101 | if [ -f ${D}${datadir}/qt4/mkspecs/common/g++-unix.conf ] ; then | ||
102 | # mkspecs were refactored for 4.8.0 | ||
103 | cp -f ${WORKDIR}/g++.conf ${D}${datadir}/qt4/mkspecs/common/g++-unix.conf | ||
104 | else | ||
105 | cp -f ${WORKDIR}/g++.conf ${D}${datadir}/qt4/mkspecs/common/g++.conf | ||
106 | fi | ||
107 | cp -f ${WORKDIR}/linux.conf ${D}${datadir}/qt4/mkspecs/common/ | ||
108 | |||
109 | install -m 0644 tools/porting/src/q3porting.xml ${D}${datadir}/qt4/ | ||
110 | |||
111 | for i in ${TOBUILD}; do | ||
112 | cd ${S}/$i && oe_runmake install INSTALL_ROOT=${D} | ||
113 | done | ||
114 | } | ||
diff --git a/meta/recipes-qt/qt4/qt4-native_4.8.5.bb b/meta/recipes-qt/qt4/qt4-native_4.8.5.bb new file mode 100644 index 0000000000..2443cc4b10 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-native_4.8.5.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | require qt4-native.inc | ||
2 | |||
3 | TOBUILD := "src/tools/bootstrap ${TOBUILD}" | ||
4 | |||
5 | SRC_URI[md5sum] = "1864987bdbb2f58f8ae8b350dfdbe133" | ||
6 | SRC_URI[sha256sum] = "eb728f8268831dc4373be6403b7dd5d5dde03c169ad6882f9a8cb560df6aa138" | ||
diff --git a/meta/recipes-qt/qt4/qt4-x11-free.inc b/meta/recipes-qt/qt4/qt4-x11-free.inc new file mode 100644 index 0000000000..73ed2bcbd9 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-x11-free.inc | |||
@@ -0,0 +1,39 @@ | |||
1 | require qt4.inc | ||
2 | |||
3 | SUMMARY = "Cross-platform UI toolkit and application framework (X11 version)" | ||
4 | DESCRIPTION = "Qt is a versatile cross-platform application framework -- this is the X11 version." | ||
5 | HOMEPAGE = "http://qt-project.org/" | ||
6 | SECTION = "x11/libs" | ||
7 | DEPENDS += "virtual/libgl virtual/libx11 fontconfig libxft libxext libxrender libxrandr libxcursor" | ||
8 | PROVIDES += "qt4-x11" | ||
9 | QT4DEPENDS = "" | ||
10 | |||
11 | INC_PR = "r50" | ||
12 | |||
13 | QT_GLFLAGS ?= "${@base_contains('DISTRO_FEATURES', 'opengl', '-opengl', '-no-opengl', d)} " | ||
14 | QT_GLFLAGS_qemux86 = "-opengl" | ||
15 | QT_GLFLAGS_qemuppc = "-opengl" | ||
16 | QT_X11_FLAGS ?= "-no-xinerama -no-xkb -no-gtkstyle" | ||
17 | QT_CONFIG_FLAGS += "${QT_X11_FLAGS}" | ||
18 | QT_BASE_LIB ?= "libqt" | ||
19 | |||
20 | # required by kdelibs4 | ||
21 | QT_KDE_FLAGS ?= "-accessibility -sm" | ||
22 | QT_DISTRO_FLAGS ?= "${QT_KDE_FLAGS}" | ||
23 | |||
24 | inherit qt4x11 | ||
25 | |||
26 | do_install_append() { | ||
27 | # fix pkgconfig, libtool and prl files | ||
28 | sed -i -e 's#I/usr/include#Iincludedir}#g' \ | ||
29 | -e 's#Iin#I${in#g' \ | ||
30 | ${D}${libdir}/*.la ${D}${libdir}/*.prl ${D}${libdir}/pkgconfig/*.pc | ||
31 | |||
32 | # QT abuses $includedir to point to its headers, which breaks pkgconfig sysroot, so | ||
33 | # manually fix it up here: | ||
34 | for pc in ${D}${libdir}/pkgconfig/*.pc ; do | ||
35 | sed -i -e "s:prefix}include/${QT_BASE_NAME}/$(basename $pc .pc):prefix}/include:" \ | ||
36 | -e "s,Cflags: ,Cflags: -IP{includedir}/${QT_BASE_NAME}/$(basename $pc .pc) ," \ | ||
37 | -e 's:IP{:I${:g' $pc | ||
38 | done | ||
39 | } | ||
diff --git a/meta/recipes-qt/qt4/qt4-x11-free_4.8.5.bb b/meta/recipes-qt/qt4/qt4-x11-free_4.8.5.bb new file mode 100644 index 0000000000..5cb5e6817d --- /dev/null +++ b/meta/recipes-qt/qt4/qt4-x11-free_4.8.5.bb | |||
@@ -0,0 +1,9 @@ | |||
1 | require qt4-x11-free.inc | ||
2 | require qt4-${PV}.inc | ||
3 | |||
4 | QT_CONFIG_FLAGS_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " -no-neon" ,d)}" | ||
5 | |||
6 | QT_CONFIG_FLAGS += " \ | ||
7 | -no-embedded \ | ||
8 | -xrandr \ | ||
9 | -x11" | ||
diff --git a/meta/recipes-qt/qt4/qt4.inc b/meta/recipes-qt/qt4/qt4.inc new file mode 100644 index 0000000000..9a10138e94 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4.inc | |||
@@ -0,0 +1,393 @@ | |||
1 | inherit qmake_base | ||
2 | |||
3 | DEPENDS += "qt4-tools-native freetype jpeg libpng zlib dbus openssl glib-2.0 gstreamer gst-plugins-base sqlite3 tiff icu" | ||
4 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}" | ||
5 | |||
6 | require qt4_arch.inc | ||
7 | |||
8 | QT_DISTRO_FLAGS ?= "-no-accessibility -no-sm" | ||
9 | QT_DISTRO_FLAGS_linuxstdbase = "-sm" | ||
10 | |||
11 | QT_SQL_DRIVER_FLAGS ?= "-no-sql-ibase -no-sql-mysql -no-sql-psql -no-sql-odbc -plugin-sql-sqlite -system-sqlite" | ||
12 | |||
13 | QT_GLFLAGS ?= "" | ||
14 | |||
15 | |||
16 | QT_QT3SUPPORT ?= "-qt3support" | ||
17 | QT_XML ?= "-xmlpatterns" | ||
18 | QT_WEBKIT ?= "-webkit" | ||
19 | QT_PHONON ?= "-phonon" | ||
20 | QT_DBUS ?= "-qdbus" | ||
21 | QT_MULTIMEDIA ?= "${@base_contains('DISTRO_FEATURES', 'pulseaudio', '-pulseaudio', '-no-pulseaudio', d)}" | ||
22 | |||
23 | QT_CONFIG_FLAGS += "-release -no-cups -reduce-relocations \ | ||
24 | -shared -no-nas-sound -no-nis \ | ||
25 | -system-libjpeg -system-libpng -system-libtiff -system-zlib \ | ||
26 | -no-pch -stl -glib -icu \ | ||
27 | -no-rpath -silent \ | ||
28 | ${QT_DBUS} \ | ||
29 | ${QT_QT3SUPPORT} \ | ||
30 | ${QT_WEBKIT} \ | ||
31 | ${QT_PHONON} \ | ||
32 | ${QT_XML} \ | ||
33 | ${QT_MULTIMEDIA} \ | ||
34 | ${QT_SQL_DRIVER_FLAGS} \ | ||
35 | ${QT_DISTRO_FLAGS} \ | ||
36 | ${QT_GLFLAGS}" | ||
37 | |||
38 | EXTRA_OEMAKE = "-e" | ||
39 | |||
40 | EXTRA_ENV = 'QMAKE="${STAGING_BINDIR_NATIVE}/qmake2 -after \ | ||
41 | INCPATH+=${STAGING_INCDIR}/freetype2 LIBS+=-L${STAGING_LIBDIR}" \ | ||
42 | QMAKESPEC="${QMAKESPEC}" LINK="${CXX} -Wl,-rpath-link,${STAGING_LIBDIR}" \ | ||
43 | AR="${TARGET_PREFIX}ar cqs" \ | ||
44 | MOC="${STAGING_BINDIR_NATIVE}/moc4" UIC="${STAGING_BINDIR_NATIVE}/uic4" MAKE="make -e"' | ||
45 | |||
46 | export QT_CONF_PATH="${WORKDIR}/qt.conf" | ||
47 | |||
48 | # Library packages | ||
49 | QT_LIB_NAMES = "Qt3Support QtAssistantClient QtCLucene QtCore QtDBus QtDesigner QtDesignerComponents QtGui QtHelp QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg QtTest QtUiTools QtWebKit QtXml QtXmlPatterns phonon QtMultimedia QtOpenVG QtMediaServices QtDeclarative" | ||
50 | |||
51 | QT_EXTRA_LIBS = "pvrQWSWSEGL" | ||
52 | |||
53 | python __anonymous () { | ||
54 | lib_packages = [] | ||
55 | dev_packages = [] | ||
56 | dbg_packages = [] | ||
57 | staticdev_packages = [] | ||
58 | for name in d.getVar("QT_LIB_NAMES", True).split(): | ||
59 | pkg = d.getVar("QT_BASE_LIB", True) + name.lower().replace("qt", "").replace("_", "-") + "4" | ||
60 | # NOTE: the headers for QtAssistantClient are different | ||
61 | incname = name.replace("QtAssistantClient", "QtAssistant") | ||
62 | d.setVar("FILES_%s" % pkg, "${libdir}/lib%(name)s${QT_LIBINFIX}.so.*" % locals()) | ||
63 | d.setVar("FILES_%s-dev" % pkg, """${libdir}/lib%(name)s${QT_LIBINFIX}.prl | ||
64 | ${libdir}/lib%(name)s${QT_LIBINFIX}.la | ||
65 | ${libdir}/lib%(name)s${QT_LIBINFIX}.so | ||
66 | ${includedir}/${QT_DIR_NAME}/%(incname)s | ||
67 | ${libdir}/pkgconfig/%(name)s${QT_LIBINFIX}.pc""" % locals()) | ||
68 | d.setVar("FILES_%s-staticdev" % pkg, "${libdir}/lib%(name)s${QT_LIBINFIX}.a" % locals()) | ||
69 | d.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s${QT_LIBINFIX}.so*" % locals()) | ||
70 | d.setVar("RRECOMMENDS_%s-dbg" % pkg, "${PN}-dbg") | ||
71 | lib_packages.append(pkg) | ||
72 | dev_packages.append("%s-dev" % pkg) | ||
73 | dbg_packages.append("%s-dbg" % pkg) | ||
74 | staticdev_packages.append("%s-staticdev" % pkg) | ||
75 | for name in d.getVar("OTHER_PACKAGES", True).split(): | ||
76 | dbg_packages.append("%s-dbg" % name) | ||
77 | staticdev_packages.append("%s-staticdev" % name) | ||
78 | |||
79 | for name in d.getVar("QT_EXTRA_LIBS", True).split(): | ||
80 | pkg = d.getVar("QT_BASE_LIB", True) + name.lower().replace("qt", "").replace("_", "-") + "4" | ||
81 | d.setVar("FILES_%s" % pkg, "${libdir}/lib%(name)s.so.*" % locals()) | ||
82 | d.setVar("FILES_%s-staticdev" % pkg, "${libdir}/lib%(name)s.a" % locals()) | ||
83 | d.setVar("FILES_%s-dev" % pkg, """${libdir}/lib%(name)s.prl | ||
84 | ${libdir}/lib%(name)s.la | ||
85 | ${libdir}/lib%(name)s.so | ||
86 | ${includedir}/${QT_DIR_NAME}/%(incname)s | ||
87 | ${libdir}/pkgconfig/%(name)s.pc""" % locals()) | ||
88 | d.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s.so*" % locals()) | ||
89 | d.setVar("RRECOMMENDS_%s-dbg" % pkg, "${PN}-dbg") | ||
90 | lib_packages.append(pkg) | ||
91 | dev_packages.append("%s-dev" % pkg) | ||
92 | dbg_packages.append("%s-dbg" % pkg) | ||
93 | staticdev_packages.append("%s-staticdev" % pkg) | ||
94 | |||
95 | d.setVar("LIB_PACKAGES", " ".join(lib_packages)) | ||
96 | d.setVar("DEV_PACKAGES", " ".join(dev_packages)) | ||
97 | d.setVar("DBG_PACKAGES", " ".join(dbg_packages)) | ||
98 | d.setVar("STATICDEV_PACKAGES", " ".join(staticdev_packages)) | ||
99 | } | ||
100 | |||
101 | OTHER_PACKAGES = "\ | ||
102 | ${QT_BASE_NAME}-tools \ | ||
103 | ${QT_BASE_NAME}-assistant \ | ||
104 | ${QT_BASE_NAME}-common \ | ||
105 | ${QT_BASE_NAME}-dbus \ | ||
106 | ${QT_BASE_NAME}-demos \ | ||
107 | ${QT_BASE_NAME}-designer \ | ||
108 | ${QT_BASE_NAME}-examples \ | ||
109 | ${QT_BASE_NAME}-linguist \ | ||
110 | ${QT_BASE_NAME}-makeqpf \ | ||
111 | ${QT_BASE_NAME}-mkspecs \ | ||
112 | ${QT_BASE_NAME}-pixeltool \ | ||
113 | ${QT_BASE_NAME}-qmlviewer \ | ||
114 | ${QT_BASE_NAME}-xmlpatterns \ | ||
115 | ${QT_BASE_NAME}-qt3to4 \ | ||
116 | ${QT_BASE_NAME}-qml-plugins" | ||
117 | |||
118 | #We prepend so ${QT_BASE_NAME}-demos-doc comes before ${PN}-doc,so the packaging of FILES_ get done before. | ||
119 | PACKAGES =+ "${QT_BASE_NAME}-demos-doc" | ||
120 | PACKAGES += " \ | ||
121 | ${LIB_PACKAGES} \ | ||
122 | ${DEV_PACKAGES} \ | ||
123 | ${DBG_PACKAGES} \ | ||
124 | ${STATICDEV_PACKAGES} \ | ||
125 | ${OTHER_PACKAGES}" | ||
126 | |||
127 | PACKAGES_DYNAMIC += "^${QT_BASE_NAME}-plugin-.* ^${QT_BASE_NAME}-translation-.* ^${QT_BASE_NAME}-phrasebook-.*" | ||
128 | |||
129 | ALLOW_EMPTY_${PN} = "1" | ||
130 | FILES_${PN} = "" | ||
131 | FILES_${PN}-dev = "${includedir}/${QT_DIR_NAME}/Qt/*" | ||
132 | FILES_${PN}-dbg = "/usr/src/debug/" | ||
133 | FILES_${QT_BASE_NAME}-demos-doc = "${docdir}/${QT_DIR_NAME}/qch/qt.qch" | ||
134 | RRECOMMENDS_${PN} = "${LIB_PACKAGES} ${OTHER_PACKAGES}" | ||
135 | RRECOMMENDS_${PN}-dev = "${DEV_PACKAGES}" | ||
136 | RRECOMMENDS_${PN}-dbg = "${DBG_PACKAGES}" | ||
137 | RRECOMMENDS_${QT_BASE_LIB}core4_append_libc-glibc = " eglibc-gconv-utf-16" | ||
138 | RRECOMMENDS_${QT_BASE_NAME}-demos += " \ | ||
139 | ${QT_BASE_NAME}-examples \ | ||
140 | ${QT_BASE_NAME}-plugin-sqldriver-sqlite \ | ||
141 | ${QT_BASE_NAME}-plugin-imageformat-jpeg \ | ||
142 | ${QT_BASE_NAME}-qml-plugins \ | ||
143 | ${QT_BASE_NAME}-assistant \ | ||
144 | ${QT_BASE_NAME}-demos-doc" | ||
145 | RRECOMMENDS_${QT_BASE_NAME}-examples += " \ | ||
146 | ${QT_BASE_NAME}-plugin-sqldriver-sqlite \ | ||
147 | ${QT_BASE_NAME}-plugin-imageformat-jpeg \ | ||
148 | ${QT_BASE_NAME}-qml-plugins" | ||
149 | RRECOMMENDS_${QT_BASE_NAME}-qmlviewer += " \ | ||
150 | ${QT_BASE_NAME}-qml-plugins" | ||
151 | RRECOMMENDS_${QT_BASE_NAME}-doc += " \ | ||
152 | ${QT_BASE_NAME}-demos-doc" | ||
153 | |||
154 | RPROVIDES_${QT_BASE_NAME}-tools += "qmake2" | ||
155 | RREPLACES_${QT_BASE_NAME}-tools += "qmake2" | ||
156 | |||
157 | FILES_${QT_BASE_NAME}-tools = "${bindir}/qttracereplay ${bindir}/qdoc* ${bindir}/qmake ${bindir}/moc ${bindir}/uic* ${bindir}/rcc" | ||
158 | FILES_${QT_BASE_NAME}-tools-dbg = "${bindir}/.debug/qttracereplay ${bindir}/.debug/qdoc* ${bindir}/.debug/qmake ${bindir}/.debug/uic* ${bindir}/.debug/moc ${bindir}/.debug/rcc" | ||
159 | FILES_${QT_BASE_NAME}-assistant = "${bindir}/*assistant* ${bindir}/qcollectiongenerator ${bindir}/qhelpconverter ${bindir}/qhelpgenerator" | ||
160 | FILES_${QT_BASE_NAME}-assistant-dbg = "${bindir}/.debug/*assistant* ${bindir}/.debug/qcollectiongenerator ${bindir}/.debug/qhelpconverter ${bindir}/.debug/qhelpgenerator" | ||
161 | FILES_${QT_BASE_NAME}-common = "${bindir}/qtconfig" | ||
162 | FILES_${QT_BASE_NAME}-common-dbg = "${bindir}/.debug/qtconfig" | ||
163 | FILES_${QT_BASE_NAME}-dbus = "${bindir}/qdbus ${bindir}/qdbusxml2cpp ${bindir}/qdbuscpp2xml ${bindir}/qdbusviewer" | ||
164 | FILES_${QT_BASE_NAME}-dbus-dbg = "${bindir}/.debug/qdbus ${bindir}/.debug/qdbusxml2cpp ${bindir}/.debug/qdbuscpp2xml ${bindir}/.debug/qdbusviewer" | ||
165 | FILES_${QT_BASE_NAME}-demos = "${bindir}/qtdemo* ${bindir}/${QT_DIR_NAME}/demos/*" | ||
166 | FILES_${QT_BASE_NAME}-demos-staticdev = "${bindir}/${QT_DIR_NAME}/demos/shared/libdemo_shared.a" | ||
167 | FILES_${QT_BASE_NAME}-demos-dbg = "${bindir}/.debug/qtdemo* ${bindir}/${QT_DIR_NAME}/demos/.debug/* ${bindir}/${QT_DIR_NAME}/demos/*/.debug ${bindir}/${QT_DIR_NAME}/demos/*/*/.debug ${bindir}/${QT_DIR_NAME}/demos/*/*/*/.debug" | ||
168 | FILES_${QT_BASE_NAME}-designer = "${bindir}/*designer*" | ||
169 | FILES_${QT_BASE_NAME}-designer-dbg = "${bindir}/.debug/*designer*" | ||
170 | FILES_${QT_BASE_NAME}-examples = "${bindir}/${QT_DIR_NAME}/examples/*" | ||
171 | FILES_${QT_BASE_NAME}-examples-staticdev = "${bindir}/${QT_DIR_NAME}/examples/tools/plugandpaint/plugins/libpnp_basictools.a" | ||
172 | FILES_${QT_BASE_NAME}-examples-dbg = "${bindir}/${QT_DIR_NAME}/examples/.debug ${bindir}/${QT_DIR_NAME}/examples/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/declarative/*/*/*/*/*/.debug/* ${bindir}/${QT_DIR_NAME}/examples/declarative/*/*/*/*/.debug/*" | ||
173 | FILES_${QT_BASE_NAME}-linguist = "${bindir}/*linguist* ${bindir}/lrelease ${bindir}/lupdate ${bindir}/lconvert ${bindir}/qm2ts" | ||
174 | FILES_${QT_BASE_NAME}-linguist-dbg = "${bindir}/.debug/*linguist* ${bindir}/.debug/lrelease ${bindir}/.debug/lupdate ${bindir}/.debug/lconvert ${bindir}/.debug/qm2ts" | ||
175 | FILES_${QT_BASE_NAME}-pixeltool = "${bindir}/pixeltool" | ||
176 | FILES_${QT_BASE_NAME}-pixeltool-dbg = "${bindir}/.debug/pixeltool" | ||
177 | FILES_${QT_BASE_NAME}-qt3to4 = "${bindir}/qt3to4 ${datadir}/${QT_DIR_NAME}/q3porting.xml" | ||
178 | FILES_${QT_BASE_NAME}-qt3to4-dbg = "${bindir}/.debug/qt3to4" | ||
179 | FILES_${QT_BASE_NAME}-qmlviewer = "${bindir}/qmlviewer" | ||
180 | FILES_${QT_BASE_NAME}-qmlviewer-dbg = "${bindir}/.debug/qmlviewer" | ||
181 | FILES_${QT_BASE_NAME}-makeqpf = "${bindir}/makeqpf" | ||
182 | FILES_${QT_BASE_NAME}-makeqpf-dbg = "${bindir}/.debug/makeqpf" | ||
183 | FILES_${QT_BASE_NAME}-mkspecs = "${datadir}/${QT_DIR_NAME}/mkspecs/* ${datadir}/${QT_DIR_NAME}/environment-setup" | ||
184 | FILES_${QT_BASE_NAME}-xmlpatterns = "${bindir}/xmlpatterns*" | ||
185 | FILES_${QT_BASE_NAME}-xmlpatterns-dbg = "${bindir}/.debug/xmlpatterns*" | ||
186 | FILES_${QT_BASE_NAME}-qml-plugins = "${libdir}/${QT_DIR_NAME}/imports/* ${libdir}/${QT_DIR_NAME}/plugins/qmltooling/*" | ||
187 | FILES_${QT_BASE_NAME}-qml-plugins-dbg = "${libdir}/${QT_DIR_NAME}/imports/*/*/*/.debug/* ${libdir}/${QT_DIR_NAME}/imports/*/.debug ${libdir}/${QT_DIR_NAME}/plugins/qmltooling/.debug" | ||
188 | INSANE_SKIP_${MLPREFIX}${QT_BASE_NAME}-examples += "libdir" | ||
189 | INSANE_SKIP_${MLPREFIX}${QT_BASE_NAME}-examples-dbg += "libdir" | ||
190 | |||
191 | # License options, to be set by the recipe if different values are needed | ||
192 | QT_LICENSE_FILE ?= "" | ||
193 | QT_LICENSE_FLAGS ?= "-opensource" | ||
194 | |||
195 | do_configure() { | ||
196 | unset QMAKESPEC | ||
197 | unset QTDIR | ||
198 | |||
199 | set_arch | ||
200 | set_endian | ||
201 | |||
202 | if [ ! -e bin/qmake ]; then | ||
203 | ln -sf ${STAGING_BINDIR_NATIVE}/qmake2 bin/qmake | ||
204 | fi | ||
205 | |||
206 | if [ ! -e mkspecs/${TARGET_OS}-oe-g++ ]; then | ||
207 | ln -sf linux-g++ mkspecs/${TARGET_OS}-oe-g++ | ||
208 | fi | ||
209 | |||
210 | if [ -f mkspecs/common/g++-unix.conf ] ; then | ||
211 | # mkspecs were refactored for 4.8.0 | ||
212 | cp -f ${WORKDIR}/g++.conf mkspecs/common/g++-unix.conf | ||
213 | else | ||
214 | cp -f ${WORKDIR}/g++.conf mkspecs/common/g++.conf | ||
215 | fi | ||
216 | cp -f ${WORKDIR}/linux.conf mkspecs/common/ | ||
217 | |||
218 | echo "[Paths]" > $QT_CONF_PATH | ||
219 | echo "Prefix=${prefix}" >> $QT_CONF_PATH | ||
220 | echo "Documentation=${docdir}/${QT_DIR_NAME}" >> $QT_CONF_PATH | ||
221 | echo "Headers=${includedir}/${QT_DIR_NAME}" >> $QT_CONF_PATH | ||
222 | echo "Libraries=${libdir}" >> $QT_CONF_PATH | ||
223 | echo "Binaries=${bindir}" >> $QT_CONF_PATH | ||
224 | echo "Plugins=${libdir}/${QT_DIR_NAME}/plugins" >> $QT_CONF_PATH | ||
225 | echo "Imports=${libdir}/${QT_DIR_NAME}/imports" >> $QT_CONF_PATH | ||
226 | echo "Data=${datadir}/${QT_DIR_NAME}" >> $QT_CONF_PATH | ||
227 | echo "Translations=${datadir}/${QT_DIR_NAME}/translations" >> $QT_CONF_PATH | ||
228 | echo "Settings=${sysconfdir}/${QT_DIR_NAME}" >> $QT_CONF_PATH | ||
229 | echo "Examples=${bindir}/${QT_DIR_NAME}/examples" >> $QT_CONF_PATH | ||
230 | echo "Demos=${bindir}/${QT_DIR_NAME}/demos" >> $QT_CONF_PATH | ||
231 | |||
232 | ${EXTRA_QMAKE_MUNGE}|| true | ||
233 | |||
234 | echo yes | QT_LICENSE_FILE="${QT_LICENSE_FILE}" ./configure -v \ | ||
235 | -prefix ${prefix} \ | ||
236 | -bindir ${bindir} \ | ||
237 | -libdir ${libdir} \ | ||
238 | -datadir ${datadir}/${QT_DIR_NAME} \ | ||
239 | -sysconfdir ${sysconfdir}/${QT_DIR_NAME} \ | ||
240 | -docdir ${docdir}/${QT_DIR_NAME} \ | ||
241 | -headerdir ${includedir}/${QT_DIR_NAME} \ | ||
242 | -plugindir ${libdir}/${QT_DIR_NAME}/plugins \ | ||
243 | -importdir ${libdir}/${QT_DIR_NAME}/imports \ | ||
244 | -translationdir ${datadir}/${QT_DIR_NAME}/translations \ | ||
245 | -examplesdir ${bindir}/${QT_DIR_NAME}/examples \ | ||
246 | -demosdir ${bindir}/${QT_DIR_NAME}/demos \ | ||
247 | -platform ${TARGET_OS}-oe-g++ \ | ||
248 | -xplatform ${TARGET_OS}-oe-g++ \ | ||
249 | ${QT_ENDIAN} \ | ||
250 | -crossarch ${QT_ARCH} \ | ||
251 | ${QT_LICENSE_FLAGS} \ | ||
252 | ${QT_CONFIG_FLAGS} -no-fast \ | ||
253 | -L${STAGING_LIBDIR} -I${STAGING_INCDIR} \ | ||
254 | -I${STAGING_INCDIR}/freetype2 | ||
255 | } | ||
256 | |||
257 | do_compile() { | ||
258 | # Fixup missing wsegl header in some SGX SDKs | ||
259 | if ! [ -e ${STAGING_INCDIR}/wsegl.h ] ; then | ||
260 | cp src/3rdparty/powervr/wsegl.h src/plugins/gfxdrivers/powervr/QWSWSEGL/ | ||
261 | fi | ||
262 | |||
263 | unset CFLAGS CXXFLAGS | ||
264 | |||
265 | oe_runmake ${EXTRA_ENV} | ||
266 | |||
267 | # Build target qmake | ||
268 | export QMAKESPEC="${S}/mkspecs/${TARGET_OS}-oe-g++" | ||
269 | cd ${S}/qmake | ||
270 | ${OE_QMAKE_QMAKE} | ||
271 | oe_runmake CC="${CC}" CXX="${CXX}" | ||
272 | cd ${S} | ||
273 | } | ||
274 | |||
275 | python populate_packages_prepend() { | ||
276 | translation_dir = d.expand('${datadir}/${QT_DIR_NAME}/translations/') | ||
277 | translation_name = d.expand('${QT_BASE_NAME}-translation-%s') | ||
278 | do_split_packages(d, translation_dir, '^(assistant|designer|linguist|qt|qtconfig|qvfb)_(.*)\.qm$', translation_name, '${PN} translation for %s', extra_depends='' ) | ||
279 | |||
280 | phrasebook_dir = d.expand('${datadir}/${QT_DIR_NAME}/phrasebooks/') | ||
281 | phrasebook_name = d.expand('${QT_BASE_NAME}-phrasebook-%s') | ||
282 | |||
283 | if os.path.exists("%s%s" % (d.expand('${D}'), phrasebook_dir)): | ||
284 | do_split_packages(d, phrasebook_dir, '^(.*)\.qph$', phrasebook_name, '${PN} phrasebook for %s', extra_depends='' ) | ||
285 | else: | ||
286 | bb.note("The path does not exist:", d.expand('${D}'), phrasebook_dir) | ||
287 | |||
288 | # Package all the plugins and their -dbg version and create a meta package | ||
289 | def qtopia_split(path, name, glob): | ||
290 | """ | ||
291 | Split the package into a normal and -dbg package and then add the | ||
292 | new packages to the meta package. | ||
293 | """ | ||
294 | plugin_dir = d.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/' % path) | ||
295 | if not os.path.exists("%s%s" % (d.expand('${D}'), plugin_dir)): | ||
296 | bb.note("The path does not exist:", d.expand('${D}'), plugin_dir) | ||
297 | return | ||
298 | |||
299 | plugin_name = d.expand('${QT_BASE_NAME}-plugin-%s-%%s' % name) | ||
300 | dev_packages = [] | ||
301 | dev_hook = lambda file,pkg,b,c,d:dev_packages.append((file,pkg)) | ||
302 | do_split_packages(d, plugin_dir, glob, plugin_name, '${PN} %s for %%s' % name, extra_depends='', hook=dev_hook) | ||
303 | # Create a -dbg package as well | ||
304 | plugin_dir_dbg = d.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/.debug' % path) | ||
305 | packages = d.getVar('PACKAGES') | ||
306 | for (file,package) in dev_packages: | ||
307 | packages = "%s %s-dbg" % (packages, package) | ||
308 | file_name = os.path.join(plugin_dir_dbg, os.path.basename(file)) | ||
309 | d.setVar("FILES_%s-dbg" % package, file_name) | ||
310 | d.setVar("DESCRIPTION_%s-dbg" % package, "${PN} %s for %s" % (name, package)) | ||
311 | |||
312 | d.setVar('PACKAGES', packages) | ||
313 | |||
314 | qtopia_split('accessible', 'accessible', '^libq(.*)\.so$') | ||
315 | qtopia_split('codecs', 'codec', '^libq(.*)\.so$') | ||
316 | qtopia_split('decorations', 'decoration', '^libqdecoration(.*)\.so$') | ||
317 | qtopia_split('designer', 'designer', '^lib(.*)\.so$') | ||
318 | qtopia_split('gfxdrivers', 'gfxdriver', '^libq(.*)\.so$') | ||
319 | qtopia_split('graphicssystems','graphicssystems', '^libq(.*)\.so$') | ||
320 | qtopia_split('kbddrivers', 'kbddriver', '^libq(.*)kbddriver\.so$') | ||
321 | qtopia_split('mousedrivers', 'mousedriver', '^libq(.*)mousedriver\.so$') | ||
322 | qtopia_split('iconengines', 'iconengine', '^libq(.*)\.so$') | ||
323 | qtopia_split('imageformats', 'imageformat', '^libq(.*)\.so$') | ||
324 | qtopia_split('inputmethods', 'inputmethod', '^libq(.*)\.so$') | ||
325 | qtopia_split('sqldrivers', 'sqldriver', '^libq(.*)\.so$') | ||
326 | qtopia_split('script', 'script', '^libqtscript(.*)\.so$') | ||
327 | qtopia_split('styles', 'style', '^libq(.*)\.so$') | ||
328 | qtopia_split('phonon_backend','phonon-backend','^libphonon_(.*)\.so$') | ||
329 | qtopia_split('bearer', 'bearer', '^libq(.*)bearer\.so$') | ||
330 | } | ||
331 | |||
332 | do_install() { | ||
333 | oe_runmake install INSTALL_ROOT=${D} | ||
334 | |||
335 | # Install a proper target version of qmake | ||
336 | rm ${D}/${bindir}/qmake | ||
337 | install -m 0755 bin/qmake2 ${D}${bindir}/qmake | ||
338 | |||
339 | # fix pkgconfig, libtool and prl files | ||
340 | sed -i -e 's#-L${S}/lib/\?##g' \ | ||
341 | -e 's#-L${STAGING_LIBDIR}/\?##g' \ | ||
342 | -e 's#STAGING_LIBDIR}#libdir}'#g \ | ||
343 | -e 's#-L${libdir}/\?##g' \ | ||
344 | -e s#'$(OE_QMAKE_LIBS_X11)'#"${OE_QMAKE_LIBS_X11}"#g \ | ||
345 | -e 's#" -Wl,-rpath-link,${S}/lib/\?"##g' \ | ||
346 | -e 's#" -Wl,-rpath-link,${libdir}/\?"##g' \ | ||
347 | -e 's#Iin#I${in#g' \ | ||
348 | -e 's#-L\.\./\.\./WebCore/release\s\+-L\.\./\.\./JavaScriptCore/release\s\+-lwebcore##g' \ | ||
349 | -e 's#-ljscore##g' \ | ||
350 | ${D}${libdir}/*.la ${D}${libdir}/*.prl ${D}${libdir}/pkgconfig/*.pc | ||
351 | |||
352 | sed -i -e s#" -Wl,-rpath-link,${S}/lib"##g \ | ||
353 | ${D}${datadir}/${QT_DIR_NAME}/mkspecs/common/linux.conf | ||
354 | |||
355 | # fix pkgconfig files | ||
356 | sed -i -e s#"moc_location=.*$"#"moc_location=${bindir}/moc4"# \ | ||
357 | -e s#"uic_location=.*$"#"uic_location=${bindir}/uic4"# \ | ||
358 | ${D}${libdir}/pkgconfig/*.pc | ||
359 | for name in ${QT_LIB_NAMES}; do | ||
360 | sed -i -e /Requires/s#"${name}"#"${name}${QT_LIBINFIX}"#g ${D}${libdir}/pkgconfig/*.pc | ||
361 | done | ||
362 | |||
363 | # QT abuses $includedir to point to its headers, which breaks pkgconfig sysroot, so manually fix it up here: | ||
364 | for pc in ${D}${libdir}/pkgconfig/*.pc ; do | ||
365 | sed -i -e "s:prefix}/include/${QT_DIR_NAME}/$(basename $pc .pc):prefix}/include:" \ | ||
366 | -e 's:IP{:I${:g' $pc | ||
367 | done | ||
368 | |||
369 | #Append an E to the qtdemo file | ||
370 | if [ -n "${QT_LIBINFIX}" ] ; then | ||
371 | [ -f ${D}${bindir}/qtdemo ] && mv ${D}${bindir}/qtdemo ${D}${bindir}/qtdemo${QT_LIBINFIX} | ||
372 | fi | ||
373 | |||
374 | script="${D}/${datadir}/${QT_DIR_NAME}/environment-setup" | ||
375 | touch $script | ||
376 | echo 'export QT_DIR_NAME=${QT_DIR_NAME}' >> $script | ||
377 | echo 'export QT_LIBINFIX=${QT_LIBINFIX}' >> $script | ||
378 | echo 'export OE_QMAKE_AR=ar' >> $script | ||
379 | echo 'export OE_QMAKE_CC=gcc' >> $script | ||
380 | echo 'export OE_QMAKE_CXX=g++' >> $script | ||
381 | echo 'export OE_QMAKE_LINK=g++' >> $script | ||
382 | echo 'export OE_QMAKE_LIBDIR_QT=${libdir}' >> $script | ||
383 | echo 'export OE_QMAKE_INCDIR_QT=${includedir}/${QT_DIR_NAME}' >> $script | ||
384 | echo 'export OE_QMAKE_MOC=${bindir}/moc' >> $script | ||
385 | echo 'export OE_QMAKE_UIC=${bindir}/uic' >> $script | ||
386 | echo 'export OE_QMAKE_UIC3=${bindir}/uic3' >> $script | ||
387 | echo 'export OE_QMAKE_RCC=${bindir}/rcc' >> $script | ||
388 | echo 'export OE_QMAKE_QDBUSCPP2XML=${bindir}/qdbuscpp2xml' >> $script | ||
389 | echo 'export OE_QMAKE_QDBUSXML2CPP=${bindir}/qdbusxml2cpp' >> $script | ||
390 | echo 'export OE_QMAKE_QT_CONFIG=${datadir}/${QT_DIR_NAME}/mkspecs/qconfig.pri' >> $script | ||
391 | echo 'export QMAKESPEC=${datadir}/${QT_DIR_NAME}/mkspecs/linux-g++' >> $script | ||
392 | chmod 0755 $script | ||
393 | } | ||
diff --git a/meta/recipes-qt/qt4/qt4_arch.inc b/meta/recipes-qt/qt4/qt4_arch.inc new file mode 100644 index 0000000000..c1d35ab726 --- /dev/null +++ b/meta/recipes-qt/qt4/qt4_arch.inc | |||
@@ -0,0 +1,21 @@ | |||
1 | inherit siteinfo | ||
2 | |||
3 | ARM_INSTRUCTION_SET = "arm" | ||
4 | |||
5 | set_arch() { | ||
6 | case ${TARGET_ARCH} in | ||
7 | arm*) QT_ARCH=arm ;; | ||
8 | i*86*) QT_ARCH=i386 ;; | ||
9 | mips*) QT_ARCH=mips ;; | ||
10 | powerpc*) QT_ARCH=powerpc ;; | ||
11 | x86_64*) QT_ARCH=x86_64 ;; | ||
12 | esac | ||
13 | } | ||
14 | |||
15 | set_endian() { | ||
16 | if [ ${SITEINFO_ENDIANNESS} = "le" ] ; then | ||
17 | QT_ENDIAN="-little-endian" | ||
18 | elif [ ${SITEINFO_ENDIANNESS} = "be" ] ; then | ||
19 | QT_ENDIAN="-big-endian" | ||
20 | fi | ||
21 | } | ||