Fix build.

- Introduced EXPORT definition for new QPrintSupport library.
- Fixed dependencies in src.pro
- Fixed some includes.

Change-Id: I9863233ca2767928b37cf3fd1fdec31351b5da6b
Reviewed-on: http://codereview.qt.nokia.com/3253
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
bb10
Friedemann Kleint 2011-08-19 10:39:45 +02:00
parent 0368c9978a
commit 2e95ce7459
26 changed files with 43 additions and 231 deletions

View File

@ -1265,6 +1265,11 @@ class QDataStream;
# else
# define Q_WIDGETS_EXPORT Q_DECL_IMPORT
# endif
# if defined(QT_BUILD_PRINTSUPPORT_LIB)
# define Q_PRINTSUPPORT_EXPORT Q_DECL_EXPORT
# else
# define Q_PRINTSUPPORT_EXPORT Q_DECL_IMPORT
# endif
# if defined(QT_BUILD_SQL_LIB)
# define Q_SQL_EXPORT Q_DECL_EXPORT
# else
@ -1350,6 +1355,7 @@ class QDataStream;
# define Q_CORE_EXPORT Q_DECL_IMPORT
# define Q_GUI_EXPORT Q_DECL_IMPORT
# define Q_WIDGETS_EXPORT Q_DECL_IMPORT
# define Q_PRINTSUPPORT_EXPORT Q_DECL_IMPORT
# define Q_SQL_EXPORT Q_DECL_IMPORT
# define Q_NETWORK_EXPORT Q_DECL_IMPORT
# define Q_SVG_EXPORT Q_DECL_IMPORT
@ -1383,6 +1389,7 @@ class QDataStream;
# define Q_CORE_EXPORT Q_DECL_EXPORT
# define Q_GUI_EXPORT Q_DECL_EXPORT
# define Q_WIDGETS_EXPORT Q_DECL_EXPORT
# define Q_PRINTSUPPORT_EXPORT Q_DECL_EXPORT
# define Q_SQL_EXPORT Q_DECL_EXPORT
# define Q_NETWORK_EXPORT Q_DECL_EXPORT
# define Q_SVG_EXPORT Q_DECL_EXPORT
@ -1402,6 +1409,7 @@ class QDataStream;
# define Q_CORE_EXPORT
# define Q_GUI_EXPORT
# define Q_WIDGETS_EXPORT
# define Q_PRINTSUPPORT_EXPORT
# define Q_SQL_EXPORT
# define Q_NETWORK_EXPORT
# define Q_SVG_EXPORT
@ -1437,6 +1445,11 @@ class QDataStream;
# else
# define Q_WIDGETS_EXPORT_INLINE inline
# endif
# if defined(QT_BUILD_PRINTSUPPORT_LIB)
# define Q_PRINTSUPPORT_EXPORT_INLINE Q_PRINTSUPPORT_EXPORT inline
# else
# define Q_PRINTSUPPORT_EXPORT_INLINE inline
# endif
# if defined(QT_BUILD_COMPAT_LIB)
# define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline
# else
@ -1449,11 +1462,13 @@ class QDataStream;
# define Q_CORE_EXPORT_INLINE inline
# define Q_GUI_EXPORT_INLINE inline
# define Q_WIDGETS_EXPORT_INLINE inline
# define Q_PRINTSUPPORT_EXPORT_INLINE inline
# define Q_COMPAT_EXPORT_INLINE inline
#else
# define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
# define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
# define Q_WIDGETS_EXPORT_INLINE Q_WIDGETS_EXPORT inline
# define Q_PRINTSUPPORT_EXPORT_INLINE Q_PRINTSUPPORT_EXPORT inline
# define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline
#endif
@ -2023,6 +2038,7 @@ static inline bool qIsNull(float f)
return false; \
}
#else
# define Q_DUMMY_COMPARISON_OPERATOR(C)
#endif

View File

