51 #if !defined(QT_NO_QWS_DECORATION_DEFAULT) || defined(QT_PLUGIN) 60 #ifndef QT_NO_IMAGEFORMAT_XPM 207 #endif // QT_NO_IMAGEFORMAT_XPM 273 #ifdef QT_NO_IMAGEFORMAT_XPM 313 int decorationRegion,
317 #ifdef QT_NO_IMAGEFORMAT_XPM 323 static const char **staticHelpPixmapXPM = 0;
324 static const char **staticMenuPixmapXPM = 0;
325 static const char **staticClosePixmapXPM = 0;
326 static const char **staticMinimizePixmapXPM = 0;
327 static const char **staticMaximizePixmapXPM = 0;
328 static const char **staticNormalizePixmapXPM = 0;
334 staticHelpPixmapXPM = xpm;
338 staticMenuPixmapXPM = xpm;
342 staticClosePixmapXPM = xpm;
346 staticMinimizePixmapXPM = xpm;
350 staticMaximizePixmapXPM = xpm;
354 staticNormalizePixmapXPM = xpm;
360 switch (decorationRegion) {
411 int decorationRegion)
429 switch (decorationRegion) {
432 rect.
top() - titleHeight - bw,
433 rect.
width() + 2 * bw,
434 rect.
height() + titleHeight + bw + bbw);
443 rect.
top() - titleHeight,
459 rect.
top() - titleHeight - bw,
495 rect.
top() - bw - titleHeight,
500 rect.
top() - bw - titleHeight,
510 rect.
top() - bw - titleHeight,
515 rect.
top() - bw - titleHeight,
560 if (hasContextHelp) {
567 if (r.left() > rect.
left() + titleHeight)
575 if (hasMinimize && !isMinimized) {
580 if (r.left() > rect.
left() + titleHeight)
587 if (hasMaximize && !isMaximized) {
590 if (r.left() > rect.
left() + titleHeight)
597 if (hasMinimize && isMinimized) {
602 if (r.left() > rect.
left() + titleHeight)
604 }
else if (hasMaximize && isMaximized) {
607 if (r.left() > rect.
left() + titleHeight)
616 if (r.left() > rect.
left() + titleHeight)
624 if (i & decorationRegion)
625 region += this->
region(widget, rect, i);
646 int decorationRegion,
649 if (decorationRegion ==
None)
654 int titleHeight = titleRect.
height();
655 int titleWidth = titleRect.
width();
667 bool paintAll = (decorationRegion == int(
All));
668 bool handled =
false;
672 if ((paintAll || decorationRegion &
Borders) && state ==
Normal && hasBorder) {
675 QRect r(rect.left(), rect.top() - titleHeight,
676 rect.width(), titleHeight);
690 if ((paintAll || decorationRegion &
Title && titleWidth > 0) && state ==
Normal && hasTitle) {
695 if (widget ==
qApp->activeWindow()) {
706 titleRect.
x(), titleRect.
y(), titleRect.
width(), titleRect.
height(),
707 pal,
true, 1, &titleBrush);
711 painter->
setPen(titlePen);
712 painter->
drawText(titleRect.
x() + 4, titleRect.
y(),
718 if (state !=
Hover) {
720 if ((paintAll || decorationRegion &
Menu) && hasSysMenu) {
725 if ((paintAll || decorationRegion &
Help) && hasContextHelp) {
730 if ((paintAll || decorationRegion &
Minimize) && hasMinimize) {
731 paintButton(painter, widget, Minimize, state, pal);
735 if ((paintAll || decorationRegion &
Maximize) && hasMaximize) {
742 if (paintAll || decorationRegion &
Close) {
791 painter->
drawPixmap(brect.
x() + xoff, brect.
y() + yoff, pm);
804 #endif // QT_NO_QWS_DECORATION_DEFAULT The QPainter class performs low-level painting on widgets and other paint devices.
virtual void paintButton(QPainter *painter, const QWidget *widget, int buttonRegion, DecorationState state, const QPalette &pal)
Paints a region of the top-level widget.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
static const char *const default_maximize_xpm[]
QDecorationDefault()
Default constructor.
virtual QRegion region(const QWidget *widget, const QRect &rect, int decorationRegion=All)
Returns the region specified by decorationRegion for the top-level widget.
int left() const
Returns the x-coordinate of the rectangle's left edge.
virtual bool paint(QPainter *painter, const QWidget *widget, int decorationRegion=All, DecorationState state=Normal)
Paints the border and title decoration for the top-level widget using the painter provided and the de...
int width() const
Returns the width of the rectangle.
static const char *const default_normalize_xpm[]
static QPixmap * staticNormalizePixmap
static QPalette palette()
Returns the application palette.
QRect boundingRect() const
Returns the bounding rectangle of this region.
int height() const
Returns the height of the rectangle.
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
virtual QRegion region(const QWidget *w, const QRect &rect, int decorationRegion=All)=0
Implement this function to return the region specified by decorationRegion for the given top level wi...
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
static QPixmap * staticMenuPixmap
The QDecoration class is a base class for window decorations in Qt for Embedded Linux.
static const QRectF boundingRect(const QPointF *points, int pointCount)
static QFontMetrics fontMetrics()
Returns display (screen) font metrics for the application font.
virtual ~QDecorationDefault()
The constructor deletes the static pixmaps.
QRegion clipRegion() const
Returns the currently set clip region.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
virtual int titleBarHeight(const QWidget *widget)
Returns the title bar height in pixels for the given widget.
static QPixmap * staticHelpPixmap
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual const char ** xpmForRegion(int region)
Returns a pointer to the X pixmap for the icon specified by region.
void qDrawWinPanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
static const char *const default_minimize_xpm[]
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
static const char *const default_close_xpm[]
static const char *const default_menu_xpm[]
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
void qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
The QRegion class specifies a clip region for a painter.
static QPixmap * staticMinimizePixmap
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
int top() const
Returns the y-coordinate of the rectangle's top edge.
QString windowTitleFor(const QWidget *widget) const
void setClipRegion(const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip)
Sets the clip region to the given region using the specified clip operation.
int right() const
Returns the x-coordinate of the rectangle's right edge.
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
int y() const
Returns the y-coordinate of the rectangle's top edge.
static const char *const default_help_xpm[]
int x() const
Returns the x-coordinate of the rectangle's left edge.
virtual QPixmap pixmapFor(const QWidget *widget, int decorationRegion, int &xoff, int &yoff)
Returns a pointer to the QPixmap for the widget specified by widget and decorationRegion.
#define BOTTOM_BORDER_WIDTH
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
The QRect class defines a rectangle in the plane using integer precision.
DecorationState
This enum describes the various states of a decoration region.
The QPixmap class is an off-screen image representation that can be used as a paint device...
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device...
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
static QPixmap * staticMaximizePixmap
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
static QPixmap * staticClosePixmap
bool hasFeature(PaintEngineFeatures feature) const
Returns true if the paint engine supports the specified feature; otherwise returns false...
QString qt_setWindowTitle_helperHelper(const QString &, const QWidget *)
Returns a modified window title with the [*] place holder replaced according to the rules described i...
The QPalette class contains color groups for each widget state.