diff 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
line wrap: on
line diff
--- a/src/shapes.h	Sun Aug 03 13:04:55 2008 +0800
+++ b/src/shapes.h	Mon Aug 04 10:10:47 2008 +0800
@@ -4,10 +4,29 @@
 #include <cairo.h>
 #include "mb_types.h"
 
+/* Define a shape
+ *
+ * A shape must include
+ * - *_new() and *_free()
+ * - *_transform()
+ * - *_fill()
+ * - *_stroke()
+ * - struct of shape must include an shape_t as type of first member.
+ */
+
 extern void sh_path_free(shape_t *path);
 extern shape_t *sh_path_new(char *data);
 extern void sh_path_transform(shape_t *shape);
 extern void sh_path_fill(shape_t *shape, cairo_t *cr);
 extern void sh_path_stroke(shape_t *shape, cairo_t *cr);
 
+
+extern void sh_text_free(shape_t *text);
+extern shape_t *sh_text_new(const char *txt, co_aix x, co_aix y,
+			    co_aix font_size, cairo_font_face_t *face);
+extern void sh_text_transform(shape_t *shape);
+extern void sh_text_fill(shape_t *shape, cairo_t *cr);
+extern void sh_text_stroke(shape_t *shape, cairo_t *cr);
+
+
 #endif /* __SHAPES_H_ */