Make wayland actually a module
authorJørgen Lind <jorgen.lind@nokia.com>
Mon, 5 Dec 2011 16:09:02 +0000 (17:09 +0100)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>
Wed, 7 Dec 2011 08:58:35 +0000 (09:58 +0100)
Also fix so that QtCompositor can be built as shared object.

+ fix so that the default QT_WAYLAND_GL_CONFIG is wayland_egl

Change-Id: I02b72e99286584426bd37ab2d00bbc84af11efdc
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
87 files changed:
README
examples/examples.pro [new file with mode: 0644]
examples/qml-compositor/main.cpp
examples/qml-compositor/qml-compositor.pro
examples/qwidget-compositor-mdi/main.cpp
examples/qwidget-compositor-mdi/qt-compositor.pro [deleted file]
examples/qwidget-compositor/qwidget-compositor.pro
examples/qwindow-compositor/qwindow-compositor.pro
examples/qwindow-compositor/surfacerenderer.cpp
examples/qwindow-compositor/surfacerenderer.h
modules/qt_compositor.pri [new file with mode: 0644]
qtwayland.pro
src/compositor/compositor.pri [moved from src/qt-compositor/qt-compositor.pri with 86% similarity]
src/compositor/compositor.pro [new file with mode: 0644]
src/compositor/compositor_api/compositor_api.pri [moved from src/qt-compositor/compositor_api/compositor_api.pri with 52% similarity]
src/compositor/compositor_api/waylandcompositor.cpp [moved from src/qt-compositor/compositor_api/waylandcompositor.cpp with 100% similarity]
src/compositor/compositor_api/waylandcompositor.h [moved from src/qt-compositor/compositor_api/waylandcompositor.h with 98% similarity]
src/compositor/compositor_api/waylandsurface.cpp [moved from src/qt-compositor/compositor_api/waylandsurface.cpp with 100% similarity]
src/compositor/compositor_api/waylandsurface.h [moved from src/qt-compositor/compositor_api/waylandsurface.h with 98% similarity]
src/compositor/compositor_api/waylandsurfaceitem.cpp [moved from src/qt-compositor/compositor_api/waylandsurfaceitem.cpp with 98% similarity]
src/compositor/compositor_api/waylandsurfaceitem.h [moved from src/qt-compositor/compositor_api/waylandsurfaceitem.h with 97% similarity]
src/compositor/hardware_integration/dri2_xcb/README [moved from src/qt-compositor/hardware_integration/dri2_xcb/README with 100% similarity]
src/compositor/hardware_integration/dri2_xcb/dri2_xcb.pri [moved from src/qt-compositor/hardware_integration/dri2_xcb/dri2_xcb.pri with 100% similarity]
src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.cpp [moved from src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.cpp with 100% similarity]
src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.h [moved from src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.h with 100% similarity]
src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.cpp [moved from src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.cpp with 100% similarity]
src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.h [moved from src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.h with 100% similarity]
src/compositor/hardware_integration/graphicshardwareintegration.cpp [moved from src/qt-compositor/hardware_integration/graphicshardwareintegration.cpp with 100% similarity]
src/compositor/hardware_integration/graphicshardwareintegration.h [moved from src/qt-compositor/hardware_integration/graphicshardwareintegration.h with 100% similarity]
src/compositor/hardware_integration/hardware_integration.pri [moved from src/qt-compositor/hardware_integration/hardware_integration.pri with 92% similarity]
src/compositor/hardware_integration/wayland_egl/wayland_egl.pri [moved from src/qt-compositor/hardware_integration/wayland_egl/wayland_egl.pri with 100% similarity]
src/compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp [moved from src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp with 100% similarity]
src/compositor/hardware_integration/wayland_egl/waylandeglintegration.h [moved from src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.h with 100% similarity]
src/compositor/hardware_integration/xcomposite_egl/xcomposite_egl.pri [moved from src/qt-compositor/hardware_integration/xcomposite_egl/xcomposite_egl.pri with 100% similarity]
src/compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.cpp [moved from src/qt-compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.cpp with 100% similarity]
src/compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.h [moved from src/qt-compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.h with 100% similarity]
src/compositor/hardware_integration/xcomposite_glx/xcomposite_glx.pri [moved from src/qt-compositor/hardware_integration/xcomposite_glx/xcomposite_glx.pri with 100% similarity]
src/compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.cpp [moved from src/qt-compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.cpp with 100% similarity]
src/compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.h [moved from src/qt-compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.h with 100% similarity]
src/compositor/hardware_integration/xcomposite_share/protocol/wayland-xcomposite.xml [moved from src/qt-compositor/hardware_integration/xcomposite_share/protocol/wayland-xcomposite.xml with 100% similarity]
src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h [moved from src/qt-compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h with 100% similarity]
src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-protocol.c [moved from src/qt-compositor/hardware_integration/xcomposite_share/wayland-xcomposite-protocol.c with 100% similarity]
src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-server-protocol.h [moved from src/qt-compositor/hardware_integration/xcomposite_share/wayland-xcomposite-server-protocol.h with 100% similarity]
src/compositor/hardware_integration/xcomposite_share/xcomposite_share.pri [moved from src/qt-compositor/hardware_integration/xcomposite_share/xcomposite_share.pri with 100% similarity]
src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp [moved from src/qt-compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp with 100% similarity]
src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.h [moved from src/qt-compositor/hardware_integration/xcomposite_share/xcompositebuffer.h with 100% similarity]
src/compositor/hardware_integration/xcomposite_share/xcompositehandler.cpp [moved from src/qt-compositor/hardware_integration/xcomposite_share/xcompositehandler.cpp with 100% similarity]
src/compositor/hardware_integration/xcomposite_share/xcompositehandler.h [moved from src/qt-compositor/hardware_integration/xcomposite_share/xcompositehandler.h with 100% similarity]
src/compositor/hardware_integration/xcomposite_share/xlibinclude.h [moved from src/qt-compositor/hardware_integration/xcomposite_share/xlibinclude.h with 100% similarity]
src/compositor/util/util.pri [moved from src/qt-compositor/util/util.pri with 100% similarity]
src/compositor/util/waylandobject.h [moved from src/qt-compositor/util/waylandobject.h with 100% similarity]
src/compositor/wayland_wrapper/wayland_wrapper.pri [moved from src/qt-compositor/wayland_wrapper/wayland_wrapper.pri with 100% similarity]
src/compositor/wayland_wrapper/wlcompositor.cpp [moved from src/qt-compositor/wayland_wrapper/wlcompositor.cpp with 100% similarity]
src/compositor/wayland_wrapper/wlcompositor.h [moved from src/qt-compositor/wayland_wrapper/wlcompositor.h with 100% similarity]
src/compositor/wayland_wrapper/wldatadevice.cpp [moved from src/qt-compositor/wayland_wrapper/wldatadevice.cpp with 100% similarity]
src/compositor/wayland_wrapper/wldatadevice.h [moved from src/qt-compositor/wayland_wrapper/wldatadevice.h with 100% similarity]
src/compositor/wayland_wrapper/wldatadevicemanager.cpp [moved from src/qt-compositor/wayland_wrapper/wldatadevicemanager.cpp with 100% similarity]
src/compositor/wayland_wrapper/wldatadevicemanager.h [moved from src/qt-compositor/wayland_wrapper/wldatadevicemanager.h with 100% similarity]
src/compositor/wayland_wrapper/wldataoffer.cpp [moved from src/qt-compositor/wayland_wrapper/wldataoffer.cpp with 100% similarity]
src/compositor/wayland_wrapper/wldataoffer.h [moved from src/qt-compositor/wayland_wrapper/wldataoffer.h with 100% similarity]
src/compositor/wayland_wrapper/wldatasource.cpp [moved from src/qt-compositor/wayland_wrapper/wldatasource.cpp with 100% similarity]
src/compositor/wayland_wrapper/wldatasource.h [moved from src/qt-compositor/wayland_wrapper/wldatasource.h with 100% similarity]
src/compositor/wayland_wrapper/wldisplay.cpp [moved from src/qt-compositor/wayland_wrapper/wldisplay.cpp with 100% similarity]
src/compositor/wayland_wrapper/wldisplay.h [moved from src/qt-compositor/wayland_wrapper/wldisplay.h with 100% similarity]
src/compositor/wayland_wrapper/wlinputdevice.cpp [moved from src/qt-compositor/wayland_wrapper/wlinputdevice.cpp with 100% similarity]
src/compositor/wayland_wrapper/wlinputdevice.h [moved from src/qt-compositor/wayland_wrapper/wlinputdevice.h with 100% similarity]
src/compositor/wayland_wrapper/wloutput.cpp [moved from src/qt-compositor/wayland_wrapper/wloutput.cpp with 100% similarity]
src/compositor/wayland_wrapper/wloutput.h [moved from src/qt-compositor/wayland_wrapper/wloutput.h with 100% similarity]
src/compositor/wayland_wrapper/wlshell.cpp [moved from src/qt-compositor/wayland_wrapper/wlshell.cpp with 100% similarity]
src/compositor/wayland_wrapper/wlshell.h [moved from src/qt-compositor/wayland_wrapper/wlshell.h with 100% similarity]
src/compositor/wayland_wrapper/wlshmbuffer.cpp [moved from src/qt-compositor/wayland_wrapper/wlshmbuffer.cpp with 100% similarity]
src/compositor/wayland_wrapper/wlshmbuffer.h [moved from src/qt-compositor/wayland_wrapper/wlshmbuffer.h with 100% similarity]
src/compositor/wayland_wrapper/wlsurface.cpp [moved from src/qt-compositor/wayland_wrapper/wlsurface.cpp with 100% similarity]
src/compositor/wayland_wrapper/wlsurface.h [moved from src/qt-compositor/wayland_wrapper/wlsurface.h with 100% similarity]
src/compositor/windowmanagerprotocol/wayland-windowmanager-protocol.c [moved from src/qt-compositor/windowmanagerprotocol/wayland-windowmanager-protocol.c with 100% similarity]
src/compositor/windowmanagerprotocol/wayland-windowmanager-server-protocol.h [moved from src/qt-compositor/windowmanagerprotocol/wayland-windowmanager-server-protocol.h with 100% similarity]
src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp [moved from src/qt-compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp with 100% similarity]
src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h [moved from src/qt-compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h with 100% similarity]
src/compositor/windowmanagerprotocol/windowmanager.xml [moved from src/qt-compositor/windowmanagerprotocol/windowmanager.xml with 100% similarity]
src/compositor/windowmanagerprotocol/windowmanagerprotocol.pri [moved from src/qt-compositor/windowmanagerprotocol/windowmanagerprotocol.pri with 100% similarity]
src/plugins/platforms/platforms.pro [new file with mode: 0644]
src/plugins/platforms/wayland/gl_integration/gl_integration.pri
src/plugins/platforms/wayland/wayland.pro
src/plugins/plugins.pro [new file with mode: 0644]
src/qt-compositor/qt-compositor.pro [deleted file]
src/src.pro
sync.profile [new file with mode: 0644]

