From 4c89518228012ddc3602eab405e4b5fb8108fcdf Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B8rgen=20Lind?= Date: Mon, 5 Dec 2011 17:09:02 +0100 Subject: [PATCH] Make wayland actually a module 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 --- README | 88 +--------------------- examples/examples.pro | 6 ++ examples/qml-compositor/main.cpp | 4 +- examples/qml-compositor/qml-compositor.pro | 25 +++--- examples/qwidget-compositor-mdi/main.cpp | 2 +- examples/qwidget-compositor-mdi/qt-compositor.pro | 20 ----- examples/qwidget-compositor/qwidget-compositor.pro | 15 ++-- examples/qwindow-compositor/qwindow-compositor.pro | 16 ++-- examples/qwindow-compositor/surfacerenderer.cpp | 11 +-- examples/qwindow-compositor/surfacerenderer.h | 4 +- modules/qt_compositor.pri | 19 +++++ qtwayland.pro | 14 +++- .../compositor.pri} | 6 ++ src/compositor/compositor.pro | 10 +++ .../compositor_api/compositor_api.pri | 13 ++-- .../compositor_api/waylandcompositor.cpp | 0 .../compositor_api/waylandcompositor.h | 2 +- .../compositor_api/waylandsurface.cpp | 0 .../compositor_api/waylandsurface.h | 2 +- .../compositor_api/waylandsurfaceitem.cpp | 8 +- .../compositor_api/waylandsurfaceitem.h | 4 +- .../hardware_integration/dri2_xcb/README | 0 .../hardware_integration/dri2_xcb/dri2_xcb.pri | 0 .../dri2_xcb/dri2xcbbuffer.cpp | 0 .../hardware_integration/dri2_xcb/dri2xcbbuffer.h | 0 .../dri2_xcb/dri2xcbhwintegration.cpp | 0 .../dri2_xcb/dri2xcbhwintegration.h | 0 .../graphicshardwareintegration.cpp | 0 .../graphicshardwareintegration.h | 0 .../hardware_integration/hardware_integration.pri | 14 ++-- .../wayland_egl/wayland_egl.pri | 0 .../wayland_egl/waylandeglintegration.cpp | 0 .../wayland_egl/waylandeglintegration.h | 0 .../xcomposite_egl/xcomposite_egl.pri | 0 .../xcomposite_egl/xcompositeeglintegration.cpp | 0 .../xcomposite_egl/xcompositeeglintegration.h | 0 .../xcomposite_glx/xcomposite_glx.pri | 0 .../xcomposite_glx/xcompositeglxintegration.cpp | 0 .../xcomposite_glx/xcompositeglxintegration.h | 0 .../protocol/wayland-xcomposite.xml | 0 .../wayland-xcomposite-client-protocol.h | 0 .../xcomposite_share/wayland-xcomposite-protocol.c | 0 .../wayland-xcomposite-server-protocol.h | 0 .../xcomposite_share/xcomposite_share.pri | 0 .../xcomposite_share/xcompositebuffer.cpp | 0 .../xcomposite_share/xcompositebuffer.h | 0 .../xcomposite_share/xcompositehandler.cpp | 0 .../xcomposite_share/xcompositehandler.h | 0 .../xcomposite_share/xlibinclude.h | 0 src/{qt-compositor => compositor}/util/util.pri | 0 .../util/waylandobject.h | 0 .../wayland_wrapper/wayland_wrapper.pri | 0 .../wayland_wrapper/wlcompositor.cpp | 0 .../wayland_wrapper/wlcompositor.h | 0 .../wayland_wrapper/wldatadevice.cpp | 0 .../wayland_wrapper/wldatadevice.h | 0 .../wayland_wrapper/wldatadevicemanager.cpp | 0 .../wayland_wrapper/wldatadevicemanager.h | 0 .../wayland_wrapper/wldataoffer.cpp | 0 .../wayland_wrapper/wldataoffer.h | 0 .../wayland_wrapper/wldatasource.cpp | 0 .../wayland_wrapper/wldatasource.h | 0 .../wayland_wrapper/wldisplay.cpp | 0 .../wayland_wrapper/wldisplay.h | 0 .../wayland_wrapper/wlinputdevice.cpp | 0 .../wayland_wrapper/wlinputdevice.h | 0 .../wayland_wrapper/wloutput.cpp | 0 .../wayland_wrapper/wloutput.h | 0 .../wayland_wrapper/wlshell.cpp | 0 .../wayland_wrapper/wlshell.h | 0 .../wayland_wrapper/wlshmbuffer.cpp | 0 .../wayland_wrapper/wlshmbuffer.h | 0 .../wayland_wrapper/wlsurface.cpp | 0 .../wayland_wrapper/wlsurface.h | 0 .../wayland-windowmanager-protocol.c | 0 .../wayland-windowmanager-server-protocol.h | 0 .../waylandwindowmanagerintegration.cpp | 0 .../waylandwindowmanagerintegration.h | 0 .../windowmanagerprotocol/windowmanager.xml | 0 .../windowmanagerprotocol.pri | 0 src/plugins/platforms/platforms.pro | 2 + .../wayland/gl_integration/gl_integration.pri | 10 +-- src/plugins/platforms/wayland/wayland.pro | 3 +- src/plugins/plugins.pro | 2 + src/qt-compositor/qt-compositor.pro | 15 ---- src/src.pro | 2 +- sync.profile | 24 ++++++ 87 files changed, 155 insertions(+), 186 deletions(-) create mode 100644 examples/examples.pro delete mode 100644 examples/qwidget-compositor-mdi/qt-compositor.pro create mode 100644 modules/qt_compositor.pri rename src/{qt-compositor/qt-compositor.pri => compositor/compositor.pri} (86%) create mode 100644 src/compositor/compositor.pro rename src/{qt-compositor => compositor}/compositor_api/compositor_api.pri (52%) rename src/{qt-compositor => compositor}/compositor_api/waylandcompositor.cpp (100%) rename src/{qt-compositor => compositor}/compositor_api/waylandcompositor.h (98%) rename src/{qt-compositor => compositor}/compositor_api/waylandsurface.cpp (100%) rename src/{qt-compositor => compositor}/compositor_api/waylandsurface.h (98%) rename src/{qt-compositor => compositor}/compositor_api/waylandsurfaceitem.cpp (98%) rename src/{qt-compositor => compositor}/compositor_api/waylandsurfaceitem.h (97%) rename src/{qt-compositor => compositor}/hardware_integration/dri2_xcb/README (100%) rename src/{qt-compositor => compositor}/hardware_integration/dri2_xcb/dri2_xcb.pri (100%) rename src/{qt-compositor => compositor}/hardware_integration/dri2_xcb/dri2xcbbuffer.cpp (100%) rename src/{qt-compositor => compositor}/hardware_integration/dri2_xcb/dri2xcbbuffer.h (100%) rename src/{qt-compositor => compositor}/hardware_integration/dri2_xcb/dri2xcbhwintegration.cpp (100%) rename src/{qt-compositor => compositor}/hardware_integration/dri2_xcb/dri2xcbhwintegration.h (100%) rename src/{qt-compositor => compositor}/hardware_integration/graphicshardwareintegration.cpp (100%) rename src/{qt-compositor => compositor}/hardware_integration/graphicshardwareintegration.h (100%) rename src/{qt-compositor => compositor}/hardware_integration/hardware_integration.pri (92%) rename src/{qt-compositor => compositor}/hardware_integration/wayland_egl/wayland_egl.pri (100%) rename src/{qt-compositor => compositor}/hardware_integration/wayland_egl/waylandeglintegration.cpp (100%) rename src/{qt-compositor => compositor}/hardware_integration/wayland_egl/waylandeglintegration.h (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_egl/xcomposite_egl.pri (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_egl/xcompositeeglintegration.cpp (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_egl/xcompositeeglintegration.h (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_glx/xcomposite_glx.pri (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_glx/xcompositeglxintegration.cpp (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_glx/xcompositeglxintegration.h (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_share/protocol/wayland-xcomposite.xml (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_share/wayland-xcomposite-protocol.c (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_share/wayland-xcomposite-server-protocol.h (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_share/xcomposite_share.pri (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_share/xcompositebuffer.cpp (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_share/xcompositebuffer.h (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_share/xcompositehandler.cpp (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_share/xcompositehandler.h (100%) rename src/{qt-compositor => compositor}/hardware_integration/xcomposite_share/xlibinclude.h (100%) rename src/{qt-compositor => compositor}/util/util.pri (100%) rename src/{qt-compositor => compositor}/util/waylandobject.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wayland_wrapper.pri (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wlcompositor.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wlcompositor.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wldatadevice.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wldatadevice.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wldatadevicemanager.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wldatadevicemanager.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wldataoffer.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wldataoffer.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wldatasource.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wldatasource.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wldisplay.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wldisplay.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wlinputdevice.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wlinputdevice.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wloutput.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wloutput.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wlshell.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wlshell.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wlshmbuffer.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wlshmbuffer.h (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wlsurface.cpp (100%) rename src/{qt-compositor => compositor}/wayland_wrapper/wlsurface.h (100%) rename src/{qt-compositor => compositor}/windowmanagerprotocol/wayland-windowmanager-protocol.c (100%) rename src/{qt-compositor => compositor}/windowmanagerprotocol/wayland-windowmanager-server-protocol.h (100%) rename src/{qt-compositor => compositor}/windowmanagerprotocol/waylandwindowmanagerintegration.cpp (100%) rename src/{qt-compositor => compositor}/windowmanagerprotocol/waylandwindowmanagerintegration.h (100%) rename src/{qt-compositor => compositor}/windowmanagerprotocol/windowmanager.xml (100%) rename src/{qt-compositor => compositor}/windowmanagerprotocol/windowmanagerprotocol.pri (100%) create mode 100644 src/plugins/platforms/platforms.pro create mode 100644 src/plugins/plugins.pro delete mode 100644 src/qt-compositor/qt-compositor.pro create mode 100644 sync.profile diff --git a/README b/README index ce4bc7c..3247a25 100644 --- 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 index 0000000..5c75789 --- /dev/null +++ b/examples/examples.pro @@ -0,0 +1,6 @@ +TEMPLATE=subdirs +SUBDIRS += qwidget-compositor qwidget-compositor-mdi qwindow-compositor + +contains(QT_CONFIG, quick) { + SUBDIRS += qml-compositor +} diff --git a/examples/qml-compositor/main.cpp b/examples/qml-compositor/main.cpp index 7f2d47b..0bd0943 100644 --- a/examples/qml-compositor/main.cpp +++ b/examples/qml-compositor/main.cpp @@ -42,7 +42,7 @@ #include "waylandsurface.h" #include "waylandsurfaceitem.h" -#include +#include #include #include #include @@ -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")); diff --git a/examples/qml-compositor/qml-compositor.pro b/examples/qml-compositor/qml-compositor.pro index aea2fdc..0295ded 100644 --- a/examples/qml-compositor/qml-compositor.pro +++ b/examples/qml-compositor/qml-compositor.pro @@ -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 diff --git a/examples/qwidget-compositor-mdi/main.cpp b/examples/qwidget-compositor-mdi/main.cpp index 752014a..062669d 100644 --- a/examples/qwidget-compositor-mdi/main.cpp +++ b/examples/qwidget-compositor-mdi/main.cpp @@ -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 index 3cd110b..0000000 --- a/examples/qwidget-compositor-mdi/qt-compositor.pro +++ /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 diff --git a/examples/qwidget-compositor/qwidget-compositor.pro b/examples/qwidget-compositor/qwidget-compositor.pro index 98bcb0c..409930a 100644 --- a/examples/qwidget-compositor/qwidget-compositor.pro +++ b/examples/qwidget-compositor/qwidget-compositor.pro @@ -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 diff --git a/examples/qwindow-compositor/qwindow-compositor.pro b/examples/qwindow-compositor/qwindow-compositor.pro index 79f318a..e154ad9 100644 --- a/examples/qwindow-compositor/qwindow-compositor.pro +++ b/examples/qwindow-compositor/qwindow-compositor.pro @@ -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 diff --git a/examples/qwindow-compositor/surfacerenderer.cpp b/examples/qwindow-compositor/surfacerenderer.cpp index 42af697..f160a3a 100644 --- a/examples/qwindow-compositor/surfacerenderer.cpp +++ b/examples/qwindow-compositor/surfacerenderer.cpp @@ -1,6 +1,7 @@ #include "surfacerenderer.h" #include +#include 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); diff --git a/examples/qwindow-compositor/surfacerenderer.h b/examples/qwindow-compositor/surfacerenderer.h index d2e03a4..abfb554 100644 --- a/examples/qwindow-compositor/surfacerenderer.h +++ b/examples/qwindow-compositor/surfacerenderer.h @@ -2,7 +2,7 @@ #define SURFACERENDERER_H #include -#include +#include #include 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 index 0000000..eb6af77 --- /dev/null +++ b/modules/qt_compositor.pri @@ -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 diff --git a/qtwayland.pro b/qtwayland.pro index 8feb4aa..2d56e73 100644 --- a/qtwayland.pro +++ b/qtwayland.pro @@ -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 \ diff --git a/src/qt-compositor/qt-compositor.pri b/src/compositor/compositor.pri similarity index 86% rename from src/qt-compositor/qt-compositor.pri rename to src/compositor/compositor.pri index 7b421f3..de95dc4 100644 --- a/src/qt-compositor/qt-compositor.pri +++ b/src/compositor/compositor.pri @@ -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 index 0000000..850e350 --- /dev/null +++ b/src/compositor/compositor.pro @@ -0,0 +1,10 @@ +load(qt_module) + +TARGET = QtCompositor +QPRO_PWD = $$PWD + +include (compositor.pri) +load(qt_module_config) + +QT += gui-private + diff --git a/src/qt-compositor/compositor_api/compositor_api.pri b/src/compositor/compositor_api/compositor_api.pri similarity index 52% rename from src/qt-compositor/compositor_api/compositor_api.pri rename to src/compositor/compositor_api/compositor_api.pri index 1072662..374c774 100644 --- a/src/qt-compositor/compositor_api/compositor_api.pri +++ b/src/compositor/compositor_api/compositor_api.pri @@ -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 } + diff --git a/src/qt-compositor/compositor_api/waylandcompositor.cpp b/src/compositor/compositor_api/waylandcompositor.cpp similarity index 100% rename from src/qt-compositor/compositor_api/waylandcompositor.cpp rename to src/compositor/compositor_api/waylandcompositor.cpp diff --git a/src/qt-compositor/compositor_api/waylandcompositor.h b/src/compositor/compositor_api/waylandcompositor.h similarity index 98% rename from src/qt-compositor/compositor_api/waylandcompositor.h rename to src/compositor/compositor_api/waylandcompositor.h index 06d8ec7..557aa6c 100644 --- a/src/qt-compositor/compositor_api/waylandcompositor.h +++ b/src/compositor/compositor_api/waylandcompositor.h @@ -56,7 +56,7 @@ namespace Wayland class Compositor; } -class WaylandCompositor +class Q_COMPOSITOR_EXPORT WaylandCompositor { public: WaylandCompositor(QWindow *window = 0, const char *socketName = 0); diff --git a/src/qt-compositor/compositor_api/waylandsurface.cpp b/src/compositor/compositor_api/waylandsurface.cpp similarity index 100% rename from src/qt-compositor/compositor_api/waylandsurface.cpp rename to src/compositor/compositor_api/waylandsurface.cpp diff --git a/src/qt-compositor/compositor_api/waylandsurface.h b/src/compositor/compositor_api/waylandsurface.h similarity index 98% rename from src/qt-compositor/compositor_api/waylandsurface.h rename to src/compositor/compositor_api/waylandsurface.h index fb2e172..d9f68d7 100644 --- a/src/qt-compositor/compositor_api/waylandsurface.h +++ b/src/compositor/compositor_api/waylandsurface.h @@ -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) diff --git a/src/qt-compositor/compositor_api/waylandsurfaceitem.cpp b/src/compositor/compositor_api/waylandsurfaceitem.cpp similarity index 98% rename from src/qt-compositor/compositor_api/waylandsurfaceitem.cpp rename to src/compositor/compositor_api/waylandsurfaceitem.cpp index bf91499..0de4f98 100644 --- a/src/qt-compositor/compositor_api/waylandsurfaceitem.cpp +++ b/src/compositor/compositor_api/waylandsurfaceitem.cpp @@ -41,13 +41,13 @@ #include "waylandsurfaceitem.h" #include "waylandsurface.h" -#include +#include #include -#include -#include -#include +#include +#include +#include class WaylandSurfaceTextureProvider : public QSGTextureProvider { diff --git a/src/qt-compositor/compositor_api/waylandsurfaceitem.h b/src/compositor/compositor_api/waylandsurfaceitem.h similarity index 97% rename from src/qt-compositor/compositor_api/waylandsurfaceitem.h rename to src/compositor/compositor_api/waylandsurfaceitem.h index 78fcd0c..a66a2ce 100644 --- a/src/qt-compositor/compositor_api/waylandsurfaceitem.h +++ b/src/compositor/compositor_api/waylandsurfaceitem.h @@ -46,14 +46,14 @@ #include #include -#include +#include 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) diff --git a/src/qt-compositor/hardware_integration/dri2_xcb/README b/src/compositor/hardware_integration/dri2_xcb/README similarity index 100% rename from src/qt-compositor/hardware_integration/dri2_xcb/README rename to src/compositor/hardware_integration/dri2_xcb/README diff --git a/src/qt-compositor/hardware_integration/dri2_xcb/dri2_xcb.pri b/src/compositor/hardware_integration/dri2_xcb/dri2_xcb.pri similarity index 100% rename from src/qt-compositor/hardware_integration/dri2_xcb/dri2_xcb.pri rename to src/compositor/hardware_integration/dri2_xcb/dri2_xcb.pri diff --git a/src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.cpp b/src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.cpp similarity index 100% rename from src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.cpp rename to src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.cpp diff --git a/src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.h b/src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.h similarity index 100% rename from src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.h rename to src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.h diff --git a/src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.cpp b/src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.cpp similarity index 100% rename from src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.cpp rename to src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.cpp diff --git a/src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.h b/src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.h similarity index 100% rename from src/qt-compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.h rename to src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.h diff --git a/src/qt-compositor/hardware_integration/graphicshardwareintegration.cpp b/src/compositor/hardware_integration/graphicshardwareintegration.cpp similarity index 100% rename from src/qt-compositor/hardware_integration/graphicshardwareintegration.cpp rename to src/compositor/hardware_integration/graphicshardwareintegration.cpp diff --git a/src/qt-compositor/hardware_integration/graphicshardwareintegration.h b/src/compositor/hardware_integration/graphicshardwareintegration.h similarity index 100% rename from src/qt-compositor/hardware_integration/graphicshardwareintegration.h rename to src/compositor/hardware_integration/graphicshardwareintegration.h diff --git a/src/qt-compositor/hardware_integration/hardware_integration.pri b/src/compositor/hardware_integration/hardware_integration.pri similarity index 92% rename from src/qt-compositor/hardware_integration/hardware_integration.pri rename to src/compositor/hardware_integration/hardware_integration.pri index 02a834b..6e65ea9 100644 --- a/src/qt-compositor/hardware_integration/hardware_integration.pri +++ b/src/compositor/hardware_integration/hardware_integration.pri @@ -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/qt-compositor/hardware_integration/wayland_egl/wayland_egl.pri b/src/compositor/hardware_integration/wayland_egl/wayland_egl.pri similarity index 100% rename from src/qt-compositor/hardware_integration/wayland_egl/wayland_egl.pri rename to src/compositor/hardware_integration/wayland_egl/wayland_egl.pri diff --git a/src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp b/src/compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp similarity index 100% rename from src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp rename to src/compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp diff --git a/src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.h b/src/compositor/hardware_integration/wayland_egl/waylandeglintegration.h similarity index 100% rename from src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.h rename to src/compositor/hardware_integration/wayland_egl/waylandeglintegration.h diff --git a/src/qt-compositor/hardware_integration/xcomposite_egl/xcomposite_egl.pri b/src/compositor/hardware_integration/xcomposite_egl/xcomposite_egl.pri similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_egl/xcomposite_egl.pri rename to src/compositor/hardware_integration/xcomposite_egl/xcomposite_egl.pri diff --git a/src/qt-compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.cpp b/src/compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.cpp similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.cpp rename to src/compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.cpp diff --git a/src/qt-compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.h b/src/compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.h similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.h rename to src/compositor/hardware_integration/xcomposite_egl/xcompositeeglintegration.h diff --git a/src/qt-compositor/hardware_integration/xcomposite_glx/xcomposite_glx.pri b/src/compositor/hardware_integration/xcomposite_glx/xcomposite_glx.pri similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_glx/xcomposite_glx.pri rename to src/compositor/hardware_integration/xcomposite_glx/xcomposite_glx.pri diff --git a/src/qt-compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.cpp b/src/compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.cpp similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.cpp rename to src/compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.cpp diff --git a/src/qt-compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.h b/src/compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.h similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.h rename to src/compositor/hardware_integration/xcomposite_glx/xcompositeglxintegration.h diff --git a/src/qt-compositor/hardware_integration/xcomposite_share/protocol/wayland-xcomposite.xml b/src/compositor/hardware_integration/xcomposite_share/protocol/wayland-xcomposite.xml similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_share/protocol/wayland-xcomposite.xml rename to src/compositor/hardware_integration/xcomposite_share/protocol/wayland-xcomposite.xml diff --git a/src/qt-compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h b/src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h rename to src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-client-protocol.h diff --git a/src/qt-compositor/hardware_integration/xcomposite_share/wayland-xcomposite-protocol.c b/src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-protocol.c similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_share/wayland-xcomposite-protocol.c rename to src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-protocol.c diff --git a/src/qt-compositor/hardware_integration/xcomposite_share/wayland-xcomposite-server-protocol.h b/src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-server-protocol.h similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_share/wayland-xcomposite-server-protocol.h rename to src/compositor/hardware_integration/xcomposite_share/wayland-xcomposite-server-protocol.h diff --git a/src/qt-compositor/hardware_integration/xcomposite_share/xcomposite_share.pri b/src/compositor/hardware_integration/xcomposite_share/xcomposite_share.pri similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_share/xcomposite_share.pri rename to src/compositor/hardware_integration/xcomposite_share/xcomposite_share.pri diff --git a/src/qt-compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp b/src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp rename to src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp diff --git a/src/qt-compositor/hardware_integration/xcomposite_share/xcompositebuffer.h b/src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.h similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_share/xcompositebuffer.h rename to src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.h diff --git a/src/qt-compositor/hardware_integration/xcomposite_share/xcompositehandler.cpp b/src/compositor/hardware_integration/xcomposite_share/xcompositehandler.cpp similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_share/xcompositehandler.cpp rename to src/compositor/hardware_integration/xcomposite_share/xcompositehandler.cpp diff --git a/src/qt-compositor/hardware_integration/xcomposite_share/xcompositehandler.h b/src/compositor/hardware_integration/xcomposite_share/xcompositehandler.h similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_share/xcompositehandler.h rename to src/compositor/hardware_integration/xcomposite_share/xcompositehandler.h diff --git a/src/qt-compositor/hardware_integration/xcomposite_share/xlibinclude.h b/src/compositor/hardware_integration/xcomposite_share/xlibinclude.h similarity index 100% rename from src/qt-compositor/hardware_integration/xcomposite_share/xlibinclude.h rename to src/compositor/hardware_integration/xcomposite_share/xlibinclude.h diff --git a/src/qt-compositor/util/util.pri b/src/compositor/util/util.pri similarity index 100% rename from src/qt-compositor/util/util.pri rename to src/compositor/util/util.pri diff --git a/src/qt-compositor/util/waylandobject.h b/src/compositor/util/waylandobject.h similarity index 100% rename from src/qt-compositor/util/waylandobject.h rename to src/compositor/util/waylandobject.h diff --git a/src/qt-compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri similarity index 100% rename from src/qt-compositor/wayland_wrapper/wayland_wrapper.pri rename to src/compositor/wayland_wrapper/wayland_wrapper.pri diff --git a/src/qt-compositor/wayland_wrapper/wlcompositor.cpp b/src/compositor/wayland_wrapper/wlcompositor.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wlcompositor.cpp rename to src/compositor/wayland_wrapper/wlcompositor.cpp diff --git a/src/qt-compositor/wayland_wrapper/wlcompositor.h b/src/compositor/wayland_wrapper/wlcompositor.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wlcompositor.h rename to src/compositor/wayland_wrapper/wlcompositor.h diff --git a/src/qt-compositor/wayland_wrapper/wldatadevice.cpp b/src/compositor/wayland_wrapper/wldatadevice.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wldatadevice.cpp rename to src/compositor/wayland_wrapper/wldatadevice.cpp diff --git a/src/qt-compositor/wayland_wrapper/wldatadevice.h b/src/compositor/wayland_wrapper/wldatadevice.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wldatadevice.h rename to src/compositor/wayland_wrapper/wldatadevice.h diff --git a/src/qt-compositor/wayland_wrapper/wldatadevicemanager.cpp b/src/compositor/wayland_wrapper/wldatadevicemanager.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wldatadevicemanager.cpp rename to src/compositor/wayland_wrapper/wldatadevicemanager.cpp diff --git a/src/qt-compositor/wayland_wrapper/wldatadevicemanager.h b/src/compositor/wayland_wrapper/wldatadevicemanager.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wldatadevicemanager.h rename to src/compositor/wayland_wrapper/wldatadevicemanager.h diff --git a/src/qt-compositor/wayland_wrapper/wldataoffer.cpp b/src/compositor/wayland_wrapper/wldataoffer.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wldataoffer.cpp rename to src/compositor/wayland_wrapper/wldataoffer.cpp diff --git a/src/qt-compositor/wayland_wrapper/wldataoffer.h b/src/compositor/wayland_wrapper/wldataoffer.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wldataoffer.h rename to src/compositor/wayland_wrapper/wldataoffer.h diff --git a/src/qt-compositor/wayland_wrapper/wldatasource.cpp b/src/compositor/wayland_wrapper/wldatasource.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wldatasource.cpp rename to src/compositor/wayland_wrapper/wldatasource.cpp diff --git a/src/qt-compositor/wayland_wrapper/wldatasource.h b/src/compositor/wayland_wrapper/wldatasource.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wldatasource.h rename to src/compositor/wayland_wrapper/wldatasource.h diff --git a/src/qt-compositor/wayland_wrapper/wldisplay.cpp b/src/compositor/wayland_wrapper/wldisplay.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wldisplay.cpp rename to src/compositor/wayland_wrapper/wldisplay.cpp diff --git a/src/qt-compositor/wayland_wrapper/wldisplay.h b/src/compositor/wayland_wrapper/wldisplay.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wldisplay.h rename to src/compositor/wayland_wrapper/wldisplay.h diff --git a/src/qt-compositor/wayland_wrapper/wlinputdevice.cpp b/src/compositor/wayland_wrapper/wlinputdevice.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wlinputdevice.cpp rename to src/compositor/wayland_wrapper/wlinputdevice.cpp diff --git a/src/qt-compositor/wayland_wrapper/wlinputdevice.h b/src/compositor/wayland_wrapper/wlinputdevice.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wlinputdevice.h rename to src/compositor/wayland_wrapper/wlinputdevice.h diff --git a/src/qt-compositor/wayland_wrapper/wloutput.cpp b/src/compositor/wayland_wrapper/wloutput.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wloutput.cpp rename to src/compositor/wayland_wrapper/wloutput.cpp diff --git a/src/qt-compositor/wayland_wrapper/wloutput.h b/src/compositor/wayland_wrapper/wloutput.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wloutput.h rename to src/compositor/wayland_wrapper/wloutput.h diff --git a/src/qt-compositor/wayland_wrapper/wlshell.cpp b/src/compositor/wayland_wrapper/wlshell.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wlshell.cpp rename to src/compositor/wayland_wrapper/wlshell.cpp diff --git a/src/qt-compositor/wayland_wrapper/wlshell.h b/src/compositor/wayland_wrapper/wlshell.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wlshell.h rename to src/compositor/wayland_wrapper/wlshell.h diff --git a/src/qt-compositor/wayland_wrapper/wlshmbuffer.cpp b/src/compositor/wayland_wrapper/wlshmbuffer.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wlshmbuffer.cpp rename to src/compositor/wayland_wrapper/wlshmbuffer.cpp diff --git a/src/qt-compositor/wayland_wrapper/wlshmbuffer.h b/src/compositor/wayland_wrapper/wlshmbuffer.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wlshmbuffer.h rename to src/compositor/wayland_wrapper/wlshmbuffer.h diff --git a/src/qt-compositor/wayland_wrapper/wlsurface.cpp b/src/compositor/wayland_wrapper/wlsurface.cpp similarity index 100% rename from src/qt-compositor/wayland_wrapper/wlsurface.cpp rename to src/compositor/wayland_wrapper/wlsurface.cpp diff --git a/src/qt-compositor/wayland_wrapper/wlsurface.h b/src/compositor/wayland_wrapper/wlsurface.h similarity index 100% rename from src/qt-compositor/wayland_wrapper/wlsurface.h rename to src/compositor/wayland_wrapper/wlsurface.h diff --git a/src/qt-compositor/windowmanagerprotocol/wayland-windowmanager-protocol.c b/src/compositor/windowmanagerprotocol/wayland-windowmanager-protocol.c similarity index 100% rename from src/qt-compositor/windowmanagerprotocol/wayland-windowmanager-protocol.c rename to src/compositor/windowmanagerprotocol/wayland-windowmanager-protocol.c diff --git a/src/qt-compositor/windowmanagerprotocol/wayland-windowmanager-server-protocol.h b/src/compositor/windowmanagerprotocol/wayland-windowmanager-server-protocol.h similarity index 100% rename from src/qt-compositor/windowmanagerprotocol/wayland-windowmanager-server-protocol.h rename to src/compositor/windowmanagerprotocol/wayland-windowmanager-server-protocol.h diff --git a/src/qt-compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp b/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp similarity index 100% rename from src/qt-compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp rename to src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp diff --git a/src/qt-compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h b/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h similarity index 100% rename from src/qt-compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h rename to src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h diff --git a/src/qt-compositor/windowmanagerprotocol/windowmanager.xml b/src/compositor/windowmanagerprotocol/windowmanager.xml similarity index 100% rename from src/qt-compositor/windowmanagerprotocol/windowmanager.xml rename to src/compositor/windowmanagerprotocol/windowmanager.xml diff --git a/src/qt-compositor/windowmanagerprotocol/windowmanagerprotocol.pri b/src/compositor/windowmanagerprotocol/windowmanagerprotocol.pri similarity index 100% rename from src/qt-compositor/windowmanagerprotocol/windowmanagerprotocol.pri rename to src/compositor/windowmanagerprotocol/windowmanagerprotocol.pri diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro new file mode 100644 index 0000000..b912e25 --- /dev/null +++ b/src/plugins/platforms/platforms.pro @@ -0,0 +1,2 @@ +TEMPLATE=subdirs +SUBDIRS += wayland diff --git a/src/plugins/platforms/wayland/gl_integration/gl_integration.pri b/src/plugins/platforms/wayland/gl_integration/gl_integration.pri index 20c3aa0..8b41f21 100644 --- a/src/plugins/platforms/wayland/gl_integration/gl_integration.pri +++ b/src/plugins/platforms/wayland/gl_integration/gl_integration.pri @@ -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 diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro index 3df4cb7..6493ec0 100644 --- a/src/plugins/platforms/wayland/wayland.pro +++ b/src/plugins/platforms/wayland/wayland.pro @@ -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 index 0000000..3dd6c02 --- /dev/null +++ b/src/plugins/plugins.pro @@ -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 index 0d12277..0000000 --- a/src/qt-compositor/qt-compositor.pro +++ /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 diff --git a/src/src.pro b/src/src.pro index d2dd7c8..81bc9ac 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,2 +1,2 @@ TEMPLATE=subdirs -SUBDIRS=qt-compositor +SUBDIRS += plugins compositor diff --git a/sync.profile b/sync.profile new file mode 100644 index 0000000..27887ee --- /dev/null +++ b/sync.profile @@ -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 \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", +); -- 2.7.4