[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qdirectpainter_qws.cpp:72 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QDirectPainter Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <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>
|
---|
| 33 |
|
---|
| 34 | <p>The QDirectPainter class provides direct access to the video hardware.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qdirectpainter_qws-h.html">qdirectpainter_qws.h</a>></tt>
|
---|
| 37 | <p>Inherits <a href="qpainter.html">QPainter</a>.
|
---|
| 38 | <p><a href="qdirectpainter-members.html">List of all member functions.</a>
|
---|
| 39 | <h2>Public Members</h2>
|
---|
| 40 | <ul>
|
---|
| 41 | <li class=fn><a href="#QDirectPainter"><b>QDirectPainter</b></a> ( const QWidget * w )</li>
|
---|
| 42 | <li class=fn><a href="#~QDirectPainter"><b>~QDirectPainter</b></a> ()</li>
|
---|
| 43 | <li class=fn>uchar * <a href="#frameBuffer"><b>frameBuffer</b></a> ()</li>
|
---|
| 44 | <li class=fn>int <a href="#lineStep"><b>lineStep</b></a> ()</li>
|
---|
| 45 | <li class=fn>int <a href="#transformOrientation"><b>transformOrientation</b></a> ()</li>
|
---|
| 46 | <li class=fn>int <a href="#numRects"><b>numRects</b></a> () const</li>
|
---|
| 47 | <li class=fn>const QRect & <a href="#rect"><b>rect</b></a> ( int i ) const</li>
|
---|
| 48 | <li class=fn>QRegion <a href="#region"><b>region</b></a> () const</li>
|
---|
| 49 | <li class=fn>int <a href="#depth"><b>depth</b></a> () const</li>
|
---|
| 50 | <li class=fn>int <a href="#width"><b>width</b></a> () const</li>
|
---|
| 51 | <li class=fn>int <a href="#height"><b>height</b></a> () const</li>
|
---|
| 52 | <li class=fn>int <a href="#xOffset"><b>xOffset</b></a> () const</li>
|
---|
| 53 | <li class=fn>int <a href="#yOffset"><b>yOffset</b></a> () const</li>
|
---|
| 54 | <li class=fn>QPoint <a href="#offset"><b>offset</b></a> () const</li>
|
---|
| 55 | <li class=fn>QSize <a href="#size"><b>size</b></a> () const</li>
|
---|
| 56 | <li class=fn>void <a href="#setAreaChanged"><b>setAreaChanged</b></a> ( const QRect & r )</li>
|
---|
| 57 | </ul>
|
---|
| 58 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 59 |
|
---|
| 60 |
|
---|
| 61 | The QDirectPainter class provides direct access to the video hardware.
|
---|
| 62 | <p>
|
---|
| 63 | <p> Only available in Qt/Embedded.
|
---|
| 64 | <p> When the hardware is known and well defined, as is often the case
|
---|
| 65 | with software for embedded devices, it may be useful to manipulate
|
---|
| 66 | the underlying video hardware directly. In order to do this in a
|
---|
| 67 | way that is co-operative with other applications, you must lock
|
---|
| 68 | the video hardware for exclusive use for a small time while you
|
---|
| 69 | write to it, and you must know the clipping region which is
|
---|
| 70 | allocated to a widget.
|
---|
| 71 | <p> QDirectPainter provides this functionality.
|
---|
| 72 | <p> In the simplest case, you make a QDirectPainter on a widget and
|
---|
| 73 | then, observing the clip region, perform some platform-specific
|
---|
| 74 | operation. For example:
|
---|
| 75 | <pre>
|
---|
| 76 | void MyWidget::updatePlatformGraphics()
|
---|
| 77 | {
|
---|
| 78 | QDirectPainter dp( this );
|
---|
| 79 | for ( int i = 0; i < dp.numRects; i++ ) {
|
---|
| 80 | const <a href="qrect.html">QRect</a>& clip = dp.<a href="#rect">rect</a>(i);
|
---|
| 81 | ... // platform specific operation
|
---|
| 82 | }
|
---|
| 83 | }
|
---|
| 84 | </pre>
|
---|
| 85 |
|
---|
| 86 | <p> The platform-specific code has access to the display, but should
|
---|
| 87 | only modify graphics in the rectangles specified by <a href="#numRects">numRects</a>() and
|
---|
| 88 | <a href="#rect">rect</a>(). Note that these rectangles are relative to the entire
|
---|
| 89 | display.
|
---|
| 90 | <p> The <a href="#offset">offset</a>() function returns the position of the widget relative
|
---|
| 91 | to the entire display, allowing you to offset platform-specific
|
---|
| 92 | operations appropriately. The <a href="#xOffset">xOffset</a>() and <a href="#yOffset">yOffset</a>() functions
|
---|
| 93 | merely return the component values of offset().
|
---|
| 94 | <p> For simple frame-buffer hardware, the <a href="#frameBuffer">frameBuffer</a>(), <a href="#lineStep">lineStep</a>(),
|
---|
| 95 | and <a href="#depth">depth</a>() functions provide basic access, though some hardware
|
---|
| 96 | configurations are insufficiently specified by such simple
|
---|
| 97 | parameters.
|
---|
| 98 | <p> Note that while a QDirectPainter exists, the entire Qt/Embedded
|
---|
| 99 | window system is locked from use by other applications. Always
|
---|
| 100 | construct the QDirectPainter as an auto (stack) variable, and be
|
---|
| 101 | very careful to write robust and stable code within its scope.
|
---|
| 102 | <p>See also <a href="graphics.html">Graphics Classes</a>.
|
---|
| 103 |
|
---|
| 104 | <hr><h2>Member Function Documentation</h2>
|
---|
| 105 | <h3 class=fn><a name="QDirectPainter"></a>QDirectPainter::QDirectPainter ( const <a href="qwidget.html">QWidget</a> * w )
|
---|
| 106 | </h3>
|
---|
| 107 | Construct a direct painter on <em>w</em>. The display is locked and the
|
---|
| 108 | mouse cursor is hidden if it is above <em>w</em>.
|
---|
| 109 |
|
---|
| 110 | <h3 class=fn><a name="~QDirectPainter"></a>QDirectPainter::~QDirectPainter ()
|
---|
| 111 | </h3>
|
---|
| 112 | Destroys the direct painter. The mouse cursor is revealed if
|
---|
| 113 | necessary and the display is unlocked.
|
---|
| 114 |
|
---|
| 115 | <h3 class=fn>int <a name="depth"></a>QDirectPainter::depth () const
|
---|
| 116 | </h3>
|
---|
| 117 | Returns the bit-depth of the display.
|
---|
| 118 |
|
---|
| 119 | <h3 class=fn>uchar * <a name="frameBuffer"></a>QDirectPainter::frameBuffer ()
|
---|
| 120 | </h3>
|
---|
| 121 | Returns a pointer to the framebuffer memory if available.
|
---|
| 122 |
|
---|
| 123 | <h3 class=fn>int <a name="height"></a>QDirectPainter::height () const
|
---|
| 124 | </h3>
|
---|
| 125 | Returns the height of the widget drawn upon.
|
---|
| 126 |
|
---|
| 127 | <h3 class=fn>int <a name="lineStep"></a>QDirectPainter::lineStep ()
|
---|
| 128 | </h3>
|
---|
| 129 | Returns the spacing in bytes from one framebuffer line to the
|
---|
| 130 | next.
|
---|
| 131 |
|
---|
| 132 | <h3 class=fn>int <a name="numRects"></a>QDirectPainter::numRects () const
|
---|
| 133 | </h3>
|
---|
| 134 | Returns the number of rectangles in the drawable region.
|
---|
| 135 | <p> <p>See also <a href="#rect">rect</a>() and <a href="#region">region</a>().
|
---|
| 136 |
|
---|
| 137 | <h3 class=fn><a href="qpoint.html">QPoint</a> <a name="offset"></a>QDirectPainter::offset () const
|
---|
| 138 | </h3>
|
---|
| 139 | Returns the position of the widget relative to the entire display.
|
---|
| 140 |
|
---|
| 141 | <h3 class=fn>const <a href="qrect.html">QRect</a> & <a name="rect"></a>QDirectPainter::rect ( int i ) const
|
---|
| 142 | </h3>
|
---|
| 143 | Returns a reference to rectangle <em>i</em> of the drawable region.
|
---|
| 144 | Valid values for <em>i</em> are 0..<a href="#numRects">numRects</a>()-1.
|
---|
| 145 | <p> <p>See also <a href="#region">region</a>().
|
---|
| 146 |
|
---|
| 147 | <h3 class=fn><a href="qregion.html">QRegion</a> <a name="region"></a>QDirectPainter::region () const
|
---|
| 148 | </h3>
|
---|
| 149 | Returns the region of the framebuffer which represents the exposed
|
---|
| 150 | area of the widget being painted on. Note that this may be a sub-area of
|
---|
| 151 | the clip region, because of child widgets and overlapping cousin widgets.
|
---|
| 152 | <p> <p>See also <a href="#numRects">numRects</a>() and <a href="#rect">rect</a>().
|
---|
| 153 |
|
---|
| 154 | <h3 class=fn>void <a name="setAreaChanged"></a>QDirectPainter::setAreaChanged ( const <a href="qrect.html">QRect</a> & r )
|
---|
| 155 | </h3>
|
---|
| 156 | Sets the area changed by the transaction to <em>r</em>. By default, the
|
---|
| 157 | entire widget is assumed to have changed. The area changed is only
|
---|
| 158 | used by some graphics drivers, so often calling this function for
|
---|
| 159 | a smaller area will make no difference to performance.
|
---|
| 160 |
|
---|
| 161 | <h3 class=fn><a href="qsize.html">QSize</a> <a name="size"></a>QDirectPainter::size () const
|
---|
| 162 | </h3>
|
---|
| 163 | Returns the size of the widget drawn upon.
|
---|
| 164 | <p> <p>See also <a href="#width">width</a>() and <a href="#height">height</a>().
|
---|
| 165 |
|
---|
| 166 | <h3 class=fn>int <a name="transformOrientation"></a>QDirectPainter::transformOrientation ()
|
---|
| 167 | </h3>
|
---|
| 168 | Returns a number that signifies the orientation of the
|
---|
| 169 | framebuffer.
|
---|
| 170 | <center><table cellpadding="4" cellspacing="2" border="0">
|
---|
| 171 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="1"> 0 <td valign="top" colspan="1" rowspan="1"> no rotation
|
---|
| 172 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="1"> 1 <td valign="top" colspan="1" rowspan="1"> 90 degrees rotation
|
---|
| 173 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="1"> 2 <td valign="top" colspan="1" rowspan="1"> 180 degrees rotation
|
---|
| 174 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="1"> 3 <td valign="top" colspan="1" rowspan="1"> 270 degrees rotation
|
---|
| 175 | </table></center>
|
---|
| 176 |
|
---|
| 177 | <h3 class=fn>int <a name="width"></a>QDirectPainter::width () const
|
---|
| 178 | </h3>
|
---|
| 179 | Returns the width of the widget drawn upon.
|
---|
| 180 |
|
---|
| 181 | <h3 class=fn>int <a name="xOffset"></a>QDirectPainter::xOffset () const
|
---|
| 182 | </h3>
|
---|
| 183 | Returns the X-position of the widget relative to the entire
|
---|
| 184 | display.
|
---|
| 185 |
|
---|
| 186 | <h3 class=fn>int <a name="yOffset"></a>QDirectPainter::yOffset () const
|
---|
| 187 | </h3>
|
---|
| 188 | Returns the Y-position of the widget relative to the entire
|
---|
| 189 | display.
|
---|
| 190 |
|
---|
| 191 | <!-- eof -->
|
---|
| 192 | <hr><p>
|
---|
| 193 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 194 | Copyright © 1995-2007
|
---|
| 195 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 196 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 197 | <td>Copyright © 2007
|
---|
| 198 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 199 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 200 | </table></div></address></body>
|
---|
| 201 | </html>
|
---|