9 static struct graphics_priv {
13 static struct graphics_font_priv {
17 static struct graphics_gc_priv {
21 static struct graphics_image_priv {
23 } graphics_image_priv;
26 graphics_destroy(struct graphics_priv *gr)
30 static void font_destroy(struct graphics_font_priv *font)
35 static struct graphics_font_methods font_methods = {
39 static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, int size)
42 return &graphics_font_priv;
46 gc_destroy(struct graphics_gc_priv *gc)
51 gc_set_linewidth(struct graphics_gc_priv *gc, int w)
56 gc_set_dashes(struct graphics_gc_priv *gc, int w, int offset, unsigned char *dash_list, int n)
61 gc_set_foreground(struct graphics_gc_priv *gc, struct color *c)
66 gc_set_background(struct graphics_gc_priv *gc, struct color *c)
70 static struct graphics_gc_methods gc_methods = {
78 static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics_gc_methods *meth)
81 return &graphics_gc_priv;
85 static struct graphics_image_priv *
86 image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, int *w, int *h)
88 return &graphics_image_priv;
92 draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
97 draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
102 draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h)
107 draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int r)
113 draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy)
118 draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img)
123 draw_image_warp(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, int count, char *data)
128 draw_restore(struct graphics_priv *gr, struct point *p, int w, int h)
133 background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc)
138 draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
142 static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h);
145 get_data(struct graphics_priv *this, char *type)
153 register_resize_callback(struct graphics_priv *this, void (*callback)(void *data, int w, int h), void *data)
158 register_motion_callback(struct graphics_priv *this, void (*callback)(void *data, struct point *p), void *data)
163 register_button_callback(struct graphics_priv *this, void (*callback)(void *data, int press, int button, struct point *p), void *data)
167 static struct graphics_methods graphics_methods = {
184 register_resize_callback,
185 register_button_callback,
186 register_motion_callback,
189 static struct graphics_priv *
190 overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h)
192 *meth=graphics_methods;
193 return &graphics_priv;
197 static struct graphics_priv *
198 graphics_null_new(struct graphics_methods *meth, struct attr **attrs)
200 *meth=graphics_methods;
201 return &graphics_priv;
207 plugin_register_graphics_type("null", graphics_null_new);