@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
class QIODevice;
class QPdfWriterPrivate;
class Q_GUI_EXPORT QPdfWriter : public QObject, public QPagedPaintDevice

View File

@ -46,7 +46,6 @@
#include "qwindowsglcontext.h"
#include "qwindowsscreen.h"
#include "qwindowsfontdatabase.h"
#include "qwindowsprintersupport.h"
#include "qwindowsguieventdispatcher.h"
#include "qwindowsclipboard.h"
#include "qwindowsdrag.h"
@ -131,7 +130,6 @@ struct QWindowsIntegrationPrivate
const bool m_openGL;
QWindowsContext m_context;
QWindowsPrinterSupport m_printerSupport;
QWindowsFontDatabase m_fontDatabase;
QWindowsNativeInterface m_nativeInterface;
QWindowsClipboard m_clipboard;
@ -232,13 +230,6 @@ QPlatformFontDatabase *QWindowsIntegration::fontDatabase() const
return &d->m_fontDatabase;
}
QPlatformPrinterSupport *QWindowsIntegration::printerSupport() const
{
if (QWindowsContext::verboseIntegration)
qDebug() << __FUNCTION__;
return &d->m_printerSupport;
}
QPlatformNativeInterface *QWindowsIntegration::nativeInterface() const
{
return &d->m_nativeInterface;

View File

@ -67,7 +67,6 @@ public:
virtual QPlatformDrag *drag() const;
virtual QPlatformInputContext *inputContext() const;
virtual QPlatformNativeInterface *nativeInterface() const;
virtual QPlatformPrinterSupport *printerSupport() const;
virtual QPlatformFontDatabase *fontDatabase() const;
static QWindowsIntegration *instance();

View File

@ -42,7 +42,6 @@
#include "qwindowsnativeimage.h"
#include "qwindowscontext.h"
#include <QtGui/QColorMap>
#include <QtGui/private/qpaintengine_p.h>
#include <QtGui/private/qpaintengine_raster_p.h>

View File

@ -1,134 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qwindowsprintersupport.h"
#ifdef HAS_PRINTENGINE
# include <qprintengine_win_p.h>
#endif
#include <QtGui/QPrinterInfo>
#include <QtCore/QStringList>
#include <QtCore/qt_windows.h>
QT_BEGIN_NAMESPACE
QPrintEngine *QWindowsPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode mode)
{
#ifdef HAS_PRINTENGINE
return new QWin32PrintEngine(mode);
#else
Q_UNUSED(mode);
Q_UNIMPLEMENTED();
return 0;
#endif
}
QPaintEngine *QWindowsPrinterSupport::createPaintEngine(QPrintEngine *engine, QPrinter::PrinterMode)
{
#ifdef HAS_PRINTENGINE
return static_cast<QWin32PrintEngine *>(engine);
#else
Q_UNIMPLEMENTED();
Q_UNUSED(engine);
return 0;
#endif
}
QList<QPrinter::PaperSize> QWindowsPrinterSupport::supportedPaperSizes(const QPrinterInfo &printerInfo) const
{
QList<QPrinter::PaperSize> paperSizes;
const QString printerName = printerInfo.printerName();
const wchar_t *nameUtf16 = reinterpret_cast<const wchar_t*>(printerName.utf16());
DWORD size = DeviceCapabilities(nameUtf16, NULL, DC_PAPERS, NULL, NULL);
if ((int)size != -1) {
wchar_t *papers = new wchar_t[size];
size = DeviceCapabilities(nameUtf16, NULL, DC_PAPERS, papers, NULL);
#ifdef HAS_PRINTENGINE
for (int c = 0; c < (int)size; ++c)
paperSizes.append(mapDevmodePaperSize(papers[c]));
#endif
delete [] papers;
}
return paperSizes;
}
QList<QPrinterInfo> QWindowsPrinterSupport::availablePrinters()
{
QList<QPrinterInfo> printers;
DWORD needed = 0;
DWORD returned = 0;
if (!EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 4, 0, 0, &needed, &returned)) {
LPBYTE buffer = new BYTE[needed];
if (EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 4, buffer, needed, &needed, &returned)) {
PPRINTER_INFO_4 infoList = reinterpret_cast<PPRINTER_INFO_4>(buffer);
QPrinterInfo defPrn = defaultPrinter();
for (uint i = 0; i < returned; ++i) {
const QString printerName(QString::fromWCharArray(infoList[i].pPrinterName));
const bool isDefault = printerName == defPrn.printerName();
printers.append(QPlatformPrinterSupport::printerInfo(printerName,
isDefault));
}
}
delete [] buffer;
}
return printers;
}
QPrinterInfo QWindowsPrinterSupport::defaultPrinter()
{
QString noPrinters(QStringLiteral("qt_no_printers"));
wchar_t buffer[256];
GetProfileString(L"windows", L"device", (wchar_t*)noPrinters.utf16(), buffer, 256);
QString output = QString::fromWCharArray(buffer);
if (output != noPrinters) {
// Filter out the name of the printer, which should be everything before a comma.
const QString printerName = output.split(QLatin1Char(',')).value(0);
return QPlatformPrinterSupport::printerInfo(printerName, true);
}
return QPrinterInfo();
}
QT_END_NAMESPACE

