5 #ifndef __quartzgraphicspath__ 6 #define __quartzgraphicspath__ 8 #include "../../cgraphicspath.h" 9 #include "../../cgradient.h" 13 #include "macglobals.h" 15 #include <CoreGraphics/CoreGraphics.h> 16 #include <ImageIO/ImageIO.h> 18 #include <ApplicationServices/ApplicationServices.h> 26 class QuartzGraphicsPath :
public CGraphicsPath
29 QuartzGraphicsPath ();
30 QuartzGraphicsPath (
const CoreTextFont* font, UTF8StringPtr text);
31 ~QuartzGraphicsPath () noexcept override;
33 void pixelAlign (CDrawContext* context);
34 CGPathRef getCGPathRef ();
35 void dirty () override;
37 bool hitTest (const CPoint& p,
bool evenOddFilled = false, CGraphicsTransform* transform =
nullptr) override;
38 CPoint getCurrentPosition () override;
39 CRect getBoundingBox () override;
41 CGradient* createGradient (
double color1Start,
double color2Start, const CColor& color1, const CColor& color2) override;
43 static CGAffineTransform createCGAffineTransform (const CGraphicsTransform& t);
47 CGMutablePathRef path;
48 CGMutablePathRef originalTextPath;
53 class QuartzGradient : public CGradient
56 explicit QuartzGradient (
const ColorStopMap& map);
57 QuartzGradient (
double _color1Start,
double _color2Start,
const CColor& _color1,
const CColor& _color2);
58 ~QuartzGradient () noexcept override;
60 operator CGGradientRef () const;
62 void addColorStop (const std::pair<
double, CColor>& colorStop) override;
63 void addColorStop (std::pair<
double, CColor>&& colorStop) override;
66 void createCGGradient () const;
67 void releaseCGGradient ();
69 mutable CGGradientRef gradient;
76 #endif // __quartzgraphicspath__ Definition: customcontrols.cpp:8