Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qpaintengine_x11_p.h
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#pragma once
6
7#include <QtGui/QPaintEngine>
8
9typedef unsigned long XID;
10typedef XID Drawable;
11typedef struct _XGC *GC;
12
13QT_BEGIN_NAMESPACE
14
15extern "C" {
16Drawable qt_x11Handle(const QPaintDevice *pd);
17GC qt_x11_get_pen_gc(QPainter *);
18GC qt_x11_get_brush_gc(QPainter *);
19}
20
23{
25public:
28
29 bool begin(QPaintDevice *pdev) override;
30 bool end() override;
31
32 void updateState(const QPaintEngineState &state) override;
33
34 void updatePen(const QPen &pen);
35 void updateBrush(const QBrush &brush, const QPointF &pt);
36 void updateRenderHints(QPainter::RenderHints hints);
37 void updateFont(const QFont &font);
38 void updateMatrix(const QTransform &matrix);
39 void updateClipRegion_dev(const QRegion &region, Qt::ClipOperation op);
40
41 void drawLines(const QLine *lines, int lineCount) override;
42 void drawLines(const QLineF *lines, int lineCount) override;
43
44 void drawRects(const QRect *rects, int rectCount) override;
45 void drawRects(const QRectF *rects, int rectCount) override;
46
47 void drawPoints(const QPoint *points, int pointCount) override;
48 void drawPoints(const QPointF *points, int pointCount) override;
49
50 void drawEllipse(const QRect &r) override;
51 void drawEllipse(const QRectF &r) override;
52
53 virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
54 inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override
55 { QPaintEngine::drawPolygon(points, pointCount, mode); }
56
57 void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
58 void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override;
59 void drawPath(const QPainterPath &path) override;
60 void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
61 void drawImage(const QRectF &r, const QImage &img, const QRectF &sr,
62 Qt::ImageConversionFlags flags = Qt::AutoColor) override;
63
64 virtual Drawable handle() const;
65 inline Type type() const override { return QPaintEngine::X11; }
66
68
69protected:
71
72#if QT_CONFIG(fontconfig)
73 void drawFreetype(const QPointF &p, const QTextItemInt &ti);
75#endif // QT_CONFIG(fontconfig)
76
77 friend class QPixmap;
78 friend class QFontEngineBox;
79 friend GC qt_x11_get_pen_gc(QPainter *);
80 friend GC qt_x11_get_brush_gc(QPainter *);
81
82private:
84};
85
86QT_END_NAMESPACE
void systemStateChanged() override
QPolygonClipper< qt_float_point, qt_float_point, float > polygonClipper
void setupAdaptedOrigin(const QPoint &p)
void fillPolygon_translated(const QPointF *points, int pointCount, GCMode gcMode, QPaintEngine::PolygonDrawMode mode)
void clipPolygon_dev(const QPolygonF &poly, QPolygonF *clipped_poly)
QTransform::TransformationType txop
void strokePolygon_dev(const QPointF *points, int pointCount, bool close)
const QXcbX11Info * xinfo
void fillPath(const QPainterPath &path, GCMode gcmode, bool transform)
void strokePolygon_translated(const QPointF *points, int pointCount, bool close)
void fillPolygon_dev(const QPointF *points, int pointCount, GCMode gcMode, QPaintEngine::PolygonDrawMode mode)
friend GC qt_x11_get_pen_gc(QPainter *)
Returns the X11 specific pen GC for the painter p.
void updateState(const QPaintEngineState &state) override
Reimplement this function to update the state of a paint engine.
void drawTextItem(const QPointF &p, const QTextItem &textItem) override
This function draws the text item textItem at position p.
void drawLines(const QLine *lines, int lineCount) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool begin(QPaintDevice *pdev) override
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
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
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
QX11PaintEngine(QX11PaintEnginePrivate &dptr)
void drawRects(const QRect *rects, int rectCount) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void updateMatrix(const QTransform &matrix)
Type type() const override
Reimplement this function to return the paint engine \l{Type}.
QPainter::RenderHints supportedRenderHints() const
void updateRenderHints(QPainter::RenderHints hints)
void drawPath(const QPainterPath &path) override
The default implementation ignores the path and does nothing.
void drawPoints(const QPoint *points, int pointCount) override
Draws the first pointCount points in the buffer points.
friend GC qt_x11_get_brush_gc(QPainter *)
Returns the X11 specific brush GC for the painter p.
virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override
Reimplement this virtual function to draw the polygon defined by the pointCount first points in point...
void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override
Reimplement this function to draw the pixmap in the given rect, starting at the given p.
void updatePen(const QPen &pen)
void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) override
Reimplement this function to draw the part of the image specified by the sr rectangle in the given re...
bool end() override
Reimplement this function to finish painting on the current paint device.
void drawEllipse(const QRect &r) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
friend const QXcbX11Info & qt_x11Info(const QPixmap &pixmap)
static Display * display()
Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale)
static void setCapStyle(int cap_style, GC gc)
static void x11SetClipRegion(Display *dpy, GC gc, GC gc2, Qt::HANDLE picture, const QRegion &r)
static const qreal aliasedCoordinateDelta
#define X11
static QPaintEngine::PaintEngineFeatures qt_decide_features()
Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const QImage &image, Drawable hd, GC gc, Display *dpy, Visual *visual, int depth)
static QLine clipStraightLine(const QRect &clip, const QLine &l)
#define DITHER_SIZE
QPixmap qt_toX11Pixmap(const QPixmap &pixmap)
static void x11ClearClipRegion(Display *dpy, GC gc, GC gc2, Qt::HANDLE picture)
static const uchar base_dither_matrix[DITHER_SIZE][DITHER_SIZE]
static const QXcbX11Info * qt_x11Info(const QPaintDevice *pd)
void qt_draw_tile(QPaintEngine *, qreal, qreal, qreal, qreal, const QPixmap &, qreal, qreal)
static QPixmap qt_patternForAlpha(uchar alpha, int screen)
static bool clipLine(QLineF *line, const QRect &rect)
struct _XGC * GC
XID Drawable
QPixmap qt_pixmapForBrush(int style, bool invert)
Definition qbrush.cpp:80
XID Pixmap
int qt_x11SetDefaultScreen(int screen)
QT_BEGIN_NAMESPACE QPainterPath qt_regionToPath(const QRegion &region)
Definition qregion.cpp:1010
#define EvenOddRule
Definition qregion.cpp:1604
#define WindingRule
Definition qregion.cpp:1605
#define Q_XCB_EXPORT
Definition qxcbexport.h:14
void write(QChar *&dest) const
HexString(const T t)
static int size(const HexString< T > &)
static void appendTo(const HexString< T > &str, QChar *&out)
bool use_xrender
Definition qt_x11_p.h:94