Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXDC Class Reference

Abstract Device Context. More...

#include <FXDC.h>

Inheritance diagram for FX::FXDC:
FX::FXDCPrint FX::FXDCWindow

Public Member Functions

 FXDC (FXApp *a)
 Construct dummy DC.
 
FXAppgetApp () const
 Get application.
 
void * context () const
 Get context handle.
 
virtual FXColor readPixel (FXint x, FXint y)
 Read back pixel.
 
virtual void drawPoint (FXint x, FXint y)
 Draw points.
 
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)
 Draw lines.
 
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)
 Draw rectangles.
 
virtual void drawRectangles (const FXRectangle *rectangles, FXuint nrectangles)
 
virtual void drawRoundRectangle (FXint x, FXint y, FXint w, FXint h, FXint ew, FXint eh)
 Draw rounded rectangle with ellipse with ew and ellips height eh.
 
virtual void drawArc (FXint x, FXint y, FXint w, FXint h, FXint ang1, FXint ang2)
 Draw arcs. More...
 
virtual void drawArcs (const FXArc *arcs, FXuint narcs)
 
virtual void drawEllipse (FXint x, FXint y, FXint w, FXint h)
 Draw ellipse.
 
virtual void fillRectangle (FXint x, FXint y, FXint w, FXint h)
 Filled rectangles.
 
virtual void fillRectangles (const FXRectangle *rectangles, FXuint nrectangles)
 
virtual void fillRoundRectangle (FXint x, FXint y, FXint w, FXint h, FXint ew, FXint eh)
 Filled rounded rectangle with ellipse with ew and ellips height eh.
 
virtual void fillChord (FXint x, FXint y, FXint w, FXint h, FXint ang1, FXint ang2)
 Fill chord.
 
virtual void fillChords (const FXArc *chords, FXuint nchords)
 
virtual void fillArc (FXint x, FXint y, FXint w, FXint h, FXint ang1, FXint ang2)
 Fill arcs.
 
virtual void fillArcs (const FXArc *arcs, FXuint narcs)
 
virtual void fillEllipse (FXint x, FXint y, FXint w, FXint h)
 Fill ellipse.
 
virtual void fillPolygon (const FXPoint *points, FXuint npoints)
 Filled polygon.
 
virtual void fillConcavePolygon (const FXPoint *points, FXuint npoints)
 
virtual void fillComplexPolygon (const FXPoint *points, FXuint npoints)
 
virtual void fillPolygonRel (const FXPoint *points, FXuint npoints)
 Filled polygon with relative points.
 
virtual void fillConcavePolygonRel (const FXPoint *points, FXuint npoints)
 
virtual void fillComplexPolygonRel (const FXPoint *points, FXuint npoints)
 
virtual void fillVerticalGradient (FXint x, FXint y, FXint w, FXint h, FXColor top, FXColor bottom)
 Fill vertical gradient rectangle.
 
virtual void fillHorizontalGradient (FXint x, FXint y, FXint w, FXint h, FXColor left, FXColor right)
 Fill horizontal gradient rectangle.
 
virtual void drawHashBox (FXint x, FXint y, FXint w, FXint h, FXint b=1)
 Draw hashed box.
 
virtual void drawFocusRectangle (FXint x, FXint y, FXint w, FXint h)
 Draw focus rectangle.
 
virtual void drawArea (const FXDrawable *source, FXint sx, FXint sy, FXint sw, FXint sh, FXint dx, FXint dy)
 Draw area from source.
 
virtual void drawArea (const FXDrawable *source, FXint sx, FXint sy, FXint sw, FXint sh, FXint dx, FXint dy, FXint dw, FXint dh)
 Draw area stretched area from source.
 
virtual void drawImage (const FXImage *image, FXint dx, FXint dy)
 Draw image.
 
virtual void drawBitmap (const FXBitmap *bitmap, FXint dx, FXint dy)
 Draw bitmap.
 
virtual void drawIcon (const FXIcon *icon, FXint dx, FXint dy)
 Draw icon.
 
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)
 Draw string with base line starting at x, y.
 
virtual void drawText (FXint x, FXint y, const FXchar *string, FXuint length)
 
virtual void drawImageText (FXint x, FXint y, const FXString &string)
 Draw text starting at x, y over filled background.
 
virtual void drawImageText (FXint x, FXint y, const FXchar *string, FXuint length)
 
