Skip to content

Commit

Permalink
Merge branch 'staging-master' of scm.dev.nokia.troll.no:qt/qt-lightho…
Browse files Browse the repository at this point in the history
…use into master-integration

* 'staging-master' of scm.dev.nokia.troll.no:qt/qt-lighthouse: (69 commits)
  Lighthouse: License headers to new files in testlite
  Make sure we blit the fbo on flush in QGLWindowSurface
  Lighthouse: Wayland. Make the wayland integration closer to Lighthosue
  Lighthouse: Wayland, only make one fbo for the WaylandPaintDevice
  Making clearer separation between responsibility of different classes
  Make it possible to vertically mirror gl painting
  Lighthouse:Wayland Moving some logic into files
  Fix Wayland plugin to work with Wayland after some interfaces changed
  Make QGLContext::fromPlatformGLContext show correct sharing
  Remove Lighthouse specific code from QGLWindowSurface
  Fix X11 clipboard bug.
  Fix for uninitialized member in QWaylandCursor
  wayland: use pkgconfig for libdrm in wayland.pro
  wayland: remove non-public header from config.tests
  wayland: fix SOURCES to point to wayland.cpp in config.tests
  Wayland: request rbg and premultiplied argb visuals as needed
  Wayland: clamp window resizes to screen size
  Wayland: split GL code into separate files
  Wayland: use correct viewport for swapBuffers and correct coords
  Wayland: fix geometry of swapBuffers
  ...
  • Loading branch information
Qt Continuous Integration System committed Jan 27, 2011
2 parents 39e6aa3 + b0390e6 commit aac8c26
Show file tree
Hide file tree
Showing 94 changed files with 7,908 additions and 1,549 deletions.
46 changes: 46 additions & 0 deletions config.tests/qpa/wayland/wayland.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation ([email protected])
**
** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at [email protected].
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <wayland-client.h>

int main(int, char **)
{
return 0;
}
6 changes: 6 additions & 0 deletions config.tests/qpa/wayland/wayland.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SOURCES = wayland.cpp
CONFIG -= qt

QMAKE_CXXFLAGS += $$QT_CFLAGS_WAYLAND
LIBS += $$QT_LIBS_WAYLAND -lfreetype -lfontconfig -lwayland-client

7 changes: 6 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ while [ "$#" -gt 0 ]; do
;;

framework)
if [ "$PLATFORM_MAC" = "yes" ]; then
if [ "$PLATFORM_MAC" = "yes" ] || [ "$PLATFORM_QPA" = "yes" ]; then
CFG_FRAMEWORK="$VAL"
else
UNKNOWN_OPT=yes
Expand Down Expand Up @@ -6143,6 +6143,11 @@ if [ "$PLATFORM_QPA" = "yes" ]; then
QMakeVar set QMAKE_LIBS_FONTCONFIG "$QT_LIBS_FONTCONFIG"
CFG_LIBFREETYPE=system
fi

if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qpa/wayland "Wayland" $L_FLAGS $I_FLAGS $l_FLAGS; then
QT_CONFIG="$QT_CONFIG wayland"
fi

fi

if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/coreservices "CoreServices" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/common/mac/qplatformdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#include <net/if.h>
#endif

#include "../common/posix/qplatformdefs.h"
#include "../posix/qplatformdefs.h"

#undef QT_OPEN_LARGEFILE
#undef QT_SOCKLEN_T
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/features/qttest_p4.prf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ isEmpty(TEMPLATE):TEMPLATE=app
CONFIG += qt warn_on console depend_includepath testcase

# x11 is not defined by configure (the following line is copied from gui.pro)
!win32:!embedded:!mac:!symbian:CONFIG += x11
!win32:!embedded:!qpa:!mac:!symbian:CONFIG += x11

qtAddLibrary(QtTest)

Expand Down
1 change: 1 addition & 0 deletions src/gui/embedded/qkbd_defaultmap_qws_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ const QWSKeyboard::Mapping QWSKbPrivate::s_keymap_default[] = {
{ 119, 0xffff, 0x01000008, 0x00, 0x00, 0x0000 },
{ 138, 0xffff, 0x01000058, 0x00, 0x00, 0x0000 },
{ 139, 0xffff, 0x01000055, 0x00, 0x00, 0x0000 },
{ 152, 0xffff, 0x010000ba, 0x00, 0x00, 0x0000 },

};

