QtGui: Remove Q_WS and qpa.

Enable compilation without -qpa.
Remove QT_NO_FREETYPE and QT_NO_FONTCONFIG when building.

Change-Id: I0e017cc47ee06b885be65deaeb67a449a119b8be
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Friedemann Kleint 2011-10-20 13:35:27 +02:00 committed by Qt by Nokia
parent b22d290a37
commit 8afc067647
15 changed files with 28 additions and 279 deletions

View File

@ -24,19 +24,13 @@ contains(QT_CONFIG, egl): {
wince*: SOURCES += egl/qegl_wince.cpp
unix {
qpa {
SOURCES += egl/qegl_qpa.cpp
} else {
symbian {
SOURCES += egl/qegl_symbian.cpp
} else {
SOURCES += egl/qegl_x11.cpp
}
}
}
} else:symbian {
DEFINES += QT_NO_EGL
SOURCES += egl/qegl_stub.cpp
SOURCES += egl/qeglproperties_stub.cpp
symbian {
SOURCES += egl/qegl_symbian.cpp
} else {
SOURCES += egl/qegl_qpa.cpp
}
} else:symbian: {
DEFINES += QT_NO_EGL
SOURCES += egl/qegl_stub.cpp
SOURCES += egl/qeglproperties_stub.cpp
}

View File

@ -41,7 +41,6 @@
#include <QtGui/qpaintdevice.h>
#include <QtGui/qpixmap.h>
#include <QtGui/qwidget.h>
#include <QtCore/qdebug.h>
#include "qegl_p.h"

View File

@ -123,13 +123,6 @@ bool QEglProperties::reduceConfiguration()
return false;
}
static void addTag(QString& str, const QString& tag)
{
Q_UNUSED(str)
Q_UNUSED(tag)
NOEGL
}
// Convert a property list to a string suitable for debug output.
QString QEglProperties::toString() const
{

View File

@ -2879,7 +2879,7 @@ CONVERT_DECL(quint32, qrgb666)
CONVERT_DECL(qargb6666, quint32)
CONVERT_DECL(quint32, qargb6666)
CONVERT_DECL(qrgb555, quint32)
#if !defined(Q_WS_QWS) || (defined(QT_QWS_DEPTH_15) && defined(QT_QWS_DEPTH_16))
#if (defined(QT_QWS_DEPTH_15) && defined(QT_QWS_DEPTH_16))
CONVERT_DECL(quint16, qrgb555)
CONVERT_DECL(qrgb555, quint16)
#endif
@ -3046,7 +3046,7 @@ static Image_Converter converter_map[QImage::NImageFormats][QImage::NImageFormat
0,
0,
0,
#if !defined(Q_WS_QWS) || (defined(QT_QWS_DEPTH_15) && defined(QT_QWS_DEPTH_16))
#if defined(QT_QWS_DEPTH_15) && defined(QT_QWS_DEPTH_16)
CONVERT_PTR(qrgb555, quint16),
#else
0,
@ -3122,7 +3122,7 @@ static Image_Converter converter_map[QImage::NImageFormats][QImage::NImageFormat
CONVERT_PTR(quint32, qrgb555),
CONVERT_PTR(quint32, qrgb555),
CONVERT_PTR(quint32, qrgb555),
#if !defined(Q_WS_QWS) || (defined(QT_QWS_DEPTH_15) && defined(QT_QWS_DEPTH_16))
#if defined(QT_QWS_DEPTH_15) && defined(QT_QWS_DEPTH_16)
CONVERT_PTR(quint16, qrgb555),
#else
0,

View File

@ -1323,9 +1323,8 @@ uint QGuiApplicationPrivate::currentKeyPlatform()
uint platform = KB_Win;
#ifdef Q_OS_MAC
platform = KB_Mac;
#elif defined Q_WS_X11
#elif defined Q_WS_X11 // ## TODO: detect these
platform = KB_X11;
// ## TODO: detect these
#if 0
if (X11->desktopEnvironment == DE_KDE)
platform |= KB_KDE;

View File

@ -81,59 +81,9 @@ private:
Q_DISABLE_COPY(QKeyMapper)
};
#if defined(Q_OS_WIN)
enum WindowsNativeModifiers {
ShiftLeft = 0x00000001,
ControlLeft = 0x00000002,
AltLeft = 0x00000004,
MetaLeft = 0x00000008,
ShiftRight = 0x00000010,
ControlRight = 0x00000020,
AltRight = 0x00000040,
MetaRight = 0x00000080,
CapsLock = 0x00000100,
NumLock = 0x00000200,
ScrollLock = 0x00000400,
ExtendedKey = 0x01000000,
// Convenience mappings
ShiftAny = 0x00000011,
ControlAny = 0x00000022,
AltAny = 0x00000044,
MetaAny = 0x00000088,
LockAny = 0x00000700
};
# if !defined(tagMSG)
typedef struct tagMSG MSG;
# endif
#elif defined(Q_WS_MAC)
QT_BEGIN_INCLUDE_NAMESPACE
# include <private/qt_mac_p.h>
QT_END_INCLUDE_NAMESPACE
#elif defined(Q_WS_X11)
QT_BEGIN_INCLUDE_NAMESPACE
typedef ulong XID;
typedef XID KeySym;
QT_END_INCLUDE_NAMESPACE
struct QXCoreDesc {
int min_keycode;
int max_keycode;
int keysyms_per_keycode;
KeySym *keysyms;
uchar mode_switch;
uchar num_lock;
KeySym lock_meaning;
};
#endif
struct KeyboardLayoutItem;
typedef struct __TISInputSource * TISInputSourceRef;
class QKeyEvent;
class QKeyMapperPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QKeyMapper)
@ -146,17 +96,6 @@ public:
QLocale keyboardInputLocale;
Qt::LayoutDirection keyboardInputDirection;
#if defined(Q_OS_WIN)
void clearRecordedKeys();
void updateKeyMap(const MSG &msg);
bool translateKeyEvent(QWidget *receiver, const MSG &msg, bool grab);
void updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 scancode, quint32 vk_key);
bool isADeadKey(unsigned int vk_key, unsigned int modifiers);
void deleteLayouts();
KeyboardLayoutItem *keyLayout[256];
#endif // defined(Q_OS_WIN)
};
QKeyMapperPrivate *qt_keymapper_private(); // from qkeymapper.cpp

