diff options
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbscreen.h')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbscreen.h | 95 |
1 files changed, 76 insertions, 19 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h index ebe40b1..df0eea4 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h @@ -50,6 +50,49 @@ QT_BEGIN_HEADER QT_MODULE(Gui) +#if !defined QT_NO_DIRECTFB_LAYER && !defined QT_DIRECTFB_LAYER +#define QT_DIRECTFB_LAYER +#endif +#if !defined QT_NO_DIRECTFB_WM && !defined QT_DIRECTFB_WM +#define QT_DIRECTFB_WM +#endif +#if !defined QT_DIRECTFB_IMAGECACHE && !defined QT_NO_DIRECTFB_IMAGECACHE +#define QT_NO_DIRECTFB_IMAGECACHE +#endif +#if !defined QT_DIRECTFB_NO_IMAGEPROVIDER && !defined QT_DIRECTFB_IMAGEPROVIDER +#define QT_DIRECTFB_IMAGEPROVIDER +#endif +#if !defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE && !defined QT_NO_DIRECTFB_IMAGEPROVIDER_KEEPALIVE +#define QT_NO_DIRECTFB_IMAGEPROVIDER_KEEPALIVE +#endif +#if !defined QT_DIRECTFB_WINDOW_AS_CURSOR && !defined QT_NO_DIRECTFB_WINDOW_AS_CURSOR +#define QT_NO_DIRECTFB_WINDOW_AS_CURSOR +#endif +#if !defined QT_NO_DIRECTFB_PALETTE && !defined QT_DIRECTFB_PALETTE +#define QT_DIRECTFB_PALETTE +#endif +#if !defined QT_NO_DIRECTFB_PREALLOCATED && !defined QT_DIRECTFB_PREALLOCATED +#define QT_DIRECTFB_PREALLOCATED +#endif +#if !defined QT_NO_DIRECTFB_MOUSE && !defined QT_DIRECTFB_MOUSE +#define QT_DIRECTFB_MOUSE +#endif +#if !defined QT_NO_DIRECTFB_KEYBOARD && !defined QT_DIRECTFB_KEYBOARD +#define QT_DIRECTFB_KEYBOARD +#endif +#if !defined QT_NO_DIRECTFB_OPAQUE_DETECTION && !defined QT_DIRECTFB_OPAQUE_DETECTION +#define QT_DIRECTFB_OPAQUE_DETECTION +#endif +#if defined QT_NO_DIRECTFB_LAYER && defined QT_DIRECTFB_WM +#error QT_NO_DIRECTFB_LAYER requires QT_NO_DIRECTFB_WM +#endif +#if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE && defined QT_NO_DIRECTFB_IMAGEPROVIDER +#error QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE requires QT_DIRECTFB_IMAGEPROVIDER to be defined +#endif +#if defined QT_DIRECTFB_WINDOW_AS_CURSOR && defined QT_NO_DIRECTFB_WM +#error QT_DIRECTFB_WINDOW_AS_CURSOR requires QT_DIRECTFB_WM to be defined +#endif + #define Q_DIRECTFB_VERSION ((DIRECTFB_MAJOR_VERSION << 16) | (DIRECTFB_MINOR_VERION << 8) | DIRECTFB_MICRO_VERSION) #define DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(F) \ @@ -61,6 +104,8 @@ QT_MODULE(Gui) DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBInputDeviceCapabilities); DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBWindowDescriptionFlags); +DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBWindowCapabilities); +DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBWindowOptions); DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBSurfaceDescriptionFlags); DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBSurfaceCapabilities); DIRECTFB_DECLARE_OPERATORS_FOR_FLAGS(DFBSurfaceLockFlags); @@ -107,45 +152,57 @@ public: return static_cast<QDirectFBScreen*>(inst); } + IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const; + IDirectFBSurface *subSurfaceForWidget(const QWidget *widget, const QRect &area = QRect()) const; + IDirectFB *dfb(); - IDirectFBSurface *dfbSurface(); +#ifdef QT_NO_DIRECTFB_WM + IDirectFBSurface *primarySurface(); +#endif #ifndef QT_NO_DIRECTFB_LAYER IDirectFBDisplayLayer *dfbDisplayLayer(); #endif // Track surface creation/release so we can release all on exit enum SurfaceCreationOption { - DontTrackSurface = 0, - TrackSurface = 1 + DontTrackSurface = 0x1, + TrackSurface = 0x2, + NoPreallocated = 0x4 }; Q_DECLARE_FLAGS(SurfaceCreationOptions, SurfaceCreationOption); IDirectFBSurface *createDFBSurface(const QImage &image, - SurfaceCreationOptions options); + QImage::Format format, + SurfaceCreationOptions options, + DFBResult *result = 0); IDirectFBSurface *createDFBSurface(const QSize &size, QImage::Format format, - SurfaceCreationOptions options); + SurfaceCreationOptions options, + DFBResult *result = 0); IDirectFBSurface *copyDFBSurface(IDirectFBSurface *src, QImage::Format format, - SurfaceCreationOptions options); - IDirectFBSurface *copyToDFBSurface(const QImage &image, - QImage::Format format, - SurfaceCreationOptions options); + SurfaceCreationOptions options, + DFBResult *result = 0); + IDirectFBSurface *createDFBSurface(DFBSurfaceDescription desc, + SurfaceCreationOptions options, + DFBResult *result); + void flipSurface(IDirectFBSurface *surface, DFBSurfaceFlipFlags flipFlags, const QRegion ®ion, const QPoint &offset); void releaseDFBSurface(IDirectFBSurface *surface); void erase(const QRegion ®ion); + using QScreen::depth; static int depth(DFBSurfacePixelFormat format); + static int depth(QImage::Format format); static DFBSurfacePixelFormat getSurfacePixelFormat(QImage::Format format); - static DFBSurfaceDescription getSurfaceDescription(const QImage &image); static DFBSurfaceDescription getSurfaceDescription(const uint *buffer, int length); static QImage::Format getImageFormat(IDirectFBSurface *surface); static bool initSurfaceDescriptionPixelFormat(DFBSurfaceDescription *description, QImage::Format format); static inline bool isPremultiplied(QImage::Format format); - static inline bool hasAlpha(DFBSurfacePixelFormat format); - static inline bool hasAlpha(IDirectFBSurface *surface); + static inline bool hasAlphaChannel(DFBSurfacePixelFormat format); + static inline bool hasAlphaChannel(IDirectFBSurface *surface); QImage::Format alphaPixmapFormat() const; #ifndef QT_NO_DIRECTFB_PALETTE @@ -153,12 +210,12 @@ public: const QImage &image); #endif - static uchar *lockSurface(IDirectFBSurface *surface, uint flags, int *bpl = 0); + static uchar *lockSurface(IDirectFBSurface *surface, DFBSurfaceLockFlags flags, int *bpl = 0); +#if defined QT_DIRECTFB_IMAGEPROVIDER && defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE + void setDirectFBImageProvider(IDirectFBImageProvider *provider); +#endif private: - IDirectFBSurface *createDFBSurface(DFBSurfaceDescription desc, - SurfaceCreationOptions options); QDirectFBScreenPrivate *d_ptr; - friend class SurfaceCache; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QDirectFBScreen::SurfaceCreationOptions); @@ -179,7 +236,7 @@ inline bool QDirectFBScreen::isPremultiplied(QImage::Format format) return false; } -inline bool QDirectFBScreen::hasAlpha(DFBSurfacePixelFormat format) +inline bool QDirectFBScreen::hasAlphaChannel(DFBSurfacePixelFormat format) { switch (format) { case DSPF_ARGB1555: @@ -204,12 +261,12 @@ inline bool QDirectFBScreen::hasAlpha(DFBSurfacePixelFormat format) } } -inline bool QDirectFBScreen::hasAlpha(IDirectFBSurface *surface) +inline bool QDirectFBScreen::hasAlphaChannel(IDirectFBSurface *surface) { Q_ASSERT(surface); DFBSurfacePixelFormat format; surface->GetPixelFormat(surface, &format); - return QDirectFBScreen::hasAlpha(format); + return QDirectFBScreen::hasAlphaChannel(format); } QT_END_HEADER |