Updated project files to VS2008 SP1. Removed deprecated features (and warning message...
[xiph/unicode.git] / planarity / gameboard_draw_button.c
blobad614c9214b3ec45588eaa94619daa01823a8ec9
1 /*
3 * gPlanarity:
4 * The geeky little puzzle game with a big noodly crunch!
5 *
6 * gPlanarity copyright (C) 2005 Monty <monty@xiph.org>
7 * Original Flash game by John Tantalo <john.tantalo@case.edu>
8 * Original game concept by Mary Radcliffe
10 * gPlanarity is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
13 * any later version.
15 * gPlanarity is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Postfish; see the file COPYING. If not, write to the
22 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include <math.h>
28 #include <gtk/gtk.h>
30 #include "graph.h"
31 #include "gameboard.h"
32 #include "gameboard_draw_button.h"
35 /************************* simple round icon drawing *********************/
37 void path_button_help(cairo_t *c, double x, double y){
39 cairo_save(c);
40 cairo_translate(c,x,y);
41 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
42 cairo_set_line_width(c,1);
43 cairo_arc(c,0,0,14,0,2*M_PI);
45 cairo_move_to(c,-9,-2);
46 cairo_curve_to(c,-8,-7, -4.5,-12, 0,-12);
47 cairo_curve_to(c, 7,-12, 9,-6, 9,-4);
48 cairo_curve_to(c, 9,0 ,6,2, 5,2);
50 cairo_curve_to(c, 4,2, 2.5,3, 2.5,6);
51 cairo_line_to(c,-2.5,6);
53 cairo_curve_to(c,-2.5,3, -3,1, 0,-1);
54 cairo_curve_to(c, 11,-4, -3,-12, -4,-2);
55 cairo_close_path(c);
57 cairo_move_to(c,-2.5,8);
58 cairo_line_to(c,2.5,8);
59 cairo_line_to(c,2.5,12);
60 cairo_line_to(c,-2.5,12);
61 cairo_close_path(c);
62 cairo_fill_preserve(c);
64 cairo_restore(c);
68 void path_button_pause(cairo_t *c, double x, double y){
70 cairo_save(c);
71 cairo_translate(c,x,y);
72 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
73 cairo_set_line_width(c,1);
74 cairo_arc(c,0,0,14,0,2*M_PI);
76 cairo_rectangle(c,-7,-9,5,18);
77 cairo_rectangle(c,2,-9,5,18);
78 cairo_fill_preserve(c);
79 cairo_restore(c);
83 void path_button_exit(cairo_t *c, double x, double y){
85 cairo_save(c);
86 cairo_translate(c,x,y);
87 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
88 cairo_set_line_width(c,1);
89 cairo_arc(c,0,0,14,0,2*M_PI);
91 cairo_move_to(c,-6,-9.5);
92 cairo_line_to(c,0,-3.5);
93 cairo_line_to(c,6,-9.5);
94 cairo_line_to(c,9.5,-6);
95 cairo_line_to(c,3.5,0);
96 cairo_line_to(c,9.5,6);
97 cairo_line_to(c,6,9.5);
98 cairo_line_to(c,0,3.5);
99 cairo_line_to(c,-6,9.5);
100 cairo_line_to(c,-9.5,6);
101 cairo_line_to(c,-3.5,0);
102 cairo_line_to(c,-9.5,-6);
103 cairo_close_path(c);
105 cairo_fill_preserve(c);
106 cairo_restore(c);
110 void path_button_back(cairo_t *c, double x, double y){
112 cairo_save(c);
113 cairo_translate(c,x,y);
114 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
115 cairo_set_line_width(c,1);
117 cairo_arc(c,0,0,14,0,2*M_PI);
119 cairo_move_to(c,0,-11);
120 cairo_line_to(c,-9,0);
121 cairo_line_to(c,-3,0);
122 cairo_line_to(c,-3,10);
123 cairo_line_to(c,3,10);
124 cairo_line_to(c,3,0);
125 cairo_line_to(c,9,0);
126 cairo_close_path(c);
128 cairo_fill_preserve(c);
129 cairo_restore(c);
133 void path_button_reset(cairo_t *c, double x, double y){
135 cairo_save(c);
136 cairo_translate(c,x,y);
137 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
138 cairo_set_line_width(c,1);
140 cairo_arc(c,0,0,14,0,2*M_PI);
142 cairo_move_to(c,-11,-5);
143 cairo_line_to(c,-12,1);
144 cairo_line_to(c,-6,1);
145 cairo_line_to(c,0, 11);
146 cairo_line_to(c,6,1);
147 cairo_line_to(c,12,1);
148 cairo_line_to(c,11,-5);
149 cairo_line_to(c,4,-5);
150 cairo_line_to(c,0,2);
151 cairo_line_to(c,-4,-5);
152 cairo_close_path(c);
154 cairo_fill_preserve(c);
155 cairo_restore(c);
159 void path_button_expand(cairo_t *c, double x, double y){
161 cairo_save(c);
162 cairo_translate(c,x,y);
163 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
164 cairo_set_line_width(c,1);
166 cairo_arc(c,0,0,14,0,2*M_PI);
168 cairo_move_to(c,-8.5,-3);
169 cairo_line_to(c,-2.5,-3);
170 cairo_line_to(c,-3,-8.5);
171 cairo_line_to(c,3, -8.5);
172 cairo_line_to(c,3,-3);
173 cairo_line_to(c,8.5,-3);
174 cairo_line_to(c,8.5,3);
175 cairo_line_to(c,3,3);
176 cairo_line_to(c,3,8.5);
177 cairo_line_to(c,-3,8.5);
178 cairo_line_to(c,-3,3);
179 cairo_line_to(c,-8.5,3);
180 cairo_close_path(c);
182 cairo_fill_preserve(c);
183 cairo_restore(c);
187 void path_button_shrink(cairo_t *c, double x, double y){
189 cairo_save(c);
190 cairo_translate(c,x,y);
191 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
192 cairo_set_line_width(c,1);
194 cairo_arc(c,0,0,14,0,2*M_PI);
196 cairo_move_to(c,-10,-3);
197 cairo_line_to(c,10,-3);
198 cairo_line_to(c,10,3);
199 cairo_line_to(c,-10,3);
200 cairo_close_path(c);
202 cairo_fill_preserve(c);
203 cairo_restore(c);
207 void path_button_lines(cairo_t *c, double x, double y){
209 cairo_save(c);
210 cairo_translate(c,x,y);
211 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
212 cairo_set_line_width(c,1);
214 cairo_arc(c,0,0,14,0,2*M_PI);
216 cairo_move_to(c,6,-4);
217 cairo_arc(c,0,-4,6,0,2*M_PI);
219 cairo_move_to(c,0,2);
220 cairo_line_to(c,0,10);
221 cairo_close_path(c);
223 cairo_move_to(c,2.68328,5.36656-4);
224 cairo_rel_line_to(c,4,8);
225 cairo_close_path(c);
227 cairo_move_to(c,-2.68328,5.36656-4);
228 cairo_rel_line_to(c,-4,8);
229 cairo_close_path(c);
231 cairo_fill_preserve(c);
232 cairo_restore(c);
236 void path_button_int(cairo_t *c, double x, double y){
238 cairo_save(c);
239 cairo_translate(c,x,y);
240 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
241 cairo_set_line_width(c,1);
243 cairo_arc(c,0,0,14,0,2*M_PI);
245 cairo_move_to(c,8,0);
246 cairo_line_to(c,0,8);
247 cairo_line_to(c,-8,0);
248 cairo_line_to(c,0,-8);
250 cairo_close_path(c);
252 cairo_fill_preserve(c);
253 cairo_restore(c);
257 void path_button_check(cairo_t *c, double x, double y){
259 cairo_save(c);
260 cairo_translate(c,x,y);
261 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
262 cairo_set_line_width(c,1);
264 cairo_arc(c,0,0,14,0,2*M_PI);
266 cairo_move_to(c,8,-8);
267 cairo_curve_to(c, 7,-7, 11,-7.3, 10,-6);
268 cairo_line_to(c,0,9);
269 cairo_curve_to(c, -1,9.1, -2,11, -3,10);
270 cairo_line_to(c,-11,4);
271 cairo_curve_to(c, -12,3, -10,.5, -9,1);
272 cairo_line_to(c,-3,3);
274 cairo_close_path(c);
276 cairo_fill_preserve(c);
277 cairo_restore(c);
281 void path_button_play(cairo_t *c, double x, double y){
283 cairo_save(c);
284 cairo_translate(c,x,y);
285 cairo_set_fill_rule(c,CAIRO_FILL_RULE_EVEN_ODD);
286 cairo_set_line_width(c,1);
288 cairo_arc(c,0,0,14,0,2*M_PI);
290 cairo_move_to(c,-8,-8);
291 cairo_line_to(c,10,0);
292 cairo_line_to(c,-8,8);
293 cairo_close_path(c);
295 cairo_fill_preserve(c);
296 cairo_restore(c);