Expand Down
6 changes: 4 additions & 2 deletions src/gui/kernel/kernel.pri
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ qpa {
kernel/qplatformglcontext_qpa.h \
kernel/qdesktopwidget_qpa_p.h \
kernel/qplatformeventloopintegration_qpa.h \
kernel/qplatformcursor_qpa.h
kernel/qplatformcursor_qpa.h \
kernel/qplatformclipboard_qpa.h

SOURCES += \
kernel/qapplication_qpa.cpp \
Expand All @@ -244,7 +245,8 @@ qpa {
kernel/qplatformwindowformat_qpa.cpp \
kernel/qplatformeventloopintegration_qpa.cpp \
kernel/qplatformglcontext_qpa.cpp \
kernel/qplatformcursor_qpa.cpp
kernel/qplatformcursor_qpa.cpp \
kernel/qplatformclipboard_qpa.cpp

contains(QT_CONFIG, glib) {
SOURCES += \
Expand Down
2 changes: 2 additions & 0 deletions src/gui/kernel/qapplication_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ class Q_GUI_EXPORT QApplicationPrivate : public QCoreApplicationPrivate
static void processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e);
static void processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e);

static void processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e);

static void processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e);

// static void reportScreenCount(int count);
Expand Down
33 changes: 25 additions & 8 deletions src/gui/kernel/qapplication_qpa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ int qt_last_x = 0;
int qt_last_y = 0;
QPointer<QWidget> qt_last_mouse_receiver = 0;

static Qt::KeyboardModifiers modifiers = Qt::NoModifier;
static Qt::MouseButtons buttons = Qt::NoButton;
static ulong mousePressTime;
static Qt::MouseButton mousePressButton = Qt::NoButton;
Expand Down Expand Up @@ -111,6 +110,9 @@ void QApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate
case QWindowSystemInterfacePrivate::Leave:
QApplicationPrivate::processLeaveEvent(static_cast<QWindowSystemInterfacePrivate::LeaveEvent *>(e));
break;
case QWindowSystemInterfacePrivate::ActivatedWindow:
QApplicationPrivate::processActivatedEvent(static_cast<QWindowSystemInterfacePrivate::ActivatedWindowEvent *>(e));
break;
case QWindowSystemInterfacePrivate::Close:
QApplicationPrivate::processCloseEvent(
static_cast<QWindowSystemInterfacePrivate::CloseEvent *>(e));
Expand Down Expand Up @@ -441,11 +443,11 @@ void QApplication::alert(QWidget *, int)
{
}

static void init_platform(const QString &name)
static void init_platform(const QString &name, const QString &platformPluginPath)
{
QApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name);
QApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, platformPluginPath);
if (!QApplicationPrivate::platform_integration) {
QStringList keys = QPlatformIntegrationFactory::keys();
QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath);
QString fatalMessage =
QString::fromLatin1("Failed to load platform plugin \"%1\". Available platforms are: \n").arg(name);
foreach(QString key, keys) {
Expand Down Expand Up @@ -510,6 +512,7 @@ void qt_init(QApplicationPrivate *priv, int type)
}

QList<QByteArray> pluginList;
QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));
QString platformName = QLatin1String(qgetenv("QT_QPA_PLATFORM"));

// Get command line params
Expand All @@ -524,6 +527,9 @@ void qt_init(QApplicationPrivate *priv, int type)
if (arg == "-fn" || arg == "-font") {
if (++i < argc)
appFont = QString::fromLocal8Bit(argv[i]);
} else if (arg == "-platformpluginpath") {
if (++i < argc)
platformPluginPath = QLatin1String(argv[i]);
} else if (arg == "-platform") {
if (++i < argc)
platformName = QLatin1String(argv[i]);
Expand All @@ -547,7 +553,7 @@ void qt_init(QApplicationPrivate *priv, int type)
}
#endif

init_platform(platformName);
init_platform(platformName, platformPluginPath);
init_plugins(pluginList);

QColormap::initialize();
Expand Down Expand Up @@ -724,15 +730,23 @@ void QApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mouse

// qDebug() << "sending mouse ev." << ev.type() << localPoint << globalPoint << ev.button() << ev.buttons() << mouseWidget << "mouse grabber" << implicit_mouse_grabber;

QMouseEvent ev(type, localPoint, globalPoint, button, buttons, modifiers);
QMouseEvent ev(type, localPoint, globalPoint, button, buttons, QApplication::keyboardModifiers());

QList<QWeakPointer<QPlatformCursor> > cursors = QPlatformCursorPrivate::getInstances();
foreach (QWeakPointer<QPlatformCursor> cursor, cursors) {
if (cursor)
cursor.data()->pointerEvent(ev);
}

int oldOpenPopupCount = openPopupCount;
QApplication::sendSpontaneousEvent(mouseWidget, &ev);

#ifndef QT_NO_CONTEXTMENU
if (type == QEvent::MouseButtonPress && button == Qt::RightButton && (openPopupCount == oldOpenPopupCount)) {
QContextMenuEvent e(QContextMenuEvent::Mouse, localPoint, globalPoint, QApplication::keyboardModifiers());
QApplication::sendSpontaneousEvent(mouseWidget, &e);
}
#endif // QT_NO_CONTEXTMENU
}


