You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
202 lines
9.3 KiB
202 lines
9.3 KiB
14 years ago
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
|
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qdirectpainter_qws.cpp:72 -->
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||
|
<title>QDirectPainter Class</title>
|
||
|
<style type="text/css"><!--
|
||
|
fn { margin-left: 1cm; text-indent: -1cm; }
|
||
|
a:link { color: #004faf; text-decoration: none }
|
||
|
a:visited { color: #672967; text-decoration: none }
|
||
|
body { background: #ffffff; color: black; }
|
||
|
--></style>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||
|
<tr bgcolor="#E5E5E5">
|
||
|
<td valign=center>
|
||
|
<a href="index.html">
|
||
|
<font color="#004faf">Home</font></a>
|
||
|
| <a href="classes.html">
|
||
|
<font color="#004faf">All Classes</font></a>
|
||
|
| <a href="mainclasses.html">
|
||
|
<font color="#004faf">Main Classes</font></a>
|
||
|
| <a href="annotated.html">
|
||
|
<font color="#004faf">Annotated</font></a>
|
||
|
| <a href="groups.html">
|
||
|
<font color="#004faf">Grouped Classes</font></a>
|
||
|
| <a href="functions.html">
|
||
|
<font color="#004faf">Functions</font></a>
|
||
|
</td>
|
||
|
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QDirectPainter Class Reference</h1>
|
||
|
|
||
|
<p>The QDirectPainter class provides direct access to the video hardware.
|
||
|
<a href="#details">More...</a>
|
||
|
<p><tt>#include <<a href="qdirectpainter_qws-h.html">qdirectpainter_qws.h</a>></tt>
|
||
|
<p>Inherits <a href="qpainter.html">QPainter</a>.
|
||
|
<p><a href="qdirectpainter-members.html">List of all member functions.</a>
|
||
|
<h2>Public Members</h2>
|
||
|
<ul>
|
||
|
<li class=fn><a href="#QDirectPainter"><b>QDirectPainter</b></a> ( const QWidget * w )</li>
|
||
|
<li class=fn><a href="#~QDirectPainter"><b>~QDirectPainter</b></a> ()</li>
|
||
|
<li class=fn>uchar * <a href="#frameBuffer"><b>frameBuffer</b></a> ()</li>
|
||
|
<li class=fn>int <a href="#lineStep"><b>lineStep</b></a> ()</li>
|
||
|
<li class=fn>int <a href="#transformOrientation"><b>transformOrientation</b></a> ()</li>
|
||
|
<li class=fn>int <a href="#numRects"><b>numRects</b></a> () const</li>
|
||
|
<li class=fn>const QRect & <a href="#rect"><b>rect</b></a> ( int i ) const</li>
|
||
|
<li class=fn>QRegion <a href="#region"><b>region</b></a> () const</li>
|
||
|
<li class=fn>int <a href="#depth"><b>depth</b></a> () const</li>
|
||
|
<li class=fn>int <a href="#width"><b>width</b></a> () const</li>
|
||
|
<li class=fn>int <a href="#height"><b>height</b></a> () const</li>
|
||
|
<li class=fn>int <a href="#xOffset"><b>xOffset</b></a> () const</li>
|
||
|
<li class=fn>int <a href="#yOffset"><b>yOffset</b></a> () const</li>
|
||
|
<li class=fn>QPoint <a href="#offset"><b>offset</b></a> () const</li>
|
||
|
<li class=fn>QSize <a href="#size"><b>size</b></a> () const</li>
|
||
|
<li class=fn>void <a href="#setAreaChanged"><b>setAreaChanged</b></a> ( const QRect & r )</li>
|
||
|
</ul>
|
||
|
<hr><a name="details"></a><h2>Detailed Description</h2>
|
||
|
|
||
|
|
||
|
The QDirectPainter class provides direct access to the video hardware.
|
||
|
<p>
|
||
|
<p> Only available in Qt/Embedded.
|
||
|
<p> 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.
|
||
|
<p> QDirectPainter provides this functionality.
|
||
|
<p> In the simplest case, you make a QDirectPainter on a widget and
|
||
|
then, observing the clip region, perform some platform-specific
|
||
|
operation. For example:
|
||
|
<pre>
|
||
|
void MyWidget::updatePlatformGraphics()
|
||
|
{
|
||
|
QDirectPainter dp( this );
|
||
|
for ( int i = 0; i < dp.numRects; i++ ) {
|
||
|
const <a href="qrect.html">QRect</a>& clip = dp.<a href="#rect">rect</a>(i);
|
||
|
... // platform specific operation
|
||
|
}
|
||
|
}
|
||
|
</pre>
|
||
|
|
||
|
<p> The platform-specific code has access to the display, but should
|
||
|
only modify graphics in the rectangles specified by <a href="#numRects">numRects</a>() and
|
||
|
<a href="#rect">rect</a>(). Note that these rectangles are relative to the entire
|
||
|
display.
|
||
|
<p> The <a href="#offset">offset</a>() function returns the position of the widget relative
|
||
|
to the entire display, allowing you to offset platform-specific
|
||
|
operations appropriately. The <a href="#xOffset">xOffset</a>() and <a href="#yOffset">yOffset</a>() functions
|
||
|
merely return the component values of offset().
|
||
|
<p> For simple frame-buffer hardware, the <a href="#frameBuffer">frameBuffer</a>(), <a href="#lineStep">lineStep</a>(),
|
||
|
and <a href="#depth">depth</a>() functions provide basic access, though some hardware
|
||
|
configurations are insufficiently specified by such simple
|
||
|
parameters.
|
||
|
<p> 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.
|
||
|
<p>See also <a href="graphics.html">Graphics Classes</a>.
|
||
|
|
||
|
<hr><h2>Member Function Documentation</h2>
|
||
|
<h3 class=fn><a name="QDirectPainter"></a>QDirectPainter::QDirectPainter ( const <a href="qwidget.html">QWidget</a> * w )
|
||
|
</h3>
|
||
|
Construct a direct painter on <em>w</em>. The display is locked and the
|
||
|
mouse cursor is hidden if it is above <em>w</em>.
|
||
|
|
||
|
<h3 class=fn><a name="~QDirectPainter"></a>QDirectPainter::~QDirectPainter ()
|
||
|
</h3>
|
||
|
Destroys the direct painter. The mouse cursor is revealed if
|
||
|
necessary and the display is unlocked.
|
||
|
|
||
|
<h3 class=fn>int <a name="depth"></a>QDirectPainter::depth () const
|
||
|
</h3>
|
||
|
Returns the bit-depth of the display.
|
||
|
|
||
|
<h3 class=fn>uchar * <a name="frameBuffer"></a>QDirectPainter::frameBuffer ()
|
||
|
</h3>
|
||
|
Returns a pointer to the framebuffer memory if available.
|
||
|
|
||
|
<h3 class=fn>int <a name="height"></a>QDirectPainter::height () const
|
||
|
</h3>
|
||
|
Returns the height of the widget drawn upon.
|
||
|
|
||
|
<h3 class=fn>int <a name="lineStep"></a>QDirectPainter::lineStep ()
|
||
|
</h3>
|
||
|
Returns the spacing in bytes from one framebuffer line to the
|
||
|
next.
|
||
|
|
||
|
<h3 class=fn>int <a name="numRects"></a>QDirectPainter::numRects () const
|
||
|
</h3>
|
||
|
Returns the number of rectangles in the drawable region.
|
||
|
<p> <p>See also <a href="#rect">rect</a>() and <a href="#region">region</a>().
|
||
|
|
||
|
<h3 class=fn><a href="qpoint.html">QPoint</a> <a name="offset"></a>QDirectPainter::offset () const
|
||
|
</h3>
|
||
|
Returns the position of the widget relative to the entire display.
|
||
|
|
||
|
<h3 class=fn>const <a href="qrect.html">QRect</a> & <a name="rect"></a>QDirectPainter::rect ( int i ) const
|
||
|
</h3>
|
||
|
Returns a reference to rectangle <em>i</em> of the drawable region.
|
||
|
Valid values for <em>i</em> are 0..<a href="#numRects">numRects</a>()-1.
|
||
|
<p> <p>See also <a href="#region">region</a>().
|
||
|
|
||
|
<h3 class=fn><a href="qregion.html">QRegion</a> <a name="region"></a>QDirectPainter::region () const
|
||
|
</h3>
|
||
|
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.
|
||
|
<p> <p>See also <a href="#numRects">numRects</a>() and <a href="#rect">rect</a>().
|
||
|
|
||
|
<h3 class=fn>void <a name="setAreaChanged"></a>QDirectPainter::setAreaChanged ( const <a href="qrect.html">QRect</a> & r )
|
||
|
</h3>
|
||
|
Sets the area changed by the transaction to <em>r</em>. 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.
|
||
|
|
||
|
<h3 class=fn><a href="qsize.html">QSize</a> <a name="size"></a>QDirectPainter::size () const
|
||
|
</h3>
|
||
|
Returns the size of the widget drawn upon.
|
||
|
<p> <p>See also <a href="#width">width</a>() and <a href="#height">height</a>().
|
||
|
|
||
|
<h3 class=fn>int <a name="transformOrientation"></a>QDirectPainter::transformOrientation ()
|
||
|
</h3>
|
||
|
Returns a number that signifies the orientation of the
|
||
|
framebuffer.
|
||
|
<center><table cellpadding="4" cellspacing="2" border="0">
|
||
|
<tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="1"> 0 <td valign="top" colspan="1" rowspan="1"> no rotation
|
||
|
<tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="1"> 1 <td valign="top" colspan="1" rowspan="1"> 90 degrees rotation
|
||
|
<tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="1"> 2 <td valign="top" colspan="1" rowspan="1"> 180 degrees rotation
|
||
|
<tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="1"> 3 <td valign="top" colspan="1" rowspan="1"> 270 degrees rotation
|
||
|
</table></center>
|
||
|
|
||
|
<h3 class=fn>int <a name="width"></a>QDirectPainter::width () const
|
||
|
</h3>
|
||
|
Returns the width of the widget drawn upon.
|
||
|
|
||
|
<h3 class=fn>int <a name="xOffset"></a>QDirectPainter::xOffset () const
|
||
|
</h3>
|
||
|
Returns the X-position of the widget relative to the entire
|
||
|
display.
|
||
|
|
||
|
<h3 class=fn>int <a name="yOffset"></a>QDirectPainter::yOffset () const
|
||
|
</h3>
|
||
|
Returns the Y-position of the widget relative to the entire
|
||
|
display.
|
||
|
|
||
|
<!-- eof -->
|
||
|
<hr><p>
|
||
|
This file is part of the <a href="index.html">Qt toolkit</a>.
|
||
|
Copyright © 1995-2007
|
||
|
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
||
|
<table width=100% cellspacing=0 border=0><tr>
|
||
|
<td>Copyright © 2007
|
||
|
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
||
|
<td align=right><div align=right>Qt 3.3.8</div>
|
||
|
</table></div></address></body>
|
||
|
</html>
|