Qt 4.8
qlinuxfbintegration.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 QGRAPHICSSYSTEM_LINUXFB_H
43 #define QGRAPHICSSYSTEM_LINUXFB_H
44 
45 #include <QPlatformIntegration>
46 #include "../fb_base/fb_base.h"
47 
49 
50 class QLinuxFbScreen : public QFbScreen
51 {
52  Q_OBJECT
53 public:
54  QLinuxFbScreen(uchar * d, int w, int h, int lstep, QImage::Format screenFormat);
55  void setGeometry(QRect rect);
57 
58 public slots:
59  QRegion doRedraw();
60 
61 private:
65 
67 };
68 
70 struct fb_cmap;
71 struct fb_var_screeninfo;
72 struct fb_fix_screeninfo;
73 
75 {
76 public:
79 
80  bool hasCapability(QPlatformIntegration::Capability cap) const;
81 
82  QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
83  QPlatformWindow *createPlatformWindow(QWidget *widget, WId WinId) const;
84  QWindowSurface *createWindowSurface(QWidget *widget, WId WinId) const;
85 
86  QList<QPlatformScreen *> screens() const { return mScreens; }
87 
88  QPlatformFontDatabase *fontDatabase() const;
89 
90 private:
94 
96 
99 
101 
103  int w;
104  int lstep;
105  int h;
106  int d;
108  bool grayscale;
109 
110  int dw;
111  int dh;
112 
113  int size; // Screen size
114  int mapsize; // Total mapped memory
115 
117 
120 
121  bool canaccel;
124 
125  bool connect(const QString &displaySpec);
126  bool initDevice();
127  void setPixelFormat(struct fb_var_screeninfo);
128  void createPalette(fb_cmap &cmap, fb_var_screeninfo &vinfo, fb_fix_screeninfo &finfo);
129  void blank(bool on);
131 };
132 
134 
135 #endif
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
Format
The following image formats are available in Qt.
Definition: qimage.h:91
unsigned int QRgb
Definition: qrgb.h:53
unsigned long WId
Definition: qwindowdefs.h:119
QLinuxFbIntegrationPrivate * d_ptr
int type
Definition: qmetatype.cpp:239
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QPointer< QWidget > widget
int d
the pixel depth
Definition: qscreen_qws.h:327
QList< QPlatformScreen * > mScreens
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static QColor cmap[256]
Definition: qgl_mac.mm:760
QRgb screenclut[256]
the color table
Definition: qscreen_qws.h:308
QList< QPlatformScreen * > screens() const
Accessor function to a list of all the screens on the current system.
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QPlatformWindow class provides an abstraction for top-level windows.
QImage::Format screenFormat
unsigned char uchar
Definition: qglobal.h:994
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QPlatformFontDatabase * fontDb
int w
the logical width of the screen.
Definition: qscreen_qws.h:324
virtual void blank(bool on)
Reimplemented Function
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
void createPalette(fb_cmap &cmap, fb_var_screeninfo &vinfo, fb_fix_screeninfo &finfo)
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
#define Q_OBJECT
Definition: qobjectdefs.h:157
The QWindowSurface class provides the drawing area for top-level windows.
The QPlatformIntegration class is the entry for WindowSystem specific functionality.
virtual bool connect(const QString &displaySpec)
This is called by Qt for Embedded Linux clients to map in the framebuffer.
void setFormat(QImage::Format format)
QLinuxFbScreen(int display_id)
Constructs a QLinuxFbScreen object.
QPainter * compositePainter
virtual bool initDevice()
This is called by the Qt for Embedded Linux server at startup time.
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void setPixelFormat(struct fb_var_screeninfo)
The QPlatformFontDatabase class makes it possible to customize how fonts are discovered and how they ...
int lstep
the number of bytes representing a line in the frame buffer.
Definition: qscreen_qws.h:325
QLinuxFbScreen * mPrimaryScreen
int h
the logical height of the screen.
Definition: qscreen_qws.h:326
#define slots
Definition: qobjectdefs.h:68
The QLinuxFbScreen class implements a screen driver for the Linux framebuffer.
void setGeometry(QRect rect)
The QList class is a template class that provides lists.
Definition: qdatastream.h:62