comparison src/coord.c @ 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 164162781a7a
children 79e9edf4c00a
comparison
equal deleted inserted replaced
4:399517bf65dc 5:9c331ec9e210
2 * \file 2 * \file
3 * This file implements coordination transforming for containers. 3 * This file implements coordination transforming for containers.
4 */ 4 */
5 #include <stdio.h> 5 #include <stdio.h>
6 #include <string.h> 6 #include <string.h>
7 7 #include "mb_types.h"
8 typedef float co_aix;
9 /*! \brief A coordination system.
10 *
11 * It have a transform function defined by matrix to transform
12 * coordination from source space to target space.
13 * Source space is where the contained is drawed, and target space
14 * is where the coordination of parent container of the element
15 * represented by this coord object.
16 */
17 typedef struct coord {
18 int seq;
19 co_aix matrix[6];
20 co_aix aggr_matrix[6];
21 struct coord *parent;
22 struct coord *children, *sibling;
23 } coord_t;
24 8
25 /* To keep possibility of changing type of aix */ 9 /* To keep possibility of changing type of aix */
26 #define MUL(a, b) ((a) * (b)) 10 #define MUL(a, b) ((a) * (b))
27 #define ADD(a, b) ((a) + (b)) 11 #define ADD(a, b) ((a) + (b))
28 #define DIV(a, b) ((a) / (b)) 12 #define DIV(a, b) ((a) / (b))