diff src/mb_types.h @ 5:9c331ec9e210

SVG path is partially supported
author Thinker K.F. Li <thinker@branda.to>
date Sat, 26 Jul 2008 01:37:35 +0800
parents
children 7cfecdce94cc
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mb_types.h	Sat Jul 26 01:37:35 2008 +0800
@@ -0,0 +1,34 @@
+#ifndef __MB_TYPES_H_
+#define __MB_TYPES_H_
+
+typedef float co_aix;
+
+/*! \brief A coordination system.
+ *
+ * It have a transform function defined by matrix to transform
+ * coordination from source space to target space.
+ * Source space is where the contained is drawed, and target space
+ * is where the coordination of parent container of the element
+ * represented by this coord object.
+ */
+typedef struct _coord {
+    int seq;
+    co_aix matrix[6];
+    co_aix aggr_matrix[6];
+    struct _coord *parent;
+    struct _coord *children, *sibling;
+} coord_t;
+
+
+typedef struct _geo geo_t;
+typedef struct _shape {
+    int sh_type;
+    geo_t *geo;
+} shape_t;
+
+enum { SHT_UNKNOW, SHT_PATH, SHT_TEXT };
+
+extern void coord_init(coord_t *co, coord_t *parent);
+extern void coord_trans_pos(coord_t *co, co_aix *x, co_aix *y);
+
+#endif /* __MB_TYPES_H_ */