1QScreen(3qt)                                                      QScreen(3qt)
2
3
4

NAME

6       QScreen - And its descendants manage the framebuffer and palette
7

SYNOPSIS

9       #include <qgfx_qws.h>
10
11   Public Members
12       QScreen ( int display_id )
13       virtual ~QScreen ()
14       virtual bool initDevice () = 0
15       virtual bool connect ( const QString & displaySpec ) = 0
16       virtual void disconnect () = 0
17       virtual int initCursor ( void * end_of_location, bool init = FALSE )
18       virtual void shutdownDevice ()
19       virtual void setMode ( int, int, int ) = 0
20       virtual bool supportsDepth ( int d ) const
21       virtual QGfx * createGfx ( unsigned char * bytes, int w, int h, int d,
22           int linestep )
23       virtual QGfx * screenGfx ()
24       virtual void save ()
25       virtual void restore ()
26       virtual void blank ( bool on )
27       virtual int pixmapOffsetAlignment ()
28       virtual int pixmapLinestepAlignment ()
29       virtual bool onCard ( unsigned char * p ) const
30       virtual bool onCard ( unsigned char * p, ulong & offset ) const
31       virtual void set ( unsigned int, unsigned int, unsigned int, unsigned
32           int )
33       virtual int alloc ( unsigned int r, unsigned int g, unsigned int b )
34       int width () const
35       int height () const
36       int depth () const
37       virtual int pixmapDepth () const
38       int pixelType () const
39       int linestep () const
40       int deviceWidth () const
41       int deviceHeight () const
42       uchar * base () const
43       virtual uchar * cache ( int, int )
44       virtual void uncache ( uchar * )
45       int screenSize () const
46       int totalSize () const
47       QRgb * clut ()
48       int numCols ()
49       virtual QSize mapToDevice ( const QSize & s ) const
50       virtual QSize mapFromDevice ( const QSize & s ) const
51       virtual QPoint mapToDevice ( const QPoint &, const QSize & ) const
52       virtual QPoint mapFromDevice ( const QPoint &, const QSize & ) const
53       virtual QRect mapToDevice ( const QRect & r, const QSize & ) const
54       virtual QRect mapFromDevice ( const QRect & r, const QSize & ) const
55       virtual QImage mapToDevice ( const QImage & i ) const
56       virtual QImage mapFromDevice ( const QImage & i ) const
57       virtual QRegion mapToDevice ( const QRegion & r, const QSize & ) const
58       virtual QRegion mapFromDevice ( const QRegion & r, const QSize & )
59           const
60       virtual int transformOrientation () const
61       virtual bool isTransformed () const
62       virtual bool isInterlaced () const
63       virtual void setDirty ( const QRect & )
64       int * opType ()
65       int * lastOp ()
66

DESCRIPTION

68       The QScreen class and its descendants manage the framebuffer and
69       palette.
70
71       QScreens act as factories for the screen cursor and QGfx's.
72       QLinuxFbScreen manages a Linux framebuffer; accelerated drivers
73       subclass QLinuxFbScreen. There can only be one screen in a Qt/Embedded
74       application.
75
76       See also Qt/Embedded.
77

MEMBER FUNCTION DOCUMENTATION

QScreen::QScreen ( int display_id )

80       Create a screen; the display_id is the number of the Qt/Embedded server
81       to connect to.
82

QScreen::~QScreen () [virtual]

84       Destroys a QScreen
85

int QScreen::alloc ( unsigned int r, unsigned int g, unsigned int b )

87       [virtual]
88       Given an RGB value r g b, return an index which is the closest match to
89       it in the screen's palette. Used in paletted modes only.
90

uchar * QScreen::base () const

92       Returns a pointer to the start of the framebuffer.
93

void QScreen::blank ( bool on ) [virtual]

95       If on is true, blank the screen. Otherwise unblank it.
96

uchar * QScreen::cache ( int, int ) [virtual]

98       This function is used to store pixmaps in graphics memory for the use
99       of the accelerated drivers. See QLinuxFbScreen (where the cacheing is
100       implemented) for more information.
101

QRgb * QScreen::clut ()

103       Returns the screen's color lookup table (color palette). This is only
104       valid in paletted modes (8bpp and lower).
105

bool QScreen::connect ( const QString & displaySpec ) [pure virtual]

107       This function is called by every Qt/Embedded application on startup. It
108       maps in the framebuffer and in the accelerated drivers the graphics
109       card control registers. displaySpec has the following syntax:
110
111       [gfx driver][:driver specific options][:display number]
112
113       for example if you want to use the mach64 driver on fb1 as display 2:
114
115       Mach64:/dev/fb1:2
116
117       displaySpec is passed in via the QWS_DISPLAY environment variable or
118       the -display command line parameter.
119

QGfx * QScreen::createGfx ( unsigned char * bytes, int w, int h, int d, int

121       linestep ) [virtual]
122       Creates a gfx on an arbitrary buffer bytes, width w and height h in
123       pixels, depth d and linestep (length in bytes of each line in the
124       buffer). Accelerated drivers can check to see if bytes points into
125       graphics memory and create an accelerated Gfx.
126

