comparison dox/first_program.h @ 106:74e2ffd50741

Tutorial
author Thinker K.F. Li <thinker@branda.to>
date Fri, 12 Sep 2008 02:14:27 +0800
parents
children 565b55508c8d
comparison
equal deleted inserted replaced
105:8d97455811a8 106:74e2ffd50741
1 /*! /page first_program Your First MadButterfly Program.
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
19 * - $(TOOLSDIR)/svg2code.py foo.svg foo.mb
20 * - m4 -I $(TOOLSDIR) mb_c_source.m4 foo.mb > foo.c
21 * - m4 -I $(TOOLSDIR) mb_c_header.m4 foo.mb > foo.h
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
27 * and initialize a 'foo' instance. A instance is released by calling
28 * foo_free().
29 */