summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosintegration.h
Commit message (Collapse)AuthorAgeFilesLines
* iOS: Add text selection support from the platform pluginRichard Moe Gustavsen2016-05-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch will add touch based text selection support to Qt from the iOS plugin. QIOSTextInputOverlay will listen to changes to the focus object, and if IM enabled, create three different gesture recognizers that tracks what the user is doing. The first recogniser detects if the user does a press and hold on the text when there is no selection. If triggered, it will show a loupe that follows the touch around together with the cursor. The second recogniser will instead be active when text is selected, and takes care of drawing a set of handles on each side of the selection. If the user drags on any of the handles, a loupe will show that follows the touch/text line together with the handle. The third recogniser detects if the user does a tap, and depending on if there's a selection, or if the cursor didn't move, it will show or hide the edit menu. The handles and loupe are implemented as overlays using Core Animation layers. Change-Id: Idff6e40e12307a458c9c399b0487bb976fce29c8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* iOS: Implement support for QApplication::beep()Tor Arne Vestbø2015-12-171-0/+2
| | | | | | | | | | | | | Vibrates the device or plays an alert sound on devices that do not support vibration. The other implementations of beep() have been moved to QPlatformIntegration as a proper API instead of having them as invokables in QPlatformNativeInterface. Change-Id: Ic597dbef04b46d49862b070e78ddfc0d763829a2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
* iOS: add missing Q_DECL_OVERRIDERichard Moe Gustavsen2015-07-271-13/+13
| | | | | | | Add missing Q_DECL_OVERRIDE to silence clang. Change-Id: I57261a39f0dcf4e0ffd8d9c079a95f2d3347d34a Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* iOS: Add platform plugin option to debug window managementTor Arne Vestbø2015-03-161-0/+6
| | | | | | | | | | | | When the 'debugWindowManagement' option is enabled, e.g. by passing the argument -platform ios:debugWindowManagement to the application, the plugin will add a background color and outline to all QUIViews, as well as draw a grid for the underlying QUIViewController. This makes it easier to see where windows are placed when the window itself doesn't draw anything, e.g. in unit tests. Change-Id: If9a59822e0b320b154ad8e338f9fb5ec7cf191a2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* iOS: Prepare QIOSIntegration for handling plugin optionsTor Arne Vestbø2015-03-121-3/+7
| | | | | | | | | | QGuiApplication sets options passed to the plugin through -platform as properties on the QPlatformNativeInterface. To handle those we need to inherit QPlatformNativeInterface first (which is the QObject subclass), and include the Q_OBJECT macro. Change-Id: Ia496851c64cbb0036c26e7ed0683d0ecfa8319cc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* iOS: add a file engine to support loading assets/photosRichard Moe Gustavsen2015-02-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This patch will add a new file engine that lets the app load images from the asset library using QFile. The engine will recognize file names with the scheme 'assets-library', which is the same scheme returned by UIImagePickerController. This patch will be the first of a set of patches that lets the user open a native image picker dialog by using a QFileDialog with directory set to QStandardPaths::PictureLocation. This patch will ensure that the url returned from the dialog can be loaded using QFile. AssetsLibrary, which is used in this patch, is actually deprecated in favor of the new Photos framework. But since the latter is only supported from iOS8, we choose to use the former framework for now. Change-Id: If2a6eb394ae4df55fb4e9e1dc245a1574d38618a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* iOS: Use QPlatformIntegration::destroyScreen() instead of manual deleteTor Arne Vestbø2015-01-211-0/+2
| | | | | Change-Id: I8128fa1a4b7d6d202d15c03d51f6360a74d75d8c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* iOS: Detect external screen connections and expose as additional QScreenTor Arne Vestbø2014-07-211-1/+2
| | | | | | | | The additional QScreen can not be used for anything yet, since we don't set up a window and root view controller for it. Change-Id: I335b796bdd89fc58a27ec4e20c5ed355be0cab66 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Add helper for getting the iOS platform integration instanceTor Arne Vestbø2014-07-211-0/+2
| | | | | Change-Id: I550d345ab0f8bcba1225c425464e198d43d9fda8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Accessibility iOSFrederik Gladhorn2014-06-061-0/+3
| | | | | | | | | | | | | | | | | | | | | This lays the foundation for iOS accessibility. The approach is slightly different from other a11y bridges in that we completely flaten the hierarchy of wigets/quick items to a list. This works well with VoiceOver since there are comparatively few elements. The cache implementation for OS X is re-used. With this patch VoiceOver on iOS works on many applications out of the box. For now it sends the screen changed notfification somewhat overzealous, that will need revisiting and potentially new API in QAccessible. Device orientation changes are not yet supported. [ChangeLog][iOS] Accessibility was added to the iOS platform port. This enables Qt applications to be read by VoiceOver on iOS devices. Task-number: QTBUG-39097 Change-Id: I441e844652d528cc2fdcc444f43b54ed6fa04f0c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Add support for offscreen GL surfaces without using hidden windowsTor Arne Vestbø2014-03-281-0/+1
| | | | | | | | | | | | | | There's no need to create a hidden window to get a surface on iOS, as the platform supports FBOs. Note that defaultFramebufferObject() returns 0 in the case of offscreen surfaces, which is technically not a valid FBO on iOS due to the indirect rendering, but binding and rendering to the zero-FBO seems to be no-ops, so clients may safely call eg glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject()) to restore the default FBO after drawing to its own FBO. Change-Id: I2e67f5d69c0698562052f5ac1df0bbfaa3337148 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* iOS: implement clipboardRichard Moe Gustavsen2014-03-061-0/+2
| | | | | | | | This will implement support for copy/paste operations inside, and between, applications. Change-Id: I50031b89bdb07f106950dc90fb8b1accbd1191bb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Re-enable drag-and-drop on iOS after bugfixes to QBasicDrag and friendsTor Arne Vestbø2014-03-061-2/+0
| | | | | Change-Id: I0fd4e5e8d561826841cc78b26cd524ba01a8b689 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* iOS: Disable drag and drop completely instead of enabling simple d'n'dTor Arne Vestbø2013-12-041-0/+2
| | | | | | | | | The drag and drop event filters do not play nicely with touch events or virtual keyboards. Task-number: QTBUG-35348 Change-Id: Id4d079ae72882f48750d394f13e10700d60e4532 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Implement QPlatformServices to handle opening URLsTor Arne Vestbø2013-10-031-0/+4
| | | | | Change-Id: Ie644df16b919d6def1435dc5f3665ba3f62fb055 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Delete members in platform integrationTor Arne Vestbø2013-10-031-0/+1
| | | | | Change-Id: Ibb1bf2bf4a1ced897172facbc9027402adfe6f08 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* QPA: Fix semantics of GUI event dispatcher ownership in platform pluginsTor Arne Vestbø2013-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The QPlatformIntegration::guiThreadEventDispatcher() function acted as an accessor to event dispatchers created in the constructor of each platform plugin, but the logic and semantics of event-dispatcher handling in Qt itself (QCoreApplication/QGuiApplication) still assumed both ownership and control over the event dispatcher, such as when to create one, which one to create, and when to delete it. This conflicted with the explicit calls in the platform plugins to QGuiApplication::setEventDispatcher(), as well as left a possibility that the event-dispatcher created by the platform plugin would never be deleted, as none of the platform plugins actually took full ownership of the dispatcher and deleted it in its destructor. The integration function has now been renamed back to its old name, createEventDispatcher(), and acts as a factory function, leaving the logic and lifetime of event dispatcher to QtCoreApplication. The only platform left with creating the event-dispatcher in the constructor is QNX, where other parts of the platform relies on having an event-dispatcher before their initialization. We then need to manually take care of the ownership transfer, so that the event-dispatcher is still destroyed at some point. Change-Id: I113db97d2545ebda39ebdefa865e488d2ce9368b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* iOS: add support for Qt::ApplicationStatesRichard Moe Gustavsen2013-06-251-0/+3
| | | | | Change-Id: I39858fe835c131d5c681db535f2ec9308e2f8223 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: don't delete m_touchDevice, QPA takes ownershipRichard Moe Gustavsen2013-04-221-1/+0
| | | | | | | | | | | | When registering m_touchDevice with QWindowSystemInterface, it will also transfer ownership to it. It will eventually be deleted in clenupDevicesList on qtouchdevice.cpp. This patch will also stop the app from crashing when telling it to quit. Change-Id: I97070efdf16b4db7d076935fbec62e60f094a7df Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Add QIOSIntegration::hasCapability functionRichard Moe Gustavsen2013-02-271-0/+2
| | | | | | | | Add the missing override, and report that we support OpenGL (and multiple windows). Change-Id: If95138cab9099b547d12d3dfed008bd63b6d2acf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Implement touch events.Morten Johan Sørvig2013-02-271-0/+3
| | | | | | | | | | | | | | | Track touch events during the standard [Began -> Moved -> Ended] event sequence based on the UITouch pointer which stays constant. Enable multiTouch on Qt's UIView. Mouse events should now be automatically created from (unhanded) touch events by QGuiApplication. Reviewed by: Ada Sørvig (fingerpaint app approved) Change-Id: I2aeb48c962c697d8b8337f8ceab062070c2a4240 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Make fusion style the default style on iOS, not the windows styleTor Arne Vestbø2013-02-271-0/+3
| | | | | Change-Id: I81b6049ff666bf23ac58d60e10d7c3d8713a19ea Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: add class QIOSInputContext (to handle keyboard)Richard Moe Gustavsen2013-02-271-0/+2
| | | | | | | | This change will add an initial implementation of the QPlatformInputContext for dealing with the keyboard. Change-Id: I29c1cfbbebb8456977b8a1db0e966973cd2c24a5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Enable the ShowIsFullScreen style-hint so that show() implies fullscreenTor Arne Vestbø2013-02-271-0/+2
| | | | | | | | | | We may need to qualify this setting for UC2, so that the user may still create windows as sub-controls of a regular iOS user interface, but for UC1 it makes sense. Change-Id: I1a7019f901fabed8b5b9cbb18a929913780e6595 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: insert Digia license headersRichard Moe Gustavsen2013-02-271-24/+24
| | | | | | | Remove Nokia. Change-Id: Iec7095ef4e3099453b6103814e826039b377ecce Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Use default createPlatformPixmap implementationMorten Johan Sorvig2013-02-271-1/+0
| | | | | | | | No need to implement this one, the standard implementation creates a raster pixmap. Change-Id: I9bb25188bd95159d76e760b2be6870e0bede7b56 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Implement QPlatformOpenGLContextTor Arne Vestbø2013-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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: Add ability to get the UIView for a QWindow through ↵Tor Arne Vestbø2013-02-271-1/+5
| | | | | | | 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-271-1/+1
| | | | | Change-Id: I9d92843af9018d51b73fadcc7c20d792fad772fa Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Add screen like other platform pluginsTor Arne Vestbø2013-02-271-3/+1
| | | | | | | | | | 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-271-2/+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-271-2/+2
| | | | | Change-Id: Idd65ad9cbb77114466c5b69a799b98a7fee5068f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: copy brute-force port of Qt4 uikit plugin into Qt5.Richard Moe Gustavsen2013-02-261-0/+75
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>