View File

@ -1,62 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QWINDOWSPRINTERSUPPORT_H
#define QWINDOWSPRINTERSUPPORT_H
#include <QtGui/QPlatformPrinterSupport>
QT_BEGIN_NAMESPACE
class QWindowsPrinterSupport : public QPlatformPrinterSupport
{
public:
virtual QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode);
virtual QPaintEngine *createPaintEngine(QPrintEngine *, QPrinter::PrinterMode);
virtual QList<QPrinter::PaperSize> supportedPaperSizes(const QPrinterInfo &) const;
virtual QPrinterInfo defaultPrinter();
virtual QList<QPrinterInfo> availablePrinters();
};
QT_END_NAMESPACE
#endif // QWINDOWSPRINTERSUPPORT_H

View File

@ -27,7 +27,6 @@ SOURCES += \
qwindowscontext.cpp \
qwindowsbackingstore.cpp \
qwindowsscreen.cpp \
qwindowsprintersupport.cpp \
qwindowskeymapper.cpp \
qwindowsfontengine.cpp \
qwindowsfontdatabase.cpp \
@ -48,7 +47,6 @@ HEADERS += \
qwindowscontext.h \
qwindowsbackingstore.h \
qwindowsscreen.h \
qwindowsprintersupport.h \
qwindowskeymapper.h \
qwindowsfontengine.h \
qwindowsfontdatabase.h \

View File

