Eneboo - Documentación para desarrolladores
src/qt/src/kernel/qpainter.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qpainter.h   3.3.8   edited Jan 11 14:38 $
00003 **
00004 ** Definition of QPainter class
00005 **
00006 ** Created : 940112
00007 **
00008 ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
00009 **
00010 ** This file is part of the kernel module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech ASA of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QPAINTER_H
00039 #define QPAINTER_H
00040 
00041 
00042 #ifndef QT_H
00043 #include "qcolor.h"
00044 #include "qfontmetrics.h"
00045 #include "qfontinfo.h"
00046 #include "qregion.h"
00047 #include "qpen.h"
00048 #include "qbrush.h"
00049 #include "qpointarray.h"
00050 #include "qwmatrix.h"
00051 #endif // QT_H
00052 
00053 class QGfx;
00054 class QTextCodec;
00055 class QTextParag;
00056 class QPaintDevice;
00057 class QTextItem;
00058 #if defined( Q_WS_MAC )
00059 class QMacSavedPortInfo;
00060 #endif
00061 class QPainterPrivate;
00062 
00063 #if defined(Q_WS_QWS)
00064 class QScreen;
00065 #endif
00066 
00067 class Q_EXPORT QPainter : public Qt {
00068 public:
00069   enum CoordinateMode { CoordDevice, CoordPainter };
00070 
00071   QPainter();
00072   QPainter( const QPaintDevice *, bool unclipped = FALSE );
00073   QPainter( const QPaintDevice *, const QWidget *, bool unclipped = FALSE );
00074   ~QPainter();
00075 
00076   bool  begin( const QPaintDevice *, bool unclipped = FALSE );
00077   bool  begin( const QPaintDevice *, const QWidget *, bool unclipped = FALSE );
00078   bool  end();
00079   QPaintDevice *device() const;
00080 
00081 #ifdef Q_WS_QWS
00082   QGfx * internalGfx();
00083 #ifdef QT_QWS_EXPERIMENTAL_SCREENPAINTER
00084   bool begin( QScreen *screen );
00085 #endif
00086 #endif
00087 
00088   static void redirect( QPaintDevice *pdev, QPaintDevice *replacement );
00089   static QPaintDevice *redirect( QPaintDevice *pdev );
00090 
00091   bool  isActive() const;
00092 
00093   void  flush( const QRegion &region, CoordinateMode cm = CoordDevice );
00094   void  flush();
00095   // ### AbanQ
00096   //void save();
00097   void  save( const QString & id = QString::null );
00098   void  restore();
00099 
00100   // Drawing tools
00101 
00102   QFontMetrics fontMetrics()  const;
00103   QFontInfo  fontInfo() const;
00104 
00105   const QFont &font()   const;
00106   void  setFont( const QFont & );
00107   const QPen &pen()   const;
00108   void  setPen( const QPen & );
00109   void  setPen( PenStyle );
00110   void  setPen( const QColor & );
00111   const QBrush &brush() const;
00112   void  setBrush( const QBrush & );
00113   void  setBrush( BrushStyle );
00114   void  setBrush( const QColor & );
00115   QPoint  pos() const;
00116 
00117   // Drawing attributes/modes
00118 
00119   const QColor &backgroundColor() const;
00120   void  setBackgroundColor( const QColor & );
00121   BGMode  backgroundMode() const;
00122   void  setBackgroundMode( BGMode );
00123   RasterOp  rasterOp()  const;
00124   void  setRasterOp( RasterOp );
00125   const QPoint &brushOrigin() const;
00126   void  setBrushOrigin( int x, int y );
00127   void  setBrushOrigin( const QPoint & );
00128 
00129   // Scaling and transformations
00130 
00131 //    PaintUnit unit()         const;   // get set painter unit
00132 //    void  setUnit( PaintUnit );   // NOT IMPLEMENTED!!!
00133 
00134   bool  hasViewXForm() const;
00135   bool  hasWorldXForm() const;
00136 
00137 #ifndef QT_NO_TRANSFORMATIONS
00138   void  setViewXForm( bool );   // set xform on/off
00139   QRect window()       const;   // get window
00140   void  setWindow( const QRect & ); // set window
00141   void  setWindow( int x, int y, int w, int h );
00142   QRect viewport()   const;   // get viewport
00143   void  setViewport( const QRect & ); // set viewport
00144   void  setViewport( int x, int y, int w, int h );
00145 
00146   void  setWorldXForm( bool );    // set world xform on/off
00147   const QWMatrix &worldMatrix() const;  // get/set world xform matrix
00148   void  setWorldMatrix( const QWMatrix &, bool combine = FALSE );
00149 
00150   void  saveWorldMatrix();
00151   void  restoreWorldMatrix();
00152 
00153   void  scale( double sx, double sy );
00154   void  shear( double sh, double sv );
00155   void  rotate( double a );
00156 #endif
00157   void  translate( double dx, double dy );
00158   void  resetXForm();
00159   double  translationX() const;
00160   double  translationY() const;
00161 
00162   QPoint  xForm( const QPoint & ) const;  // map virtual -> device
00163   QRect xForm( const QRect & )  const;
00164   QPointArray xForm( const QPointArray & ) const;
00165   QPointArray xForm( const QPointArray &, int index, int npoints ) const;
00166   QPoint  xFormDev( const QPoint & ) const; // map device -> virtual
00167   QRect xFormDev( const QRect & )  const;
00168   QPointArray xFormDev( const QPointArray & ) const;
00169   QPointArray xFormDev( const QPointArray &, int index, int npoints ) const;
00170 
00171   // Clipping
00172 
00173   void  setClipping( bool );    // set clipping on/off
00174   bool  hasClipping() const;
00175   QRegion clipRegion( CoordinateMode = CoordDevice ) const;
00176   void  setClipRect( const QRect &, CoordinateMode = CoordDevice ); // set clip rectangle
00177   void  setClipRect( int x, int y, int w, int h, CoordinateMode = CoordDevice );
00178   void  setClipRegion( const QRegion &, CoordinateMode = CoordDevice );// set clip region
00179 
00180   // Graphics drawing functions
00181 
00182   void  drawPoint( int x, int y );
00183   void  drawPoint( const QPoint & );
00184   void  drawPoints( const QPointArray& a,
00185                    int index = 0, int npoints = -1 );
00186   void  moveTo( int x, int y );
00187   void  moveTo( const QPoint & );
00188   void  lineTo( int x, int y );
00189   void  lineTo( const QPoint & );
00190   void  drawLine( int x1, int y1, int x2, int y2 );
00191   void  drawLine( const QPoint &, const QPoint & );
00192   void  drawRect( int x, int y, int w, int h );
00193   void  drawRect( const QRect & );
00194   void  drawWinFocusRect( int x, int y, int w, int h );
00195   void  drawWinFocusRect( int x, int y, int w, int h,
00196                          const QColor &bgColor );
00197   void  drawWinFocusRect( const QRect & );
00198   void  drawWinFocusRect( const QRect &,
00199                          const QColor &bgColor );
00200   void  drawRoundRect( int x, int y, int w, int h, int = 25, int = 25 );
00201   void  drawRoundRect( const QRect &, int = 25, int = 25 );
00202   void  drawEllipse( int x, int y, int w, int h );
00203   void  drawEllipse( const QRect & );
00204   void  drawArc( int x, int y, int w, int h, int a, int alen );
00205   void  drawArc( const QRect &, int a, int alen );
00206   void  drawPie( int x, int y, int w, int h, int a, int alen );
00207   void  drawPie( const QRect &, int a, int alen );
00208   void  drawChord( int x, int y, int w, int h, int a, int alen );
00209   void  drawChord( const QRect &, int a, int alen );
00210   void  drawLineSegments( const QPointArray &,
00211                          int index = 0, int nlines = -1 );
00212   void  drawPolyline( const QPointArray &,
00213                      int index = 0, int npoints = -1 );
00214   void  drawPolygon( const QPointArray &, bool winding = FALSE,
00215                     int index = 0, int npoints = -1 );
00216   void  drawConvexPolygon( const QPointArray &,
00217                           int index = 0, int npoints = -1 );
00218 #ifndef QT_NO_BEZIER
00219   void  drawCubicBezier( const QPointArray &, int index = 0 );
00220 #endif
00221   void  drawPixmap( int x, int y, const QPixmap &,
00222                    int sx = 0, int sy = 0, int sw = -1, int sh = -1 );
00223   void  drawPixmap( const QPoint &, const QPixmap &,
00224                    const QRect &sr );
00225   void  drawPixmap( const QPoint &, const QPixmap & );
00226   void  drawPixmap( const QRect &, const QPixmap & );
00227   void  drawImage( int x, int y, const QImage &,
00228                   int sx = 0, int sy = 0, int sw = -1, int sh = -1,
00229                   int conversionFlags = 0 );
00230   void  drawImage( const QPoint &, const QImage &,
00231                   const QRect &sr, int conversionFlags = 0 );
00232   void  drawImage( const QPoint &, const QImage &,
00233                   int conversion_flags = 0 );
00234   void  drawImage( const QRect &, const QImage & );
00235   void  drawTiledPixmap( int x, int y, int w, int h, const QPixmap &,
00236                         int sx = 0, int sy = 0 );
00237   void  drawTiledPixmap( const QRect &, const QPixmap &,
00238                         const QPoint & );
00239   void  drawTiledPixmap( const QRect &, const QPixmap & );
00240 #ifndef QT_NO_PICTURE
00241   void  drawPicture( const QPicture & );
00242   void  drawPicture( int x, int y, const QPicture & );
00243   void  drawPicture( const QPoint &, const QPicture & );
00244 #endif
00245 
00246   void  fillRect( int x, int y, int w, int h, const QBrush & );
00247   void  fillRect( const QRect &, const QBrush & );
00248   void  eraseRect( int x, int y, int w, int h );
00249   void  eraseRect( const QRect & );
00250 
00251   // Text drawing functions
00252 
00253   enum TextDirection {
00254     Auto,
00255     RTL,
00256     LTR
00257   };
00258 
00259   void  drawText( int x, int y, const QString &, int len = -1, TextDirection dir = Auto );
00260   void  drawText( const QPoint &, const QString &, int len = -1, TextDirection dir = Auto );
00261 
00262   void     drawText( int x, int y, const QString &, int pos, int len, TextDirection dir = Auto );
00263   void     drawText( const QPoint &p, const QString &, int pos, int len, TextDirection dir = Auto );
00264 
00265   void  drawText( int x, int y, int w, int h, int flags,
00266                  const QString&, int len = -1, QRect *br = 0,
00267                  QTextParag **intern = 0 );
00268   void  drawText( const QRect &, int flags,
00269                  const QString&, int len = -1, QRect *br = 0,
00270                  QTextParag **intern = 0 );
00271 
00272   void drawTextItem( int x, int y, const QTextItem &ti, int textflags = 0 );
00273   void drawTextItem( const QPoint& p, const QTextItem &ti, int textflags = 0 );
00274 
00275   QRect boundingRect( int x, int y, int w, int h, int flags,
00276                       const QString&, int len = -1, QTextParag **intern = 0 );
00277   QRect boundingRect( const QRect &, int flags,
00278                       const QString&, int len = -1, QTextParag **intern = 0 );
00279 
00280   int   tabStops() const;
00281   void  setTabStops( int );
00282   int        *tabArray() const;
00283   void  setTabArray( int * );
00284 
00285   // Other functions
00286 
00287 #if defined(Q_WS_WIN)
00288   HDC   handle() const;
00289 #elif defined(Q_WS_X11) || defined(Q_WS_MAC)
00290   HANDLE  handle() const;
00291 #endif
00292 
00293 
00294   static void initialize();
00295   static void cleanup();
00296 
00297 private:
00298   void  init();
00299   void        destroy();
00300   void  updateFont();
00301   void  updatePen();
00302   void  updateBrush();
00303 #ifndef QT_NO_TRANSFORMATIONS
00304   void  updateXForm();
00305   void  updateInvXForm();
00306 #endif
00307   void  map( int, int, int *rx, int *ry ) const;
00308   void  map( int, int, int, int, int *, int *, int *, int * ) const;
00309   void  mapInv( int, int, int *, int * ) const;
00310   void  mapInv( int, int, int, int, int *, int *, int *, int * ) const;
00311   void  drawPolyInternal( const QPointArray &, bool close = TRUE );
00312   void  drawWinFocusRect( int x, int y, int w, int h, bool xorPaint,
00313                          const QColor &penColor );
00314 
00315   enum { IsActive = 0x01, ExtDev = 0x02, IsStartingUp = 0x04, NoCache = 0x08,
00316          VxF = 0x10, WxF = 0x20, ClipOn = 0x40, SafePolygon = 0x80, MonoDev = 0x100,
00317          DirtyFont = 0x200, DirtyPen = 0x400, DirtyBrush = 0x800,
00318          RGBColor = 0x1000, FontMet = 0x2000, FontInf = 0x4000, CtorBegin = 0x8000,
00319          UsePrivateCx = 0x10000, VolatileDC = 0x20000, Qt2Compat = 0x40000
00320        };
00321   uint  flags;
00322   bool  testf( uint b ) const {
00323     return ( flags&b ) != 0;
00324   }
00325   void  setf( uint b )  {
00326     flags |= b;
00327   }
00328   void  setf( uint b, bool v );
00329   void  clearf( uint b )  {
00330     flags &= ( uint )( ~b );
00331   }
00332   void  fix_neg_rect( int *x, int *y, int *w, int *h );
00333 
00334   QPainterPrivate *d;
00335   QPaintDevice *pdev;
00336   QColor  bg_col;
00337   uchar bg_mode;
00338   uchar rop;
00339   uchar pu;
00340   QPoint  bro;
00341   QFont cfont;
00342   QFont *pfont;   // font used for metrics (might be different for printers)
00343   QPen  cpen;
00344   QBrush  cbrush;
00345   QRegion crgn;
00346   int   tabstops;
00347   int        *tabarray;
00348   int   tabarraylen;
00349   bool  block_ext;  // for temporary blocking of external devices
00350 
00351   // Transformations
00352 #ifndef QT_NO_TRANSFORMATIONS
00353   QCOORD  wx, wy, ww, wh;
00354   QCOORD  vx, vy, vw, vh;
00355   QWMatrix  wxmat;
00356 
00357   // Cached composition (and inverse) of transformations
00358   QWMatrix  xmat;
00359   QWMatrix  ixmat;
00360 
00361 
00362 
00363   double  m11() const {
00364     return xmat.m11();
00365   }
00366   double      m12() const {
00367     return xmat.m12();
00368   }
00369   double      m21() const {
00370     return xmat.m21();
00371   }
00372   double      m22() const {
00373     return xmat.m22();
00374   }
00375   double      dx() const {
00376     return xmat.dx();
00377   }
00378   double      dy() const {
00379     return xmat.dy();
00380   }
00381   double  im11() const {
00382     return ixmat.m11();
00383   }
00384   double      im12() const {
00385     return ixmat.m12();
00386   }
00387   double      im21() const {
00388     return ixmat.m21();
00389   }
00390   double      im22() const {
00391     return ixmat.m22();
00392   }
00393   double      idx() const {
00394     return ixmat.dx();
00395   }
00396   double      idy() const {
00397     return ixmat.dy();
00398   }
00399 
00400   int   txop;
00401   bool  txinv;
00402 
00403 #else
00404   // even without transformations we still have translations
00405   int   xlatex;
00406   int   xlatey;
00407 #endif
00408 
00409   void       *penRef;       // pen cache ref
00410   void       *brushRef;     // brush cache ref
00411   void       *ps_stack;
00412   void       *wm_stack;
00413   void  killPStack();
00414 
00415 protected:
00416 #ifdef Q_OS_TEMP
00417   QPoint  internalCurrentPos;
00418   uint  old_pix;      // ### All win platforms in 4.0
00419 #endif
00420 #if defined(Q_WS_WIN)
00421   friend class QFontEngineWin;
00422   friend class QFontEngineBox;
00423   QT_WIN_PAINTER_MEMBERS
00424 #elif defined(Q_WS_X11)
00425   friend class QFontEngineXLFD;
00426   friend class QFontEngineXft;
00427   friend class QFontEngineBox;
00428   Display    *dpy;        // current display
00429   int   scrn;       // current screen
00430   Qt::HANDLE  hd;       // handle to drawable
00431   Qt::HANDLE  rendhd;       // handle to Xft draw
00432   GC    gc;       // graphics context (standard)
00433   GC    gc_brush;     // graphics contect for brush
00434   QPoint  curPt;        // current point
00435   uint  clip_serial;      // clipping serial number
00436 #elif defined(Q_WS_MAC)
00437   Qt::HANDLE  hd;       // handle to drawable
00438   void initPaintDevice( bool force = FALSE, QPoint *off = NULL, QRegion *rgn = NULL );
00439   friend const QRegion &qt_mac_update_painter( QPainter *, bool );
00440   friend class QFontEngineMac;
00441   friend class QMacPainter;
00442 #elif defined(Q_WS_QWS)
00443   friend class QFontEngine;
00444   QGfx * gfx;
00445   friend void qwsUpdateActivePainters();
00446 #endif
00447   friend class QFontMetrics;
00448   friend class QFontInfo;
00449   friend class QTextLayout;
00450   friend void qt_format_text( const QFont &, const QRect &r,
00451                               int tf, const QString& str, int len, QRect *brect,
00452                               int tabstops, int* tabarray, int tabarraylen,
00453                               QTextParag **internal, QPainter* painter );
00454   friend void qt_draw_background( QPainter *p, int x, int y, int w,  int h );
00455   friend void qt_draw_transformed_rect( QPainter *p,  int x, int y, int w,  int h, bool fill );
00456   friend class QPrinter;
00457 
00458 private:  // Disabled copy constructor and operator=
00459 #if defined(Q_DISABLE_COPY)
00460   QPainter( const QPainter & );
00461   QPainter &operator=( const QPainter & );
00462 #endif
00463 
00464   enum TransformationCodes {
00465     TxNone      = 0,    // transformation codes
00466     TxTranslate = 1,    // copy in qpainter_*.cpp
00467     TxScale     = 2,
00468     TxRotShear  = 3
00469   };
00470 };
00471 
00472 
00473 /*****************************************************************************
00474   QPainter member functions
00475  *****************************************************************************/
00476 
00477 inline QPaintDevice *QPainter::device() const {
00478   return pdev;
00479 }
00480 
00481 inline bool QPainter::isActive() const {
00482   return testf( IsActive );
00483 }
00484 
00485 inline const QFont &QPainter::font() const {
00486   return cfont;
00487 }
00488 
00489 inline const QPen &QPainter::pen() const {
00490   return cpen;
00491 }
00492 
00493 inline const QBrush &QPainter::brush() const {
00494   return cbrush;
00495 }
00496 
00497 /*
00498 inline PaintUnit QPainter::unit() const
00499 {
00500     return (PaintUnit)pu;
00501 }
00502 */
00503 
00504 inline const QColor &QPainter::backgroundColor() const {
00505   return bg_col;
00506 }
00507 
00508 inline Qt::BGMode QPainter::backgroundMode() const {
00509   return ( BGMode )bg_mode;
00510 }
00511 
00512 inline Qt::RasterOp QPainter::rasterOp() const {
00513   return ( RasterOp )rop;
00514 }
00515 
00516 inline const QPoint &QPainter::brushOrigin() const {
00517   return bro;
00518 }
00519 
00520 inline bool QPainter::hasViewXForm() const {
00521 #ifndef QT_NO_TRANSFORMATIONS
00522   return testf( VxF );
00523 #else
00524   return xlatex || xlatey;
00525 #endif
00526 }
00527 
00528 inline bool QPainter::hasWorldXForm() const {
00529 #ifndef QT_NO_TRANSFORMATIONS
00530   return testf( WxF );
00531 #else
00532   return xlatex || xlatey;
00533 #endif
00534 }
00535 
00536 inline double QPainter::translationX() const {
00537 #ifndef QT_NO_TRANSFORMATIONS
00538   return worldMatrix().dx();
00539 #else
00540   return xlatex;
00541 #endif
00542 }
00543 
00544 inline double QPainter::translationY() const {
00545 #ifndef QT_NO_TRANSFORMATIONS
00546   return worldMatrix().dy();
00547 #else
00548   return xlatey;
00549 #endif
00550 }
00551 
00552 
00553 inline bool QPainter::hasClipping() const {
00554   return testf( ClipOn );
00555 }
00556 
00557 inline int QPainter::tabStops() const {
00558   return tabstops;
00559 }
00560 
00561 inline int *QPainter::tabArray() const {
00562   return tabarray;
00563 }
00564 
00565 #if defined(Q_WS_WIN)
00566 inline HDC QPainter::handle() const {
00567   return hdc;
00568 }
00569 #elif defined(Q_WS_X11) || defined(Q_WS_MAC)
00570 inline Qt::HANDLE QPainter::handle() const {
00571   return hd;
00572 }
00573 #endif
00574 
00575 inline void QPainter::setBrushOrigin( const QPoint &p ) {
00576   setBrushOrigin( p.x(), p.y() );
00577 }
00578 
00579 #ifndef QT_NO_TRANSFORMATIONS
00580 inline void QPainter::setWindow( const QRect &r ) {
00581   setWindow( r.x(), r.y(), r.width(), r.height() );
00582 }
00583 
00584 inline void QPainter::setViewport( const QRect &r ) {
00585   setViewport( r.x(), r.y(), r.width(), r.height() );
00586 }
00587 #endif
00588 
00589 inline void QPainter::setClipRect( int x, int y, int w, int h, CoordinateMode m ) {
00590   setClipRect( QRect( x, y, w, h ), m );
00591 }
00592 
00593 inline void QPainter::drawPoint( const QPoint &p ) {
00594   drawPoint( p.x(), p.y() );
00595 }
00596 
00597 inline void QPainter::moveTo( const QPoint &p ) {
00598   moveTo( p.x(), p.y() );
00599 }
00600 
00601 inline void QPainter::lineTo( const QPoint &p ) {
00602   lineTo( p.x(), p.y() );
00603 }
00604 
00605 inline void QPainter::drawLine( const QPoint &p1, const QPoint &p2 ) {
00606   drawLine( p1.x(), p1.y(), p2.x(), p2.y() );
00607 }
00608 
00609 inline void QPainter::drawRect( const QRect &r ) {
00610   drawRect( r.x(), r.y(), r.width(), r.height() );
00611 }
00612 
00613 inline void QPainter::drawWinFocusRect( const QRect &r ) {
00614   drawWinFocusRect( r.x(), r.y(), r.width(), r.height() );
00615 }
00616 
00617 inline void QPainter::drawWinFocusRect( const QRect &r, const QColor &penColor ) {
00618   drawWinFocusRect( r.x(), r.y(), r.width(), r.height(), penColor );
00619 }
00620 
00621 inline void QPainter::drawRoundRect( const QRect &r, int xRnd, int yRnd ) {
00622   drawRoundRect( r.x(), r.y(), r.width(), r.height(), xRnd, yRnd );
00623 }
00624 
00625 inline void QPainter::drawEllipse( const QRect &r ) {
00626   drawEllipse( r.x(), r.y(), r.width(), r.height() );
00627 }
00628 
00629 inline void QPainter::drawArc( const QRect &r, int a, int alen ) {
00630   drawArc( r.x(), r.y(), r.width(), r.height(), a, alen );
00631 }
00632 
00633 inline void QPainter::drawPie( const QRect &r, int a, int alen ) {
00634   drawPie( r.x(), r.y(), r.width(), r.height(), a, alen );
00635 }
00636 
00637 inline void QPainter::drawChord( const QRect &r, int a, int alen ) {
00638   drawChord( r.x(), r.y(), r.width(), r.height(), a, alen );
00639 }
00640 
00641 inline void QPainter::drawPixmap( const QPoint &p, const QPixmap &pm,
00642                                   const QRect &sr ) {
00643   drawPixmap( p.x(), p.y(), pm, sr.x(), sr.y(), sr.width(), sr.height() );
00644 }
00645 
00646 inline void QPainter::drawImage( const QPoint &p, const QImage &pm,
00647                                  const QRect &sr, int conversionFlags ) {
00648   drawImage( p.x(), p.y(), pm,
00649              sr.x(), sr.y(), sr.width(), sr.height(), conversionFlags );
00650 }
00651 
00652 inline void QPainter::drawTiledPixmap( const QRect &r, const QPixmap &pm,
00653                                        const QPoint &sp ) {
00654   drawTiledPixmap( r.x(), r.y(), r.width(), r.height(), pm, sp.x(), sp.y() );
00655 }
00656 
00657 inline void QPainter::drawTiledPixmap( const QRect &r, const QPixmap &pm ) {
00658   drawTiledPixmap( r.x(), r.y(), r.width(), r.height(), pm, 0, 0 );
00659 }
00660 
00661 inline void QPainter::fillRect( const QRect &r, const QBrush &brush ) {
00662   fillRect( r.x(), r.y(), r.width(), r.height(), brush );
00663 }
00664 
00665 inline void QPainter::eraseRect( int x, int y, int w, int h ) {
00666   fillRect( x, y, w, h, backgroundColor() );
00667 }
00668 
00669 inline void QPainter::eraseRect( const QRect &r ) {
00670   fillRect( r.x(), r.y(), r.width(), r.height(), backgroundColor() );
00671 }
00672 
00673 inline void QPainter::drawText( const QPoint &p, const QString &s, int len, TextDirection dir ) {
00674   drawText( p.x(), p.y(), s, 0, len, dir );
00675 }
00676 
00677 inline void QPainter::drawText( const QPoint &p, const QString &s, int pos, int len, TextDirection dir ) {
00678   drawText( p.x(), p.y(), s, pos, len, dir );
00679 }
00680 
00681 inline void QPainter::drawText( int x, int y, int w, int h, int tf,
00682                                 const QString& str, int len, QRect *br, QTextParag **i ) {
00683   QRect r( x, y, w, h );
00684   drawText( r, tf, str, len, br, i );
00685 }
00686 
00687 inline void QPainter::drawTextItem( const QPoint& p, const QTextItem &ti, int textflags ) {
00688   drawTextItem( p.x(), p.y(), ti, textflags );
00689 }
00690 
00691 inline QRect QPainter::boundingRect( int x, int y, int w, int h, int tf,
00692                                      const QString& str, int len, QTextParag **i ) {
00693   QRect r( x, y, w, h );
00694   return boundingRect( r, tf, str, len, i );
00695 }
00696 
00697 #if defined(Q_WS_QWS)
00698 inline QGfx * QPainter::internalGfx() {
00699   return gfx;
00700 }
00701 #endif
00702 
00703 #endif // QPAINTER_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'