annotate dox/first_program.h @ 1494:ac390af12152

Add comment and rename methods
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 03 May 2011 01:21:20 +0800
parents 6ce68c1f7405
children
rev   line source
108
565b55508c8d More dox
Thinker K.F. Li <thinker@branda.to>
parents: 106
diff changeset
1 /*! \page first_program Your First MadButterfly Program.
106
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
2 *
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
3 * MadButterfly use SVG as a media to adapt gap between GUI designers
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
4 * and application programmmers. Designers export their works with SVG
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5 * format. Then some ones, designers or programmers, assign IDs to SVG tags
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6 * that will be manipulated by application. For example, you have a menu
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
7 * that should be hidden at beginning. When user hit a button, the menu
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 * should be showed. So, we assign an ID to the group or other tags that
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9 * contain all elements in menu. The ID is the name of a object that
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
10 * application manipulate, hide and show it.
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
11 *
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
12 * After assigning IDs to tags, the file is translated by svg2code.py.
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
13 * Outputs of svg2code.py are M4 macro files. Conventional, foo.svg is
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
14 * translated a M4 file as foo.mb, using .mb as extension of file name.
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
15 * Macro files are translate to *.c and *.h files to link with application
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
16 * programs.
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
17 *
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
18 * For example, to translate foo.svg with steps
154
6ce68c1f7405 Tank can fire bullet.
Thinker K.F. Li <thinker@branda.to>
parents: 117
diff changeset
19 * - \$(PREFIX)/bin/svg2code.py foo.svg foo.mb
6ce68c1f7405 Tank can fire bullet.
Thinker K.F. Li <thinker@branda.to>
parents: 117
diff changeset
20 * - m4 -I \$(PREFIX)/share/mb mb_c_source.m4 foo.mb > foo.c
6ce68c1f7405 Tank can fire bullet.
Thinker K.F. Li <thinker@branda.to>
parents: 117
diff changeset
21 * - m4 -I \$(PREFIX)/share/mb mb_c_header.m4 foo.mb > foo.h
106
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
22 *
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
23 * foo.h declares a structure, named 'foo' and two functions,
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
24 * foo_new() and foo_free(). An instance of 'foo' holds all objects for
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
25 * foo.svg. One object, with specified ID as name, for each tag. If you
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
26 * don't assign one, a random one is picked. foo_new() is invoked to create
108
565b55508c8d More dox
Thinker K.F. Li <thinker@branda.to>
parents: 106
diff changeset
27 * and initialize a 'foo' instance. An instance is released by calling
106
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
28 * foo_free().
109
Thinker K.F. Li <thinker@branda.to>
parents: 108
diff changeset
29 *
117
Thinker K.F. Li <thinker@branda.to>
parents: 110
diff changeset
30 * \dontinclude examples/svg2code_ex/main.c
Thinker K.F. Li <thinker@branda.to>
parents: 110
diff changeset
31 * \skip main
Thinker K.F. Li <thinker@branda.to>
parents: 110
diff changeset
32 * \until }
106
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
33 */