int QScreen::depth () const

128       Gives the depth in bits per pixel of the framebuffer. This is the
129       number of bits each pixel takes up rather than the number of
130       significant bits, so 24bpp and 32bpp express the same range of colors
131       (8 bits of red, green and blue)
132

int QScreen::deviceHeight () const

134       Gives the full height of the framebuffer device, as opposed to the
135       height which Qt/Embedded will actually use. These can differ if the
136       display is centered within the framebuffer.
137

int QScreen::deviceWidth () const

139       Gives the full width of the framebuffer device, as opposed to the width
140       which Qt/Embedded will actually use. These can differ if the display is
141       centered within the framebuffer.
142

void QScreen::disconnect () [pure virtual]

144       This function is called by every Qt/Embedded application just before
145       exitting; it's normally used to unmap the framebuffer.
146

int QScreen::height () const

148       Gives the height in pixels of the framebuffer.
149

int QScreen::initCursor ( void * end_of_location, bool init = FALSE )

151       [virtual]
152       This is used to initialize the software cursor - end_of_location points
153       to the address after the area where the cursor image can be stored.
154       init is true for the first application this method is called from (the
155       Qt/Embedded server), false otherwise.
156

bool QScreen::initDevice () [pure virtual]

158       This function is called by the Qt/Embedded server when initializing the
159       framebuffer. Accelerated drivers use it to set up the graphics card.
160

bool QScreen::isInterlaced () const [virtual]

162       Returns TRUE if the display is interlaced (for instance a television
163       screen); otherwise returns FALSE. If TRUE, drawing is altered to look
164       better on such displays.
165

bool QScreen::isTransformed () const [virtual]

167       Returns TRUE if the screen is transformed (for instance, rotated 90
168       degrees); otherwise returns FALSE. QScreen's version always returns
169       FALSE.
170

int * QScreen::lastOp ()

172       Returns the screens last operation.
173

int QScreen::linestep () const

175       Returns the length in bytes of each scanline of the framebuffer.
176

QSize QScreen::mapFromDevice ( const QSize & s ) const [virtual]

178       Map a framebuffer coordinate to the coordinate space used by the
179       application. Used by the rotated driver; the QScreen implementation
180       simply returns s.
181

QPoint QScreen::mapFromDevice ( const QPoint &, const QSize & ) const

183       [virtual]
184       This is an overloaded member function, provided for convenience. It
185       behaves essentially like the above function.
186
187       Map a framebuffer coordinate to the coordinate space used by the
188       application. Used by the rotated driver; the QScreen implementation
189       simply returns the point.
190

QRect QScreen::mapFromDevice ( const QRect & r, const QSize & ) const

192       [virtual]
193       This is an overloaded member function, provided for convenience. It
194       behaves essentially like the above function.
195
196       Map a framebuffer coordinate to the coordinate space used by the
197       application. Used by the rotated driver; the QScreen implementation
198       simply returns r.
199

QImage QScreen::mapFromDevice ( const QImage & i ) const [virtual]

201       This is an overloaded member function, provided for convenience. It
202       behaves essentially like the above function.
203
204       Transforms an image so that it matches the application coordinate space
205       (e.g. rotating it 90 degrees counter-clockwise). The QScreen
206       implementation simply returns i.
207

QRegion QScreen::mapFromDevice ( const QRegion & r, const QSize & ) const

209       [virtual]
210       This is an overloaded member function, provided for convenience. It
211       behaves essentially like the above function.
212
213       Transforms a region so that it matches the application coordinate space
214       (e.g. rotating it 90 degrees counter-clockwise). The QScreen
215       implementation simply returns r.
216

QSize QScreen::mapToDevice ( const QSize & s ) const [virtual]

218       Map a user coordinate to the one to actually draw. Used by the rotated
219       driver; the QScreen implementation simply returns s.
220

QPoint QScreen::mapToDevice ( const QPoint &, const QSize & ) const [virtual]

222       This is an overloaded member function, provided for convenience. It
223       behaves essentially like the above function.
224
225       Map a user coordinate to the one to actually draw. Used by the rotated
226       driver; the QScreen implementation simply returns the point passed in.
227

QRect QScreen::mapToDevice ( const QRect & r, const QSize & ) const [virtual]

229       This is an overloaded member function, provided for convenience. It
230       behaves essentially like the above function.
231
232       Map a user coordinate to the one to actually draw. Used by the rotated
233       driver; the QScreen implementation simply returns r.
234

QImage QScreen::mapToDevice ( const QImage & i ) const [virtual]

236       This is an overloaded member function, provided for convenience. It
237       behaves essentially like the above function.
238
239       Transforms an image so that it fits the device coordinate space (e.g.
240       rotating it 90 degrees clockwise). The QScreen implementation simply
241       returns i.
242

