From 255371252bdad3cd370ccf95337c94baae7277a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= <jorgen.lind@nokia.com> Date: Fri, 23 Apr 2010 08:38:44 +0200 Subject: Porting openkode platform plugin to new api --- src/plugins/platforms/openkode/frag.glslf | 8 - src/plugins/platforms/openkode/frag.h | 37 --- src/plugins/platforms/openkode/main.cpp | 16 +- src/plugins/platforms/openkode/openkode.pro | 22 +- .../openkode/qgraphicssystem_openkode.cpp | 236 ------------------ .../platforms/openkode/qgraphicssystem_openkode.h | 95 -------- .../platforms/openkode/qopenkodeintegration.cpp | 227 ++++++++++++++++++ .../platforms/openkode/qopenkodeintegration.h | 95 ++++++++ src/plugins/platforms/openkode/qopenkodewindow.cpp | 114 +++++++++ src/plugins/platforms/openkode/qopenkodewindow.h | 63 +++++ .../platforms/openkode/qopenkodewindowsurface.cpp | 187 +++++++++++++++ .../platforms/openkode/qopenkodewindowsurface.h | 75 ++++++ .../platforms/openkode/qwindowsurface_openkode.cpp | 265 --------------------- .../platforms/openkode/qwindowsurface_openkode.h | 79 ------ src/plugins/platforms/openkode/resources.qrc | 6 + src/plugins/platforms/openkode/shaders/frag.glslf | 8 + src/plugins/platforms/openkode/shaders/vert.glslv | 14 ++ src/plugins/platforms/openkode/vert.glslv | 14 -- src/plugins/platforms/openkode/vert.h | 63 ----- 19 files changed, 811 insertions(+), 813 deletions(-) delete mode 100644 src/plugins/platforms/openkode/frag.glslf delete mode 100644 src/plugins/platforms/openkode/frag.h delete mode 100644 src/plugins/platforms/openkode/qgraphicssystem_openkode.cpp delete mode 100644 src/plugins/platforms/openkode/qgraphicssystem_openkode.h create mode 100644 src/plugins/platforms/openkode/qopenkodeintegration.cpp create mode 100644 src/plugins/platforms/openkode/qopenkodeintegration.h create mode 100644 src/plugins/platforms/openkode/qopenkodewindow.cpp create mode 100644 src/plugins/platforms/openkode/qopenkodewindow.h create mode 100644 src/plugins/platforms/openkode/qopenkodewindowsurface.cpp create mode 100644 src/plugins/platforms/openkode/qopenkodewindowsurface.h delete mode 100644 src/plugins/platforms/openkode/qwindowsurface_openkode.cpp delete mode 100644 src/plugins/platforms/openkode/qwindowsurface_openkode.h create mode 100644 src/plugins/platforms/openkode/resources.qrc create mode 100644 src/plugins/platforms/openkode/shaders/frag.glslf create mode 100644 src/plugins/platforms/openkode/shaders/vert.glslv delete mode 100644 src/plugins/platforms/openkode/vert.glslv delete mode 100644 src/plugins/platforms/openkode/vert.h diff --git a/src/plugins/platforms/openkode/frag.glslf b/src/plugins/platforms/openkode/frag.glslf deleted file mode 100644 index a593434..0000000 --- a/src/plugins/platforms/openkode/frag.glslf +++ /dev/null @@ -1,8 +0,0 @@ -uniform sampler2D tex_samp; - -varying vec2 texcoord_var; - -void main() -{ - gl_FragColor = texture2D(tex_samp, texcoord_var); -} diff --git a/src/plugins/platforms/openkode/frag.h b/src/plugins/platforms/openkode/frag.h deleted file mode 100644 index 6575cb5..0000000 --- a/src/plugins/platforms/openkode/frag.h +++ /dev/null @@ -1,37 +0,0 @@ -0x4e,0x56,0x75,0x63,0x01,0x00,0x00,0x00,0x09,0x00,0x06,0x00,0x06,0x00,0x50,0x00, -0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x50,0x02,0x00,0x00,0x00,0x00,0x00,0x00, -0x03,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x27,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x50,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0xe8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x0b,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x70,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x01,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x90,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x11,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xb0,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x12,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x2b,0x00,0x00,0x00,0x7a,0x00,0x00,0x00,0xd0,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x2c,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x03,0x68,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, -0x00,0x00,0x00,0x80,0x04,0x00,0x00,0x90,0x00,0x02,0x01,0x82,0x04,0x02,0x02,0x82, -0x01,0x00,0x40,0xf6,0x85,0xc7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x30,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x02,0x00,0x00,0x00,0x00,0x00,0x00, -0x3a,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x2a,0x00,0x06,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0x3b,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x02,0x00,0x00,0x00,0x00,0x00,0x00, -0x49,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x26,0x00,0x04,0x00,0x00,0x00, -0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0x00,0x74,0x65,0x78,0x5f,0x73,0x61,0x6d,0x70,0x00,0x00,0x00,0x74,0x65,0x78,0x63, -0x6f,0x6f,0x72,0x64,0x5f,0x76,0x61,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 diff --git a/src/plugins/platforms/openkode/main.cpp b/src/plugins/platforms/openkode/main.cpp index e9c1083..bd2b5c7 100644 --- a/src/plugins/platforms/openkode/main.cpp +++ b/src/plugins/platforms/openkode/main.cpp @@ -39,33 +39,33 @@ ** ****************************************************************************/ -#include <private/qgraphicssystemplugin_p.h> -#include "qgraphicssystem_openkode.h" +#include <QtGui/QPlatformIntegrationPlugin> +#include "qopenkodeintegration.h" QT_BEGIN_NAMESPACE -class QOpenKODEGraphicsSystemPlugin : public QGraphicsSystemPlugin +class QOpenKODEPlugin : public QPlatformIntegrationPlugin { public: QStringList keys() const; - QGraphicsSystem *create(const QString&); + QPlatformIntegration *create(const QString&); }; -QStringList QOpenKODEGraphicsSystemPlugin::keys() const +QStringList QOpenKODEPlugin::keys() const { QStringList list; list << "OpenKODE"; return list; } -QGraphicsSystem* QOpenKODEGraphicsSystemPlugin::create(const QString& system) +QPlatformIntegration * QOpenKODEPlugin::create(const QString& system) { if (system.toLower() == "openkode") - return new QOpenKODEGraphicsSystem; + return new QOpenKODEIntegration; return 0; } -Q_EXPORT_PLUGIN2(openkode, QOpenKODEGraphicsSystemPlugin) +Q_EXPORT_PLUGIN2(openkode, QOpenKODEPlugin) QT_END_NAMESPACE diff --git a/src/plugins/platforms/openkode/openkode.pro b/src/plugins/platforms/openkode/openkode.pro index 055048d..042b74d 100644 --- a/src/plugins/platforms/openkode/openkode.pro +++ b/src/plugins/platforms/openkode/openkode.pro @@ -1,14 +1,20 @@ -TARGET = qopenkodegraphicssystem +TARGET = qopenkodeintegration include(../../qpluginbase.pri) -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/graphicssystems +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms -SOURCES = main.cpp qgraphicssystem_openkode.cpp qwindowsurface_openkode.cpp -HEADERS = qgraphicssystem_openkode.h qwindowsurface_openkode.h +SOURCES = main.cpp \ + qopenkodeintegration.cpp \ + qopenkodewindowsurface.cpp \ + qopenkodewindow.cpp -target.path += $$[QT_INSTALL_PLUGINS]/graphicssystems +HEADERS = qopenkodeintegration.h \ + qopenkodewindowsurface.h \ + qopenkodewindow.h + +RESOURCES = resources.qrc + +target.path += $$[QT_INSTALL_PLUGINS]/platforms INSTALLS += target -# openkode specific stuff -INCLUDEPATH += $(OPENKODE_DIR)/include -LIBS += $${QMAKE_RPATH}/$(OPENKODE_DIR)/lib-target -L$(OPENKODE_DIR)/lib-target -lKD -lEGL -lGLESv2 +LIBS += -lKD -lEGL -lGLESv2 diff --git a/src/plugins/platforms/openkode/qgraphicssystem_openkode.cpp b/src/plugins/platforms/openkode/qgraphicssystem_openkode.cpp deleted file mode 100644 index 7a07776..0000000 --- a/src/plugins/platforms/openkode/qgraphicssystem_openkode.cpp +++ /dev/null @@ -1,236 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins 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 either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qgraphicssystem_openkode.h" -#include "qwindowsurface_openkode.h" -#include <QtGui/private/qpixmap_raster_p.h> - -#include <QtCore/qdebug.h> -#include <QtCore/qthread.h> - -#include <KD/kd.h> -#include <KD/NV_display.h> -#include <KD/NV_initialize.h> - -#include "GLES2/gl2ext.h" - - -QT_BEGIN_NAMESPACE - -QOpenKODEGraphicsSystemScreen::QOpenKODEGraphicsSystemScreen() -{ - KDDesktopNV *kdDesktop = KD_NULL; - KDDisplayNV *kdDisplay = KD_NULL; - - qDebug() << "QOpenKODEGraphicsSystemScreen::QOpenKODEGraphicsSystemScreen()"; - - // Get the default desktop and display - kdDesktop = kdGetDesktopNV(KD_DEFAULT_DESKTOP_NV, KD_NULL); - if (!kdDesktop || kdDesktop == (void*)-1) { - qErrnoWarning(kdGetError(), "Could not obtain KDDesktopNV pointer"); - return; - } - - kdDisplay = kdGetDisplayNV(KD_DEFAULT_DISPLAY_NV, KD_NULL); - if (!kdDisplay || kdDisplay == (void*)-1) { - qErrnoWarning(kdGetError(), "Could not obtain KDDisplayNV pointer"); - kdReleaseDesktopNV(kdDesktop); - return; - } - - KDDisplayModeNV mode; - if (kdGetDisplayModeNV(kdDisplay, &mode)) { - qErrnoWarning(kdGetError(), "Could not get display mode"); - return; - } - - qDebug() << " - display mode " << mode.width << "x" << mode.height << " refresh " << mode.refresh; - - KDint desktopSize[] = { mode.width, mode.height }; - - if (kdSetDesktopPropertyivNV(kdDesktop, KD_DESKTOPPROPERTY_SIZE_NV, desktopSize)) { - qErrnoWarning(kdGetError(), "Could not set desktop size"); - return; - } - - // Once we've set up the desktop and display we don't need them anymore - kdReleaseDisplayNV(kdDisplay); - kdReleaseDesktopNV(kdDesktop); - - const int defaultDpi = 72; - mGeometry = QRect(0, 0, mode.width, mode.height); - mPhysicalSize = QSize(mode.width * 25.4 / defaultDpi, mode.height * 25.4 / defaultDpi); - - mDepth = 24; - mFormat = QImage::Format_RGB888; - - - QEglProperties properties; - properties.setPixelFormat(QImage::Format_RGB888); - properties.setValue(EGL_BUFFER_SIZE, EGL_DONT_CARE); - properties.setRenderableType(QEgl::OpenGL); - - if (!mContext.chooseConfig(properties, QEgl::BestPixelFormat)) { - qWarning("qEglContext: Unable to choose config!"); - return; - } - - if (!mContext.display()) { - qWarning("qEglContext: Unable to open display!"); - return; - } - - qDebug() << " - QEglContext::openDisplay OK"; -} - -static GLuint NvKdTestLoadShaders(const char *vertex_shader_binary, - const char *fragment_shader_binary, - GLuint vertex_shader_binary_size, - GLuint fragment_shader_binary_size) -{ - GLuint prog; - GLuint vertShader; - GLuint fragShader; - - // Create the program - prog = glCreateProgram(); - - // Create the GL shader objects - vertShader = glCreateShader(GL_VERTEX_SHADER); - fragShader = glCreateShader(GL_FRAGMENT_SHADER); - - // Load the binary data into the shader objects - glShaderBinary(1, &vertShader, - GL_NVIDIA_PLATFORM_BINARY_NV, vertex_shader_binary, vertex_shader_binary_size); - glShaderBinary(1, &fragShader, - GL_NVIDIA_PLATFORM_BINARY_NV, fragment_shader_binary, fragment_shader_binary_size); - - // Attach the shaders to the program - glAttachShader(prog, vertShader); - glAttachShader(prog, fragShader); - - // Delete the shaders - glDeleteShader(vertShader); - glDeleteShader(fragShader); - - // Link and validate the shader program - glLinkProgram(prog); - glValidateProgram(prog); - - return prog; -} - -class QOpenKODEEventLoopHelper : public QThread -{ -public: - QOpenKODEEventLoopHelper(QSemaphore *m) - : eventMutex(m) - { - m->acquire(); - } - -protected: - void run() - { - qDebug() << "initializing KD"; - kdInitializeNV(); - qDebug() << "done initializing KD"; - eventMutex->release(); - - const KDEvent *event; - while ((event = kdWaitEvent(-1)) != 0) { - qDebug() << "!!! received event!"; - kdDefaultEvent(event); - } - - qDebug() << "exiting event loop"; - } - -private: - QSemaphore *eventMutex; -}; - -QOpenKODEGraphicsSystem::QOpenKODEGraphicsSystem() - : eventMutex(1) -{ - QOpenKODEEventLoopHelper *loop = new QOpenKODEEventLoopHelper(&eventMutex); - loop->start(); - eventMutex.acquire(); // block until initialization done - - mPrimaryScreen = new QOpenKODEGraphicsSystemScreen(); - - mScreens.append(mPrimaryScreen); - -} - -QPixmapData *QOpenKODEGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const -{ - return new QRasterPixmapData(type); -} - -QWindowSurface *QOpenKODEGraphicsSystem::createWindowSurface(QWidget *widget) const -{ - return new QOpenKODEWindowSurface(mPrimaryScreen, widget); -} - -GLuint QOpenKODEGraphicsSystem::blitterProgram() -{ - static GLuint shaderProgram = 0; - if (!shaderProgram) { - - const char vertShaderBinary[] = { -# include "vert.h" - }; - const char fragShaderBinary[] = { -# include "frag.h" - }; - - shaderProgram = NvKdTestLoadShaders(vertShaderBinary, fragShaderBinary, - sizeof(vertShaderBinary), sizeof(fragShaderBinary)); - - if (!shaderProgram) - qFatal("QOpenKodeGraphicsSystem(): Cannot load shaders!"); - } - return shaderProgram; -} - - -QT_END_NAMESPACE diff --git a/src/plugins/platforms/openkode/qgraphicssystem_openkode.h b/src/plugins/platforms/openkode/qgraphicssystem_openkode.h deleted file mode 100644 index 7d73ae0..0000000 --- a/src/plugins/platforms/openkode/qgraphicssystem_openkode.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins 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 either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QGRAPHICSSYSTEM_OPENKODE_H -#define QGRAPHICSSYSTEM_OPENKODE_H - -#include <QtCore/qsemaphore.h> - -#include <QtGui/private/qgraphicssystem_p.h> -#include <QtGui/private/qeglcontext_p.h> - -# include <GLES2/gl2.h> - -QT_BEGIN_NAMESPACE - -struct KDDesktopNV; - -class QOpenKODEGraphicsSystemScreen : public QGraphicsSystemScreen -{ -public: - QOpenKODEGraphicsSystemScreen(); - ~QOpenKODEGraphicsSystemScreen() {} - - QRect geometry() const { return mGeometry; } - int depth() const { return mDepth; } - QImage::Format format() const { return mFormat; } - QSize physicalSize() const { return mPhysicalSize; } - -public: - QRect mGeometry; - int mDepth; - QImage::Format mFormat; - QSize mPhysicalSize; - QEglContext mContext; -}; - -class QOpenKODEGraphicsSystem : public QGraphicsSystem -{ -public: - QOpenKODEGraphicsSystem(); - - QPixmapData *createPixmapData(QPixmapData::PixelType type) const; - QWindowSurface *createWindowSurface(QWidget *widget) const; - - QList<QGraphicsSystemScreen *> screens() const { return mScreens; } - - static GLuint blitterProgram(); - -private: - QOpenKODEGraphicsSystemScreen *mPrimaryScreen; - QList<QGraphicsSystemScreen *> mScreens; - QSemaphore eventMutex; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/openkode/qopenkodeintegration.cpp b/src/plugins/platforms/openkode/qopenkodeintegration.cpp new file mode 100644 index 0000000..d9430c2 --- /dev/null +++ b/src/plugins/platforms/openkode/qopenkodeintegration.cpp @@ -0,0 +1,227 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qopenkodeintegration.h" +#include "qopenkodewindowsurface.h" +#include "qopenkodewindow.h" + +#include <QtGui/private/qpixmap_raster_p.h> + +#include <QtCore/qdebug.h> +#include <QtCore/qthread.h> +#include <QtCore/qfile.h> + +#include <KD/kd.h> +#include <KD/NV_display.h> +#include <KD/NV_initialize.h> + +#include "GLES2/gl2ext.h" + +#include <nvgl2demo_common.h> + + +QT_BEGIN_NAMESPACE + +QOpenKODEScreen::QOpenKODEScreen() +{ + KDDesktopNV *kdDesktop = KD_NULL; + KDDisplayNV *kdDisplay = KD_NULL; + + qDebug() << "QOpenKODEScreen::QOpenKODEIntegrationScreen()"; + + // Get the default desktop and display + kdDesktop = kdGetDesktopNV(KD_DEFAULT_DESKTOP_NV, KD_NULL); + if (!kdDesktop || kdDesktop == (void*)-1) { + qErrnoWarning(kdGetError(), "Could not obtain KDDesktopNV pointer"); + return; + } + + kdDisplay = kdGetDisplayNV(KD_DEFAULT_DISPLAY_NV, KD_NULL); + if (!kdDisplay || kdDisplay == (void*)-1) { + qErrnoWarning(kdGetError(), "Could not obtain KDDisplayNV pointer"); + kdReleaseDesktopNV(kdDesktop); + return; + } + + KDDisplayModeNV mode; + if (kdGetDisplayModeNV(kdDisplay, &mode)) { + qErrnoWarning(kdGetError(), "Could not get display mode"); + return; + } + + qDebug() << " - display mode " << mode.width << "x" << mode.height << " refresh " << mode.refresh; + + KDint desktopSize[] = { mode.width, mode.height }; + + if (kdSetDesktopPropertyivNV(kdDesktop, KD_DESKTOPPROPERTY_SIZE_NV, desktopSize)) { + qErrnoWarning(kdGetError(), "Could not set desktop size"); + return; + } + + // Once we've set up the desktop and display we don't need them anymore + kdReleaseDisplayNV(kdDisplay); + kdReleaseDesktopNV(kdDesktop); + + const int defaultDpi = 72; + mGeometry = QRect(0, 0, mode.width, mode.height); + mPhysicalSize = QSize(mode.width * 25.4 / defaultDpi, mode.height * 25.4 / defaultDpi); + + mDepth = 24; + mFormat = QImage::Format_RGB32; +} + +static GLuint loadShaders(const QString &vertexShader, const QString &fragmentShader) +{ + GLuint prog = 0; + GLuint vertShader; + GLuint fragShader; + + // Create the program + prog = glCreateProgram(); + + // Create the GL shader objects + vertShader = glCreateShader(GL_VERTEX_SHADER); + fragShader = glCreateShader(GL_FRAGMENT_SHADER); + + // Load shader sources into GL and compile + QFile vertexFile(vertexShader); + vertexFile.open(QFile::ReadOnly); + QByteArray vertSource = vertexFile.readAll(); + const char *vertChar = vertSource.constData(); + int vertSize = vertSource.size(); + + QFile fragFile(fragmentShader); + fragFile.open(QFile::ReadOnly); + QByteArray fragSource = fragFile.readAll(); + const char *fragChar = fragSource.constData(); + int fragSize = fragSource.size(); + + glShaderSource(vertShader, 1, (const char**)&vertChar, &vertSize); + glCompileShader(vertShader); + + glShaderSource(fragShader, 1, (const char**)&fragChar, &fragSize); + glCompileShader(fragShader); + + // Attach the shaders to the program + glAttachShader(prog, vertShader); + glAttachShader(prog, fragShader); + + // Delete the shaders + glDeleteShader(vertShader); + glDeleteShader(fragShader); + + // Link and validate the shader program + glLinkProgram(prog); + glValidateProgram(prog); + + return prog; +} + +class QOpenKODEEventLoopHelper : public QThread +{ +public: + QOpenKODEEventLoopHelper(QSemaphore *m) + : eventMutex(m) + { + m->acquire(); + } + +protected: + void run() + { + if (kdInitializeNV() == KD_ENOTINITIALIZED) { + qFatal("Did not manage to initialize openkode"); + } + eventMutex->release(); + + const KDEvent *event; + while ((event = kdWaitEvent(-1)) != 0) { + qDebug() << "!!! received event!"; + kdDefaultEvent(event); + } + } + +private: + QSemaphore *eventMutex; +}; + +QOpenKODEIntegration::QOpenKODEIntegration() + : eventMutex(1) +{ + QOpenKODEEventLoopHelper *loop = new QOpenKODEEventLoopHelper(&eventMutex); + loop->start(); + eventMutex.acquire(); // block until initialization done + + QOpenKODEScreen *mPrimaryScreen = new QOpenKODEScreen(); + + mScreens.append(mPrimaryScreen); + +} + +QPixmapData *QOpenKODEIntegration::createPixmapData(QPixmapData::PixelType type) const +{ + return new QRasterPixmapData(type); +} + +QPlatformWindow *QOpenKODEIntegration::createPlatformWindow(QWidget *tlw, WId ) const +{ + return new QOpenKODEWindow(tlw); +} + +QWindowSurface *QOpenKODEIntegration::createWindowSurface(QWidget *widget, WId winId) const +{ + return new QOpenKODEWindowSurface(widget,winId); +} + +GLuint QOpenKODEIntegration::blitterProgram() +{ + static GLuint shaderProgram = 0; + if (!shaderProgram) { + + shaderProgram = loadShaders(":/shaders/vert.glslv",":/shaders/frag.glslf"); + if (!shaderProgram) + qFatal("QOpenKodeGraphicsSystem(): Cannot load shaders!"); + } + return shaderProgram; +} + + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/openkode/qopenkodeintegration.h b/src/plugins/platforms/openkode/qopenkodeintegration.h new file mode 100644 index 0000000..76ce219 --- /dev/null +++ b/src/plugins/platforms/openkode/qopenkodeintegration.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QGRAPHICSSYSTEM_OPENKODE_H +#define QGRAPHICSSYSTEM_OPENKODE_H + +#include <QtCore/qsemaphore.h> + +#include <QtGui/QPlatformIntegration> +#include <QtGui/QPlatformScreen> +#include <QtGui/private/qeglcontext_p.h> + +# include <GLES2/gl2.h> + +QT_BEGIN_NAMESPACE + +struct KDDesktopNV; + +class QOpenKODEScreen : public QPlatformScreen +{ +public: + QOpenKODEScreen(); + ~QOpenKODEScreen() {} + + QRect geometry() const { return mGeometry; } + int depth() const { return mDepth; } + QImage::Format format() const { return mFormat; } + QSize physicalSize() const { return mPhysicalSize; } + +public: + QRect mGeometry; + int mDepth; + QImage::Format mFormat; + QSize mPhysicalSize; +}; + +class QOpenKODEIntegration : public QPlatformIntegration +{ +public: + QOpenKODEIntegration(); + + QPixmapData *createPixmapData(QPixmapData::PixelType type) const; + QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId = 0) const; + QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const; + + virtual QList<QPlatformScreen *> screens() const { return mScreens; } + + static GLuint blitterProgram(); + +private: + QList<QPlatformScreen *> mScreens; + QSemaphore eventMutex; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/openkode/qopenkodewindow.cpp b/src/plugins/platforms/openkode/qopenkodewindow.cpp new file mode 100644 index 0000000..8e1527c --- /dev/null +++ b/src/plugins/platforms/openkode/qopenkodewindow.cpp @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenVG module 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "qopenkodewindow.h" + +#include <KD/NV_display.h> + +#include <QtGui/private/qeglcontext_p.h> +#include <QtGui/qwidget.h> +#include <QtCore/QDebug> + +QOpenKODEWindow::QOpenKODEWindow(QWidget *tlw) + : QPlatformWindow(tlw) +{ + /* Initialize EGL display */ + EGLBoolean rvbool = eglInitialize(QEgl::display(), KD_NULL, KD_NULL); + if (!rvbool) { + kdLogMessage("EGL failed to initialize display\n"); + } + + kdWindow = kdCreateWindow(QEgl::display(), + QEgl::defaultConfig(QInternal::Widget,QEgl::OpenGL,QEgl::Renderable), + KD_NULL); + if (!kdWindow) { + qErrnoWarning(kdGetError(), "Error creating native window"); + return; + } + + const KDint windowSize[2] = { tlw->width(), tlw->height() }; + if (kdSetWindowPropertyiv(kdWindow, KD_WINDOWPROPERTY_SIZE, windowSize)) { + qErrnoWarning(kdGetError(), "Could not set native window size"); + return; + } + +// const KDboolean windowExclusive[] = { false }; +// if (kdSetWindowPropertybv(kdWindow, KD_WINDOWPROPERTY_DESKTOP_EXCLUSIVE_NV, windowExclusive)) { +// qErrnoWarning(kdGetError(), "Could not set exclusive bit"); +// //return; +// } +// +// const KDint windowPos[2] = { tlw->x(), tlw->y() }; +// if (kdSetWindowPropertyiv(kdWindow, KD_WINDOWPROPERTY_DESKTOP_OFFSET_NV, windowPos)) { +// qErrnoWarning(kdGetError(), "Could not set native window position"); +// return; +// } + + if (kdRealizeWindow(kdWindow, &eglWindow)) { + qErrnoWarning(kdGetError(), "Could not realize native window"); + return; + } +} + +void QOpenKODEWindow::setGeometry(const QRect &rect) +{ + const QRect geo = geometry(); + if (geo.size() != rect.size()) { + const KDint windowSize[2] = { rect.width(), rect.height() }; + if (kdSetWindowPropertyiv(kdWindow, KD_WINDOWPROPERTY_SIZE, windowSize)) { + qErrnoWarning(kdGetError(), "Could not set native window size"); + //return; + } + } + +// if (geo.topLeft() != rect.topLeft()) { +// const KDint windowPos[2] = { rect.x(), rect.y() }; +// if (kdSetWindowPropertyiv(kdWindow, KD_WINDOWPROPERTY_DESKTOP_OFFSET_NV, windowPos)) { +// qErrnoWarning(kdGetError(), "Could not set native window position"); +// //return; +// } +// } + +} + +void QOpenKODEWindow::setVisible(bool visible) +{ + +} diff --git a/src/plugins/platforms/openkode/qopenkodewindow.h b/src/plugins/platforms/openkode/qopenkodewindow.h new file mode 100644 index 0000000..b52f8e6 --- /dev/null +++ b/src/plugins/platforms/openkode/qopenkodewindow.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenVG module 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QOPENKODEWINDOW_H +#define QOPENKODEWINDOW_H + +#include <QtGui/QPlatformWindow> + +#include <KD/kd.h> + +class QOpenKODEWindow : public QPlatformWindow +{ +public: + QOpenKODEWindow(QWidget *tlw); + + void setGeometry(const QRect &rect); + void setVisible(bool visible); + WId winId() const { return WId(eglWindow); } + +private: + struct KDWindow *kdWindow; + EGLNativeWindowType eglWindow; +}; + +#endif //QOPENKODEWINDOW_H diff --git a/src/plugins/platforms/openkode/qopenkodewindowsurface.cpp b/src/plugins/platforms/openkode/qopenkodewindowsurface.cpp new file mode 100644 index 0000000..5eb0d2d --- /dev/null +++ b/src/plugins/platforms/openkode/qopenkodewindowsurface.cpp @@ -0,0 +1,187 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenVG module 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qopenkodewindowsurface.h" +#include "qopenkodeintegration.h" + +#include "qopenkodewindow.h" + +#include <QtCore/qdebug.h> + +QT_BEGIN_NAMESPACE + +QOpenKODEWindowSurface::QOpenKODEWindowSurface + (QWidget *window, WId winId) + : QWindowSurface(window), + mSurface(EGL_NO_SURFACE), + mWin((EGLNativeWindowType) winId) +{ + EGLConfig config = QEgl::defaultConfig(QInternal::Widget,QEgl::OpenGL,QEgl::Renderable); + mContext.setConfig(config); + if (!mContext.createContext()) { + qWarning("QOpenKODEWindowSurface: Unable to create context"); + return; + } +} + +QOpenKODEWindowSurface::~QOpenKODEWindowSurface() +{ +} + +QPaintDevice *QOpenKODEWindowSurface::paintDevice() +{ + return &mImage; +} + +// ### TODO - this updates the entire toplevel, should only update the region +void QOpenKODEWindowSurface::flush(QWidget *, const QRegion ®ion, const QPoint &offset) +{ + mContext.makeCurrent(mSurface); + + if (!offset.isNull()) { + qWarning("Offset flushing not supported yet"); + return; + } + + if (!mContext.makeCurrent(mSurface)) { + qWarning("EGL couldn't make context/surface current: 0x%x", eglGetError()); + return; + } + + QRect boundingRect = region.boundingRect(); + + int x, y, w, h; + QImage blitImage; + if (true || boundingRect == mImage.rect()) { // TODO - check optimization + blitImage = mImage; + x = y = 0; + w = mImage.width(); + h = mImage.height(); + } else { + blitImage = mImage.copy(boundingRect); + w = boundingRect.width(); + h = boundingRect.height(); + x = boundingRect.x(); + y = boundingRect.y(); + } + +// qDebug() << "flush" << widget << offset << region.boundingRect() << mImage.format() << blitImage.format(); + + GLuint shaderProgram = QOpenKODEIntegration::blitterProgram(); + + glUseProgram(shaderProgram); + + GLuint index = glGetUniformLocation(shaderProgram, "window"); + glUniform2f(index, GLfloat(mImage.width()), GLfloat(mImage.height())); + + // attributes + GLuint posId = glGetAttribLocation(shaderProgram, "pos_attr"); + GLuint texcoordId = glGetAttribLocation(shaderProgram, "texcoord_attr"); + + // sampler + index = glGetUniformLocation(shaderProgram, "tex_samp"); + + glUniform1i(index, 0); + + glDisable(GL_DEPTH_TEST); + glActiveTexture(GL_TEXTURE0); + + GLuint texId; + GLfloat coords[8] = {x, y, x, y + h, x + w, y + h, x + w, y }; + GLfloat texcoords[8] = { 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0 }; + + // Generate texture for checkered background + glGenTextures(1, &texId); + glBindTexture(GL_TEXTURE_2D, texId); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, blitImage.bits()); + + // Enable vertex attribute associated with vertex position + glEnableVertexAttribArray(posId); + glEnableVertexAttribArray(texcoordId); + + // Set the quad vertices + glVertexAttribPointer(posId, 2, GL_FLOAT, 0, 0, coords); + glVertexAttribPointer(texcoordId, 2, GL_FLOAT, 0, 0, texcoords); + + // Draw the quad + glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + + // Cleanup + glDisableVertexAttribArray(posId); + glDisableVertexAttribArray(texcoordId); + + // Release all textures + glBindTexture(GL_TEXTURE_2D, 0); + if (texId) + glDeleteTextures(1, &texId); + + mContext.swapBuffers(mSurface); + mContext.doneCurrent(); +} + +void QOpenKODEWindowSurface::resize(const QSize &size) +{ + QWindowSurface::resize(size); + mContext.destroySurface(mSurface); + mSurface = EGL_NO_SURFACE; + mImage = QImage(); + +} +void QOpenKODEWindowSurface::beginPaint(const QRegion ®ion) +{ + if (mSurface == EGL_NO_SURFACE) { + EGLConfig config = QEgl::defaultConfig(QInternal::Widget,QEgl::OpenGL,QEgl::Renderable); + EGLint windowAttrs[] = { EGL_NONE }; + mSurface = eglCreateWindowSurface(QEgl::display(), config, mWin, windowAttrs); + mImage = QImage(size(),QImage::Format_RGB32); + } +} + +void QOpenKODEWindowSurface::endPaint(const QRegion ®ion) +{ + Q_UNUSED(region); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/openkode/qopenkodewindowsurface.h b/src/plugins/platforms/openkode/qopenkodewindowsurface.h new file mode 100644 index 0000000..568dbc2 --- /dev/null +++ b/src/plugins/platforms/openkode/qopenkodewindowsurface.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenVG module 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWINDOWSURFACE_OPENKODE_H +#define QWINDOWSURFACE_OPENKODE_H + +#include <QtGui/private/qwindowsurface_p.h> +#include <QtGui/private/qeglcontext_p.h> + +QT_BEGIN_NAMESPACE + +class QOpenKODEWindow; + +class QOpenKODEWindowSurface : public QWindowSurface +{ +public: + QOpenKODEWindowSurface + (QWidget *window, WId winId); + ~QOpenKODEWindowSurface(); + + QPaintDevice *paintDevice(); + void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset); + void resize (const QSize &size); + + void beginPaint(const QRegion ®ion); + void endPaint(const QRegion ®ion); + +private: + QImage mImage; + EGLSurface mSurface; + QEglContext mContext; + EGLNativeWindowType mWin; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/openkode/qwindowsurface_openkode.cpp b/src/plugins/platforms/openkode/qwindowsurface_openkode.cpp deleted file mode 100644 index b3f3965..0000000 --- a/src/plugins/platforms/openkode/qwindowsurface_openkode.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtOpenVG module 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 either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwindowsurface_openkode.h" -#include "qgraphicssystem_openkode.h" -#include <QtCore/qdebug.h> - -#include "KD/kd.h" -#include "KD/NV_display.h" - -QT_BEGIN_NAMESPACE - -QOpenKODEWindowSurface::QOpenKODEWindowSurface - (QOpenKODEGraphicsSystemScreen *screen, QWidget *window) - : QWindowSurface(window), - mScreen(screen), - mSurface(0) -{ - qDebug() << "QOpenKODEWindowSurface::QOpenKODEWindowSurface:" << window << window->width() << "x" << window->height() - << "pos" << window->x() << "x" << window->y(); - - if (!mContext.display()) { - qWarning("qEglContext: Unable to open display!"); - return; - } - - QEglProperties properties; - properties.setPixelFormat(QImage::Format_RGB888); - properties.setValue(EGL_BUFFER_SIZE, EGL_DONT_CARE); - properties.setRenderableType(QEgl::OpenGL); - - if (!mContext.chooseConfig(properties, QEgl::BestPixelFormat)) { - qWarning("qEglContext: Unable to choose config!"); - return; - } - - createWindow(window); -} - -void QOpenKODEWindowSurface::createWindow(QWidget *window) -{ - qDebug() << "createWindow"; - kdWindow = kdCreateWindow(mContext.display(), mContext.config(), KD_NULL); - - if (!kdWindow) { - qErrnoWarning(kdGetError(), "Error creating native window"); - return; - } - - const KDint windowSize[2] = { window->width(), window->height() }; - if (kdSetWindowPropertyiv(kdWindow, KD_WINDOWPROPERTY_SIZE, windowSize)) { - qErrnoWarning(kdGetError(), "Could not set native window size"); - return; - } - - //const KDboolean windowExclusive[] = { false }; - //if (kdSetWindowPropertybv(kdWindow, KD_WINDOWPROPERTY_DESKTOP_EXCLUSIVE_NV, windowExclusive)) { - // qErrnoWarning(kdGetError(), "Could not set exclusive bit"); - // //return; - //} - - //const KDint windowPos[2] = { window->x(), window->y() }; - //if (kdSetWindowPropertyiv(kdWindow, KD_WINDOWPROPERTY_DESKTOP_OFFSET_NV, windowPos)) { - // qErrnoWarning(kdGetError(), "Could not set native window position"); - // //return; - //} - - EGLNativeWindowType nativeWindow; - - if (kdRealizeWindow(kdWindow, &nativeWindow)) { - qErrnoWarning(kdGetError(), "Could not realize native window"); - return; - } - qDebug() << "kdRealizeWindow" << nativeWindow; - - // Create an EGL window surface for the native window - EGLint windowAttrs[3] = { EGL_NONE }; - qDebug() << "doing createwindowsurface"; - *mSurface = eglCreateWindowSurface(mContext.display(), - mContext.config(), - nativeWindow, - windowAttrs); - qDebug() << "create windowsurface"; - if (!mSurface) { - qWarning("EGL couldn't create window surface: 0x%x", eglGetError()); - return; - } - - qDebug() << "making context"; - if (!mContext.createContext()) { - qDebug() << "Unable to create context!"; - return; - } - - qDebug() << "about to make current"; - mContext.makeCurrent(mSurface); -} - -QOpenKODEWindowSurface::~QOpenKODEWindowSurface() -{ -} - -QPaintDevice *QOpenKODEWindowSurface::paintDevice() -{ - qDebug() << "QOpenKODEWindowSurface::paintDevice"; - return &mImage; -} - -// ### TODO - this updates the entire toplevel, should only update the region -void QOpenKODEWindowSurface::flush(QWidget *, const QRegion ®ion, const QPoint &offset) -{ - qDebug() << "in flush"; - if (!offset.isNull()) { - qWarning("Offset flushing not supported yet"); - return; - } - - if (!mContext.makeCurrent(mSurface)) { - qWarning("EGL couldn't make context/surface current: 0x%x", eglGetError()); - return; - } - - QRect boundingRect = region.boundingRect(); - - int x, y, w, h; - QImage blitImage; - if (true || boundingRect == mImage.rect()) { // TODO - check optimization - blitImage = mImage; - x = y = 0; - w = mImage.width(); - h = mImage.height(); - } else { - blitImage = mImage.copy(boundingRect); - w = boundingRect.width(); - h = boundingRect.height(); - x = boundingRect.x(); - y = boundingRect.y(); - } - -// qDebug() << "flush" << widget << offset << region.boundingRect() << mImage.format() << blitImage.format(); - - GLuint shaderProgram = QOpenKODEGraphicsSystem::blitterProgram(); - - glUseProgram(shaderProgram); - - GLuint index = glGetUniformLocation(shaderProgram, "window"); - glUniform2f(index, GLfloat(mImage.width()), GLfloat(mImage.height())); - - // attributes - GLuint posId = glGetAttribLocation(shaderProgram, "pos_attr"); - GLuint texcoordId = glGetAttribLocation(shaderProgram, "texcoord_attr"); - - // sampler - index = glGetUniformLocation(shaderProgram, "tex_samp"); - - glUniform1i(index, 0); - - glDisable(GL_DEPTH_TEST); - glActiveTexture(GL_TEXTURE0); - - GLuint texId; - GLfloat coords[8] = {x, y, x, y + h, x + w, y + h, x + w, y }; - GLfloat texcoords[8] = { 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0 }; - - // Generate texture for checkered background - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glGenTextures(1, &texId); - glBindTexture(GL_TEXTURE_2D, texId); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, blitImage.bits()); - - // Enable vertex attribute associated with vertex position - glEnableVertexAttribArray(posId); - glEnableVertexAttribArray(texcoordId); - - // Set the quad vertices - glVertexAttribPointer(posId, 2, GL_FLOAT, 0, 0, coords); - glVertexAttribPointer(texcoordId, 2, GL_FLOAT, 0, 0, texcoords); - - // Draw the quad - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - // Cleanup - glDisableVertexAttribArray(posId); - glDisableVertexAttribArray(texcoordId); - - // Release all textures - glBindTexture(GL_TEXTURE_2D, 0); - if (texId) - glDeleteTextures(1, &texId); - - mContext.doneCurrent(); - mContext.swapBuffers(mSurface); -} - -void QOpenKODEWindowSurface::setGeometry(const QRect &rect) -{ - qDebug() << "QOpenKODEWindowSurface::setGeometry:" << rect; - QWindowSurface::setGeometry(rect); - if (mImage.size() != rect.size()) - mImage = QImage(rect.size(), mScreen->format()); - - mContext.destroySurface(mSurface); - kdDestroyWindow(kdWindow); - createWindow(window()); - qDebug() << "set geometry workded"; -} - -bool QOpenKODEWindowSurface::scroll(const QRegion &area, int dx, int dy) -{ - return QWindowSurface::scroll(area, dx, dy); -} - -void QOpenKODEWindowSurface::beginPaint(const QRegion ®ion) -{ - Q_UNUSED(region); -} - -void QOpenKODEWindowSurface::endPaint(const QRegion ®ion) -{ - Q_UNUSED(region); -} - -QT_END_NAMESPACE diff --git a/src/plugins/platforms/openkode/qwindowsurface_openkode.h b/src/plugins/platforms/openkode/qwindowsurface_openkode.h deleted file mode 100644 index bee94a5..0000000 --- a/src/plugins/platforms/openkode/qwindowsurface_openkode.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtOpenVG module 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 either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWINDOWSURFACE_OPENKODE_H -#define QWINDOWSURFACE_OPENKODE_H - -#include <QtGui/private/qwindowsurface_p.h> -#include <QtGui/private/qeglcontext_p.h> - -QT_BEGIN_NAMESPACE - -class QOpenKODEGraphicsSystemScreen; - -class QOpenKODEWindowSurface : public QWindowSurface -{ -public: - QOpenKODEWindowSurface - (QOpenKODEGraphicsSystemScreen *screen, QWidget *window); - ~QOpenKODEWindowSurface(); - - QPaintDevice *paintDevice(); - void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset); - void setGeometry(const QRect &rect); - bool scroll(const QRegion &area, int dx, int dy); - - void beginPaint(const QRegion ®ion); - void endPaint(const QRegion ®ion); - -private: - QOpenKODEGraphicsSystemScreen *mScreen; - QImage mImage; - struct KDWindow *kdWindow; - EGLSurface *mSurface; - QEglContext mContext; - - void createWindow(QWidget *window); -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/openkode/resources.qrc b/src/plugins/platforms/openkode/resources.qrc new file mode 100644 index 0000000..dbb3419 --- /dev/null +++ b/src/plugins/platforms/openkode/resources.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>shaders/vert.glslv</file> + <file>shaders/frag.glslf</file> +</qresource> +</RCC> diff --git a/src/plugins/platforms/openkode/shaders/frag.glslf b/src/plugins/platforms/openkode/shaders/frag.glslf new file mode 100644 index 0000000..ed360fe --- /dev/null +++ b/src/plugins/platforms/openkode/shaders/frag.glslf @@ -0,0 +1,8 @@ +uniform sampler2D tex_samp; + +varying vec2 texcoord_var; + +void main(void) +{ + gl_FragColor = texture2D(tex_samp, texcoord_var); +} diff --git a/src/plugins/platforms/openkode/shaders/vert.glslv b/src/plugins/platforms/openkode/shaders/vert.glslv new file mode 100644 index 0000000..57b5866 --- /dev/null +++ b/src/plugins/platforms/openkode/shaders/vert.glslv @@ -0,0 +1,14 @@ +uniform vec2 window; // window size + +// Per-vertex attributes] +attribute vec2 pos_attr; +attribute vec2 texcoord_attr; + +// Output vertex color +varying vec2 texcoord_var; + +void main() +{ + gl_Position = vec4( (2.0 * pos_attr / window -1.0) * vec2(1.0, -1.0), 0.0, 1.0); + texcoord_var = texcoord_attr; +} diff --git a/src/plugins/platforms/openkode/vert.glslv b/src/plugins/platforms/openkode/vert.glslv deleted file mode 100644 index 57b5866..0000000 --- a/src/plugins/platforms/openkode/vert.glslv +++ /dev/null @@ -1,14 +0,0 @@ -uniform vec2 window; // window size - -// Per-vertex attributes] -attribute vec2 pos_attr; -attribute vec2 texcoord_attr; - -// Output vertex color -varying vec2 texcoord_var; - -void main() -{ - gl_Position = vec4( (2.0 * pos_attr / window -1.0) * vec2(1.0, -1.0), 0.0, 1.0); - texcoord_var = texcoord_attr; -} diff --git a/src/plugins/platforms/openkode/vert.h b/src/plugins/platforms/openkode/vert.h deleted file mode 100644 index bdf564d..0000000 --- a/src/plugins/platforms/openkode/vert.h +++ /dev/null @@ -1,63 +0,0 @@ -0x4e,0x56,0x75,0x63,0x01,0x00,0x00,0x00,0x0a,0x00,0x06,0x00,0x06,0x00,0x50,0x00, -0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0xf0,0x03,0x00,0x00,0x00,0x00,0x00,0x00, -0x03,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x60,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x24,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x70,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x05,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x26,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x90,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0xe8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x06,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0xb0,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x28,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00, -0x05,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x10,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x20,0x02,0x00,0x00,0x00,0x00,0x00,0x00, -0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x01,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x30,0x02,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x2b,0x00,0x00,0x00,0x39,0x01,0x00,0x00,0xb0,0x02,0x00,0x00,0x00,0x00,0x00,0x00, -0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x30,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x04,0x05,0x08,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x0f,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x01,0x02,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0x04,0x05,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x80,0x3f,0x00,0x00,0x00,0x40,0x00,0x00,0x80,0xbf,0x00,0x00,0x00,0x00, -0x05,0x00,0x00,0x10,0x80,0xc7,0x00,0x24,0x05,0x02,0x00,0x10,0x80,0xc7,0x00,0x24, -0x01,0x02,0x81,0xc0,0x80,0x07,0x60,0x00,0x05,0x02,0x00,0x90,0x80,0x07,0x00,0x00, -0x09,0x00,0x01,0xe1,0x80,0x87,0x40,0x00,0x05,0x00,0x00,0x10,0x80,0xc7,0x00,0x24, -0x01,0x00,0x81,0xc0,0x80,0x07,0x60,0x00,0x09,0x04,0x00,0xa0,0x80,0x47,0x00,0xe4, -0x05,0x02,0x00,0x90,0x80,0x07,0x00,0x00,0x05,0x04,0x00,0x10,0x88,0xc7,0x03,0x04, -0x01,0x00,0x01,0xe1,0x88,0x87,0x40,0x00,0x09,0xf8,0x00,0x10,0x88,0xc7,0x03,0x04, -0x0d,0x00,0x00,0x10,0x88,0xc7,0x40,0x24,0x11,0x04,0x00,0x10,0x88,0xc7,0x23,0x04, -0x15,0x06,0x00,0x10,0x89,0xc7,0x23,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xa0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xa1,0x03,0x00,0x00,0x00,0x00,0x00,0x00, -0xad,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x28,0x00,0x02,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00, -0xb6,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xb7,0x03,0x00,0x00,0x00,0x00,0x00,0x00, -0xbe,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x26,0x00,0x05,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xbf,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x03,0x00,0x00,0x00,0x00,0x00,0x00, -0xc9,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x26,0x00,0x01,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xca,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xcb,0x03,0x00,0x00,0x00,0x00,0x00,0x00, -0xd9,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x26,0x00,0x01,0x00,0x00,0x00, -0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xda,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xdb,0x03,0x00,0x00,0x00,0x00,0x00,0x00, -0xe8,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x26,0x00,0x02,0x00,0x00,0x00, -0x04,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0x00,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x50,0x4f,0x53, -0x49,0x54,0x49,0x4f,0x4e,0x00,0x00,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x00,0x00, -0x70,0x6f,0x73,0x5f,0x61,0x74,0x74,0x72,0x00,0x00,0x00,0x74,0x65,0x78,0x63,0x6f, -0x6f,0x72,0x64,0x5f,0x61,0x74,0x74,0x72,0x00,0x00,0x00,0x74,0x65,0x78,0x63,0x6f, -0x6f,0x72,0x64,0x5f,0x76,0x61,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -- cgit v0.12