A drawing context encapsulates the drawing context of the underlying OS. More...
#include <vstgui.h>
Public Member Functions | |
~CDrawContext () | |
void * | getWindow () |
void | setWindow (void *ptr) |
void | getLoc (CPoint &where) const |
CFrame * | getFrame () const |
void * | getSystemContext () const |
void | forget () |
decrease refcount and delete object if refcount == 0 | |
DEPRECATED_ATTRIBUTE CColor | getPoint (const CPoint &point) |
DEPRECATED_ATTRIBUTE void | floodFill (const CPoint &start) |
DEPRECATED_ATTRIBUTE void | drawArc (const CRect &rect, const CPoint &point1, const CPoint &point2) |
DEPRECATED_ATTRIBUTE void | fillArc (const CRect &rect, const CPoint &point1, const CPoint &point2) |
DEPRECATED_ATTRIBUTE void | polyLine (const CPoint *pPoint, long numberOfPoints) |
DEPRECATED_ATTRIBUTE void | fillPolygon (const CPoint *pPoint, long numberOfPoints) |
DEPRECATED_ATTRIBUTE void | fillRect (const CRect &rect) |
DEPRECATED_ATTRIBUTE void | fillEllipse (const CRect &rect) |
DEPRECATED_ATTRIBUTE long | getMouseButtons () |
DEPRECATED_ATTRIBUTE void | getMouseLocation (CPoint &point) |
DEPRECATED_ATTRIBUTE bool | waitDoubleClick () |
DEPRECATED_ATTRIBUTE bool | waitDrag () |
Public Attributes | |
CPoint | offsetScreen |
CPoint | offset |
Protected Attributes | |
void * | pSystemContext |
void * | pWindow |
CFrame * | pFrame |
CFontRef | font |
CColor | fontColor |
CPoint | penLoc |
CCoord | frameWidth |
CColor | frameColor |
CColor | fillColor |
CLineStyle | lineStyle |
CDrawMode | drawMode |
CRect | clipRect |
Constructor | |
| |
CDrawContext (CFrame *pFrame, void *pSystemContext, void *pWindow=0) | |
Draw primitives | |
| |
void | moveTo (const CPoint &point) |
move line position to point | |
void | lineTo (const CPoint &point) |
draw a line from current position to point | |
void | drawLines (const CPoint *points, const long &numberOfLines) |
draw multiple lines at once | |
void | drawPolygon (const CPoint *pPoints, long numberOfPoints, const CDrawStyle drawStyle=kDrawStroked, bool closePolygon=true) |
draw a polygon | |
void | drawRect (const CRect &rect, const CDrawStyle drawStyle=kDrawStroked) |
draw a rect | |
void | drawArc (const CRect &rect, const float startAngle1, const float endAngle2, const CDrawStyle drawStyle=kDrawStroked) |
draw an arc, angles are in degree | |
void | drawEllipse (const CRect &rect, const CDrawStyle drawStyle=kDrawStroked) |
draw an ellipse | |
void | drawPoint (const CPoint &point, CColor color) |
draw a point | |
Line Mode | |
| |
void | setLineStyle (CLineStyle style) |
set the current line style | |
CLineStyle | getLineStyle () const |
get the current line style | |
void | setLineWidth (CCoord width) |
set the current line width | |
CCoord | getLineWidth () const |
get the current line width | |
Draw Mode | |
| |
void | setDrawMode (CDrawMode mode) |
set the current draw mode, see CDrawMode | |
CDrawMode | getDrawMode () const |
get the current draw mode, see CDrawMode | |
Clipping | |
| |
void | setClipRect (const CRect &clip) |
set the current clip | |
CRect & | getClipRect (CRect &clip) const |
get the current clip | |
void | resetClipRect () |
reset the clip to the default state | |
Color | |
| |
void | setFillColor (const CColor color) |
set current fill color | |
CColor | getFillColor () const |
get current fill color | |
void | setFrameColor (const CColor color) |
set current stroke color | |
CColor | getFrameColor () const |
get current stroke color | |
Font | |
| |
void | setFontColor (const CColor color) |
set current font color | |
CColor | getFontColor () const |
get current font color | |
void | setFont (const CFontRef font, const long &size=0, const long &style=-1) |
set current font | |
const CFontRef & | getFont () const |
get current font | |
long | getFontSize () const |
get current font size | |
Text | |
| |
CCoord | getStringWidth (const char *pStr) |
get the width of an ASCII encoded string | |
void | drawString (const char *pString, const CRect &rect, const short opaque=false, const CHoriTxtAlign hAlign=kCenterText) |
draw an ASCII encoded string | |
CCoord | getStringWidthUTF8 (const char *pStr) |
get the width of an UTF-8 encoded string | |
void | drawStringUTF8 (const char *pString, const CRect &rect, const CHoriTxtAlign hAlign=kCenterText, bool antialias=true) |
draw an UTF-8 encoded string | |
void | drawStringUTF8 (const char *string, const CPoint &_point, bool antialias=true) |
draw an UTF-8 encoded string | |
Reference Counting Methods | |
| |
virtual void | remember () |
increase refcount | |
long | getNbReference () const |
get refcount | |
Message Methods | |
| |
virtual CMessageResult | notify (CBaseObject *sender, const char *message) |
A drawing context encapsulates the drawing context of the underlying OS.
CDrawContext | ( | CFrame * | inFrame, | |
void * | inSystemContext, | |||
void * | inWindow = 0 | |||
) |
CDrawContext constructor.
inFrame | the parent CFrame | |
inSystemContext | the platform system context, can be NULL | |
inWindow | the platform window object |
~CDrawContext | ( | ) |
void drawArc | ( | const CRect & | rect, | |
const float | startAngle1, | |||
const float | endAngle2, | |||
const CDrawStyle | drawStyle = kDrawStroked | |||
) |
draw an arc, angles are in degree
void drawEllipse | ( | const CRect & | rect, | |
const CDrawStyle | drawStyle = kDrawStroked | |||
) |
draw an ellipse
void drawLines | ( | const CPoint * | points, | |
const long & | numberOfLines | |||
) |
draw multiple lines at once
void drawPolygon | ( | const CPoint * | pPoints, | |
long | numberOfPoints, | |||
const CDrawStyle | drawStyle = kDrawStroked , |
|||
bool | closePolygon = true | |||
) |
draw a polygon
void drawRect | ( | const CRect & | rect, | |
const CDrawStyle | drawStyle = kDrawStroked | |||
) |
draw a rect
void drawString | ( | const char * | pString, | |
const CRect & | rect, | |||
const short | opaque = false , |
|||
const CHoriTxtAlign | hAlign = kCenterText | |||
) |
draw an ASCII encoded string
void drawStringUTF8 | ( | const char * | string, | |
const CPoint & | _point, | |||
bool | antialias = true | |||
) |
draw an UTF-8 encoded string
void drawStringUTF8 | ( | const char * | pString, | |
const CRect & | rect, | |||
const CHoriTxtAlign | hAlign = kCenterText , |
|||
bool | antialias = true | |||
) |
draw an UTF-8 encoded string
void fillEllipse | ( | const CRect & | rect | ) |
void fillPolygon | ( | const CPoint * | pPoint, | |
long | numberOfPoints | |||
) |
void fillRect | ( | const CRect & | rect | ) |
void floodFill | ( | const CPoint & | start | ) |
void forget | ( | ) | [virtual] |
decrease refcount and delete object if refcount == 0
Reimplemented from CBaseObject.
CDrawMode getDrawMode | ( | ) | const [inline] |
get the current draw mode, see CDrawMode
CColor getFillColor | ( | ) | const [inline] |
get current fill color
const CFontRef& getFont | ( | ) | const [inline] |
get current font
CColor getFontColor | ( | ) | const [inline] |
get current font color
long getFontSize | ( | ) | const [inline] |
get current font size
CFrame* getFrame | ( | ) | const [inline] |
CColor getFrameColor | ( | ) | const [inline] |
get current stroke color
CLineStyle getLineStyle | ( | ) | const [inline] |
get the current line style
CCoord getLineWidth | ( | ) | const [inline] |
get the current line width
void getLoc | ( | CPoint & | where | ) | const [inline] |
long getMouseButtons | ( | ) |
void getMouseLocation | ( | CPoint & | point | ) |
long getNbReference | ( | ) | const [inline, inherited] |
get refcount
CCoord getStringWidth | ( | const char * | pStr | ) |
get the width of an ASCII encoded string
CCoord getStringWidthUTF8 | ( | const char * | pStr | ) |
get the width of an UTF-8 encoded string
void* getSystemContext | ( | ) | const [inline] |
void* getWindow | ( | ) | [inline] |
void lineTo | ( | const CPoint & | point | ) |
draw a line from current position to point
void moveTo | ( | const CPoint & | point | ) |
move line position to point
virtual CMessageResult notify | ( | CBaseObject * | sender, | |
const char * | message | |||
) | [inline, virtual, inherited] |
void polyLine | ( | const CPoint * | pPoint, | |
long | numberOfPoints | |||
) |
virtual void remember | ( | ) | [inline, virtual, inherited] |
increase refcount
void resetClipRect | ( | ) |
reset the clip to the default state
void setClipRect | ( | const CRect & | clip | ) |
set the current clip
void setDrawMode | ( | CDrawMode | mode | ) |
set the current draw mode, see CDrawMode
void setFillColor | ( | const CColor | color | ) |
set current fill color
void setFont | ( | const CFontRef | font, | |
const long & | size = 0 , |
|||
const long & | style = -1 | |||
) |
set current font
void setFontColor | ( | const CColor | color | ) |
set current font color
void setFrameColor | ( | const CColor | color | ) |
set current stroke color
void setLineStyle | ( | CLineStyle | style | ) |
set the current line style
void setLineWidth | ( | CCoord | width | ) |
set the current line width
void setWindow | ( | void * | ptr | ) | [inline] |
bool waitDoubleClick | ( | ) |
bool waitDrag | ( | ) |
CColor frameColor [protected] |
CCoord frameWidth [protected] |
CLineStyle lineStyle [protected] |
void* pSystemContext [protected] |
void* pWindow [protected] |