summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaintegration.mm
Commit message (Collapse)AuthorAgeFilesLines
* Cocoa: Fix zombie NSScreen crashGabriel de Dietrich2013-01-041-7/+12
| | | | | | | | | | | | While the Cocoa documentation says we should not cache [NSScreen screens], it seems that we should not cache its referenced objects either. This caused a crash in desktop components when using Dial because, given the way it is being rendered, we need to know the screen pixel ratio. Task-number: QTCOMPONENTS-1279 Change-Id: If5c3c6f14d04925215b9dca011143a2056a68846 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Implement Cocoa KeyMapper.Morten Johan Sorvig2012-12-071-0/+6
| | | | | | | | | | Port Qt 4 implementation. Shortcuts such as shift-5 should now work. Change-Id: I1d8c4c6c4a903142361996b558ee31c8549fcef6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Basic high-dpi "retina" support for Qt 5.Morten Johan Sørvig2012-12-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Bring Qt 5 on par with Qt 4, prepare for more comprehensive support later on. Introduce device independent pixels (dips), device pixels, and devicePixelRatio. Add high-dpi support to QPainter, QGLWidget, the cocoa platform plugin, mac and fusion styles. Dips are similar to CSS pixels, Apple points and Android density-independent pixels. Device pixels are pixels in the backing store/physical pixels on screen. devicePixelRatio is the ratio between them, which is 1.0 on standard displays and 2.0 on "retina" displays. New API: QImage::devicePixelRatio() and setDevicePixelRatio() QPixmap::devicePixelRatio() and setDevicePixelRatio() QWindow::devicePixelRatio() QScreen::devicePixelRatio() QGuiApplicaiton::devicePixelRatio() Change-Id: If98c3ca9bfdf0e1bdbcf7574cd5b912c9ff63856 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Cocoa: Disable accessibility.Morten Johan Sørvig2012-12-011-2/+2
| | | | | | | | | The accessibility implementation is unstable and causes application crashes. Disable until it has been stabilized. Change-Id: Ic34361a0ad599c6f92df722499d274fe0655646b Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Implement EditableText accessibility for Mac.Morten Johan Sorvig2012-11-151-1/+2
| | | | | Change-Id: Ibe03975bafc5a6a420b3bd69dfaa93dbf65c9958 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Support native event filter for Mac OS XLiang Qi2012-11-091-1/+4
| | | | | | | | | | | Ported from Qt 4 implementation, updated with QAbstractEventDispatcher::filterNativeEvent() call. Tested with an example. Change-Id: I3271f8a565d06d80b7b48ba81728bcdb7b1c32e3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: Fix fonts on retina displays.Morten Johan Sørvig2012-11-021-4/+3
| | | | | | | | | | | | | | | | | | | Hardcode logical dpi to 72 again. NSDeviceResolution gives us the physical dpi (144) and results in double- sized fonts in Qt. QPlatformScreen does not currently have a physicalDpi virtual, perhaps this can be added later on. Unfortunately the usefulness of a per-screen correct DPI metric seems questionable to me: 1) The value returned by the system is not correct, pixels per inch on the rMBP is around 220. 2) Qt always uses the dpi for the main screen, via qt_defaltDpiX/Y. Change-Id: Ia35804be62ee7f1c623bad854f65d744dc9075d4 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Added MultipleWindows platform capability.Samuel Rødal2012-11-021-0/+1
| | | | | | | | | | | | | | Several platform plugins, like eglfs, kms, etc don't support multiple windows as there's no system compositor, they're rendering directly to a single back buffer. By adding a platform capability we'll be able to provide better error reporting when an application tries to create multiple QWindows on a single-window platform. Also, QML apps can use this capability to figure out whether they should create a QWindow for dialogs / popups / menus, or whether to just create items in the same scene, that are shown on top of the rest of the content. Change-Id: I15b8d21ee2bc4568e9d705dbf32f872c2c25742b Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Compile cocoa with QT_NO_ACCESSIBILITYJan Arve Saether2012-11-021-0/+6
| | | | | Change-Id: I82b5dbf1bce94bd928eee207992c0036edc527ad Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Mac: Add support for WindowMasks platform capabilityGabriel de Dietrich2012-11-021-5/+8
| | | | | | | | Also brings back a working QWidgetPrivate::setMask_sys(). Change-Id: Idde9eea15d28bb0299258df81322a5a3ff0b9493 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* osx: support for QScreen changes at runtime, and physical dimensionsShawn Rutledge2012-10-081-19/+81
| | | | | | | | | | | | | QScreen's physical size and logical DPI come from the operating system. Physical DPI is calculated as pixel size / physical size. Whenever the user changes the display settings, applicationDidChangeScreenParameters is called; QScreens are created and destroyed when displays are added and removed, and each QScreen which continues to exist gets updated properties from the OS. Change-Id: I7f2e9e32a3ad53d73ea987f39a0c62fa8dd22b05 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Load Mac specific resources when used in a static buildAndy Shaw2012-09-201-0/+7
| | | | | | | | | When Qt was built statically then the Mac specific resources were not being loaded which meant some style specific images were not used. Task-number: QTBUG-25391 Change-Id: If311148df19a87b6c8104553b662e3bf157f5717 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* CocoaPlugin: remove autoreleasepool warnings on 10.6Richard Moe Gustavsen2012-09-101-0/+1
| | | | | | | | | All examples running on 10.6 complained about missing autoreleasepools. This patch adds them in where they were missing. Change-Id: I18a1ddf486efdd1ece82d82d111b46e2ef064ff1 Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
* Add hint for touch -> mouse event synthesizingMorten Johan Sorvig2012-08-221-0/+3
| | | | | | | | | | | | | | | | | Commit 7808ec79 changes QApplication to synthesize mouse events from (unhandled) touch events. On Mac OS X this creates a conflict for two-finger scroll swipes, which generates both touch events and mouse wheel events: scrolling in QTextEdit will also select the text. Add a SynthesizeMouseFromTouchEvents platform style hint that enables the event synthesising. Set to true by default and false in Cocoa. Change-Id: I1ffa5a141476aa38b81ce92a87eff676c7ec2276 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* QtGui: use new qEnvironmentVariableIsEmpty()Marc Mutz2012-08-141-1/+1
| | | | | | | | In particular, static bool showRasterOverlay is safer. Change-Id: I9df6c9a9a56d2e61b13391b6889c0ac6e259e801 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPlatformScreen::grabWindow() support on MacTasuku Suzuki2012-07-061-0/+61
| | | | | | | | Added QCocoaScreen::grabWindow() and copied Qt 4 implimentation. examples/desktop/screenshot works but WId window is not handled yet. Change-Id: If228bb59d98a5166788ab38293d7e6a6300d1f85 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: re-enable getUrl: and appleEventQuit: AppleEvent handlersBradley T. Hughes2012-06-121-1/+7
| | | | | | | | | | | | | | | | | | | The getUrl: and appleEventQuit: handlers are only called if we register them with the NSAppleEventManager. The Cocoa documentation says the best place to do this is in the applicationWillFinishLaunching: delegate method, so add this method and move the code from qcocoaeventdispatcher.mm to there. Since QCocoaApplicationDelegate is only used when AA_MacPluginApplication is not set, we do not need to check again in the delegate code. Be sure to remove these event handlers when shutting down the application. For the getUrl: handler, send file open events when receiving this event. This restores Qt 4 behavior. Remove the qDebug() from the appleEventQuit: handler. Change-Id: Ibcbdd541695176e3d236366d4d541e4811882d6c Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Remove QtWidgets include.Morten Johan Sorvig2012-06-111-3/+0
| | | | | | Change-Id: I39ff73ce0dbfe36634b5331538165e636f62e57c Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix font rendering gamma correction on MacJiang Jiang2012-05-231-0/+7
| | | | | | | It needs a 2.0 gamma (as in Qt 4) in platform plugin styleHint. Change-Id: I2286532c607554c41baee4fa348cd7899bf010e1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* QPA menu abstraction, originally based on Morten's workJames Turner2012-05-191-1/+0
| | | | | | | | | | Create a QPA abstraction for native menus, derived from the Cocoa support in 4.8, but with the expectation to support other platforms too. Update the QtWidget QMenu and QMenuBar code to maintain their QPA equivalents if they exist. Change-Id: Id605de3da8811dc832bf48b35f9107778ad320ff Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Expose QPA API under qpa/*Girish Ramakrishnan2012-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main reasons for doing this are: 1. _qpa.h end up in the master QtGui include file. QtGui is meant for userland applications. qpa code is neither binary nor source compatible. Inadvertant use of QPA api makes the user code binary-incompatible. 2. syncqt creates forwarding headers for non-private header files. This gives people the impression that this is public API. As discussed on the mailing list, even though QPA api is internal and subject to change, it needs to treated differently from private headers since they will be used by in-qtbase and out-of-qtbase plugins. This commit does the following: 1. The _qpa in QPA header files is dropped. 2. syncqt now treats any file with qplatform prefix as a special file and moves it to qpa/ directory. The recommended way of using QPA API in plugins is: #include <qpa/qplatformfoo.h>. This allows the user include QPA API from multiple modules (for example, qplatformfoo might be in QtPrintSupport) 3. The user needs to explicitly add QT += <module>-private to get access to the qpa api. 4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo includes. This commit does not change the cpp filenames. This requires a more careful merging of existing non qpa cpp files and existing cpp files on a case by case basis. This can be done at anytime. The following files are not renamed as part of this changed but will be fixed as part of a future change: src/gui/kernel/qgenericpluginfactory_qpa.h src/gui/kernel/qgenericplugin_qpa.h src/gui/kernel/qwindowsysteminterface_qpa.h files were renamed using for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done includes were renamed using script for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include <qpa/\L\1.h>,g' \ -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include <qpa/\L\1_p.h>,g' \ -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include <qpa/\2\3>,g' \ -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include <qpa/\2\3>,g' \ $file done Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix ownership / lifetime of QCocoaNativeInterfaceJames Turner2012-04-121-1/+2
| | | | | | | | Change-Id: I21dd1e3186e0dbbc60294f807de0db6aad8b9eee Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Add Mac OS X backend for QDesktopServices.Christoph Schleifenbaum2012-04-111-0/+6
| | | | | | Change-Id: Ie48844ed93385c8aef9ae0765b7a3d26583ed642 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: Implement screen availableGeometry.Morten Johan Sorvig2012-03-211-2/+6
| | | | | | | | As usual the y coordinate needs to be inverted. Change-Id: Iac9b48f9bdb475a3d5a76b930c2e138a625f1ef8 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Implement cocoa clipboard support.Morten Johan Sorvig2012-03-151-1/+13
| | | | | | | | | | | | | | | Add QCoccoaClipboard which wraps the existing QMacPasteboard implementation. Remove unused QClipboard integration code from qmacclipboard.mm Change mime type cleanup from using qAddPostRoutine to using an explicit call to destroyMimieTypes in the cocoa platform integration destructor. This is necessary to ensure cleanup happens in the correct order on app shutdown. Change-Id: Ief0e0d996b04c8e84e9fd2cd3a17fb5bd73bb761 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Refactor theme plugin loading.Friedemann Kleint2012-03-151-3/+9
| | | | | | | | | | | | | | | | | | | | In the old implementation, the QPlatformIntegration was asked for the theme first, so there was no way of overriding that by a custom plugin. Also, there was a memory leak in case the platform theme was actually created by a plugin. QGuiApplication now asks the QPlatformIntegration for a list of potential theme names first, tries to load them using the plugin loader and finally invokes a factory method of QPlatformIntegration in case that fails. The theme is now owned by QGuiApplication. In the XCB plugin, the environment variable DESKTOP_SESSION is queried and appended to the list of themes, making it possible to load plugins for other session types. Change-Id: I1a4b4e061815bca16c65b23e591bb7563a3e44e2 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Input method on MacTasuku Suzuki2012-03-121-0/+7
| | | | | | | | Restore input method implimentation in Qt4 Task-number: QTBUG-23867 Change-Id: I5d405ccc8b0a73c399d992f6474a0cc38d191157 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* QCursor: Associate cursor with screen.Friedemann Kleint2012-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | - Introduce cursor() accessor to QPlatformScreen. - Remove screen member of QPlatformCursor (a cursor can be shared by multiple screens of a virtual desktop). - Add QCursor::pos()/ QCursor::setPos() taking a QScreen-parameter, use primaryScreen() for old overloads. QCursor::pos() can then query the platform cursor for the position and return the position even if the mouse position is outside the windows owned by the Qt application. - Fix tests Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Task-number: QTBUG-22457 Task-number: QTBUG-22565 Task-number: QTBUG-20753 Change-Id: Ia69f37343f95772e934eab1cd806bd54cbdbbe51 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Cocoa: Implement Drag-and-Drop.Friedemann Kleint2012-03-071-1/+8
| | | | | | | | | | Implement drag and drop support for drags originating from outside Qt. Port mime and pasteboard code from Qt 4. Use QSimpleDrag from from platform support to implement internal Qt drags. Change-Id: I5b664a95ebb00f48de2bd21c24dfb579af16123e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix QApplication autotest crash when running on multiple screensMiikka Heikkinen2012-03-021-0/+6
| | | | | | | | | | Screens need to be destroyed in reverse order to ensure the primary screen stays valid when other screens are destroyed. Task-number: QTBUG-24300 Change-Id: I9d9d710aa67ec045baa8bf292833ffe7d9eea935 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Introduced BufferQueueingOpenGL capability in platofrm integrationGunnar Sletta2012-02-011-0/+1
| | | | | Change-Id: Iedb7255862fd3a11aceae0e06e90a5539febc7e7 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Clean up QCocoaIntegration destruction.Morten Johan Sorvig2012-01-141-6/+7
| | | | | | | | Fix memory leak - delete the font database. Remove the NAApplication delegate. Change-Id: I7c69eb4df01c8450c0abde360f77fbb318b20c83 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cocoa: Add autorelease pools.Morten Johan Sørvig2011-12-121-0/+2
| | | | | | | | | | | | | A couple of cases where we call Cococa APIs without having an autorelease pool in place surfaced after removing the global autorelease pool in 1a218a7. (This happens when when Qt API is called before app.exec() has started the Cocoa event loop.) Add local autorelease pools to prevent memory leaks. Change-Id: I0c4be3ff102aaff4539235857f95ab29fdbc9d70 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
* Cocoa: remove autoreleasepool in QCocoaIntegrationMorten Johan Sorvig2011-12-081-3/+0
| | | | | | | | | | | | | This one was far to long lived and would delay releases until application shutdown. We might get more "no autoreleasepool in place" warnings now, these should be fixed by adding local auto release pools. Change-Id: Ia7a46ab05fb1937154997d0c47b8899d2a0cef65 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
* Fix image format use in cocoa pluginGunnar Sletta2011-12-011-1/+1
| | | | | | | | | | | | The screen should be opaque. It is used to create the default pixmap data which should be RGB32 on mac. The backing store uses premultiplied in the resize but initializes with non premultiplied. Unify this to all premultiplied Change-Id: I7d17d492fcff30b555a768da852ff9be0a9d96aa Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Mac Core Text font database for QPAJiang Jiang2011-11-301-2/+2
| | | | | | | | | | | | | | Add Core Text fontdatabase for Mac and use it as default. It also reenabled Core Text font engine for native font rendering on Mac, though it's not used in declarative UI (by default declarative will still use scenegraph, which will only use this font engine for retrieving font metrics and outlines). With the new fontdatabase it's now possible to load all the fonts installed in the system as well as adding application fonts. Change-Id: I0d2aa1420019adf6d0f70dd147a9d71b2684d3f1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Factor out QPlatformTheme from QPlatformPlugin.Friedemann Kleint2011-11-111-29/+4
| | | | | | | | | | | | | | | | | | Implement QCocoaPlatformTheme. The menus and dialog API is moved from the platform to the theme plugin. (Both APIs contain references to QtWidget classes, which we are working towards removing.) The theme plugin is created after the platform plugin, first by asking the platform plugin, then by looking for a separate plugin if the platform does not specify a theme. Initial-patch-by: Morten Sorvig <msorvig@trolltech.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Change-Id: I2778cdd3a205c4ce35ead93e39fe6b4cd58a39f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Cocoa cursor support: Add QCocoaCursor.Morten Sorvig2011-11-081-1/+4
| | | | | | | Port the Qt 4 mac implementation. Change-Id: I3bc6fd0b5a0398dcf43a5aaa3b498bb74b42c105 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Native file dialog support for MacMorten Sorvig2011-10-271-0/+26
| | | | | | | | | | * New API: QPlatformDialogHelper to support native dialog on QPA. (Currently, It supports only file dialog.) * Modify QDialog* and QFileDialog* to support native dialog. * Add native file dialog support to cocoa platform plugin. Change-Id: I957f046748a27a33fd9f8af3c525feabd1b0f582 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: clean up compiler warnings.Morten Sorvig2011-10-231-1/+1
| | | | | Change-Id: I2cb65bb455b79b218a317b21e5a3b0d9792e0e22 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Accessibility plugin for mac and xcb.Frederik Gladhorn2011-10-141-0/+9
| | | | | | | | | | Instead of creating new instances of the class whenever accessibility() is called, create one on startup. Change-Id: Idd5b06ee935d7acf4934b98882d254a1ef0ca04e Reviewed-on: http://codereview.qt-project.org/6435 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Use freetype font engine on WindowsOlli Werwolff2011-10-101-2/+2
| | | | | | | | | | | | | | | As windows' fontdatabases also uses functionalities from qbasicunixfontdatabase it was renamed to qbasicfontdatabase. But instead of iterating over the font directories' files it uses system calls to obtain the list of fonts and uses registry values to find the according filenames to add. The native font engine was still kept. It can be activated by adding fontengine=native as platformargument. Change-Id: I7197bed5d18b8a33d4aa97ce91bfa1cd281b80ea Reviewed-on: http://codereview.qt-project.org/5839 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> Sanity-Review: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Improved logical and physical DPI APIs.Samuel Rødal2011-10-061-1/+1
| | | | | | | | | | | | | | Made physicalSize() return QSizeF instead, to prevent rounding errors. Added logicalSize() as the base to compute font pixel sizes instead, and added convenience functions in QScreen to access the logical and physical sizes and DPI metrics. Task-number: QTBUG-21736 Task-number: QTBUG-21737 Change-Id: Ic705dc98eb3632617659e65a0c9a552673dc0c65 Reviewed-on: http://codereview.qt-project.org/5888 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Cocoa: Add env variable for disabling foreground.Morten Sorvig2011-10-041-12/+14
| | | | | | | | | | | Setting QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM prevents the process from having an dock icon and taking focus. Change-Id: Id127967d8ec1dadda790128f36a7c1f50d581433 Reviewed-on: http://codereview.qt-project.org/5968 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Zeno Albisser <zeno.albisser@nokia.com>
* Cocoa: Enable native menus.Morten Sorvig2011-09-221-4/+4
| | | | | | | | | | Fix menu duplication bug: make QCocoaMenu::addAction do nothing before the native menu has ben created. Change-Id: Ifca192421f2073264de9f5faeb053008ecb8532e Reviewed-on: http://codereview.qt-project.org/5135 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: QMenu refactor.Morten Sorvig2011-09-071-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change prepares for enabling native menus on OS X. Move code from src/widgets to cocoa: - qcocoaapplicaiton - qcocoaapplicaitondelegate - qcocoamenuloader - qcocoamenu - qmenu_mac - misc helpers to qcocoahelpers Create a QNSApplication and QCocoaApplicationDelegate at application startup. New Lighthouse API: - class QPlatformMenu - class QPlatformMenuBar - QPlatformIntegration::createPlatformMenu() - QPlatformIntegration::createPlatformMenuBar() Platforms that wants a native menu integration subclasses QPlatformMenu[|Bar] and implements the create function. The default implementation returns 0, which causes QMenu to use the standard Qt menus. This API is based on the current native menu abstraction that Mac, Wince and S60 uses in Qt 4. The main difference is that the platform classes are proper standalone classes and not #ifdeffed into QMenuPrivate. Change-Id: I3da41f80b0ae903a476937908b1f9b88014b7954 Reviewed-on: http://codereview.qt.nokia.com/4068 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>