summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
Commit message (Collapse)AuthorAgeFilesLines
* Refactor theme plugin loading.Friedemann Kleint2012-03-152-10/+38
| | | | | | | | | | | | | | | | | | | | 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>
* Fix LSB buildHarald Fernengel2012-03-141-2/+3
| | | | | | | | Fix compliation in LSB by removing legacy calls and adding an explicit header. Change-Id: I13a73211c07457195b5d5aad0854643da1e25f9b Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Use the lazily-queried families for all QPA multi font engines.Pierre Rossi2012-03-144-8/+6
| | | | | | | | | This is the approach introduced together with the WebKit "backdoor" that lets us use QRawFont with QTextLayout. We could use it all over the place and share more code. Change-Id: Ie1963679755f37ba9204d67554a163f1d1115604 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* remove obsolete qudevhelper and adopt mouse and touch pluginsJohannes Zellner2012-03-143-135/+2
| | | | | | | | | | | | The QUDevHelper class is now replaced by QUDeviceHelper class. All evdev input plugins are using the new udev helper now to enable hotplugin for keyboard and mouse input. EvdevTouch plugin still only uses the first detected device by udev, this cannot be tested on my side, due to the lack of multiple touch input devices. Change-Id: I01a4cfe1a80000bfb27c67a2f53faf560906b73c Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
* Fix QFont hinting preference with fontconfigBalazs Kelemen2012-03-121-18/+31
| | | | | | | | Consider if the hinting preference of the QFont is not PreferDefaultHinting. Change-Id: I0f50b320356787b6c1eabee5f009e7d326a06925 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Fix a performance regression with shouldLoadFontEngineForCharacter.Pierre Rossi2012-03-082-14/+38
| | | | | | | | | Calling FcFontMatch should be avoided as much as possible. We can simply cache the patterns it returns, which should still save memory compared to loading all font engines as we did before. Change-Id: I67208a4f919338a948535f717cfd0139dbea2e5f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* replace uses of QMAKE_INCDIR_QT and QMAKE_LIBDIR_QT with module-specific ↵Oswald Buddenhagen2012-03-081-1/+1
| | | | | | | variables Change-Id: Id410887fa97f345a229e0cbf395633ccf303fa2f Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Add fonts to QPlatformTheme.Friedemann Kleint2012-03-072-10/+64
| | | | | | | | | | | | | | | | - Remove QPlatformFontDatabase::defaultFonts() returning a hash containing widget name ->font and the Windows implementation. - Add enumeration and font accessor to QPlatformTheme. The value returned for the enumeration value overwrites the default font of the font database. - Implement for Windows, Mac and KDE. - Add more Windows palettes. Task-number: QTBUG-23686 Change-Id: I8a2abdfd216df23daa7c9630c54264cdf61295db Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Fix support for scripts that require OpenTypeEskil Abrahamsen Blomfeldt2012-03-072-2/+2
| | | | | | | | | We need to load OpenType tables when initializing fonts for scripts that require them. This fixes support for many Brahmic scripts. Change-Id: Ib5e50f2c7e5edb4b3e3ecf9fd004f2cf62634add Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Query udev build parameters from pkg-configDonald Carr2012-03-071-0/+2
| | | | | | | | Change-Id: Ia3b7329d7359684ee7bf572a7e5fb681105108f4 Reviewed-by: Donald Carr <donald.carr@nokia.com> Reviewed-by: Holger Freyther <holger+qt@freyther.de> Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add missing Q_OBJECT macro to QCoreTextFontEngineTasuku Suzuki2012-03-061-0/+1
| | | | | Change-Id: I5d6b4742265a026d404d5ffa48f2c554d5483f30 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Change bugreports.qt.nokia.com -> bugreports.qt-project.orgSergio Ahumada2012-03-021-1/+1
| | | | | Change-Id: Ia795098f24cf358b15067f54cd08dff0bd792bc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the LIBS from platformsupportJørgen Lind2012-03-022-2/+0
| | | | | | | | | The application / library that uses this should know it needs to link to ie. udev, xrendr etc. Change-Id: I9e3ffd4d98b3bd66abb8e621378b010da7feda7a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
* Refactor the QPA dnd interface.Friedemann Kleint2012-02-295-101/+465
| | | | | | | | | | | | | | | - Give QPlatformDrag a synchronous drag() function returning the Qt::DropAction - Move the base functionality for asynchronous event handling to the platformsupport library as QBasicDrag (extendable base class handling drag icon and providing new virtuals) and QSimpleDrag (sample implementation for drag within the Qt application). - Change the Windows implementation accordingly. - Change XCB to be based on QBasicDrag. - Clean up QDragManager. Change-Id: I654f76f0e55a385ba189bd74f3ceaded6a8fe318 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Add UDev helper class for evdev pluginsJohannes Zellner2012-02-244-2/+336
| | | | | | | Adopt evdevkeyboard plugin to use new UDev helper Change-Id: Ie914c77dde9a28a8cf7f7cd972acd963c13bc698 Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
* Fix fontconfig.pri file to allow QPA plugins to buildSean Harmer2012-02-231-2/+2
| | | | | Change-Id: I5ebcffb7153f4216d69921d4818051e6b3d14d8a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Add further theme hints to QPlatformTheme.Friedemann Kleint2012-02-221-1/+18
| | | | | | | | | | | | | | | | - Add hints for QDialog/QDialogButtonBox. - Add hint for available popup-menu area. - Add keyboard scheme hint replacing QGuiApplicationPrivate::currentKeyPlatform() Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Task-number: QTBUG-24204 Task-number: QTBUG-24315 Change-Id: I6653786b0dcb49a6fc264d3b9891dbfee502bd3e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Use new plugin system for Input Context plugins.Friedemann Kleint2012-02-211-1/+1
| | | | | Change-Id: Ifd1f63499afba546a745815762263a58ebf66460 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add palette() and further hints to QtGui/QPlatformTheme.Friedemann Kleint2012-02-177-6/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | - Move palette() from deprecated QtWidgets/QGuiPlatformPlugin to QtGui/QPlatformTheme, Make it return a const * since QPalette does not have isNull(). - Initialize QGuiApplication::palette() and QApplication::systemPalette() from it. - Do not initialize QPalette from QGuiApplication::palette() unless app_pal is non-null (default to Qt::black if it is 0). This avoids initialization order crashes/recursions in the QPA plugin. Streamline initialization function. - Remove styleName(), systemIconThemeName() and iconSearchPaths() from QGuiPlatformPlugin and re-add them as QPlatformTheme::themeHint(). - Remove styleHint() from QGuiPlatformPlugin, add it to QPlatformTheme::themeHint(). - Add UNIX themes with factory function (Generic, KDE, Gnome), taking it from Qt 4.8 code (stripping the KDE 3 code). - Implement Windows palettes. Task-number: QTBUG-24204 Change-Id: Ie27ec035df4f84c42deaffc4816b2e53ce705462 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Remove historical +1 from font height calculationEskil Abrahamsen Blomfeldt2012-02-171-3/+1
| | | | | | | | | | | Historically, we've calculated font height as ascent+descent+1. In Qt 4, a patch was added to work around this by subtracting 1 from the descent of the font engines. We now remove the +1 and the work arounds. Change-Id: I7e25d49b97ac892015d3328f32d70eb9a7c2d88f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Avoid loading and keeping unused fallback font enginesEskil Abrahamsen Blomfeldt2012-02-175-4/+161
| | | | | | | | | | | | | | | | | | | | | | | | | When we request glyphs from fallback fonts, we would potentially load all fonts on the system into memory. This is especially true for glyphs that are not supported by any font (or by the last in the list) in any "Common" script (which e.g. includes CJK). This would make any application which tried to display unsupported glyphs use huge amounts of memory for keeping unused fonts cached, only limited by the number of fonts on the system. The patch contains two solutions: First, before loading the font, the multi font engine will be asked whether it needs to be tried for the given character. By default, this will always be true, so all fonts will be tried, but with the new font config multi engine in the platform plugin, it will ask FontConfig whether the font contains a glyph for the character. Should the font be loaded and still fail to resolve the character (which could be the case for other platforms), we will simply delete it again immediately instead keeping it cached. Change-Id: I92dfb39289a359f49caa02c2caf8baf66098fb59 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add QPlatformServices class.Friedemann Kleint2012-02-105-0/+233
| | | | | | | | | | | | | | | - Add QPlatformServices as back-end for QDesktopServices. - Bring back UNIX/Linux desktop detection in platformsupport as a generic implementation. - Add Windows implementation. Reviewed-by: Morten Johan Sorvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org> Change-Id: If94bb65755df4f849edd83c57143ee2c73002137 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Add support for "none" QT_IM_MODULEJan Arne Petersen2012-02-101-1/+4
| | | | | | | | Do not try to load any input method when QT_IM_MODULE is set to "none". Change-Id: I695cb76d616bb2ce5021979bae2790b2f286122d Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Properly read back the actual format in xcb and xlib plugins.Samuel Rødal2012-02-102-7/+12
| | | | | Change-Id: Iccef2c4a87863b93914b84edf3a6015dad5e512a Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* More graceful handling of QSurfaceFormat::samples() with GLX.Samuel Rødal2012-02-101-1/+1
| | | | | | | | | | Earlier, if we asked for say 16 and the implementation only handled 4, we defaulted to 0 (no antialiasing). Now, we instead try a progressively lower number until we find a match. Task-number: QTBUG-22669 Change-Id: I3d89f2a302f9c6195e2d43827006fd015d981ce7 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* More graceful handling of QSurfaceFormat::samples() with EGL.Samuel Rødal2012-02-101-4/+10
| | | | | | | | | | Earlier, if we asked for say 16 and the implementation only handled 4, we defaulted to 0 (no antialiasing). Now, we instead try a progressively lower number until we find a match. Task-number: QTBUG-22669 Change-Id: I63f4b8aadf8e06713d19fdc9b9d73672162c816a Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Use qgetenv instead of getenv.Andreas Holzammer2012-02-081-1/+1
| | | | | | | | | Use the Qt Version because platforms like Windows CE don't support getenv. Change-Id: I95ca4d7194e09889ab228af80e679a3c34479e41 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Reorganize evdev pluginsLaszlo Agocs2012-02-084-0/+138
| | | | | | | | | | | | | | | | | | | | | | | | | linuxinput becomes evdevmouse. The experimental touch code is removed, now the plugin's purpose is solely to generate mouse events from absolute and relative pointer events. The plugin key is EvdevMouse. touchscreen becomes evdevtouch. The plugin key is EvdevTouch. In case keyboard support appears some day, it will fit nicely in the system by the name of evdevkeyboard or similar. Some little udev code is moved to platformsupport so it can be shared between the plugins. This may be extended later if more sophisticated udev support is needed. N.B. the intention is to keep this as simple as possible. We are shipping these plug-ins as reference examples, not as full-featured drivers. evdev and udev support has configure time tests from now on. This means the "drivers" (generic plugins) will get built automatically when the support is available. Change-Id: Iaf6260b5c2edfb9f25d070d2764466725adc6b4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Move QString <-> NSString conversion to QtCoreMorten Johan Sorvig2012-02-021-5/+2
| | | | | | | | | | | | | | | | Add (private) API to QCFString: static QString toQString(NSString *) static NSString *toNSString(const QString &) Add implementation to qcore_mac_objc.mm. Keep the mac_cpp since it's used for building qmake as well as bootstrapping. Replace usage of NSString conversion functions in the cocoa and corewlan plugin with QCFString. Change-Id: I9f34edd5231255aef9d8d6e9a60306174bb279b3 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Revert "Put the generated <module>version.h into build tree"Bradley T. Hughes2012-02-011-1/+1
| | | | | | | | | After discussion with Liang, I'm reverting it as he requested. This change put every header into the SYNCQT.HEADER_FILES twice for in-source builds, and the qtMODULEversion.h header did not include a path component. This reverts commit 2fbc45b58bba860abf67fb28aa1319c9f4ededaf Change-Id: Ie84cef19193ce5e49072f1f67a41140d9d2673b8 Reviewed-by: Liang Qi <liang.qi@nokia.com>
* Windows: Fix compilation with -qtnamespaceKai Koehne2012-01-312-1/+10
| | | | | Change-Id: Ib006d74299d65e5872a5a524eaa937e127306ec7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Mac: Fix compilation with -qtnamespace setKai Koehne2012-01-312-1/+9
| | | | | | Change-Id: Id3b9f4e3edf2caeac32c8a44278cdf05a1fc70fb Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Remove Symbian specific code in platformsupport.Xizhi Zhu2012-01-301-1/+1
| | | | | Change-Id: I5f06f80ae47b2c9fcd93832c23a453a9193e6120 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3035-35/+35
| | | | | | | | | | 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>
* Put the generated <module>version.h into build treeLiang Qi2012-01-281-1/+1
| | | | | | | | | It was put in source tree before. Task-number: QTBUG-20439 Change-Id: Ib52d9c2e83ae375aad259ddc74138bbc728b3ed0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fall back on glXChooseVisual() if glXChooseFBConfig() doesn't work.Samuel Rødal2012-01-271-9/+66
| | | | | | | | | | Some older drivers don't fully support glXChooseFBConfig(). As a bonus, fix some memory leaks here and there. Task-number: QTBUG-21880 Change-Id: Ie306dee27f616927a6aa55fd71601569b828afcc Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-252-2/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Move glyphMargin() to QFontEngineJiang Jiang2012-01-242-7/+8
| | | | | | | | | | | | | glyphMargin() support for QTextureGlyphCache is implemented in respective font engines, thus this function is platform dependent. Before Qt 5 the code is guarded in macros like #ifdef Q_WS_MAC, now we should move them into QFontEngine and its subclasses. So far only Windows font engines support it. FreeType and Core Text based font engines all ignore it. Change-Id: Ia14016533d8fbfaacf848a7d3bc928f8197318f5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-2335-35/+35
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Added xrender as a dependency to build glxconvenience.Samuel Rødal2012-01-061-1/+1
| | | | | | | Prevents build errors when xrender is not present. Change-Id: Ib80d52109dd0bcd63ba865c5f6e143961f3c20e6 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-0535-35/+35
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix rare crashes in fontconfig fontdb due to uninitialized variableSimon Hausmann2012-01-041-1/+1
| | | | | | | | | Initialize the out variable passed to FcPatternGetString to protect against the "failure" case. Otherwise the subsequent QString::fromUtf8 is called with an uninitialized pointer. Change-Id: I31b8b4c366f673609b26eca162334fd8bc9f25d2 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Link to X and Xrender libs in glxconvenienceJørgen Lind2011-12-231-0/+1
| | | | | Change-Id: I54b2704be678f2c3b9ab8d24d044977c9c01e98e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename QEventDispatcherQPA to QUnixEventDispatcherQPA.Robin Burchell2011-12-154-18/+18
| | | | | | | | | This removes confusion when we add a Linux-specific QPA dispatcher, and is technically more accurate, as QEDQPA was not 'the' QPA event dispatcher in the first place. Change-Id: I2a41d425f284522ee76ef86782d5eb2bdd805120 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Cocoa: Add autorelease pools.Morten Johan Sørvig2011-12-121-2/+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>
* Better handling of GLX / EGL errors.Samuel Rødal2011-12-072-6/+8
| | | | | | | | | | If context creation fails, try again without a shared context. Added QPlatformOpenGLContext::isSharing() and QPlatformOpenGLContext::isValid() to propagate whether the platform context was successfully created with or without sharing. Change-Id: I37080b645f531fd207946441057be6d3f6be3f6e Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Remove QCoreTextFontEngineMultiJiang Jiang2011-12-042-357/+0
| | | | | | | | It's not used anymore since we have switch to HarfBuzz on Mac. Change-Id: I68252fbe3021f54dacac5a901184c3f3e541a6b7 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Enable subpixel rendering for raster on MacJiang Jiang2011-12-042-1/+11
| | | | | | Change-Id: I06e6465e03c17776974d361254abf5b750736080 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Add QRawFont from data support to Mac font dbJiang Jiang2011-12-012-0/+24
| | | | | Change-Id: I02f1c4b35b9ed585e72aa4bad9b75d3c098f8e62 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Set supporting writingSystem correctlyJiang Jiang2011-12-011-1/+2
| | | | | Change-Id: I963aa7b69a48441619c5885c443ae2620fcc4e57 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>