summaryrefslogtreecommitdiffstats
path: root/src/plugins/printsupport/windows
Commit message (Collapse)AuthorAgeFilesLines
* Replace #ifdefs with qmake feature checks.Ulf Hermann2015-06-222-7/+0
| | | | | | | | This prevents the building of dysfunctional plugins that don't define a loader function, or won't compile at all. Change-Id: Ib62edb8db4a8917effa05292cb702bb4022f552c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QPA plugins: Use _iid macros instead of strings in Q_PLUGIN_METADATA.Friedemann Kleint2015-05-131-1/+1
| | | | | | | | | This makes it easier to change the version numbers by changing the macros in QtGui. Task-number: QTBUG-46009 Change-Id: I94c9591ec6f7c9173a698df9e1fe8fd6a904caf4 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Clean up API of QPlatformPrintDevice (QPA).Friedemann Kleint2015-05-052-24/+0
| | | | | | | | | | | | | | | | | | | | | The class inherited QSharedData, had a non-virtual clone() function and a non-virtual operator==() which compared QPlatformPrintDevice::id(). Derived classes implemented clone() and operator==() comparing ids to no effect. The class does not have any setters modifying its values, so detaching, copying and assigning does not make sense. Remove the inheritance, clone(), and operator==() and make the class a non-copyable base class. Use a QSharedPointer instead of a QSharedDataPointer to store it in QPrintDevice. Remove copy constructors and clone() reimplementations that were never called in implementations. Found while investigating QTBUG-44991. Task-number: QTBUG-44991 Change-Id: Ib79354b37048d04d50d936f1d0ae06c36efaac00 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Use QT_WARNING_.. instead of #pragma GCC diagnostic ..Konstantin Ritt2015-04-071-4/+2
| | | | | Change-Id: I0bb55a7f1074f3b8d6fb681b1d4dab5105ae7569 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-311-2/+16
|\ | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| * Improved Windows printer support and fixed crashes due to NULL devModeMike Kuta2015-03-061-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With certain printer drivers, the PRINTER_INFO_2 can return NULL for the pDevMode member in the call to GetPrinter() as mentioned on MSDN: https://msdn.microsoft.com/en-us/library/windows/desktop/dd144911 In many places, Qt first checks that devMode isn't NULL before dereferencing it. In other places it does not (such as when it actually attempts to print in QWin32PrintEngine::begin()). Checking every dereference aside, most printer functionality is removed without access to the DEVMODE structure. This fix uses DocumentProperties() to get the DEVMODE information when the first method fails. [ChangeLog][QtPrintSupport][QPrinter][Windows] Improved Windows printer support and fixed crashes due to NULL devMode Task-number: QTBUG-44349 Task-number: QTBUG-43877 Task-number: QTBUG-2251 Change-Id: Iafa337055d967c70f2096dcde4cc9c8ca8a0d252 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | Update copyright headersJani Heikkinen2015-02-116-40/+40
|/ | | | | | | | | | | | | | | | | | 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>
* Fix win32-g++ build due to -WerrorSérgio Martins2014-12-261-0/+4
| | | | | | | | | | | qwindowsprintdevice.cpp:182:85: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] && DeviceCapabilities((LPWSTR)m_id.utf16(), NULL, DC_PAPERSIZE, NULL, NULL) == paperCount MinGW DeviceCapabilities is returning an int, although microsoft documents it as returning DWORD. Change-Id: I3acd76dde0b8b83f8a785ec84e3413115c847cb2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPrinter - Fix DuplexMode on all platformsJohn Layt2014-10-241-0/+1
| | | | | | | | | | | | | Add support to get/set the DuplexMode on Windows and Mac, improve the CUPS duplex handling, ensure support is the same on all platforms. [ChangeLog][QtPrintSupport][QPrinter] Added duplex support for Windows and OS X. Task-number: QTBUG-11332 Change-Id: I9d61d63233d828c3b1fd6df54072c6049f3c6298 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get the correct available resolutions from the printerAndy Shaw2014-10-231-3/+3
| | | | | | | | | | On Windows the resolutions are available in pairs so get the y resolution from each pair as the y resolution is the one that is actually useful in QtPrintSupport terms Task-number: QTBUG-42007 Change-Id: I02c0588dd97c541e679f22431435751563caadb2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Windows: QWindowsPrintDevice::printableMargins avoids leaking the DCShawn Rutledge2014-10-221-1/+1
| | | | | | | | | MSDN says if the DC was created by calling CreateDC, it must be freed by DeleteDC not ReleaseDC. Task-number: QTBUG-41941 Change-Id: I4c60b5d2587f1c4d3332fce74224cbc8b756eb2a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Don't use QStringLiteral in comparisonsMarc Mutz2014-10-091-1/+1
| | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I7af3bf3a67c55dae33ffaf9922d004fa168a3f9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update license headers and add new license filesMatti Paaso2014-09-246-112/+64
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QWindowsPrintDevice check for NULL pDevMode from PPRINTER_INFO_2Dyami Caliri2014-06-201-0/+3
| | | | | | | | | The MSDN documentation states that the pDevMode member of PPRINTER_INFO_2 may be NULL. Task-number: QTBUG-39764 Change-Id: I9c3a4bb565115415dbf45544f3d2391107356610 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QPrinter/Windows: Fix handling of native paper source ids.Friedemann Kleint2014-05-231-0/+1
| | | | | | | | | | | | On Windows, it is possible to pass native Windows paper source ids >= DMBIN_USER to QPrinter::setPaperSource() and they are listed by supportedPaperSources(). Task-number: QTBUG-38897 Task-number: QTBUG-38888 Change-Id: I8f1264e80ce5bdddd3873602200b24eabee00502 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Windows printer support: Fix linking problem when built with -no-opengl .Friedemann Kleint2014-04-231-1/+1
| | | | | | | | Add missing libraries that were otherwise pulled in by opengl.prf. Task-number: QTBUG-38431 Change-Id: I1705d432088a47b5a202595e818e9efcd5f6a4cf Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Fix build on older MinGW versionsKonstantin Ritt2014-03-171-0/+4
| | | | | | | | | > In constructor 'QWindowsPrintDevice::QWindowsPrintDevice(const QString&)': > src\plugins\printsupport\windows\qwindowsprintdevice.cpp:105:86: > error: 'DC_COLLATE' was not declared in this scope Change-Id: Ifb64c323765ae4b6abb80c32d4ba2bc3fbffa245 Reviewed-by: John Layt <jlayt@kde.org>
* QtPrintSupport - Fix QT_NO_PRINTER buildJohn Layt2014-03-172-3/+6
| | | | | | | | Fix the QT_NO_PRINTER build for issues that have accumulated over last few months, and in the new changes already approved. Change-Id: I9aed21dee861837fd1a68a96692c873a4f5be293 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrinterInfo - Switch to QPlatformPrintDeviceJohn Layt2014-03-172-57/+3
| | | | | | | | | | | | | | | | | | | Change the QPrinterInfo implementation to use QPlatformPrintDevice as the backend. Remove all the old QPrinterInfo related code from the QPA plugin. Add public api to QPrinterInfo to support some features from QPlatformPrintDevice. [ChangeLog][QtPrintSupport][QPrinterInfo] Added new public api for isRemote(), state(), defaultPageSize(), supportedPageSizes(), supportsCustomPageSizes(), minimumPhysicalPageSize(), maximumPhysicalPageSize(), supportedResolutions(), availablePrinterNames(), and defaultPrinterName(). The use of availablePrinters() is discouraged due to performance concerns. Task-number: QTBUG-35248 Change-Id: Ic38323a930549ad67bf04a1a6bb43d623dfe6a33 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPlatformPrintDevice - Add Windows implementationJohn Layt2014-03-175-2/+614
| | | | | | | Add Windows implementation of QPlatformPrintDevice. Change-Id: I007678cd6d2bdae0728b61cc2796a5c5e5d1578f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrintEngine - Remove Windows use of port and driverJohn Layt2014-02-261-3/+1
| | | | | | | | | | | | | | The use of the driver name and port name in the DEVNAMES structure is no longer required within the Windows print engine and dialogs. The CreateDC docs clearly state any driver value passed in for a printer is ignored. The PRINTDLGEX docs also state only the name is actually used. The use of the port name is not required as the DeviceCapabilities api works fine with just the printer name and the FILE: port can be manually handled. Change-Id: I7765d73d4a31b1a3c5dab55ee4cfd3580bcf9ad7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Refresh Windows printer list when QPrinterInfo.availablePrinters() is called.Friedemann Kleint2013-10-172-19/+37
| | | | | | | | | Introduce static query functions. Task-number: QTBUG-33666 Change-Id: I291098c9da82bc2cc24957044187e93cdc33c41d Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add support for getting the paper names available for the printerAndy Shaw2013-02-112-0/+6
| | | | | | | Task-number: QTBUG-27714 Change-Id: I9bc6f1188f262e43f581add058d7895e1b5bd9e3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-2/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-184-4/+4
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add PLUGIN_CLASS_NAME to qtbase pluginsMiikka Heikkinen2012-12-101-0/+1
| | | | | | | | Needed for automating static plugin loading. Task-number: QTBUG-28131 Change-Id: Icd993c0fc8335f29aeec30e853a408d888069399 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* specify MODULE to avoid module .pri filename clashMark Brand2012-11-021-1/+1
| | | | | | | | | | | | | | | Since 733ac1f6e6b3155a594376ef99288c6117124000 the default MODULE is the base of the .pro file for the plugin (i.e., "windows"). Since MODULE becomes the base of the module .pri, the names of the module .pri files can clash. Now we explicitly specify MODULE for printersupport plugins to avoid overwriting the module .pri files of the platform plugins whose .pro files have the same names. Follow-up to 81f8f0db5cb75e29b041a011ca4e7dbbf2d903c5 which renamed the TARGET. Change-Id: Ie83892dc419257e1df3b81bcf6ecec751ae345b0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* disambiguate plugin name vs. windows platform pluginOswald Buddenhagen2012-11-011-1/+1
| | | | | | | | | static plugin linking needs unique names. also, non-unique names are generally somewhat counterproductive. Change-Id: Idffba2b442b98dd2b0917f9f0af89f0694a99196 Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* beef up qt_plugin.prfOswald Buddenhagen2012-11-011-3/+2
| | | | | | | it now defines the DESTDIR and creates an INSTALLS rule. Change-Id: I15a462ccad9acbe3521c352fa98327825dc27c05 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-224-96/+96
| | | | | | | | 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>
* QtPrintSupport: Move printer list into plugin base classJohn Layt2012-06-082-13/+1
| | | | | | | | | Move the cached printer list from the Windows plugin into the base class so the CUPS plugin can also use it in a subsequent commit. Change-Id: Idf5fb7fc49b1820aad58f16e8854ab9120caa193 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: John Layt <jlayt@kde.org>
* QtPrintSupport: Move plugin access of QPrinterInfo internals to baseJohn Layt2012-06-081-4/+2
| | | | | | | | | | Move all plugin methods requiring access to QPrinterInfo internals into the plugin base class, and remove the plugin classes as friends from QPrinterInfo. Change-Id: Ic527efc681e198abf19e038dd77c36bb8017d049 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: John Layt <jlayt@kde.org>
* Remove dependency from QFactoryInterface for the print pluginLars Knoll2012-06-081-6/+0
| | | | | Change-Id: Ia35890b72e7797ef655bf97b4a34af2908657c0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove capitalization when specifying include-libraries.kb2012-05-141-1/+1
| | | | | | | | | | | | | MinGW installations on case-sensitive filesystems expect lowercase names of include-libraries and (usually) include files. When crosscompiling on Debian 6 (targeting MS Windows) linking fails because mingw is looking for non-existent include-libraries. Using lowercase names solves this. Change-Id: Id3454f4ed8ba42b6ea93d65d9c0ce567db6712df Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Expose QPA API under qpa/*Girish Ramakrishnan2012-05-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Compile fix for MinGW.Friedemann Kleint2012-03-241-1/+3
| | | | | Change-Id: Id8099668dd1a4b137b6f9451be8617d07bc9d0c3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix QPrinter test in WindowsMiikka Heikkinen2012-03-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fixed Q_WS_WIN flagging to Q_OS_WIN in QPrinter API and related implementation to make API match the documentation and Qt 4.8. Also Removed the unused internal HDC related functions from the API, that were previously behind Q_WS_WIN flag. Some of the properties tested are documented to be valid for native print engine only in X11 environment, so skipped testing those in non-xcb environments. Copy collation is also apparently not supported in Windows native print engine, though this seems to be undocumented, so skipped that only in Windows. At least one of the test blocks in tst_QPrinter::valuePreservation() failed due to default printer not getting set properly, so fixed that, too. Task-number: QTBUG-24191 Task-number: QTBUG-22927 Change-Id: I44a5e3d647a1279fcc7f1e99de6881f9be330246 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix infinite recursion crash in QPrinterInfo::supportedPaperSizes()Miikka Heikkinen2012-03-191-8/+2
| | | | | | | | | | | | | | This function calls platform specific function QWindowsPrinterSupport::supportedPaperSizes(), which then called back to QPrinterInfo::supportedPaperSizes(), causing infinite recursion. Fixed by providing a proper implementation for querying supported paper sizes in QWin32PrintEngine - the same implementation was used in Qt 4.8. Task-number: QTBUG-24190 Change-Id: I64a2773d83596df19818bf2636f1255943d7851d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Use new plugin system in qtbase.Friedemann Kleint2012-02-273-2/+7
| | | | | | | | | - AccessibleWidgets - Windows printer support - Examples Change-Id: Icc162bd7fc284b3c76d9966210f983728085c743 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Windows: Fix compilation with -qtnamespaceKai Koehne2012-01-312-0/+9
| | | | | Change-Id: Ib006d74299d65e5872a5a524eaa937e127306ec7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-304-4/+4
| | | | | | | | | | 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-234-4/+4
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-054-4/+4
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Readded PrintSupport for WindowsOliver Wolff2011-10-255-0/+386
The prepared plugin architecture for printing support was used as much as possible but some functionality had to be done in src/printsupport. Change-Id: Ic8446cb8018a0970b4da97c1912ba6dc20d2a09f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>