8 static struct graphics_priv {
12 static struct graphics_font_priv {
16 static struct graphics_gc_priv {
20 static struct graphics_image_priv {
22 } graphics_image_priv;
25 graphics_destroy(struct graphics_priv *gr)
29 static void font_destroy(struct graphics_font_priv *font)
34 static struct graphics_font_methods font_methods = {
38 static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, int size)
41 return &graphics_font_priv;
45 gc_destroy(struct graphics_gc_priv *gc)
50 gc_set_linewidth(struct graphics_gc_priv *gc, int w)
55 gc_set_dashes(struct graphics_gc_priv *gc, unsigned char *dash_list, int n)
60 gc_set_color(struct graphics_gc_priv *gc, struct color *c, int fg)
65 gc_set_foreground(struct graphics_gc_priv *gc, struct color *c)
70 gc_set_background(struct graphics_gc_priv *gc, struct color *c)
74 static struct graphics_gc_methods gc_methods = {
82 static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics_gc_methods *meth)
85 return &graphics_gc_priv;
89 static struct graphics_image_priv *
90 image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, int *w, int *h)
92 return &graphics_image_priv;
96 draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
101 draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
106 draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h)
111 draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int r)
117 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)
122 draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img)
127 draw_image_warp(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, int count, char *data)
132 overlay_draw(struct graphics_priv *parent, struct graphics_priv *overlay, int window)
137 draw_restore(struct graphics_priv *gr, struct point *p, int w, int h)
142 background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc)
147 draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
151 static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h);
154 get_data(struct graphics_priv *this, char *type)
162 register_resize_callback(struct graphics_priv *this, void (*callback)(void *data, int w, int h), void *data)
167 register_motion_callback(struct graphics_priv *this, void (*callback)(void *data, struct point *p), void *data)
172 register_button_callback(struct graphics_priv *this, void (*callback)(void *data, int press, int button, struct point *p), void *data)
176 static struct graphics_methods graphics_methods = {
193 register_resize_callback,
194 register_button_callback,
195 register_motion_callback,
198 static struct graphics_priv *
199 overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h)
201 *meth=graphics_methods;
202 return &graphics_priv;
206 static struct graphics_priv *
207 graphics_null_new(struct graphics_methods *meth)
209 *meth=graphics_methods;
210 return &graphics_priv;
216 plugin_register_graphics_type("null", graphics_null_new);