diff --git a/README b/README
index ce4bc7c..3247a25 100644 (file)
--- a/README
+++ b/README
@@ -1,87 +1,5 @@
-This document is heavily inspired by the Building Wayland document:
-http://wayland.freedesktop.org/building.html
+This is the Qt for Wayland module.
 
-However, it is slightly more messy
-:) If you encounter things you find unclear, and know of a better way of
-expressing it, then please send a patch:)
+Sometimes we are slightly behind upstream wayland, so if your compiling Wayland from git, reset to sha1 defined in wayland_sha1.txt
 
-Qt-Compositor is meant as a toolbox for making new funky Wayland compositors.
-
-Pre-requisites on Linux (apt-get): git, autoconf, automake, libtool, libexpat1-dev
-Pre-requisites on Mac OSX Snow Leopard: git, latest Gnu autoconf, latest Gnu automake, latest Gnu libtool, latest pkg-config.
-Make sure you have /usr/local/bin on the $PATH before /usr/bin
-  
-1. To build wayland we need libffi + libffi headers on Linux. For Mac we need a special version of wayland/event-loop.c -- if you pull the distribution from the freedesktop.org, replace the event-loop.c with the one in this repo
-# sudo apt-get install libffi-dev
-On Mac ffi is part of the OS but you need to tell the the wayland configure
-export FFI_CFLAGS=-I/usr/include/ffi
-export FFI_LIBS-lffi
-
-Qt-Compositor contains a copy of the Wayland libraries. We have not changed
-them in any way, but they are provided for convenience so that you can compile
-everything using qmake. However, I suggest you use the official Wayland
-libraries. The only dependency they have is to ffi. The demos has some more
-dependencies, but we are not going to compile those.
-
-2. Clone Wayland from: git://anongit.freedesktop.org/wayland/wayland
-# git clone git://anongit.freedesktop.org/wayland/wayland
-
-3. Compile Wayland: ./autogen.sh -prefix=$HOME/install && make && make install
-
-4. Set your PKG_CONFIG_PATH so that the location of the Wayland libraries are
-picked up by Qt's configure. 
-# export PKG_CONFIG_PATH=$HOME/install/lib/pkgconfig/
-
-6. Set the library path to pick up the Wayland libraries
-# export LD_LIBRARY_PATH=$HOME/install/lib
-
-8. Get the build dependencies that you need for QtGui.
-# sudo apt-get build-dep libqt4-gui
-
-One of the dependencies that the wayland-demos compositor and client
-applications has is xkbcommon. The Qt-Lighthouse wayland plugin has code to
-read xkbcommon codes sent over the wayland protocol, so that Qt-Lighthouse
-clients on Wayland will get keyboard functionality in other compositors.
-However, Qt-Compositor doesn't have this requirement. The support for xkbcommon
-is picked up by configure. If it is not detected the Wayland plug-in will be
-compiled with the: QT_NO_WAYLAND_XKB.
-
-libxkbcommon is available from: git://people.freedesktop.org/xorg/lib/libxkbcommon.git
-Use typically the following line to configure it:
-# ./autogen.sh --prefix=$HOME/install --with-xkb-config-root=/usr/share/X11/xkb
-
-Its a good idea to use out of source builds when building Qt. A good setup
-could be: $HOME/dev/qt-src/lighthouse where lighthouse is where you have a
-complete checkout of the lighthouse repository.  Then you can have ie.:
-$HOME/dev/qt-builds/lighthouse-debug
-
-9. Clone Lighthouse from gitorious
-# git clone git@gitorious.org:+qt-developers/qt/lighthouse.git
-# $HOME/dev/qt-src/lighthouse
-(you might want to use git remote etc. if you already have a clone of
-qt-master)
-
-10. Configure and compile Qt-Lighthouse. So from
-$HOME/dev/qt-builds/lighthouse-debug do: ../../qt-src/lighthouse/configure -qpa
--developer-build && make
-
-11. OK, now we have Lighthouse and Wayland libs on our system. To try Wayland
-out we want the compositor to render into a XWindow(this is for development).
-So we need to compile up a X back-end for lighthouse. They don't get built
-automatically (yet). The Wayland plug-in will be ma
-
-Go into the directory: $HOME/dev/qt-src/lighthouse/src/plugins/platforms/xcb
-# make
-
-12. When this is done, you are ready to compile the qwidget-compositor.  Enter
-the directory with $QT-COMPOSITOR-DIR/examples/qwidget-compositor #qmake &&
-make
-
-Makes generates a executable in $QT-COMPOSITOR-DIR/bin. Execute it and pass in
--platform xcb
-# $QT-COMPOSITOR-DIR/bin/qt-compositor -platform xcb
-
-This should give you a blank window. If you now open a another terminal with
-LD_LIBRARY_PATH set and run a simple Qt example with the -platform Wayland, it
-should render into this window.
+We hang out at #qt-labs and #qt-lighthouse on freenode if you have any questions
diff --git a/examples/examples.pro b/examples/examples.pro
new file mode 100644 (file)
index 0000000..5c75789
--- /dev/null
@@ -0,0 +1,6 @@
+TEMPLATE=subdirs
+SUBDIRS += qwidget-compositor qwidget-compositor-mdi qwindow-compositor
+
+contains(QT_CONFIG, quick) {
+    SUBDIRS += qml-compositor
+}
index 7f2d47b..0bd0943 100644 (file)
@@ -42,7 +42,7 @@
 #include "waylandsurface.h"
 #include "waylandsurfaceitem.h"
 
