aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/Draw.h138
1 files changed, 42 insertions, 96 deletions
diff --git a/generic/Draw.h b/generic/Draw.h
index 3862b2b..258f297 100644
--- a/generic/Draw.h
+++ b/generic/Draw.h
@@ -34,8 +34,12 @@
#include "Types.h"
#include "Color.h"
#include "Attrs.h"
+#include "Image.h"
#include <X11/Xlib.h>
+#ifdef GLX
+#include <GL/glx.h>
+#endif
#define LIGHTNING_POINTS 4
@@ -45,7 +49,6 @@
#define LINE_SHAPE_POINTS 4 /* Maximum of all above */
struct _WidgetInfo;
-struct _ImageBits;
#ifdef GLX
#define GLX_START_CLIP(num_clips, render) { \
@@ -83,105 +86,48 @@ struct _ImageBits;
#endif
-void SetLineStyle(struct _WidgetInfo *wi, LineStyle line_style);
-void GetLineShape(ZnPoint *p1, ZnPoint *p2, unsigned int line_width,
- LineShape shape, ZnBBox *bbox, ZnList to_points);
-void DrawLineShape(struct _WidgetInfo *wi, ZnPoint *points, int num_points,
- LineStyle line_style, ZnColor line_foreground,
- unsigned int line_width, LineShape shape);
-int PolygonReliefInBBox(ZnPoint *points, int num_points, int line_width,
- ZnBBox *bbox);
-void GetPolygonReliefBBox(ZnPoint *points, int num_points, int line_width,
+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);
-double PolygonReliefToPointDist(ZnPoint *points, int num_points, int line_width,
- ZnPoint *pp);
-void DrawRectangleRelief(struct _WidgetInfo *wi,
- ReliefStyle relief, ZnGradient *gradient,
- XRectangle *bbox, unsigned int line_width);
-void DrawPolygonRelief(struct _WidgetInfo *wi, ReliefStyle relief,
- ZnGradient *gradient, ZnPoint *points,
- int num_points, int line_width);
+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,
+ ZnGradient *gradient, ZnPoint *points,
+ int num_points, int line_width);
#ifdef GLX
-void RenderPolygonRelief(struct _WidgetInfo *wi, ReliefStyle relief,
- ZnGradient *gradient, ZnBool smooth,
- ZnPoint *points, int num_points, int line_width);
-void RenderPolyline(struct _WidgetInfo *wi, ZnPoint *points, int num_points,
- int line_width, LineStyle line_style, int cap_style,
- int join_style, ZnLineEnd first_end, ZnLineEnd last_end,
- ZnGradient *gradient);
-void ComputeAxialGradient(struct _WidgetInfo *wi, ZnPoly *shape, int angle,
- ZnPoint *grad_geo);
-void ComputeRadialGradient(struct _WidgetInfo *wi, ZnPoly *shape, ZnBBox *bbox,
- ZnPoint *center, ZnPoint *grad_geo);
-void RenderGradient(struct _WidgetInfo *wi, ZnGradient *gradient,
- void cb(void *), void *closure, ZnPoint *quad,
- ZnPoly *poly);
-void RenderTile(struct _WidgetInfo *wi, struct _ImageBits *tile,
- ZnGradient *gradient, void cb(void *), void *closure,
- ZnPoint *quad);
-void RenderImage(struct _WidgetInfo *wi, struct _ImageBits *image,
- ZnGradient *gradient, ZnPoint *origin, ZnBool modulate);
+void ZnRenderPolygonRelief(struct _WidgetInfo *wi, ReliefStyle relief,
+ ZnGradient *gradient, ZnBool smooth,
+ ZnPoint *points, int num_points, int line_width);
+void ZnRenderPolyline(struct _WidgetInfo *wi, ZnPoint *points, int num_points,
+ int line_width, LineStyle 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,
+ ZnPoint *grad_geo);
+void ZnComputeRadialGradient(struct _WidgetInfo *wi, ZnPoly *shape, ZnBBox *bbox,
+ ZnPoint *center, ZnPoint *grad_geo);
+void ZnRenderGradient(struct _WidgetInfo *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 ZnRenderImage(struct _WidgetInfo *wi, ZnImage image,
+ ZnGradient *gradient, ZnPoint *origin, ZnBool modulate);
void RenderHollowDot(struct _WidgetInfo *wi, ZnPoint *p, ZnReal size);
-#endif
-
-#ifdef GLX
-/* Copyright (c) Mark J. Kilgard, 1997. */
-
-/* This program is freely distributable without licensing fees and is
- provided without guarantee or warrantee expressed or implied. This
- program is -not- in the public domain. */
-
-#include <GL/gl.h>
-
-typedef struct {
- unsigned short c; /* Potentially support 16-bit glyphs. */
- unsigned char width;
- unsigned char height;
- signed char xoffset;
- signed char yoffset;
- signed char advance;
- char dummy; /* Space holder for alignment reasons. */
- short x;
- short y;
-} TexGlyphInfo;
-
-typedef struct {
- GLfloat t0[2];
- GLshort v0[2];
- GLfloat t1[2];
- GLshort v1[2];
- GLfloat t2[2];
- GLshort v2[2];
- GLfloat t3[2];
- GLshort v3[2];
- GLfloat advance;
-} TexGlyphVertexInfo;
-
-typedef struct {
- GLuint texobj;
- int tex_width;
- int tex_height;
- int max_ascent;
- int max_descent;
- int num_glyphs;
- int min_glyph;
- int range;
- unsigned char *teximage;
- TexGlyphInfo *tgi;
- TexGlyphVertexInfo *tgvi;
- TexGlyphVertexInfo **lut;
-} TexFont;
-
-extern void txfRenderGlyph(TexFont */* txf */,
- int /* c */);
-
-extern void txfRenderString(TexFont */* txf */,
- unsigned char */* string */,
- int /* len */);
-extern void txfRenderFancyString(TexFont */* txf */,
- unsigned char */* string */,
- int /* len */);
+void ZnRenderGlyph(ZnTexFontInfo *tfi, int c);
+void ZnRenderString(ZnTexFontInfo *tfi, unsigned char *str, int len);
+void ZnRenderFancyString(ZnTexFontInfo *tfi, unsigned char *str, int len);
#endif
#endif /* _Draw_h */