31059016e90d9d6d65e11f55808869efacb8d4e2 kate Tue Apr 10 18:16:17 2018 -0700 Add postscript for ellipse drawing. refs #21109 diff --git src/inc/vGfx.h src/inc/vGfx.h index 63dd864..5de64cf 100644 --- src/inc/vGfx.h +++ src/inc/vGfx.h @@ -68,30 +68,36 @@ int xOff, int yOff, int width, int height, Color *dots, boolean zeroClear); /* Put a series of one 'pixel' width vertical lines. */ void (*fillUnder)(void *v, int x1, int y1, int x2, int y2, int bottom, Color color); /* Draw a 4 sided filled figure that has line x1/y1 to x2/y2 at * it's top, a horizontal line at bottom at it's bottom, and * vertical lines from the bottom to y1 on the left and bottom to * y2 on the right. */ void (*drawPoly)(void *v, struct gfxPoly *poly, Color color, boolean filled); /* Draw polygon, possibly filled in color. */ + void (*ellipse)(void *v, int x1, int y1, int x2, int y2, Color color, + int mode, boolean isDashed); + /* Draw an ellipse or half-ellipse (top or bottom), + * specified by left-most and top-most points on a rectangle. + * Optionally draw with dashed line. */ + void (*setHint)(void *v, char *hint, char *value); /* Set hint */ char * (*getHint)(void *v, char *hint); /* Get hint */ int (*getFontPixelHeight)(void *v, void *font); /* How high in pixels is font? */ int (*getFontStringWidth)(void *v, void *font, char *string); /* How wide is a string? */ }; struct vGfx *vgOpenPng(int width, int height, char *fileName, boolean useTransparency); /* Open up something that will write out a PNG file upon vgClose. @@ -155,30 +161,36 @@ #define vgVerticalSmear(v,x,y,w,h,dots,zeroClear) \ v->verticalSmear(v->data,x,y,w,h,dots,zeroClear) /* Take array of dots and smear them vertically. */ #define vgFillUnder(v,x1,y1,x2,y2,bottom,color) \ v->fillUnder(v->data,x1,y1,x2,y2,bottom,color) /* Draw a 4 sided filled figure that has line x1/y1 to x2/y2 at * it's top, a horizontal line at bottom at it's bottom, and * vertical lines from the bottom to y1 on the left and bottom to * y2 on the right. */ #define vgDrawPoly(v,poly,color,filled) \ v->drawPoly(v->data,poly,color,filled) /* Draw a polygon in color, optionally filled. */ +#define vgEllipse(v,x1,x2,y1,y2,color,mode,isDashed) \ + v->ellipse(v->data,x1,x2,y1,y2,color,mode,isDashed) + /* Draw an ellipse or half-ellipse (top or bottom), + * specified by left-most and top-most points on a rectangle. + * Optionally draw with dashed line */ + #define vgSetHint(v,hint,value) \ v->setHint(v->data,hint,value) /* Set hint */ #define vgGetHint(v,hint) \ v->getHint(v->data,hint) /* Get hint */ #define vgGetFontPixelHeight(v,font) \ v->getFontPixelHeight(v->data,font) /* How high in pixels is font? */ #define vgGetFontStringWidth(v,font,string) \ v->getFontStringWidth(v->data,font,string) /* How wide is a string? */