46 #include <private/qwidget_p.h> 52 #ifndef QT_NO_QWS_DIRECTFB 58 #ifndef QT_NO_DIRECTFB_WM
62 , boundingRectFlip(scr->directFBFlags() &
QDirectFBScreen::BoundingRectFlip)
65 #ifdef QT_NO_DIRECTFB_WM 69 #ifdef QT_DIRECTFB_TIMING 77 #ifndef QT_NO_DIRECTFB_WM
84 SurfaceFlags flags = 0;
87 #ifdef QT_NO_DIRECTFB_WM 97 #ifdef QT_DIRECTFB_TIMING 114 #ifdef QT_DIRECTFB_WM 131 qFatal(
"QDirectFBWindowSurface: Unable to get primary display layer!");
135 DFBWindowDescription description;
136 memset(&description, 0,
sizeof(DFBWindowDescription));
138 description.flags = DWDESC_CAPS|DWDESC_HEIGHT|DWDESC_WIDTH|DWDESC_POSX|DWDESC_POSY|DWDESC_SURFACE_CAPS|DWDESC_PIXELFORMAT;
139 description.caps = DWCAPS_NODECORATION;
140 description.surface_caps = DSCAPS_NONE;
145 description.caps |= DWCAPS_ALPHACHANNEL;
146 #if (Q_DIRECTFB_VERSION >= 0x010200) 147 description.flags |= DWDESC_OPTIONS;
148 description.options |= DWOP_ALPHACHANNEL;
152 description.posx = rect.
x();
153 description.posy = rect.
y();
154 description.width = rect.
width();
155 description.height = rect.
height();
158 description.surface_caps = DSCAPS_PREMULTIPLIED;
161 description.surface_caps |= DSCAPS_VIDEOONLY;
163 DFBResult result = layer->CreateWindow(layer, &description, &
dfbWindow);
165 if (result != DFB_OK)
166 DirectFBErrorFatal(
"QDirectFBWindowSurface::createWindow", result);
174 if (result != DFB_OK) {
175 DirectFBError(
"QDirectFBWindowSurface::createWindow. Can't get ID", result);
187 DFBResult result = DFB_OK;
189 const bool isResize = rect.
size() != old.
size();
191 #if (Q_DIRECTFB_VERSION >= 0x010000) 192 if (isResize && isMove) {
193 result = dfbWindow->SetBounds(dfbWindow, rect.
x(), rect.
y(),
195 }
else if (isResize) {
196 result = dfbWindow->Resize(dfbWindow,
199 result = dfbWindow->MoveTo(dfbWindow, rect.
x(), rect.
y());
203 result = dfbWindow->Resize(dfbWindow,
207 result = dfbWindow->MoveTo(dfbWindow, rect.
x(), rect.
y());
212 #endif // QT_NO_DIRECTFB_WM 221 const bool sizeChanged = oldRect.
size() != rect.
size();
230 #ifndef QT_NO_DIRECTFB_WM 240 #ifdef QT_DIRECTFB_SUBSURFACE 244 #ifdef QT_DIRECTFB_WM 254 IDirectFBSurface *primarySurface =
screen->primarySurface();
255 DFBResult result = DFB_OK;
256 if (mode == Primary) {
261 const DFBRectangle r = { rect.
x(), rect.
y(),
263 result = primarySurface->GetSubSurface(primarySurface, &r, &
dfbSurface);
271 if (result != DFB_OK)
272 DirectFBErrorFatal(
"QDirectFBWindowSurface::setGeometry()", result);
279 if (oldRect.
size() != rect.
size()) {
288 QByteArray state(
sizeof(SurfaceFlags) +
sizeof(DFBWindowID), 0);
291 memcpy(ptr, &flags,
sizeof(SurfaceFlags));
292 ptr +=
sizeof(SurfaceFlags);
293 DFBWindowID did = (DFBWindowID)(-1);
296 memcpy(ptr, &did,
sizeof(DFBWindowID));
305 memcpy(&flags, ptr,
sizeof(SurfaceFlags));
308 ptr +=
sizeof(SurfaceFlags);
310 memcpy(&
id, ptr,
sizeof(DFBWindowID));
313 if (
id != (DFBWindowID)-1) {
315 layer->GetWindow(layer,
id, &dw);
316 if (dw->GetSurface(dw, &
dfbSurface) != DFB_OK)
350 if (opaque != (flags &
Opaque)) {
368 #if !defined(QT_NO_QWS_PROXYSCREEN) && !defined(QT_NO_GRAPHICSVIEW) 378 #ifdef QT_DIRECTFB_WM 382 if (currentOpacity != windowOpacity) {
389 if (mode == Offscreen) {
396 #ifdef QT_DIRECTFB_TIMING 399 if (
timer.elapsed() >= Secs * 1000) {
400 qDebug(
"%d fps",
int(
double(frames) /
double(Secs)));
425 #ifdef QT_NO_DIRECTFB_SUBSURFACE 445 *rect = widget->
rect();
458 #ifdef QT_DIRECTFB_SUBSURFACE 463 #ifdef QT_NO_DIRECTFB_WM 506 #endif // QT_NO_QWS_DIRECTFB The QVariant class acts like a union for the most common Qt data types.
void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset)
Flushes the given region from the specified widget onto the screen.
QRect geometry() const
Returns the currently allocated area on the screen.
The QWSWindowSurface class provides the drawing area for top-level windows in Qt for Embedded Linux...
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
static DFBResult setWindowGeometry(IDirectFBWindow *dfbWindow, const QRect &old, const QRect &rect)
IDirectFBSurface * createDFBSurface(const QImage &image, QImage::Format format, SurfaceCreationOptions options, DFBResult *result=0)
#define QT_END_NAMESPACE
This macro expands to.
IDirectFBSurface * directFBSurface() const
IDirectFBWindow * directFBWindow() const
char * data()
Returns a pointer to the data stored in the byte array.
DirectFBFlags directFBFlags() const
QRect rect(const QWidget *widget) const
Returns the rectangle for widget in the coordinates of this window surface.
static bool isPremultiplied(QImage::Format format)
The QByteArray class provides an array of bytes.
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
IDirectFBDisplayLayer * dfbDisplayLayer()
virtual void setGeometry(const QRect &rect)
Sets the currently allocated area to be the given rect.
int width() const
Returns the width of the rectangle.
virtual QPoint offset(const QWidget *widget) const
Returns the offset of widget in the coordinates of this window surface.
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
QRect boundingRect() const
Returns the bounding rectangle of this region.
void setSurfaceFlags(SurfaceFlags type)
Sets the surface flags describing the contents of this surface, to be the given flags.
int height() const
Returns the height of the rectangle.
QImage::Format alphaPixmapFormat() const
int rectCount() const
Returns the number of rectangles that will be returned in rects().
QDirectFBPaintEngine * engine
IDirectFBWindow * dfbWindow
QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen *scr)
Q_CORE_EXPORT void qDebug(const char *,...)
virtual QRegion region() const
Returns the region covered by this screen driver.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QSize size() const
Returns the size of the rectangle.
bool move(const QPoint &offset)
Move the surface with the given offset.
The QRegion class specifies a clip region for a painter.
const T * ptr(const T &t)
static DFBSurfacePixelFormat getSurfacePixelFormat(QImage::Format format)
static QImage::Format getImageFormat(IDirectFBSurface *surface)
Qt::BrushStyle style() const
Returns the brush style.
~QDirectFBWindowSurface()
bool isOpaque() const
Returns true if the brush is fully opaque otherwise false.
IDirectFBSurface * dfbSurface
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
void endPaint(const QRegion &)
This function is called after painting onto the surface has ended, with the region in which the paint...
IDirectFBSurface * surfaceForWidget(const QWidget *widget, QRect *rect) const
SurfaceFlags surfaceFlags() const
Returns the surface flags describing the contents of this surface.
const char * constData() const
Returns a pointer to the data stored in the byte array.
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
void solidFill(const QColor &color, const QRegion ®ion)
Fills the given region of the screen with the specified color.
Q_CORE_EXPORT void qFatal(const char *,...)
bool scroll(const QRegion &area, int dx, int dy)
Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative...
QImage::Format pixelFormat() const
Returns the pixel format of the screen, or QImage::Format_Invalid if the pixel format is not a suppor...
DFBSurfaceFlipFlags flipFlags
int y() const
Returns the y-coordinate of the rectangle's top edge.
int x() const
Returns the x-coordinate of the rectangle's left edge.
bool isValid() const
Implement this function to return true if the surface is a valid surface for the given top-level wind...
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.
void beginPaint(const QRegion &)
This function is called before painting onto the surface begins, with the region in which the paintin...
QRegion translated(int dx, int dy) const
Returns a copy of the region that is translated dx along the x axis and dy along the y axis...
void setPermanentState(const QByteArray &state)
Implement this function to attach a server-side surface instance to the corresponding client side ins...
void flipSurface(IDirectFBSurface *surface, DFBSurfaceFlipFlags flipFlags, const QRegion ®ion, const QPoint &offset)
void exposeRegion(QRegion r, int changing)
This function is called by the Qt for Embedded Linux server whenever a screen update is required...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
void setGeometry(const QRect &rect)
Sets the currently allocated area to be the given rect.
QWidget * window() const
Returns a pointer to the top-level window associated with this surface.
QImage::Format imageFormat
virtual void setGeometry(const QRect &rect)
Sets the currently allocated area to be the given rect.
void createWindow(const QRect &rect)
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
void setOpaque(bool opaque)
QByteArray permanentState() const
Implement this function to return the data required for creating a server-side representation of the ...
The QPalette class contains color groups for each widget state.