Expand Down Expand Up @@ -771,7 +785,7 @@ void QApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wheel
p = mouseWidget->mapFromGlobal(globalPoint);
}

QWheelEvent ev(p, globalPoint, e->delta, buttons, modifiers,
QWheelEvent ev(p, globalPoint, e->delta, buttons, QApplication::keyboardModifiers(),
e->orient);
QApplication::sendSpontaneousEvent(mouseWidget, &ev);
}
Expand Down Expand Up @@ -802,7 +816,6 @@ void QApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEven
if (app_do_modal && !qt_try_modal(focusW, e->keyType))
return;

modifiers = e->modifiers;
QKeyEvent ev(e->keyType, e->key, e->modifiers, e->unicode, e->repeat, e->repeatCount);
QApplication::sendSpontaneousEvent(focusW, &ev);
}
Expand All @@ -823,6 +836,10 @@ void QApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Leave

}

void QApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e)
{
QApplication::setActiveWindow(e->activated.data());
}

void QApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e)
{
Expand Down
82 changes: 12 additions & 70 deletions src/gui/kernel/qclipboard_qpa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,73 +44,16 @@
#ifndef QT_NO_CLIPBOARD

#include "qmimedata.h"
#include "qapplication.h"
#include "private/qapplication_p.h"
#include "qplatformclipboard_qpa.h"

QT_BEGIN_NAMESPACE

QT_USE_NAMESPACE


class QClipboardData
{
public:
QClipboardData();
~QClipboardData();

void setSource(QMimeData* s)
{
if (s == src)
return;
delete src;
src = s;
}
QMimeData* source()
{ return src; }

void clear();

private:
QMimeData* src;
};

QClipboardData::QClipboardData()
{
src = 0;
}

QClipboardData::~QClipboardData()
{
delete src;
}

void QClipboardData::clear()
{
delete src;
src = 0;
}


static QClipboardData *internalCbData = 0;

static void cleanupClipboardData()
{
delete internalCbData;
internalCbData = 0;
}

static QClipboardData *clipboardData()
{
if (internalCbData == 0) {
internalCbData = new QClipboardData;
qAddPostRoutine(cleanupClipboardData);
}
return internalCbData;
}


void QClipboard::clear(Mode mode)
{
setText(QString(), mode);
setMimeData(0,mode);
}


Expand All @@ -121,26 +64,25 @@ bool QClipboard::event(QEvent *e)

const QMimeData* QClipboard::mimeData(Mode mode) const
{
if (mode != Clipboard) return 0;

QClipboardData *d = clipboardData();
return d->source();
QPlatformClipboard *clipboard = QApplicationPrivate::platformIntegration()->clipboard();
if (!clipboard->supportsMode(mode)) return 0;
return clipboard->mimeData(mode);
}

void QClipboard::setMimeData(QMimeData* src, Mode mode)
{
if (mode != Clipboard) return;

QClipboardData *d = clipboardData();
QPlatformClipboard *clipboard = QApplicationPrivate::platformIntegration()->clipboard();
if (!clipboard->supportsMode(mode)) return;

d->setSource(src);
clipboard->setMimeData(src,mode);

emitChanged(QClipboard::Clipboard);
emitChanged(mode);
}

bool QClipboard::supportsMode(Mode mode) const
{
return (mode == Clipboard);
QPlatformClipboard *clipboard = QApplicationPrivate::platformIntegration()->clipboard();
return clipboard->supportsMode(mode);
}

bool QClipboard::ownsMode(Mode mode) const
Expand Down
8 changes: 7 additions & 1 deletion src/gui/kernel/qdesktopwidget_qpa_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@
class QDesktopScreenWidget : public QWidget {
Q_OBJECT
public:
QDesktopScreenWidget(int screenNumber = -1) { setWindowFlags(Qt::Desktop); setVisible(false); d_func()->screenNumber = screenNumber; }
QDesktopScreenWidget(int screenNumber = -1)
{
setWindowFlags(Qt::Desktop);
setVisible(false);
QTLWExtra *topData = d_func()->topData();
topData->screenIndex = screenNumber;
}
};

class QDesktopWidgetPrivate : public QWidgetPrivate {
Expand Down
2 changes: 1 addition & 1 deletion src/gui/kernel/qdnd_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class QEventLoop;

#if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD))

class QInternalMimeData : public QMimeData
class Q_GUI_EXPORT QInternalMimeData : public QMimeData
{
Q_OBJECT
public:
Expand Down
Loading

0 comments on commit aac8c26

Please sign in to comment.