View File

@ -70,20 +70,14 @@ QT_BEGIN_NAMESPACE
#endif
#endif
#if defined(Q_WS_QWS) || defined(Q_WS_QPA) && defined(Q_OS_WIN)
#define Q_GUI_QWS_EXPORT Q_GUI_EXPORT
#else
#define Q_GUI_QWS_EXPORT
#endif
#define QT_DECL_MEMROTATE(srctype, desttype) \
void Q_GUI_QWS_EXPORT qt_memrotate90(const srctype*, int, int, int, desttype*, int); \
void Q_GUI_QWS_EXPORT qt_memrotate180(const srctype*, int, int, int, desttype*, int); \
void Q_GUI_QWS_EXPORT qt_memrotate270(const srctype*, int, int, int, desttype*, int)
void Q_GUI_EXPORT qt_memrotate90(const srctype*, int, int, int, desttype*, int); \
void Q_GUI_EXPORT qt_memrotate180(const srctype*, int, int, int, desttype*, int); \
void Q_GUI_EXPORT qt_memrotate270(const srctype*, int, int, int, desttype*, int)
void Q_GUI_EXPORT qt_memrotate90(const quint32*, int, int, int, quint32*, int);
void Q_GUI_QWS_EXPORT qt_memrotate180(const quint32*, int, int, int, quint32*, int);
void Q_GUI_QWS_EXPORT qt_memrotate270(const quint32*, int, int, int, quint32*, int);
void Q_GUI_EXPORT qt_memrotate180(const quint32*, int, int, int, quint32*, int);
void Q_GUI_EXPORT qt_memrotate270(const quint32*, int, int, int, quint32*, int);
QT_DECL_MEMROTATE(quint32, quint16);
QT_DECL_MEMROTATE(quint16, quint32);

View File

@ -250,9 +250,6 @@ private:
friend class QFontEngineBox;
friend class QFontEngineMac;
friend class QFontEngineWin;
#ifndef QT_NO_FREETYPE
friend class QFontEngineFT;
#endif
#ifndef QT_NO_QWS_QPF
friend class QFontEngineQPF1;
#endif

View File

@ -324,8 +324,6 @@ public:
#if defined (Q_OS_WIN)
HDC hdc;
#elif defined(Q_WS_MAC)
CGContextRef cgContext;
#endif
QRect deviceRect;

View File

@ -42,10 +42,9 @@
#include <qmath.h>
#include "qtextureglyphcache_p.h"
#include "private/qfontengine_p.h"
#include "private/qnumeric_p.h"
#include "private/qnativeimage_p.h"
#include "private/qfontengine_ft_p.h"
QT_BEGIN_NAMESPACE

View File

@ -556,9 +556,7 @@ public:
HANDLE handle;
bool memoryFont;
QVector<FONTSIGNATURE> signatures;
#elif defined(Q_WS_MAC)
ATSFontContainerRef handle;
#elif defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE)
#elif defined(Q_OS_SYMBIAN)
QString temporaryFileName;
TInt screenDeviceFontFileId;
TUid fontStoreFontFileUid;

