KiCad PCB EDA Suite
cairo_gal.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KICAD, a free EDA CAD application.
3  *
4  * Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
5  * Copyright (C) 2012-2021 KiCad Developers, see AUTHORS.txt for contributors.
6  * Copyright (C) 2017-2018 CERN
7  * @author Maciej Suminski <maciej.suminski@cern.ch>
8  *
9  * CairoGal - Graphics Abstraction Layer for Cairo
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, you may find one here:
23  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24  * or you may search the http://www.gnu.org website for the version 2 license,
25  * or you may write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
27  */
28 
29 #ifndef CAIROGAL_H_
30 #define CAIROGAL_H_
31 
32 #include <map>
33 #include <iterator>
34 
35 #include <cairo.h>
36 
38 #include <wx/dcbuffer.h>
39 
40 #include <memory>
41 
53 namespace KIGFX
54 {
55 class CAIRO_COMPOSITOR;
56 
57 class CAIRO_GAL_BASE : public GAL
58 {
59 public:
60  CAIRO_GAL_BASE( GAL_DISPLAY_OPTIONS& aDisplayOptions );
61 
63 
64  bool IsCairoEngine() override { return true; }
65 
66  // ---------------
67  // Drawing methods
68  // ---------------
69 
71  void DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint ) override;
72 
74  void DrawSegment( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint,
75  double aWidth ) override;
76 
78  void DrawCircle( const VECTOR2D& aCenterPoint, double aRadius ) override;
79 
81  void DrawArc( const VECTOR2D& aCenterPoint, double aRadius,
82  double aStartAngle, double aEndAngle ) override;
83 
85  void DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadius,
86  double aStartAngle, double aEndAngle, double aWidth ) override;
87 
89  void DrawRectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint ) override;
90 
92  void DrawPolyline( const std::deque<VECTOR2D>& aPointList ) override { drawPoly( aPointList ); }
93  void DrawPolyline( const VECTOR2D aPointList[], int aListSize ) override
94  {
95  drawPoly( aPointList, aListSize );
96  }
97 
98  void DrawPolyline( const SHAPE_LINE_CHAIN& aLineChain ) override { drawPoly( aLineChain ); }
99 
101  void DrawPolygon( const std::deque<VECTOR2D>& aPointList ) override { drawPoly( aPointList ); }
102  void DrawPolygon( const VECTOR2D aPointList[], int aListSize ) override
103  {
104  drawPoly( aPointList, aListSize );
105  }
106 
107  void DrawPolygon( const SHAPE_POLY_SET& aPolySet ) override;
108  void DrawPolygon( const SHAPE_LINE_CHAIN& aPolySet ) override;
109 
111  void DrawCurve( const VECTOR2D& startPoint, const VECTOR2D& controlPointA,
112  const VECTOR2D& controlPointB, const VECTOR2D& endPoint,
113  double aFilterValue = 0.0 ) override;
114 
116  void DrawBitmap( const BITMAP_BASE& aBitmap ) override;
117 
118  // --------------
119  // Screen methods
120  // --------------
121 
123  void ResizeScreen( int aWidth, int aHeight ) override;
124 
126  void Flush() override;
127 
129  void ClearScreen() override;
130 
131  // -----------------
132  // Attribute setting
133  // -----------------
134 
136  void SetIsFill( bool aIsFillEnabled ) override;
137 
139  void SetIsStroke( bool aIsStrokeEnabled ) override;
140 
142  void SetStrokeColor( const COLOR4D& aColor ) override;
143 
145  void SetFillColor( const COLOR4D& aColor ) override;
146 
148  void SetLineWidth( float aLineWidth ) override;
149 
151  void SetLayerDepth( double aLayerDepth ) override;
152 
153  // --------------
154  // Transformation
155  // --------------
156 
158  void Transform( const MATRIX3x3D& aTransformation ) override;
159 
161  void Rotate( double aAngle ) override;
162 
164  void Translate( const VECTOR2D& aTranslation ) override;
165 
167  void Scale( const VECTOR2D& aScale ) override;
168 
170  void Save() override;
171 
173  void Restore() override;
174 
175  // --------------------------------------------
176  // Group methods
177  // ---------------------------------------------
178 
180  int BeginGroup() override;
181 
183  void EndGroup() override;
184 
186  void DrawGroup( int aGroupNumber ) override;
187 
189  void ChangeGroupColor( int aGroupNumber, const COLOR4D& aNewColor ) override;
190 
192  void ChangeGroupDepth( int aGroupNumber, int aDepth ) override;
193 
195  void DeleteGroup( int aGroupNumber ) override;
196 
198  void ClearCache() override;
199 
200  // --------------------------------------------------------
201  // Handling the world <-> screen transformation
202  // --------------------------------------------------------
203 
205  void SetNegativeDrawMode( bool aSetting ) override;
206 
207  // -------
208  // Cursor
209  // -------
210 
212  void DrawCursor( const VECTOR2D& aCursorPosition ) override;
213 
214  void EnableDepthTest( bool aEnabled = false ) override;
215 
217  void DrawGrid() override;
218 
219 
220 protected:
221  // Geometric transforms according to the m_currentWorld2Screen transform matrix:
222  const double xform( double x ); // scale
223  const VECTOR2D xform( double x, double y ); // rotation, scale and offset
224  const VECTOR2D xform( const VECTOR2D& aP ); // rotation, scale and offset
225 
232  const double angle_xform( const double aAngle );
233 
241  void arc_angles_xform_and_normalize( double& aStartAngle, double& aEndAngle );
242 
244  void beginDrawing() override;
245 
247  void endDrawing() override;
248 
249  void resetContext();
250 
257  void drawGridLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );
258  void drawGridCross( const VECTOR2D& aPoint );
259  void drawGridPoint( const VECTOR2D& aPoint, double aWidth, double aHeight );
260  void drawAxes( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );
261 
262 
263  void flushPath();
264  void storePath();
265 
269  void blitCursor( wxMemoryDC& clientDC );
270 
272  void drawPoly( const std::deque<VECTOR2D>& aPointList );
273  void drawPoly( const VECTOR2D aPointList[], int aListSize );
274  void drawPoly( const SHAPE_LINE_CHAIN& aLineChain );
275 
281  unsigned int getNewGroupNumber();
282 
283  void syncLineWidth( bool aForceWidth = false, double aWidth = 0.0 );
285  const VECTOR2D roundp( const VECTOR2D& v );
286 
288  typedef GAL super;
289 
291  static const int MAX_CAIRO_ARGUMENTS = 4;
292 
295  {
303  //CMD_TRANSFORM, ///< Transform the actual context
310  };
311 
313  typedef struct
314  {
316  union {
317  double DblArg[MAX_CAIRO_ARGUMENTS];
318  bool BoolArg;
319  int IntArg;
320  } m_Argument;
321  cairo_path_t* m_CairoPath;
322  } GROUP_ELEMENT;
323 
324  typedef std::deque<GROUP_ELEMENT> GROUP;
325 
326  // Variables for the grouping function
329  std::map<int, GROUP> m_groups;
330  unsigned int m_groupCounter;
332 
335 
336  cairo_matrix_t m_cairoWorldScreenMatrix;
337  cairo_matrix_t m_currentXform;
338  cairo_matrix_t m_currentWorld2Screen;
339  cairo_t* m_currentContext;
340  cairo_t* m_context;
341  cairo_surface_t* m_surface;
342 
344  std::vector<cairo_surface_t*> m_imageSurfaces;
345 
346  std::vector<cairo_matrix_t> m_xformStack;
348  static constexpr cairo_format_t GAL_FORMAT = CAIRO_FORMAT_ARGB32;
349 };
350 
351 
352 class CAIRO_GAL : public CAIRO_GAL_BASE, public wxWindow
353 {
354 public:
366  CAIRO_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
367  wxEvtHandler* aMouseListener = nullptr, wxEvtHandler* aPaintListener = nullptr,
368  const wxString& aName = wxT( "CairoCanvas" ) );
369 
370  ~CAIRO_GAL();
371 
373  bool IsVisible() const override
374  {
375  return IsShownOnScreen() && !GetClientRect().IsEmpty();
376  }
377 
378  void ResizeScreen( int aWidth, int aHeight ) override;
379 
380  bool Show( bool aShow ) override;
381 
382  int BeginGroup() override;
383 
384  void EndGroup() override;
385 
386  void SetTarget( RENDER_TARGET aTarget ) override;
387 
388  RENDER_TARGET GetTarget() const override;
389 
390  void ClearTarget( RENDER_TARGET aTarget ) override;
391 
398  void PostPaint( wxPaintEvent& aEvent );
399 
400  void SetMouseListener( wxEvtHandler* aMouseListener )
401  {
402  m_mouseListener = aMouseListener;
403  }
404 
405  void SetPaintListener( wxEvtHandler* aPaintListener )
406  {
407  m_paintListener = aPaintListener;
408  }
409 
411  bool SetNativeCursorStyle( KICURSOR aCursor ) override;
412 
414  void beginDrawing() override;
415 
417  void endDrawing() override;
418 
420  void initSurface();
421 
423  void deinitSurface();
424 
426  void allocateBitmaps();
427 
429  void deleteBitmaps();
430 
432  void setCompositor();
433 
434  // Event handlers
440  void onPaint( wxPaintEvent& aEvent );
441 
447  void skipMouseEvent( wxMouseEvent& aEvent );
448 
454  void onSetNativeCursor( wxSetCursorEvent& aEvent );
455 
457  bool updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) override;
458 
459 protected:
460  // Compositor related variables
461  std::shared_ptr<CAIRO_COMPOSITOR> m_compositor;
462  unsigned int m_mainBuffer;
463  unsigned int m_overlayBuffer;
466 
467  // Variables related to wxWidgets
468  wxWindow* m_parentWindow;
469  wxEvtHandler* m_mouseListener;
470  wxEvtHandler* m_paintListener;
471  unsigned int m_bufferSize;
472  unsigned char* m_wxOutput;
473 
474  // Variables related to Cairo <-> wxWidgets
475  unsigned char* m_bitmapBuffer;
476  int m_stride;
480  wxCursor m_currentwxCursor;
481 };
482 
483 } // namespace KIGFX
484 
485 #endif // CAIROGAL_H_
void SetNegativeDrawMode(bool aSetting) override
Set negative draw mode in the renderer.
Definition: cairo_gal.cpp:920
wxWindow * m_parentWindow
Parent window.
Definition: cairo_gal.h:468
void initSurface()
Prepare Cairo surfaces for drawing.
Definition: cairo_gal.cpp:1425
unsigned char * m_wxOutput
wxImage compatible buffer
Definition: cairo_gal.h:472
void DrawBitmap(const BITMAP_BASE &aBitmap) override
Draw a bitmap image.
Definition: cairo_gal.cpp:462
std::map< int, GROUP > m_groups
List of graphic groups.
Definition: cairo_gal.h:329
void ResizeScreen(int aWidth, int aHeight) override
Resizes the canvas.
Definition: cairo_gal.cpp:530
CAIRO_GAL(GAL_DISPLAY_OPTIONS &aDisplayOptions, wxWindow *aParent, wxEvtHandler *aMouseListener=nullptr, wxEvtHandler *aPaintListener=nullptr, const wxString &aName=wxT("CairoCanvas"))
Definition: cairo_gal.cpp:1214
void EndGroup() override
End the group.
Definition: cairo_gal.cpp:772
void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor) override
Change the color used to draw the group.
Definition: cairo_gal.cpp:871
bool m_isInitialized
Are Cairo image & surface ready to use.
Definition: cairo_gal.h:478
double m_lineWidthInPixels
Definition: cairo_gal.h:333
bool updatedGalDisplayOptions(const GAL_DISPLAY_OPTIONS &aOptions) override
Handle updating display options.
Definition: cairo_gal.cpp:1518
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:175
void ResizeScreen(int aWidth, int aHeight) override
Resizes the canvas.
Definition: cairo_gal.cpp:1333
void deinitSurface()
Destroy Cairo surfaces when are not needed anymore.
Definition: cairo_gal.cpp:1446
void SetIsStroke(bool aIsStrokeEnabled) override
Enable/disable stroked outlines.
Definition: cairo_gal.cpp:565
RENDER_TARGET m_currentTarget
Current rendering target.
Definition: cairo_gal.h:464
void EnableDepthTest(bool aEnabled=false) override
Definition: cairo_gal.cpp:932
void ChangeGroupDepth(int aGroupNumber, int aDepth) override
Change the depth (Z-axis position) of the group.
Definition: cairo_gal.cpp:888
void onPaint(wxPaintEvent &aEvent)
Paint event handler.
Definition: cairo_gal.cpp:1504
std::deque< GROUP_ELEMENT > GROUP
A graphic group type definition.
Definition: cairo_gal.h:324
~CAIRO_GAL()
Return true if the GAL canvas is visible on the screen.
Definition: cairo_gal.cpp:1266
void Translate(const VECTOR2D &aTranslation) override
Translate the context.
Definition: cairo_gal.cpp:676
CAIRO_GAL_BASE(GAL_DISPLAY_OPTIONS &aDisplayOptions)
Definition: cairo_gal.cpp:49
void setCompositor()
Prepare the compositor.
Definition: cairo_gal.cpp:1489
void storePath()
Store the actual path.
Definition: cairo_gal.cpp:1060
GROUP * m_currentGroup
Currently used group.
Definition: cairo_gal.h:331
Type definition for an graphics group element.
Definition: cairo_gal.h:313
void DeleteGroup(int aGroupNumber) override
Delete the group from the memory.
Definition: cairo_gal.cpp:895
static const int MAX_CAIRO_ARGUMENTS
Maximum number of arguments for one command.
Definition: cairo_gal.h:291
unsigned char * m_bitmapBuffer
Storage of the Cairo image.
Definition: cairo_gal.h:475
KICURSOR
Definition: cursors.h:33
void PostPaint(wxPaintEvent &aEvent)
Post an event to m_paint_listener.
Definition: cairo_gal.cpp:1325
void drawAxes(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Definition: cairo_gal.cpp:969
bool IsVisible() const override
Return true if the GAL canvas is visible on the screen.
Definition: cairo_gal.h:373
cairo_matrix_t m_cairoWorldScreenMatrix
Cairo world to screen transform matrix.
Definition: cairo_gal.h:336
Enable/disable filling.
Definition: cairo_gal.h:296
void SetLayerDepth(double aLayerDepth) override
Set the depth of the layer (position on the z-axis)
Definition: cairo_gal.cpp:635
GAL super
Super class definition.
Definition: cairo_gal.h:288
unsigned int m_groupCounter
Counter used for generating group keys.
Definition: cairo_gal.h:330
unsigned int m_bufferSize
Size of buffers cairoOutput, bitmapBuffers.
Definition: cairo_gal.h:471
const double angle_xform(const double aAngle)
Transform according to the rotation from m_currentWorld2Screen transform matrix.
Definition: cairo_gal.cpp:127
GRAPHICS_COMMAND
Definitions for the command recorder.
Definition: cairo_gal.h:294
void DrawPolyline(const VECTOR2D aPointList[], int aListSize) override
Definition: cairo_gal.h:93
This class handle bitmap images in KiCad.
Definition: bitmap_base.h:51
void ClearCache() override
Delete all data created during caching of graphic items.
Definition: cairo_gal.cpp:913
void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius) override
Draw a circle using world coordinates.
Definition: cairo_gal.cpp:291
void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth) override
Draw a rounded segment.
Definition: cairo_gal.cpp:234
void DrawPolygon(const VECTOR2D aPointList[], int aListSize) override
Definition: cairo_gal.h:102
void drawGridPoint(const VECTOR2D &aPoint, double aWidth, double aHeight)
Definition: cairo_gal.cpp:1022
void ClearScreen() override
Clear the screen.
Definition: cairo_gal.cpp:542
bool m_isElementAdded
Was an graphic element added ?
Definition: cairo_gal.h:328
GRAPHICS_COMMAND m_Command
Command to execute.
Definition: cairo_gal.h:315
void ClearTarget(RENDER_TARGET aTarget) override
Clear the target for rendering.
Definition: cairo_gal.cpp:1404
void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
Draw a line.
Definition: cairo_gal.cpp:196
std::vector< cairo_matrix_t > m_xformStack
Definition: cairo_gal.h:346
Represent a set of closed polygons.
void endDrawing() override
Definition: cairo_gal.cpp:98
void SetPaintListener(wxEvtHandler *aPaintListener)
Definition: cairo_gal.h:405
void DrawArcSegment(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth) override
Draw an arc segment.
Definition: cairo_gal.cpp:343
void DrawPolygon(const std::deque< VECTOR2D > &aPointList) override
Draw a polygon.
Definition: cairo_gal.h:101
wxCursor m_currentwxCursor
wxCursor showing the current native cursor
Definition: cairo_gal.h:480
cairo_t * m_currentContext
Currently used Cairo context for drawing.
Definition: cairo_gal.h:339
bool SetNativeCursorStyle(KICURSOR aCursor) override
Set the cursor in the native panel.
Definition: cairo_gal.cpp:1541
void updateWorldScreenMatrix()
Definition: cairo_gal.cpp:105
void DrawCursor(const VECTOR2D &aCursorPosition) override
Draw the cursor.
Definition: cairo_gal.cpp:926
void onSetNativeCursor(wxSetCursorEvent &aEvent)
Give the correct cursor image when the native widget asks for it.
Definition: cairo_gal.cpp:1556
const double xform(double x)
Definition: cairo_gal.cpp:173
int m_stride
Stride value for Cairo.
Definition: cairo_gal.h:476
cairo_t * m_context
Cairo image.
Definition: cairo_gal.h:340
void SetTarget(RENDER_TARGET aTarget) override
Set the target for rendering.
Definition: cairo_gal.cpp:1375
void skipMouseEvent(wxMouseEvent &aEvent)
Mouse event handler, forwards the event to the child.
Definition: cairo_gal.cpp:1510
Save the transformation matrix.
Definition: cairo_gal.h:307
void SetIsFill(bool aIsFillEnabled) override
Enable/disable fill.
Definition: cairo_gal.cpp:550
const VECTOR2D roundp(const VECTOR2D &v)
Definition: cairo_gal.cpp:187
bool m_validCompositor
Compositor initialization flag.
Definition: cairo_gal.h:465
cairo_matrix_t m_currentWorld2Screen
Definition: cairo_gal.h:338
void DrawArc(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle) override
Draw an arc.
Definition: cairo_gal.cpp:307
void DrawPolyline(const std::deque< VECTOR2D > &aPointList) override
Draw a polyline.
Definition: cairo_gal.h:92
void SetStrokeColor(const COLOR4D &aColor) override
Set the stroke color.
Definition: cairo_gal.cpp:580
void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
Draw a rectangle.
Definition: cairo_gal.cpp:405
void beginDrawing() override
Definition: cairo_gal.cpp:1272
void Restore() override
Restore the context.
Definition: cairo_gal.cpp:734
bool Show(bool aShow) override
Show/hide the GAL canvas.
Definition: cairo_gal.cpp:1350
cairo_matrix_t m_currentXform
Definition: cairo_gal.h:337
int BeginGroup() override
Begin a group.
Definition: cairo_gal.cpp:756
bool BoolArg
A bool argument.
Definition: cairo_gal.h:318
void arc_angles_xform_and_normalize(double &aStartAngle, double &aEndAngle)
Transform according to the rotation from m_currentWorld2Screen transform matrix for the start angle a...
Definition: cairo_gal.cpp:141
wxEvtHandler * m_mouseListener
Mouse listener.
Definition: cairo_gal.h:469
RENDER_TARGET GetTarget() const override
Get the currently used target for rendering.
Definition: cairo_gal.cpp:1398
SHAPE_LINE_CHAIN.
void drawPoly(const std::deque< VECTOR2D > &aPointList)
Drawing polygons & polylines is the same in Cairo, so here is the common code.
Definition: cairo_gal.cpp:1126
void DrawGrid() override
Definition: cairo_gal.cpp:1562
Translate the context.
Definition: cairo_gal.h:305
void Save() override
Save the context.
Definition: cairo_gal.cpp:716
void beginDrawing() override
Definition: cairo_gal.cpp:92
void endDrawing() override
Definition: cairo_gal.cpp:1286
void SetMouseListener(wxEvtHandler *aMouseListener)
Definition: cairo_gal.h:400
void drawGridLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a grid line (usually a simplified line function).
Definition: cairo_gal.cpp:987
unsigned int m_mainBuffer
Handle to the main buffer.
Definition: cairo_gal.h:462
cairo_path_t * m_CairoPath
Pointer to a Cairo path.
Definition: cairo_gal.h:321
void SetLineWidth(float aLineWidth) override
Set the line width.
Definition: cairo_gal.cpp:616
std::shared_ptr< CAIRO_COMPOSITOR > m_compositor
Object for layers compositing.
Definition: cairo_gal.h:461
void Scale(const VECTOR2D &aScale) override
Scale the context.
Definition: cairo_gal.cpp:696
void deleteBitmaps()
Allocate the bitmaps for drawing.
Definition: cairo_gal.cpp:1479
void DrawGroup(int aGroupNumber) override
Draw the stored group.
Definition: cairo_gal.cpp:779
void syncLineWidth(bool aForceWidth=false, double aWidth=0.0)
Definition: cairo_gal.cpp:210
int BeginGroup() override
Begin a group.
Definition: cairo_gal.cpp:1361
RENDER_TARGET
RENDER_TARGET: Possible rendering targets.
Definition: definitions.h:46
void allocateBitmaps()
Allocate the bitmaps for drawing.
Definition: cairo_gal.cpp:1460
unsigned int m_overlayBuffer
Handle to the overlay buffer.
Definition: cairo_gal.h:463
void Transform(const MATRIX3x3D &aTransformation) override
Transform the context.
Definition: cairo_gal.cpp:642
bool IsCairoEngine() override
Return true if the GAL engine is a Cairo based type.
Definition: cairo_gal.h:64
void DrawCurve(const VECTOR2D &startPoint, const VECTOR2D &controlPointA, const VECTOR2D &controlPointB, const VECTOR2D &endPoint, double aFilterValue=0.0) override
Draw a cubic bezier spline.
Definition: cairo_gal.cpp:440
void EndGroup() override
End the group.
Definition: cairo_gal.cpp:1368
cairo_surface_t * m_surface
Cairo surface.
Definition: cairo_gal.h:341
void Flush() override
Force all remaining objects to be drawn.
Definition: cairo_gal.cpp:536
std::vector< cairo_surface_t * > m_imageSurfaces
List of surfaces that were created by painting images, to be cleaned up later.
Definition: cairo_gal.h:344
Enable/disable stroking.
Definition: cairo_gal.h:297
unsigned int getNewGroupNumber()
Return a valid key that can be used as a new group number.
Definition: cairo_gal.cpp:1202
bool m_isGrouping
Is grouping enabled ?
Definition: cairo_gal.h:327
void blitCursor(wxMemoryDC &clientDC)
Blit cursor into the current screen.
Definition: cairo_gal.cpp:1109
Restore the transformation matrix.
Definition: cairo_gal.h:308
void SetFillColor(const COLOR4D &aColor) override
Set the fill color.
Definition: cairo_gal.cpp:598
void drawGridCross(const VECTOR2D &aPoint)
Definition: cairo_gal.cpp:1001
Abstract interface for drawing on a 2D-surface.
void Rotate(double aAngle) override
Rotate the context.
Definition: cairo_gal.cpp:657
static constexpr cairo_format_t GAL_FORMAT
Format used to store pixels.
Definition: cairo_gal.h:348
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98
COLOR4D m_backgroundColor
Background color.
Definition: cairo_gal.h:479
void DrawPolyline(const SHAPE_LINE_CHAIN &aLineChain) override
Definition: cairo_gal.h:98
wxEvtHandler * m_paintListener
Paint listener.
Definition: cairo_gal.h:470