00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef QDRAWUTIL_H
00043 #define QDRAWUTIL_H
00044
00045 #include <QtCore/qnamespace.h>
00046 #include <QtCore/qstring.h>
00047 #include <QtCore/qmargins.h>
00048 #include <QtGui/qpixmap.h>
00049 QT_BEGIN_HEADER
00050
00051 QT_BEGIN_NAMESPACE
00052
00053 QT_MODULE(Gui)
00054
00055 class QPainter;
00056 #ifndef QT3_SUPPORT
00057 class QColorGroup;
00058 #endif
00059 class QPalette;
00060 class QPoint;
00061 class QColor;
00062 class QBrush;
00063 class QRect;
00064
00065
00066
00067
00068
00069 Q_GUI_EXPORT void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2,
00070 const QPalette &pal, bool sunken = true,
00071 int lineWidth = 1, int midLineWidth = 0);
00072
00073 Q_GUI_EXPORT void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint &p2,
00074 const QPalette &pal, bool sunken = true,
00075 int lineWidth = 1, int midLineWidth = 0);
00076
00077 Q_GUI_EXPORT void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
00078 const QPalette &pal, bool sunken = false,
00079 int lineWidth = 1, int midLineWidth = 0,
00080 const QBrush *fill = 0);
00081
00082 Q_GUI_EXPORT void qDrawShadeRect(QPainter *p, const QRect &r,
00083 const QPalette &pal, bool sunken = false,
00084 int lineWidth = 1, int midLineWidth = 0,
00085 const QBrush *fill = 0);
00086
00087 Q_GUI_EXPORT void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
00088 const QPalette &pal, bool sunken = false,
00089 int lineWidth = 1, const QBrush *fill = 0);
00090
00091 Q_GUI_EXPORT void qDrawShadePanel(QPainter *p, const QRect &r,
00092 const QPalette &pal, bool sunken = false,
00093 int lineWidth = 1, const QBrush *fill = 0);
00094
00095 Q_GUI_EXPORT void qDrawWinButton(QPainter *p, int x, int y, int w, int h,
00096 const QPalette &pal, bool sunken = false,
00097 const QBrush *fill = 0);
00098
00099 Q_GUI_EXPORT void qDrawWinButton(QPainter *p, const QRect &r,
00100 const QPalette &pal, bool sunken = false,
00101 const QBrush *fill = 0);
00102
00103 Q_GUI_EXPORT void qDrawWinPanel(QPainter *p, int x, int y, int w, int h,
00104 const QPalette &pal, bool sunken = false,
00105 const QBrush *fill = 0);
00106
00107 Q_GUI_EXPORT void qDrawWinPanel(QPainter *p, const QRect &r,
00108 const QPalette &pal, bool sunken = false,
00109 const QBrush *fill = 0);
00110
00111 Q_GUI_EXPORT void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &,
00112 int lineWidth = 1, const QBrush *fill = 0);
00113
00114 Q_GUI_EXPORT void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &,
00115 int lineWidth = 1, const QBrush *fill = 0);
00116
00117
00118 #ifdef QT3_SUPPORT
00119
00120
00121
00122 Q_GUI_EXPORT QT3_SUPPORT QRect qItemRect(QPainter *p, Qt::GUIStyle gs, int x, int y, int w, int h,
00123 int flags, bool enabled,
00124 const QPixmap *pixmap, const QString& text, int len=-1);
00125
00126 Q_GUI_EXPORT QT3_SUPPORT void qDrawItem(QPainter *p, Qt::GUIStyle gs, int x, int y, int w, int h,
00127 int flags, const QPalette &pal, bool enabled,
00128 const QPixmap *pixmap, const QString& text,
00129 int len=-1, const QColor* penColor = 0);
00130
00131 Q_GUI_EXPORT QT3_SUPPORT void qDrawArrow(QPainter *p, Qt::ArrowType type, Qt::GUIStyle style, bool down,
00132 int x, int y, int w, int h,
00133 const QPalette &pal, bool enabled);
00134 #endif
00135
00136 struct QTileRules
00137 {
00138 inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
00139 : horizontal(horizontalRule), vertical(verticalRule) {}
00140 inline QTileRules(Qt::TileRule rule = Qt::StretchTile)
00141 : horizontal(rule), vertical(rule) {}
00142 Qt::TileRule horizontal;
00143 Qt::TileRule vertical;
00144 };
00145
00146 #ifndef Q_QDOC
00147
00148 namespace QDrawBorderPixmap
00149 {
00150 enum DrawingHint
00151 {
00152 OpaqueTopLeft = 0x0001,
00153 OpaqueTop = 0x0002,
00154 OpaqueTopRight = 0x0004,
00155 OpaqueLeft = 0x0008,
00156 OpaqueCenter = 0x0010,
00157 OpaqueRight = 0x0020,
00158 OpaqueBottomLeft = 0x0040,
00159 OpaqueBottom = 0x0080,
00160 OpaqueBottomRight = 0x0100,
00161 OpaqueCorners = OpaqueTopLeft | OpaqueTopRight | OpaqueBottomLeft | OpaqueBottomRight,
00162 OpaqueEdges = OpaqueTop | OpaqueLeft | OpaqueRight | OpaqueBottom,
00163 OpaqueFrame = OpaqueCorners | OpaqueEdges,
00164 OpaqueAll = OpaqueCenter | OpaqueFrame
00165 };
00166
00167 Q_DECLARE_FLAGS(DrawingHints, DrawingHint)
00168 }
00169 #endif
00170
00171 Q_GUI_EXPORT void qDrawBorderPixmap(QPainter *painter,
00172 const QRect &targetRect,
00173 const QMargins &targetMargins,
00174 const QPixmap &pixmap,
00175 const QRect &sourceRect,
00176 const QMargins &sourceMargins,
00177 const QTileRules &rules = QTileRules()
00178 #ifndef Q_QDOC
00179 , QDrawBorderPixmap::DrawingHints hints = 0
00180 #endif
00181 );
00182
00183 inline void qDrawBorderPixmap(QPainter *painter,
00184 const QRect &target,
00185 const QMargins &margins,
00186 const QPixmap &pixmap)
00187 {
00188 qDrawBorderPixmap(painter, target, margins, pixmap, pixmap.rect(), margins);
00189 }
00190
00191 QT_END_NAMESPACE
00192
00193 QT_END_HEADER
00194
00195 #endif // QDRAWUTIL_H