#include <FXDC.h>
A Device Context is used to maintain the state of the graphics drawing system. Defining your drawing code in terms of the Abstract Device Context allows the drawing commands to be rendered on different types of surfaces, such as windows and images (FXDCWindow), or on paper (FXDCPrint). WYSYWYG may be obtained by using the same identical drawing code in your application regardless of the actual device surface being utilized.
Public Member Functions | |
FXDC (FXApp *a) | |
FXApp * | getApp () const |
void * | context () const |
virtual FXColor | readPixel (FXint x, FXint y) |
virtual void | drawPoint (FXint x, FXint y) |
virtual void | drawPoints (const FXPoint *points, FXuint npoints) |
virtual void | drawPointsRel (const FXPoint *points, FXuint npoints) |
virtual void | drawLine (FXint x1, FXint y1, FXint x2, FXint y2) |
virtual void | drawLines (const FXPoint *points, FXuint npoints) |
virtual void | drawLinesRel (const FXPoint *points, FXuint npoints) |
virtual void | drawLineSegments (const FXSegment *segments, FXuint nsegments) |
virtual void | drawRectangle (FXint x, FXint y, FXint w, FXint h) |
virtual void | drawRectangles (const FXRectangle *rectangles, FXuint nrectangles) |
virtual void | drawRoundRectangle (FXint x, FXint y, FXint w, FXint h, FXint ew, FXint eh) |
virtual void | drawArc (FXint x, FXint y, FXint w, FXint h, FXint ang1, FXint ang2) |
virtual void | drawArcs (const FXArc *arcs, FXuint narcs) |
virtual void | drawEllipse (FXint x, FXint y, FXint w, FXint h) |
virtual void | fillRectangle (FXint x, FXint y, FXint w, FXint h) |
virtual void | fillRectangles (const FXRectangle *rectangles, FXuint nrectangles) |
virtual void | fillRoundRectangle (FXint x, FXint y, FXint w, FXint h, FXint ew, FXint eh) |
virtual void | fillChord (FXint x, FXint y, FXint w, FXint h, FXint ang1, FXint ang2) |
virtual void | fillChords (const FXArc *chords, FXuint nchords) |
virtual void | fillArc (FXint x, FXint y, FXint w, FXint h, FXint ang1, FXint ang2) |
virtual void | fillArcs (const FXArc *arcs, FXuint narcs) |
virtual void | fillEllipse (FXint x, FXint y, FXint w, FXint h) |
virtual void | fillPolygon (const FXPoint *points, FXuint npoints) |
virtual void | fillConcavePolygon (const FXPoint *points, FXuint npoints) |
virtual void | fillComplexPolygon (const FXPoint *points, FXuint npoints) |
virtual void | fillPolygonRel (const FXPoint *points, FXuint npoints) |
virtual void | fillConcavePolygonRel (const FXPoint *points, FXuint npoints) |
virtual void | fillComplexPolygonRel (const FXPoint *points, FXuint npoints) |
virtual void | drawHashBox (FXint x, FXint y, FXint w, FXint h, FXint b=1) |
virtual void | drawFocusRectangle (FXint x, FXint y, FXint w, FXint h) |
virtual void | drawArea (const FXDrawable *source, FXint sx, FXint sy, FXint sw, FXint sh, FXint dx, FXint dy) |
virtual void | drawArea (const FXDrawable *source, FXint sx, FXint sy, FXint sw, FXint sh, FXint dx, FXint dy, FXint dw, FXint dh) |
virtual void | drawImage (const FXImage *image, FXint dx, FXint dy) |
virtual void | drawBitmap (const FXBitmap *bitmap, FXint dx, FXint dy) |
virtual void | drawIcon (const FXIcon *icon, FXint dx, FXint dy) |
virtual void | drawIconShaded (const FXIcon *icon, FXint dx, FXint dy) |
virtual void | drawIconSunken (const FXIcon *icon, FXint dx, FXint dy) |
virtual void | drawText (FXint x, FXint y, const FXString &string) |
virtual void | drawText (FXint x, FXint y, const FXchar *string, FXuint length) |
virtual void | drawImageText (FXint x, FXint y, const FXString &string) |
virtual void | drawImageText (FXint x, FXint y, const FXchar *string, FXuint length) |
virtual void | setForeground (FXColor clr) |
FXColor | getForeground () const |
virtual void | setBackground (FXColor clr) |
FXColor | getBackground () const |
virtual void | setDashes (FXuint dashoffset, const FXchar *dashpattern, FXuint dashlength) |
const FXchar * | getDashPattern () const |
FXuint | getDashOffset () const |
FXuint | getDashLength () const |
virtual void | setLineWidth (FXuint linewidth=0) |
FXuint | getLineWidth () const |
virtual void | setLineCap (FXCapStyle capstyle=CAP_BUTT) |
FXCapStyle | getLineCap () const |
virtual void | setLineJoin (FXJoinStyle joinstyle=JOIN_MITER) |
FXJoinStyle | getLineJoin () const |
virtual void | setLineStyle (FXLineStyle linestyle=LINE_SOLID) |
FXLineStyle | getLineStyle () const |
virtual void | setFillStyle (FXFillStyle fillstyle=FILL_SOLID) |
FXFillStyle | getFillStyle () const |
virtual void | setFillRule (FXFillRule fillrule=RULE_EVEN_ODD) |
FXFillRule | getFillRule () const |
virtual void | setFunction (FXFunction func=BLT_SRC) |
FXFunction | getFunction () const |
virtual void | setTile (FXImage *image, FXint dx=0, FXint dy=0) |
FXImage * | getTile () const |
virtual void | setStipple (FXBitmap *bitmap, FXint dx=0, FXint dy=0) |
FXBitmap * | getStippleBitmap () const |
virtual void | setStipple (FXStipplePattern pat, FXint dx=0, FXint dy=0) |
FXStipplePattern | getStipplePattern () const |
virtual void | setClipRegion (const FXRegion ®ion) |
virtual void | setClipRectangle (FXint x, FXint y, FXint w, FXint h) |
virtual void | setClipRectangle (const FXRectangle &rectangle) |
const FXRectangle & | getClipRectangle () const |
FXint | getClipX () const |
FXint | getClipY () const |
FXint | getClipWidth () const |
FXint | getClipHeight () const |
virtual void | clearClipRectangle () |
virtual void | setClipMask (FXBitmap *bitmap, FXint dx=0, FXint dy=0) |
virtual void | clearClipMask () |
virtual void | setFont (FXFont *fnt) |
FXFont * | getFont () const |
virtual void | clipChildren (FXbool yes) |
virtual | ~FXDC () |
Protected Attributes | |
void * | ctx |
FXFont * | font |
FXStipplePattern | pattern |
FXBitmap * | stipple |
FXImage * | tile |
FXBitmap * | mask |
FXRectangle | clip |
FXColor | fg |
FXColor | bg |
FXuint | width |
FXCapStyle | cap |
FXJoinStyle | join |
FXLineStyle | style |
FXFillStyle | fill |
FXFillRule | rule |
FXFunction | rop |
FXchar | dashpat [32] |
FXuint | dashlen |
FXuint | dashoff |
FXint | tx |
FXint | ty |
FXint | cx |
FXint | cy |
Friends | |
class | FXFont |
FX::FXDC::FXDC | ( | FXApp * | a | ) |
Construct dummy DC.
virtual FX::FXDC::~FXDC | ( | ) | [virtual] |
Destructor.
FXApp* FX::FXDC::getApp | ( | ) | const [inline] |
Get application.
void* FX::FXDC::context | ( | ) | const [inline] |
Get context handle.
virtual FXColor FX::FXDC::readPixel | ( | FXint | x, | |
FXint | y | |||
) | [virtual] |
virtual void FX::FXDC::drawPoint | ( | FXint | x, | |
FXint | y | |||
) | [virtual] |
virtual void FX::FXDC::drawLine | ( | FXint | x1, | |
FXint | y1, | |||
FXint | x2, | |||
FXint | y2 | |||
) | [virtual] |
virtual void FX::FXDC::drawRectangle | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h | |||
) | [virtual] |
virtual void FX::FXDC::drawRoundRectangle | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h, | |||
FXint | ew, | |||
FXint | eh | |||
) | [virtual] |
Draw rounded rectangle with ellipse with ew and ellips height eh.
Reimplemented in FX::FXDCPrint, and FX::FXDCWindow.
virtual void FX::FXDC::drawArc | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h, | |||
FXint | ang1, | |||
FXint | ang2 | |||
) | [virtual] |
Draw arcs. The argument ang1 specifies the start of the arc relative to the three-o'clock position from the center, in units of degrees*64. The argument ang2 specifies the path and extent of the arc relative to the start of the arc, in units of degrees*64. The arguments x,y,w,h specify the bounding rectangle.
Reimplemented in FX::FXDCPrint, and FX::FXDCWindow.
virtual void FX::FXDC::drawEllipse | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h | |||
) | [virtual] |
virtual void FX::FXDC::fillRectangle | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h | |||
) | [virtual] |
virtual void FX::FXDC::fillRoundRectangle | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h, | |||
FXint | ew, | |||
FXint | eh | |||
) | [virtual] |
Filled rounded rectangle with ellipse with ew and ellips height eh.
Reimplemented in FX::FXDCPrint, and FX::FXDCWindow.
virtual void FX::FXDC::fillChord | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h, | |||
FXint | ang1, | |||
FXint | ang2 | |||
) | [virtual] |
virtual void FX::FXDC::fillArc | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h, | |||
FXint | ang1, | |||
FXint | ang2 | |||
) | [virtual] |
virtual void FX::FXDC::fillEllipse | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h | |||
) | [virtual] |
virtual void FX::FXDC::fillPolygon | ( | const FXPoint * | points, | |
FXuint | npoints | |||
) | [virtual] |
virtual void FX::FXDC::fillPolygonRel | ( | const FXPoint * | points, | |
FXuint | npoints | |||
) | [virtual] |
virtual void FX::FXDC::drawHashBox | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h, | |||
FXint | b = 1 | |||
) | [virtual] |
virtual void FX::FXDC::drawFocusRectangle | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h | |||
) | [virtual] |
virtual void FX::FXDC::drawArea | ( | const FXDrawable * | source, | |
FXint | sx, | |||
FXint | sy, | |||
FXint | sw, | |||
FXint | sh, | |||
FXint | dx, | |||
FXint | dy | |||
) | [virtual] |
virtual void FX::FXDC::drawArea | ( | const FXDrawable * | source, | |
FXint | sx, | |||
FXint | sy, | |||
FXint | sw, | |||
FXint | sh, | |||
FXint | dx, | |||
FXint | dy, | |||
FXint | dw, | |||
FXint | dh | |||
) | [virtual] |
virtual void FX::FXDC::drawImage | ( | const FXImage * | image, | |
FXint | dx, | |||
FXint | dy | |||
) | [virtual] |
virtual void FX::FXDC::drawBitmap | ( | const FXBitmap * | bitmap, | |
FXint | dx, | |||
FXint | dy | |||
) | [virtual] |
virtual void FX::FXDC::drawIcon | ( | const FXIcon * | icon, | |
FXint | dx, | |||
FXint | dy | |||
) | [virtual] |
virtual void FX::FXDC::drawText | ( | FXint | x, | |
FXint | y, | |||
const FXString & | string | |||
) | [virtual] |
virtual void FX::FXDC::drawImageText | ( | FXint | x, | |
FXint | y, | |||
const FXString & | string | |||
) | [virtual] |
Draw text starting at x, y over filled background.
Reimplemented in FX::FXDCPrint, and FX::FXDCWindow.
virtual void FX::FXDC::setForeground | ( | FXColor | clr | ) | [virtual] |
FXColor FX::FXDC::getForeground | ( | ) | const [inline] |
Get foreground drawing color.
virtual void FX::FXDC::setBackground | ( | FXColor | clr | ) | [virtual] |
FXColor FX::FXDC::getBackground | ( | ) | const [inline] |
Get background drawing color.
virtual void FX::FXDC::setDashes | ( | FXuint | dashoffset, | |
const FXchar * | dashpattern, | |||
FXuint | dashlength | |||
) | [virtual] |
Set dash pattern and dash offset. A dash pattern of [1 2 3 4] is a repeating pattern of 1 foreground pixel, 2 background pixels, 3 foreground pixels, and 4 background pixels. The offset is where in the pattern the system will start counting. The maximum length of the dash pattern is 32.
Reimplemented in FX::FXDCPrint, and FX::FXDCWindow.
const FXchar* FX::FXDC::getDashPattern | ( | ) | const [inline] |
Get dash pattern.
FXuint FX::FXDC::getDashOffset | ( | ) | const [inline] |
Get dash offset.
FXuint FX::FXDC::getDashLength | ( | ) | const [inline] |
Get dash length.
virtual void FX::FXDC::setLineWidth | ( | FXuint | linewidth = 0 |
) | [virtual] |
Set line width:- 0 means thinnest/fastest possible.
Reimplemented in FX::FXDCPrint, and FX::FXDCWindow.
FXuint FX::FXDC::getLineWidth | ( | ) | const [inline] |
Get line width.
virtual void FX::FXDC::setLineCap | ( | FXCapStyle | capstyle = CAP_BUTT |
) | [virtual] |
FXCapStyle FX::FXDC::getLineCap | ( | ) | const [inline] |
Get line cap style.
virtual void FX::FXDC::setLineJoin | ( | FXJoinStyle | joinstyle = JOIN_MITER |
) | [virtual] |
FXJoinStyle FX::FXDC::getLineJoin | ( | ) | const [inline] |
Get line join style.
virtual void FX::FXDC::setLineStyle | ( | FXLineStyle | linestyle = LINE_SOLID |
) | [virtual] |
FXLineStyle FX::FXDC::getLineStyle | ( | ) | const [inline] |
Get line style.
virtual void FX::FXDC::setFillStyle | ( | FXFillStyle | fillstyle = FILL_SOLID |
) | [virtual] |
FXFillStyle FX::FXDC::getFillStyle | ( | ) | const [inline] |
Get fill style.
virtual void FX::FXDC::setFillRule | ( | FXFillRule | fillrule = RULE_EVEN_ODD |
) | [virtual] |
FXFillRule FX::FXDC::getFillRule | ( | ) | const [inline] |
Get fill rule.
virtual void FX::FXDC::setFunction | ( | FXFunction | func = BLT_SRC |
) | [virtual] |
FXFunction FX::FXDC::getFunction | ( | ) | const [inline] |
Get rasterop function.
virtual void FX::FXDC::setTile | ( | FXImage * | image, | |
FXint | dx = 0 , |
|||
FXint | dy = 0 | |||
) | [virtual] |
FXImage* FX::FXDC::getTile | ( | ) | const [inline] |
Get the tile image.
virtual void FX::FXDC::setStipple | ( | FXBitmap * | bitmap, | |
FXint | dx = 0 , |
|||
FXint | dy = 0 | |||
) | [virtual] |
FXBitmap* FX::FXDC::getStippleBitmap | ( | ) | const [inline] |
Get stipple bitmap.
virtual void FX::FXDC::setStipple | ( | FXStipplePattern | pat, | |
FXint | dx = 0 , |
|||
FXint | dy = 0 | |||
) | [virtual] |
FXStipplePattern FX::FXDC::getStipplePattern | ( | ) | const [inline] |
Get pattern.
virtual void FX::FXDC::setClipRegion | ( | const FXRegion & | region | ) | [virtual] |
virtual void FX::FXDC::setClipRectangle | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h | |||
) | [virtual] |
virtual void FX::FXDC::setClipRectangle | ( | const FXRectangle & | rectangle | ) | [virtual] |
const FXRectangle& FX::FXDC::getClipRectangle | ( | ) | const [inline] |
Return clip rectangle.
FXint FX::FXDC::getClipX | ( | ) | const [inline] |
Return clip x.
FXint FX::FXDC::getClipY | ( | ) | const [inline] |
Return clip y.
FXint FX::FXDC::getClipWidth | ( | ) | const [inline] |
Return clip width.
FXint FX::FXDC::getClipHeight | ( | ) | const [inline] |
Return clip height.
virtual void FX::FXDC::clearClipRectangle | ( | ) | [virtual] |
virtual void FX::FXDC::setClipMask | ( | FXBitmap * | bitmap, | |
FXint | dx = 0 , |
|||
FXint | dy = 0 | |||
) | [virtual] |
virtual void FX::FXDC::clearClipMask | ( | ) | [virtual] |
virtual void FX::FXDC::setFont | ( | FXFont * | fnt | ) | [virtual] |
FXFont* FX::FXDC::getFont | ( | ) | const [inline] |
Get text font.
virtual void FX::FXDC::clipChildren | ( | FXbool | yes | ) | [virtual] |