annotate tools/mb_c_header.m4 @ 795:46a4cd4d382b

Remove dependent on system time to gain frame rate Date.now() would read system time. It is ineffeciency in for some implementation. To gain frame rate, we should rely on accuration of setInterval().
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 31 Aug 2010 10:04:15 +0800
parents bf1addb037b7
children
rev   line source
62
7d976d925431 Generate C header files for SVG files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 changequote(`[', `]')dnl
63
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
2 divert([-1])
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
3
333
bdf36a26e420 Make generated code clean.
Thinker K.F. Li <thinker@branda.to>
parents: 280
diff changeset
4 define([ADD_LINEAR_PAINT],[
bdf36a26e420 Make generated code clean.
Thinker K.F. Li <thinker@branda.to>
parents: 280
diff changeset
5 [ paint_t *$1;
63
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
6 ]])
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
7
333
bdf36a26e420 Make generated code clean.
Thinker K.F. Li <thinker@branda.to>
parents: 280
diff changeset
8 define([ADD_RADIAL_PAINT],[
bdf36a26e420 Make generated code clean.
Thinker K.F. Li <thinker@branda.to>
parents: 280
diff changeset
9 [ paint_t *$1;
63
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
10 ]])
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
11 define([ADD_PATH],[
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
12 [ shape_t *$1;
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
13 ]])
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
14 define([ADD_RECT],[
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
15 [ shape_t *$1;
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
16 ]])
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
17 define([ADD_COORD],[
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
18 [ coord_t *$1;
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
19 ]])
83
ea758bb3bbe2 example
Thinker K.F. Li <thinker@branda.to>
parents: 81
diff changeset
20 define([ADD_TEXT],[
ea758bb3bbe2 example
Thinker K.F. Li <thinker@branda.to>
parents: 81
diff changeset
21 [ shape_t *$1;
ea758bb3bbe2 example
Thinker K.F. Li <thinker@branda.to>
parents: 81
diff changeset
22 ]])
431
bf1addb037b7 Add -s option to svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
23 define([ADD_STEXT],[
bf1addb037b7 Add -s option to svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
24 [ shape_t *$1;
bf1addb037b7 Add -s option to svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
25 int $1_style_blks_num;
bf1addb037b7 Add -s option to svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
26 mb_style_blk_t *$1_style_blks;
bf1addb037b7 Add -s option to svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
27 ]])
260
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
28 define([ADD_IMAGE],[[
356
3e84458968ec Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents: 333
diff changeset
29 paint_t *$1_paint_img;
260
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
30 shape_t *$1;
257
50d253d0fcba Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents: 241
diff changeset
31 ]])
278
a90fd749af82 Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents: 241
diff changeset
32 define([PANGO_BEGIN_TEXT],[
a90fd749af82 Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents: 241
diff changeset
33 [ shape_t *$1;
a90fd749af82 Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents: 241
diff changeset
34 ]])
333
bdf36a26e420 Make generated code clean.
Thinker K.F. Li <thinker@branda.to>
parents: 280
diff changeset
35 define([PANGO_END_TEXT],[])
278
a90fd749af82 Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents: 241
diff changeset
36 define([PANGO_SIZE],[])
a90fd749af82 Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents: 241
diff changeset
37 define([PANGO_STYLE],[])
a90fd749af82 Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents: 241
diff changeset
38 define([PANGO_WEIGHT],[])
a90fd749af82 Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents: 241
diff changeset
39 define([PANGO_FAMILY],[])
63
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
40 define([COLOR_STOP],[ ])
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
41
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 69
diff changeset
42 define([REF_STOPS_RADIAL],)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 69
diff changeset
43 define([REF_STOPS_LINEAR],)
333
bdf36a26e420 Make generated code clean.
Thinker K.F. Li <thinker@branda.to>
parents: 280
diff changeset
44 define([FILL_SHAPE],[
bdf36a26e420 Make generated code clean.
Thinker K.F. Li <thinker@branda.to>
parents: 280
diff changeset
45 [ paint_t *$1_fill;
64
c668c5c3ceae M4 macro for C binding.
Thinker K.F. Li <thinker@branda.to>
parents: 63
diff changeset
46 ]])
333
bdf36a26e420 Make generated code clean.
Thinker K.F. Li <thinker@branda.to>
parents: 280
diff changeset
47 define([STROKE_SHAPE],[
bdf36a26e420 Make generated code clean.
Thinker K.F. Li <thinker@branda.to>
parents: 280
diff changeset
48 [ paint_t *$1_stroke;
64
c668c5c3ceae M4 macro for C binding.
Thinker K.F. Li <thinker@branda.to>
parents: 63
diff changeset
49 ]])
63
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
50 define([FILL_SHAPE_WITH_PAINT],)
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
51 define([STROKE_SHAPE_WITH_PAINT],)
80
e548221c04eb svg2code.py support stroke
Thinker K.F. Li <thinker@branda.to>
parents: 78
diff changeset
52 define([STROKE_WIDTH],)
81
13fdf205047b Hide shapes and groups
Thinker K.F. Li <thinker@branda.to>
parents: 80
diff changeset
53 define([GROUP_HIDE],)
13fdf205047b Hide shapes and groups
Thinker K.F. Li <thinker@branda.to>
parents: 80
diff changeset
54 define([PATH_HIDE],)
13fdf205047b Hide shapes and groups
Thinker K.F. Li <thinker@branda.to>
parents: 80
diff changeset
55 define([RECT_HIDE],)
84
42698de1f653 Support translate() function for transform attribute of 'g' tag.
Thinker K.F. Li <thinker@branda.to>
parents: 83
diff changeset
56 define([COORD_TRANSLATE],)
85
9b4a02bcaeb1 matrix() function in transform attribute of group and shapes
Thinker K.F. Li <thinker@branda.to>
parents: 84
diff changeset
57 define([COORD_MATRIX],)
100
1a1dda98730c Fix the bug of order of cross & inner product of vectors
Thinker K.F. Li <thinker@branda.to>
parents: 85
diff changeset
58 define([SHAPE_TRANSLATE],)
85
9b4a02bcaeb1 matrix() function in transform attribute of group and shapes
Thinker K.F. Li <thinker@branda.to>
parents: 84
diff changeset
59 define([SHAPE_MATRIX],)
431
bf1addb037b7 Add -s option to svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
60 define([STYLE_BLOCK],[])
210
3fadd2f2742e M4 macros to generate code for dynamic loading.
Thinker K.F. Li <thinker@branda.to>
parents: 154
diff changeset
61 define([ADD_SYMBOL],)
241
104d83378582 Add scene support in svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 210
diff changeset
62 define([SCENE])
63
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
63
62
7d976d925431 Generate C header files for SVG files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
64 define([MADBUTTERFLY],[dnl
7d976d925431 Generate C header files for SVG files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
65 [#ifndef __$1_H_
67
3f2872a1a2fe clear objects in *_free() for generated code
Thinker K.F. Li <thinker@branda.to>
parents: 64
diff changeset
66 #define __$1_H_
62
7d976d925431 Generate C header files for SVG files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
67
67
3f2872a1a2fe clear objects in *_free() for generated code
Thinker K.F. Li <thinker@branda.to>
parents: 64
diff changeset
68 typedef struct $1 $1_t;
62
7d976d925431 Generate C header files for SVG files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
69
67
3f2872a1a2fe clear objects in *_free() for generated code
Thinker K.F. Li <thinker@branda.to>
parents: 64
diff changeset
70 struct $1 {
210
3fadd2f2742e M4 macros to generate code for dynamic loading.
Thinker K.F. Li <thinker@branda.to>
parents: 154
diff changeset
71 mb_sprite_lsym_t lsym;
154
6ce68c1f7405 Tank can fire bullet.
Thinker K.F. Li <thinker@branda.to>
parents: 130
diff changeset
72 redraw_man_t *rdman;
241
104d83378582 Add scene support in svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 210
diff changeset
73 const int *last_scene;
67
3f2872a1a2fe clear objects in *_free() for generated code
Thinker K.F. Li <thinker@branda.to>
parents: 64
diff changeset
74 coord_t *root_coord;]
63
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
75 $2[]dnl
67
3f2872a1a2fe clear objects in *_free() for generated code
Thinker K.F. Li <thinker@branda.to>
parents: 64
diff changeset
76 [};
62
7d976d925431 Generate C header files for SVG files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
77
130
3a4d6179e6a9 change mb_c_source.m4 and mb_c_header.m4 to specify parent for SVG object
Thinker K.F. Li <thinker@branda.to>
parents: 100
diff changeset
78 extern $1_t *$1_new(redraw_man_t *rdman, coord_t *parent_coord);
67
3f2872a1a2fe clear objects in *_free() for generated code
Thinker K.F. Li <thinker@branda.to>
parents: 64
diff changeset
79 extern void $1_free($1_t *obj);
3f2872a1a2fe clear objects in *_free() for generated code
Thinker K.F. Li <thinker@branda.to>
parents: 64
diff changeset
80
3f2872a1a2fe clear objects in *_free() for generated code
Thinker K.F. Li <thinker@branda.to>
parents: 64
diff changeset
81 #endif /* __$1_H_ */]
63
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
82 ])
f4b792afa74e m4 translator
Thinker K.F. Li <thinker@branda.to>
parents: 62
diff changeset
83 divert[]dnl