-#include <QApplication>
+#include <QGuiApplication>
 #include <QTimer>
 #include <QPainter>
 #include <QMouseEvent>
@@ -117,7 +117,7 @@ private:
 
 int main(int argc, char *argv[])
 {
-    QApplication app(argc, argv);
+    QGuiApplication app(argc, argv);
 
     QmlCompositor compositor;
     compositor.setWindowTitle(QLatin1String("QML Compositor"));
index aea2fdc..0295ded 100644 (file)
@@ -6,24 +6,13 @@ INCLUDEPATH += .
 # comment out the following to not use pkg-config in the pri files
 CONFIG += use_pkgconfig
 
-DESTDIR=$$PWD/../../bin/
-
 LIBS += -L ../../lib
 
-QT += declarative v8
-QT += opengl
-
-# to be removed once scenegraph gets rid of its widget dependencies
-#QT += widgets widgets-private
-
-!isEmpty(QT.core.MAJOR_VERSION):greaterThan(QT.core.MAJOR_VERSION, 4) {
-    QT += core-private gui-private declarative-private opengl-private
-}
+QT += quick v8
+QT += quick-private
 
-include (../../src/qt-compositor/qt-compositor.pri)
-
-target.path += $$[QT_INSTALL_BINS]
-INSTALLS += target
+QT += compositor
+#include (../../src/compositor/compositor.pri)
 
 # Input
 SOURCES += main.cpp
@@ -32,3 +21,9 @@ RESOURCES = qml-compositor.qrc
 CONFIG += qt warn_on debug  create_prl link_prl
 OBJECTS_DIR = .obj/release-shared
 MOC_DIR = .moc/release-shared
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtwayland/qml-compositor
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qml-compositor.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtwayland/qml-compositor
+INSTALLS += target sources
index 752014a..062669d 100644 (file)
@@ -172,7 +172,7 @@ class QWidgetCompositorMdi : public QMainWindow, public WaylandCompositor
 {
     Q_OBJECT
 public:
-    QWidgetCompositorMdi() : WaylandCompositor(this) {
+    QWidgetCompositorMdi() : WaylandCompositor(this->windowHandle()) {
        m_mdiArea = new QMdiArea(this);
 
        setCentralWidget(m_mdiArea);
diff --git a/examples/qwidget-compositor-mdi/qt-compositor.pro b/examples/qwidget-compositor-mdi/qt-compositor.pro
deleted file mode 100644 (file)
index 3cd110b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-TEMPLATE = app
-TARGET = qwidget-compositor-mdi
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# comment out the following to not use pkg-config in the pri files
-CONFIG += use_pkgconfig
-
-DESTDIR=$$PWD/../../bin/
-
-include (../../src/qt-compositor/qt-compositor.pri)
-
-QT += widgets gui-private widgets-private
-
-# Input
-SOURCES += main.cpp
-
-CONFIG += qt warn_on debug  create_prl link_prl
-OBJECTS_DIR = .obj/release-shared
-MOC_DIR = .moc/release-shared
index 98bcb0c..409930a 100644 (file)
@@ -6,9 +6,7 @@ INCLUDEPATH += .
 # comment out the following to not use pkg-config in the pri files
 CONFIG += use_pkgconfig
 
-DESTDIR=$$PWD/../../bin/
-
-include (../../src/qt-compositor/qt-compositor.pri)
+#include (../../src/qt-compositor/qt-compositor.pri)
 
 # Input
 SOURCES += main.cpp
@@ -23,12 +21,17 @@ isEmpty(QT_SOURCE_TREE) {
 } else {
     QTBASE = $$QT_SOURCE_TREE
 }
+
 #TOUCHSCREEN_BASE = $$QTBASE/src/plugins/generic/touchscreen
 #SOURCES += $$TOUCHSCREEN_BASE/qtouchscreen.cpp
 #HEADERS += $$TOUCHSCREEN_BASE/qtouchscreen.h
 #INCLUDEPATH += $$TOUCHSCREEN_BASE
 #LIBS += -ludev -lmtdev
-QT += gui-private widgets widgets-private opengl opengl-private
 
-target.path += $$[QT_INSTALL_DATA]/bin
-INSTALLS += target
+QT += gui-private widgets widgets-private opengl opengl-private compositor
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtwayland/qwidget-compositor
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qwidget-compositor.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtwayland/qwidget-compositor
+INSTALLS += target sources
index 79f318a..e154ad9 100644 (file)
@@ -6,10 +6,8 @@ INCLUDEPATH += .
 # comment out the following to not use pkg-config in the pri files
 CONFIG += use_pkgconfig
 
-DESTDIR=$$PWD/../../bin/
-
 LIBS += -L ../../lib
-include (../../src/qt-compositor/qt-compositor.pri)
+#include (../../src/qt-compositor/qt-compositor.pri)
 
 # Input
 SOURCES += main.cpp \
@@ -21,10 +19,10 @@ CONFIG += qt warn_on debug  create_prl link_prl
 OBJECTS_DIR = .obj/release-shared
 MOC_DIR = .moc/release-shared
 
-QT += gui opengl
+QT += gui
 
-target.path += $$[QT_INSTALL_BINS]
-INSTALLS += target
+QT += compositor
+#include(../../src/compositor/compositor.pri)
 
 HEADERS += \
     qopenglwindow.h \
@@ -32,3 +30,9 @@ HEADERS += \
     qwindowcompositor.h
 
 RESOURCES += qwindow-compositor.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtwayland/qwindow-compositor
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qwindow-compositor.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtwayland/qwindow-compositor
+INSTALLS += target sources
index 42af697..f160a3a 100644 (file)
@@ -1,6 +1,7 @@
 #include "surfacerenderer.h"
 
 #include <QOpenGLFunctions>
+#include <QImage>
 
 SurfaceRenderer::SurfaceRenderer(QOpenGLContext *context, QWindow *surface)
     : m_context(context)
@@ -30,10 +31,10 @@ SurfaceRenderer::SurfaceRenderer(QOpenGLContext *context, QWindow *surface)
     glBlendFunc (GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
 
     //May need to manually set context here
-    m_shaderProgram = new QGLShaderProgram();
+    m_shaderProgram = new QOpenGLShaderProgram();
 
-    m_shaderProgram->addShaderFromSourceCode(QGLShader::Vertex, textureVertexProgram);
-    m_shaderProgram->addShaderFromSourceCode(QGLShader::Fragment, textureFragmentProgram);
+    m_shaderProgram->addShaderFromSourceCode(QOpenGLShader::Vertex, textureVertexProgram);
+    m_shaderProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, textureFragmentProgram);
     m_shaderProgram->link();
     m_shaderProgram->bind();
 
@@ -97,13 +98,13 @@ void SurfaceRenderer::drawTexture(int textureId, const QRectF &geometry, int dep
 GLuint SurfaceRenderer::textureFromImage(const QImage &image)
 {
     //TODO: Replace this line
-    QImage convertedImage = QGLWidget::convertToGLFormat(image);
+    //QImage convertedImage = QGLWidget::convertToGLFormat(image);
 
     GLuint textureId;
     //Copy QImage data to Texture
     glGenTextures(1, &textureId);
     glBindTexture(GL_TEXTURE_2D, textureId);
-    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, convertedImage.width(), convertedImage.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, convertedImage.constBits());
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, image.constBits());
 
     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
index d2e03a4..abfb554 100644 (file)
@@ -2,7 +2,7 @@
 #define SURFACERENDERER_H
 
 #include <QOpenGLContext>
-#include <QGLShaderProgram>
+#include <QOpenGLShaderProgram>
 #include <QWindow>
 
 class SurfaceRenderer
@@ -18,7 +18,7 @@ private:
 
     QOpenGLContext *m_context;
     QWindow *m_surface;
-    QGLShaderProgram *m_shaderProgram;
+    QOpenGLShaderProgram *m_shaderProgram;
     QMatrix4x4 m_transformMatrix;
 
     int m_matrixLocation;
diff --git a/modules/qt_compositor.pri b/modules/qt_compositor.pri
new file mode 100644 (file)
index 0000000..eb6af77
--- /dev/null
@@ -0,0 +1,19 @@
+QT.compositor.VERSION = 5.0.0
+QT.compositor.MAJOR_VERSION = 5
+QT.compositor.MINOR_VERSION = 0
+QT.compositor.PATCH_VERSION = 0
+
+QT.compositor.name = QtCompositor
+QT.compositor.bins = $$QT_MODULE_BIN_BASE
+QT.compositor.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtCompositor
+QT.compositor.private_includes = $$QT_MODULE_INCLUDE_BASE/QtCompositor/$$QT.compositor.VERSION
+QT.compositor.sources = $$QT_MODULE_BASE/src/compositor
+QT.compositor.libs = $$QT_MODULE_LIB_BASE
+QT.compositor.plugins = $$QT_MODULE_PLUGIN_BASE
+QT.compositor.imports = $$QT_MODULE_IMPORT_BASE
+QT.compositor.depends = gui
+contains(QT_CONFIG, opengl) {
+    QT.compositor.DEFINES = QT_COMPOSITOR_WAYLAND_GL
+}
+
+QT_CONFIG += compositor
index 8feb4aa..2d56e73 100644 (file)
@@ -1,2 +1,14 @@
 TEMPLATE=subdirs
-SUBDIRS=src
+
+module_qtcompositor_src.subdir = src
+module_qtcompositor_src.target = module-module_qtcompositor_src
+
+module_qtcompositor_examples.subdir = examples
+module_qtcompositor_examples.target = module_qtcompositor_examples
+module_qtcompositor_examples.depends = module_qtcompositor_src
+!contains(QT_BUILD_PARTS,examples) {
+    module_qtcompositor_examples.CONFIG = no_default_target no_default_install
+}
+
+SUBDIRS += module_qtcompositor_src \
+           module_qtcompositor_examples \
similarity index 86%
rename from src/qt-compositor/qt-compositor.pri
rename to src/compositor/compositor.pri
index 7b421f3..de95dc4 100644 (file)
@@ -1,5 +1,9 @@
+CONFIG += module
+MODULE_PRI += $$PWD/../../modules/qt_compositor.pri
+
 INCLUDEPATH += $$PWD
 DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT
+DEFINES += QT_BUILD_COMPOSITOR_LIB
 
 !mac:use_pkgconfig {
     CONFIG += link_pkgconfig
@@ -19,6 +23,8 @@ DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT
     LIBS += -lwayland-server -lffi
 }
 
+HEADERS += qtcompositorversion.h
+
 include ($$PWD/util/util.pri)
 include ($$PWD/wayland_wrapper/wayland_wrapper.pri)
 include ($$PWD/hardware_integration/hardware_integration.pri)
diff --git a/src/compositor/compositor.pro b/src/compositor/compositor.pro
new file mode 100644 (file)
index 0000000..850e350
--- /dev/null
@@ -0,0 +1,10 @@
+load(qt_module)
+
+TARGET  = QtCompositor
+QPRO_PWD   = $$PWD
+
+include (compositor.pri)
+load(qt_module_config)
+
+QT += gui-private
+
@@ -8,14 +8,15 @@ SOURCES += \
     $$PWD/waylandcompositor.cpp \
     $$PWD/waylandsurface.cpp
 
-contains(QT, declarative) {
+QT += core-private
+
+contains(QT_CONFIG, quick) {
     SOURCES += $$PWD/waylandsurfaceitem.cpp
     HEADERS += $$PWD/waylandsurfaceitem.h
 
-   DEFINES += QT_COMPOSITOR_DECLARATIVE
-}
+    DEFINES += QT_COMPOSITOR_QUICK
 
-!isEmpty(QT.core.MAJOR_VERSION):greaterThan(QT.core.MAJOR_VERSION, 4) {
-    QT += core-private
-    contains(QT, declarative):QT += declarative-private gui-private
+    QT += quick
+    QT += quick-private gui-private
 }
+
@@ -56,7 +56,7 @@ namespace Wayland
     class Compositor;
 }
 
-class WaylandCompositor
+class Q_COMPOSITOR_EXPORT WaylandCompositor
 {
 public:
     WaylandCompositor(QWindow *window = 0, const char *socketName = 0);
@@ -59,7 +59,7 @@ class Surface;
 class SurfacePrivate;
 }
 
-class WaylandSurface : public QObject
+class Q_COMPOSITOR_EXPORT WaylandSurface : public QObject
 {
     Q_OBJECT
     Q_DECLARE_PRIVATE(WaylandSurface)
 #include "waylandsurfaceitem.h"
 #include "waylandsurface.h"
 
-#include <QtDeclarative/QSGEngine>
+#include <QtQuick/QSGEngine>
 
 #include <QtGui/QKeyEvent>
 
-#include <QtDeclarative/QSGSimpleTextureNode>
-#include <QtDeclarative/QSGSimpleRectNode>
-#include <QtDeclarative/QQuickCanvas>
+#include <QtQuick/QSGSimpleTextureNode>
+#include <QtQuick/QSGSimpleRectNode>
+#include <QtQuick/QQuickCanvas>
 
 class WaylandSurfaceTextureProvider : public QSGTextureProvider
 {
 #include <QtQuick/QQuickItem>
 #include <QtQuick/qsgtexture.h>
 
-#include <private/qsgtextureprovider_p.h>
+#include <QtQuick/private/qsgtextureprovider_p.h>
 
 class WaylandSurface;
 class WaylandSurfaceTextureProvider;
 
 Q_DECLARE_METATYPE(WaylandSurface*)
 
-class WaylandSurfaceItem : public QQuickItem
+class Q_COMPOSITOR_EXPORT WaylandSurfaceItem : public QQuickItem
 {
     Q_OBJECT
     Q_PROPERTY(WaylandSurface* surface READ surface WRITE setSurface)
@@ -13,16 +13,16 @@ isEmpty(QT_WAYLAND_GL_CONFIG):QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG)
         QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG
     } else {
         contains(QT_CONFIG, opengles2) {
-            isEqual(QT_WAYLAND_GL_CONFIG, wayland_egl) {
-                QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG
-                CONFIG += mesa_egl
-                DEFINES += MESA_EGL_NO_X11_HEADERS
+            isEqual(QT_WAYLAND_GL_CONFIG, xcomposite_egl) {
+                QT_WAYLAND_GL_INTEGRATION = xcomposite_egl
+                CONFIG += xcomposite_egl
             } else:isEqual(QT_WAYLAND_GL_CONFIG,dri2_xcb) {
                 QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG
                 CONFIG += dri2_xcb
             } else {
-                QT_WAYLAND_GL_INTEGRATION = xcomposite_egl
-                CONFIG += xcomposite_egl
+                QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG
+                CONFIG += wayland_egl
+                DEFINES += MESA_EGL_NO_X11_HEADERS
             }
         } else {
             QT_WAYLAND_GL_INTEGRATION = xcomposite_glx
@@ -34,7 +34,7 @@ isEmpty(QT_WAYLAND_GL_CONFIG):QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG)
     system(echo "Qt-Compositor configured as raster only compositor")
 }
 
-mesa_egl {
+wayland_egl {
     include (wayland_egl/wayland_egl.pri)
 }
 dri2_xcb {
diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro
new file mode 100644 (file)
index 0000000..b912e25
--- /dev/null
@@ -0,0 +1,2 @@
+TEMPLATE=subdirs
+SUBDIRS += wayland
index 20c3aa0..8b41f21 100644 (file)
@@ -10,15 +10,15 @@ SOURCES += \
 
     QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG)
     contains(QT_CONFIG, opengles2) {
-        isEqual(QT_WAYLAND_GL_CONFIG, wayland_egl) {
-            QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG
-            CONFIG += wayland_egl
+        isEqual(QT_WAYLAND_GL_CONFIG, xcomposite_egl) {
+            QT_WAYLAND_GL_INTEGRATION = xcomposite_egl
+            CONFIG += xcomposite_egl
         } else:isEqual(QT_WAYLAND_GL_CONFIG,readback) {
             QT_WAYLAND_GL_INTEGRATION = readback_egl
             CONFIG += readback_egl
         } else {
-            QT_WAYLAND_GL_INTEGRATION = xcomposite_egl
-            CONFIG += xcomposite_egl
+            QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG
+            CONFIG += wayland_egl
         }
     } else:mac {
         QT_WAYLAND_GL_INTEGRATION = readback_cgl
index 3df4cb7..6493ec0 100644 (file)
@@ -1,9 +1,10 @@
 TARGET = qwayland
 load(qt_plugin)
+load(qt_module)
 
 CONFIG += qpa/genericunixfontdatabase
 
-#DESTDIR = $$QT.gui.plugins/platforms
+DESTDIR = $$QT.gui.plugins/platforms
 
 DEFINES += Q_PLATFORM_WAYLAND
 DEFINES += $$QMAKE_DEFINES_WAYLAND
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
new file mode 100644 (file)
index 0000000..3dd6c02
--- /dev/null
@@ -0,0 +1,2 @@
+TEMPLATE=subdirs
+SUBDIRS += platforms
diff --git a/src/qt-compositor/qt-compositor.pro b/src/qt-compositor/qt-compositor.pro
deleted file mode 100644 (file)
index 0d12277..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = lib
-
-include (qt-compositor.pri)
-
-installPath = $$INSTALLBASE
-
-target.path = $$installPath/lib
-headers_path = $$installPath/include
-
-headers.path = $$headers_path/qt-compositor
-headers.files = $$HEADERS
-
-INSTALLS = target headers
-
-QT += gui-private
index d2dd7c8..81bc9ac 100644 (file)
@@ -1,2 +1,2 @@
 TEMPLATE=subdirs
-SUBDIRS=qt-compositor
+SUBDIRS += plugins compositor
diff --git a/sync.profile b/sync.profile
new file mode 100644 (file)
index 0000000..27887ee
--- /dev/null
@@ -0,0 +1,24 @@
+%modules = ( # path to module name map
+    "QtCompositor" => "$basedir/src/compositor",
+);
+%moduleheaders = ( # restrict the module headers to those found in relative path
+);
+%classnames = (
+);
+%mastercontent = (
+    "gui" => "#include <QtGui/QtGui>\n",
+);
+%modulepris = (
+    "QtCompositor" => "$basedir/modules/qt_compositor.pri",
+);
+%deprecatedheaders = (
+);
+# Module dependencies.
+# Every module that is required to build this module should have one entry.
+# Each of the module version specifiers can take one of the following values:
+#   - A specific Git revision.
+#   - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch)
+#
+%dependencies = (
+        "qtbase" => "refs/heads/master",
+);