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