1 /****************************************************************************
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
5 **
6 ** This file is part of the QtWidgets module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL21$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 or version 3 as published by the Free
20 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22 ** following information to ensure the GNU Lesser General Public License
23 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 **
26 ** As a special exception, The Qt Company gives you certain additional
27 ** rights. These rights are described in The Qt Company LGPL Exception
28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 **
30 ** $QT_END_LICENSE$
31 **
32 ****************************************************************************/
33 
34 #ifndef QGTK2PAINTER_P_H
35 #define QGTK2PAINTER_P_H
36 
37 //
38 //  W A R N I N G
39 //  -------------
40 //
41 // This file is not part of the Qt API.  It exists purely as an
42 // implementation detail.  This header file may change from version to
43 // version without notice, or even be removed.
44 //
45 // We mean it.
46 //
47 
48 #include <QtCore/qglobal.h>
49 
50 #include "qgtkpainter_p.h"
51 
52 QT_BEGIN_NAMESPACE
53 
54 class QGtk2Painter : public QGtkPainter
55 {
56 public:
57     QGtk2Painter();
58 
59     void paintBoxGap(GtkWidget *gtkWidget, const gchar* part, const QRect &rect,
60                      GtkStateType state, GtkShadowType shadow, GtkPositionType gap_side, gint x,
61                      gint width, GtkStyle *style) Q_DECL_OVERRIDE;
62     void paintBox(GtkWidget *gtkWidget, const gchar* part,
63                   const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style,
64                   const QString &pmKey = QString()) Q_DECL_OVERRIDE;
65     void paintHline(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkStyle *style,
66                     int x1, int x2, int y, const QString &pmKey = QString()) Q_DECL_OVERRIDE;
67     void paintVline(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkStyle *style,
68                     int y1, int y2, int x, const QString &pmKey = QString()) Q_DECL_OVERRIDE;
69     void paintExpander(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state,
70                        GtkExpanderStyle expander_state, GtkStyle *style, const QString &pmKey = QString()) Q_DECL_OVERRIDE;
71     void paintFocus(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkStyle *style,
72                     const QString &pmKey = QString()) Q_DECL_OVERRIDE;
73     void paintResizeGrip(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow,
74                          GdkWindowEdge edge, GtkStyle *style, const QString &pmKey = QString()) Q_DECL_OVERRIDE;
75     void paintArrow(GtkWidget *gtkWidget, const gchar* part, const QRect &arrowrect, GtkArrowType arrow_type, GtkStateType state, GtkShadowType shadow,
76                     gboolean fill, GtkStyle *style, const QString &pmKey = QString()) Q_DECL_OVERRIDE;
77     void paintHandle(GtkWidget *gtkWidget, const gchar* part, const QRect &rect,
78                      GtkStateType state, GtkShadowType shadow, GtkOrientation orientation, GtkStyle *style) Q_DECL_OVERRIDE;
79     void paintSlider(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow,
80                      GtkStyle *style, GtkOrientation orientation, const QString &pmKey = QString()) Q_DECL_OVERRIDE;
81     void paintShadow(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow,
82                      GtkStyle *style, const QString &pmKey = QString()) Q_DECL_OVERRIDE;
83     void paintFlatBox(GtkWidget *gtkWidget, const gchar* part, const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, const QString & = QString()) Q_DECL_OVERRIDE;
84     void paintExtention(GtkWidget *gtkWidget, const gchar *part, const QRect &rect, GtkStateType state, GtkShadowType shadow,
85                         GtkPositionType gap_pos, GtkStyle *style) Q_DECL_OVERRIDE;
86     void paintOption(GtkWidget *gtkWidget, const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, const QString &detail) Q_DECL_OVERRIDE;
87     void paintCheckbox(GtkWidget *gtkWidget, const QRect &rect, GtkStateType state, GtkShadowType shadow, GtkStyle *style, const QString &detail) Q_DECL_OVERRIDE;
88 
89 private:
90     QPixmap renderTheme(uchar *bdata, uchar *wdata, const QRect &rect) const;
91 
92     GtkWidget *m_window;
93 };
94 
95 QT_END_NAMESPACE
96 
97 #endif // QGTK2PAINTER_P_H
98