43 #include <private/qpixmap_raster_p.h> 44 #include <private/qwindowsurface_gl_p.h> 45 #include <private/qwindowsurface_raster_p.h> 46 #include <private/qegl_p.h> 47 #include <private/qglextensions_p.h> 48 #include <private/qgl_p.h> 49 #include <private/qimagepixmapcleanuphooks_p.h> 50 #include <private/qapplication_p.h> 51 #include <private/qgraphicssystem_runtime_p.h> 52 #include <private/qimage_p.h> 53 #include <private/qeglproperties_p.h> 54 #include <private/qeglcontext_p.h> 55 #include <private/qpixmap_x11_p.h> 74 qDebug(
"Using the meego graphics system");
79 qDebug(
"Meego graphics system destroyed");
92 void handleMapNotify();
95 void removeWidget(
QObject *
object);
100 int visibleWidgets()
const;
133 m_widgets.removeOne(static_cast<QWidget *>(
object));
151 for (
int i = 0; i < m_widgets.size(); ++i)
152 count += m_widgets.at(i)->isVisible() && !(m_widgets.at(i)->windowState() &
Qt::WindowMinimized);
165 Qt::WindowStates old = change->
oldState();
169 if (current & Qt::WindowMinimized) {
170 if (visibleWidgets() == 0)
173 if (visibleWidgets() > 0)
179 if (visibleWidgets() > 0)
183 if (visibleWidgets() == 0)
195 if (
event->type == MapNotify)
196 switch_handler()->handleMapNotify();
210 switch_handler()->addWidget(widget);
242 if (name ==
"runtime") {
256 qWarning(
"Trying to set surface fixed size but surface already created!");
260 #ifdef QT_WAS_PATCHED 277 qWarning(
"Trying to set translucency but surface already created!");
290 qFatal(
"For egl shared images, the soft image has to be ARGB32_Premultiplied or RGB32");
305 qFatal(
"Iternal misalignment of raster data detected. Prolly a QImage copy fail.");
318 qFatal(
"Trying to updated EGLSharedImage pixmap but it's not really a shared image pixmap!");
348 return pixmapData->
lock(fenceSync);
354 return pixmapData->
release(image);
360 return pixmapData->
handle();
380 qWarning(
"Querying graphics system but application not running yet!");
399 qWarning(
"Can't switch to meego - switching only supported with 'runtime' graphics system.");
416 qWarning(
"Can't switch to raster - switching only supported with 'runtime' graphics system.");
542 #include "qmeegographicssystem.moc" static bool eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surface, int x, int y, int width, int height)
static void triggerSwitchCallbacks(int type, const char *name)
static void registerSharedImage(Qt::HANDLE handle, const QImage &si)
Qt::WindowStates oldState() const
Returns the state of the window before the change.
The QApplication class manages the GUI application's control flow and main settings.
Format
The following image formats are available in Qt.
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
bool(* QX11FilterFunction)(XEvent *event)
bool qt_meego_live_texture_release(QPixmap *pixmap, QImage *image)
static void * createFenceSync()
static void switchToRaster()
static void updateEGLSharedImagePixmap(QPixmap *pixmap)
static void switchToMeeGo()
QPointer< QWidget > widget
static void invalidateSurfaces()
void * qt_meego_create_fence_sync(void)
static QImage * lockLiveTexture(QPixmap *pixmap, void *fenceSync)
Q_OPENGL_EXPORT QGLWidget * qt_gl_share_widget()
static QPixmapData * pixmapDataFromLiveTextureHandle(Qt::HANDLE handle)
void removeWidget(QObject *object)
static void setExtraWindowSurfaceCreationProps(QEglProperties *props)
void qt_meego_set_switch_policy(int policy)
static bool x11EventFilter(XEvent *event)
static void registerSwitchCallback(QMeeGoSwitchCallback callback)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static QApplicationPrivate * instance()
void qt_meego_destroy_fence_sync(void *fs)
static bool releaseLiveTexture(QPixmap *pixmap, QImage *image)
static void setSurfaceFixedSize(int width, int height)
The QString class provides a Unicode character string.
void qt_meego_invalidate_live_surfaces(void)
bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
The QHash class is a template class that provides a hash-table-based dictionary.
void setValue(int name, int value)
The QObject class is the base class of all Qt objects.
virtual QPixmapData * createPixmapData(QPixmapData::PixelType) const
QPixmapData * qt_meego_pixmapdata_with_gl_texture(int w, int h)
QImage * lock(EGLSyncKHR fenceSync)
Format format() const
Returns the format of the image.
static SwitchPolicy switchPolicy
QString graphicsSystemName() const
int qt_meego_image_to_egl_shared_image(const QImage &image)
Q_CORE_EXPORT void qDebug(const char *,...)
PixelType pixelType() const
void qt_meego_set_surface_fixed_size(int width, int height)
T * data() const
Returns a pointer to the shared data object.
static bool destroyEGLSharedImage(Qt::HANDLE h)
QImage * qt_meego_live_texture_lock(QPixmap *pixmap, void *fenceSync)
Q_GUI_EXPORT EGLDisplay display()
static QHash< Qt::HANDLE, QPixmap * > liveTexturePixmaps
void qt_meego_set_surface_scaling(int x, int y, int width, int height)
static void setSurfaceScaling(int x, int y, int width, int height)
void qt_meego_update_egl_shared_image_pixmap(QPixmap *pixmap)
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
const T & at(int i) const
Returns the item at index position i in the list.
void resize(int width, int height)
void(* QMeeGoSwitchCallback)(int type, const char *name)
static QGLFormat surfaceFormat
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
static QHash< void *, QMeeGoImageInfo * > sharedImagesMap
void qt_meego_switch_to_meego(void)
QList< QWidget * > m_widgets
static void setGraphicsSystem(const QString &)
Sets the default graphics backend to system, which will be used for on-screen widgets and QPixmaps...
Q_GUI_EXPORT void qt_installX11EventFilter(QX11FilterFunction func)
static void destroyFenceSync(void *fenceSync)
QPixmapData * qt_meego_pixmapdata_from_live_texture_handle(Qt::HANDLE handle)
static QString graphics_system_name
static EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
void addWidget(QWidget *widget)
The QWindowSurface class provides the drawing area for top-level windows.
#define EGL_SYNC_FENCE_KHR
static QPixmapData * pixmapDataWithNewLiveTexture(int w, int h, QImage::Format format)
QList< QRuntimePixmapData * > m_pixmapDatas
Q_CORE_EXPORT void qFatal(const char *,...)
void qt_destroy_gl_share_widget()
The QWindowStateChangeEvent class provides the window state before a window state change...
static bool meeGoRunning()
static QEglContext * currentContext(QEgl::API api)
static Qt::HANDLE imageToEGLSharedImage(const QImage &image)
static void ensureInitialized()
QPixmapData * qt_meego_pixmapdata_with_new_live_texture(int w, int h, QImage::Format format)
static QCoreApplication * instance()
Returns a pointer to the application's QCoreApplication (or QApplication) instance.
static bool eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
QMeeGoGraphicsSystemSwitchHandler()
void qt_meego_register_switch_callback(QMeeGoSwitchCallback callback)
void * data_ptr(const QTransform &t)
bool singleShot
This static function calls a slot after a given time interval.
void installEventFilter(QObject *)
Installs an event filter filterObj on this object.
int size() const
Returns the number of items in the list.
static QGraphicsSystem * graphics_system
static const QCssKnownValue properties[NumProperties - 1]
The QPixmap class is an off-screen image representation that can be used as a paint device...
bool qt_meego_destroy_egl_shared_image(Qt::HANDLE handle)
virtual void fromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage)
void qt_meego_switch_to_raster(void)
QPixmapData * qt_meego_pixmapdata_from_egl_shared_image(Qt::HANDLE handle, const QImage &softImage)
static void setTranslucent(bool translucent)
#define EGL_FIXED_HEIGHT_NOK
Qt::HANDLE qt_meego_live_texture_get_handle(QPixmap *pixmap)
static QList< QMeeGoSwitchCallback > switchCallbacks
static QString runningGraphicsSystemName()
#define EGL_FIXED_WIDTH_NOK
static bool surfaceWasCreated
void qt_meego_set_translucent(bool translucent)
virtual void updateFromSoftImage()
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
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)
static QPixmapData * wrapPixmapData(QPixmapData *pmd)
bool release(QImage *img)
void fromImage(const QImage &image, Qt::ImageConversionFlags flags)
QPixmapData * pixmapData() const
int visibleWidgets() const