diff options
Diffstat (limited to 'generic/Draw.h')
-rw-r--r-- | generic/Draw.h | 101 |
1 files changed, 48 insertions, 53 deletions
diff --git a/generic/Draw.h b/generic/Draw.h index 038b379..f0166ef 100644 --- a/generic/Draw.h +++ b/generic/Draw.h @@ -36,37 +36,28 @@ #include "Attrs.h" #include "Image.h" -#include <X11/Xlib.h> -#ifdef GLX -#include <GL/glx.h> -#endif - -#define LIGHTNING_POINTS 4 -#define CORNER_POINTS 3 -#define DOUBLE_CORNER_POINTS 4 -#define STRAIGHT_POINTS 2 -#define LINE_SHAPE_POINTS 4 /* Maximum of all above */ +#define ZN_LINE_SHAPE_POINTS 4 /* Maximum of all *_SHAPE_POINTS */ -struct _WidgetInfo; +struct _ZnWInfo; -#ifdef GLX -#define GLX_START_CLIP(num_clips, render) { \ +#ifdef GL +#define ZnGlStartClip(num_clips, render) { \ if (!num_clips) { \ glEnable(GL_STENCIL_TEST); \ } \ - glStencilFunc(GL_EQUAL, num_clips, 0xFF); \ + glStencilFunc(GL_EQUAL, (GLint) num_clips, 0xFF); \ glStencilOp(GL_KEEP, GL_INCR, GL_INCR); \ if (!render) { \ glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); \ } \ } -#define GLX_RENDER_CLIPPED() { \ +#define ZnGlRenderClipped() { \ glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); \ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); \ } -#define GLX_RESTORE_STENCIL(num_clips, render) { \ - glStencilFunc(GL_EQUAL, num_clips+1, 0xFF); \ +#define ZnGlRestoreStencil(num_clips, render) { \ + glStencilFunc(GL_EQUAL, (GLint) (num_clips+1), 0xFF); \ glStencilOp(GL_KEEP, GL_DECR, GL_DECR); \ if (render) { \ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); \ @@ -75,8 +66,8 @@ struct _WidgetInfo; glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); \ } \ } -#define GLX_END_CLIP(num_clips) { \ - glStencilFunc(GL_EQUAL, num_clips, 0xFF); \ +#define ZnGlEndClip(num_clips) { \ + glStencilFunc(GL_EQUAL, (GLint) num_clips, 0xFF); \ glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); \ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); \ if (!num_clips) { \ @@ -86,52 +77,56 @@ struct _WidgetInfo; #endif -void ZnSetLineStyle(struct _WidgetInfo *wi, LineStyle line_style); -void ZnGetLineShape(ZnPoint *p1, ZnPoint *p2, unsigned int line_width, - LineShape shape, ZnBBox *bbox, ZnList to_points); -void ZnDrawLineShape(struct _WidgetInfo *wi, ZnPoint *points, int num_points, - LineStyle line_style, ZnColor line_foreground, - unsigned int line_width, LineShape shape); -int ZnPolygonReliefInBBox(ZnPoint *points, int num_points, int line_width, - ZnBBox *bbox); -void ZnGetPolygonReliefBBox(ZnPoint *points, int num_points, int line_width, - ZnBBox *bbox); -double ZnPolygonReliefToPointDist(ZnPoint *points, int num_points, int line_width, - ZnPoint *pp); -void ZnDrawRectangleRelief(struct _WidgetInfo *wi, - ReliefStyle relief, ZnGradient *gradient, - XRectangle *bbox, unsigned int line_width); -void ZnDrawPolygonRelief(struct _WidgetInfo *wi, ReliefStyle relief, +void ZnSetLineStyle(struct _ZnWInfo *wi, ZnLineStyle line_style); +void ZnLineShapePoints(ZnPoint *p1, ZnPoint *p2, ZnDim line_width, + ZnLineShape shape, ZnBBox *bbox, ZnList to_points); +void ZnDrawLineShape(struct _ZnWInfo *wi, ZnPoint *points, unsigned int num_points, + ZnLineStyle line_style, XColor *line_foreground, + ZnDim line_width, ZnLineShape shape); +void +ZnGetLineEnd(ZnPoint *p1, ZnPoint *p2, ZnDim line_width, + int cap_style, ZnLineEnd end_style, ZnPoint *points); + +int ZnPolygonReliefInBBox(ZnPoint *points, unsigned int num_points, + ZnDim line_width, ZnBBox *bbox); +void ZnGetPolygonReliefBBox(ZnPoint *points, unsigned int num_points, + ZnDim line_width, ZnBBox *bbox); +double ZnPolygonReliefToPointDist(ZnPoint *points, unsigned int num_points, + ZnDim line_width, ZnPoint *pp); +void ZnDrawRectangleRelief(struct _ZnWInfo *wi, + ZnReliefStyle relief, ZnGradient *gradient, + XRectangle *bbox, ZnDim line_width); +void ZnDrawPolygonRelief(struct _ZnWInfo *wi, ZnReliefStyle relief, ZnGradient *gradient, ZnPoint *points, - int num_points, int line_width); -#ifdef GLX -void ZnRenderPolygonRelief(struct _WidgetInfo *wi, ReliefStyle relief, + unsigned int num_points, ZnDim line_width); +#ifdef GL +void ZnRenderPolygonRelief(struct _ZnWInfo *wi, ZnReliefStyle relief, ZnGradient *gradient, ZnBool smooth, - ZnPoint *points, int num_points, ZnReal line_width); -void ZnRenderPolyline(struct _WidgetInfo *wi, ZnPoint *points, int num_points, - ZnReal line_width, LineStyle line_style, int cap_style, + ZnPoint *points, unsigned int num_points, ZnDim line_width); +void ZnRenderPolyline(struct _ZnWInfo *wi, ZnPoint *points, unsigned int num_points, + ZnDim line_width, ZnLineStyle line_style, int cap_style, int join_style, ZnLineEnd first_end, ZnLineEnd last_end, ZnGradient *gradient); -void ZnComputeAxialGradient(struct _WidgetInfo *wi, ZnPoly *shape, int angle, +void ZnComputeAxialGradient(struct _ZnWInfo *wi, ZnPoly *shape, ZnReal angle, ZnPoint *grad_geo); -void ZnComputeRadialGradient(struct _WidgetInfo *wi, ZnPoly *shape, ZnBool oval, +void ZnComputeRadialGradient(struct _ZnWInfo *wi, ZnPoly *shape, ZnBool oval, ZnPoint *center, ZnPoint *grad_geo); -void ZnComputePathGradient(struct _WidgetInfo *wi, ZnPoly *shape, ZnPoint *center, +void ZnComputePathGradient(struct _ZnWInfo *wi, ZnPoly *shape, ZnPoint *center, ZnPoint *grad_geo); -void ZnRenderGradient(struct _WidgetInfo *wi, ZnGradient *gradient, - void cb(void *), void *closure, ZnPoint *quad, +void ZnRenderGradient(struct _ZnWInfo *wi, ZnGradient *gradient, + void (*cb)(void *), void *closure, ZnPoint *quad, ZnPoly *poly); -void ZnRenderTile(struct _WidgetInfo *wi, ZnImage tile, ZnGradient *gradient, - void cb(void *), void *closure, ZnPoint *quad); -void ZnRenderIcon(struct _WidgetInfo *wi, ZnImage image, ZnGradient *gradient, +void ZnRenderTile(struct _ZnWInfo *wi, ZnImage tile, ZnGradient *gradient, + void (*cb)(void *), void *closure, ZnPoint *quad); +void ZnRenderIcon(struct _ZnWInfo *wi, ZnImage image, ZnGradient *gradient, ZnPoint *origin, ZnBool modulate); -void ZnRenderImage(struct _WidgetInfo *wi, ZnImage image, ZnGradient *gradient, +void ZnRenderImage(struct _ZnWInfo *wi, ZnImage image, ZnGradient *gradient, ZnPoint *quad, ZnBool modulate); -void RenderHollowDot(struct _WidgetInfo *wi, ZnPoint *p, ZnReal size); +void RenderHollowDot(struct _ZnWInfo *wi, ZnPoint *p, ZnReal size); void ZnRenderGlyph(ZnTexFontInfo *tfi, int c); -void ZnRenderString(ZnTexFontInfo *tfi, unsigned char *str, int len); -void ZnRenderFancyString(ZnTexFontInfo *tfi, unsigned char *str, int len); +void ZnRenderString(ZnTexFontInfo *tfi, unsigned char *str, unsigned int len); +void ZnRenderFancyString(ZnTexFontInfo *tfi, unsigned char *str, unsigned int len); #endif #endif /* _Draw_h */ |