QRegion QScreen::mapToDevice ( const QRegion & r, const QSize & ) const

244       [virtual]
245       This is an overloaded member function, provided for convenience. It
246       behaves essentially like the above function.
247
248       Transforms a region so that it fits the device coordinate space (e.g.
249       rotating it 90 degrees clockwise). The QScreen implementation simply
250       returns r.
251

int QScreen::numCols ()

253       Returns the number of entries in the color table returned by clut().
254

bool QScreen::onCard ( unsigned char * p ) const [virtual]

256       Returns true if the buffer pointed to by p is within graphics card
257       memory, false if it's in main RAM.
258

bool QScreen::onCard ( unsigned char * p, ulong & offset ) const [virtual]

260       This is an overloaded member function, provided for convenience. It
261       behaves essentially like the above function.
262
263       This checks whether the buffer specified by p is on the card (as per
264       the other version of onCard) and returns an offset in bytes from the
265       start of graphics card memory in offset if it is.
266

int * QScreen::opType ()

268       Returns the screen's operation type.
269

int QScreen::pixelType () const

271       Returns an integer (taking the same values as QGfx::PixelType) that
272       specifies the pixel storage format of the screen.
273

int QScreen::pixmapDepth () const [virtual]

275       Gives the preferred depth for pixmaps. By default this is the same as
276       the screen depth, but for the VGA16 driver it's 8bpp.
277

int QScreen::pixmapLinestepAlignment () [virtual]

279       Returns the value in bits to which individual scanlines of pixmaps held
280       in graphics card memory should be aligned. This is only useful for
281       accelerated drivers. By default the value returned is 64 but it can be
282       overridden by individual accelerated drivers.
283

int QScreen::pixmapOffsetAlignment () [virtual]

285       Returns the value in bits to which the start address of pixmaps held in
286       graphics card memory should be aligned. This is only useful for
287       accelerated drivers. By default the value returned is 64 but it can be
288       overridden by individual accelerated drivers.
289

void QScreen::restore () [virtual]

291       Restores the state of the graphics card from a previous save()
292

void QScreen::save () [virtual]

294       Saves the state of the graphics card - used so that, for instance, the
295       palette can be restored when switching between linux virtual consoles.
296       Hardware QScreen descendants should save register state here if
297       necessary if switching between virtual consoles (for example to/from X)
298       is to be permitted.
299

QGfx * QScreen::screenGfx () [virtual]

301       Returns a QGfx (normally a QGfxRaster) initialized to point to the
302       screen, with an origin at 0,0 and a clip region covering the whole
303       screen.
304

int QScreen::screenSize () const

306       Returns the size in bytes of the screen. This is always located at the
307       beginning of framebuffer memory (i.e. at base()).
308

void QScreen::set ( unsigned int, unsigned int, unsigned int, unsigned int )

310       [virtual]
311       Sets an entry in the color palette.
312

void QScreen::setDirty ( const QRect & ) [virtual]

314       Indicates which section of the screen has been altered. Used by the VNC
315       and VFB displays; the QScreen version does nothing.
316

void QScreen::setMode ( int, int, int ) [pure virtual]

318       This function can be used to set the framebuffer width, height and
319       depth. It's currently unused.
320

void QScreen::shutdownDevice () [virtual]

322       Called by the Qt/Embedded server on shutdown; never called by a
323       Qt/Embedded client. This is intended to support graphics card specific
324       shutdown; the unaccelerated implementation simply hides the mouse
325       cursor.
326

bool QScreen::supportsDepth ( int d ) const [virtual]

328       Returns true if the screen supports a particular color depth d.
329       Possible values are 1,4,8,16 and 32.
330

int QScreen::totalSize () const

332       Returns the size in bytes of available graphics card memory, including
333       the screen. Offscreen memory is only used by the accelerated drivers.
334

int QScreen::transformOrientation () const [virtual]

336       Used by the rotated server. The QScreeen implementation returns 0.
337

void QScreen::uncache ( uchar * ) [virtual]

339       This function is called on pixmap destruction to remove them from
340       graphics card memory.
341

int QScreen::width () const

343       Gives the width in pixels of the framebuffer.
344
345

SEE ALSO

347       http://doc.trolltech.com/qscreen.html
348       http://www.trolltech.com/faq/tech.html
349
351       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
352       license file included in the distribution for a complete license
353       statement.
354

AUTHOR

356       Generated automatically from the source code.
357

BUGS

359       If you find a bug in Qt, please report it as described in
360       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
361       help you. Thank you.
362
363       The definitive Qt documentation is provided in HTML format; it is
364       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
365       web browser. This man page is provided as a convenience for those users
366       who prefer man pages, although this format is not officially supported
367       by Trolltech.
368
369       If you find errors in this manual page, please report them to qt-
370       bugs@trolltech.com.  Please include the name of the manual page
371       (qscreen.3qt) and the Qt version (3.3.8).
372
373
374
375Trolltech AS                    2 February 2007                   QScreen(3qt)
Impressum