0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
** All rights reserved.
|
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
6 |
**
|
|
7 |
** This file is part of the documentation of the Qt Toolkit.
|
|
8 |
**
|
|
9 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
10 |
** No Commercial Usage
|
|
11 |
** This file contains pre-release code and may not be distributed.
|
|
12 |
** You may use this file in accordance with the terms and conditions
|
|
13 |
** contained in the Technology Preview License Agreement accompanying
|
|
14 |
** this package.
|
|
15 |
**
|
|
16 |
** GNU Lesser General Public License Usage
|
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
18 |
** General Public License version 2.1 as published by the Free Software
|
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
20 |
** packaging of this file. Please review the following information to
|
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
23 |
**
|
|
24 |
** In addition, as a special exception, Nokia gives you certain additional
|
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
27 |
**
|
|
28 |
** If you have questions regarding the use of this file, please contact
|
|
29 |
** Nokia at qt-info@nokia.com.
|
|
30 |
**
|
|
31 |
**
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
38 |
** $QT_END_LICENSE$
|
|
39 |
**
|
|
40 |
****************************************************************************/
|
|
41 |
|
|
42 |
/*!
|
|
43 |
\page qt-embedded-displaymanagement.html
|
|
44 |
|
|
45 |
\title Qt for Embedded Linux Display Management
|
|
46 |
\ingroup qt-embedded-linux
|
|
47 |
|
|
48 |
When rendering, the default behavior for each Qt for Embedded Linux
|
|
49 |
client is to render its widgets into memory, while the server is
|
|
50 |
responsible for putting the contents of the memory onto the
|
|
51 |
screen. The server uses the screen driver to copy the content of
|
|
52 |
the memory to the display.
|
|
53 |
|
|
54 |
The screen driver is loaded by the server application when it
|
|
55 |
starts running, using Qt's \l {How to Create Qt Plugins}{plugin
|
|
56 |
system}.
|
|
57 |
|
|
58 |
Contents:
|
|
59 |
|
|
60 |
\tableofcontents
|
|
61 |
|
|
62 |
\section1 Available Drivers
|
|
63 |
|
|
64 |
\l{Qt for Embedded Linux} provides drivers for the Linux framebuffer, the
|
|
65 |
virtual framebuffer, transformed screens, VNC servers and multi
|
|
66 |
screens. Run the \c configure script to list the available
|
|
67 |
drivers:
|
|
68 |
|
|
69 |
\if defined(QTOPIA_DOCS)
|
|
70 |
\snippet doc/src/snippets/code/doc_src_qt-embedded-displaymanagement.qdoc 0
|
|
71 |
\else
|
|
72 |
\snippet doc/src/snippets/code/doc_src_qt-embedded-displaymanagement.qdoc 1
|
|
73 |
\endif
|
|
74 |
|
|
75 |
\if defined(QTOPIA_DOCS)
|
|
76 |
In the default Qt Extended configuration, only an unaccelerated Linux
|
|
77 |
framebuffer driver (\c /dev/fb0) is enabled. The various drivers
|
|
78 |
can be enabled and disabled using the \c configure script. For
|
|
79 |
example:
|
|
80 |
|
|
81 |
\snippet doc/src/snippets/code/doc_src_qt-embedded-displaymanagement.qdoc 2
|
|
82 |
\else
|
|
83 |
In the default Qt configuration, only an unaccelerated Linux
|
|
84 |
framebuffer driver (\c /dev/fb0) is enabled. The various drivers
|
|
85 |
can be enabled and disabled using the \c configure script. For
|
|
86 |
example:
|
|
87 |
|
|
88 |
\snippet doc/src/snippets/code/doc_src_qt-embedded-displaymanagement.qdoc 3
|
|
89 |
\endif
|
|
90 |
|
|
91 |
Custom screen drivers can be implemented by subclassing the
|
|
92 |
QScreen class and creating a screen driver plugin (derived from
|
|
93 |
the QScreenDriverPlugin class). The default implementation
|
|
94 |
of the QScreenDriverFactory class will automatically detect the
|
|
95 |
plugin, loading the driver into the server application at run-time.
|
|
96 |
|
|
97 |
\section1 Specifying a Driver
|
|
98 |
|
|
99 |
To specify which driver to use, set the QWS_DISPLAY environment
|
|
100 |
variable. For example (if the current shell is bash, ksh, zsh or
|
|
101 |
sh):
|
|
102 |
|
|
103 |
\snippet doc/src/snippets/code/doc_src_qt-embedded-displaymanagement.qdoc 4
|
|
104 |
|
|
105 |
The valid values for the \c <driver> argument are \c LinuxFb, \c
|
|
106 |
QVFb, \c VNC, \c Transformed, \c Multi and \l
|
|
107 |
{QScreenDriverPlugin::keys()}{keys} identifying custom drivers,
|
|
108 |
and the \c {<display num>} argument is used to separate screens
|
|
109 |
that are using the same screen driver and to enable multiple
|
|
110 |
displays (see the \l {Running Qt for Embedded Linux Applications}
|
|
111 |
documentation for more details). The driver specific options are
|
|
112 |
described in the table below.
|
|
113 |
|
|
114 |
\table
|
|
115 |
\header
|
|
116 |
\o Driver Specific Option \o Available For \o Description
|
|
117 |
\row
|
|
118 |
\o \c tty=<device>
|
|
119 |
\o LinuxFb
|
|
120 |
\o Passes the device file to the console the application is
|
|
121 |
running on.
|
|
122 |
\row
|
|
123 |
\o \c nographicsmodeswitch
|
|
124 |
\o LinuxFb
|
|
125 |
\o Ensures that the application is not in graphics mode.
|
|
126 |
\row
|
|
127 |
\o \c littleendian
|
|
128 |
\o LinuxFb
|
|
129 |
\o Tells the driver it must handle a little-endian frame
|
|
130 |
buffer in a big-endian system.
|
|
131 |
\row
|
|
132 |
\o \c mmWidth=<value> \target mmWidth
|
|
133 |
\o LinuxFb, QVFb
|
|
134 |
\o The screen's physical width (used to calculate DPI).
|
|
135 |
\row
|
|
136 |
\o \c mmHeight=<value> \target mmHeight
|
|
137 |
\o LinuxFb, QVFb
|
|
138 |
\o The screen's physical height (used to calculate DPI).
|
|
139 |
\row
|
|
140 |
\o \c <device>
|
|
141 |
\o LinuxFb
|
|
142 |
\o
|
|
143 |
\row
|
|
144 |
\o \c <subdriver>
|
|
145 |
\o VNC, Transformed, Multi
|
|
146 |
\o Specifies a subdriver.
|
|
147 |
\row
|
|
148 |
\o \c <RotX>
|
|
149 |
\o Transformed
|
|
150 |
\o Specifies the rotation of the screen. The valid values of
|
|
151 |
\c X are 90, 180 and 270.
|
|
152 |
\row
|
|
153 |
\o \c offset=<x,y>
|
|
154 |
\o Multi
|
|
155 |
\o Specifies the coordinates of a subscreen's top-left corner
|
|
156 |
(by default 0,0).
|
|
157 |
|
|
158 |
\endtable
|
|
159 |
|
|
160 |
The QWS_DISPLAY environment variable can also be set using the \c
|
|
161 |
-display option when running an application. For example:
|
|
162 |
|
|
163 |
\snippet doc/src/snippets/code/doc_src_qt-embedded-displaymanagement.qdoc 5
|
|
164 |
|
|
165 |
\section1 Subdrivers and Multiple Drivers
|
|
166 |
|
|
167 |
The VNC, Transformed and Multi screen drivers depend on
|
|
168 |
subdrivers. The general syntax for specifying a driver is as
|
|
169 |
follows:
|
|
170 |
|
|
171 |
\snippet doc/src/snippets/code/doc_src_qt-embedded-displaymanagement.qdoc 6
|
|
172 |
|
|
173 |
In the case of subdrivers, it is important to add a space between
|
|
174 |
each subdriver and before the display number to separate the
|
|
175 |
various drivers and displays. Note that \c Multi screen drivers
|
|
176 |
can have several subdrivers. For example:
|
|
177 |
|
|
178 |
\snippet doc/src/snippets/code/doc_src_qt-embedded-displaymanagement.qdoc 7
|
|
179 |
|
|
180 |
Note also that the VNC screen driver defaults to a virtual screen
|
|
181 |
driver if no subdriver is specified. In this case the VNC driver accepts a
|
|
182 |
few additional (optional) arguments specifying the size and depth
|
|
183 |
of the default virtual screen:
|
|
184 |
|
|
185 |
\list
|
|
186 |
\o \c {size=<width x height>}
|
|
187 |
\o \c {depth=<value>}
|
|
188 |
\o \c {mmHeight=<physical height in millimeters>}
|
|
189 |
\o \c {mmWidth=<physical width in millimeters>}
|
|
190 |
\endlist
|
|
191 |
|
|
192 |
Example running the VNC screen driver with a virtual screen of size
|
|
193 |
720x480 with 32 bits per pixel:
|
|
194 |
|
|
195 |
\snippet doc/src/snippets/code/doc_src_qt-embedded-displaymanagement.qdoc 8
|
|
196 |
|
|
197 |
Example running the VNC screen driver on top of the Linux framebuffer
|
|
198 |
driver:
|
|
199 |
|
|
200 |
\snippet doc/src/snippets/code/doc_src_qt-embedded-displaymanagement.qdoc 9
|
|
201 |
|
|
202 |
In this last example, Qt is using two screen drivers simultaneously,
|
|
203 |
displaying output on both the device's screen and across a network on
|
|
204 |
VNC client displays.
|
|
205 |
*/
|