annotate src/shapes.h @ 27:19c603dd6ff9

Add text shape.
author Thinker K.F. Li <thinker@branda.to>
date Mon, 04 Aug 2008 10:10:47 +0800
parents 8fcf2d878ecd
children e06a4a667ce2
rev   line source
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 #ifndef __SHAPES_H_
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
2 #define __SHAPES_H_
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
3
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents: 5
diff changeset
4 #include <cairo.h>
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5 #include "mb_types.h"
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6
27
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
7 /* Define a shape
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
8 *
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
9 * A shape must include
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
10 * - *_new() and *_free()
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
11 * - *_transform()
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
12 * - *_fill()
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
13 * - *_stroke()
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
14 * - struct of shape must include an shape_t as type of first member.
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
15 */
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
16
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
17 extern void sh_path_free(shape_t *path);
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
18 extern shape_t *sh_path_new(char *data);
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents: 5
diff changeset
19 extern void sh_path_transform(shape_t *shape);
20
74d3d5dc9aaa rename XXX_draw() to XXX_fill()
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
20 extern void sh_path_fill(shape_t *shape, cairo_t *cr);
22
8fcf2d878ecd shapes with stroke
Thinker K.F. Li <thinker@branda.to>
parents: 20
diff changeset
21 extern void sh_path_stroke(shape_t *shape, cairo_t *cr);
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
22
27
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
23
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
24 extern void sh_text_free(shape_t *text);
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
25 extern shape_t *sh_text_new(const char *txt, co_aix x, co_aix y,
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
26 co_aix font_size, cairo_font_face_t *face);
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
27 extern void sh_text_transform(shape_t *shape);
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
28 extern void sh_text_fill(shape_t *shape, cairo_t *cr);
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
29 extern void sh_text_stroke(shape_t *shape, cairo_t *cr);
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
30
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
31
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
32 #endif /* __SHAPES_H_ */