home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / include / private / qinternal_p.h < prev    next >
C/C++ Source or Header  |  2001-10-11  |  4KB  |  112 lines

  1. /****************************************************************************
  2. ** $Id:  qt/qinternal_p.h   3.0.0   edited Jun 9 11:18 $
  3. **
  4. ** Definition of some shared interal classes
  5. **
  6. ** Created : 010427
  7. **
  8. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the kernel module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
  22. ** licenses may use this file in accordance with the Qt Commercial License
  23. ** Agreement provided with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. #ifndef QINTERNAL_P_H
  39. #define QINTERNAL_P_H
  40.  
  41. //
  42. //  W A R N I N G
  43. //  -------------
  44. //
  45. // This file is not part of the Qt API.  It exists for the convenience
  46. // of a number of Qt sources files.  This header file may change from
  47. // version to version without notice, or even be removed.
  48. //
  49. // We mean it.
  50. //
  51. //
  52. #ifndef QT_H
  53. #include <qnamespace.h>
  54. #include <qrect.h>
  55. #endif // QT_H
  56.  
  57. class QWidget;
  58. class QPainter;
  59. class QPixmap;
  60.  
  61. class Q_EXPORT QSharedDoubleBuffer
  62. {
  63. public:
  64.     QSharedDoubleBuffer( bool mustShare = TRUE, bool initializeBg = TRUE, QPixmap* pm = 0);
  65.     QSharedDoubleBuffer( QWidget* widget, int x = 0, int y = 0, int w = -1, int h = -1 );
  66.     QSharedDoubleBuffer( QPainter* painter, int x = 0, int y = 0, int w = -1, int h = -1 );
  67.     QSharedDoubleBuffer( QWidget *widget, const QRect &r );
  68.     QSharedDoubleBuffer( QPainter *painter, const QRect &r );
  69.     ~QSharedDoubleBuffer();
  70.  
  71.     bool begin( QWidget* widget, int x = 0, int y = 0, int w = -1, int h = -1 );
  72.     bool begin( QPainter* painter, int x = 0, int y = 0, int w = -1, int h = -1);
  73.     bool begin( QWidget* widget, const QRect &r );
  74.     bool begin( QPainter* painter, const QRect &r );
  75.     bool end();
  76.  
  77.     QPainter* painter() const;
  78.  
  79.     bool isActive() const;
  80.     bool isBuffered() const;
  81.     void flush();
  82.  
  83.     static bool isDisabled() { return !dblbufr; }
  84.     static QPixmap* getRawPixmap( int w, int h );
  85.  
  86. private:
  87.     QWidget* wid;
  88.     int rx, ry, rw, rh;
  89.     QPainter *p, *xp;
  90.     QPixmap *pix, *xpix;
  91.     uint mustsh : 1;
  92.     uint initbg : 1;
  93.     static bool dblbufr;
  94. };
  95.  
  96. inline bool QSharedDoubleBuffer::begin( QWidget* widget, const QRect &r )
  97. { return begin( widget, r.x(), r.y(), r.width(), r.height() ); }
  98.  
  99. inline bool QSharedDoubleBuffer::begin( QPainter *painter, const QRect &r )
  100. { return begin( painter, r.x(), r.y(), r.width(), r.height() ); }
  101.  
  102. inline QPainter* QSharedDoubleBuffer::painter() const
  103. { return p; }
  104.  
  105. inline bool QSharedDoubleBuffer::isActive() const
  106. { return p != 0; }
  107.  
  108. inline bool QSharedDoubleBuffer::isBuffered() const
  109. { return pix != 0; }
  110.  
  111. #endif // QINTERNAL_P_H
  112.