@ -56,7 +56,7 @@ class QAbstractPageSetupDialogPrivate;
class QPrinter;
// ### Qt 5: Remove this class
class Q_WIDGETS_EXPORT QAbstractPageSetupDialog : public QDialog
class Q_PRINTSUPPORT_EXPORT QAbstractPageSetupDialog : public QDialog
{
Q_DECLARE_PRIVATE(QAbstractPageSetupDialog)
Q_OBJECT

View File

@ -56,7 +56,7 @@ class QAbstractPrintDialogPrivate;
class QPrinter;
// ### Qt 5: remove this class
class Q_WIDGETS_EXPORT QAbstractPrintDialog : public QDialog
class Q_PRINTSUPPORT_EXPORT QAbstractPrintDialog : public QDialog
{
Q_DECLARE_PRIVATE(QAbstractPrintDialog)
Q_OBJECT

View File

@ -54,7 +54,7 @@ QT_MODULE(Gui)
class QPageSetupDialogPrivate;
class Q_WIDGETS_EXPORT QPageSetupDialog : public QAbstractPageSetupDialog
class Q_PRINTSUPPORT_EXPORT QPageSetupDialog : public QAbstractPageSetupDialog
{
Q_OBJECT
Q_DECLARE_PRIVATE(QPageSetupDialog)

View File

@ -59,7 +59,7 @@ class QPrinter;
#if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN)
class QUnixPrintWidgetPrivate;
class Q_WIDGETS_EXPORT QUnixPrintWidget : public QWidget
class Q_PRINTSUPPORT_EXPORT QUnixPrintWidget : public QWidget
{
Q_OBJECT
@ -78,7 +78,7 @@ private:
};
#endif
class Q_WIDGETS_EXPORT QPrintDialog : public QAbstractPrintDialog
class Q_PRINTSUPPORT_EXPORT QPrintDialog : public QAbstractPrintDialog
{
Q_OBJECT
Q_DECLARE_PRIVATE(QPrintDialog)

View File

@ -56,7 +56,7 @@ class QGraphicsView;
class QPrintPreviewDialogPrivate;
class QPrinter;
class Q_WIDGETS_EXPORT QPrintPreviewDialog : public QDialog
class Q_PRINTSUPPORT_EXPORT QPrintPreviewDialog : public QDialog
{
Q_OBJECT
Q_DECLARE_PRIVATE(QPrintPreviewDialog)

View File

@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_TYPEINFO(cups_option_t, Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE);
class Q_GUI_EXPORT QCUPSSupport
class Q_PRINTSUPPORT_EXPORT QCUPSSupport
{
public:
struct Printer

View File

@ -54,7 +54,7 @@ QT_MODULE(Gui)
class QPrintEngine;
class Q_GUI_EXPORT QPlatformPrinterSupport
class Q_PRINTSUPPORT_EXPORT QPlatformPrinterSupport
{
public:
QPlatformPrinterSupport();

View File

@ -73,7 +73,7 @@ struct QPlatformPrinterSupportFactoryInterface : public QFactoryInterface
Q_DECLARE_INTERFACE(QPlatformPrinterSupportFactoryInterface, QPlatformPrinterSupportFactoryInterface_iid)
class Q_GUI_EXPORT QPlatformPrinterSupportPlugin : public QObject, public QPlatformPrinterSupportFactoryInterface
class Q_PRINTSUPPORT_EXPORT QPlatformPrinterSupportPlugin : public QObject, public QPlatformPrinterSupportFactoryInterface
{
Q_OBJECT
Q_INTERFACES(QPlatformPrinterSupportFactoryInterface:QFactoryInterface)

View File

@ -53,7 +53,7 @@ QT_MODULE(Gui)
#ifndef QT_NO_PRINTER
class Q_GUI_EXPORT QPrintEngine
class Q_PRINTSUPPORT_EXPORT QPrintEngine
{
public:
virtual ~QPrintEngine() {}

View File

@ -58,6 +58,10 @@
#include "private/qcore_unix_p.h" // overrides QT_OPEN
#endif
#ifdef Q_OS_WIN
#include <io.h> // _close.
#endif
QT_BEGIN_NAMESPACE
//#define FONT_DUMP

View File

@ -89,8 +89,8 @@ namespace QPdf {
struct PaperSize {
int width, height; // in postscript points
};
Q_GUI_EXPORT PaperSize paperSize(QPrinter::PaperSize paperSize);
Q_GUI_EXPORT const char *paperSizeToString(QPrinter::PaperSize paperSize);
Q_PRINTSUPPORT_EXPORT PaperSize paperSize(QPrinter::PaperSize paperSize);
Q_PRINTSUPPORT_EXPORT const char *paperSizeToString(QPrinter::PaperSize paperSize);
}
class QPdfPrintEnginePrivate;

View File

@ -118,7 +118,7 @@ static const float qt_paperSizes[][2] = {
};
/// return the multiplier of converting from the unit value to postscript-points.
Q_GUI_EXPORT double qt_multiplierForUnit(QPrinter::Unit unit, int resolution)
Q_PRINTSUPPORT_EXPORT double qt_multiplierForUnit(QPrinter::Unit unit, int resolution)
{
switch(unit) {
case QPrinter::Millimeter:
@ -140,7 +140,7 @@ Q_GUI_EXPORT double qt_multiplierForUnit(QPrinter::Unit unit, int resolution)
}
// not static: it's needed in qpagesetupdialog_unix.cpp
Q_GUI_EXPORT QSizeF qt_printerPaperSize(QPrinter::Orientation orientation,
Q_PRINTSUPPORT_EXPORT QSizeF qt_printerPaperSize(QPrinter::Orientation orientation,
QPrinter::PaperSize paperSize,
QPrinter::Unit unit,
int resolution)

View File

@ -63,7 +63,7 @@ class QPaintEngine;
class QPrintEngine;
class QPrinterInfo;
class Q_GUI_EXPORT QPrinter : public QPagedPaintDevice
class Q_PRINTSUPPORT_EXPORT QPrinter : public QPagedPaintDevice
{
Q_DECLARE_PRIVATE(QPrinter)
public:

View File

@ -70,7 +70,7 @@ class QPrintEngine;
class QPreviewPaintEngine;
class QPicture;
class Q_GUI_EXPORT QPrinterPrivate
class Q_PRINTSUPPORT_EXPORT QPrinterPrivate
{
Q_DECLARE_PUBLIC(QPrinter)
public:

View File

@ -55,7 +55,7 @@ QT_MODULE(Gui)
#ifndef QT_NO_PRINTER
class QPrinterInfoPrivate;
class QPrinterInfoPrivateDeleter;
class Q_GUI_EXPORT QPrinterInfo
class Q_PRINTSUPPORT_EXPORT QPrinterInfo
{
public:
QPrinterInfo();

View File

@ -741,7 +741,7 @@ void qt_parseQconfig(QList<QPrinterDescription> *printers)
} while (!ts.atEnd());
}
Q_GUI_EXPORT int qt_getLprPrinters(QList<QPrinterDescription>& printers)
Q_PRINTSUPPORT_EXPORT int qt_getLprPrinters(QList<QPrinterDescription>& printers)
{
QByteArray etcLpDefault;
qt_parsePrintcap(&printers, QLatin1String("/etc/printcap"));

View File

@ -55,7 +55,7 @@ QT_MODULE(Gui)
class QPrintPreviewWidgetPrivate;
class Q_WIDGETS_EXPORT QPrintPreviewWidget : public QWidget
class Q_PRINTSUPPORT_EXPORT QPrintPreviewWidget : public QWidget
{
Q_OBJECT
Q_DECLARE_PRIVATE(QPrintPreviewWidget)

View File

@ -10,7 +10,7 @@ SRC_SUBDIRS += src_corelib
!cross_compile {
win32:!wince*: SRC_SUBDIRS += src_tools_idc
}
SRC_SUBDIRS += src_network src_sql src_gui src_xml src_uitools src_printsupport src_widgets src_testlib src_platformsupport
SRC_SUBDIRS += src_network src_sql src_gui src_xml src_uitools src_widgets src_printsupport src_testlib src_platformsupport
nacl: SRC_SUBDIRS -= src_network src_testlib
!symbian:contains(QT_CONFIG, dbus):SRC_SUBDIRS += src_dbus
contains(QT_CONFIG, no-gui): SRC_SUBDIRS -= src_gui
@ -60,8 +60,8 @@ src_platformsupport.target = sub-platformsupport
!wince*:!ordered:!symbian-abld:!symbian-sbsv2 {
src_corelib.depends = src_tools_moc src_tools_rcc
src_gui.depends = src_corelib
src_printsupport.depends = src_corelib src_gui
src_widgets.depends = src_corelib src_gui src_printsupport src_tools_uic
src_printsupport.depends = src_corelib src_gui src_widgets
src_widgets.depends = src_corelib src_gui src_tools_uic
embedded: src_gui.depends += src_network
src_xml.depends = src_corelib
src_uitools.depends = src_corelib src_widgets