QtBase  v6.3.1
qpaintengine_x11_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2018 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
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 https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://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 3 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 3 requirements
23 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24 **
25 ** GNU General Public License Usage
26 ** Alternatively, this file may be used under the terms of the GNU
27 ** General Public License version 2.0 or (at your option) the GNU General
28 ** Public license version 3 or any later version approved by the KDE Free
29 ** Qt Foundation. The licenses are as published by the Free Software
30 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31 ** included in the packaging of this file. Please review the following
32 ** information to ensure the GNU General Public License requirements will
33 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34 ** https://www.gnu.org/licenses/gpl-3.0.html.
35 **
36 ** $QT_END_LICENSE$
37 **
38 ****************************************************************************/
39 
40 #ifndef QPAINTENGINE_X11_H
41 #define QPAINTENGINE_X11_H
42 
43 #include <QtGui/QPaintEngine>
44 
45 typedef unsigned long XID;
46 typedef XID Drawable;
47 typedef struct _XGC *GC;
48 
50 
51 extern "C" {
55 }
56 
59 {
60  Q_DECLARE_PRIVATE(QX11PaintEngine)
61 public:
64 
65  bool begin(QPaintDevice *pdev) override;
66  bool end() override;
67 
68  void updateState(const QPaintEngineState &state) override;
69 
70  void updatePen(const QPen &pen);
71  void updateBrush(const QBrush &brush, const QPointF &pt);
72  void updateRenderHints(QPainter::RenderHints hints);
73  void updateFont(const QFont &font);
74  void updateMatrix(const QTransform &matrix);
75  void updateClipRegion_dev(const QRegion &region, Qt::ClipOperation op);
76 
77  void drawLines(const QLine *lines, int lineCount) override;
78  void drawLines(const QLineF *lines, int lineCount) override;
79 
80  void drawRects(const QRect *rects, int rectCount) override;
81  void drawRects(const QRectF *rects, int rectCount) override;
82 
83  void drawPoints(const QPoint *points, int pointCount) override;
84  void drawPoints(const QPointF *points, int pointCount) override;
85 
86  void drawEllipse(const QRect &r) override;
87  void drawEllipse(const QRectF &r) override;
88 
89  virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
90  inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override
91  { QPaintEngine::drawPolygon(points, pointCount, mode); }
92 
93  void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
94  void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override;
95  void drawPath(const QPainterPath &path) override;
96  void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
97  void drawImage(const QRectF &r, const QImage &img, const QRectF &sr,
98  Qt::ImageConversionFlags flags = Qt::AutoColor) override;
99 
100  virtual Drawable handle() const;
101  inline Type type() const override { return QPaintEngine::X11; }
102 
103  QPainter::RenderHints supportedRenderHints() const;
104 
105 protected:
107 
108 #if QT_CONFIG(fontconfig)
109  void drawFreetype(const QPointF &p, const QTextItemInt &ti);
110  bool drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti);
111 #endif // QT_CONFIG(fontconfig)
112 
113  friend class QPixmap;
114  friend class QFontEngineBox;
115  friend GC qt_x11_get_pen_gc(QPainter *);
116  friend GC qt_x11_get_brush_gc(QPainter *);
117 
118 private:
120 };
121 
123 
124 #endif // QPAINTENGINE_X11_H
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:66
The QFont class specifies a query for a font used for drawing text.
Definition: qfont.h:56
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:73
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:215
The QLine class provides a two-dimensional vector using integer precision.
Definition: qline.h:53
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
Definition: qpaintengine.h:87
virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)
QPaintEngineState * state
Definition: qpaintengine.h:234
The QPaintEngineState class provides information about the active paint engine's current state....
Definition: qpaintengine.h:268
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:82
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:65
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:61
The QPixmap class is an off-screen image representation that can be used as a paint device.
Definition: qpixmap.h:63
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:242
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:52
The QRectF class defines a finite rectangle in the plane using floating point precision.
Definition: qrect.h:511
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:59
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:63
The QTextItem class provides all the information required to draw text in a custom paint engine.
Definition: qpaintengine.h:64
Internal QTextItem.
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:56
void updateState(const QPaintEngineState &state) override
void drawTextItem(const QPointF &p, const QTextItem &textItem) override
void drawLines(const QLine *lines, int lineCount) override
bool begin(QPaintDevice *pdev) override
void updateBrush(const QBrush &brush, const QPointF &pt)
void updateClipRegion_dev(const QRegion &region, Qt::ClipOperation op)
void updateFont(const QFont &font)
virtual Drawable handle() const
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override
friend GC qt_x11_get_pen_gc(QPainter *)
void drawRects(const QRect *rects, int rectCount) override
void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override
void updateMatrix(const QTransform &matrix)
Type type() const override
QPainter::RenderHints supportedRenderHints() const
friend GC qt_x11_get_brush_gc(QPainter *)
void updateRenderHints(QPainter::RenderHints hints)
void drawPath(const QPainterPath &path) override
void drawPoints(const QPoint *points, int pointCount) override
virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override
void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override
void updatePen(const QPen &pen)
void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) override
bool end() override
void drawEllipse(const QRect &r) override
@ AutoColor
Definition: qnamespace.h:503
ClipOperation
Definition: qnamespace.h:1330
Definition: brush.cpp:52
set set set set set set set macro pixldst1 op
#define Q_DISABLE_COPY_MOVE(Class)
Definition: qglobal.h:519
GLenum mode
GLboolean r
[2]
GLbitfield flags
GLuint GLenum GLenum transform
Definition: qopenglext.h:11564
GLfixed GLfixed GLint GLint GLfixed points
Definition: qopenglext.h:5206
GLint void * img
Definition: qopenglext.h:233
GLuint GLenum matrix
Definition: qopenglext.h:11564
GLsizei const GLchar *const * path
Definition: qopenglext.h:4283
GLdouble s
[6]
Definition: qopenglext.h:235
GLfloat GLfloat p
[1]
Definition: qopenglext.h:12698
unsigned long XID
QT_BEGIN_NAMESPACE Drawable qt_x11Handle(const QPaintDevice *pd)
GC qt_x11_get_pen_gc(QPainter *)
struct _XGC * GC
XID Drawable
GC qt_x11_get_brush_gc(QPainter *)
widget render & pixmap
Definition: moc.h:48