summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* iOS: create top-level UIWindow and UIViewControllerRichard Moe Gustavsen2013-02-272-0/+24
| | | | | | | | Create a UIWIndow with a view controller and a view where we can reparent our QIOSWindow views inside. Change-Id: Ic90707d3ebe1af970a3aa2aa0f8c0f4be192456a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Implement QIOSBackingStore in terms of a QOpenGLPaintDeviceTor Arne Vestbø2013-02-274-119/+89
| | | | | | | | | | | | | | | | We build on top of the QPlatformOpenGLContext implementation to get automatic support for QBackingStore-based painting. Since the OpenGL renderer does not clear the backingstore between frames, we actually also get support for partial updates, and we get the benefit of an accelerated paint engine for Qt Quick 1 without setting a GLWidget as the viewport, which would cause issues such as an extra QWindow. This patch also removes the dependency to QtOpenGL and QtWidgets, which were leftovers from the Qt4 platform plugin. In Qt5 the needed GL bits are in QtGui. Change-Id: Id9b736bfb2e4aec56c0fa9f5b7b4d8bff8e3d1dc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Implement QPlatformOpenGLContextTor Arne Vestbø2013-02-278-376/+343
| | | | | | | | | | | | | | | | | | | | | | | | | The iOS platform GL context is an EAGLContext, which is wrapped by the new class QIOSContext. The class takes care of makeCurrent() and swapBuffers(), but defers framebuffer management to the corresponding QIOSWindow. At the moment only a single framebuffer is created, and changing the geometry of the QWindow does not trigger any sort of invalidation of the buffers. The implementation assumes OpenGL ES2.x support. Though strictly speaking we could support ES1 for QtGui, it serves little purpose as Qt Quick 2 requires ES2. This patch also disabled touch event synthesization until we have figured out where we will maintain the connection to UIWindow. QPlatformOpenGLContext::getProcAddress() for getting extensions is implemented by using dlsym() to look up the symbol. This should not present any issues for App Store deployment, like dlopen() would. Change-Id: I166f800f3ecc0d180133c590465371ac1642b0ec Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: support killing timersRichard Moe Gustavsen2013-02-271-12/+42
| | | | | | | Implement the remaining timer functions in the event dispatcher Change-Id: Ie323962c898a2ee95ea60a8ca63b93cbd4544fd1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: call UIApplicationMain from event dispatcher, and add application delegateRichard Moe Gustavsen2013-02-274-38/+165
| | | | | | | | | This change will let you call QApplication::exec() instead of UiApplicationMain from main. Also added an application delegate that we will need sooner or later for catching application activation events. Change-Id: I4edba5ce2059a804782d67c160755fc0e2e5267d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Flesh out initial QPlatformScreen implementationTor Arne Vestbø2013-02-272-57/+61
| | | | | | | | | | | | | | | | | | We check the device's model identifier to tweak the screen values based on the precense of older iPhone/iPod touch models, or the iPad Mini. This does not work when running under the simulator, which reports its model identifier as the architecture of the host platform. There doesn't appear to be any APIs to get the simulated device of the simulator, but if this becomes an issue we can always look at the UIDevice model and screen resolution and apply a few heuristics. We do not update the screen geometry on orientation-changes. This matches what UIScreen reports for bounds, but may not be the most intuitive solution from a Qt perspective compared to the way other platform-plugins work. Change-Id: I74783e053601de9ce805f8b52b944c116f9a1e3e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Fix build on case sensitive filesystemsTor Arne Vestbø2013-02-271-1/+1
| | | | | Change-Id: Ic7a2b38ffcc2bd83e268c5caf5bec17006879969 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: QIOSEventDispatcher: implement timer supportRichard Moe Gustavsen2013-02-272-19/+132
| | | | | Change-Id: I1966a64e6535f32005681db37b4fe5d89dafc70c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: QIOSEventDispatcher: add runloop source for processing eventsRichard Moe Gustavsen2013-02-272-7/+63
| | | | | Change-Id: I6cd649a493dab9a982d71921f19d2a9252fc14b0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Add ability to get the UIView for a QWindow through ↵Tor Arne Vestbø2013-02-272-1/+25
| | | | | | | QPlatformNativeInterface Change-Id: Iab2742bbaa97ff345871ad07ef0162b12248506a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Style nitpicking, rename m_fontDb to m_fontDatabaseTor Arne Vestbø2013-02-272-3/+4
| | | | | Change-Id: I9d92843af9018d51b73fadcc7c20d792fad772fa Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Keep UIScreen* for current QIOSScreen instead of looking up each timeTor Arne Vestbø2013-02-273-10/+11
| | | | | | | Also, add enum for screen numbers, for better code readability. Change-Id: Id5162c34e80ff5efb149ae86b49f51df183d1c1d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Add screen like other platform pluginsTor Arne Vestbø2013-02-272-10/+3
| | | | | | | | | | We may add support for external displays at a later point, but for now we follow the same pattern as the other platform plugins. Either way we should call screenAdded() to let the platform integration know about the screen. Change-Id: Id01785a5262df0180caf957c7de8ecbbf169f233 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Get rid of singleton instance accessor in platform pluginTor Arne Vestbø2013-02-272-11/+0
| | | | | | | None of the other platform plugins have one, and it's not used anywhere. Change-Id: Id46ab5f75c9819511c3e9d123d0338c3c8799869 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Change member variable style to be consistent with Qt's de facto standardTor Arne Vestbø2013-02-277-122/+122
| | | | | Change-Id: Idd65ad9cbb77114466c5b69a799b98a7fee5068f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Don't add to OBJECTIVE_HEADERS, there's no such thingTor Arne Vestbø2013-02-271-1/+1
| | | | | | | | We should add to HEADERS, so that moc will realize it needs to run on the headers. Change-Id: I582e989e4faf0835c4bf9a677cbd8ac075559319 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Don't include QtPrintSupport dialogs on iOSTor Arne Vestbø2013-02-271-1/+1
| | | | | | | It pulls in a dependency on Cocoa. Change-Id: I293063adfdef8b92f80ffda0c66ac6e6d12958ff Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Add required public dependencies of the CoreText font databaseTor Arne Vestbø2013-02-271-0/+8
| | | | | | | | | | | | | CoreText and CoreGraphics are available on iOS as stand-alone frameworks, but on Mac OS X they are part of the ApplicationServices umbrella framework. Mac OS 10.8 actually introduced both as stand-alone frameworks, but for simplicity we link to ApplicationServices, as there's still symlinks from ApplicationServices to the real frameworks. Change-Id: I7f7ef795629cc37da85857d5c42283754acc4474 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: network should not link against CoreServices on iOSRichard Moe Gustavsen2013-02-271-1/+5
| | | | | Change-Id: Ia3e21a3d73f696f0e77c427bdb263333646c48d3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Add missing QuartzCore dependency to platform pluginTor Arne Vestbø2013-02-271-1/+1
| | | | | Change-Id: Ic69a5a7faa9b7f9907d0325260b6b6e2389a4c3a Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Don't link ios platform plugin to CocoaTor Arne Vestbø2013-02-271-1/+1
| | | | | Change-Id: I2348b19617d3e342cd344bf7d0fa894118cbfae8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Build platform plugin like other platform pluginsTor Arne Vestbø2013-02-271-4/+3
| | | | | | | ... by loading(qt_plugin) Change-Id: I9be438b72be986a991a81c2cf1a3e5047bcf0a60 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Build ios platform plugin when appropriateTor Arne Vestbø2013-02-273-3/+6
| | | | | | | | | Defining QT_QPA_DEFAULT_PLATFORM_NAME in qplatformdefs.h is not neccecary, as qconfig.h will already have this define written by configure. Change-Id: I89d9191533f6b4e6bfd5eade6cc0dced02b50f81 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Write default code signing identify for iOS in Xcode generatorTor Arne Vestbø2013-02-272-0/+5
| | | | | | | Change-Id: Ic04da6063863585665c9133caba0279ba478fbb4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Ian Dean <ian@mediator-software.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Target both iPhone and iPad by defaultTor Arne Vestbø2013-02-272-0/+9
| | | | | Change-Id: I3122b9391c6187da17389c889a456c58210dca09 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Allow projects to disable the main wrapperTor Arne Vestbø2013-02-271-6/+8
| | | | | | | In case they provide their own main that calls UIApplicationMain. Change-Id: Ia050277ae5cbcbf01bc57b87ec37a74db9568059 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Link to the platform plugin and iosmain plugin and define mainTor Arne Vestbø2013-02-271-0/+22
| | | | | | | | | | | | | | | | | | | Ideally we'd only have to do QTPLUGIN += ios, but this doesn't work as we need to link with the force_load linker option. Even trying to build on QTPLUGIN and then replace the -l line with what we need will fail, as the prl logic in qmake which runs after all the prf files does not know about the force_load option and will then fail to resolve dependencies from the prl file. Since we load the platform plugin using -force_load, there's no need to generate a cpp file that does the plugin import. The main wrapper is not a real Qt plugin, and doesn't have an import function that we can call, so we link it manually instead of relying on QTPLUGIN. Change-Id: I0381a3c9ed7f8d41a4121e1fc0b7c0e210a8b832 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Make Xcode output the default for GUI applicationsTor Arne Vestbø2013-02-273-3/+20
| | | | | | | | | | | | | | | | | | | | | | As long as Qt Creator does not provide any iOS integration, and the app bundle we create using the Makefile generator is not good enough to deploy to a device anyways, producing Xcode projects make the most sense. We base the decicion on whether or not the project depends on QtGui and has app_bundles enabled. This prevents configure tests and other tools from having Xcode projects, but allows examples and demos to build out of the box. Instead of setting the generator unconditionally we unset it in default_pre so that we can detect if the user set it manually. This means the user won't be able to inspect the MAKEFILE_GENERATOR variable from the pro file, but this is less of a use-case then overriding the generator from the command line or prooject file. Change-Id: I881cf3e29631445f83ea4ff0979f7a566e4810f5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Replace device and simulator makespecs with single makespecTor Arne Vestbø2013-02-2713-227/+89
| | | | | | | | | | And use configure's -sdk argument to choose between the iphoneos and the iphonesimulator SDK. xcodebuild -showsdks can be used to list the available SDKs. Passing an SDK without a version postfix implies the latest version of the SDK. Change-Id: I881df754d522fc91aaa16ba3e39cf0c37a21a1f1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Include clang-mac.conf instead of defining precompile flags ourselvesTor Arne Vestbø2013-02-263-6/+2
| | | | | Change-Id: I1a3b9ad16e54457068d3451c066a8d7965a622df Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Use sdk.prf to set -isysroot based on the chosen SDKTor Arne Vestbø2013-02-263-14/+5
| | | | | Change-Id: I4683ab422ad886b86604fbd68f8dfb4cf6bfc06e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Move device/simulator conditionals out of common mkspecsTor Arne Vestbø2013-02-266-46/+46
| | | | | | | | Instead we deal with any differenced by setting variables in the top level makespecs, that are used by the common makespec configs. Change-Id: Iae1fb5fef8c95778511ed400008731989b446f3c Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Disable NEON until LLVM handles the GAS syntax of the draw-helpersTor Arne Vestbø2013-02-261-1/+2
| | | | | | | | | | | The LLVM version in Xcode 4.5 and below does not handle the GNU assembler syntax in the pixman assembly file. A possible alternative workaround is to include a preprocessed assembly file using https://github.com/hollylee/gas-preprocessor. Change-Id: Id95add669c60d3a7da823e5975afdd1f88f71977 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Simplify arch detection/configuration in mkspecTor Arne Vestbø2013-02-261-34/+6
| | | | | | | | NEON detection is handled by configure's arch test, and THUMB2 is the default for ARMv7. Change-Id: I8ec3ce0ec6af9ad8d9509890aa1f8c87e18364d5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Force static builds so that apps can be submitted to the App StoreTor Arne Vestbø2013-02-261-0/+6
| | | | | Change-Id: I66c917e98e40c07ae9532c106ee1c47caa61abd5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Bump arch and iOS SDK, now that we require GLES 2.xTor Arne Vestbø2013-02-266-116/+25
| | | | | | | We now require SDK version 4.3 or above, and armv7. Change-Id: I4766e277a3a4a32712bf2ec27fede694e8316c95 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Simplify SDK resolving in mkspecTor Arne Vestbø2013-02-262-88/+42
| | | | | | | | There's no need to duplicate the logic for device vs simulator. The only difference is the iPhoneOS/iPhoneSimulator name. Change-Id: I87c57fa785279a3ee258b76fdac8317e52e7daa2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Move Q_OS_IOS out of makesespec to qsystemdetection.hTor Arne Vestbø2013-02-264-1/+11
| | | | | | | | | We treat iOS as a variant of Mac OS, so for iOS both Q_OS_MAC and Q_OS_IOS will be defined. This matches what Apple assumes in the header file TargetConditionals.h Change-Id: I55cc851401b748297478e4c32e84e0f6e1fdfc28 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* iOS: Don't reference QMacStyle from QStyleOption as we don't build itRichard Moe Gustavsen2013-02-261-1/+1
| | | | | | | | QMacStyle is not buildt as a part of iOS. So make sure we dont reference it from QStyleOption Change-Id: I98e779c576d0607402e45a19b457144a6bdfc73b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: fix build issue, dont link against cocoaRichard Moe Gustavsen2013-02-264-6/+4
| | | | | | | | | Make sure the libraries dont depend on Cocoa. This will be picked up by libtool, and make all apps and examples link against cocoa too (which will ofcourse fail) Change-Id: I5654bb08c4ed376fc7ee74da422d903270a8af38 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: copy brute-force port of Qt4 uikit plugin into Qt5.Richard Moe Gustavsen2013-02-2614-0/+1601
| | | | | | | | | | | | | | | | The plugin has been renamed from uikit to ios. Other than that, the plugin will now build, but do nothing. Most of the Qt4 code is preserved, with a rough translation into the Qt5 qpa API. A lot of code has simply been commented out so far, and most lacking at the moment is the event dispatcher which will need to be rewritten, and the opengl paint device implementation. But it should suffice as a starting ground. Also: The plugin will currently not automatically build when building Qt, this needs to be enabled from configure first. Change-Id: I0d229a453a8477618e06554655bffc5505203b44 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Get rid of GCC/LLVM makespecs for iOSTor Arne Vestbø2013-02-2613-373/+5
| | | | | | | We only want to support Clang. Change-Id: Id0558df905106158f4c25ca10462bf4ca41e1e45 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Remove hard-coding of Xcode /Developer path in common/ios mkspecsTor Arne Vestbø2013-02-2615-481/+27
| | | | | | | | | | | | We can use xcode-select -print-path to get the /Developer directory. This also removes the need for the "legacy" makespecs, which only differ from their non-legacy counterparts in the location of the Xcode developer directory. Change-Id: Ia9245033a4b82cc3933226bf998f07177b60871f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* qmake: Resolve QMAKE_INFO_PLIST against current working dirTor Arne Vestbø2013-02-261-1/+1
| | | | | | | | | We're not in the output directory yet, so resolving using vanilla fileFixify will end up failing when we check if the file exists, since QFileInfo resolves relative paths against the current directory. Change-Id: I414c6a2e83b49e3fb30e6153a49f7a90a8e528a0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* qmake: Fix file paths in Xcode projects when shadow-buildingTor Arne Vestbø2013-02-261-5/+20
| | | | | | | | | | | | | | | | | The Xcode generator seems to have been written with the assumption that writeMakeParts() would be called with the output directory as the current directory, but that's not the case when shadow-building. Perhaps this was changed in qmake at some point, and the Xcode generator was not updated to reflect that. Instead of replacing every occurance of fileFixify and other logic to deal with paths, we just chdir into the output_dir for the duration of the function (except when writing the 'make qmake' makefile, as the regular makefile generator works as expected with the current directory set to the input directory). Change-Id: I6ba492036d73f29f4adbd7cd554db9504050629e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* qmake: Prevent Obj-C sources from building both as extra compiler and in XcodeTor Arne Vestbø2013-02-261-3/+13
| | | | | | | | | We already assume that if a source is buildable and should end up in OBJECTS we can let Xcode build it, so we skip this input for the extra compiler. Change-Id: I17b2408925b8e6513f0fa0d2459ec539bf7381d3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* qmake: Use PBXResourcesBuildPhase for QMAKE_BUNDLE_DATA without a pathTor Arne Vestbø2013-02-261-43/+57
| | | | | | | | | | | | | The PBXResourcesBuildPhase will optimize resources, such as turning XIB files into NIB files, running pngcrush on images, turning string files into binary plists, etc, so we prefer that if possible. Unfortunatly this phase does not support custom paths, so whenever we encounter bundle data with a custom path we fall back to the regular PBXCopyFilesBuildPhase. Change-Id: I539db03dd7982fd37293123b6428cdb695f64d2b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* qmake: Don't treat .xcodeproj directories as OUT_PWD when passed with -oTor Arne Vestbø2013-02-261-0/+5
| | | | | | | | | | | | | | | | | The Xcode generator creates a makefile for running 'make qmake', and the makefile passes -o to ensure it writes to the same Xcode project. This fails when qmake then treats -o foo.xcodeproj/project.xcproj as not only setting the output filename, but also the output directory to foo.xcodeproj, which results in the Xcode project trying to reference files relative to this directory, such as '../main.cpp'. Unfortunatly the output filename parsing happens too early for us to know whether or not the generator is Xcode, so we just have to assume that a certain combination of output filename and directories means we are generating an Xcode project. Change-Id: I0901d4db995f287c35cbbbd015683d5abda6d0f5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* qmake: Prevent duplicate libaries from being added to the link phaseTor Arne Vestbø2013-02-261-15/+17
| | | | | Change-Id: I5ec7acb8f060e9d9bbd8cdb95d40ace03cffe9c7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* qmake: Don't generate Xcode project bundle identifiers with spacesTor Arne Vestbø2013-02-263-0/+39
| | | | | | | Replace them with dashes, like Xcode itself does. Change-Id: I302425363a2eef13394025cd4a9e414048ce55ce Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>