forked from shoes/shoes-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 6
/
canvas.h
644 lines (581 loc) · 19.5 KB
/
canvas.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
//
// shoes/canvas.h
// Ruby methods for all the drawing ops.
//
#ifndef SHOES_CANVAS_H
#define SHOES_CANVAS_H
#include <cairo.h>
#include <cairo-svg.h>
#include <cairo-ps.h>
#include <cairo-pdf.h>
#include <pango/pangocairo.h>
#include <ruby.h>
#include "shoes/config.h"
#include "shoes/code.h"
struct _shoes_app;
typedef unsigned int PIXEL;
extern const double RAD2PI, PIM2, PI;
extern const char *dialog_title, *dialog_title_says;
#define REL_WINDOW 1
#define REL_CANVAS 2
#define REL_CURSOR 3
#define REL_TILE 4
#define REL_STICKY 5
#define REL_SCALE 8
#define REL_COORDS(x) (x & 0x07)
#define REL_FLAGS(x) (x & 0xF8)
#define FLAG_POSITION 0x0F
#define FLAG_ABSX 0x10
#define FLAG_ABSY 0x20
#define FLAG_ORIGIN 0x40
#define HOVER_MOTION 0x01
#define HOVER_CLICK 0x02
//
// affine transforms, to avoid littering these structs everywhere
//
typedef struct {
cairo_matrix_t tf;
ID mode;
int refs;
} shoes_transform;
//
// place struct
// (outlines the area where a control has been placed)
//
typedef struct {
int x, y, w, h, dx, dy;
int ix, iy, iw, ih;
unsigned char flags;
} shoes_place;
#define SETUP_BASIC() \
shoes_basic *basic; \
Data_Get_Struct(self, shoes_basic, basic);
#define COPY_PENS(attr1, attr2) \
if (NIL_P(ATTR(attr1, stroke))) ATTRSET(attr1, stroke, ATTR(attr2, stroke)); \
if (NIL_P(ATTR(attr1, fill))) ATTRSET(attr1, fill, ATTR(attr2, fill)); \
if (NIL_P(ATTR(attr1, strokewidth))) ATTRSET(attr1, strokewidth, ATTR(attr2, strokewidth)); \
if (NIL_P(ATTR(attr1, cap))) ATTRSET(attr1, cap, ATTR(attr2, cap));
#define DRAW(c, app, blk) \
{ \
rb_ary_push(app->nesting, c); \
blk; \
rb_ary_pop(app->nesting); \
}
#define PATTERN_DIM(self_t, x) (self_t->cached != NULL ? self_t->cached->x : 1)
#define PATTERN(self_t) (self_t->cached != NULL ? self_t->cached->pattern : self_t->pattern)
#define ABSX(place) ((place).flags & FLAG_ABSX)
#define ABSY(place) ((place).flags & FLAG_ABSY)
#define POS(place) ((place).flags & FLAG_POSITION)
#define ORIGIN(place) ((place).flags & FLAG_ORIGIN)
#define CPX(c) (c != NULL && (c->place.flags & FLAG_ORIGIN) ? 0 : c->place.ix)
#define CPY(c) (c != NULL && (c->place.flags & FLAG_ORIGIN) ? 0 : c->place.iy)
#define CPB(c) ((c->place.h - c->place.ih) - (c->place.iy - c->place.y))
#define CPH(c) (ORIGIN(c->place) ? c->height : (c->fully - CPB(c)) - CPY(c))
#define CPW(c) (c->place.iw)
#define CCR(c) (c->cr == NULL ? c->app->scratch : c->cr)
#define SWPOS(x) ((int)sw % 2 == 0 ? x * 1. : x + .5)
//
// color struct
//
typedef struct {
unsigned char r, g, b, a, on;
} shoes_color;
#define SHOES_COLOR_OPAQUE 0xFF
#define SHOES_COLOR_TRANSPARENT 0x0
#define SHOES_COLOR_DARK (0x55 * 3)
#define SHOES_COLOR_LIGHT (0xAA * 3)
//
// basic struct
//
typedef struct {
VALUE parent;
VALUE attr;
} shoes_basic;
typedef struct {
VALUE parent;
VALUE attr;
shoes_place place;
} shoes_element;
//
// shape struct
//
typedef struct {
VALUE parent;
VALUE attr;
shoes_place place;
ID name;
char hover;
cairo_path_t *line;
shoes_transform *st;
} shoes_shape;
//
// flow struct
//
typedef struct {
VALUE parent;
VALUE attr;
VALUE contents;
} shoes_flow;
//
// link struct
//
typedef struct {
int start;
int end;
VALUE ele;
} shoes_link;
//
// text cursor
//
typedef struct {
int pos, x, y, hi;
} shoes_textcursor;
//
// text block struct
//
typedef struct {
VALUE parent;
VALUE attr;
shoes_place place;
VALUE texts;
VALUE links;
shoes_textcursor *cursor;
PangoLayout *layout;
PangoAttrList *pattr;
GString *text;
guint len;
char cached, hover;
shoes_transform *st;
} shoes_textblock;
//
// text struct
//
typedef struct {
VALUE parent;
VALUE attr;
VALUE texts;
char hover;
} shoes_text;
//
// cached image
//
typedef enum {
SHOES_IMAGE_NONE,
SHOES_IMAGE_PNG,
SHOES_IMAGE_JPEG,
SHOES_IMAGE_GIF
} shoes_image_format;
typedef struct {
cairo_surface_t *surface;
cairo_pattern_t *pattern;
int width, height, mtime;
shoes_image_format format;
} shoes_cached_image;
#define SHOES_CACHE_FILE 0
#define SHOES_CACHE_ALIAS 1
#define SHOES_CACHE_MEM 2
typedef struct {
unsigned char type;
shoes_cached_image *image;
} shoes_cache_entry;
//
// image struct
//
#define SHOES_IMAGE_EXPIRE (60 * 60)
typedef struct {
VALUE parent;
VALUE attr;
shoes_place place;
unsigned char type;
shoes_cached_image *cached;
shoes_transform *st;
cairo_t *cr;
VALUE path;
char hover;
} shoes_image;
#define SHOES_VIDEO 0
//
// pattern struct
//
typedef struct {
VALUE parent;
VALUE attr;
shoes_place place;
VALUE source;
char hover;
shoes_cached_image *cached;
cairo_pattern_t *pattern;
} shoes_pattern;
//
// native controls struct
//
#define CONTROL_NORMAL 0
#define CONTROL_READONLY 1
#define CONTROL_DISABLED 2
typedef struct {
VALUE parent;
VALUE attr;
shoes_place place;
SHOES_CONTROL_REF ref;
} shoes_control;
#define ANIM_NADA 0
#define ANIM_STARTED 1
#define ANIM_PAUSED 2
#define ANIM_STOPPED 3
//
// animation struct
//
typedef struct {
VALUE parent;
VALUE block;
unsigned int rate, frame;
char started;
SHOES_TIMER_REF ref;
} shoes_timer;
typedef void (*shoes_effect_filter)(cairo_t *, VALUE attr, shoes_place *);
typedef struct {
VALUE parent;
VALUE attr;
shoes_place place;
shoes_effect_filter filter;
} shoes_effect;
typedef struct {
VALUE parent;
VALUE attr;
VALUE response;
unsigned char state;
unsigned LONG_LONG total;
unsigned LONG_LONG transferred;
unsigned long percent;
} shoes_http_klass;
#define CANVAS_NADA 0
#define CANVAS_STARTED 1
#define CANVAS_PAINT 2
#define CANVAS_EMPTY 3
#define CANVAS_REMOVED 4
//
// temporary canvas (used internally for painting)
//
typedef struct {
VALUE parent;
VALUE attr;
shoes_place place;
cairo_t *cr, *shape;
shoes_transform *st, **sts;
int stl, stt;
VALUE contents;
unsigned char stage;
long insertion;
int cx, cy; // cursor x and y (stored in absolute coords)
int endx, endy; // jump points if the cursor spills over
int topy, fully; // since we often stack vertically
int width, height; // the full height and width used by this box
char hover;
struct _shoes_app *app;
SHOES_SLOT_OS *slot;
SHOES_GROUP_OS group;
} shoes_canvas;
void shoes_control_hide_ref(SHOES_CONTROL_REF);
void shoes_control_show_ref(SHOES_CONTROL_REF);
VALUE shoes_app_main(int, VALUE *, VALUE);
VALUE shoes_app_window(int, VALUE *, VALUE, VALUE);
VALUE shoes_app_contents(VALUE);
VALUE shoes_app_get_width(VALUE);
VALUE shoes_app_get_height(VALUE);
VALUE shoes_basic_remove(VALUE);
shoes_transform *shoes_transform_new(shoes_transform *);
shoes_transform *shoes_transform_touch(shoes_transform *);
shoes_transform *shoes_transform_detach(shoes_transform *);
void shoes_transform_release(shoes_transform *);
VALUE shoes_canvas_info (VALUE, VALUE);
VALUE shoes_canvas_debug(VALUE, VALUE);
VALUE shoes_canvas_warn (VALUE, VALUE);
VALUE shoes_canvas_error(VALUE, VALUE);
void shoes_info (const char *fmt, ...);
void shoes_debug(const char *fmt, ...);
void shoes_warn (const char *fmt, ...);
void shoes_error(const char *fmt, ...);
void shoes_canvas_mark(shoes_canvas *);
VALUE shoes_canvas_alloc(VALUE);
VALUE shoes_canvas_new(VALUE, struct _shoes_app *);
void shoes_canvas_clear(VALUE);
shoes_canvas *shoes_canvas_init(VALUE, SHOES_SLOT_OS *, VALUE, int, int);
void shoes_slot_scroll_to(shoes_canvas *, int, int);
void shoes_canvas_paint(VALUE);
void shoes_apply_transformation(cairo_t *, shoes_transform *, shoes_place *, unsigned char);
void shoes_undo_transformation(cairo_t *, shoes_transform *, shoes_place *, unsigned char);
void shoes_canvas_shape_do(shoes_canvas *, double, double, double, double, unsigned char);
VALUE shoes_canvas_style(int, VALUE *, VALUE);
VALUE shoes_canvas_owner(VALUE);
VALUE shoes_canvas_close(VALUE);
VALUE shoes_canvas_get_top(VALUE);
VALUE shoes_canvas_get_left(VALUE);
VALUE shoes_canvas_get_width(VALUE);
VALUE shoes_canvas_get_height(VALUE);
VALUE shoes_canvas_get_scroll_height(VALUE);
VALUE shoes_canvas_get_scroll_max(VALUE);
VALUE shoes_canvas_get_scroll_top(VALUE);
VALUE shoes_canvas_set_scroll_top(VALUE, VALUE);
VALUE shoes_canvas_get_gutter_width(VALUE);
VALUE shoes_canvas_displace(VALUE, VALUE, VALUE);
VALUE shoes_canvas_move(VALUE, VALUE, VALUE);
VALUE shoes_canvas_nostroke(VALUE);
VALUE shoes_canvas_stroke(int, VALUE *, VALUE);
VALUE shoes_canvas_strokewidth(VALUE, VALUE);
VALUE shoes_canvas_dash(VALUE, VALUE);
VALUE shoes_canvas_cap(VALUE, VALUE);
VALUE shoes_canvas_nofill(VALUE);
VALUE shoes_canvas_fill(int, VALUE *, VALUE);
VALUE shoes_canvas_rgb(int, VALUE *, VALUE);
VALUE shoes_canvas_gray(int, VALUE *, VALUE);
VALUE shoes_canvas_rect(int, VALUE *, VALUE);
VALUE shoes_canvas_arc(int, VALUE *, VALUE);
VALUE shoes_canvas_oval(int, VALUE *, VALUE);
VALUE shoes_canvas_line(int, VALUE *, VALUE);
VALUE shoes_canvas_arrow(int, VALUE *, VALUE);
VALUE shoes_canvas_star(int, VALUE *, VALUE);
VALUE shoes_canvas_para(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_banner(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_title(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_subtitle(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_tagline(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_caption(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_inscription(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_code(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_del(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_em(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_ins(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_link(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_span(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_strong(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_sub(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_sup(int argc, VALUE *argv, VALUE self);
VALUE shoes_canvas_background(int, VALUE *, VALUE);
VALUE shoes_canvas_border(int, VALUE *, VALUE);
VALUE shoes_canvas_video(int, VALUE *, VALUE);
VALUE shoes_canvas_blur(int, VALUE *, VALUE);
VALUE shoes_canvas_glow(int, VALUE *, VALUE);
VALUE shoes_canvas_shadow(int, VALUE *, VALUE);
VALUE shoes_canvas_image(int, VALUE *, VALUE);
VALUE shoes_canvas_animate(int, VALUE *, VALUE);
VALUE shoes_canvas_every(int, VALUE *, VALUE);
VALUE shoes_canvas_timer(int, VALUE *, VALUE);
VALUE shoes_canvas_imagesize(VALUE, VALUE);
VALUE shoes_canvas_shape(int, VALUE *, VALUE);
void shoes_canvas_remove_item(VALUE, VALUE, char, char);
VALUE shoes_canvas_move_to(VALUE, VALUE, VALUE);
VALUE shoes_canvas_line_to(VALUE, VALUE, VALUE);
VALUE shoes_canvas_curve_to(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
VALUE shoes_canvas_arc_to(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
VALUE shoes_canvas_transform(VALUE, VALUE);
VALUE shoes_canvas_translate(VALUE, VALUE, VALUE);
VALUE shoes_canvas_rotate(VALUE, VALUE);
VALUE shoes_canvas_scale(int, VALUE *, VALUE);
VALUE shoes_canvas_skew(int, VALUE *, VALUE);
VALUE shoes_canvas_push(VALUE);
VALUE shoes_canvas_pop(VALUE);
VALUE shoes_canvas_reset(VALUE);
VALUE shoes_canvas_button(int, VALUE *, VALUE);
VALUE shoes_canvas_list_box(int, VALUE *, VALUE);
VALUE shoes_canvas_edit_line(int, VALUE *, VALUE);
VALUE shoes_canvas_edit_box(int, VALUE *, VALUE);
VALUE shoes_canvas_progress(int, VALUE *, VALUE);
VALUE shoes_canvas_slider(int, VALUE *, VALUE);
VALUE shoes_canvas_check(int, VALUE *, VALUE);
VALUE shoes_canvas_radio(int, VALUE *, VALUE);
VALUE shoes_canvas_contents(VALUE);
VALUE shoes_canvas_children(VALUE);
void shoes_canvas_size(VALUE, int, int);
VALUE shoes_canvas_clear_contents(int, VALUE *, VALUE);
VALUE shoes_canvas_remove(VALUE);
VALUE shoes_canvas_draw(VALUE, VALUE, VALUE);
VALUE shoes_canvas_after(int, VALUE *, VALUE);
VALUE shoes_canvas_before(int, VALUE *, VALUE);
VALUE shoes_canvas_append(int, VALUE *, VALUE);
VALUE shoes_canvas_prepend(int, VALUE *, VALUE);
VALUE shoes_canvas_flow(int, VALUE *, VALUE);
VALUE shoes_canvas_stack(int, VALUE *, VALUE);
VALUE shoes_canvas_mask(int, VALUE *, VALUE);
VALUE shoes_canvas_widget(int, VALUE *, VALUE);
VALUE shoes_canvas_hide(VALUE);
VALUE shoes_canvas_show(VALUE);
VALUE shoes_canvas_toggle(VALUE);
VALUE shoes_canvas_mouse(VALUE);
VALUE shoes_canvas_start(int, VALUE *, VALUE);
VALUE shoes_canvas_finish(int, VALUE *, VALUE);
VALUE shoes_canvas_hover(int, VALUE *, VALUE);
VALUE shoes_canvas_leave(int, VALUE *, VALUE);
VALUE shoes_canvas_click(int, VALUE *, VALUE);
VALUE shoes_canvas_release(int, VALUE *, VALUE);
VALUE shoes_canvas_motion(int, VALUE *, VALUE);
VALUE shoes_canvas_keydown(int, VALUE *, VALUE);
VALUE shoes_canvas_keypress(int, VALUE *, VALUE);
VALUE shoes_canvas_keyup(int, VALUE *, VALUE);
int shoes_canvas_independent(shoes_canvas *);
VALUE shoes_find_canvas(VALUE);
VALUE shoes_canvas_get_app(VALUE);
void shoes_canvas_repaint_all(VALUE);
void shoes_canvas_compute(VALUE);
VALUE shoes_canvas_goto(VALUE, VALUE);
VALUE shoes_canvas_send_click(VALUE, int, int, int);
void shoes_canvas_send_release(VALUE, int, int, int);
VALUE shoes_canvas_send_motion(VALUE, int, int, VALUE);
void shoes_canvas_send_wheel(VALUE, ID, int, int);
void shoes_canvas_send_keydown(VALUE, VALUE);
void shoes_canvas_send_keypress(VALUE, VALUE);
void shoes_canvas_send_keyup(VALUE, VALUE);
VALUE shoes_canvas_get_cursor(VALUE);
VALUE shoes_canvas_set_cursor(VALUE, VALUE);
VALUE shoes_canvas_get_clipboard(VALUE);
VALUE shoes_canvas_set_clipboard(VALUE, VALUE);
VALUE shoes_canvas_window(int, VALUE *, VALUE);
VALUE shoes_canvas_dialog(int, VALUE *, VALUE);
VALUE shoes_canvas_window_plain(VALUE);
VALUE shoes_canvas_dialog_plain(VALUE);
VALUE shoes_canvas_snapshot(int, VALUE *, VALUE);
VALUE shoes_canvas_download(int, VALUE *, VALUE);
SHOES_SLOT_OS *shoes_slot_alloc(shoes_canvas *, SHOES_SLOT_OS *, int);
VALUE shoes_slot_new(VALUE, VALUE, VALUE);
VALUE shoes_flow_new(VALUE, VALUE);
VALUE shoes_stack_new(VALUE, VALUE);
VALUE shoes_mask_new(VALUE, VALUE);
VALUE shoes_widget_new(VALUE, VALUE, VALUE);
void shoes_control_mark(shoes_control *);
VALUE shoes_control_new(VALUE, VALUE, VALUE);
VALUE shoes_control_alloc(VALUE);
void shoes_control_send(VALUE, ID);
VALUE shoes_control_get_top(VALUE);
VALUE shoes_control_get_left(VALUE);
VALUE shoes_control_get_width(VALUE);
VALUE shoes_control_get_height(VALUE);
VALUE shoes_control_remove(VALUE);
VALUE shoes_control_show(VALUE);
VALUE shoes_control_temporary_show(VALUE);
VALUE shoes_control_hide(VALUE);
VALUE shoes_control_temporary_hide(VALUE);
VALUE shoes_control_focus(VALUE);
VALUE shoes_control_get_state(VALUE);
VALUE shoes_control_set_state(VALUE, VALUE);
VALUE shoes_button_draw(VALUE, VALUE, VALUE);
void shoes_button_send_click(VALUE);
VALUE shoes_edit_line_draw(VALUE, VALUE, VALUE);
VALUE shoes_edit_line_get_text(VALUE);
VALUE shoes_edit_line_set_text(VALUE, VALUE);
VALUE shoes_edit_box_draw(VALUE, VALUE, VALUE);
VALUE shoes_edit_box_get_text(VALUE);
VALUE shoes_edit_box_set_text(VALUE, VALUE);
VALUE shoes_list_box_text(VALUE);
VALUE shoes_list_box_draw(VALUE, VALUE, VALUE);
VALUE shoes_progress_draw(VALUE, VALUE, VALUE);
void shoes_shape_mark(shoes_shape *);
VALUE shoes_shape_attr(int, VALUE *, int, ...);
void shoes_shape_sketch(cairo_t *, ID, shoes_place *, shoes_transform *, VALUE, cairo_path_t *, unsigned char);
VALUE shoes_shape_new(VALUE, ID, VALUE, shoes_transform *, cairo_path_t *);
VALUE shoes_shape_alloc(VALUE);
VALUE shoes_shape_draw(VALUE, VALUE, VALUE);
VALUE shoes_shape_move(VALUE, VALUE, VALUE);
VALUE shoes_shape_get_top(VALUE);
VALUE shoes_shape_get_left(VALUE);
VALUE shoes_shape_get_width(VALUE);
VALUE shoes_shape_get_height(VALUE);
VALUE shoes_shape_motion(VALUE, int, int, char *);
VALUE shoes_shape_send_click(VALUE, int, int, int);
void shoes_shape_send_release(VALUE, int, int, int);
void shoes_image_ensure_dup(shoes_image *);
void shoes_image_mark(shoes_image *);
VALUE shoes_image_new(VALUE, VALUE, VALUE, VALUE, shoes_transform *);
VALUE shoes_image_alloc(VALUE);
void shoes_image_image(VALUE, VALUE, VALUE);
VALUE shoes_image_draw(VALUE, VALUE, VALUE);
VALUE shoes_image_get_top(VALUE);
VALUE shoes_image_get_left(VALUE);
VALUE shoes_image_get_width(VALUE);
VALUE shoes_image_get_height(VALUE);
VALUE shoes_image_motion(VALUE, int, int, char *);
VALUE shoes_image_send_click(VALUE, int, int, int);
void shoes_image_send_release(VALUE, int, int, int);
shoes_effect_filter shoes_effect_for_type(ID);
void shoes_effect_mark(shoes_effect *);
VALUE shoes_effect_new(ID, VALUE, VALUE);
VALUE shoes_effect_alloc(VALUE);
VALUE shoes_effect_draw(VALUE, VALUE, VALUE);
VALUE shoes_pattern_self(VALUE);
VALUE shoes_pattern_method(VALUE, VALUE);
VALUE shoes_pattern_args(int, VALUE *, VALUE);
void shoes_pattern_mark(shoes_pattern *);
VALUE shoes_pattern_new(VALUE, VALUE, VALUE, VALUE);
VALUE shoes_pattern_alloc(VALUE);
VALUE shoes_pattern_motion(VALUE, int, int, char *);
VALUE shoes_background_draw(VALUE, VALUE, VALUE);
VALUE shoes_border_draw(VALUE, VALUE, VALUE);
VALUE shoes_subpattern_new(VALUE, VALUE, VALUE);
void shoes_timer_mark(shoes_timer *);
VALUE shoes_timer_new(VALUE, VALUE, VALUE, VALUE);
VALUE shoes_timer_alloc(VALUE);
VALUE shoes_timer_init(VALUE, VALUE);
VALUE shoes_timer_remove(VALUE);
VALUE shoes_timer_start(VALUE);
VALUE shoes_timer_stop(VALUE);
void shoes_timer_call(VALUE);
void shoes_color_mark(shoes_color *);
VALUE shoes_color_new(int, int, int, int);
VALUE shoes_color_alloc(VALUE);
VALUE shoes_color_rgb(int, VALUE *, VALUE);
VALUE shoes_color_gray(int, VALUE *, VALUE);
cairo_pattern_t *shoes_color_pattern(VALUE);
void shoes_color_grad_stop(cairo_pattern_t *, double, VALUE);
VALUE shoes_color_args(int, VALUE *, VALUE);
VALUE shoes_color_parse(VALUE, VALUE);
VALUE shoes_color_is_black(VALUE);
VALUE shoes_color_is_dark(VALUE);
VALUE shoes_color_is_light(VALUE);
VALUE shoes_color_is_white(VALUE);
VALUE shoes_color_invert(VALUE);
VALUE shoes_color_to_s(VALUE);
VALUE shoes_color_to_pattern(VALUE);
VALUE shoes_color_gradient(int, VALUE *, VALUE);
void shoes_link_mark(shoes_link *);
VALUE shoes_link_new(VALUE, int, int);
VALUE shoes_link_alloc(VALUE);
VALUE shoes_text_new(VALUE, VALUE, VALUE);
VALUE shoes_text_alloc(VALUE);
void shoes_text_mark(shoes_text *);
void shoes_textblock_mark(shoes_textblock *);
VALUE shoes_textblock_new(VALUE, VALUE, VALUE, VALUE, shoes_transform *);
VALUE shoes_textblock_alloc(VALUE);
VALUE shoes_textblock_get_top(VALUE);
VALUE shoes_textblock_get_left(VALUE);
VALUE shoes_textblock_get_width(VALUE);
VALUE shoes_textblock_get_height(VALUE);
VALUE shoes_textblock_set_cursor(VALUE, VALUE);
VALUE shoes_textblock_get_cursor(VALUE);
VALUE shoes_textblock_draw(VALUE, VALUE, VALUE);
VALUE shoes_textblock_motion(VALUE, int, int, char *);
VALUE shoes_textblock_send_click(VALUE, int, int, int, VALUE *);
void shoes_textblock_send_release(VALUE, int, int, int);
void shoes_http_mark(shoes_http_klass *);
VALUE shoes_http_new(VALUE, VALUE, VALUE);
VALUE shoes_http_alloc(VALUE);
VALUE shoes_http_threaded(VALUE, VALUE, VALUE);
int shoes_message_download(VALUE, void *);
int shoes_catch_message(unsigned int name, VALUE obj, void *data);
VALUE shoes_response_new(VALUE, int);
VALUE shoes_response_body(VALUE);
VALUE shoes_response_headers(VALUE);
VALUE shoes_response_status(VALUE);
VALUE shoes_p(VALUE, VALUE);
extern const double SHOES_PIM2, SHOES_PI, SHOES_RAD2PI, SHOES_HALFPI;
//
// shoes/image.c
//
typedef struct {
unsigned long status;
char *cachepath, *filepath, *uripath, *etag;
char hexdigest[42];
VALUE slot;
} shoes_image_download_event;
shoes_code shoes_load_imagesize(VALUE, int *, int *);
shoes_cached_image *shoes_cached_image_new(int, int, cairo_surface_t *);
shoes_cached_image *shoes_load_image(VALUE, VALUE);
unsigned char shoes_image_downloaded(shoes_image_download_event *);
#endif