Qt 4.8
pvreglscreen.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 PVREGLSCREEN_H
43 #define PVREGLSCREEN_H
44 
45 #include <QScreen>
46 #include <QGLScreen>
47 #include "pvrqwsdrawable.h"
48 
49 class PvrEglScreen;
50 
52 {
53 public:
55  : screen(s), displayId(screenNum) {}
56 
58 
59 private:
61  int displayId;
62 };
63 
64 class PvrEglScreen : public QGLScreen
65 {
66 public:
68  ~PvrEglScreen();
69 
70  bool initDevice();
71  bool connect(const QString &displaySpec);
72  void disconnect();
73  void shutdownDevice();
74  void setMode(int, int, int) {}
75 
76  void blit(const QImage &img, const QPoint &topLeft, const QRegion &region);
77  void solidFill(const QColor &color, const QRegion &region);
78 
79  bool chooseContext(QGLContext *context, const QGLContext *shareContext);
80  bool hasOpenGL();
81 
84 
85  int transformation() const;
86 
87 private:
88  void sync();
89  void openTty();
90  void closeTty();
91 
92  int fd;
93  int ttyfd, oldKdMode;
96  mutable const QScreen *parent;
97 };
98 
99 #endif
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
The QWSWindowSurface class provides the drawing area for top-level windows in Qt for Embedded Linux...
QPointer< QWidget > widget
bool doGraphicsMode
Definition: pvreglscreen.h:95
void setMode(int, int, int)
Implement this function to reset the framebuffer&#39;s resolution (width and height) and bit depth...
Definition: pvreglscreen.h:74
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
const QScreen * parent
Definition: pvreglscreen.h:96
The QString class provides a Unicode character string.
Definition: qstring.h:83
NativeWindowType EGLNativeWindowType
Definition: qegl_p.h:116
PvrEglScreenSurfaceFunctions(PvrEglScreen *s, int screenNum)
Definition: pvreglscreen.h:54
QString ttyDevice
Definition: pvreglscreen.h:94
The QGLContext class encapsulates an OpenGL rendering context.
Definition: qgl.h:310
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
bool createNativeWindow(QWidget *widget, EGLNativeWindowType *native)
[2]
Q_GUI_EXPORT EGLSurface createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *surfaceAttribs=0)
Definition: qegl_x11.cpp:333
int key
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QGLScreenSurfaceFunctions class encapsulates the functions for creating native windows and pixmap...
Definition: qglscreen_qws.h:81
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
This class encapsulates an OpenGL screen driver.
Definition: qglscreen_qws.h:89