summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/accessibility/qaccessiblebridgeutils_p.h4
-rw-r--r--src/platformsupport/eglconvenience/eglconvenience.pri4
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience.cpp12
-rw-r--r--src/platformsupport/eglconvenience/qeglpbuffer_p.h4
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext.cpp56
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext_p.h17
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcursor_p.h1
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformintegration.cpp45
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformintegration_p.h5
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformscreen.cpp49
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformscreen_p.h13
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformwindow.cpp24
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformwindow_p.h17
-rw-r--r--src/platformsupport/eglconvenience/qxlibeglintegration.cpp34
-rw-r--r--src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h2
-rw-r--r--src/platformsupport/fbconvenience/qfbbackingstore_p.h6
-rw-r--r--src/platformsupport/fbconvenience/qfbcursor_p.h4
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler.cpp2
-rw-r--r--src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp31
-rw-r--r--src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h12
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp47
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h16
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp6
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h4
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm27
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h1
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm76
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h5
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp72
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp25
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp28
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp33
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablet.cpp16
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablet_p.h2
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch.cpp35
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch_p.h2
-rw-r--r--src/platformsupport/input/input.pri4
-rw-r--r--src/platformsupport/input/tslib/qtslib.cpp134
-rw-r--r--src/platformsupport/input/tslib/qtslib_p.h (renamed from src/platformsupport/eglconvenience/qeglcompositor_p.h)49
-rw-r--r--src/platformsupport/input/tslib/tslib.pri7
-rw-r--r--src/platformsupport/linuxaccessibility/application.cpp3
-rw-r--r--src/platformsupport/linuxaccessibility/application_p.h4
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp2
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor_p.h2
-rw-r--r--src/platformsupport/linuxaccessibility/bridge.cpp2
-rw-r--r--src/platformsupport/linuxaccessibility/bridge_p.h4
-rw-r--r--src/platformsupport/linuxaccessibility/cache.cpp6
-rw-r--r--src/platformsupport/linuxaccessibility/cache_p.h2
-rw-r--r--src/platformsupport/linuxaccessibility/constant_mappings.cpp2
-rw-r--r--src/platformsupport/linuxaccessibility/constant_mappings_p.h2
-rw-r--r--src/platformsupport/linuxaccessibility/struct_marshallers.cpp2
-rw-r--r--src/platformsupport/linuxaccessibility/struct_marshallers_p.h2
-rw-r--r--src/platformsupport/platformcompositor/platformcompositor.pri7
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositor.cpp (renamed from src/platformsupport/eglconvenience/qeglcompositor.cpp)158
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositor_p.h107
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp (renamed from src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp)103
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h (renamed from src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h)20
-rw-r--r--src/platformsupport/platformsupport.pro1
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices_p.h6
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp13
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h14
61 files changed, 808 insertions, 585 deletions
diff --git a/src/platformsupport/accessibility/qaccessiblebridgeutils_p.h b/src/platformsupport/accessibility/qaccessiblebridgeutils_p.h
index bce2f90a09..e615e8a336 100644
--- a/src/platformsupport/accessibility/qaccessiblebridgeutils_p.h
+++ b/src/platformsupport/accessibility/qaccessiblebridgeutils_p.h
@@ -34,11 +34,11 @@
#ifndef QACCESSIBLEBRIDGEUTILS_H
#define QACCESSIBLEBRIDGEUTILS_H
-#ifndef QT_NO_ACCESSIBILITY
-
#include <QtCore/qstringlist.h>
#include <QtGui/qaccessible.h>
+#ifndef QT_NO_ACCESSIBILITY
+
QT_BEGIN_NAMESPACE
namespace QAccessibleBridgeUtils {
diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri
index 8ada53d2c1..d102203d5e 100644
--- a/src/platformsupport/eglconvenience/eglconvenience.pri
+++ b/src/platformsupport/eglconvenience/eglconvenience.pri
@@ -16,16 +16,12 @@ contains(QT_CONFIG,egl) {
$$PWD/qeglplatformcursor_p.h \
$$PWD/qeglplatformwindow_p.h \
$$PWD/qeglplatformscreen_p.h \
- $$PWD/qeglcompositor_p.h \
- $$PWD/qeglplatformbackingstore_p.h \
$$PWD/qeglplatformintegration_p.h
SOURCES += \
$$PWD/qeglplatformcursor.cpp \
$$PWD/qeglplatformwindow.cpp \
$$PWD/qeglplatformscreen.cpp \
- $$PWD/qeglcompositor.cpp \
- $$PWD/qeglplatformbackingstore.cpp \
$$PWD/qeglplatformintegration.cpp
}
}
diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp
index c1a491c80b..f3a135a499 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience.cpp
+++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp
@@ -303,7 +303,7 @@ EGLConfig QEglConfigChooser::chooseConfig()
} while (q_reduceConfigAttributes(&configureAttributes));
if (!cfg)
- qWarning("Cant find EGLConfig, returning null config");
+ qWarning("Cannot find EGLConfig, returning null config");
return cfg;
}
@@ -460,8 +460,8 @@ QSizeF q_physicalScreenSizeFromFb(int framebufferDevice, const QSize &screenSize
if (size.isEmpty()) {
// Note: in millimeters
- int width = qgetenv("QT_QPA_EGLFS_PHYSICAL_WIDTH").toInt();
- int height = qgetenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT").toInt();
+ int width = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_WIDTH");
+ int height = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_HEIGHT");
if (width && height) {
size.setWidth(width);
@@ -513,8 +513,8 @@ QSize q_screenSizeFromFb(int framebufferDevice)
static QSize size;
if (size.isEmpty()) {
- int width = qgetenv("QT_QPA_EGLFS_WIDTH").toInt();
- int height = qgetenv("QT_QPA_EGLFS_HEIGHT").toInt();
+ int width = qEnvironmentVariableIntValue("QT_QPA_EGLFS_WIDTH");
+ int height = qEnvironmentVariableIntValue("QT_QPA_EGLFS_HEIGHT");
if (width && height) {
size.setWidth(width);
@@ -553,7 +553,7 @@ int q_screenDepthFromFb(int framebufferDevice)
Q_UNUSED(framebufferDevice)
#endif
const int defaultDepth = 32;
- static int depth = qgetenv("QT_QPA_EGLFS_DEPTH").toInt();
+ static int depth = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DEPTH");
if (depth == 0) {
#ifdef Q_OS_LINUX
diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
index 0995b6d443..4a3682b582 100644
--- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h
+++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
@@ -56,8 +56,8 @@ public:
QEGLPbuffer(EGLDisplay display, const QSurfaceFormat &format, QOffscreenSurface *offscreenSurface);
~QEGLPbuffer();
- QSurfaceFormat format() const { return m_format; }
- bool isValid() const { return m_pbuffer != EGL_NO_SURFACE; }
+ QSurfaceFormat format() const Q_DECL_OVERRIDE { return m_format; }
+ bool isValid() const Q_DECL_OVERRIDE { return m_pbuffer != EGL_NO_SURFACE; }
EGLSurface pbuffer() const { return m_pbuffer; }
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
index 7cc330092e..d7c4fd6764 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
@@ -177,17 +177,17 @@ void QEGLPlatformContext::init(const QSurfaceFormat &format, QPlatformOpenGLCont
}
if (m_eglContext == EGL_NO_CONTEXT) {
- qWarning("QEGLPlatformContext::init: eglError: %x, this: %p \n", eglGetError(), this);
+ qWarning("QEGLPlatformContext: Failed to create context: %x", eglGetError());
return;
}
- static const bool printConfig = qgetenv("QT_QPA_EGLFS_DEBUG").toInt();
+ static const bool printConfig = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DEBUG");
if (printConfig) {
qDebug() << "Created context for format" << format << "with config:";
q_printEglConfig(m_eglDisplay, m_eglConfig);
}
- updateFormatFromGL();
+ // Cannot just call updateFormatFromGL() since it relies on virtuals. Defer it to initialize().
}
void QEGLPlatformContext::adopt(const QVariant &nativeHandle, QPlatformOpenGLContext *share)
@@ -238,18 +238,13 @@ void QEGLPlatformContext::adopt(const QVariant &nativeHandle, QPlatformOpenGLCon
updateFormatFromGL();
}
-void QEGLPlatformContext::updateFormatFromGL()
+void QEGLPlatformContext::initialize()
{
-#ifndef QT_NO_OPENGL
- // Have to save & restore to prevent QOpenGLContext::currentContext() from becoming
- // inconsistent after QOpenGLContext::create().
- EGLDisplay prevDisplay = eglGetCurrentDisplay();
- if (prevDisplay == EGL_NO_DISPLAY) // when no context is current
- prevDisplay = m_eglDisplay;
- EGLContext prevContext = eglGetCurrentContext();
- EGLSurface prevSurfaceDraw = eglGetCurrentSurface(EGL_DRAW);
- EGLSurface prevSurfaceRead = eglGetCurrentSurface(EGL_READ);
+ updateFormatFromGL();
+}
+EGLSurface QEGLPlatformContext::createTemporaryOffscreenSurface()
+{
// Make the context current to ensure the GL version query works. This needs a surface too.
const EGLint pbufferAttributes[] = {
EGL_WIDTH, 1,
@@ -257,15 +252,34 @@ void QEGLPlatformContext::updateFormatFromGL()
EGL_LARGEST_PBUFFER, EGL_FALSE,
EGL_NONE
};
+
// Cannot just pass m_eglConfig because it may not be suitable for pbuffers. Instead,
// do what QEGLPbuffer would do: request a config with the same attributes but with
// PBUFFER_BIT set.
EGLConfig config = q_configFromGLFormat(m_eglDisplay, m_format, false, EGL_PBUFFER_BIT);
- EGLSurface pbuffer = eglCreatePbufferSurface(m_eglDisplay, config, pbufferAttributes);
- if (pbuffer == EGL_NO_SURFACE)
- return;
- if (eglMakeCurrent(m_eglDisplay, pbuffer, pbuffer, m_eglContext)) {
+ return eglCreatePbufferSurface(m_eglDisplay, config, pbufferAttributes);
+}
+
+void QEGLPlatformContext::destroyTemporaryOffscreenSurface(EGLSurface surface)
+{
+ eglDestroySurface(m_eglDisplay, surface);
+}
+
+void QEGLPlatformContext::updateFormatFromGL()
+{
+#ifndef QT_NO_OPENGL
+ // Have to save & restore to prevent QOpenGLContext::currentContext() from becoming
+ // inconsistent after QOpenGLContext::create().
+ EGLDisplay prevDisplay = eglGetCurrentDisplay();
+ if (prevDisplay == EGL_NO_DISPLAY) // when no context is current
+ prevDisplay = m_eglDisplay;
+ EGLContext prevContext = eglGetCurrentContext();
+ EGLSurface prevSurfaceDraw = eglGetCurrentSurface(EGL_DRAW);
+ EGLSurface prevSurfaceRead = eglGetCurrentSurface(EGL_READ);
+
+ EGLSurface tempSurface = createTemporaryOffscreenSurface();
+ if (eglMakeCurrent(m_eglDisplay, tempSurface, tempSurface, m_eglContext)) {
if (m_format.renderableType() == QSurfaceFormat::OpenGL
|| m_format.renderableType() == QSurfaceFormat::OpenGLES) {
const GLubyte *s = glGetString(GL_VERSION);
@@ -303,7 +317,7 @@ void QEGLPlatformContext::updateFormatFromGL()
}
eglMakeCurrent(prevDisplay, prevSurfaceDraw, prevSurfaceRead, prevContext);
}
- eglDestroySurface(m_eglDisplay, pbuffer);
+ destroyTemporaryOffscreenSurface(tempSurface);
#endif // QT_NO_OPENGL
}
@@ -343,7 +357,7 @@ bool QEGLPlatformContext::makeCurrent(QPlatformSurface *surface)
eglSwapInterval(eglDisplay(), m_swapInterval);
}
} else {
- qWarning("QEGLPlatformContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this);
+ qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x", eglGetError());
}
return ok;
@@ -362,7 +376,7 @@ void QEGLPlatformContext::doneCurrent()
eglBindAPI(m_api);
bool ok = eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (!ok)
- qWarning("QEGLPlatformContext::doneCurrent(): eglError: %d, this: %p \n", eglGetError(), this);
+ qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x", eglGetError());
}
void QEGLPlatformContext::swapBuffers(QPlatformSurface *surface)
@@ -371,7 +385,7 @@ void QEGLPlatformContext::swapBuffers(QPlatformSurface *surface)
EGLSurface eglSurface = eglSurfaceForPlatformSurface(surface);
bool ok = eglSwapBuffers(m_eglDisplay, eglSurface);
if (!ok)
- qWarning("QEGLPlatformContext::swapBuffers(): eglError: %d, this: %p \n", eglGetError(), this);
+ qWarning("QEGLPlatformContext: eglSwapBuffers failed: %x", eglGetError());
}
void (*QEGLPlatformContext::getProcAddress(const QByteArray &procName)) ()
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
index 7825c7b3d7..c6d2fdec92 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
@@ -59,14 +59,15 @@ public:
EGLConfig *config = 0, const QVariant &nativeHandle = QVariant());
~QEGLPlatformContext();
- bool makeCurrent(QPlatformSurface *surface);
- void doneCurrent();
- void swapBuffers(QPlatformSurface *surface);
- void (*getProcAddress(const QByteArray &procName)) ();
+ void initialize() Q_DECL_OVERRIDE;
+ bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
+ void doneCurrent() Q_DECL_OVERRIDE;
+ void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
+ void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE;
- QSurfaceFormat format() const;
- bool isSharing() const { return m_shareContext != EGL_NO_CONTEXT; }
- bool isValid() const { return m_eglContext != EGL_NO_CONTEXT; }
+ QSurfaceFormat format() const Q_DECL_OVERRIDE;
+ bool isSharing() const Q_DECL_OVERRIDE { return m_shareContext != EGL_NO_CONTEXT; }
+ bool isValid() const Q_DECL_OVERRIDE { return m_eglContext != EGL_NO_CONTEXT; }
EGLContext eglContext() const;
EGLDisplay eglDisplay() const;
@@ -74,6 +75,8 @@ public:
protected:
virtual EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) = 0;
+ virtual EGLSurface createTemporaryOffscreenSurface();
+ virtual void destroyTemporaryOffscreenSurface(EGLSurface surface);
private:
void init(const QSurfaceFormat &format, QPlatformOpenGLContext *share);
diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
index 83204748c1..bf2aeef378 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
@@ -92,6 +92,7 @@ private:
class QEGLPlatformCursor : public QPlatformCursor, protected QOpenGLFunctions
{
+ Q_OBJECT
public:
QEGLPlatformCursor(QPlatformScreen *screen);
~QEGLPlatformCursor();
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp
index 7d05b54c15..09011e6e58 100644
--- a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp
@@ -43,6 +43,7 @@
#include <QtPlatformSupport/private/qgenericunixservices_p.h>
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
#include <QtPlatformSupport/private/qfbvthandler_p.h>
+#include <QtPlatformSupport/private/qopenglcompositorbackingstore_p.h>
#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
#include <QtPlatformSupport/private/qevdevmousemanager_p.h>
@@ -50,12 +51,15 @@
#include <QtPlatformSupport/private/qevdevtouch_p.h>
#endif
+#if !defined(QT_NO_TSLIB) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+#include <QtPlatformSupport/private/qtslib_p.h>
+#endif
+
#include <QtPlatformHeaders/qeglfsfunctions.h>
#include "qeglplatformintegration_p.h"
#include "qeglplatformcontext_p.h"
#include "qeglplatformwindow_p.h"
-#include "qeglplatformbackingstore_p.h"
#include "qeglplatformscreen_p.h"
#include "qeglplatformcursor_p.h"
@@ -84,8 +88,7 @@ QT_BEGIN_NAMESPACE
*/
QEGLPlatformIntegration::QEGLPlatformIntegration()
- : m_screen(0),
- m_display(EGL_NO_DISPLAY),
+ : m_display(EGL_NO_DISPLAY),
m_inputContext(0),
m_fontDb(new QGenericUnixFontDatabase),
m_services(new QGenericUnixServices),
@@ -95,9 +98,6 @@ QEGLPlatformIntegration::QEGLPlatformIntegration()
QEGLPlatformIntegration::~QEGLPlatformIntegration()
{
- delete m_screen;
- if (m_display != EGL_NO_DISPLAY)
- eglTerminate(m_display);
}
void QEGLPlatformIntegration::initialize()
@@ -110,14 +110,20 @@ void QEGLPlatformIntegration::initialize()
if (!eglInitialize(m_display, &major, &minor))
qFatal("Could not initialize egl display");
- m_screen = createScreen();
- screenAdded(m_screen);
-
m_inputContext = QPlatformInputContextFactory::create();
m_vtHandler.reset(new QFbVtHandler);
}
+void QEGLPlatformIntegration::destroy()
+{
+ foreach (QWindow *w, qGuiApp->topLevelWindows())
+ w->destroy();
+
+ if (m_display != EGL_NO_DISPLAY)
+ eglTerminate(m_display);
+}
+
QAbstractEventDispatcher *QEGLPlatformIntegration::createEventDispatcher() const
{
return createUnixEventDispatcher();
@@ -135,7 +141,9 @@ QPlatformFontDatabase *QEGLPlatformIntegration::fontDatabase() const
QPlatformBackingStore *QEGLPlatformIntegration::createPlatformBackingStore(QWindow *window) const
{
- return new QEGLPlatformBackingStore(window);
+ QOpenGLCompositorBackingStore *bs = new QOpenGLCompositorBackingStore(window);
+ static_cast<QEGLPlatformWindow *>(window->handle())->setBackingStore(bs);
+ return bs;
}
QPlatformWindow *QEGLPlatformIntegration::createPlatformWindow(QWindow *window) const
@@ -150,10 +158,9 @@ QPlatformWindow *QEGLPlatformIntegration::createPlatformWindow(QWindow *window)
QPlatformOpenGLContext *QEGLPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
- QEGLPlatformScreen *screen = static_cast<QEGLPlatformScreen *>(context->screen()->handle());
// If there is a "root" window into which raster and QOpenGLWidget content is
// composited, all other contexts must share with its context.
- QOpenGLContext *compositingContext = screen ? screen->compositingContext() : 0;
+ QOpenGLContext *compositingContext = QOpenGLCompositor::instance()->context();
QPlatformOpenGLContext *share = compositingContext ? compositingContext->handle() : context->shareHandle();
QVariant nativeHandle = context->nativeHandle();
QPlatformOpenGLContext *platformContext = createContext(context->format(),
@@ -219,7 +226,7 @@ void *QEGLPlatformIntegration::nativeResourceForIntegration(const QByteArray &re
switch (resourceType(resource)) {
case EglDisplay:
- result = m_screen->display();
+ result = display();
break;
case NativeDisplay:
result = reinterpret_cast<void*>(nativeDisplay());
@@ -257,7 +264,7 @@ void *QEGLPlatformIntegration::nativeResourceForWindow(const QByteArray &resourc
if (window && window->handle())
result = static_cast<QEGLPlatformScreen *>(window->handle()->screen())->display();
else
- result = m_screen->display();
+ result = display();
break;
case EglWindow:
if (window && window->handle())
@@ -345,11 +352,17 @@ void QEGLPlatformIntegration::createInputHandlers()
m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this);
QEvdevMouseManager *mouseMgr = new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this);
Q_FOREACH (QScreen *screen, QGuiApplication::screens()) {
- QEGLPlatformCursor *cursor = static_cast<QEGLPlatformCursor *>(screen->handle()->cursor());
+ QEGLPlatformCursor *cursor = qobject_cast<QEGLPlatformCursor *>(screen->handle()->cursor());
if (cursor)
cursor->setMouseDeviceDiscovery(mouseMgr->deviceDiscovery());
}
- new QEvdevTouchScreenHandlerThread(QString() /* spec */, this);
+#ifndef QT_NO_TSLIB
+ const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_EGLFS_TSLIB");
+ if (useTslib)
+ new QTsLibMouseHandler(QLatin1String("TsLib"), QString() /* spec */);
+ else
+#endif // QT_NO_TSLIB
+ new QEvdevTouchScreenHandlerThread(QString() /* spec */, this);
#endif
}
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
index 4d7adce309..7f0037db92 100644
--- a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
@@ -52,7 +52,6 @@
QT_BEGIN_NAMESPACE
-class QEGLPlatformScreen;
class QEGLPlatformWindow;
class QEGLPlatformContext;
class QFbVtHandler;
@@ -65,8 +64,8 @@ public:
~QEGLPlatformIntegration();
void initialize() Q_DECL_OVERRIDE;
+ void destroy() Q_DECL_OVERRIDE;
- QEGLPlatformScreen *screen() const { return m_screen; }
EGLDisplay display() const { return m_display; }
QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
@@ -92,7 +91,6 @@ public:
QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE;
protected:
- virtual QEGLPlatformScreen *createScreen() const = 0;
virtual QEGLPlatformWindow *createWindow(QWindow *window) const = 0;
virtual QEGLPlatformContext *createContext(const QSurfaceFormat &format,
QPlatformOpenGLContext *shareContext,
@@ -109,7 +107,6 @@ protected:
private:
static void loadKeymapStatic(const QString &filename);
- QEGLPlatformScreen *m_screen;
EGLDisplay m_display;
QPlatformInputContext *m_inputContext;
QScopedPointer<QPlatformFontDatabase> m_fontDb;
diff --git a/src/platformsupport/eglconvenience/qeglplatformscreen.cpp b/src/platformsupport/eglconvenience/qeglplatformscreen.cpp
index fd577a48d7..fd9befb575 100644
--- a/src/platformsupport/eglconvenience/qeglplatformscreen.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformscreen.cpp
@@ -31,8 +31,8 @@
**
****************************************************************************/
-#include "qeglcompositor_p.h"
#include "qeglplatformscreen_p.h"
+#include <QtPlatformSupport/private/qopenglcompositor_p.h>
QT_BEGIN_NAMESPACE
@@ -42,19 +42,6 @@ QT_BEGIN_NAMESPACE
\since 5.2
\internal
\ingroup qpa
-
- This class provides a lightweight base for QPlatformScreen
- implementations. It covers basic window stack management which is
- necessary when compositing multiple raster (widget-based) windows
- together into one single native surface.
-
- Reimplementing the virtuals are essential when using
- QEGLPlatformBackingStore. The context and the window returned from
- these are the ones that are used when compositing the textures
- generated from the raster (widget) based windows.
-
- \note It is up to the QEGLPlatformWindow subclasses to use the
- functions, like addWindow(), removeWindow(), etc., provided here.
*/
QEGLPlatformScreen::QEGLPlatformScreen(EGLDisplay dpy)
@@ -64,39 +51,7 @@ QEGLPlatformScreen::QEGLPlatformScreen(EGLDisplay dpy)
QEGLPlatformScreen::~QEGLPlatformScreen()
{
- QEGLCompositor::destroy();
-}
-
-void QEGLPlatformScreen::addWindow(QEGLPlatformWindow *window)
-{
- if (!m_windows.contains(window)) {
- m_windows.append(window);
- topWindowChanged(window);
- }
-}
-
-void QEGLPlatformScreen::removeWindow(QEGLPlatformWindow *window)
-{
- m_windows.removeOne(window);
- if (!m_windows.isEmpty())
- topWindowChanged(m_windows.last());
-}
-
-void QEGLPlatformScreen::moveToTop(QEGLPlatformWindow *window)
-{
- m_windows.removeOne(window);
- m_windows.append(window);
- topWindowChanged(window);
-}
-
-void QEGLPlatformScreen::changeWindowIndex(QEGLPlatformWindow *window, int newIdx)
-{
- int idx = m_windows.indexOf(window);
- if (idx != -1 && idx != newIdx) {
- m_windows.move(idx, newIdx);
- if (newIdx == m_windows.size() - 1)
- topWindowChanged(m_windows.last());
- }
+ QOpenGLCompositor::destroy();
}
QT_END_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglplatformscreen_p.h b/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
index bb1d26d7d2..e9d3363a66 100644
--- a/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
@@ -60,22 +60,9 @@ public:
QEGLPlatformScreen(EGLDisplay dpy);
~QEGLPlatformScreen();
- QList<QEGLPlatformWindow *> windows() const { return m_windows; }
-
- void addWindow(QEGLPlatformWindow *window);
- void removeWindow(QEGLPlatformWindow *window);
- void moveToTop(QEGLPlatformWindow *window);
- void changeWindowIndex(QEGLPlatformWindow *window, int newIdx);
-
- virtual void topWindowChanged(QEGLPlatformWindow *window) { Q_UNUSED(window); }
-
EGLDisplay display() const { return m_dpy; }
- virtual QEGLPlatformWindow *compositingWindow() = 0;
- virtual QOpenGLContext *compositingContext() = 0;
-
private:
- QList<QEGLPlatformWindow *> m_windows;
EGLDisplay m_dpy;
};
diff --git a/src/platformsupport/eglconvenience/qeglplatformwindow.cpp b/src/platformsupport/eglconvenience/qeglplatformwindow.cpp
index 39edec4811..5e5c879a22 100644
--- a/src/platformsupport/eglconvenience/qeglplatformwindow.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformwindow.cpp
@@ -32,9 +32,10 @@
****************************************************************************/
#include <qpa/qwindowsysteminterface.h>
+#include <QtPlatformSupport/private/qopenglcompositor_p.h>
+#include <QtPlatformSupport/private/qopenglcompositorbackingstore_p.h>
#include "qeglplatformwindow_p.h"
-#include "qeglplatformbackingstore_p.h"
#include "qeglplatformscreen_p.h"
QT_BEGIN_NAMESPACE
@@ -47,7 +48,7 @@ QT_BEGIN_NAMESPACE
\ingroup qpa
Lightweight class providing some basic platform window operations
- and interfacing with QEGLPlatformBackingStore.
+ and interfacing with QOpenGLCompositorBackingStore.
Almost no QPlatformWindow functions are implemented here. This is
intentional because different platform plugins may use different
@@ -57,13 +58,15 @@ QT_BEGIN_NAMESPACE
enforce anything for these functions.
\note Subclasses are responsible for invoking this class'
- implementation of create(). When using QEGLPlatformScreen, the
- subclasses of this class are expected to utilize the window stack
- management functions (addWindow() etc.) provided there.
+ implementation of create() and are expected to utilize the window
+ stack management functions (addWindow() etc.) in
+ QOpenGLCompositor.
*/
QEGLPlatformWindow::QEGLPlatformWindow(QWindow *w)
: QPlatformWindow(w),
+ m_backingStore(0),
+ m_raster(false),
m_winId(0)
{
}
@@ -100,6 +103,11 @@ bool QEGLPlatformWindow::isRaster() const
return m_raster || window()->surfaceType() == QSurface::RasterGLSurface;
}
+QWindow *QEGLPlatformWindow::sourceWindow() const
+{
+ return window();
+}
+
const QPlatformTextureList *QEGLPlatformWindow::textures() const
{
if (m_backingStore)
@@ -108,10 +116,10 @@ const QPlatformTextureList *QEGLPlatformWindow::textures() const
return 0;
}
-void QEGLPlatformWindow::composited()
+void QEGLPlatformWindow::endCompositing()
{
if (m_backingStore)
- m_backingStore->composited();
+ m_backingStore->notifyComposited();
}
WId QEGLPlatformWindow::winId() const
@@ -122,7 +130,7 @@ WId QEGLPlatformWindow::winId() const
void QEGLPlatformWindow::setOpacity(qreal)
{
if (!isRaster())
- qWarning("eglfs: Cannot set opacity for non-raster windows");
+ qWarning("QEGLPlatformWindow: Cannot set opacity for non-raster windows");
// Nothing to do here. The opacity is stored in the QWindow.
}
diff --git a/src/platformsupport/eglconvenience/qeglplatformwindow_p.h b/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
index 3a19301e5d..947f02aeb5 100644
--- a/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
@@ -46,33 +46,36 @@
//
#include <qpa/qplatformwindow.h>
+#include <QtPlatformSupport/private/qopenglcompositor_p.h>
#include <EGL/egl.h>
QT_BEGIN_NAMESPACE
-class QEGLPlatformBackingStore;
+class QOpenGLCompositorBackingStore;
class QPlatformTextureList;
-class QEGLPlatformWindow : public QPlatformWindow
+class QEGLPlatformWindow : public QPlatformWindow, public QOpenGLCompositorWindow
{
public:
QEGLPlatformWindow(QWindow *w);
virtual void create();
- QEGLPlatformBackingStore *backingStore() { return m_backingStore; }
- void setBackingStore(QEGLPlatformBackingStore *backingStore) { m_backingStore = backingStore; }
- const QPlatformTextureList *textures() const;
- void composited();
+ QOpenGLCompositorBackingStore *backingStore() { return m_backingStore; }
+ void setBackingStore(QOpenGLCompositorBackingStore *backingStore) { m_backingStore = backingStore; }
bool isRaster() const;
+ QWindow *sourceWindow() const Q_DECL_OVERRIDE;
+ const QPlatformTextureList *textures() const Q_DECL_OVERRIDE;
+ void endCompositing() Q_DECL_OVERRIDE;
+
WId winId() const Q_DECL_OVERRIDE;
void setOpacity(qreal opacity) Q_DECL_OVERRIDE;
virtual EGLNativeWindowType eglWindow() const = 0;
private:
- QEGLPlatformBackingStore *m_backingStore;
+ QOpenGLCompositorBackingStore *m_backingStore;
bool m_raster;
WId m_winId;
};
diff --git a/src/platformsupport/eglconvenience/qxlibeglintegration.cpp b/src/platformsupport/eglconvenience/qxlibeglintegration.cpp
index eb6e01c585..f697f1ab89 100644
--- a/src/platformsupport/eglconvenience/qxlibeglintegration.cpp
+++ b/src/platformsupport/eglconvenience/qxlibeglintegration.cpp
@@ -31,8 +31,11 @@
**
****************************************************************************/
+#include <QLoggingCategory>
#include "qxlibeglintegration_p.h"
+Q_LOGGING_CATEGORY(lcXlibEglDebug, "qt.egl.xlib.debug")
+
VisualID QXlibEglIntegration::getCompatibleVisualId(Display *display, EGLDisplay eglDisplay, EGLConfig config)
{
VisualID visualId = 0;
@@ -87,31 +90,26 @@ VisualID QXlibEglIntegration::getCompatibleVisualId(Display *display, EGLDisplay
// configs. In such a case we have to fall back to XGetVisualInfo.
if (!visualMatchesConfig) {
visualId = 0;
-#ifdef QT_DEBUG_X11_VISUAL_SELECTION
- qWarning("Warning: EGL suggested using X Visual ID %d (%d %d %d depth %d) for EGL config %d (%d %d %d %d), but this is incompatible",
- (int)visualId, visualRedSize, visualGreenSize, visualBlueSize, chosenVisualInfo->depth,
- configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize);
-#endif
+ qCDebug(lcXlibEglDebug,
+ "EGL suggested using X Visual ID %d (%d %d %d depth %d) for EGL config %d"
+ "(%d %d %d %d), but this is incompatible",
+ (int)visualId, visualRedSize, visualGreenSize, visualBlueSize, chosenVisualInfo->depth,
+ configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize);
}
} else {
- qWarning("Warning: EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID",
- (int)visualId, configId);
+ qCDebug(lcXlibEglDebug, "EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID",
+ (int)visualId, configId);
visualId = 0;
}
XFree(chosenVisualInfo);
}
-#ifdef QT_DEBUG_X11_VISUAL_SELECTION
else
- qDebug("EGL did not suggest a VisualID (EGL_NATIVE_VISUAL_ID was zero) for EGLConfig %d", configId);
-#endif
+ qCDebug(lcXlibEglDebug, "EGL did not suggest a VisualID (EGL_NATIVE_VISUAL_ID was zero) for EGLConfig %d", configId);
if (visualId) {
-#ifdef QT_DEBUG_X11_VISUAL_SELECTION
- if (configAlphaSize > 0)
- qDebug("Using ARGB Visual ID %d provided by EGL for config %d", (int)visualId, configId);
- else
- qDebug("Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId);
-#endif
+ qCDebug(lcXlibEglDebug, configAlphaSize > 0
+ ? "Using ARGB Visual ID %d provided by EGL for config %d"
+ : "Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId);
return visualId;
}
@@ -143,9 +141,7 @@ VisualID QXlibEglIntegration::getCompatibleVisualId(Display *display, EGLDisplay
}
if (visualId) {
-#ifdef QT_DEBUG_X11_VISUAL_SELECTION
- qDebug("Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, configId);
-#endif
+ qCDebug(lcXlibEglDebug, "Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, configId);
return visualId;
}
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h b/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
index a9402f920d..e182d949b0 100644
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
+++ b/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
@@ -61,7 +61,7 @@ public:
explicit QPAEventDispatcherGlib(QObject *parent = 0);
~QPAEventDispatcherGlib();
- bool processEvents(QEventLoop::ProcessEventsFlags flags);
+ bool processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE;
QEventLoop::ProcessEventsFlags m_flags;
};
diff --git a/src/platformsupport/fbconvenience/qfbbackingstore_p.h b/src/platformsupport/fbconvenience/qfbbackingstore_p.h
index 08a4b37eee..cf9e5088ad 100644
--- a/src/platformsupport/fbconvenience/qfbbackingstore_p.h
+++ b/src/platformsupport/fbconvenience/qfbbackingstore_p.h
@@ -59,10 +59,10 @@ public:
QFbBackingStore(QWindow *window);
~QFbBackingStore();
- virtual QPaintDevice *paintDevice() { return &mImage; }
- virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset);
+ virtual QPaintDevice *paintDevice() Q_DECL_OVERRIDE { return &mImage; }
+ virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
- virtual void resize(const QSize &size, const QRegion &region);
+ virtual void resize(const QSize &size, const QRegion &region) Q_DECL_OVERRIDE;
const QImage image() { return mImage; }
diff --git a/src/platformsupport/fbconvenience/qfbcursor_p.h b/src/platformsupport/fbconvenience/qfbcursor_p.h
index 0354989a8b..95632f177b 100644
--- a/src/platformsupport/fbconvenience/qfbcursor_p.h
+++ b/src/platformsupport/fbconvenience/qfbcursor_p.h
@@ -61,9 +61,9 @@ public:
virtual QRect drawCursor(QPainter &painter);
// input methods
- virtual void pointerEvent(const QMouseEvent &event);
+ virtual void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE;
#ifndef QT_NO_CURSOR
- virtual void changeCursor(QCursor *widgetCursor, QWindow *window);
+ virtual void changeCursor(QCursor *widgetCursor, QWindow *window) Q_DECL_OVERRIDE;
#endif
virtual void setDirty();
diff --git a/src/platformsupport/fbconvenience/qfbvthandler.cpp b/src/platformsupport/fbconvenience/qfbvthandler.cpp
index 511f723dd9..d6c3944cb0 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler.cpp
+++ b/src/platformsupport/fbconvenience/qfbvthandler.cpp
@@ -68,7 +68,7 @@ QFbVtHandler::QFbVtHandler(QObject *parent)
m_tty = 0;
::ioctl(m_tty, KDGKBMODE, &m_oldKbdMode);
- if (!qgetenv("QT_QPA_ENABLE_TERMINAL_KEYBOARD").toInt()) {
+ if (!qEnvironmentVariableIntValue("QT_QPA_ENABLE_TERMINAL_KEYBOARD")) {
::ioctl(m_tty, KDSKBMODE, KBD_OFF_MODE);
QGuiApplicationPrivate *appd = QGuiApplicationPrivate::instance();
Q_ASSERT(appd);
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
index 52505c570b..f831f3b908 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
@@ -281,41 +281,26 @@ QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByt
if (supportedWritingSystems)
*supportedWritingSystems = writingSystems;
- if (os2->usWeightClass == 0)
- ;
- else if (os2->usWeightClass < 150)
- weight = qt_thinFontWeight;
- else if (os2->usWeightClass < 250)
- weight = qt_extralightFontWeight;
- else if (os2->usWeightClass < 350)
- weight = QFont::Light;
- else if (os2->usWeightClass < 450)
- weight = QFont::Normal;
- else if (os2->usWeightClass < 550)
- weight = qt_mediumFontWeight;
- else if (os2->usWeightClass < 650)
- weight = QFont::DemiBold;
- else if (os2->usWeightClass < 750)
- weight = QFont::Bold;
- else if (os2->usWeightClass < 1000)
- weight = QFont::Black;
-
- if (os2->panose[2] >= 2) {
+ if (os2->usWeightClass) {
+ weight = QPlatformFontDatabase::weightFromInteger(os2->usWeightClass);
+ } else if (os2->panose[2]) {
int w = os2->panose[2];
if (w <= 1)
- weight = qt_thinFontWeight;
+ weight = QFont::Thin;
else if (w <= 2)
- weight = qt_extralightFontWeight;
+ weight = QFont::ExtraLight;
else if (w <= 3)
weight = QFont::Light;
else if (w <= 5)
weight = QFont::Normal;
else if (w <= 6)
- weight = qt_mediumFontWeight;
+ weight = QFont::Medium;
else if (w <= 7)
weight = QFont::DemiBold;
else if (w <= 8)
weight = QFont::Bold;
+ else if (w <= 9)
+ weight = QFont::ExtraBold;
else if (w <= 10)
weight = QFont::Black;
}
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
index a37bfb9f5c..5593577389 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
@@ -60,12 +60,12 @@ struct FontFile
class QBasicFontDatabase : public QPlatformFontDatabase
{
public:
- void populateFontDatabase();
- QFontEngine *fontEngine(const QFontDef &fontDef, void *handle);
- QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference);
- QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const;
- QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName);
- void releaseHandle(void *handle);
+ void populateFontDatabase() Q_DECL_OVERRIDE;
+ QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
+ QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE;
+ QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE;
+ QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE;
+ void releaseHandle(void *handle) Q_DECL_OVERRIDE;
static QStringList addTTFile(const QByteArray &fontData, const QByteArray &file, QSupportedWritingSystems *supportedWritingSystems = 0);
static QString fontNameFromTTFile(const QString &filename);
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 5dec1d0915..f129bb40dd 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -54,6 +54,13 @@
QT_BEGIN_NAMESPACE
+static const int maxWeight = 99;
+
+static inline int mapToQtWeightForRange(int fcweight, int fcLower, int fcUpper, int qtLower, int qtUpper)
+{
+ return qtLower + ((fcweight - fcLower) * (qtUpper - qtLower)) / (fcUpper - fcLower);
+}
+
static inline bool requiresOpenType(int writingSystem)
{
return ((writingSystem >= QFontDatabase::Syriac && writingSystem <= QFontDatabase::Sinhala)
@@ -68,26 +75,28 @@ static inline int weightFromFcWeight(int fcweight)
// mapping. This ensures that where there is a corresponding enum on both sides (for example
// FC_WEIGHT_DEMIBOLD and QFont::DemiBold) we map one to the other but other values map
// to intermediate Qt weights.
- const int maxWeight = 99;
- int qtweight;
- if (fcweight < 0)
- qtweight = 0;
- else if (fcweight <= FC_WEIGHT_LIGHT)
- qtweight = (fcweight * QFont::Light) / FC_WEIGHT_LIGHT;
- else if (fcweight <= FC_WEIGHT_NORMAL)
- qtweight = QFont::Light + ((fcweight - FC_WEIGHT_LIGHT) * (QFont::Normal - QFont::Light)) / (FC_WEIGHT_NORMAL - FC_WEIGHT_LIGHT);
- else if (fcweight <= FC_WEIGHT_DEMIBOLD)
- qtweight = QFont::Normal + ((fcweight - FC_WEIGHT_NORMAL) * (QFont::DemiBold - QFont::Normal)) / (FC_WEIGHT_DEMIBOLD - FC_WEIGHT_NORMAL);
- else if (fcweight <= FC_WEIGHT_BOLD)
- qtweight = QFont::DemiBold + ((fcweight - FC_WEIGHT_DEMIBOLD) * (QFont::Bold - QFont::DemiBold)) / (FC_WEIGHT_BOLD - FC_WEIGHT_DEMIBOLD);
- else if (fcweight <= FC_WEIGHT_BLACK)
- qtweight = QFont::Bold + ((fcweight - FC_WEIGHT_BOLD) * (QFont::Black - QFont::Bold)) / (FC_WEIGHT_BLACK - FC_WEIGHT_BOLD);
- else if (fcweight <= FC_WEIGHT_ULTRABLACK)
- qtweight = QFont::Black + ((fcweight - FC_WEIGHT_BLACK) * (maxWeight - QFont::Black)) / (FC_WEIGHT_ULTRABLACK - FC_WEIGHT_BLACK);
- else
- qtweight = maxWeight;
- return qtweight;
+ if (fcweight <= FC_WEIGHT_THIN)
+ return QFont::Thin;
+ if (fcweight <= FC_WEIGHT_ULTRALIGHT)
+ return mapToQtWeightForRange(fcweight, FC_WEIGHT_THIN, FC_WEIGHT_ULTRALIGHT, QFont::Thin, QFont::ExtraLight);
+ if (fcweight <= FC_WEIGHT_LIGHT)
+ return mapToQtWeightForRange(fcweight, FC_WEIGHT_ULTRALIGHT, FC_WEIGHT_LIGHT, QFont::ExtraLight, QFont::Light);
+ if (fcweight <= FC_WEIGHT_NORMAL)
+ return mapToQtWeightForRange(fcweight, FC_WEIGHT_LIGHT, FC_WEIGHT_NORMAL, QFont::Light, QFont::Normal);
+ if (fcweight <= FC_WEIGHT_MEDIUM)
+ return mapToQtWeightForRange(fcweight, FC_WEIGHT_NORMAL, FC_WEIGHT_MEDIUM, QFont::Normal, QFont::Medium);
+ if (fcweight <= FC_WEIGHT_DEMIBOLD)
+ return mapToQtWeightForRange(fcweight, FC_WEIGHT_MEDIUM, FC_WEIGHT_DEMIBOLD, QFont::Medium, QFont::DemiBold);
+ if (fcweight <= FC_WEIGHT_BOLD)
+ return mapToQtWeightForRange(fcweight, FC_WEIGHT_DEMIBOLD, FC_WEIGHT_BOLD, QFont::DemiBold, QFont::Bold);
+ if (fcweight <= FC_WEIGHT_ULTRABOLD)
+ return mapToQtWeightForRange(fcweight, FC_WEIGHT_BOLD, FC_WEIGHT_ULTRABOLD, QFont::Bold, QFont::ExtraBold);
+ if (fcweight <= FC_WEIGHT_BLACK)
+ return mapToQtWeightForRange(fcweight, FC_WEIGHT_ULTRABOLD, FC_WEIGHT_BLACK, QFont::ExtraBold, QFont::Black);
+ if (fcweight <= FC_WEIGHT_ULTRABLACK)
+ return mapToQtWeightForRange(fcweight, FC_WEIGHT_BLACK, FC_WEIGHT_ULTRABLACK, QFont::Black, maxWeight);
+ return maxWeight;
}
static inline int stretchFromFcWidth(int fcwidth)
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
index 745d12b825..f67db6a527 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
@@ -55,14 +55,14 @@ class QFontEngineFT;
class QFontconfigDatabase : public QBasicFontDatabase
{
public:
- void populateFontDatabase();
- QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script);
- QFontEngine *fontEngine(const QFontDef &fontDef, void *handle);
- QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference);
- QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const;
- QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName);
- QString resolveFontFamilyAlias(const QString &family) const;
- QFont defaultFont() const;
+ void populateFontDatabase() Q_DECL_OVERRIDE;
+ QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) Q_DECL_OVERRIDE;
+ QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
+ QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE;
+ QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE;
+ QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE;
+ QString resolveFontFamilyAlias(const QString &family) const Q_DECL_OVERRIDE;
+ QFont defaultFont() const Q_DECL_OVERRIDE;
private:
void setupFontEngine(QFontEngineFT *engine, const QFontDef &fontDef) const;
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp
index 956cf68290..b0460814ca 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp
@@ -38,7 +38,7 @@
QT_BEGIN_NAMESPACE
QFontEngineMultiFontConfig::QFontEngineMultiFontConfig(QFontEngine *fe, int script)
- : QFontEngineMultiBasicImpl(fe, script)
+ : QFontEngineMulti(fe, script)
{
}
@@ -67,8 +67,8 @@ bool QFontEngineMultiFontConfig::shouldLoadFontEngineForCharacter(int at, uint u
FcPattern * QFontEngineMultiFontConfig::getMatchPatternForFallback(int fallBackIndex) const
{
Q_ASSERT(fallBackIndex < fallbackFamilyCount());
- if (engines.size() - 1 > cachedMatchPatterns.size())
- cachedMatchPatterns.resize(engines.size() - 1);
+ if (fallbackFamilyCount() > cachedMatchPatterns.size())
+ cachedMatchPatterns.resize(fallbackFamilyCount());
FcPattern *ret = cachedMatchPatterns.at(fallBackIndex);
if (ret)
return ret;
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
index 115f8e6c16..e748e81cf6 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
@@ -50,14 +50,14 @@
QT_BEGIN_NAMESPACE
-class QFontEngineMultiFontConfig : public QFontEngineMultiBasicImpl
+class QFontEngineMultiFontConfig : public QFontEngineMulti
{
public:
explicit QFontEngineMultiFontConfig(QFontEngine *fe, int script);
~QFontEngineMultiFontConfig();
- bool shouldLoadFontEngineForCharacter(int at, uint ucs4) const;
+ bool shouldLoadFontEngineForCharacter(int at, uint ucs4) const Q_DECL_OVERRIDE;
private:
FcPattern* getMatchPatternForFallback(int at) const;
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index 9f2ff10a21..ac73cd04ad 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -286,25 +286,9 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd)
if (styles) {
if (CFNumberRef weightValue = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontWeightTrait)) {
- double normalizedWeight;
- if (CFNumberGetValue(weightValue, kCFNumberDoubleType, &normalizedWeight)) {
- if (normalizedWeight >= 0.62)
- fd->weight = QFont::Black;
- else if (normalizedWeight >= 0.4)
- fd->weight = QFont::Bold;
- else if (normalizedWeight >= 0.3)
- fd->weight = QFont::DemiBold;
- else if (normalizedWeight >= 0.2)
- fd->weight = qt_mediumFontWeight;
- else if (normalizedWeight == 0.0)
- fd->weight = QFont::Normal;
- else if (normalizedWeight <= -0.4)
- fd->weight = QFont::Light;
- else if (normalizedWeight <= -0.6)
- fd->weight = qt_extralightFontWeight;
- else if (normalizedWeight <= -0.8)
- fd->weight = qt_thinFontWeight;
- }
+ float normalizedWeight;
+ if (CFNumberGetValue(weightValue, kCFNumberFloatType, &normalizedWeight))
+ fd->weight = QCoreTextFontEngine::qtWeightFromCFWeight(normalizedWeight);
}
if (CFNumberRef italic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSlantTrait)) {
double d;
@@ -842,6 +826,11 @@ QFont QCoreTextFontDatabase::defaultFont() const
return QFont(defaultFontName);
}
+bool QCoreTextFontDatabase::fontsAlwaysScalable() const
+{
+ return true;
+}
+
QList<int> QCoreTextFontDatabase::standardSizes() const
{
QList<int> ret;
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
index 044db2b03d..b95a145c1a 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
@@ -87,6 +87,7 @@ public:
void releaseHandle(void *handle);
bool isPrivateFontFamily(const QString &family) const;
QFont defaultFont() const;
+ bool fontsAlwaysScalable() const Q_DECL_OVERRIDE;
QList<int> standardSizes() const;
// For iOS and OS X platform themes
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 23fe48b493..425c7471d4 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -41,6 +41,7 @@
#include "qfontengine_coretext_p.h"
+#include <qpa/qplatformfontdatabase.h>
#include <QtCore/qendian.h>
#include <QtCore/qsettings.h>
@@ -66,6 +67,29 @@ bool QCoreTextFontEngine::ct_getSfntTable(void *user_data, uint tag, uchar *buff
return true;
}
+QFont::Weight QCoreTextFontEngine::qtWeightFromCFWeight(float value)
+{
+ if (value >= 0.62)
+ return QFont::Black;
+ if (value >= 0.5)
+ return QFont::ExtraBold;
+ if (value >= 0.4)
+ return QFont::Bold;
+ if (value >= 0.3)
+ return QFont::DemiBold;
+ if (value >= 0.2)
+ return QFont::Medium;
+ if (value == 0.0)
+ return QFont::Normal;
+ if (value <= -0.4)
+ return QFont::Light;
+ if (value <= -0.6)
+ return QFont::ExtraLight;
+ if (value <= -0.8)
+ return QFont::Thin;
+ return QFont::Normal;
+}
+
static void loadAdvancesForGlyphs(CTFontRef ctfont,
QVarLengthArray<CGGlyph> &cgGlyphs,
QGlyphLayout *glyphs, int len,
@@ -88,6 +112,16 @@ static void loadAdvancesForGlyphs(CTFontRef ctfont,
}
}
+static float getTraitValue(CFDictionaryRef allTraits, CFStringRef trait)
+{
+ if (CFDictionaryContainsKey(allTraits, trait)) {
+ CFNumberRef traitNum = (CFNumberRef) CFDictionaryGetValue(allTraits, trait);
+ float v = 0;
+ CFNumberGetValue(traitNum, kCFNumberFloatType, &v);
+ return v;
+ }
+ return 0;
+}
int QCoreTextFontEngine::antialiasingThreshold = 0;
QFontEngine::GlyphFormat QCoreTextFontEngine::defaultGlyphFormat = QFontEngine::Format_A32;
@@ -129,34 +163,6 @@ QCoreTextFontEngine::~QCoreTextFontEngine()
CFRelease(ctfont);
}
-static QFont::Weight weightFromInteger(int weight)
-{
- if (weight < 400)
- return QFont::Light;
- else if (weight < 600)
- return QFont::Normal;
- else if (weight < 700)
- return QFont::DemiBold;
- else if (weight < 800)
- return QFont::Bold;
- else
- return QFont::Black;
-}
-
-int getTraitValue(CFDictionaryRef allTraits, CFStringRef trait)
-{
- if (CFDictionaryContainsKey(allTraits, trait)) {
- CFNumberRef traitNum = (CFNumberRef) CFDictionaryGetValue(allTraits, trait);
- float v = 0;
- CFNumberGetValue(traitNum, kCFNumberFloatType, &v);
- // the value we get from CFNumberRef is from -1.0 to 1.0
- int value = v * 500 + 500;
- return value;
- }
-
- return 0;
-}
-
void QCoreTextFontEngine::init()
{
Q_ASSERT(ctfont != NULL);
@@ -182,8 +188,8 @@ void QCoreTextFontEngine::init()
fontDef.style = QFont::StyleItalic;
CFDictionaryRef allTraits = CTFontCopyTraits(ctfont);
- fontDef.weight = weightFromInteger(getTraitValue(allTraits, kCTFontWeightTrait));
- int slant = getTraitValue(allTraits, kCTFontSlantTrait);
+ fontDef.weight = QCoreTextFontEngine::qtWeightFromCFWeight(getTraitValue(allTraits, kCTFontWeightTrait));
+ int slant = static_cast<int>(getTraitValue(allTraits, kCTFontSlantTrait) * 500 + 500);
if (slant > 500 && !(traits & kCTFontItalicTrait))
fontDef.style = QFont::StyleOblique;
CFRelease(allTraits);
@@ -646,15 +652,11 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosit
QImage im = imageForGlyph(glyph, subPixelPosition, false, x);
- QImage indexed(im.width(), im.height(), QImage::Format_Indexed8);
- QVector<QRgb> colors(256);
- for (int i=0; i<256; ++i)
- colors[i] = qRgba(0, 0, 0, i);
- indexed.setColorTable(colors);
+ QImage alphaMap(im.width(), im.height(), QImage::Format_Alpha8);
for (int y=0; y<im.height(); ++y) {
uint *src = (uint*) im.scanLine(y);
- uchar *dst = indexed.scanLine(y);
+ uchar *dst = alphaMap.scanLine(y);
for (int x=0; x<im.width(); ++x) {
*dst = qGray(*src);
++dst;
@@ -662,7 +664,7 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosit
}
}
- return indexed;
+ return alphaMap;
}
QImage QCoreTextFontEngine::alphaRGBMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &x)
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
index 998a6abb18..d0f7c79929 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
@@ -57,7 +57,6 @@
QT_BEGIN_NAMESPACE
-class QRawFontPrivate;
class QCoreTextFontEngine : public QFontEngine
{
public:
@@ -122,13 +121,11 @@ public:
}
static bool ct_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length);
+ static QFont::Weight qtWeightFromCFWeight(float value);
static int antialiasingThreshold;
static QFontEngine::GlyphFormat defaultGlyphFormat;
-
private:
- friend class QRawFontPrivate;
-
void init();
QImage imageForGlyph(glyph_t glyph, QFixed subPixelPosition, bool colorful, const QTransform &m);
CTFontRef ctfont;
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
index 27d15dfafa..9ce97cf373 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
@@ -37,20 +37,18 @@
#include <QSocketNotifier>
#include <QStringList>
-#include <qpa/qwindowsysteminterface.h>
#include <QCoreApplication>
+#include <QLoggingCategory>
+#include <qpa/qwindowsysteminterface.h>
#include <private/qcore_unix_p.h>
#include <linux/input.h>
-//#define QT_QPA_KEYMAP_DEBUG
-
-#ifdef QT_QPA_KEYMAP_DEBUG
-#include <qdebug.h>
-#endif
-
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(qLcEvdevKey, "qt.qpa.input")
+Q_LOGGING_CATEGORY(qLcEvdevKeyMap, "qt.qpa.input.keymap")
+
// simple builtin US keymap
#include "qevdevkeyboard_defaultmap_p.h"
@@ -60,9 +58,7 @@ QEvdevKeyboardHandler::QEvdevKeyboardHandler(const QString &device, int fd, bool
m_no_zap(disableZap), m_do_compose(enableCompose),
m_keymap(0), m_keymap_size(0), m_keycompose(0), m_keycompose_size(0)
{
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning() << "Create keyboard handler with for device" << device;
-#endif
+ qCDebug(qLcEvdevKey) << "Create keyboard handler with for device" << device;
setObjectName(QLatin1String("LinuxInput Keyboard Handler"));
@@ -89,9 +85,7 @@ QEvdevKeyboardHandler *QEvdevKeyboardHandler::create(const QString &device,
const QString &specification,
const QString &defaultKeymapFile)
{
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning() << "Try to create keyboard handler for" << device << specification;
-#endif
+ qCDebug(qLcEvdevKey) << "Try to create keyboard handler for" << device << specification;
QString keymapFile = defaultKeymapFile;
int repeatDelay = 400;
@@ -116,9 +110,7 @@ QEvdevKeyboardHandler *QEvdevKeyboardHandler::create(const QString &device,
grab = arg.mid(5).toInt();
}
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning() << "Opening keyboard at" << device;
-#endif
+ qCDebug(qLcEvdevKey) << "Opening keyboard at" << device;
int fd;
fd = qt_safe_open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0);
@@ -138,9 +130,7 @@ QEvdevKeyboardHandler *QEvdevKeyboardHandler::create(const QString &device,
void QEvdevKeyboardHandler::switchLed(int led, bool state)
{
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning() << "switchLed" << led << state;
-#endif
+ qCDebug(qLcEvdevKey) << "switchLed" << led << state;
struct ::input_event led_ie;
::gettimeofday(&led_ie.time, 0);
@@ -153,10 +143,6 @@ void QEvdevKeyboardHandler::switchLed(int led, bool state)
void QEvdevKeyboardHandler::readKeycode()
{
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning() << "Read new keycode on" << m_device;
-#endif
-
struct ::input_event buffer[32];
int n = 0;
@@ -164,11 +150,11 @@ void QEvdevKeyboardHandler::readKeycode()
int result = qt_safe_read(m_fd, reinterpret_cast<char *>(buffer) + n, sizeof(buffer) - n);
if (result == 0) {
- qWarning("Got EOF from the input device.");
+ qWarning("evdevkeyboard: Got EOF from the input device");
return;
} else if (result < 0) {
if (errno != EINTR && errno != EAGAIN) {
- qWarning("Could not read from input device: %s", strerror(errno));
+ qErrnoWarning(errno, "evdevkeyboard: Could not read from input device");
return;
}
} else {
@@ -249,21 +235,17 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
if (m_locks[0] /*CapsLock*/ && map_withmod && (map_withmod->flags & QEvdevKeyboardMap::IsLetter))
modifiers ^= QEvdevKeyboardMap::ModShift;
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning("Processing key event: keycode=%3d, modifiers=%02x pressed=%d, autorepeat=%d | plain=%d, withmod=%d, size=%d", \
- keycode, modifiers, pressed ? 1 : 0, autorepeat ? 1 : 0, \
- map_plain ? map_plain - m_keymap : -1, \
- map_withmod ? map_withmod - m_keymap : -1, \
- m_keymap_size);
-#endif
+ qCDebug(qLcEvdevKeyMap, "Processing key event: keycode=%3d, modifiers=%02x pressed=%d, autorepeat=%d | plain=%d, withmod=%d, size=%d",
+ keycode, modifiers, pressed ? 1 : 0, autorepeat ? 1 : 0,
+ int(map_plain ? map_plain - m_keymap : -1),
+ int(map_withmod ? map_withmod - m_keymap : -1),
+ m_keymap_size);
const QEvdevKeyboardMap::Mapping *it = map_withmod ? map_withmod : map_plain;
if (!it) {
-#ifdef QT_QPA_KEYMAP_DEBUG
// we couldn't even find a plain mapping
- qWarning("Could not find a suitable mapping for keycode: %3d, modifiers: %02x", keycode, modifiers);
-#endif
+ qCDebug(qLcEvdevKeyMap, "Could not find a suitable mapping for keycode: %3d, modifiers: %02x", keycode, modifiers);
return result;
}
@@ -397,9 +379,7 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
}
if (!skip) {
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning("Processing: uni=%04x, qt=%08x, qtmod=%08x", unicode, qtcode & ~modmask, (qtcode & modmask));
-#endif
+ qCDebug(qLcEvdevKeyMap, "Processing: uni=%04x, qt=%08x, qtmod=%08x", unicode, qtcode & ~modmask, (qtcode & modmask));
//If NumLockOff and keypad key pressed remap event sent
if (!m_locks[1] &&
(qtcode & Qt::KeypadModifier) &&
@@ -457,9 +437,7 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
void QEvdevKeyboardHandler::unloadKeymap()
{
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning() << "Unload current keymap and restore built-in";
-#endif
+ qCDebug(qLcEvdevKey) << "Unload current keymap and restore built-in";
if (m_keymap && m_keymap != s_keymap_default)
delete [] m_keymap;
@@ -481,7 +459,7 @@ void QEvdevKeyboardHandler::unloadKeymap()
quint16 ledbits[1];
memset(ledbits, 0, sizeof(ledbits));
if (::ioctl(m_fd, EVIOCGLED(sizeof(ledbits)), ledbits) < 0) {
- qWarning("Failed to query led states. Settings numlock & capslock off");
+ qWarning("evdevkeyboard: Failed to query led states");
switchLed(LED_NUML,false);
switchLed(LED_CAPSL, false);
switchLed(LED_SCROLLL,false);
@@ -495,17 +473,13 @@ void QEvdevKeyboardHandler::unloadKeymap()
//Scrollock
if ((ledbits[0]&0x04) > 0)
m_locks[2] = 1;
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning("numlock=%d , capslock=%d, scrolllock=%d",m_locks[1],m_locks[0],m_locks[2]);
-#endif
+ qCDebug(qLcEvdevKey, "numlock=%d , capslock=%d, scrolllock=%d", m_locks[1], m_locks[0], m_locks[2]);
}
}
bool QEvdevKeyboardHandler::loadKeymap(const QString &file)
{
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning() << "Load keymap" << file;
-#endif
+ qCDebug(qLcEvdevKey) << "Loading keymap" << file;
QFile f(file);
@@ -529,7 +503,7 @@ bool QEvdevKeyboardHandler::loadKeymap(const QString &file)
ds >> qmap_magic >> qmap_version >> qmap_keymap_size >> qmap_keycompose_size;
if (ds.status() != QDataStream::Ok || qmap_magic != QEvdevKeyboardMap::FileMagic || qmap_version != 1 || qmap_keymap_size == 0) {
- qWarning("'%s' is ot a valid.qmap keymap file.", qPrintable(file));
+ qWarning("'%s' is not a valid .qmap keymap file", qPrintable(file));
return false;
}
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
index 3f8eb1bcd5..4614fbd499 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
@@ -35,15 +35,12 @@
#include <QStringList>
#include <QCoreApplication>
-
-//#define QT_QPA_KEYMAP_DEBUG
-
-#ifdef QT_QPA_KEYMAP_DEBUG
-#include <QDebug>
-#endif
+#include <QLoggingCategory>
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(qLcEvdevKey)
+
QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString &specification, QObject *parent)
: QObject(parent)
{
@@ -74,10 +71,7 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString &
addKeyboard(device);
if (devices.isEmpty()) {
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning() << "Use device discovery";
-#endif
-
+ qCDebug(qLcEvdevKey) << "evdevkeyboard: Using device discovery";
m_deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Keyboard, this);
if (m_deviceDiscovery) {
// scan and add already connected keyboards
@@ -100,24 +94,19 @@ QEvdevKeyboardManager::~QEvdevKeyboardManager()
void QEvdevKeyboardManager::addKeyboard(const QString &deviceNode)
{
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning() << "Adding keyboard at" << deviceNode;
-#endif
-
+ qCDebug(qLcEvdevKey) << "Adding keyboard at" << deviceNode;
QEvdevKeyboardHandler *keyboard;
keyboard = QEvdevKeyboardHandler::create(deviceNode, m_spec, m_defaultKeymapFile);
if (keyboard)
m_keyboards.insert(deviceNode, keyboard);
else
- qWarning("Failed to open keyboard");
+ qWarning("Failed to open keyboard device %s", qPrintable(deviceNode));
}
void QEvdevKeyboardManager::removeKeyboard(const QString &deviceNode)
{
if (m_keyboards.contains(deviceNode)) {
-#ifdef QT_QPA_KEYMAP_DEBUG
- qWarning() << "Removing keyboard at" << deviceNode;
-#endif
+ qCDebug(qLcEvdevKey) << "Removing keyboard at" << deviceNode;
QEvdevKeyboardHandler *keyboard = m_keyboards.value(deviceNode);
m_keyboards.remove(deviceNode);
delete keyboard;
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
index 11db06680a..eddf180e4a 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
@@ -38,6 +38,7 @@
#include <QPoint>
#include <QGuiApplication>
#include <QScreen>
+#include <QLoggingCategory>
#include <qpa/qwindowsysteminterface.h>
#include <qplatformdefs.h>
@@ -48,19 +49,15 @@
#include <linux/kd.h>
#include <linux/input.h>
-#include <qdebug.h>
-
-//#define QT_QPA_MOUSE_HANDLER_DEBUG
-
#define TEST_BIT(array, bit) (array[bit/8] & (1<<(bit%8)))
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(qLcEvdevMouse, "qt.qpa.input")
+
QEvdevMouseHandler *QEvdevMouseHandler::create(const QString &device, const QString &specification)
{
-#ifdef QT_QPA_MOUSE_HANDLER_DEBUG
- qWarning() << "Try to create mouse handler for" << device << specification;
-#endif
+ qCDebug(qLcEvdevMouse) << "create mouse handler for" << device << specification;
bool compression = true;
int jitterLimit = 0;
@@ -85,7 +82,7 @@ QEvdevMouseHandler *QEvdevMouseHandler::create(const QString &device, const QStr
::ioctl(fd, EVIOCGRAB, grab);
return new QEvdevMouseHandler(device, fd, abs, compression, jitterLimit);
} else {
- qWarning("Cannot open mouse input device '%s': %s", qPrintable(device), strerror(errno));
+ qErrnoWarning(errno, "Cannot open mouse input device %s", qPrintable(device));
return 0;
}
}
@@ -148,12 +145,10 @@ bool QEvdevMouseHandler::getHardwareMaximum()
m_hardwareScalerX = static_cast<qreal>(m_hardwareWidth) / (g.right() - g.left());
m_hardwareScalerY = static_cast<qreal>(m_hardwareHeight) / (g.bottom() - g.top());
-#ifdef QT_QPA_MOUSE_HANDLER_DEBUG
- qDebug() << "Absolute pointing device";
- qDebug() << "hardware max x" << m_hardwareWidth;
- qDebug() << "hardware max y" << m_hardwareHeight;
- qDebug() << "hardware scalers x" << m_hardwareScalerX << "y" << m_hardwareScalerY;
-#endif
+ qCDebug(qLcEvdevMouse) << "Absolute pointing device"
+ << "hardware max x" << m_hardwareWidth
+ << "hardware max y" << m_hardwareHeight
+ << "hardware scalers x" << m_hardwareScalerX << "y" << m_hardwareScalerY;
return true;
}
@@ -194,11 +189,11 @@ void QEvdevMouseHandler::readMouseData()
int result = QT_READ(m_fd, reinterpret_cast<char *>(buffer) + n, sizeof(buffer) - n);
if (result == 0) {
- qWarning("Got EOF from the input device.");
+ qWarning("evdevmouse: Got EOF from the input device");
return;
} else if (result < 0) {
if (errno != EINTR && errno != EAGAIN) {
- qWarning("Could not read from input device: %s", strerror(errno));
+ qErrnoWarning(errno, "evdevmouse: Could not read from input device");
return;
}
} else {
@@ -212,7 +207,6 @@ void QEvdevMouseHandler::readMouseData()
for (int i = 0; i < n; ++i) {
struct ::input_event *data = &buffer[i];
- //qDebug() << ">>" << hex << data->type << data->code << dec << data->value;
if (data->type == EV_ABS) {
// Touchpads: store the absolute position for now, will calculate a relative one later.
if (data->code == ABS_X && m_x != data->value) {
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index 2b52c4e995..a0c9c9f34d 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -36,16 +36,13 @@
#include <QStringList>
#include <QGuiApplication>
#include <QScreen>
+#include <QLoggingCategory>
#include <qpa/qwindowsysteminterface.h>
-//#define QT_QPA_MOUSEMANAGER_DEBUG
-
-#ifdef QT_QPA_MOUSEMANAGER_DEBUG
-#include <QDebug>
-#endif
-
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(qLcEvdevMouse)
+
QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specification, QObject *parent)
: QObject(parent), m_x(0), m_y(0), m_xoffset(0), m_yoffset(0)
{
@@ -79,10 +76,7 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif
addMouse(device);
if (devices.isEmpty()) {
-#ifdef QT_QPA_MOUSEMANAGER_DEBUG
- qWarning() << "Use device discovery";
-#endif
-
+ qCDebug(qLcEvdevMouse) << "evdevmouse: Using device discovery";
m_deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Mouse | QDeviceDiscovery::Device_Touchpad, this);
if (m_deviceDiscovery) {
// scan and add already connected keyboards
@@ -130,28 +124,17 @@ void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButto
// Cannot track the keyboard modifiers ourselves here. Instead, report the
// modifiers from the last key event that has been seen by QGuiApplication.
QWindowSystemInterface::handleMouseEvent(0, pos, pos, buttons, QGuiApplication::keyboardModifiers());
-
-#ifdef QT_QPA_MOUSEMANAGER_DEBUG
- qDebug("mouse event %d %d %d", pos.x(), pos.y(), int(buttons));
-#endif
}
void QEvdevMouseManager::handleWheelEvent(int delta, Qt::Orientation orientation)
{
QPoint pos(m_x + m_xoffset, m_y + m_yoffset);
QWindowSystemInterface::handleWheelEvent(0, pos, pos, delta, orientation, QGuiApplication::keyboardModifiers());
-
-#ifdef QT_QPA_MOUSEMANAGER_DEBUG
- qDebug("mouse wheel event %dx%d %d %d", pos.x(), pos.y(), delta, int(orientation));
-#endif
}
void QEvdevMouseManager::addMouse(const QString &deviceNode)
{
-#ifdef QT_QPA_MOUSEMANAGER_DEBUG
- qWarning() << "Adding mouse at" << deviceNode;
-#endif
-
+ qCDebug(qLcEvdevMouse) << "Adding mouse at" << deviceNode;
QEvdevMouseHandler *handler;
handler = QEvdevMouseHandler::create(deviceNode, m_spec);
if (handler) {
@@ -159,16 +142,14 @@ void QEvdevMouseManager::addMouse(const QString &deviceNode)
connect(handler, SIGNAL(handleWheelEvent(int,Qt::Orientation)), this, SLOT(handleWheelEvent(int,Qt::Orientation)));
m_mice.insert(deviceNode, handler);
} else {
- qWarning("Failed to open mouse");
+ qWarning("evdevmouse: Failed to open mouse device %s", qPrintable(deviceNode));
}
}
void QEvdevMouseManager::removeMouse(const QString &deviceNode)
{
if (m_mice.contains(deviceNode)) {
-#ifdef QT_QPA_MOUSEMANAGER_DEBUG
- qWarning() << "Removing mouse at" << deviceNode;
-#endif
+ qCDebug(qLcEvdevMouse) << "Removing mouse at" << deviceNode;
QEvdevMouseHandler *handler = m_mice.value(deviceNode);
m_mice.remove(deviceNode);
delete handler;
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablet.cpp b/src/platformsupport/input/evdevtablet/qevdevtablet.cpp
index 8d91c49488..8dbf5832d9 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablet.cpp
+++ b/src/platformsupport/input/evdevtablet/qevdevtablet.cpp
@@ -36,13 +36,15 @@
#include <QStringList>
#include <QSocketNotifier>
#include <QGuiApplication>
-#include <QDebug>
+#include <QLoggingCategory>
#include <QtCore/private/qcore_unix_p.h>
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
#include <linux/input.h>
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(qLcEvdevTablet, "qt.qpa.input")
+
class QEvdevTabletData
{
public:
@@ -87,28 +89,28 @@ bool QEvdevTabletData::queryLimits()
if (ok) {
minValues.x = absInfo.minimum;
maxValues.x = absInfo.maximum;
- qDebug("evdevtablet: min X: %d max X: %d", minValues.x, maxValues.x);
+ qCDebug(qLcEvdevTablet, "evdevtablet: min X: %d max X: %d", minValues.x, maxValues.x);
}
ok &= ioctl(fd, EVIOCGABS(ABS_Y), &absInfo) >= 0;
if (ok) {
minValues.y = absInfo.minimum;
maxValues.y = absInfo.maximum;
- qDebug("evdevtablet: min Y: %d max Y: %d", minValues.y, maxValues.y);
+ qCDebug(qLcEvdevTablet, "evdevtablet: min Y: %d max Y: %d", minValues.y, maxValues.y);
}
if (ioctl(fd, EVIOCGABS(ABS_PRESSURE), &absInfo) >= 0) {
minValues.p = absInfo.minimum;
maxValues.p = absInfo.maximum;
- qDebug("evdevtablet: min pressure: %d max pressure: %d", minValues.p, maxValues.p);
+ qCDebug(qLcEvdevTablet, "evdevtablet: min pressure: %d max pressure: %d", minValues.p, maxValues.p);
}
if (ioctl(fd, EVIOCGABS(ABS_DISTANCE), &absInfo) >= 0) {
minValues.d = absInfo.minimum;
maxValues.d = absInfo.maximum;
- qDebug("evdevtablet: min distance: %d max distance: %d", minValues.d, maxValues.d);
+ qCDebug(qLcEvdevTablet, "evdevtablet: min distance: %d max distance: %d", minValues.d, maxValues.d);
}
char name[128];
if (ioctl(fd, EVIOCGNAME(sizeof(name) - 1), name) >= 0) {
devName = QString::fromLocal8Bit(name);
- qDebug("evdevtablet: device name: %s", name);
+ qCDebug(qLcEvdevTablet, "evdevtablet: device name: %s", name);
}
return ok;
}
@@ -232,7 +234,7 @@ QEvdevTabletHandler::QEvdevTabletHandler(const QString &spec, QObject *parent)
}
}
if (!dev.isEmpty()) {
- qDebug("evdevtablet: using %s", qPrintable(dev));
+ qCDebug(qLcEvdevTablet, "evdevtablet: using %s", qPrintable(dev));
d->fd = QT_OPEN(dev.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0);
if (d->fd >= 0) {
d->testGrab();
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablet_p.h b/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
index c20ddec787..4778c85d21 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
+++ b/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
@@ -73,7 +73,7 @@ class QEvdevTabletHandlerThread : public QThread
public:
explicit QEvdevTabletHandlerThread(const QString &spec, QObject *parent = 0);
~QEvdevTabletHandlerThread();
- void run();
+ void run() Q_DECL_OVERRIDE;
QEvdevTabletHandler *handler() { return m_handler; }
private:
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
index d0d8b783a4..dd831c9e82 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
@@ -36,7 +36,7 @@
#include <QHash>
#include <QSocketNotifier>
#include <QGuiApplication>
-#include <QDebug>
+#include <QLoggingCategory>
#include <QtCore/private/qcore_unix_p.h>
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
#include <linux/input.h>
@@ -49,6 +49,8 @@ extern "C" {
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(qLcEvdevTouch, "qt.qpa.input")
+
/* android (and perhaps some other linux-derived stuff) don't define everything
* in linux/input.h, so we'll need to do that ourselves.
*/
@@ -164,7 +166,8 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification,
{
setObjectName(QLatin1String("Evdev Touch Handler"));
- bool printDeviceInfo = qgetenv("QT_QPA_EVDEV_DEBUG").toInt();
+ if (qEnvironmentVariableIsSet("QT_QPA_EVDEV_DEBUG"))
+ ((QLoggingCategory &) qLcEvdevTouch()).setEnabled(QtDebugMsg, true);
// only the first device argument is used for now
QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS"));
@@ -215,13 +218,11 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification,
}
if (dev.isEmpty()) {
- if (printDeviceInfo)
- qDebug("evdevtouch: No touch devices found");
+ qCDebug(qLcEvdevTouch, "evdevtouch: No touch devices found");
return;
}
- if (printDeviceInfo)
- qDebug("evdevtouch: Using device %s", qPrintable(dev));
+ qCDebug(qLcEvdevTouch, "evdevtouch: Using device %s", qPrintable(dev));
m_fd = QT_OPEN(dev.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0);
@@ -257,25 +258,22 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification,
}
#endif
- if (printDeviceInfo)
- qDebug("evdevtouch: Protocol type %c %s (%s)", d->m_typeB ? 'B' : 'A',
- mtdevStr, d->m_singleTouch ? "single" : "multi");
+ qCDebug(qLcEvdevTouch, "evdevtouch: Protocol type %c %s (%s)", d->m_typeB ? 'B' : 'A',
+ mtdevStr, d->m_singleTouch ? "single" : "multi");
input_absinfo absInfo;
memset(&absInfo, 0, sizeof(input_absinfo));
bool has_x_range = false, has_y_range = false;
if (ioctl(m_fd, EVIOCGABS((d->m_singleTouch ? ABS_X : ABS_MT_POSITION_X)), &absInfo) >= 0) {
- if (printDeviceInfo)
- qDebug("evdevtouch: min X: %d max X: %d", absInfo.minimum, absInfo.maximum);
+ qCDebug(qLcEvdevTouch, "evdevtouch: min X: %d max X: %d", absInfo.minimum, absInfo.maximum);
d->hw_range_x_min = absInfo.minimum;
d->hw_range_x_max = absInfo.maximum;
has_x_range = true;
}
if (ioctl(m_fd, EVIOCGABS((d->m_singleTouch ? ABS_Y : ABS_MT_POSITION_Y)), &absInfo) >= 0) {
- if (printDeviceInfo)
- qDebug("evdevtouch: min Y: %d max Y: %d", absInfo.minimum, absInfo.maximum);
+ qCDebug(qLcEvdevTouch, "evdevtouch: min Y: %d max Y: %d", absInfo.minimum, absInfo.maximum);
d->hw_range_y_min = absInfo.minimum;
d->hw_range_y_max = absInfo.maximum;
has_y_range = true;
@@ -285,8 +283,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification,
qWarning("evdevtouch: Invalid ABS limits, behavior unspecified");
if (ioctl(m_fd, EVIOCGABS(ABS_PRESSURE), &absInfo) >= 0) {
- if (printDeviceInfo)
- qDebug("evdevtouch: min pressure: %d max pressure: %d", absInfo.minimum, absInfo.maximum);
+ qCDebug(qLcEvdevTouch, "evdevtouch: min pressure: %d max pressure: %d", absInfo.minimum, absInfo.maximum);
if (absInfo.maximum > absInfo.minimum) {
d->hw_pressure_min = absInfo.minimum;
d->hw_pressure_max = absInfo.maximum;
@@ -296,8 +293,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification,
char name[1024];
if (ioctl(m_fd, EVIOCGNAME(sizeof(name) - 1), name) >= 0) {
d->hw_name = QString::fromLocal8Bit(name);
- if (printDeviceInfo)
- qDebug("evdevtouch: device name: %s", name);
+ qCDebug(qLcEvdevTouch, "evdevtouch: device name: %s", name);
}
// Fix up the coordinate ranges for am335x in case the kernel driver does not have them fixed.
@@ -310,9 +306,8 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification,
d->hw_range_y_min = 220;
d->hw_range_y_max = 3907;
}
- if (printDeviceInfo)
- qDebug("evdevtouch: found ti-tsc, overriding: min X: %d max X: %d min Y: %d max Y: %d",
- d->hw_range_x_min, d->hw_range_x_max, d->hw_range_y_min, d->hw_range_y_max);
+ qCDebug(qLcEvdevTouch, "evdevtouch: found ti-tsc, overriding: min X: %d max X: %d min Y: %d max Y: %d",
+ d->hw_range_x_min, d->hw_range_x_max, d->hw_range_y_min, d->hw_range_y_max);
}
bool grabSuccess = !ioctl(m_fd, EVIOCGRAB, (void *) 1);
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
index 31b2d86834..e7861f0360 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
@@ -85,7 +85,7 @@ class QEvdevTouchScreenHandlerThread : public QThread
public:
explicit QEvdevTouchScreenHandlerThread(const QString &spec, QObject *parent = 0);
~QEvdevTouchScreenHandlerThread();
- void run();
+ void run() Q_DECL_OVERRIDE;
QEvdevTouchScreenHandler *handler() { return m_handler; }
private:
diff --git a/src/platformsupport/input/input.pri b/src/platformsupport/input/input.pri
index 1524eb454e..c1fd95703b 100644
--- a/src/platformsupport/input/input.pri
+++ b/src/platformsupport/input/input.pri
@@ -4,3 +4,7 @@ contains(QT_CONFIG, evdev) {
include($$PWD/evdevtouch/evdevtouch.pri)
include($$PWD/evdevtablet/evdevtablet.pri)
}
+
+contains(QT_CONFIG, tslib) {
+ include($$PWD/tslib/tslib.pri)
+}
diff --git a/src/platformsupport/input/tslib/qtslib.cpp b/src/platformsupport/input/tslib/qtslib.cpp
new file mode 100644
index 0000000000..e75fd9e691
--- /dev/null
+++ b/src/platformsupport/input/tslib/qtslib.cpp
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtslib_p.h"
+
+#include <QSocketNotifier>
+#include <QStringList>
+#include <QPoint>
+#include <QLoggingCategory>
+
+#include <qpa/qwindowsysteminterface.h>
+
+#include <errno.h>
+#include <tslib.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(qLcTsLib, "qt.qpa.input")
+
+QTsLibMouseHandler::QTsLibMouseHandler(const QString &key,
+ const QString &specification,
+ QObject *parent)
+ : QObject(parent),
+ m_notify(0), m_x(0), m_y(0), m_pressed(0), m_rawMode(false)
+{
+ qCDebug(qLcTsLib) << "Initializing tslib plugin" << key << specification;
+ setObjectName(QLatin1String("TSLib Mouse Handler"));
+
+ QByteArray device = qgetenv("TSLIB_TSDEVICE");
+
+ if (specification.startsWith(QStringLiteral("/dev/")))
+ device = specification.toLocal8Bit();
+
+ if (device.isEmpty())
+ device = QByteArrayLiteral("/dev/input/event1");
+
+ m_dev = ts_open(device.constData(), 1);
+ if (!m_dev) {
+ qErrnoWarning(errno, "ts_open() failed");
+ return;
+ }
+
+ if (ts_config(m_dev))
+ qErrnoWarning(errno, "ts_config() failed");
+
+ m_rawMode = !key.compare(QLatin1String("TslibRaw"), Qt::CaseInsensitive);
+
+ int fd = ts_fd(m_dev);
+ if (fd >= 0) {
+ qCDebug(qLcTsLib) << "tslib device is" << device;
+ m_notify = new QSocketNotifier(fd, QSocketNotifier::Read, this);
+ connect(m_notify, SIGNAL(activated(int)), this, SLOT(readMouseData()));
+ } else {
+ qErrnoWarning(errno, "tslib: Cannot open input device %s", device.constData());
+ }
+}
+
+QTsLibMouseHandler::~QTsLibMouseHandler()
+{
+ if (m_dev)
+ ts_close(m_dev);
+}
+
+static bool get_sample(struct tsdev *dev, struct ts_sample *sample, bool rawMode)
+{
+ if (rawMode)
+ return (ts_read_raw(dev, sample, 1) == 1);
+ else
+ return (ts_read(dev, sample, 1) == 1);
+}
+
+void QTsLibMouseHandler::readMouseData()
+{
+ ts_sample sample;
+
+ while (get_sample(m_dev, &sample, m_rawMode)) {
+ bool pressed = sample.pressure;
+ int x = sample.x;
+ int y = sample.y;
+
+ // work around missing coordinates on mouse release
+ if (sample.pressure == 0 && sample.x == 0 && sample.y == 0) {
+ x = m_x;
+ y = m_y;
+ }
+
+ if (!m_rawMode) {
+ //filtering: ignore movements of 2 pixels or less
+ int dx = x - m_x;
+ int dy = y - m_y;
+ if (dx*dx <= 4 && dy*dy <= 4 && pressed == m_pressed)
+ continue;
+ }
+ QPoint pos(x, y);
+
+ QWindowSystemInterface::handleMouseEvent(0, pos, pos, pressed ? Qt::LeftButton : Qt::NoButton);
+
+ m_x = x;
+ m_y = y;
+ m_pressed = pressed;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglcompositor_p.h b/src/platformsupport/input/tslib/qtslib_p.h
index 1401fbdd55..4bcefb6cb9 100644
--- a/src/platformsupport/eglconvenience/qeglcompositor_p.h
+++ b/src/platformsupport/input/tslib/qtslib_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the plugins of the Qt Toolkit.
+** This file is part of the plugins module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@@ -31,53 +31,36 @@
**
****************************************************************************/
-#ifndef QEGLCOMPOSITOR_H
-#define QEGLCOMPOSITOR_H
+#ifndef QTSLIB_H
+#define QTSLIB_H
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
+#include <QObject>
-#include <QtCore/QTimer>
+struct tsdev;
QT_BEGIN_NAMESPACE
-class QOpenGLContext;
-class QOpenGLTextureBlitter;
-class QEGLPlatformWindow;
+class QSocketNotifier;
-class QEGLCompositor : public QObject
+class QTsLibMouseHandler : public QObject
{
Q_OBJECT
public:
- void schedule(QOpenGLContext *context, QEGLPlatformWindow *window);
-
- static QEGLCompositor *instance();
- static void destroy();
+ QTsLibMouseHandler(const QString &key, const QString &specification, QObject *parent = 0);
+ ~QTsLibMouseHandler();
private slots:
- void renderAll();
+ void readMouseData();
private:
- QEGLCompositor();
- ~QEGLCompositor();
-
- void render(QEGLPlatformWindow *window);
-
- QOpenGLContext *m_context;
- QEGLPlatformWindow *m_window;
- QTimer m_updateTimer;
- QOpenGLTextureBlitter *m_blitter;
+ QSocketNotifier * m_notify;
+ tsdev *m_dev;
+ int m_x, m_y;
+ bool m_pressed;
+ bool m_rawMode;
};
QT_END_NAMESPACE
-#endif // QEGLCOMPOSITOR_H
+#endif // QTSLIB_H
diff --git a/src/platformsupport/input/tslib/tslib.pri b/src/platformsupport/input/tslib/tslib.pri
new file mode 100644
index 0000000000..c9fef1ca8f
--- /dev/null
+++ b/src/platformsupport/input/tslib/tslib.pri
@@ -0,0 +1,7 @@
+HEADERS += \
+ $$PWD/qtslib_p.h
+
+SOURCES += \
+ $$PWD/qtslib.cpp
+
+LIBS += -lts
diff --git a/src/platformsupport/linuxaccessibility/application.cpp b/src/platformsupport/linuxaccessibility/application.cpp
index 2ee6b0a203..3e7fd45a09 100644
--- a/src/platformsupport/linuxaccessibility/application.cpp
+++ b/src/platformsupport/linuxaccessibility/application.cpp
@@ -38,6 +38,7 @@
#include <QtDBus/qdbuspendingreply.h>
#include <qdebug.h>
+#ifndef QT_NO_ACCESSIBILITY
#include "deviceeventcontroller_adaptor.h"
#include "atspi/atspi-constants.h"
@@ -229,3 +230,5 @@ void QSpiApplicationAdaptor::notifyKeyboardListenerError(const QDBusError& error
}
QT_END_NAMESPACE
+
+#endif //QT_NO_ACCESSIBILITY
diff --git a/src/platformsupport/linuxaccessibility/application_p.h b/src/platformsupport/linuxaccessibility/application_p.h
index d42f6e3ab0..b3e5ebbfde 100644
--- a/src/platformsupport/linuxaccessibility/application_p.h
+++ b/src/platformsupport/linuxaccessibility/application_p.h
@@ -50,6 +50,8 @@
#include <QtDBus/QDBusConnection>
#include <QtGui/QAccessibleInterface>
+#ifndef QT_NO_ACCESSIBILITY
+
QT_BEGIN_NAMESPACE
/*
@@ -86,4 +88,6 @@ private:
QT_END_NAMESPACE
+#endif //QT_NO_ACCESSIBILITY
+
#endif
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index c3573489e9..7cbda0c745 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -41,6 +41,7 @@
#include <qdebug.h>
+#ifndef QT_NO_ACCESSIBILITY
#include "socket_interface.h"
#include "constant_mappings_p.h"
#include "../accessibility/qaccessiblebridgeutils_p.h"
@@ -2356,3 +2357,4 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
}
QT_END_NAMESPACE
+#endif //QT_NO_ACCESSIBILITY
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
index fa3f616c91..342d8ba531 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
@@ -55,6 +55,7 @@
#include "dbusconnection_p.h"
#include "struct_marshallers_p.h"
+#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
class QAccessibleInterface;
@@ -215,5 +216,6 @@ private:
};
QT_END_NAMESPACE
+#endif //QT_NO_ACCESSIBILITY
#endif
diff --git a/src/platformsupport/linuxaccessibility/bridge.cpp b/src/platformsupport/linuxaccessibility/bridge.cpp
index 6211aa6e5a..4123181da3 100644
--- a/src/platformsupport/linuxaccessibility/bridge.cpp
+++ b/src/platformsupport/linuxaccessibility/bridge.cpp
@@ -44,6 +44,7 @@
#include "dbusconnection_p.h"
#include "struct_marshallers_p.h"
+#ifndef QT_NO_ACCESSIBILITY
#include "deviceeventcontroller_adaptor.h"
QT_BEGIN_NAMESPACE
@@ -264,3 +265,4 @@ void QSpiAccessibleBridge::initializeConstantMappings()
}
QT_END_NAMESPACE
+#endif //QT_NO_ACCESSIBILITY
diff --git a/src/platformsupport/linuxaccessibility/bridge_p.h b/src/platformsupport/linuxaccessibility/bridge_p.h
index 1daaaf92d2..c4bf26b507 100644
--- a/src/platformsupport/linuxaccessibility/bridge_p.h
+++ b/src/platformsupport/linuxaccessibility/bridge_p.h
@@ -51,6 +51,7 @@
class DeviceEventControllerAdaptor;
+#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
class DBusConnection;
@@ -65,7 +66,7 @@ public:
virtual ~QSpiAccessibleBridge();
- virtual void notifyAccessibilityUpdate(QAccessibleEvent *event);
+ virtual void notifyAccessibilityUpdate(QAccessibleEvent *event) Q_DECL_OVERRIDE;
QDBusConnection dBusConnection() const;
public Q_SLOTS:
@@ -82,5 +83,6 @@ private:
};
QT_END_NAMESPACE
+#endif //QT_NO_ACCESSIBILITY
#endif
diff --git a/src/platformsupport/linuxaccessibility/cache.cpp b/src/platformsupport/linuxaccessibility/cache.cpp
index 296858c391..de3d91f0d2 100644
--- a/src/platformsupport/linuxaccessibility/cache.cpp
+++ b/src/platformsupport/linuxaccessibility/cache.cpp
@@ -33,10 +33,11 @@
#include "cache_p.h"
-#include "cache_adaptor.h"
-
#include "bridge_p.h"
+#ifndef QT_NO_ACCESSIBILITY
+#include "cache_adaptor.h"
+
#define QSPI_OBJECT_PATH_CACHE "/org/a11y/atspi/cache"
QT_BEGIN_NAMESPACE
@@ -82,3 +83,4 @@ QSpiAccessibleCacheArray QSpiDBusCache::GetItems()
}
QT_END_NAMESPACE
+#endif //QT_NO_ACCESSIBILITY
diff --git a/src/platformsupport/linuxaccessibility/cache_p.h b/src/platformsupport/linuxaccessibility/cache_p.h
index 300084c493..6fdb813ebf 100644
--- a/src/platformsupport/linuxaccessibility/cache_p.h
+++ b/src/platformsupport/linuxaccessibility/cache_p.h
@@ -49,6 +49,7 @@
#include <QtCore/QObject>
#include "struct_marshallers_p.h"
+#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
class QSpiDBusCache : public QObject
@@ -69,5 +70,6 @@ public Q_SLOTS:
};
QT_END_NAMESPACE
+#endif //QT_NO_ACCESSIBILITY
#endif /* Q_SPI_CACHE_H */
diff --git a/src/platformsupport/linuxaccessibility/constant_mappings.cpp b/src/platformsupport/linuxaccessibility/constant_mappings.cpp
index 78f18124e5..8cfa8086d8 100644
--- a/src/platformsupport/linuxaccessibility/constant_mappings.cpp
+++ b/src/platformsupport/linuxaccessibility/constant_mappings.cpp
@@ -45,6 +45,7 @@
// "ruler" "autocomplete" "edit bar" "embedded component" "entry" "caption"
// "heading" "page" "section" "redundant object" "form" "input method window" "menu"
+#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
QHash <QAccessible::Role, RoleNames> qSpiRoleMapping;
@@ -142,3 +143,4 @@ AtspiRelationType qAccessibleRelationToAtSpiRelation(QAccessible::Relation relat
}
QT_END_NAMESPACE
+#endif //QT_NO_ACCESSIBILITY
diff --git a/src/platformsupport/linuxaccessibility/constant_mappings_p.h b/src/platformsupport/linuxaccessibility/constant_mappings_p.h
index f616b56c3a..da1ebee060 100644
--- a/src/platformsupport/linuxaccessibility/constant_mappings_p.h
+++ b/src/platformsupport/linuxaccessibility/constant_mappings_p.h
@@ -55,6 +55,7 @@
#include <QtGui/QAccessible>
#include <atspi/atspi-constants.h>
+#ifndef QT_NO_ACCESSIBILITY
// interface names from at-spi2-core/atspi/atspi-misc-private.h
#define ATSPI_DBUS_NAME_REGISTRY "org.a11y.atspi.Registry"
@@ -134,5 +135,6 @@ QSpiUIntList spiStateSetFromSpiStates(quint64 states);
AtspiRelationType qAccessibleRelationToAtSpiRelation(QAccessible::Relation relation);
QT_END_NAMESPACE
+#endif //QT_NO_ACCESSIBILITY
#endif /* Q_SPI_CONSTANT_MAPPINGS_H */
diff --git a/src/platformsupport/linuxaccessibility/struct_marshallers.cpp b/src/platformsupport/linuxaccessibility/struct_marshallers.cpp
index 4b3bee8bdb..66fa564a43 100644
--- a/src/platformsupport/linuxaccessibility/struct_marshallers.cpp
+++ b/src/platformsupport/linuxaccessibility/struct_marshallers.cpp
@@ -40,6 +40,7 @@
#include "bridge_p.h"
+#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
QSpiObjectReference::QSpiObjectReference()
@@ -227,3 +228,4 @@ void qSpiInitializeStructTypes()
}
QT_END_NAMESPACE
+#endif //QT_NO_ACCESSIBILITY
diff --git a/src/platformsupport/linuxaccessibility/struct_marshallers_p.h b/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
index 21e2fdefa5..53a3e723b1 100644
--- a/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
+++ b/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
@@ -52,6 +52,7 @@
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusObjectPath>
+#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
typedef QList <int> QSpiIntList;
@@ -175,4 +176,5 @@ Q_DECLARE_METATYPE(QSpiAttributeSet)
Q_DECLARE_METATYPE(QSpiAppUpdate)
Q_DECLARE_METATYPE(QSpiDeviceEvent)
+#endif //QT_NO_ACCESSIBILITY
#endif /* Q_SPI_STRUCT_MARSHALLERS_H */
diff --git a/src/platformsupport/platformcompositor/platformcompositor.pri b/src/platformsupport/platformcompositor/platformcompositor.pri
new file mode 100644
index 0000000000..923d7225da
--- /dev/null
+++ b/src/platformsupport/platformcompositor/platformcompositor.pri
@@ -0,0 +1,7 @@
+contains(QT_CONFIG, opengl) {
+ SOURCES += $$PWD/qopenglcompositor.cpp \
+ $$PWD/qopenglcompositorbackingstore.cpp
+
+ HEADERS += $$PWD/qopenglcompositor_p.h \
+ $$PWD/qopenglcompositorbackingstore_p.h
+}
diff --git a/src/platformsupport/eglconvenience/qeglcompositor.cpp b/src/platformsupport/platformcompositor/qopenglcompositor.cpp
index a46e5698de..bcb3f21922 100644
--- a/src/platformsupport/eglconvenience/qeglcompositor.cpp
+++ b/src/platformsupport/platformcompositor/qopenglcompositor.cpp
@@ -32,23 +32,46 @@
****************************************************************************/
#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLShaderProgram>
-#include <QtGui/QOpenGLFramebufferObject>
-#include <QtGui/private/qopengltextureblitter_p.h>
+#include <QtGui/QWindow>
+#include <QtGui/QMatrix4x4>
#include <qpa/qplatformbackingstore.h>
-#include "qeglcompositor_p.h"
-#include "qeglplatformwindow_p.h"
-#include "qeglplatformscreen_p.h"
+#include "qopenglcompositor_p.h"
QT_BEGIN_NAMESPACE
-static QEGLCompositor *compositor = 0;
+/*!
+ \class QOpenGLCompositor
+ \brief A generic OpenGL-based compositor
+ \since 5.4
+ \internal
+ \ingroup qpa
-QEGLCompositor::QEGLCompositor()
+ This class provides a lightweight compositor that maintains the
+ basic stacking order of windows and composites them by drawing
+ textured quads via OpenGL.
+
+ It it meant to be used by platform plugins that run without a
+ windowing system.
+
+ It is up to the platform plugin to manage the lifetime of the
+ compositor (instance(), destroy()), set the correct destination
+ context and window as early as possible (setTargetWindow()),
+ register the composited windows as they are shown, activated,
+ raised and lowered (addWindow(), moveToTop(), etc.), and to
+ schedule repaints (update()).
+
+ \note To get support for QWidget-based windows, just use
+ QOpenGLCompositorBackingStore. It will automatically create
+ textures from the raster-rendered content and trigger the
+ necessary repaints.
+ */
+
+static QOpenGLCompositor *compositor = 0;
+
+QOpenGLCompositor::QOpenGLCompositor()
: m_context(0),
- m_window(0),
- m_blitter(0)
+ m_targetWindow(0)
{
Q_ASSERT(!compositor);
m_updateTimer.setSingleShot(true);
@@ -56,45 +79,51 @@ QEGLCompositor::QEGLCompositor()
connect(&m_updateTimer, SIGNAL(timeout()), SLOT(renderAll()));
}
-QEGLCompositor::~QEGLCompositor()
+QOpenGLCompositor::~QOpenGLCompositor()
{
Q_ASSERT(compositor == this);
- if (m_blitter) {
- m_blitter->destroy();
- delete m_blitter;
- }
+ m_blitter.destroy();
compositor = 0;
}
-void QEGLCompositor::schedule(QOpenGLContext *context, QEGLPlatformWindow *window)
+void QOpenGLCompositor::setTarget(QOpenGLContext *context, QWindow *targetWindow)
{
m_context = context;
- m_window = window;
+ m_targetWindow = targetWindow;
+}
+
+void QOpenGLCompositor::update()
+{
if (!m_updateTimer.isActive())
m_updateTimer.start();
}
-void QEGLCompositor::renderAll()
+void QOpenGLCompositor::renderAll()
{
- Q_ASSERT(m_context && m_window);
- m_context->makeCurrent(m_window->window());
+ Q_ASSERT(m_context && m_targetWindow);
+ m_context->makeCurrent(m_targetWindow);
- if (!m_blitter) {
- m_blitter = new QOpenGLTextureBlitter;
- m_blitter->create();
- }
- m_blitter->bind();
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+
+ const QRect targetWindowRect(QPoint(0, 0), m_targetWindow->geometry().size());
+ glViewport(0, 0, targetWindowRect.width(), targetWindowRect.height());
- QEGLPlatformScreen *screen = static_cast<QEGLPlatformScreen *>(m_window->screen());
- QList<QEGLPlatformWindow *> windows = screen->windows();
- for (int i = 0; i < windows.size(); ++i)
- render(windows.at(i));
+ if (!m_blitter.isCreated())
+ m_blitter.create();
- m_blitter->release();
- m_context->swapBuffers(m_window->window());
+ m_blitter.bind();
- for (int i = 0; i < windows.size(); ++i)
- windows.at(i)->composited();
+ for (int i = 0; i < m_windows.size(); ++i)
+ m_windows.at(i)->beginCompositing();
+
+ for (int i = 0; i < m_windows.size(); ++i)
+ render(m_windows.at(i));
+
+ m_blitter.release();
+ m_context->swapBuffers(m_targetWindow);
+
+ for (int i = 0; i < m_windows.size(); ++i)
+ m_windows.at(i)->endCompositing();
}
struct BlendStateBinder
@@ -120,41 +149,38 @@ struct BlendStateBinder
bool m_blend;
};
-void QEGLCompositor::render(QEGLPlatformWindow *window)
+void QOpenGLCompositor::render(QOpenGLCompositorWindow *window)
{
const QPlatformTextureList *textures = window->textures();
if (!textures)
return;
- const QRect targetWindowRect(QPoint(0, 0), window->screen()->geometry().size());
- glViewport(0, 0, targetWindowRect.width(), targetWindowRect.height());
-
+ const QRect targetWindowRect(QPoint(0, 0), m_targetWindow->geometry().size());
float currentOpacity = 1.0f;
BlendStateBinder blend;
for (int i = 0; i < textures->count(); ++i) {
uint textureId = textures->textureId(i);
- QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(textures->geometry(i),
- targetWindowRect);
- const float opacity = window->window()->opacity();
+ QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(textures->geometry(i), targetWindowRect);
+ const float opacity = window->sourceWindow()->opacity();
if (opacity != currentOpacity) {
currentOpacity = opacity;
- m_blitter->setOpacity(currentOpacity);
+ m_blitter.setOpacity(currentOpacity);
}
if (textures->count() > 1 && i == textures->count() - 1) {
// Backingstore for a widget with QOpenGLWidget subwidgets
blend.set(true);
- m_blitter->blit(textureId, target, QOpenGLTextureBlitter::OriginTopLeft);
+ m_blitter.blit(textureId, target, QOpenGLTextureBlitter::OriginTopLeft);
} else if (textures->count() == 1) {
// A regular QWidget window
- const bool translucent = window->window()->requestedFormat().alphaBufferSize() > 0;
+ const bool translucent = window->sourceWindow()->requestedFormat().alphaBufferSize() > 0;
blend.set(translucent);
- m_blitter->blit(textureId, target, QOpenGLTextureBlitter::OriginTopLeft);
+ m_blitter.blit(textureId, target, QOpenGLTextureBlitter::OriginTopLeft);
} else if (!textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)) {
// Texture from an FBO belonging to a QOpenGLWidget
blend.set(false);
- m_blitter->blit(textureId, target, QOpenGLTextureBlitter::OriginBottomLeft);
+ m_blitter.blit(textureId, target, QOpenGLTextureBlitter::OriginBottomLeft);
}
}
@@ -162,24 +188,56 @@ void QEGLCompositor::render(QEGLPlatformWindow *window)
if (textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)) {
QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(textures->geometry(i), targetWindowRect);
blend.set(true);
- m_blitter->blit(textures->textureId(i), target, QOpenGLTextureBlitter::OriginBottomLeft);
+ m_blitter.blit(textures->textureId(i), target, QOpenGLTextureBlitter::OriginBottomLeft);
}
}
- m_blitter->setOpacity(1.0f);
+ m_blitter.setOpacity(1.0f);
}
-QEGLCompositor *QEGLCompositor::instance()
+QOpenGLCompositor *QOpenGLCompositor::instance()
{
if (!compositor)
- compositor = new QEGLCompositor;
+ compositor = new QOpenGLCompositor;
return compositor;
}
-void QEGLCompositor::destroy()
+void QOpenGLCompositor::destroy()
{
delete compositor;
compositor = 0;
}
+void QOpenGLCompositor::addWindow(QOpenGLCompositorWindow *window)
+{
+ if (!m_windows.contains(window)) {
+ m_windows.append(window);
+ emit topWindowChanged(window);
+ }
+}
+
+void QOpenGLCompositor::removeWindow(QOpenGLCompositorWindow *window)
+{
+ m_windows.removeOne(window);
+ if (!m_windows.isEmpty())
+ emit topWindowChanged(m_windows.last());
+}
+
+void QOpenGLCompositor::moveToTop(QOpenGLCompositorWindow *window)
+{
+ m_windows.removeOne(window);
+ m_windows.append(window);
+ emit topWindowChanged(window);
+}
+
+void QOpenGLCompositor::changeWindowIndex(QOpenGLCompositorWindow *window, int newIdx)
+{
+ int idx = m_windows.indexOf(window);
+ if (idx != -1 && idx != newIdx) {
+ m_windows.move(idx, newIdx);
+ if (newIdx == m_windows.size() - 1)
+ emit topWindowChanged(m_windows.last());
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/platformcompositor/qopenglcompositor_p.h b/src/platformsupport/platformcompositor/qopenglcompositor_p.h
new file mode 100644
index 0000000000..9c876f5af1
--- /dev/null
+++ b/src/platformsupport/platformcompositor/qopenglcompositor_p.h
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QOPENGLCOMPOSITOR_H
+#define QOPENGLCOMPOSITOR_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QTimer>
+#include <QtGui/private/qopengltextureblitter_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QOpenGLContext;
+class QWindow;
+class QPlatformTextureList;
+
+class QOpenGLCompositorWindow
+{
+public:
+ virtual QWindow *sourceWindow() const = 0;
+ virtual const QPlatformTextureList *textures() const = 0;
+ virtual void beginCompositing() { }
+ virtual void endCompositing() { }
+};
+
+class QOpenGLCompositor : public QObject
+{
+ Q_OBJECT
+
+public:
+ static QOpenGLCompositor *instance();
+ static void destroy();
+
+ void setTarget(QOpenGLContext *context, QWindow *window);
+ QOpenGLContext *context() const { return m_context; }
+ QWindow *targetWindow() const { return m_targetWindow; }
+
+ void update();
+
+ QList<QOpenGLCompositorWindow *> windows() const { return m_windows; }
+ void addWindow(QOpenGLCompositorWindow *window);
+ void removeWindow(QOpenGLCompositorWindow *window);
+ void moveToTop(QOpenGLCompositorWindow *window);
+ void changeWindowIndex(QOpenGLCompositorWindow *window, int newIdx);
+
+signals:
+ void topWindowChanged(QOpenGLCompositorWindow *window);
+
+private slots:
+ void renderAll();
+
+private:
+ QOpenGLCompositor();
+ ~QOpenGLCompositor();
+
+ void render(QOpenGLCompositorWindow *window);
+
+ QOpenGLContext *m_context;
+ QWindow *m_targetWindow;
+ QTimer m_updateTimer;
+ QOpenGLTextureBlitter m_blitter;
+ QList<QOpenGLCompositorWindow *> m_windows;
+};
+
+QT_END_NAMESPACE
+
+#endif // QOPENGLCOMPOSITOR_H
diff --git a/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
index d7d95ea97d..774743c674 100644
--- a/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp
+++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
@@ -31,62 +31,58 @@
**
****************************************************************************/
-#include <QtGui/QOpenGLShaderProgram>
#include <QtGui/QOpenGLContext>
+#include <QtGui/QWindow>
#include <QtGui/QPainter>
+#include <qpa/qplatformbackingstore.h>
-#include "qeglplatformbackingstore_p.h"
-#include "qeglcompositor_p.h"
-#include "qeglplatformwindow_p.h"
-#include "qeglplatformscreen_p.h"
+#include "qopenglcompositorbackingstore_p.h"
+#include "qopenglcompositor_p.h"
QT_BEGIN_NAMESPACE
/*!
- \class QEGLPlatformBackingStore
- \brief A backing store implementation for EGL and GLES.
- \since 5.2
+ \class QOpenGLCompositorBackingStore
+ \brief A backing store implementation for OpenGL
+ \since 5.4
\internal
\ingroup qpa
This implementation uploads raster-rendered widget windows into
- textures and composites them onto a single native window using
- QEGLCompositor. This means that multiple top-level widgets are
- supported without creating actual native windows for each of them.
-
- The class is ready to be used as-is, the default
- QEGLPlatformIntegration::createPlatformBackingStore()
- implementation creates an instance which is ready to be used
- without further customization.
-
- If QEGLCompositor is not suitable, this backing store
- implementation can also be used without it. In this case a
- subclass must reimplement composite() and schedule an update in
- its custom compositor when this function is called. The textures
- are accessible via QEGLPlatformWindow::texture().
+ textures. It is meant to be used with QOpenGLCompositor that
+ composites the textures onto a single native window using OpenGL.
+ This means that multiple top-level widgets are supported without
+ creating actual native windows for each of them.
+
+ \note It is important to call notifyComposited() from the
+ corresponding platform window's endCompositing() callback
+ (inherited from QOpenGLCompositorWindow).
+
+ \note When implementing QOpenGLCompositorWindow::textures() for
+ windows of type RasterSurface or RasterGLSurface, simply return
+ the list provided by this class' textures().
*/
-QEGLPlatformBackingStore::QEGLPlatformBackingStore(QWindow *window)
+QOpenGLCompositorBackingStore::QOpenGLCompositorBackingStore(QWindow *window)
: QPlatformBackingStore(window),
- m_window(static_cast<QEGLPlatformWindow *>(window->handle())),
+ m_window(window),
m_bsTexture(0),
m_textures(new QPlatformTextureList),
m_lockedWidgetTextures(0)
{
- m_window->setBackingStore(this);
}
-QEGLPlatformBackingStore::~QEGLPlatformBackingStore()
+QOpenGLCompositorBackingStore::~QOpenGLCompositorBackingStore()
{
delete m_textures;
}
-QPaintDevice *QEGLPlatformBackingStore::paintDevice()
+QPaintDevice *QOpenGLCompositorBackingStore::paintDevice()
{
return &m_image;
}
-void QEGLPlatformBackingStore::updateTexture()
+void QOpenGLCompositorBackingStore::updateTexture()
{
if (!m_bsTexture) {
glGenTextures(1, &m_bsTexture);
@@ -134,7 +130,7 @@ void QEGLPlatformBackingStore::updateTexture()
}
}
-void QEGLPlatformBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
+void QOpenGLCompositorBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
// Called for ordinary raster windows. This is rare since RasterGLSurface
// support is claimed which leads to having all QWidget windows marked as
@@ -144,35 +140,38 @@ void QEGLPlatformBackingStore::flush(QWindow *window, const QRegion &region, con
Q_UNUSED(region);
Q_UNUSED(offset);
- QEGLPlatformScreen *screen = static_cast<QEGLPlatformScreen *>(m_window->screen());
- QEGLPlatformWindow *dstWin = screen->compositingWindow();
- if (!dstWin || !dstWin->isRaster())
+ QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
+ QOpenGLContext *dstCtx = compositor->context();
+ QWindow *dstWin = compositor->targetWindow();
+ if (!dstWin)
return;
- screen->compositingContext()->makeCurrent(dstWin->window());
+ dstCtx->makeCurrent(dstWin);
updateTexture();
m_textures->clear();
m_textures->appendTexture(Q_NULLPTR, m_bsTexture, window->geometry());
- composite(screen->compositingContext(), dstWin);
+
+ compositor->update();
}
-void QEGLPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
+void QOpenGLCompositorBackingStore::composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
QPlatformTextureList *textures, QOpenGLContext *context,
bool translucentBackground)
{
- // QOpenGLWidget content provided as textures. The raster content should go on top.
+ // QOpenGLWidget/QQuickWidget content provided as textures. The raster content should go on top.
Q_UNUSED(region);
Q_UNUSED(offset);
Q_UNUSED(context);
Q_UNUSED(translucentBackground);
- QEGLPlatformScreen *screen = static_cast<QEGLPlatformScreen *>(m_window->screen());
- QEGLPlatformWindow *dstWin = screen->compositingWindow();
- if (!dstWin || !dstWin->isRaster())
+ QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
+ QOpenGLContext *dstCtx = compositor->context();
+ QWindow *dstWin = compositor->targetWindow();
+ if (!dstWin)
return;
- screen->compositingContext()->makeCurrent(dstWin->window());
+ dstCtx->makeCurrent(dstWin);
m_textures->clear();
for (int i = 0; i < textures->count(); ++i)
@@ -184,15 +183,10 @@ void QEGLPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &r
textures->lock(true);
m_lockedWidgetTextures = textures;
- composite(screen->compositingContext(), dstWin);
-}
-
-void QEGLPlatformBackingStore::composite(QOpenGLContext *context, QEGLPlatformWindow *window)
-{
- QEGLCompositor::instance()->schedule(context, window);
+ compositor->update();
}
-void QEGLPlatformBackingStore::composited()
+void QOpenGLCompositorBackingStore::notifyComposited()
{
if (m_lockedWidgetTextures) {
QPlatformTextureList *textureList = m_lockedWidgetTextures;
@@ -201,7 +195,7 @@ void QEGLPlatformBackingStore::composited()
}
}
-void QEGLPlatformBackingStore::beginPaint(const QRegion &region)
+void QOpenGLCompositorBackingStore::beginPaint(const QRegion &region)
{
m_dirty |= region;
@@ -213,27 +207,28 @@ void QEGLPlatformBackingStore::beginPaint(const QRegion &region)
}
}
-void QEGLPlatformBackingStore::resize(const QSize &size, const QRegion &staticContents)
+void QOpenGLCompositorBackingStore::resize(const QSize &size, const QRegion &staticContents)
{
Q_UNUSED(staticContents);
- QEGLPlatformScreen *screen = static_cast<QEGLPlatformScreen *>(m_window->screen());
- QEGLPlatformWindow *dstWin = screen->compositingWindow();
- if (!dstWin || (!dstWin->isRaster() && dstWin->window()->surfaceType() != QSurface::RasterGLSurface))
+ QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
+ QOpenGLContext *dstCtx = compositor->context();
+ QWindow *dstWin = compositor->targetWindow();
+ if (!dstWin)
return;
m_image = QImage(size, QImage::Format_RGBA8888);
m_window->create();
- screen->compositingContext()->makeCurrent(dstWin->window());
+ dstCtx->makeCurrent(dstWin);
if (m_bsTexture) {
glDeleteTextures(1, &m_bsTexture);
m_bsTexture = 0;
}
}
-QImage QEGLPlatformBackingStore::toImage() const
+QImage QOpenGLCompositorBackingStore::toImage() const
{
return m_image;
}
diff --git a/src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
index 502ca5a639..0501cd868c 100644
--- a/src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h
+++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
@@ -31,8 +31,8 @@
**
****************************************************************************/
-#ifndef QEGLPLATFORMBACKINGSTORE_H
-#define QEGLPLATFORMBACKINGSTORE_H
+#ifndef QOPENGLCOMPOSITORBACKINGSTORE_H
+#define QOPENGLCOMPOSITORBACKINGSTORE_H
//
// W A R N I N G
@@ -46,7 +46,6 @@
//
#include <qpa/qplatformbackingstore.h>
-
#include <QImage>
#include <QRegion>
@@ -54,13 +53,12 @@ QT_BEGIN_NAMESPACE
class QOpenGLContext;
class QPlatformTextureList;
-class QEGLPlatformWindow;
-class QEGLPlatformBackingStore : public QPlatformBackingStore
+class QOpenGLCompositorBackingStore : public QPlatformBackingStore
{
public:
- QEGLPlatformBackingStore(QWindow *window);
- ~QEGLPlatformBackingStore();
+ QOpenGLCompositorBackingStore(QWindow *window);
+ ~QOpenGLCompositorBackingStore();
QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
@@ -76,14 +74,12 @@ public:
const QPlatformTextureList *textures() const { return m_textures; }
- virtual void composite(QOpenGLContext *context, QEGLPlatformWindow *window);
-
- void composited();
+ void notifyComposited();
private:
void updateTexture();
- QEGLPlatformWindow *m_window;
+ QWindow *m_window;
QImage m_image;
QRegion m_dirty;
uint m_bsTexture;
@@ -93,4 +89,4 @@ private:
QT_END_NAMESPACE
-#endif // QEGLPLATFORMBACKINGSTORE_H
+#endif // QOPENGLCOMPOSITORBACKINGSTORE_H
diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro
index 32ce2e3887..39cbd9d181 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -21,5 +21,6 @@ include(themes/themes.pri)
include(accessibility/accessibility.pri)
include(linuxaccessibility/linuxaccessibility.pri)
include(clipboard/clipboard.pri)
+include(platformcompositor/platformcompositor.pri)
load(qt_module)
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices_p.h b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
index f24912278b..17eb7b456e 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices_p.h
+++ b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
@@ -55,10 +55,10 @@ class QGenericUnixServices : public QPlatformServices
public:
QGenericUnixServices() {}
- QByteArray desktopEnvironment() const;
+ QByteArray desktopEnvironment() const Q_DECL_OVERRIDE;
- virtual bool openUrl(const QUrl &url);
- virtual bool openDocument(const QUrl &url);
+ virtual bool openUrl(const QUrl &url) Q_DECL_OVERRIDE;
+ virtual bool openDocument(const QUrl &url) Q_DECL_OVERRIDE;
private:
QString m_webBrowser;
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index e66fdeb7c3..a28fbd62f4 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -135,6 +135,11 @@ QStringList QGenericUnixTheme::xdgIconThemePaths()
if (xdgIconsDir.isDir())
paths.append(xdgIconsDir.absoluteFilePath());
}
+
+ const QFileInfo pixmapsIconsDir(QStringLiteral("/usr/share/pixmaps"));
+ if (pixmapsIconsDir.isDir())
+ paths.append(pixmapsIconsDir.absoluteFilePath());
+
return paths;
}
@@ -170,6 +175,7 @@ public:
, toolButtonStyle(Qt::ToolButtonTextBesideIcon)
, toolBarIconSize(0)
, singleClick(true)
+ , wheelScrollLines(3)
{ }
static QString kdeGlobals(const QString &kdeDir)
@@ -193,6 +199,7 @@ public:
int toolButtonStyle;
int toolBarIconSize;
bool singleClick;
+ int wheelScrollLines;
};
void QKdeThemePrivate::refresh()
@@ -242,6 +249,10 @@ void QKdeThemePrivate::refresh()
toolButtonStyle = Qt::ToolButtonTextUnderIcon;
}
+ const QVariant wheelScrollLinesValue = readKdeSetting(QStringLiteral("KDE/WheelScrollLines"), kdeDirs, kdeSettings);
+ if (wheelScrollLinesValue.isValid())
+ wheelScrollLines = wheelScrollLinesValue.toInt();
+
// Read system font, ignore 'smallestReadableFont'
if (QFont *systemFont = kdeFont(readKdeSetting(QStringLiteral("font"), kdeDirs, kdeSettings)))
resources.fonts[QPlatformTheme::SystemFont] = systemFont;
@@ -428,6 +439,8 @@ QVariant QKdeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
return QVariant(int(KdeKeyboardScheme));
case QPlatformTheme::ItemViewActivateItemOnSingleClick:
return QVariant(d->singleClick);
+ case QPlatformTheme::WheelScrollLines:
+ return QVariant(d->wheelScrollLines);
default:
break;
}
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index 87df37dfd7..2a689c6872 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -75,8 +75,8 @@ public:
static QPlatformTheme *createUnixTheme(const QString &name);
static QStringList themeNames();
- virtual const QFont *font(Font type) const;
- virtual QVariant themeHint(ThemeHint hint) const;
+ virtual const QFont *font(Font type) const Q_DECL_OVERRIDE;
+ virtual QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
static QStringList xdgIconThemePaths();
@@ -93,11 +93,11 @@ public:
QKdeTheme(const QStringList& kdeDirs, int kdeVersion);
static QPlatformTheme *createKdeTheme();
- virtual QVariant themeHint(ThemeHint hint) const;
+ virtual QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
- virtual const QPalette *palette(Palette type = SystemPalette) const;
+ virtual const QPalette *palette(Palette type = SystemPalette) const Q_DECL_OVERRIDE;
- virtual const QFont *font(Font type) const;
+ virtual const QFont *font(Font type) const Q_DECL_OVERRIDE;
static const char *name;
};
@@ -110,8 +110,8 @@ class QGnomeTheme : public QPlatformTheme
Q_DECLARE_PRIVATE(QGnomeTheme)
public:
QGnomeTheme();
- virtual QVariant themeHint(ThemeHint hint) const;
- virtual const QFont *font(Font type) const;
+ virtual QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
+ virtual const QFont *font(Font type) const Q_DECL_OVERRIDE;
QString standardButtonText(int button) const Q_DECL_OVERRIDE;
virtual QString gtkFontName() const;