View File

@ -45,12 +45,6 @@
#include "private/qpdf_p.h"
#include "private/qfunctions_p.h"
#ifndef QT_NO_FREETYPE
#include <ft2build.h>
#include FT_FREETYPE_H
#endif
QT_BEGIN_NAMESPACE
static const char * const agl =
@ -276,13 +270,6 @@ QByteArray QFontSubset::glyphName(unsigned short unicode, bool symbol)
return buffer;
}
#ifndef QT_NO_FREETYPE
static FT_Face ft_face(const QFontEngine *engine)
{
return 0;
}
#endif
QByteArray QFontSubset::glyphName(unsigned int glyph, const QVector<int> reverseMap) const
{
uint glyphIndex = glyph_indices[glyph];
@ -292,20 +279,6 @@ QByteArray QFontSubset::glyphName(unsigned int glyph, const QVector<int> reverse
QByteArray ba;
QPdf::ByteStream s(&ba);
#ifndef QT_NO_FREETYPE
FT_Face face = ft_face(fontEngine);
char name[32];
name[0] = 0;
if (face && FT_HAS_GLYPH_NAMES(face)) {
FT_Get_Glyph_Name(face, glyphIndex, &name, 32);
if (name[0] == '.') // fix broken PS fonts returning .notdef for many glyphs
name[0] = 0;
}
if (name[0]) {
s << '/' << name;
} else
#endif
if (reverseMap[glyphIndex] && reverseMap[glyphIndex] < 0x10000) {
s << '/' << glyphName(reverseMap[glyphIndex], false);
} else {

View File

@ -1521,12 +1521,7 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
end(1);
}
else if (event == QKeySequence::MoveToNextChar) {
#if !defined(Q_WS_WIN) || defined(QT_NO_COMPLETER)
if (hasSelectedText()) {
#else
if (hasSelectedText() && m_completer
&& m_completer->completionMode() == QCompleter::InlineCompletion) {
#endif
moveCursor(selectionEnd(), false);
} else {
cursorForward(0, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
@ -1536,12 +1531,7 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
}
else if (event == QKeySequence::MoveToPreviousChar) {
#if !defined(Q_WS_WIN) || defined(QT_NO_COMPLETER)
if (hasSelectedText()) {
#else
if (hasSelectedText() && m_completer
&& m_completer->completionMode() == QCompleter::InlineCompletion) {
#endif
moveCursor(selectionStart(), false);
} else {
cursorForward(0, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1));

View File

@ -61,10 +61,6 @@
#include "qfontengine_p.h"
#if !defined(QT_NO_FREETYPE)
# include "qfontengine_ft_p.h"
#endif
QT_BEGIN_NAMESPACE
#define ObjectSelectionBrush (QTextFormat::ForegroundBrush + 1)
@ -2109,23 +2105,6 @@ static QGlyphRun glyphRunWithInfo(QFontEngine *fontEngine, const QGlyphLayout &g
fontD->fontEngine = fontEngine;
fontD->thread = QThread::currentThread();
fontD->fontEngine->ref.ref();
#if !defined(QT_NO_FREETYPE)
if (fontEngine->type() == QFontEngine::Freetype) {
QFontEngineFT *freeTypeEngine = static_cast<QFontEngineFT *>(fontEngine);
switch (freeTypeEngine->defaultHintStyle()) {
case QFontEngineFT::HintNone:
fontD->hintingPreference = QFont::PreferNoHinting;
break;
case QFontEngineFT::HintLight:
fontD->hintingPreference = QFont::PreferVerticalHinting;
break;
case QFontEngineFT::HintMedium:
case QFontEngineFT::HintFull:
fontD->hintingPreference = QFont::PreferFullHinting;
break;
};
}
#endif
QVarLengthArray<glyph_t> glyphsArray;
QVarLengthArray<QFixedPoint> positionsArray;

View File

@ -80,14 +80,6 @@ SOURCES += \
text/qrawfont.cpp \
text/qglyphrun.cpp
win32:!qpa {
SOURCES += \
text/qfont_win.cpp \
text/qfontengine_win.cpp \
text/qrawfont_win.cpp
HEADERS += text/qfontengine_win_p.h
}
contains(QT_CONFIG, directwrite) {
LIBS_PRIVATE += -ldwrite
HEADERS += text/qfontenginedirectwrite_p.h
@ -106,35 +98,14 @@ unix:x11 {
text/qrawfont_ft.cpp
}
!qpa:!x11:mac {
HEADERS += \
text/qfontengine_mac_p.h
OBJECTIVE_HEADERS += \
text/qfontengine_coretext_p.h
SOURCES += \
text/qfont_mac.cpp \
text/qrawfont_mac.cpp
OBJECTIVE_SOURCES += \
text/qfontengine_coretext.mm \
text/qfontengine_mac.mm
contains(QT_CONFIG, harfbuzz) {
DEFINES += QT_ENABLE_HARFBUZZ_FOR_MAC
}
}
SOURCES += \
text/qfont_qpa.cpp \
text/qfontengine_qpa.cpp \
text/qplatformfontdatabase_qpa.cpp \
text/qrawfont_qpa.cpp
qpa {
SOURCES += \
text/qfont_qpa.cpp \
text/qfontengine_qpa.cpp \
text/qplatformfontdatabase_qpa.cpp \
text/qrawfont_qpa.cpp
HEADERS += \
text/qplatformfontdatabase_qpa.h
DEFINES += QT_NO_FONTCONFIG
DEFINES += QT_NO_FREETYPE
}
HEADERS += \
text/qplatformfontdatabase_qpa.h
symbian {
SOURCES += \
@ -156,79 +127,5 @@ symbian {
LIBS += -lfntstr -lecom
}
!qpa {
contains(QT_CONFIG, freetype) {
SOURCES += \
../3rdparty/freetype/src/base/ftbase.c \
../3rdparty/freetype/src/base/ftbbox.c \
../3rdparty/freetype/src/base/ftdebug.c \
../3rdparty/freetype/src/base/ftglyph.c \
../3rdparty/freetype/src/base/ftinit.c \
../3rdparty/freetype/src/base/ftmm.c \
../3rdparty/freetype/src/base/fttype1.c \
../3rdparty/freetype/src/base/ftsynth.c \
../3rdparty/freetype/src/base/ftbitmap.c \
../3rdparty/freetype/src/bdf/bdf.c \
../3rdparty/freetype/src/cache/ftcache.c \
../3rdparty/freetype/src/cff/cff.c \
../3rdparty/freetype/src/cid/type1cid.c \
../3rdparty/freetype/src/gzip/ftgzip.c \
../3rdparty/freetype/src/pcf/pcf.c \
../3rdparty/freetype/src/pfr/pfr.c \
../3rdparty/freetype/src/psaux/psaux.c \
../3rdparty/freetype/src/pshinter/pshinter.c \
../3rdparty/freetype/src/psnames/psmodule.c \
../3rdparty/freetype/src/raster/raster.c \
../3rdparty/freetype/src/sfnt/sfnt.c \
../3rdparty/freetype/src/smooth/smooth.c \
../3rdparty/freetype/src/truetype/truetype.c \
../3rdparty/freetype/src/type1/type1.c \
../3rdparty/freetype/src/type42/type42.c \
../3rdparty/freetype/src/winfonts/winfnt.c \
../3rdparty/freetype/src/lzw/ftlzw.c\
../3rdparty/freetype/src/otvalid/otvalid.c\
../3rdparty/freetype/src/otvalid/otvbase.c\
../3rdparty/freetype/src/otvalid/otvgdef.c\
../3rdparty/freetype/src/otvalid/otvjstf.c\
../3rdparty/freetype/src/otvalid/otvcommn.c\
../3rdparty/freetype/src/otvalid/otvgpos.c\
../3rdparty/freetype/src/otvalid/otvgsub.c\
../3rdparty/freetype/src/otvalid/otvmod.c\
../3rdparty/freetype/src/autofit/afangles.c\
../3rdparty/freetype/src/autofit/afglobal.c\
../3rdparty/freetype/src/autofit/aflatin.c\
../3rdparty/freetype/src/autofit/afmodule.c\
../3rdparty/freetype/src/autofit/afdummy.c\
../3rdparty/freetype/src/autofit/afhints.c\
../3rdparty/freetype/src/autofit/afloader.c\
../3rdparty/freetype/src/autofit/autofit.c
symbian {
SOURCES += \
../3rdparty/freetype/src/base/ftsystem.c
} else {
SOURCES += \
../3rdparty/freetype/builds/unix/ftsystem.c
INCLUDEPATH += \
../3rdparty/freetype/builds/unix
}
INCLUDEPATH += \
../3rdparty/freetype/src \
../3rdparty/freetype/include
DEFINES += FT2_BUILD_LIBRARY FT_CONFIG_OPTION_SYSTEM_ZLIB
} else:contains(QT_CONFIG, system-freetype) {
# pull in the proper freetype2 include directory
include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)
LIBS_PRIVATE += -lfreetype
}
contains(QT_CONFIG, fontconfig) {
CONFIG += opentype
}
}#!qpa
DEFINES += QT_NO_OPENTYPE
INCLUDEPATH += ../3rdparty/harfbuzz/src