1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
'\" t
.TH QDirectPainter 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QDirectPainter \- Direct access to the video hardware
.SH SYNOPSIS
\fC#include <qdirectpainter_qws.h>\fR
.PP
Inherits QPainter.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQDirectPainter\fR ( const QWidget * w )"
.br
.ti -1c
.BI "\fB~QDirectPainter\fR ()"
.br
.ti -1c
.BI "uchar * \fBframeBuffer\fR ()"
.br
.ti -1c
.BI "int \fBlineStep\fR ()"
.br
.ti -1c
.BI "int \fBtransformOrientation\fR ()"
.br
.ti -1c
.BI "int \fBnumRects\fR () const"
.br
.ti -1c
.BI "const QRect & \fBrect\fR ( int i ) const"
.br
.ti -1c
.BI "QRegion \fBregion\fR () const"
.br
.ti -1c
.BI "int \fBdepth\fR () const"
.br
.ti -1c
.BI "int \fBwidth\fR () const"
.br
.ti -1c
.BI "int \fBheight\fR () const"
.br
.ti -1c
.BI "int \fBxOffset\fR () const"
.br
.ti -1c
.BI "int \fByOffset\fR () const"
.br
.ti -1c
.BI "QPoint \fBoffset\fR () const"
.br
.ti -1c
.BI "QSize \fBsize\fR () const"
.br
.ti -1c
.BI "void \fBsetAreaChanged\fR ( const QRect & r )"
.br
.in -1c
.SH DESCRIPTION
The QDirectPainter class provides direct access to the video hardware.
.PP
Only available in Qt/Embedded.
.PP
When the hardware is known and well defined, as is often the case with software for embedded devices, it may be useful to manipulate the underlying video hardware directly. In order to do this in a way that is co-operative with other applications, you must lock the video hardware for exclusive use for a small time while you write to it, and you must know the clipping region which is allocated to a widget.
.PP
QDirectPainter provides this functionality.
.PP
In the simplest case, you make a QDirectPainter on a widget and then, observing the clip region, perform some platform-specific operation. For example:
.PP
.nf
.br
void MyWidget::updatePlatformGraphics()
.br
{
.br
QDirectPainter dp( this );
.br
for ( int i = 0; i < dp.numRects; i++ ) {
.br
const QRect& clip = dp.rect(i);
.br
... // platform specific operation
.br
}
.br
}
.br
.fi
.PP
The platform-specific code has access to the display, but should only modify graphics in the rectangles specified by numRects() and rect(). Note that these rectangles are relative to the entire display.
.PP
The offset() function returns the position of the widget relative to the entire display, allowing you to offset platform-specific operations appropriately. The xOffset() and yOffset() functions merely return the component values of offset().
.PP
For simple frame-buffer hardware, the frameBuffer(), lineStep(), and depth() functions provide basic access, though some hardware configurations are insufficiently specified by such simple parameters.
.PP
Note that while a QDirectPainter exists, the entire Qt/Embedded window system is locked from use by other applications. Always construct the QDirectPainter as an auto (stack) variable, and be very careful to write robust and stable code within its scope.
.PP
See also Graphics Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QDirectPainter::QDirectPainter ( const QWidget * w )"
Construct a direct painter on \fIw\fR. The display is locked and the mouse cursor is hidden if it is above \fIw\fR.
.SH "QDirectPainter::~QDirectPainter ()"
Destroys the direct painter. The mouse cursor is revealed if necessary and the display is unlocked.
.SH "int QDirectPainter::depth () const"
Returns the bit-depth of the display.
.SH "uchar * QDirectPainter::frameBuffer ()"
Returns a pointer to the framebuffer memory if available.
.SH "int QDirectPainter::height () const"
Returns the height of the widget drawn upon.
.SH "int QDirectPainter::lineStep ()"
Returns the spacing in bytes from one framebuffer line to the next.
.SH "int QDirectPainter::numRects () const"
Returns the number of rectangles in the drawable region.
.PP
See also rect() and region().
.SH "QPoint QDirectPainter::offset () const"
Returns the position of the widget relative to the entire display.
.SH "const QRect & QDirectPainter::rect ( int i ) const"
Returns a reference to rectangle \fIi\fR of the drawable region. Valid values for \fIi\fR are 0..numRects()-1.
.PP
See also region().
.SH "QRegion QDirectPainter::region () const"
Returns the region of the framebuffer which represents the exposed area of the widget being painted on. Note that this may be a sub-area of the clip region, because of child widgets and overlapping cousin widgets.
.PP
See also numRects() and rect().
.SH "void QDirectPainter::setAreaChanged ( const QRect & r )"
Sets the area changed by the transaction to \fIr\fR. By default, the entire widget is assumed to have changed. The area changed is only used by some graphics drivers, so often calling this function for a smaller area will make no difference to performance.
.SH "QSize QDirectPainter::size () const"
Returns the size of the widget drawn upon.
.PP
See also width() and height().
.SH "int QDirectPainter::transformOrientation ()"
Returns a number that signifies the orientation of the framebuffer. <center>.nf
.TS
l - l. 0 no rotation 1 90 degrees rotation 2 180 degrees rotation 3
.TE
.fi
</center>
.SH "int QDirectPainter::width () const"
Returns the width of the widget drawn upon.
.SH "int QDirectPainter::xOffset () const"
Returns the X-position of the widget relative to the entire display.
.SH "int QDirectPainter::yOffset () const"
Returns the Y-position of the widget relative to the entire
display.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qdirectpainter.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqdirectpainter.3qt) and the Qt
version (3.3.8).
|