Merge with modular_map
[navit-package] / src / graphics / null / graphics_null.c
1 #include <glib.h>
2 #include "point.h"
3 #include "graphics.h"
4 #include "color.h"
5 #include "plugin.h"
6
7 static int dummy;
8 static struct graphics_priv {
9         int dummy;
10 } graphics_priv;
11
12 static struct graphics_font_priv {
13         int dummy;
14 } graphics_font_priv;
15
16 static struct graphics_gc_priv {
17         int dummy;
18 } graphics_gc_priv;
19
20 static struct graphics_image_priv {
21         int dummy;
22 } graphics_image_priv;
23
24 static void
25 graphics_destroy(struct graphics_priv *gr)
26 {
27 }
28
29 static void font_destroy(struct graphics_font_priv *font)
30 {
31
32 }
33
34 static struct graphics_font_methods font_methods = {
35         font_destroy
36 };
37
38 static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, int size)
39 {
40         *meth=font_methods;
41         return &graphics_font_priv;
42 }
43
44 static void
45 gc_destroy(struct graphics_gc_priv *gc)
46 {
47 }
48
49 static void
50 gc_set_linewidth(struct graphics_gc_priv *gc, int w)
51 {
52 }
53
54 static void
55 gc_set_dashes(struct graphics_gc_priv *gc, unsigned char *dash_list, int n)
56 {
57 }
58
59 static void
60 gc_set_color(struct graphics_gc_priv *gc, struct color *c, int fg)
61 {
62 }
63
64 static void
65 gc_set_foreground(struct graphics_gc_priv *gc, struct color *c)
66 {
67 }
68
69 static void
70 gc_set_background(struct graphics_gc_priv *gc, struct color *c)
71 {
72 }
73
74 static struct graphics_gc_methods gc_methods = {
75         gc_destroy,
76         gc_set_linewidth,
77         gc_set_dashes,  
78         gc_set_foreground,      
79         gc_set_background       
80 };
81
82 static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics_gc_methods *meth)
83 {
84         *meth=gc_methods;
85         return &graphics_gc_priv;
86 }
87
88
89 static struct graphics_image_priv *
90 image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, int *w, int *h)
91 {
92         return &graphics_image_priv;
93 }
94
95 static void
96 draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
97 {
98 }
99
100 static void
101 draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
102 {
103 }
104
105 static void
106 draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h)
107 {
108 }
109
110 static void
111 draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int r)
112 {
113 }
114
115
116 static void
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)
118 {
119 }
120
121 static void
122 draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img)
123 {
124 }
125
126 static void
127 draw_image_warp(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, int count, char *data)
128 {
129 }
130
131 static void
132 overlay_draw(struct graphics_priv *parent, struct graphics_priv *overlay, int window)
133 {
134 }
135
136 static void
137 draw_restore(struct graphics_priv *gr, struct point *p, int w, int h)
138 {
139 }
140
141 static void
142 background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc)
143 {
144 }
145
146 static void
147 draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
148 {
149 }
150
151 static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h);
152
153 static void *
154 get_data(struct graphics_priv *this, char *type)
155 {
156         return &dummy;
157 }
158
159
160
161 static void
162 register_resize_callback(struct graphics_priv *this, void (*callback)(void *data, int w, int h), void *data)
163 {
164 }
165
166 static void
167 register_motion_callback(struct graphics_priv *this, void (*callback)(void *data, struct point *p), void *data)
168 {
169 }
170
171 static void
172 register_button_callback(struct graphics_priv *this, void (*callback)(void *data, int press, int button, struct point *p), void *data)
173 {
174 }
175
176 static struct graphics_methods graphics_methods = {
177         graphics_destroy,
178         draw_mode,
179         draw_lines,
180         draw_polygon,
181         draw_rectangle,
182         draw_circle,
183         draw_text,
184         draw_image,
185         draw_image_warp,
186         draw_restore,
187         font_new,
188         gc_new,
189         background_gc,
190         overlay_new,
191         image_new,
192         get_data,
193         register_resize_callback,
194         register_button_callback,
195         register_motion_callback,
196 };
197
198 static struct graphics_priv *
199 overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h)
200 {
201         *meth=graphics_methods;
202         return &graphics_priv;
203 }
204
205
206 static struct graphics_priv *
207 graphics_null_new(struct graphics_methods *meth)
208 {
209         *meth=graphics_methods;
210         return &graphics_priv;
211 }
212
213 void
214 plugin_init(void)
215 {
216         plugin_register_graphics_type("null", graphics_null_new);
217 }