ASPiK SDK
VSTGUI::Cairo::Context Class Reference
Inheritance diagram for VSTGUI::Cairo::Context:
VSTGUI::COffscreenContext VSTGUI::CDrawContext VSTGUI::ReferenceCounted< T > VSTGUI::IReference

Public Types

using super = COffscreenContext
 
- Public Types inherited from VSTGUI::CDrawContext
using LinePair = std::pair< CPoint, CPoint >
 
using LineList = std::vector< LinePair >
 
using PointList = std::vector< CPoint >
 
enum  PathDrawMode { kPathFilled, kPathFilledEvenOdd, kPathStroked }
 

Public Member Functions

 Context (CRect &rect, const SurfaceHandle &surface)
 
 Context (CRect r, cairo_t *context)
 
 Context (Bitmap *bitmap)
 
bool valid () const
 
CRect getSurfaceRect () const
 
const SurfaceHandlegetSurface () const
 
const ContextHandlegetCairo () const
 
void drawLine (const LinePair &line) override
 draw a line
 
void drawLines (const LineList &lines) override
 draw multiple lines at once
 
void drawPolygon (const PointList &polygonPointList, const CDrawStyle drawStyle) override
 draw a polygon
 
void drawRect (const CRect &rect, const CDrawStyle drawStyle) override
 draw a rect
 
void drawArc (const CRect &rect, const float startAngle1, const float endAngle2, const CDrawStyle drawStyle) override
 draw an arc, angles are in degree
 
void drawEllipse (const CRect &rect, const CDrawStyle drawStyle) override
 draw an ellipse
 
void drawPoint (const CPoint &point, const CColor &color) override
 draw a point
 
void drawBitmap (CBitmap *bitmap, const CRect &dest, const CPoint &offset, float alpha) override
 don't call directly, please use CBitmap::draw instead
 
void clearRect (const CRect &rect) override
 clears the rect (makes r = 0, g = 0, b = 0, a = 0)
 
CGraphicsPathcreateGraphicsPath () override
 create a graphics path object, you need to forget it after usage
 
CGraphicsPathcreateTextPath (const CFontRef font, UTF8StringPtr text) override
 create a graphics path from a text
 
void drawGraphicsPath (CGraphicsPath *path, PathDrawMode mode, CGraphicsTransform *transformation) override
 
void fillLinearGradient (CGraphicsPath *path, const CGradient &gradient, const CPoint &startPoint, const CPoint &endPoint, bool evenOdd, CGraphicsTransform *transformation) override
 
void fillRadialGradient (CGraphicsPath *path, const CGradient &gradient, const CPoint &center, CCoord radius, const CPoint &originOffset, bool evenOdd, CGraphicsTransform *transformation) override
 
void saveGlobalState () override
 
void restoreGlobalState () override
 
void beginDraw () override
 
void endDraw () override
 
- Public Member Functions inherited from VSTGUI::COffscreenContext
CBitmapgetBitmap () const
 
void copyFrom (CDrawContext *pContext, CRect destRect, CPoint srcOffset=CPoint(0, 0))
 copy from offscreen to pContext
 
CCoord getWidth () const
 
CCoord getHeight () const
 
- Public Member Functions inherited from VSTGUI::CDrawContext
virtual void setLineStyle (const CLineStyle &style)
 set the current line style
 
const CLineStylegetLineStyle () const
 get the current line style
 
virtual void setLineWidth (CCoord width)
 set the current line width
 
CCoord getLineWidth () const
 get the current line width
 
virtual void setDrawMode (CDrawMode mode)
 set the current draw mode, see CDrawMode
 
CDrawMode getDrawMode () const
 get the current draw mode, see CDrawMode
 
virtual void setClipRect (const CRect &clip)
 set the current clip
 
CRectgetClipRect (CRect &clip) const
 get the current clip
 
virtual void resetClipRect ()
 reset the clip to the default state
 
virtual void setFillColor (const CColor &color)
 set current fill color
 
CColor getFillColor () const
 get current fill color
 
virtual void setFrameColor (const CColor &color)
 set current stroke color
 
CColor getFrameColor () const
 get current stroke color
 
virtual void setFontColor (const CColor &color)
 set current font color
 
CColor getFontColor () const
 get current font color
 
virtual void setFont (const CFontRef font, const CCoord &size=0, const int32_t &style=-1)
 set current font
 
const CFontRef getFont () const
 get current font
 
CCoord getStringWidth (UTF8StringPtr pStr)
 get the width of an UTF-8 encoded string
 
void drawString (UTF8StringPtr string, const CRect &_rect, const CHoriTxtAlign hAlign=kCenterText, bool antialias=true)
 draw an UTF-8 encoded string
 
void drawString (UTF8StringPtr string, const CPoint &_point, bool antialias=true)
 draw an UTF-8 encoded string
 
CCoord getStringWidth (IPlatformString *pStr)
 get the width of a platform string
 
void drawString (IPlatformString *string, const CRect &_rect, const CHoriTxtAlign hAlign=kCenterText, bool antialias=true)
 draw a platform string
 
void drawString (IPlatformString *string, const CPoint &_point, bool antialias=true)
 draw a platform string
 
virtual void setGlobalAlpha (float newAlpha)
 sets the global alpha value[0..1]
 
float getGlobalAlpha () const
 get current global alpha value
 
const CGraphicsTransformgetCurrentTransform () const
 
const CRectgetAbsoluteClipRect () const
 
virtual double getScaleFactor () const
 
CCoord getHairlineSize () const
 
void drawLine (const CPoint &start, const CPoint &end)
 
virtual void drawBitmapNinePartTiled (CBitmap *bitmap, const CRect &dest, const CNinePartTiledDescription &desc, float alpha=1.f)
 
virtual void fillRectWithBitmap (CBitmap *bitmap, const CRect &srcRect, const CRect &dstRect, float alpha)
 
CGraphicsPathcreateRoundRectGraphicsPath (const CRect &size, CCoord radius)
 create a rect with round corners as graphics path, you need to forget it after usage
 
- Public Member Functions inherited from VSTGUI::ReferenceCounted< T >
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
void forget () override
 decrease refcount and delete object if refcount == 0
 
void remember () override
 increase refcount
 
virtual int32_t getNbReference () const
 get refcount
 
virtual void beforeDelete ()
 

Additional Inherited Members

- Static Public Member Functions inherited from VSTGUI::COffscreenContext
static SharedPointer< COffscreenContextcreate (CFrame *frame, CCoord width, CCoord height, double scaleFactor=1.)
 
- Protected Member Functions inherited from VSTGUI::COffscreenContext
 COffscreenContext (CBitmap *bitmap)
 
 COffscreenContext (const CRect &surfaceRect)
 
- Protected Member Functions inherited from VSTGUI::CDrawContext
 CDrawContext (const CRect &surfaceRect)
 
void pushTransform (const CGraphicsTransform &transformation)
 
void popTransform ()
 
const UTF8StringgetDrawString (UTF8StringPtr string)
 
void clearDrawString ()
 
- Protected Attributes inherited from VSTGUI::COffscreenContext
SharedPointer< CBitmapbitmap
 
- Protected Attributes inherited from VSTGUI::CDrawContext
UTF8StringdrawStringHelper
 
CRect surfaceRect
 
CDrawContextState currentState
 

The documentation for this class was generated from the following files: