annotate dox/first_program.h @ 109:703ab76aa8a5

-
author Thinker K.F. Li <thinker@branda.to>
date Fri, 12 Sep 2008 14:00:02 +0800
parents 565b55508c8d
children c14cb6d12030
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
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
19 * - $(TOOLSDIR)/svg2code.py foo.svg foo.mb
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
20 * - m4 -I $(TOOLSDIR) mb_c_source.m4 foo.mb > foo.c
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
21 * - m4 -I $(TOOLSDIR) mb_c_header.m4 foo.mb > foo.h
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 *
Thinker K.F. Li <thinker@branda.to>
parents: 108
diff changeset
30 * examples/svg2code_ex/ is a simple example.
106
74e2ffd50741 Tutorial
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
31 */