COffscreenContext Class Reference

A drawing device which uses a pixmap as its drawing surface. More...

#include <vstgui.h>

List of all members.

Public Member Functions

virtual ~COffscreenContext ()
void * getWindow ()
void setWindow (void *ptr)
void getLoc (CPoint &where) const
CFramegetFrame () const
void * getSystemContext () const
void forget ()
 decrease refcount and delete object if refcount == 0
 VSTGUI_DEPRECATED (CColor getPoint(const CPoint &point);) VSTGUI_DEPRECATED(void floodFill(const CPoint &start)
 VSTGUI_DEPRECATED (void drawArc(const CRect &rect, const CPoint &point1, const CPoint &point2);) VSTGUI_DEPRECATED(void fillArc(const CRect &rect
 <
 VSTGUI_DEPRECATED (void polyLine(const CPoint *pPoint, long numberOfPoints);) VSTGUI_DEPRECATED(void fillPolygon(const CPoint *pPoint
 <
 VSTGUI_DEPRECATED (void fillRect(const CRect &rect);) VSTGUI_DEPRECATED(void fillEllipse(const CRect &rect)
 <
 VSTGUI_DEPRECATED (long getMouseButtons();) VSTGUI_DEPRECATED(void getMouseLocation(CPoint &point)
 <
 VSTGUI_DEPRECATED (bool waitDoubleClick();) VSTGUI_DEPRECATED(bool waitDrag()
 <

Public Attributes

CPoint offsetScreen
CPoint offset
const CPointpoint1
const CPoint const CPointpoint2
long numberOfPoints

Protected Attributes

CBitmappBitmap
CBitmappBitmapBg
CCoord height
CCoord width
bool bDestroyPixmap
bool bDrawInBitmap
CColor backgroundColor
void * pSystemContext
void * pWindow
CFramepFrame
CFontRef font
CColor fontColor
CPoint penLoc
CCoord frameWidth
CColor frameColor
CColor fillColor
CLineStyle lineStyle
CDrawMode drawMode
CRect clipRect

Constructors



 COffscreenContext (CDrawContext *pContext, CBitmap *pBitmap, bool drawInBitmap=false)
 COffscreenContext (CFrame *pFrame, long width, long height, const CColor backgroundColor=kBlackCColor)

COffscreenContext Methods



void copyFrom (CDrawContext *pContext, CRect destRect, CPoint srcOffset=CPoint(0, 0))
 copy from offscreen to pContext
void copyTo (CDrawContext *pContext, CRect &srcRect, CPoint destOffset=CPoint(0, 0))
 copy to offscreen from pContext
CCoord getWidth () const
CCoord getHeight () const

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
CRectgetClipRect (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 CFontRefgetFont () 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)

Detailed Description

A drawing device which uses a pixmap as its drawing surface.


Constructor & Destructor Documentation

COffscreenContext ( CDrawContext pContext,
CBitmap pBitmap,
bool  drawInBitmap = false 
)
COffscreenContext ( CFrame pFrame,
long  width,
long  height,
const CColor  backgroundColor = kBlackCColor 
)
~COffscreenContext (  )  [virtual]

Member Function Documentation

void copyFrom ( CDrawContext pContext,
CRect  destRect,
CPoint  srcOffset = CPoint (0, 0) 
)

copy from offscreen to pContext

void copyTo ( CDrawContext pContext,
CRect srcRect,
CPoint  destOffset = CPoint (0, 0) 
)

copy to offscreen from pContext

CCoord getWidth (  )  const [inline]
CCoord getHeight (  )  const [inline]
void moveTo ( const CPoint point  )  [inherited]

move line position to point

void lineTo ( const CPoint point  )  [inherited]

draw a line from current position to point

void drawLines ( const CPoint points,
const long &  numberOfLines 
) [inherited]

draw multiple lines at once

void drawPolygon ( const CPoint pPoints,
long  numberOfPoints,
const CDrawStyle  drawStyle = kDrawStroked,
bool  closePolygon = true 
) [inherited]

draw a polygon

void drawRect ( const CRect rect,
const CDrawStyle  drawStyle = kDrawStroked 
) [inherited]

draw a rect

void drawArc ( const CRect rect,
const float  startAngle1,
const float  endAngle2,
const CDrawStyle  drawStyle = kDrawStroked 
) [inherited]

draw an arc, angles are in degree

void drawEllipse ( const CRect rect,
const CDrawStyle  drawStyle = kDrawStroked 
) [inherited]

draw an ellipse

void drawPoint ( const CPoint point,
CColor  color 
) [inherited]

draw a point

void setLineStyle ( CLineStyle  style  )  [inherited]

set the current line style

CLineStyle getLineStyle (  )  const [inline, inherited]

get the current line style

void setLineWidth ( CCoord  width  )  [inherited]

set the current line width

CCoord getLineWidth (  )  const [inline, inherited]

get the current line width

void setDrawMode ( CDrawMode  mode  )  [inherited]

set the current draw mode, see CDrawMode

CDrawMode getDrawMode (  )  const [inline, inherited]

get the current draw mode, see CDrawMode

void setClipRect ( const CRect clip  )  [inherited]

set the current clip

CRect& getClipRect ( CRect clip  )  const [inline, inherited]

get the current clip

void resetClipRect (  )  [inherited]

reset the clip to the default state

void setFillColor ( const CColor  color  )  [inherited]

set current fill color

CColor getFillColor (  )  const [inline, inherited]

get current fill color

void setFrameColor ( const CColor  color  )  [inherited]

set current stroke color

CColor getFrameColor (  )  const [inline, inherited]

get current stroke color

void setFontColor ( const CColor  color  )  [inherited]

set current font color

CColor getFontColor (  )  const [inline, inherited]

get current font color

void setFont ( const CFontRef  font,
const long &  size = 0,
const long &  style = -1 
) [inherited]

set current font

const CFontRef& getFont (  )  const [inline, inherited]

get current font

long getFontSize (  )  const [inline, inherited]

get current font size

CCoord getStringWidth ( const char *  pStr  )  [inherited]

get the width of an ASCII encoded string

void drawString ( const char *  pString,
const CRect rect,
const short  opaque = false,
const CHoriTxtAlign  hAlign = kCenterText 
) [inherited]

draw an ASCII encoded string

CCoord getStringWidthUTF8 ( const char *  pStr  )  [inherited]

get the width of an UTF-8 encoded string

void drawStringUTF8 ( const char *  pString,
const CRect rect,
const CHoriTxtAlign  hAlign = kCenterText,
bool  antialias = true 
) [inherited]

draw an UTF-8 encoded string

void drawStringUTF8 ( const char *  string,
const CPoint _point,
bool  antialias = true 
) [inherited]

draw an UTF-8 encoded string

void* getWindow (  )  [inline, inherited]
void setWindow ( void *  ptr  )  [inline, inherited]
void getLoc ( CPoint where  )  const [inline, inherited]
CFrame* getFrame (  )  const [inline, inherited]
void* getSystemContext (  )  const [inline, inherited]
void forget (  )  [virtual, inherited]

decrease refcount and delete object if refcount == 0

Reimplemented from CBaseObject.

VSTGUI_DEPRECATED ( CColor getPoint(const CPoint &point);   )  const [inherited]
VSTGUI_DEPRECATED ( void drawArc(const CRect &rect, const CPoint &point1, const CPoint &point2);   )  const [inherited]
VSTGUI_DEPRECATED ( void polyLine(const CPoint *pPoint, long numberOfPoints);   )  const [inherited]
VSTGUI_DEPRECATED ( void fillRect(const CRect &rect);   )  const [inherited]

<

Deprecated:
use VSTGUI::CDrawContext::drawPolygon with kDrawFilled as draw style
VSTGUI_DEPRECATED ( long getMouseButtons();   )  [inherited]

<

Deprecated:
use VSTGUI::CDrawContext::drawEllipse with kDrawFilled as draw style
VSTGUI_DEPRECATED ( bool waitDoubleClick();   )  [inherited]

<

Deprecated:
if you really need this call VSTGUI::CFrame::getCurrentMouseLocation
virtual void remember (  )  [inline, virtual, inherited]

increase refcount

long getNbReference (  )  const [inline, inherited]

get refcount

virtual CMessageResult notify ( CBaseObject sender,
const char *  message 
) [inline, virtual, inherited]

Member Data Documentation

CBitmap* pBitmap [protected]
CBitmap* pBitmapBg [protected]
CCoord height [protected]
CCoord width [protected]
bool bDestroyPixmap [protected]
bool bDrawInBitmap [protected]
CColor backgroundColor [protected]
CPoint offsetScreen [inherited]
CPoint offset [inherited]
const CPoint& point1 [inherited]
const CPoint const CPoint& point2 [inherited]
long numberOfPoints [inherited]
void* pSystemContext [protected, inherited]
void* pWindow [protected, inherited]
CFrame* pFrame [protected, inherited]
CFontRef font [protected, inherited]
CColor fontColor [protected, inherited]
CPoint penLoc [protected, inherited]
CCoord frameWidth [protected, inherited]
CColor frameColor [protected, inherited]
CColor fillColor [protected, inherited]
CLineStyle lineStyle [protected, inherited]
CDrawMode drawMode [protected, inherited]
CRect clipRect [protected, inherited]

The documentation for this class was generated from the following files:
Generated on Fri Apr 9 10:19:32 2010 for VSTGUI by  doxygen 1.6.3