Qt 4.8
qdirectfbwindowsurface.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 QDIRECFBWINDOWSURFACE_H
43 #define QDIRECFBWINDOWSURFACE_H
44 
45 #include "qdirectfbpaintengine.h"
46 #include "qdirectfbpaintdevice.h"
47 #include "qdirectfbscreen.h"
48 
49 #ifndef QT_NO_QWS_DIRECTFB
50 
51 #include <private/qpaintengine_raster_p.h>
52 #include <private/qwindowsurface_qws_p.h>
53 
54 #ifdef QT_DIRECTFB_TIMING
55 #include <qdatetime.h>
56 #endif
57 
59 
61 
62 QT_MODULE(Gui)
63 
65 {
66 public:
67  QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen *scr);
68  QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen *scr, QWidget *widget);
70 
71 #ifdef QT_DIRECTFB_WM
72  void raise();
73 #endif
74  bool isValid() const;
75 
76  void setGeometry(const QRect &rect);
77 
78  QString key() const { return QLatin1String("directfb"); }
79  QByteArray permanentState() const;
80  void setPermanentState(const QByteArray &state);
81 
82  bool scroll(const QRegion &area, int dx, int dy);
83 
84  bool move(const QPoint &offset);
85 
86  QImage image() const { return QImage(); }
87  QPaintDevice *paintDevice() { return this; }
88 
89  void flush(QWidget *widget, const QRegion &region, const QPoint &offset);
90 
91  void beginPaint(const QRegion &);
92  void endPaint(const QRegion &);
93 
94  IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const;
95  IDirectFBSurface *directFBSurface() const;
96 #ifdef QT_DIRECTFB_WM
97  IDirectFBWindow *directFBWindow() const;
98 #endif
99 private:
100  void updateIsOpaque();
101  void setOpaque(bool opaque);
102  void releaseSurface();
103 
104 #ifdef QT_DIRECTFB_WM
105  void createWindow(const QRect &rect);
106  IDirectFBWindow *dfbWindow;
107 #else
108  enum Mode {
109  Primary,
110  Offscreen
111  } mode;
112 #endif
113 
114  DFBSurfaceFlipFlags flipFlags;
117 #ifdef QT_DIRECTFB_TIMING
118  int frames;
119  QTime timer;
120 #endif
121 };
122 
124 
126 
127 #endif // QT_NO_QWS_DIRECTFB
128 
129 #endif // QDIRECFBWINDOWSURFACE_H
The QWSWindowSurface class provides the drawing area for top-level windows in Qt for Embedded Linux...
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QPointer< QWidget > widget
#define QT_MODULE(x)
Definition: qglobal.h:2783
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
EventLoopTimerRef timer
QImage image() const
Implement this function to return an image of the top-level window.
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QTime class provides clock time functions.
Definition: qdatetime.h:148
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
QString key() const
Implement this function to return a string that uniquely identifies the class of this surface...
Mode
Definition: qaudio.h:60
QPaintDevice * paintDevice()
Implement this function to return the appropriate paint device.
DFBSurfaceFlipFlags flipFlags
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
#define class
#define QT_END_HEADER
Definition: qglobal.h:137
QTextStream & flush(QTextStream &stream)
Calls QTextStream::flush() on stream and returns stream.
static int area(const QSize &s)
Definition: qicon.cpp:155