annotate include/mb_so.h @ 431:bf1addb037b7

Add -s option to svg2code.py. Option -s is for sh_stext type. With this option, svg2code.py will generate code to using sh_stext type instead of sh_text for text nodes.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 29 Jul 2009 15:03:26 +0800
parents 6f63aa67ed83
children 586e50f82c1f
rev   line source
209
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 /*! \file
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
2 * \brief Define types for sprite shared objects.
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
3 *
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
4 * A sprite shared object includes definitions of multiple sprite factories.
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5 * Sprite factories are used to create sprites for MadButterfly.
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6 *
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
7 * \see http://en.wikipedia.org/wiki/Sprite_(computer_graphics)
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 */
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9 #ifndef __MB_SO_H_
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
10 #define __MB_SO_H_
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
11
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
12 /*! \brief Name of the variable that define contents in a shared object. */
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
13 #define MB_SPRITE_SO_SYM "mb_sprite_so_def"
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
14
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
15 typedef struct _mb_sprite_so mb_sprite_so_t;
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
16 typedef struct _sprite_factory sprite_factory_t;
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
17
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
18
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
19 /*! \brief Define content of a sprite shared object.
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
20 *
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
21 * The type of symbol with name, defined by \ref MB_SPRITE_SO_SYM, in
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
22 * a sprite shared object. It define content of a sprite object, a.k.a.
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
23 * an array of sprite factories (\ref sprite_factory_t).
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
24 */
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
25 struct _mb_sprite_so {
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
26 const char *soname;
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
27 int num_factories;
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
28 sprite_factory_t *factories;
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
29 };
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
30
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
31 /*! \brief Define a factory to create sprites.
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
32 */
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
33 struct _sprite_factory {
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
34 const char *name;
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
35 sprite_t *(*new)(coord_t*);
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
36 };
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
37
6f63aa67ed83 Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
38 #endif /* __MB_SO_H_ */