virtual void setForeground (FXColor clr)
 Set foreground drawing color.
 
FXColor getForeground () const
 Get foreground drawing color.
 
virtual void setBackground (FXColor clr)
 Set background drawing color.
 
FXColor getBackground () const
 Get background drawing color.
 
virtual void setDashes (FXuint dashoffset, const FXuchar *dashpattern, FXuint dashlength)
 Set dash pattern and dash offset. More...
 
const FXuchar * getDashPattern () const
 Get dash pattern.
 
FXuint getDashOffset () const
 Get dash offset.
 
FXuint getDashLength () const
 Get dash length.
 
virtual void setLineWidth (FXuint linewidth=0)
 Set line width:- 0 means thinnest/fastest possible.
 
FXuint getLineWidth () const
 Get line width.
 
virtual void setLineCap (FXCapStyle capstyle=CAP_BUTT)
 Set line cap style.
 
FXCapStyle getLineCap () const
 Get line cap style.
 
virtual void setLineJoin (FXJoinStyle joinstyle=JOIN_MITER)
 Set line join style.
 
FXJoinStyle getLineJoin () const
 Get line join style.
 
virtual void setLineStyle (FXLineStyle linestyle=LINE_SOLID)
 Set line style.
 
FXLineStyle getLineStyle () const
 Get line style.
 
virtual void setFillStyle (FXFillStyle fillstyle=FILL_SOLID)
 Set fill style.
 
FXFillStyle getFillStyle () const
 Get fill style.
 
virtual void setFillRule (FXFillRule fillrule=RULE_EVEN_ODD)
 Set fill rule.
 
FXFillRule getFillRule () const
 Get fill rule.
 
virtual void setFunction (FXFunction func=BLT_SRC)
 Set rasterop function.
 
FXFunction getFunction () const
 Get rasterop function.
 
virtual void setTile (FXImage *image, FXint dx=0, FXint dy=0)
 Set the tile image.
 
FXImagegetTile () const
 Get the tile image.
 
virtual void setStipple (FXBitmap *bitmap, FXint dx=0, FXint dy=0)
 Set the stipple pattern.
 
FXBitmapgetStippleBitmap () const
 Get stipple bitmap.
 
virtual void setStipple (FXStipplePattern pat, FXint dx=0, FXint dy=0)
 Set the stipple pattern.
 
FXStipplePattern getStipplePattern () const
 Get pattern.
 
virtual void setClipRegion (const FXRegion &region)
 Set clip region.
 
virtual void setClipRectangle (FXint x, FXint y, FXint w, FXint h)
 Set clip rectangle.
 
virtual void setClipRectangle (const FXRectangle &rectangle)
 Change clip rectangle.
 
const FXRectanglegetClipRectangle () const
 Return clip rectangle.
 
FXint getClipX () const
 Return clip x.
 
FXint getClipY () const
 Return clip y.
 
FXint getClipWidth () const
 Return clip width.
 
FXint getClipHeight () const
 Return clip height.
 
virtual void clearClipRectangle ()
 Clear clipping.
 
virtual void setClipMask (FXBitmap *bitmap, FXint dx=0, FXint dy=0)
 Set clip mask.
 
virtual void clearClipMask ()
 Clear clip mask.
 
virtual void setFont (FXFont *fnt)
 Set font to draw text with.
 
FXFontgetFont () const
 Get text font.
 
virtual void clipChildren (FXbool yes)
 Clip against child windows.
 
virtual ~FXDC ()
 Destructor.
 

Protected Attributes

void * ctx
 
FXFontfont
 
FXStipplePattern pattern
 
FXBitmapstipple
 
FXImagetile
 
FXBitmapmask
 
FXRectangle clip
 
FXColor fg
 
FXColor bg
 
FXuint width
 
FXCapStyle cap
 
FXJoinStyle join
 
FXLineStyle style
 
FXFillStyle fill
 
FXFillRule rule
 
FXFunction rop
 
FXuchar dashpat [32]
 
FXuint dashlen
 
FXuint dashoff
 
FXint tx
 
FXint ty
 
FXint cx
 
FXint cy
 

Friends

class FXFont
 

Detailed Description

Abstract Device Context.

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.

Member Function Documentation

◆ drawArc()

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.

◆ setDashes()

virtual void FX::FXDC::setDashes ( FXuint  dashoffset,
const FXuchar *  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.


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

Copyright © 1997-2022 Jeroen van der Zijp