Qt 4.8
qmeegographicssystem.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef MGRAPHICSSYSTEM_H
43 #define MGRAPHICSSYSTEM_H
44 
45 #include <private/qgraphicssystem_p.h>
46 #include <EGL/egl.h>
47 #include <GLES2/gl2.h>
48 #include <GLES2/gl2ext.h>
49 
50 extern "C" typedef void (*QMeeGoSwitchCallback)(int type, const char *name);
51 
53 {
54 public:
56 
59 
62  virtual QPixmapData *createPixmapData(QPixmapData *origin);
63 
65  static void setSurfaceFixedSize(int width, int height);
66  static void setSurfaceScaling(int x, int y, int width, int height);
67  static void setTranslucent(bool translucent);
68 
69  static QPixmapData *pixmapDataFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage);
71  static QPixmapData *pixmapDataWithGLTexture(int w, int h);
72  static void updateEGLSharedImagePixmap(QPixmap *pixmap);
73 
76  static QImage *lockLiveTexture(QPixmap* pixmap, void* fenceSync);
77  static bool releaseLiveTexture(QPixmap *pixmap, QImage *image);
78  static Qt::HANDLE getLiveTextureHandle(QPixmap *pixmap);
79 
80  static void* createFenceSync();
81  static void destroyFenceSync(void* fenceSync);
82 
83  static void switchToRaster();
84  static void switchToMeeGo();
86 
88 
90 
91 private:
92  static bool meeGoRunning();
93  static EGLSurface getSurfaceForLiveTexturePixmap(QPixmap *pixmap);
95  static void triggerSwitchCallbacks(int type, const char *name);
96 
97  static bool surfaceWasCreated;
100 };
101 
102 /* C api */
103 
104 extern "C" {
110  Q_DECL_EXPORT void qt_meego_set_surface_fixed_size(int width, int height);
111  Q_DECL_EXPORT void qt_meego_set_surface_scaling(int x, int y, int width, int height);
112  Q_DECL_EXPORT void qt_meego_set_translucent(bool translucent);
115  Q_DECL_EXPORT QImage* qt_meego_live_texture_lock(QPixmap *pixmap, void *fenceSync);
124  Q_DECL_EXPORT void qt_meego_set_switch_policy(int policy);
125 }
126 
127 #endif
static void triggerSwitchCallbacks(int type, const char *name)
Q_DECL_EXPORT bool qt_meego_live_texture_release(QPixmap *pixmap, QImage *image)
Q_DECL_EXPORT void qt_meego_switch_to_meego(void)
Format
The following image formats are available in Qt.
Definition: qimage.h:91
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
Definition: qsound_x11.cpp:170
Q_DECL_EXPORT Qt::HANDLE qt_meego_live_texture_get_handle(QPixmap *pixmap)
int type
Definition: qmetatype.cpp:239
static void updateEGLSharedImagePixmap(QPixmap *pixmap)
QPointer< QWidget > widget
Q_DECL_EXPORT void qt_meego_set_translucent(bool translucent)
static QImage * lockLiveTexture(QPixmap *pixmap, void *fenceSync)
static QPixmapData * pixmapDataFromLiveTextureHandle(Qt::HANDLE handle)
Q_DECL_EXPORT QPixmapData * qt_meego_pixmapdata_from_live_texture_handle(Qt::HANDLE handle)
Q_DECL_EXPORT void qt_meego_set_surface_scaling(int x, int y, int width, int height)
Q_DECL_EXPORT void qt_meego_set_surface_fixed_size(int width, int height)
Q_DECL_EXPORT void qt_meego_register_switch_callback(QMeeGoSwitchCallback callback)
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
Q_DECL_EXPORT QPixmapData * qt_meego_pixmapdata_with_new_live_texture(int w, int h, QImage::Format format)
static void registerSwitchCallback(QMeeGoSwitchCallback callback)
static void destroySurfaceForLiveTexturePixmap(QPixmapData *pmd)
static bool releaseLiveTexture(QPixmap *pixmap, QImage *image)
static void setSurfaceFixedSize(int width, int height)
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
virtual QPixmapData * createPixmapData(QPixmapData::PixelType) const
static SwitchPolicy switchPolicy
Q_DECL_EXPORT QPixmapData * qt_meego_pixmapdata_with_gl_texture(int w, int h)
static QHash< Qt::HANDLE, QPixmap * > liveTexturePixmaps
static QPixmapData * pixmapDataFromEGLImage(Qt::HANDLE handle)
Q_DECL_EXPORT void qt_meego_set_switch_policy(int policy)
static void setSurfaceScaling(int x, int y, int width, int height)
const char * name
#define Q_DECL_EXPORT
This macro marks a symbol for shared library export (see sharedlibrary.
Definition: qglobal.h:1288
void(* QMeeGoSwitchCallback)(int type, const char *name)
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
Q_DECL_EXPORT void qt_meego_destroy_fence_sync(void *fs)
Q_DECL_EXPORT bool qt_meego_destroy_egl_shared_image(Qt::HANDLE handle)
static EGLSurface getSurfaceForLiveTexturePixmap(QPixmap *pixmap)
void * HANDLE
Definition: qnamespace.h:1671
static void destroyFenceSync(void *fenceSync)
The QWindowSurface class provides the drawing area for top-level windows.
static QPixmapData * pixmapDataWithNewLiveTexture(int w, int h, QImage::Format format)
Q_DECL_EXPORT void qt_meego_invalidate_live_surfaces(void)
Q_DECL_EXPORT void qt_meego_switch_to_raster(void)
Q_DECL_EXPORT QPixmapData * qt_meego_pixmapdata_from_egl_shared_image(Qt::HANDLE handle, const QImage &softImage)
Q_DECL_EXPORT int qt_meego_image_to_egl_shared_image(const QImage &image)
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
static void setTranslucent(bool translucent)
Q_DECL_EXPORT QImage * qt_meego_live_texture_lock(QPixmap *pixmap, void *fenceSync)
static QList< QMeeGoSwitchCallback > switchCallbacks
Q_DECL_EXPORT void * qt_meego_create_fence_sync(void)
static QString runningGraphicsSystemName()
virtual QWindowSurface * createWindowSurface(QWidget *widget) const
static QPixmapData * pixmapDataWithGLTexture(int w, int h)
static Qt::HANDLE getLiveTextureHandle(QPixmap *pixmap)
static QPixmapData * pixmapDataFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage)
Q_DECL_EXPORT void qt_meego_update_egl_shared_image_pixmap(QPixmap *pixmap)
static QPixmapData * wrapPixmapData(QPixmapData *pmd)