summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * iOS: let first responder follow the view of the focus windowRichard Moe Gustavsen2013-02-273-18/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This to ensure that the keyboard does not close prematurly. This can happen if the user opens up the keyboard while typing inside one window, then switch window, continue typing while the other window gets deleted. Change-Id: I5cfb1673ccbe4d5aaa14167b7aa53451031089a1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: implement QPlatformWindow::requestActivateWindow()Richard Moe Gustavsen2013-02-272-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | Dispite the name, 'requestActivateWindow' means raise and transfer focus to the window. Change-Id: Ib97321ed7ec8da90e924ff8155a95896c12160c9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: raise windows that becomes visibleRichard Moe Gustavsen2013-02-271-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | When a QWindow becomes visible, it should move to front and be active. Change-Id: Icab12c6031c0cc8d791e4f8cc49b9c2d5c73100d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: implement QPlatformWindow::raise() and lower()Richard Moe Gustavsen2013-02-272-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Probably not going to be the most used functions on iOS, but implemented to support old widget apps out of the box. The implementation stacks both staysOnTop and popup windows on the same level for simplicity, since iOS does not have a concept of z-ordering UIViews (UILayer has z-order, but layers belong in a different hierarchy, and cannot be used in this respect). Change-Id: Idd68e5ceea7d4eaeb3066486c47400930cebb1b0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: Use 72 DPI for font size conversionTor Arne Vestbø2013-02-272-0/+6
| | | | | | | | | | | | | | | | | | | | | This matches how UIKit behaves Change-Id: I13fd2578cac84e57b6be29c42ddee414b7ee9cb9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: transfer focus to the window touchedRichard Moe Gustavsen2013-02-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since our QWindows are UIViews rather than UIWindows, we need to implement window activation manually. This patch will ensure that the window touched by the user also gets keyboard focus. Change-Id: I9390c5c8e50a4b066cd1320a2a044e02f2a9f75d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: Move handling of FBOs to QIOSContext instead of QIOSWindowTor Arne Vestbø2013-02-274-84/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lifetime of an FBO is tied to its context, so letting each window manage its own FBO failed when the window tried to delete the FBO at destruction time without the proper context being current, or even available anymore. We solve this by moving all handling of FBOs to the context itself, which is fine as we're exposing the necessary bits from the window to allocate storage based on its layer. Change-Id: I8c7c96cf63d6b667527c816f10ac2f4ff6a05e0c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Don't build qiosviewcontroller.mm into qtmain pluginTor Arne Vestbø2013-02-271-4/+1
| | | | | | | | | | | | | | | | | | | | | It's already built as part of the iOS platform plugin. Change-Id: I5a97e8723b566b9ef15aafce374be35f01e6cf08 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Move debug background color setting and guard for release buildsTor Arne Vestbø2013-02-272-2/+10
| | | | | | | | | | | | | | | Change-Id: Ie9131c3dfe16045805b37bf8af9381f4f9929da6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Don't init our own base view for the root viewcontrollerTor Arne Vestbø2013-02-271-1/+0
| | | | | | | | | | | | | | | | | | | | | This is handled automatically by the default implementation. Change-Id: Ia9bd0143490e6f2507ede03f3654a2b0b00e3e3d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Auto-release the UIWindow and root view-controllerTor Arne Vestbø2013-02-271-4/+3
| | | | | | | | | | | | | | | | | | | | | They are retained properties. Change-Id: Id1808d93fe30950fc05e41375f00183e098bff0b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Don't check for existing window in QIOSMainWrapperApplicationDelegateTor Arne Vestbø2013-02-271-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | The delegate is only used when we control the application, so we know that there isn't any window yet. Change-Id: Ibd774cb4fd8ceaab6a181769d2792b569f490495 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Fix style nitpicksTor Arne Vestbø2013-02-271-2/+2
| | | | | | | | | | | | | | | Change-Id: I670567f1793b5548393a3b315650bf34a0a3880e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * iOS: make QWindow views hidden by defaultRichard Moe Gustavsen2013-02-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Qt will tell us when the window should be visible. Showing all windows by default makes e.g the desktop widget visible as well, which causes problems with activation of windows. Change-Id: Ibf2283bc5f009df7ff23126f4dd04ec898141720 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: clean-up header includesRichard Moe Gustavsen2013-02-272-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | Try to keep qiosglobal.h free from unnecessary includes, since its typically included from many different locations. Change-Id: I6638bcaef1189b3eee3dbd5f744c15f8f7858d71 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: activate next window when active window hidesRichard Moe Gustavsen2013-02-271-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the OS does not handle window management for us, we need to handle this ourselves. So when a QWindow is closed or hidden, we transfer activation to the top-most visible window. This will fix application unresponsive after closing a dialog. Change-Id: I83f836ebafa71edca5ab5ae3a2bdba7cd1decbc1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: add UIView category to get the QWindow it representsRichard Moe Gustavsen2013-02-272-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding a simple way to get the QWindow pointer from any UIView makes writing code where you only have UIView pointers a bit easier. Perhaps we should also investigate if it is worthwhile to make this category public to the application, to further enhance working in a mixed environment. Change-Id: Ic263003dc7683a8d976024cbbbc2558e8472a790 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: make EAGLView private in QIOSWindowRichard Moe Gustavsen2013-02-272-28/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not the biggest gain, but since all the members of EAGLView are declared private, we might as well move the whole interface into the source file. We can then make the members public without caring about interface readability. We will make use of this in a following patch. Change-Id: I144fb5748573ca6faf257d72597907b5c17b1e05 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: add convenience function to get to the root QIOSViewControllerRichard Moe Gustavsen2013-02-274-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems that we need to access our view controller from many places, and the syntax to do so is tricky to remember. So lets just add it to our global functions, with the added bonus of a using a little cache. Note: many of these functions could be made inline, but since one concern of the plugin will be the end size of the app, I prefer to trade size for speed at this point. We can always change this later. Change-Id: I578ea9ae8218d23d635b7728a930763ca53c4eaa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: Fix build for modules that load(configure)Morten Johan Sørvig2013-02-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure.prf checks if MAKEFILE_GENERATOR is set to something it can work with. ios/default_pre.prf unsets MAKEFILE_GENERATOR. This breaks QtMultimedia at least. Add special case for iOS to configure.prf and set QMAKE_MAKE to "make". Change-Id: Ie8feaeefe4a932d735a0cd4c09e869ca1341aae5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: bugfix portraitToPrimary global functionRichard Moe Gustavsen2013-02-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QScreen geometry and orientation is updated a bit after we change geometry in QPlatformScreen, which this time was enough to break availableGeometry. Since this function is for internal use, we let it be based on internal data. Change-Id: I7701b0a6043839c89c01e87242decb8a739d00f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: update primary orientation when the rotation startsRichard Moe Gustavsen2013-02-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | We need to update primary orientation when the rotation starts, and not when it ends, so that we are in sync with the resize that happens to the backingstore upon layoutSubviews. Change-Id: I466a2d135e6c15550c6207c9659871629d748b73 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: report changes to keyboard rect back to QtRichard Moe Gustavsen2013-02-275-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | QInputContext expects us to report whenever the input panel changes geometry. This patch implements this. Change-Id: I9162f0d48da6925274a7489c9bcb6adab9afae82 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: add global function 'isQtApplication'Richard Moe Gustavsen2013-02-274-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several places in the code we need to check if the plugin is running as a cross-platform Qt application or inside a native app. So we refactor this function to qiosglobal so we can access it from everywhere. Change-Id: I78db0dcde71b7d281868ce304867c8f876caef2a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: refactor general convenience functions into new file 'qiosglobal'Richard Moe Gustavsen2013-02-277-63/+170
| | | | | | | | | | | | | | | | | | | | | | | | Some functions are needed across several files and classes. Lets place them in a common file for all to use. Change-Id: I5f9b578f948d66d10e57a835b80b5c493e07fb4c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: remove warning from unused function in QIOSEventDispatcherRichard Moe Gustavsen2013-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | From the documentation for QAbstractEventDispatcher::flush(), this function does only make sense for X11. Change-Id: I7f445b67b283f60c9a30ac00837beb44e8205d8b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * iOS: Retina display support.Morten Johan Sorvig2013-02-275-7/+41
| | | | | | | | | | | | | | | | | | | | | | | | Scale the OpenGL paint device size and physical dpi by the device pixel ratio. Change-Id: I8b576f23129aafc47371795151c548663e94ad52 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: let QIOSScreen use correct orientation at startupRichard Moe Gustavsen2013-02-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | When QScreen is created, we need to check if the application is already in landscape. Change-Id: I653c622154a5c23ec93e89ec3e80fefb6b1f1bdd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: refactor QIOSOrientationListener into QIOSScreenRichard Moe Gustavsen2013-02-277-203/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up a bit. The orientation conversion functions belongs to QIOSScreen more than QIOSOrientationListener. And rename them in the same go to follow toQRect/fromQRect standard. The orientation listener itself is tightly coupled to QIOSScreen, and does not make much sense on its own, so move it into QIOSScreen to follow the same patteren already implemented for QIOSInputContext. Change-Id: I8b6b4d08a42349b4232749d59d46748297083536 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: let QIOSScreen change geometry according to interface rotationTor Arne Vestbø2013-02-275-5/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt expects the screen to change geometry when the "desktop" rotates. On iOS, we interpret this as when the root view controller changes orientation, since after all, this is the surface we place QWindows on top of. Change-Id: Ia00e68c8f9f0a65aefcc60518ee544fb260d4595 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Make default system font HelveticaTor Arne Vestbø2013-02-272-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without a platform theme implementatin we were relying on QCoreTextFontDatabase::defaultFont() to return the system font. This didn't work because it reported the system font that iOS reports, '.Helvetica Neue UI', which is a private font that does not get added to our font database. The result was that we picked the first font in the list of known fonts -- in this case 'Academy Engraved LET'. We now implement QIOSTheme::font(), which takes precedence over the font database's default font, and hard-code the system font to 'Helvetica', since Qt does not yet have the concept of private system fonts. Change-Id: I901cf9c2b662ea2795212376b84b8391be2efbbe Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Make fusion style the default style on iOS, not the windows styleTor Arne Vestbø2013-02-275-2/+152
| | | | | | | | | | | | | | | Change-Id: I81b6049ff666bf23ac58d60e10d7c3d8713a19ea Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: add class QIOSInputContext (to handle keyboard)Richard Moe Gustavsen2013-02-275-2/+216
| | | | | | | | | | | | | | | | | | | | | | | | 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: implement in QIOSWindow::setVisibleRichard Moe Gustavsen2013-02-272-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | When QWindow is told to show/hide, we need to show/hide the backing UIView as well, otherwise the window will still be visible on screen. Change-Id: I806fdd8bb4afacbbc1c9c7381ba0a31195ee04ac Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: remove the view from the view hierarchy upon destructionRichard Moe Gustavsen2013-02-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to remove the view that backs QWindow when the window is destroyed. Otherwise the view will still be visible on screen, but now with a dangling QWindow pointer. This fixes a crash that happens when closing dialogs. Change-Id: I9053c83c6db80a39f4f71a63993cc7ae73fc4196 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: Remove unnecessary const-trickery when passing QIOSContext to the windowTor Arne Vestbø2013-02-271-2/+2
| | | | | | | | | | | | | | | Change-Id: I56b3873342c1572ea6a651027e8f1a684cbe2a5a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Enable auto-rotation if no orientation update-mask has been setTor Arne Vestbø2013-02-271-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | This is an intermediate heuristic until we have a proper API in Qt to deal with auto-rotation and orientation locking. Change-Id: I433992fa1c18d1670987f79e405a4501b6e5d365 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Update GL render buffers when the accociated window is resizedTor Arne Vestbø2013-02-274-43/+66
| | | | | | | | | | | | | | | | | | | | | | | | We keep track of the with and height of the FBO's buffers, and update their storage if the window size has changed since last time. Change-Id: I97788b69e7067a5b5b9f28e8498cf1bc5d2cf6ea Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Keep QIOSBackingStore's paint device size in sync with the windowTor Arne Vestbø2013-02-271-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Treating the paint-device as a thing wrapper around the OpenGL paint engine failed when the window was resized, as the paint engine would clip the drawing to the old size. We need to update the size in beginPaint. QBackingStore resize still behaves like before, and we emit a warning if the user tries to resize the backing-store to some other size than the window size, as that's not a supported use-case for our iOS backing store. Change-Id: I1a0eeb65fa9db8b5538dc69963d6fc84be6e63f1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Create QIOSBackingStore paint device lazily in paintDevice()Tor Arne Vestbø2013-02-271-2/+3
| | | | | | | | | | | | | | | | | | | | | Instead of constructor. Change-Id: I98cddd3f39add3e6f787c858b4d629325cc0f852 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: update QPlatformWindow::geometry() when UIView changes sizeRichard Moe Gustavsen2013-02-272-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that QWindow::geometry needs to be updated manually by the platform plugin, and not indirectly trough QWindowSystemInterface::handleGeometryChange as first assumed. We now always report the _actual_ geometry of the UIView (which also takes the status bar into account) to QWindow, and remember the _requested_ geometry of the window to use whenever the state of the window changes. Change-Id: Iea940173d26fb6af701234379cae914215dae984 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: let fullscreen geometry take orientation into accountRichard Moe Gustavsen2013-02-271-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since UIScreen is orientation agnostic, we need to look at the view of the top level view controller instead to determine available geometry. Change-Id: I3789ab7972a9970e46fbc8af81f2b7199e5ca5d1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: when in fullscreen, autoresize the view when the device rotatesRichard Moe Gustavsen2013-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Tell the view that backs QWindow to autoresize itself when the superview (view of the root view controller) changes size. This will typically happen when the device changes orientation. Change-Id: Ib7c4dff9112d57f60012d3f0837677e09088bcaf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: one 'transform' warning per window is sufficientRichard Moe Gustavsen2013-02-271-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The layoutSubviews function will be called when the geometry changes, and we will catch the transform issue there for both UC1 and UC2 Change-Id: I29578bbc5b3091c86fbe69c7095ff280a64be458 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: when in fullscreen, dont respond to geometry changesRichard Moe Gustavsen2013-02-272-21/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QWindow is told to be in fullscreen, we should not respond to geometry changes. Instead we should bookkeep the requested geometry and set it when/if the window enters Qt::WindowNoState later. Change-Id: Ieaf4756b2a966212c8e1738af9df175a58786a75 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-272-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Set initial window state on window creationTor Arne Vestbø2013-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When showing a QWindow the window state is set first, and then the window is made visible. The latter is the step that creates the platform window, so we need to pick up the already set window state in our constructor and respect that. Change-Id: I54fe6c4ebcd3c9504614d2d48bd21f0d76adf3b7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Remove requestWindowOrientation from QIOSWindowTor Arne Vestbø2013-02-274-44/+2
| | | | | | | | | | | | | | | | | | | | | The API is scheduled to be removed in qtbase in time for Qt 5.0. Change-Id: Ie34d6cb79fcd81b0ce02892529e3e7184ddfa096 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * iOS: Don't recreate paint device on beginPaint()Morten Johan Sørvig2013-02-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This causes painting errors. Use one lazily-created device that is used for the lifetime of the backing store. Change-Id: Ib36b6f1d6c9f958304dc8403cf17e5d71136469a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: use 'self' rather than 'super' pointer in initWithQIOSWindowRichard Moe Gustavsen2013-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | If we use super, our own initWithFrame override will never be called. Change-Id: I606beb653239cdfc46f41db4ec0791dfa5d4edea Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>