Mercurial > MadButterfly
comparison src/shapes.h @ 30:e06a4a667ce2
Accept mouse/pointer event and hint the shape that the pointer is over.
- add find_shape_at_pos()
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Tue, 05 Aug 2008 12:40:45 +0800 |
parents | 19c603dd6ff9 |
children | d82749f77108 |
comparison
equal
deleted
inserted
replaced
29:f56c96b035a8 | 30:e06a4a667ce2 |
---|---|
7 /* Define a shape | 7 /* Define a shape |
8 * | 8 * |
9 * A shape must include | 9 * A shape must include |
10 * - *_new() and *_free() | 10 * - *_new() and *_free() |
11 * - *_transform() | 11 * - *_transform() |
12 * - *_draw() | |
12 * - *_fill() | 13 * - *_fill() |
13 * - *_stroke() | 14 * - *_stroke() |
14 * - struct of shape must include an shape_t as type of first member. | 15 * - struct of shape must include an shape_t as type of first member. |
15 */ | 16 */ |
16 | 17 |
18 /* TODO: remove *_fill() and *_stroke() */ | |
19 | |
17 extern void sh_path_free(shape_t *path); | 20 extern void sh_path_free(shape_t *path); |
18 extern shape_t *sh_path_new(char *data); | 21 extern shape_t *sh_path_new(char *data); |
19 extern void sh_path_transform(shape_t *shape); | 22 extern void sh_path_transform(shape_t *shape); |
23 extern void sh_path_draw(shape_t *shape, cairo_t *cr); | |
20 extern void sh_path_fill(shape_t *shape, cairo_t *cr); | 24 extern void sh_path_fill(shape_t *shape, cairo_t *cr); |
21 extern void sh_path_stroke(shape_t *shape, cairo_t *cr); | 25 extern void sh_path_stroke(shape_t *shape, cairo_t *cr); |
22 | 26 |
23 | 27 |
24 extern void sh_text_free(shape_t *text); | 28 extern void sh_text_free(shape_t *text); |
25 extern shape_t *sh_text_new(const char *txt, co_aix x, co_aix y, | 29 extern shape_t *sh_text_new(const char *txt, co_aix x, co_aix y, |
26 co_aix font_size, cairo_font_face_t *face); | 30 co_aix font_size, cairo_font_face_t *face); |
27 extern void sh_text_transform(shape_t *shape); | 31 extern void sh_text_transform(shape_t *shape); |
32 extern void sh_text_draw(shape_t *shape, cairo_t *cr); | |
28 extern void sh_text_fill(shape_t *shape, cairo_t *cr); | 33 extern void sh_text_fill(shape_t *shape, cairo_t *cr); |
29 extern void sh_text_stroke(shape_t *shape, cairo_t *cr); | 34 extern void sh_text_stroke(shape_t *shape, cairo_t *cr); |
30 | 35 |
31 | 36 |
32 #endif /* __SHAPES_H_ */ | 37 #endif /* __SHAPES_H_ */ |