diff options
author | con <qtc-committer@nokia.com> | 2010-10-18 07:49:18 (GMT) |
---|---|---|
committer | con <qtc-committer@nokia.com> | 2011-03-10 13:23:12 (GMT) |
commit | e250660cced1f0bcb16494c23277f9205833ec03 (patch) | |
tree | ba5b42f7eaab9b3dad6e42106461a2314f96044b /src | |
parent | c84d09e1c5dd8fc3e989a07372abba8ed589ec67 (diff) | |
download | Qt-e250660cced1f0bcb16494c23277f9205833ec03.zip Qt-e250660cced1f0bcb16494c23277f9205833ec03.tar.gz Qt-e250660cced1f0bcb16494c23277f9205833ec03.tar.bz2 |
Add proof-of-concept UIKit based lighthouse platform.
See the README in the uikit platform plugin for details.
Diffstat (limited to 'src')
21 files changed, 2082 insertions, 0 deletions
diff --git a/src/plugins/platforms/uikit/README b/src/plugins/platforms/uikit/README new file mode 100644 index 0000000..19ec83f --- /dev/null +++ b/src/plugins/platforms/uikit/README @@ -0,0 +1,45 @@ +This is a proof-of-concept implemenation of a UIKit based +QPA plugin. Note that this is completely unsupported, and it is probable +that many parts of QtCore and other Qt Modules don't work properly. + +1) Build Qt + +The example Xcode project in the examples subdirectory requires that you do shadow +builds of Qt in qt-lighthouse-ios-simulator and qt-lighthouse-ios-device directories +parallel to the sources. To build for simulator make sure that both the Simulator +configuration *and* the simulator specific target are active. To build for device +make sure that both the Device configuration *and* the device specific target are +active. + +The setup is configured to use the iOS 4.2 SDKs, you might want to edit the mkspecs +to fit your need. + +After configuring and building Qt you need to also build src/plugins/platforms/uikit. + +Simulator: +---------- +configure -qpa -xplatform qws/macx-iphonesimulator-g++ -arch i386 -developer-build -no-accessibility -no-qt3support -no-xmlpatterns -no-multimedia -no-phonon -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -no-opengl -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations + +Device: +------- +configure -qpa -xplatform qws/macx-iphonedevice-g++ -arch armv7 -developer-build -no-accessibility -no-qt3support -no-xmlpatterns -no-multimedia -no-phonon -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -no-opengl -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations + +2) XCode setup: +- there are examples in the examples subdirectory of the platform plugin +- to create something fresh do something like: + - Xcode: Create a "View-based Appplication" + - remove the nibs and view controller and app controller files + - remove the reference to "Main nib file" from plist file + - create a main.mm like in the examples + - add the qmlapplicationviewer sources to your project (including the moc_*.h) + (best to link, not copy), the code for this is from the Qt Creator + mobile Qt Quick application template + - Add the Qt .a libraries, uikit platform plugin and libz (v1.2.3) to Frameworks + - add "$(SRCROOT)/../../../../qt-lighthouse-ios-device/include" (or -simulator) + to the include search paths. + - add "$(SRCROOT)/../qmltest" to the include search path if you didn't copy but + linked to the qmlapplicationviewer + - for device set the architecture to armv7 only + +3) Done: Build and Run. + diff --git a/src/plugins/platforms/uikit/examples/qmltest/main.mm b/src/plugins/platforms/uikit/examples/qmltest/main.mm new file mode 100644 index 0000000..d90be56 --- /dev/null +++ b/src/plugins/platforms/uikit/examples/qmltest/main.mm @@ -0,0 +1,33 @@ +// +// main.m +// qmltest +// +// Created by Eike Troll on 18.02.11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import <UIKit/UIKit.h> + +#include "qmlapplicationviewer/qmlapplicationviewer.h" + +#include <QtGui/QApplication> +#include <QtCore/QtPlugin> + +Q_IMPORT_PLUGIN(UIKit) + +int main(int argc, char *argv[]) { + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + setenv("QT_QPA_PLATFORM","uikit",1); + + QApplication app(argc, argv); + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + NSString *resourcePath = [[NSBundle mainBundle] resourcePath]; + viewer.setMainQmlFile(QString::fromUtf8([[resourcePath stringByAppendingPathComponent:@"qml/main.qml"] UTF8String])); + viewer.showMaximized(); + int retVal = app.exec(); + [pool release]; + return retVal; +} diff --git a/src/plugins/platforms/uikit/examples/qmltest/qml/main.qml b/src/plugins/platforms/uikit/examples/qmltest/qml/main.qml new file mode 100644 index 0000000..889a6d0 --- /dev/null +++ b/src/plugins/platforms/uikit/examples/qmltest/qml/main.qml @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id: box + width: 350; height: 250 + + Rectangle { + id: redSquare + width: 80; height: 80 + anchors.top: parent.top; anchors.left: parent.left; anchors.margins: 10 + color: "red" + + Text { text: "Click"; font.pixelSize: 16; anchors.centerIn: parent } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton + + onEntered: info.text = 'Entered' + onExited: info.text = 'Exited (pressed=' + pressed + ')' + + onPressed: { + info.text = 'Pressed (button=' + (mouse.button == Qt.RightButton ? 'right' : 'left') + + ' shift=' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')' + var posInBox = redSquare.mapToItem(box, mouse.x, mouse.y) + posInfo.text = + mouse.x + ',' + mouse.y + ' in square' + + ' (' + posInBox.x + ',' + posInBox.y + ' in window)' + } + + onReleased: { + info.text = 'Released (isClick=' + mouse.isClick + ' wasHeld=' + mouse.wasHeld + ')' + posInfo.text = '' + } + + onPressAndHold: info.text = 'Press and hold' + onClicked: info.text = 'Clicked (wasHeld=' + mouse.wasHeld + ')' + onDoubleClicked: info.text = 'Double clicked' + } + } + + Rectangle { + id: blueSquare + width: 80; height: 80 + x: box.width - width - 10; y: 10 // making this item draggable, so don't use anchors + color: "blue" + + Text { text: "Drag"; font.pixelSize: 16; color: "white"; anchors.centerIn: parent } + + MouseArea { + anchors.fill: parent + drag.target: blueSquare + drag.axis: Drag.XandYAxis + drag.minimumX: 0 + drag.maximumX: box.width - parent.width + drag.minimumY: 0 + drag.maximumY: box.height - parent.width + } + } + + Text { + id: info + anchors.bottom: posInfo.top; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30 + + onTextChanged: console.log(text) + } + + Text { + id: posInfo + anchors.bottom: parent.bottom; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30 + } +} diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/moc_qmlapplicationviewer.cpp b/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/moc_qmlapplicationviewer.cpp new file mode 100644 index 0000000..7733ce2 --- /dev/null +++ b/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/moc_qmlapplicationviewer.cpp @@ -0,0 +1,69 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'qmlapplicationviewer.h' +** +** Created: Fri Feb 18 17:53:42 2011 +** by: The Qt Meta Object Compiler version 62 (Qt 4.7.2) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "qmlapplicationviewer.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'qmlapplicationviewer.h' doesn't include <QObject>." +#elif Q_MOC_OUTPUT_REVISION != 62 +#error "This file was generated using the moc from 4.7.2. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_QmlApplicationViewer[] = { + + // content: + 5, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +static const char qt_meta_stringdata_QmlApplicationViewer[] = { + "QmlApplicationViewer\0" +}; + +const QMetaObject QmlApplicationViewer::staticMetaObject = { + { &QDeclarativeView::staticMetaObject, qt_meta_stringdata_QmlApplicationViewer, + qt_meta_data_QmlApplicationViewer, 0 } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &QmlApplicationViewer::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *QmlApplicationViewer::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *QmlApplicationViewer::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QmlApplicationViewer)) + return static_cast<void*>(const_cast< QmlApplicationViewer*>(this)); + return QDeclarativeView::qt_metacast(_clname); +} + +int QmlApplicationViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDeclarativeView::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.cpp b/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..7844e46 --- /dev/null +++ b/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,155 @@ +// checksum 0x17fa version 0x3000a +/* + This file was generated by the Qt Quick Application wizard of Qt Creator. + QmlApplicationViewer is a convenience class containing mobile device specific + code such as screen orientation handling. Also QML paths and debugging are + handled here. + It is recommended not to modify this file, since newer versions of Qt Creator + may offer an updated version of it. +*/ + +#include "qmlapplicationviewer.h" + +#include <QtCore/QCoreApplication> +#include <QtCore/QDir> +#include <QtCore/QFileInfo> +#include <QtDeclarative/QDeclarativeComponent> +#include <QtDeclarative/QDeclarativeEngine> +#include <QtDeclarative/QDeclarativeContext> + +#if defined(QMLJSDEBUGGER) +#include <qt_private/qdeclarativedebughelper_p.h> +#endif + +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#include <jsdebuggeragent.h> +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#include <qdeclarativeviewobserver.h> +#endif + +#if defined(QMLJSDEBUGGER) + +// Enable debugging before any QDeclarativeEngine is created +struct QmlJsDebuggingEnabler +{ + QmlJsDebuggingEnabler() + { + QDeclarativeDebugHelper::enableDebugging(); + } +}; + +// Execute code in constructor before first QDeclarativeEngine is instantiated +static QmlJsDebuggingEnabler enableDebuggingHelper; + +#endif // QMLJSDEBUGGER + +class QmlApplicationViewerPrivate +{ + QString mainQmlFile; + friend class QmlApplicationViewer; + static QString adjustPath(const QString &path); +}; + +QString QmlApplicationViewerPrivate::adjustPath(const QString &path) +{ +#ifdef Q_OS_UNIX +#ifdef Q_OS_MAC + if (!QDir::isAbsolutePath(path)) + return QCoreApplication::applicationDirPath() + + QLatin1String("/../Resources/") + path; +#else + const QString pathInShareDir = QCoreApplication::applicationDirPath() + + QLatin1String("/../share/") + + QFileInfo(QCoreApplication::applicationFilePath()).fileName() + + QLatin1Char('/') + path; + if (QFileInfo(pathInShareDir).exists()) + return pathInShareDir; +#endif +#endif + return path; +} + +QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : + QDeclarativeView(parent), + m_d(new QmlApplicationViewerPrivate) +{ + connect(engine(), SIGNAL(quit()), SLOT(close())); + setResizeMode(QDeclarativeView::SizeRootObjectToView); +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) + new QmlJSDebugger::QDeclarativeViewObserver(this, parent); +#endif +} + +QmlApplicationViewer::~QmlApplicationViewer() +{ + delete m_d; +} + +void QmlApplicationViewer::setMainQmlFile(const QString &file) +{ + m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file); + setSource(QUrl::fromLocalFile(m_d->mainQmlFile)); +} + +void QmlApplicationViewer::addImportPath(const QString &path) +{ + engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path)); +} + +void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) +{ +//#if defined(Q_OS_SYMBIAN) +// // If the version of Qt on the device is < 4.7.2, that attribute won't work +// if (orientation != ScreenOrientationAuto) { +// const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); +// if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { +// qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); +// return; +// } +// } +//#endif // Q_OS_SYMBIAN +// +// Qt::WidgetAttribute attribute; +// switch (orientation) { +//#if QT_VERSION < 0x040702 +// // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes +// case ScreenOrientationLockPortrait: +// attribute = static_cast<Qt::WidgetAttribute>(128); +// break; +// case ScreenOrientationLockLandscape: +// attribute = static_cast<Qt::WidgetAttribute>(129); +// break; +// default: +// case ScreenOrientationAuto: +// attribute = static_cast<Qt::WidgetAttribute>(130); +// break; +//#else // QT_VERSION < 0x040702 +// case ScreenOrientationLockPortrait: +// attribute = Qt::WA_LockPortraitOrientation; +// break; +// case ScreenOrientationLockLandscape: +// attribute = Qt::WA_LockLandscapeOrientation; +// break; +// default: +// case ScreenOrientationAuto: +// attribute = Qt::WA_AutoOrientation; +// break; +//#endif // QT_VERSION < 0x040702 +// }; +// setAttribute(attribute, true); +} + +void QmlApplicationViewer::showExpanded() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + show(); +#endif +} diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.h b/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..0e4de04 --- /dev/null +++ b/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,39 @@ +// checksum 0x5a59 version 0x3000a +/* + This file was generated by the Qt Quick Application wizard of Qt Creator. + QmlApplicationViewer is a convenience class containing mobile device specific + code such as screen orientation handling. Also QML paths and debugging are + handled here. + It is recommended not to modify this file, since newer versions of Qt Creator + may offer an updated version of it. +*/ + +#ifndef QMLAPPLICATIONVIEWER_H +#define QMLAPPLICATIONVIEWER_H + +#include <QtDeclarative/QDeclarativeView> + +class QmlApplicationViewer : public QDeclarativeView +{ + Q_OBJECT + +public: + enum ScreenOrientation { + ScreenOrientationLockPortrait, + ScreenOrientationLockLandscape, + ScreenOrientationAuto + }; + + explicit QmlApplicationViewer(QWidget *parent = 0); + virtual ~QmlApplicationViewer(); + + void setMainQmlFile(const QString &file); + void addImportPath(const QString &path); + void setOrientation(ScreenOrientation orientation); + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmltest-Info.plist b/src/plugins/platforms/uikit/examples/qmltest/qmltest-Info.plist new file mode 100644 index 0000000..1566585 --- /dev/null +++ b/src/plugins/platforms/uikit/examples/qmltest/qmltest-Info.plist @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleDisplayName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIconFile</key> + <string></string> + <key>CFBundleIdentifier</key> + <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1.0</string> + <key>LSRequiresIPhoneOS</key> + <true/> +</dict> +</plist> diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj b/src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj new file mode 100755 index 0000000..e105b73 --- /dev/null +++ b/src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj @@ -0,0 +1,455 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; + D3CAA7C813264AAD008BB877 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7C713264AAD008BB877 /* main.mm */; }; + D3CAA7E613264EA6008BB877 /* moc_qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7E313264EA6008BB877 /* moc_qmlapplicationviewer.cpp */; }; + D3CAA7E713264EA6008BB877 /* qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7E413264EA6008BB877 /* qmlapplicationviewer.cpp */; }; + D3CAA7EC13264F52008BB877 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7C713264AAD008BB877 /* main.mm */; }; + D3CAA7ED13264F52008BB877 /* moc_qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7E313264EA6008BB877 /* moc_qmlapplicationviewer.cpp */; }; + D3CAA7EE13264F52008BB877 /* qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7E413264EA6008BB877 /* qmlapplicationviewer.cpp */; }; + D3CAA7F013264F52008BB877 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + D3CAA7F113264F52008BB877 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + D3CAA7F213264F52008BB877 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; + D3CAA7FA13264F8A008BB877 /* libz.1.2.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA7F913264F8A008BB877 /* libz.1.2.3.dylib */; }; + D3CAA80613264FD5008BB877 /* libQtCore_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA7FB13264FB9008BB877 /* libQtCore_debug.a */; }; + D3CAA80713264FD5008BB877 /* libQtDeclarative_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA7FC13264FB9008BB877 /* libQtDeclarative_debug.a */; }; + D3CAA80813264FD6008BB877 /* libQtGui_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA7FD13264FB9008BB877 /* libQtGui_debug.a */; }; + D3CAA80913264FD6008BB877 /* libQtScript_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA7FE13264FB9008BB877 /* libQtScript_debug.a */; }; + D3CAA80A13264FD7008BB877 /* libQtSql_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA7FF13264FB9008BB877 /* libQtSql_debug.a */; }; + D3CAA81113264FF0008BB877 /* libz.1.2.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA7F913264F8A008BB877 /* libz.1.2.3.dylib */; }; + D3CAA81313265005008BB877 /* libquikit_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA81213265005008BB877 /* libquikit_debug.a */; }; + D3CAA81B13265056008BB877 /* libQtCore_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA81613265056008BB877 /* libQtCore_debug.a */; }; + D3CAA81C13265056008BB877 /* libQtDeclarative_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA81713265056008BB877 /* libQtDeclarative_debug.a */; }; + D3CAA81D13265056008BB877 /* libQtGui_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA81813265056008BB877 /* libQtGui_debug.a */; }; + D3CAA81E13265056008BB877 /* libQtScript_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA81913265056008BB877 /* libQtScript_debug.a */; }; + D3CAA81F13265056008BB877 /* libQtSql_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA81A13265056008BB877 /* libQtSql_debug.a */; }; + D3CAA8211326507D008BB877 /* libquikit_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA8201326507D008BB877 /* libquikit_debug.a */; }; + D3CAA8261326520A008BB877 /* libQtNetwork_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA8251326520A008BB877 /* libQtNetwork_debug.a */; }; + D3CAA82813265220008BB877 /* libQtNetwork_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA82713265220008BB877 /* libQtNetwork_debug.a */; }; + D3CAA88A132652E5008BB877 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = D3CAA836132652E5008BB877 /* fonts */; }; + D3CAA88B132652E5008BB877 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = D3CAA836132652E5008BB877 /* fonts */; }; + D3CAA89113265310008BB877 /* qml in Resources */ = {isa = PBXBuildFile; fileRef = D3CAA88E13265310008BB877 /* qml */; }; + D3CAA89213265310008BB877 /* qml in Resources */ = {isa = PBXBuildFile; fileRef = D3CAA88E13265310008BB877 /* qml */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D6058910D05DD3D006BFB54 /* qmltest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = qmltest.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 32CA4F630368D1EE00C91783 /* qmltest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qmltest_Prefix.pch; sourceTree = "<group>"; }; + 8D1107310486CEB800E47090 /* qmltest-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "qmltest-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; }; + D3CAA7C713264AAD008BB877 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; }; + D3CAA7E313264EA6008BB877 /* moc_qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_qmlapplicationviewer.cpp; path = qmlapplicationviewer/moc_qmlapplicationviewer.cpp; sourceTree = "<group>"; }; + D3CAA7E413264EA6008BB877 /* qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qmlapplicationviewer.cpp; path = qmlapplicationviewer/qmlapplicationviewer.cpp; sourceTree = "<group>"; }; + D3CAA7E513264EA6008BB877 /* qmlapplicationviewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qmlapplicationviewer.h; path = qmlapplicationviewer/qmlapplicationviewer.h; sourceTree = "<group>"; }; + D3CAA7F613264F52008BB877 /* qmltest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = qmltest.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D3CAA7F913264F8A008BB877 /* libz.1.2.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.2.3.dylib; path = usr/lib/libz.1.2.3.dylib; sourceTree = SDKROOT; }; + D3CAA7FB13264FB9008BB877 /* libQtCore_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtCore_debug.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtCore_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA7FC13264FB9008BB877 /* libQtDeclarative_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtDeclarative_debug.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtDeclarative_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA7FD13264FB9008BB877 /* libQtGui_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtGui_debug.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtGui_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA7FE13264FB9008BB877 /* libQtScript_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtScript_debug.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtScript_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA7FF13264FB9008BB877 /* libQtSql_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtSql_debug.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtSql_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA81213265005008BB877 /* libquikit_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libquikit_debug.a; path = "../../../../../../../qt-lighthouse-ios-device/plugins/platforms/libquikit_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA81613265056008BB877 /* libQtCore_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtCore_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtCore_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA81713265056008BB877 /* libQtDeclarative_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtDeclarative_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtDeclarative_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA81813265056008BB877 /* libQtGui_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtGui_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtGui_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA81913265056008BB877 /* libQtScript_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtScript_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtScript_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA81A13265056008BB877 /* libQtSql_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtSql_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtSql_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA8201326507D008BB877 /* libquikit_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libquikit_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/plugins/platforms/libquikit_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA8251326520A008BB877 /* libQtNetwork_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtNetwork_debug.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtNetwork_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA82713265220008BB877 /* libQtNetwork_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtNetwork_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtNetwork_debug.a"; sourceTree = SOURCE_ROOT; }; + D3CAA836132652E5008BB877 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = fonts; path = ../../../../../../lib/fonts; sourceTree = SOURCE_ROOT; }; + D3CAA88E13265310008BB877 /* qml */ = {isa = PBXFileReference; lastKnownFileType = folder; path = qml; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, + D3CAA7FA13264F8A008BB877 /* libz.1.2.3.dylib in Frameworks */, + D3CAA81B13265056008BB877 /* libQtCore_debug.a in Frameworks */, + D3CAA81C13265056008BB877 /* libQtDeclarative_debug.a in Frameworks */, + D3CAA81D13265056008BB877 /* libQtGui_debug.a in Frameworks */, + D3CAA81E13265056008BB877 /* libQtScript_debug.a in Frameworks */, + D3CAA81F13265056008BB877 /* libQtSql_debug.a in Frameworks */, + D3CAA8211326507D008BB877 /* libquikit_debug.a in Frameworks */, + D3CAA82813265220008BB877 /* libQtNetwork_debug.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D3CAA7EF13264F52008BB877 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D3CAA7F013264F52008BB877 /* Foundation.framework in Frameworks */, + D3CAA7F113264F52008BB877 /* UIKit.framework in Frameworks */, + D3CAA7F213264F52008BB877 /* CoreGraphics.framework in Frameworks */, + D3CAA80613264FD5008BB877 /* libQtCore_debug.a in Frameworks */, + D3CAA80713264FD5008BB877 /* libQtDeclarative_debug.a in Frameworks */, + D3CAA80813264FD6008BB877 /* libQtGui_debug.a in Frameworks */, + D3CAA80913264FD6008BB877 /* libQtScript_debug.a in Frameworks */, + D3CAA80A13264FD7008BB877 /* libQtSql_debug.a in Frameworks */, + D3CAA81113264FF0008BB877 /* libz.1.2.3.dylib in Frameworks */, + D3CAA81313265005008BB877 /* libquikit_debug.a in Frameworks */, + D3CAA8261326520A008BB877 /* libQtNetwork_debug.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* qmltest.app */, + D3CAA7F613264F52008BB877 /* qmltest.app */, + ); + name = Products; + sourceTree = "<group>"; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + D3CAA7E213264E8C008BB877 /* QMLApplicationViewer */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = "<group>"; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* qmltest_Prefix.pch */, + D3CAA7C713264AAD008BB877 /* main.mm */, + ); + name = "Other Sources"; + sourceTree = "<group>"; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + D3CAA88E13265310008BB877 /* qml */, + D3CAA836132652E5008BB877 /* fonts */, + 8D1107310486CEB800E47090 /* qmltest-Info.plist */, + ); + name = Resources; + sourceTree = "<group>"; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + D3CAA81513265035008BB877 /* Simulator */, + D3CAA8141326500A008BB877 /* Device */, + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + 288765A40DF7441C002DB57D /* CoreGraphics.framework */, + D3CAA7F913264F8A008BB877 /* libz.1.2.3.dylib */, + ); + name = Frameworks; + sourceTree = "<group>"; + }; + D3CAA7E213264E8C008BB877 /* QMLApplicationViewer */ = { + isa = PBXGroup; + children = ( + D3CAA7E313264EA6008BB877 /* moc_qmlapplicationviewer.cpp */, + D3CAA7E413264EA6008BB877 /* qmlapplicationviewer.cpp */, + D3CAA7E513264EA6008BB877 /* qmlapplicationviewer.h */, + ); + name = QMLApplicationViewer; + sourceTree = "<group>"; + }; + D3CAA8141326500A008BB877 /* Device */ = { + isa = PBXGroup; + children = ( + D3CAA81213265005008BB877 /* libquikit_debug.a */, + D3CAA7FB13264FB9008BB877 /* libQtCore_debug.a */, + D3CAA7FC13264FB9008BB877 /* libQtDeclarative_debug.a */, + D3CAA7FD13264FB9008BB877 /* libQtGui_debug.a */, + D3CAA8251326520A008BB877 /* libQtNetwork_debug.a */, + D3CAA7FE13264FB9008BB877 /* libQtScript_debug.a */, + D3CAA7FF13264FB9008BB877 /* libQtSql_debug.a */, + ); + name = Device; + sourceTree = "<group>"; + }; + D3CAA81513265035008BB877 /* Simulator */ = { + isa = PBXGroup; + children = ( + D3CAA8201326507D008BB877 /* libquikit_debug.a */, + D3CAA81613265056008BB877 /* libQtCore_debug.a */, + D3CAA81713265056008BB877 /* libQtDeclarative_debug.a */, + D3CAA81813265056008BB877 /* libQtGui_debug.a */, + D3CAA82713265220008BB877 /* libQtNetwork_debug.a */, + D3CAA81913265056008BB877 /* libQtScript_debug.a */, + D3CAA81A13265056008BB877 /* libQtSql_debug.a */, + ); + name = Simulator; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* qmltest simulator */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "qmltest simulator" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "qmltest simulator"; + productName = qmltest; + productReference = 1D6058910D05DD3D006BFB54 /* qmltest.app */; + productType = "com.apple.product-type.application"; + }; + D3CAA7E813264F52008BB877 /* qmltest device */ = { + isa = PBXNativeTarget; + buildConfigurationList = D3CAA7F313264F52008BB877 /* Build configuration list for PBXNativeTarget "qmltest device" */; + buildPhases = ( + D3CAA7E913264F52008BB877 /* Resources */, + D3CAA7EB13264F52008BB877 /* Sources */, + D3CAA7EF13264F52008BB877 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "qmltest device"; + productName = qmltest; + productReference = D3CAA7F613264F52008BB877 /* qmltest.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "qmltest" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* qmltest simulator */, + D3CAA7E813264F52008BB877 /* qmltest device */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D3CAA88A132652E5008BB877 /* fonts in Resources */, + D3CAA89113265310008BB877 /* qml in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D3CAA7E913264F52008BB877 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D3CAA88B132652E5008BB877 /* fonts in Resources */, + D3CAA89213265310008BB877 /* qml in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D3CAA7C813264AAD008BB877 /* main.mm in Sources */, + D3CAA7E613264EA6008BB877 /* moc_qmlapplicationviewer.cpp in Sources */, + D3CAA7E713264EA6008BB877 /* qmlapplicationviewer.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D3CAA7EB13264F52008BB877 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D3CAA7EC13264F52008BB877 /* main.mm in Sources */, + D3CAA7ED13264F52008BB877 /* moc_qmlapplicationviewer.cpp in Sources */, + D3CAA7EE13264F52008BB877 /* qmlapplicationviewer.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = qmltest_Prefix.pch; + HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/include\"/**"; + INFOPLIST_FILE = "qmltest-Info.plist"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/lib\"", + "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/plugins/platforms\"", + ); + PRODUCT_NAME = qmltest; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = qmltest_Prefix.pch; + HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/include\"/**"; + INFOPLIST_FILE = "qmltest-Info.plist"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/lib\"", + "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/plugins/platforms\"", + ); + PRODUCT_NAME = qmltest; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = iphoneos; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + PREBINDING = NO; + SDKROOT = iphoneos; + }; + name = Release; + }; + D3CAA7F413264F52008BB877 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = qmltest_Prefix.pch; + HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/include\"/**"; + INFOPLIST_FILE = "qmltest-Info.plist"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/lib\"", + "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/plugins/platforms\"", + ); + PRODUCT_NAME = qmltest; + }; + name = Debug; + }; + D3CAA7F513264F52008BB877 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = qmltest_Prefix.pch; + HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/include\"/**"; + INFOPLIST_FILE = "qmltest-Info.plist"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/lib\"", + "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/plugins/platforms\"", + ); + PRODUCT_NAME = qmltest; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "qmltest simulator" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "qmltest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D3CAA7F313264F52008BB877 /* Build configuration list for PBXNativeTarget "qmltest device" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D3CAA7F413264F52008BB877 /* Debug */, + D3CAA7F513264F52008BB877 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmltest_Prefix.pch b/src/plugins/platforms/uikit/examples/qmltest/qmltest_Prefix.pch new file mode 100644 index 0000000..c06715c --- /dev/null +++ b/src/plugins/platforms/uikit/examples/qmltest/qmltest_Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'qmltest' target in the 'qmltest' project +// + +#ifdef __OBJC__ + #import <Foundation/Foundation.h> + #import <UIKit/UIKit.h> +#endif diff --git a/src/plugins/platforms/uikit/main.mm b/src/plugins/platforms/uikit/main.mm new file mode 100644 index 0000000..05e0d02 --- /dev/null +++ b/src/plugins/platforms/uikit/main.mm @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <UIKit/UIKit.h> + +#include <QtGui/QPlatformIntegrationPlugin> +#include "quikitintegration.h" + +QT_BEGIN_NAMESPACE + +class QUIKitIntegrationPlugin : public QPlatformIntegrationPlugin +{ +public: + QStringList keys() const; + QPlatformIntegration *create(const QString&, const QStringList&); +}; + +QStringList QUIKitIntegrationPlugin::keys() const +{ + QStringList list; + list << "UIKit"; + return list; +} + +QPlatformIntegration * QUIKitIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "uikit") + return new QUIKitIntegration; + + return 0; +} + +Q_EXPORT_PLUGIN2(UIKit, QUIKitIntegrationPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/uikit/quikiteventloop.h b/src/plugins/platforms/uikit/quikiteventloop.h new file mode 100644 index 0000000..5c18999 --- /dev/null +++ b/src/plugins/platforms/uikit/quikiteventloop.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QUIKITEVENTLOOP_H +#define QUIKITEVENTLOOP_H + +#include <QtGui/QPlatformEventLoopIntegration> + +@class EventLoopHelper; +@class NSTimer; + +QT_BEGIN_NAMESPACE + +class QUIKitEventLoop : public QPlatformEventLoopIntegration +{ +public: + QUIKitEventLoop(); + ~QUIKitEventLoop(); + + void startEventLoop(); + void quitEventLoop(); + void qtNeedsToProcessEvents(); + + EventLoopHelper *mHelper; + NSTimer *mTimer; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/uikit/quikiteventloop.mm b/src/plugins/platforms/uikit/quikiteventloop.mm new file mode 100644 index 0000000..4469ae9 --- /dev/null +++ b/src/plugins/platforms/uikit/quikiteventloop.mm @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "quikiteventloop.h" +#include "quikitwindow.h" +#include "quikitwindowsurface.h" + +#include <UIKit/UIKit.h> + +#include <QtGui/QApplication> +#include <QtGui/QWidget> +#include <QtDebug> + +@interface QUIKitAppDelegate : NSObject <UIApplicationDelegate> { +} +@end + +@interface EventLoopHelper : NSObject { + QUIKitEventLoop *mIntegration; +} + +- (id)initWithEventLoopIntegration:(QUIKitEventLoop *)integration; + +- (void)processEvents; +- (void)processEventsAndSchedule; + +@end + +@implementation QUIKitAppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + foreach (QWidget *widget, qApp->topLevelWidgets()) { + QRect geom = widget->geometry(); + CGRect bar = [UIApplication sharedApplication].statusBarFrame; + if (geom.y() <= bar.size.height) { + geom.setY(bar.size.height); + widget->setGeometry(geom); + } + QUIKitWindow *platformWindow = static_cast<QUIKitWindow *>(widget->platformWindow()); + platformWindow->ensureNativeWindow(); + QUIKitWindowSurface *surface = static_cast<QUIKitWindowSurface*>(widget->windowSurface()); + UIView *view = surface->nativeView(); + [platformWindow->nativeWindow() addSubview:view]; + [platformWindow->nativeWindow() makeKeyAndVisible]; + } + return YES; +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // TODO this isn't called for some reason + qDebug() << "quit"; + qApp->quit(); +} + +@end + +@implementation EventLoopHelper + +- (id)initWithEventLoopIntegration:(QUIKitEventLoop *)integration +{ + if (self = [self init]) { + mIntegration = integration; + } + return self; +} + +- (void)processEvents +{ + QPlatformEventLoopIntegration::processEvents(); +} + +- (void)processEventsAndSchedule +{ + QPlatformEventLoopIntegration::processEvents(); + qint64 nextTime = mIntegration->nextTimerEvent(); + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + NSDate *nextDate = [[NSDate date] dateByAddingTimeInterval:((double)nextTime/1000)]; + [mIntegration->mTimer setFireDate:nextDate]; + [pool release]; +} + +@end + +QT_BEGIN_NAMESPACE + +QUIKitEventLoop::QUIKitEventLoop() +{ + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + mHelper = [[EventLoopHelper alloc] initWithEventLoopIntegration:this]; + mTimer = [[NSTimer timerWithTimeInterval:0.030 target:mHelper selector:@selector(processEventsAndSchedule) userInfo:nil repeats:YES] retain]; + [pool release]; +} + +QUIKitEventLoop::~QUIKitEventLoop() +{ + [mTimer release]; + [mHelper release]; +} + +void QUIKitEventLoop::startEventLoop() +{ + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + [[NSRunLoop currentRunLoop] addTimer:[mTimer autorelease] forMode:NSDefaultRunLoopMode]; + UIApplicationMain(qApp->argc(), qApp->argv(), nil, @"QUIKitAppDelegate"); + [pool release]; +} + +void QUIKitEventLoop::quitEventLoop() +{ + +} + +void QUIKitEventLoop::qtNeedsToProcessEvents() +{ + [mHelper performSelectorOnMainThread:@selector(processEvents) withObject:nil waitUntilDone:NO]; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/uikit/quikitintegration.h b/src/plugins/platforms/uikit/quikitintegration.h new file mode 100644 index 0000000..e448881 --- /dev/null +++ b/src/plugins/platforms/uikit/quikitintegration.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMINTEGRATION_UIKIT_H +#define QPLATFORMINTEGRATION_UIKIT_H + +#include <QtGui/QPlatformIntegration> + +QT_BEGIN_NAMESPACE + +class QUIKitIntegration : public QPlatformIntegration +{ +public: + QUIKitIntegration(); + ~QUIKitIntegration(); + + QPixmapData *createPixmapData(QPixmapData::PixelType type) const; + QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId = 0) const; + QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const; + + QList<QPlatformScreen *> screens() const; + + QPlatformFontDatabase *fontDatabase() const; + + QPlatformEventLoopIntegration *createEventLoopIntegration() const; + +private: + QList<QPlatformScreen *> mScreens; +}; + +QT_END_NAMESPACE + +#endif + diff --git a/src/plugins/platforms/uikit/quikitintegration.mm b/src/plugins/platforms/uikit/quikitintegration.mm new file mode 100644 index 0000000..f1fc402 --- /dev/null +++ b/src/plugins/platforms/uikit/quikitintegration.mm @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "quikitintegration.h" +#include "quikitwindow.h" +#include "quikitwindowsurface.h" +#include "quikitscreen.h" +#include "quikiteventloop.h" + +#include <QtGui/QApplication> + +#include <private/qpixmap_raster_p.h> + +#include <UIKit/UIKit.h> + +#include <QtDebug> + +QT_BEGIN_NAMESPACE + +QUIKitIntegration::QUIKitIntegration() +{ + mScreens << new QUIKitScreen(0); +} + +QUIKitIntegration::~QUIKitIntegration() +{ +} + +QPixmapData *QUIKitIntegration::createPixmapData(QPixmapData::PixelType type) const +{ + return new QRasterPixmapData(type); +} + +QPlatformWindow *QUIKitIntegration::createPlatformWindow(QWidget *widget, WId winId) const +{ + Q_UNUSED(winId); + return new QUIKitWindow(widget); +} + +QList<QPlatformScreen *> QUIKitIntegration::screens() const +{ + return mScreens; +} + +QWindowSurface *QUIKitIntegration::createWindowSurface(QWidget *widget, WId winId) const +{ + Q_UNUSED(winId); + return new QUIKitWindowSurface(widget); +} + +QPlatformEventLoopIntegration *QUIKitIntegration::createEventLoopIntegration() const +{ + return new QUIKitEventLoop(); +} + +QPlatformFontDatabase * QUIKitIntegration::fontDatabase() const +{ + static bool initialized = false; + if (!initialized) { + initialized = true; + setenv("QT_QPA_FONTDIR",[[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"fonts"] UTF8String],1); + } + return QPlatformIntegration::fontDatabase(); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/uikit/quikitscreen.h b/src/plugins/platforms/uikit/quikitscreen.h new file mode 100644 index 0000000..0253795 --- /dev/null +++ b/src/plugins/platforms/uikit/quikitscreen.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QUIKITSCREEN_H +#define QUIKITSCREEN_H + +#include <UIKit/UIKit.h> + +#include <QtGui/QPlatformScreen> + +QT_BEGIN_NAMESPACE + +class QUIKitScreen : public QPlatformScreen +{ +public: + QUIKitScreen(int screenIndex); + ~QUIKitScreen(); + + QRect geometry() const { return m_geometry; } + int depth() const { return m_depth; } + QImage::Format format() const { return m_format; } + QSize physicalSize() const { return m_physicalSize; } + + UIScreen *uiScreen() const; + +private: + QRect m_geometry; + int m_depth; + QImage::Format m_format; + QSize m_physicalSize; + int m_index; +}; + +QT_END_NAMESPACE + + +#endif diff --git a/src/plugins/platforms/uikit/quikitscreen.mm b/src/plugins/platforms/uikit/quikitscreen.mm new file mode 100644 index 0000000..718ba54 --- /dev/null +++ b/src/plugins/platforms/uikit/quikitscreen.mm @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "quikitscreen.h" + +#include <QtDebug> + +QT_BEGIN_NAMESPACE + +QUIKitScreen::QUIKitScreen(int screenIndex) + : QPlatformScreen(), + m_index(screenIndex) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + UIScreen *screen = [[UIScreen screens] objectAtIndex:screenIndex]; + UIScreenMode *mode = [screen currentMode]; + CGSize size = [mode size]; + m_geometry = QRect(0, 0, size.width, size.height); + CGRect bounds = [screen bounds]; // in 'points', 1p == 1/160in + +// qreal xDpi = size.width * 160. / bounds.size.width; +// qreal yDpi = size.height * 160. / bounds.size.height; +// qDebug() << xDpi << yDpi; + + m_format = QImage::Format_ARGB32; + + m_depth = 24; + + const qreal inch = 25.4; + m_physicalSize = QSize(qRound(bounds.size.width * inch / 160.), qRound(bounds.size.height * inch / 160.)); + [pool release]; +} + +QUIKitScreen::~QUIKitScreen() +{ +} + +UIScreen *QUIKitScreen::uiScreen() const +{ + return [[UIScreen screens] objectAtIndex:m_index]; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/uikit/quikitwindow.h b/src/plugins/platforms/uikit/quikitwindow.h new file mode 100644 index 0000000..8e8c51b --- /dev/null +++ b/src/plugins/platforms/uikit/quikitwindow.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QUIKITWINDOW_H +#define QUIKITWINDOW_H + +#include <QPlatformWindow> +#include <UIKit/UIKit.h> + +QT_BEGIN_NAMESPACE + +class QUIKitScreen; + +class QUIKitWindow : public QPlatformWindow +{ +public: + explicit QUIKitWindow(QWidget *tlw); + ~QUIKitWindow(); + + UIWindow *nativeWindow() const { return mWindow; } + void setGeometry(const QRect &rect); + + UIWindow *ensureNativeWindow(); + +private: + QUIKitScreen *mScreen; + UIWindow *mWindow; +}; + +QT_END_NAMESPACE + +#endif // QUIKITWINDOW_H diff --git a/src/plugins/platforms/uikit/quikitwindow.mm b/src/plugins/platforms/uikit/quikitwindow.mm new file mode 100644 index 0000000..4ac7447 --- /dev/null +++ b/src/plugins/platforms/uikit/quikitwindow.mm @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "quikitwindow.h" + +#include "quikitscreen.h" + +#include <QtDebug> + +QT_BEGIN_NAMESPACE + +QUIKitWindow::QUIKitWindow(QWidget *tlw) : + QPlatformWindow(tlw), + mWindow(nil) +{ + mScreen = static_cast<QUIKitScreen *>(QPlatformScreen::platformScreenForWidget(tlw)); + CGRect screenBounds = [mScreen->uiScreen() bounds]; + QRect geom(screenBounds.origin.x, screenBounds.origin.y, screenBounds.size.width, screenBounds.size.height); + setGeometry(geom); + // TODO ensure the native window if the application is already running +} + +QUIKitWindow::~QUIKitWindow() +{ + [mWindow release]; +} + +void QUIKitWindow::setGeometry(const QRect &rect) +{ + if (mWindow) { + mWindow.frame = CGRectMake(rect.x(), rect.y(), rect.width(), rect.height()); + [mWindow setNeedsDisplay]; + } + QPlatformWindow::setGeometry(rect); +} + +UIWindow *QUIKitWindow::ensureNativeWindow() +{ + if (!mWindow) { + CGRect screenBounds = [mScreen->uiScreen() bounds]; + QRect geom = geometry(); + CGRect frame = CGRectMake(geom.x(), geom.y(), geom.width(), geom.height()); + mWindow = [[UIWindow alloc] initWithFrame:frame]; + mWindow.screen = mScreen->uiScreen(); + mWindow.frame = frame; // for some reason setting the screen resets frame.origin + [mWindow setNeedsDisplay]; + } +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/uikit/quikitwindowsurface.h b/src/plugins/platforms/uikit/quikitwindowsurface.h new file mode 100644 index 0000000..2c22d7f --- /dev/null +++ b/src/plugins/platforms/uikit/quikitwindowsurface.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QUIKITWINDOWSURFACE_H +#define QUIKITWINDOWSURFACE_H + +#include <QtGui/QPlatformIntegration> +#include <QtGui/QImage> +#include <QtGui/QWindowSystemInterface> + +#include <UIKit/UIKit.h> + +@interface QImageView : UIView +{ + CGImageRef m_cgImage; + QWidget *m_widget; +} + +- (void)setImage:(QImage *)image; +- (void)setWidget:(QWidget *)widget; + +//- (QList<struct QWindowSystemInterface::TouchPoint>)touchPointsForTouches:(NSSet *)touches; +- (void)sendMouseEventForTouches:(NSSet *)touches withEvent:(UIEvent *)event fakeButtons:(Qt::MouseButtons)buttons; +@end + +QT_BEGIN_NAMESPACE + +class QUIKitWindowSurface : public QWindowSurface +{ +public: + QUIKitWindowSurface(QWidget *window); + + QPaintDevice *paintDevice(); + void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset); + void resize (const QSize &size); + + QImageView *nativeView() const { return mView; } +private: + QImage *mImage; + QImageView *mView; +}; + +QT_END_NAMESPACE + +#endif // QUIKITWINDOWSURFACE_H diff --git a/src/plugins/platforms/uikit/quikitwindowsurface.mm b/src/plugins/platforms/uikit/quikitwindowsurface.mm new file mode 100644 index 0000000..f21bb77 --- /dev/null +++ b/src/plugins/platforms/uikit/quikitwindowsurface.mm @@ -0,0 +1,242 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "quikitwindowsurface.h" +#include "quikitwindow.h" + +#include <QtDebug> + +@implementation QImageView + +- (void)dealloc +{ + CGImageRelease(m_cgImage); + [super dealloc]; +} + +- (void)setImage:(QImage *)image +{ + CGImageRelease(m_cgImage); + + const uchar *imageData = image->bits(); + int bitDepth = image->depth(); + int colorBufferSize = 8; + int bytesPrLine = image->bytesPerLine(); + int width = image->width(); + int height = image->height(); + + CGColorSpaceRef cgColourSpaceRef = CGColorSpaceCreateDeviceRGB(); + + CGDataProviderRef cgDataProviderRef = CGDataProviderCreateWithData( + NULL, + imageData, + image->byteCount(), + NULL); + + m_cgImage = CGImageCreate(width, + height, + colorBufferSize, + bitDepth, + bytesPrLine, + cgColourSpaceRef, + kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little, + cgDataProviderRef, + NULL, + false, + kCGRenderingIntentDefault); + + CGDataProviderRelease(cgDataProviderRef); + CGColorSpaceRelease(cgColourSpaceRef); +} + +- (void)setWidget:(QWidget *)widget +{ + m_widget = widget; +} + +- (void)drawRect:(CGRect)rect +{ + + if (!m_cgImage) + return; + + CGContextRef cgContext = UIGraphicsGetCurrentContext(); + CGContextSaveGState( cgContext ); + + int dy = rect.origin.y + CGRectGetMaxY(rect); + CGContextTranslateCTM(cgContext, 0, dy); + CGContextScaleCTM(cgContext, 1, -1); + CGImageRef subImage = CGImageCreateWithImageInRect(m_cgImage, rect); + CGContextDrawImage(cgContext,rect,subImage); + CGImageRelease(subImage); + + CGContextRestoreGState(cgContext); +} + +//- (QList<struct QWindowSystemInterface::TouchPoint>)touchPointsForTouches:(NSSet *)touches +//{ +// NSEnumerator *enumerator = [touches objectEnumerator]; +// id touch; +// int count = 0; +// QList<struct QWindowSystemInterface::TouchPoint> result; +// while ((touch = [enumerator nextObject])) { +// CGPoint locationInView = [touch locationInView:self]; +// CGRect bounds = [self bounds]; +// struct QWindowSystemInterface::TouchPoint p; +// p.id = count; +// p.isPrimary = true; +// p.normalPosition = QPointF(locationInView.x / bounds.size.width, +// locationInView.y / bounds.size.height); +// p.area = QRectF(locationInView.x, locationInView.y, 1, 1); +// p.pressure = 1.; +// switch ([touch phase]) { +// case UITouchPhaseBegan: +// p.state = Qt::TouchPointPressed; +// break; +// case UITouchPhaseMoved: +// p.state = Qt::TouchPointMoved; +// break; +// case UITouchPhaseStationary: +// p.state = Qt::TouchPointStationary; +// break; +// case UITouchPhaseEnded: +// case UITouchPhaseCancelled: +// p.state = Qt::TouchPointReleased; +// break; +// } +// result << p; +// qDebug() << p.id << ":" << p.normalPosition << p.area << p.state; +// ++count; +// } +// qDebug() << result.size(); +// return result; +//} + +- (void)sendMouseEventForTouches:(NSSet *)touches withEvent:(UIEvent *)event fakeButtons:(Qt::MouseButtons)buttons +{ + UITouch *touch = [touches anyObject]; + CGPoint locationInView = [touch locationInView:self]; + QPoint p(locationInView.x, locationInView.y); + // TODO handle global touch point? for status bar? + QWindowSystemInterface::handleMouseEvent(m_widget, (ulong)(event.timestamp*1000), + p, p, buttons); +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + //QWindowSystemInterface::handleTouchEvent(m_widget, (ulong)(event.timestamp*1000), + // QEvent::TouchBegin, QTouchEvent::TouchScreen, + // [self touchPointsForTouches:touches]); + [self sendMouseEventForTouches:touches withEvent:event fakeButtons:Qt::LeftButton]; +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + //QWindowSystemInterface::handleTouchEvent(m_widget, (ulong)(event.timestamp*1000), + // QEvent::TouchUpdate, QTouchEvent::TouchScreen, + // [self touchPointsForTouches:touches]); + [self sendMouseEventForTouches:touches withEvent:event fakeButtons:Qt::LeftButton]; +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + //QWindowSystemInterface::handleTouchEvent(m_widget, (ulong)(event.timestamp*1000), + // QEvent::TouchEnd, QTouchEvent::TouchScreen, + // [self touchPointsForTouches:touches]); + [self sendMouseEventForTouches:touches withEvent:event fakeButtons:Qt::NoButton]; +} + +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +{ + //QWindowSystemInterface::handleTouchEvent(m_widget, (ulong)(event.timestamp*1000), + // QEvent::TouchEnd, QTouchEvent::TouchScreen, + // [self touchPointsForTouches:touches]); + [self sendMouseEventForTouches:touches withEvent:event fakeButtons:Qt::NoButton]; +} + +@end + +QT_BEGIN_NAMESPACE + +QUIKitWindowSurface::QUIKitWindowSurface(QWidget *window) + : QWindowSurface(window) +{ + QUIKitWindow *platformWindow = static_cast<QUIKitWindow *>(window->platformWindow()); + Q_ASSERT(platformWindow); + const QRect geo = window->geometry(); + mView = [[QImageView alloc] initWithFrame:CGRectMake(geo.x(),geo.y(),geo.width(),geo.height())]; + [mView setMultipleTouchEnabled:YES]; + [mView setWidget:window]; + mImage = new QImage(window->size(),QImage::Format_ARGB32_Premultiplied); + [mView setImage:mImage]; + if (platformWindow->nativeWindow()) { + [platformWindow->nativeWindow() addSubview:mView]; + [mView setNeedsDisplay]; + } +} + +QPaintDevice *QUIKitWindowSurface::paintDevice() +{ + return mImage; +} + +void QUIKitWindowSurface::flush(QWidget *widget, const QRegion ®ion, const QPoint &offset) +{ + Q_UNUSED(widget); + Q_UNUSED(offset); + + QRect geo = region.boundingRect(); + [mView setNeedsDisplayInRect:CGRectMake(geo.x(),geo.y(),geo.width(),geo.height())]; +} + +void QUIKitWindowSurface::resize (const QSize &size) +{ + QWindowSurface::resize(size); + + delete mImage; + mImage = new QImage(size,QImage::Format_ARGB32_Premultiplied); + [mView setImage:mImage]; + const QRect geo = geometry(); + [mView setFrame:CGRectMake(geo.x(), geo.y(), size.width(), size.height())]; + [mView setNeedsDisplay]; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/uikit/uikit.pro b/src/plugins/platforms/uikit/uikit.pro new file mode 100644 index 0000000..b73c334 --- /dev/null +++ b/src/plugins/platforms/uikit/uikit.pro @@ -0,0 +1,23 @@ +TARGET = quikit +include(../../qpluginbase.pri) +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms + +OBJECTIVE_SOURCES = main.mm \ + quikitintegration.mm \ + quikitwindow.mm \ + quikitscreen.mm \ + quikiteventloop.mm \ + quikitwindowsurface.mm + +OBJECTIVE_HEADERS = quikitintegration.h \ + quikitwindow.h \ + quikitscreen.h \ + quikiteventloop.h \ + quikitwindowsurface.h + +#add libz for freetype. +LIBS += -lz + +#include(../fontdatabases/basicunix/basicunix.pri) +target.path += $$[QT_INSTALL_PLUGINS]/platforms +INSTALLS += target |