Mercurial > MadButterfly
annotate examples/dynamic/mbapp.c @ 269:c96f38ad4bb6
Fix mis-behavior of translate_path_data() on arc.
- Arc in a path in svg2code_ex is not showed.
- translate_path_data() in svg2code.py was modified for calling
binary version new method for path shape.
- rdman_shape_path_new_from_binary()
- Code to translate path data does not handle arc in a right way.
- Copy calc_center_and_x_aix() from shape_path.c to svg2code.py and
change name _calc_ellipse_of_arc()
- _calc_ellipse_of_arc() handle arc data for translate_path_data()
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sun, 25 Jan 2009 00:20:34 +0800 |
parents | ab8284c8dcee |
children | 248a40d51473 |
rev | line source |
---|---|
247 | 1 #include <mb.h> |
2 #include <mbapp.h> | |
3 MBApp *MBApp_Init(char *module) | |
4 { | |
5 MBApp *app = (MBApp *) malloc(sizeof(MBApp)); | |
6 X_MB_runtime_t *rt; | |
7 | |
8 rt = X_MB_new(":0.0", 800, 600); | |
9 | |
10 app->rt = rt; | |
11 app->rdman = X_MB_rdman(rt); | |
12 app->rootsprite= sprite_load(module,app->rdman, app->rdman->root_coord); | |
249
ab8284c8dcee
* Add loopback reference from rdman to the backend. This is only required when we need to acquire the tman for the animation. This is not a reasonable arrangement since the animation should be backend transparent. We should not touch the backend directly from the animation. We should relocate the tman to the rdman.
wycc
parents:
247
diff
changeset
|
13 rdman_attach_backend(app->rdman, rt); |
247 | 14 return app; |
15 } | |
16 | |
17 void MBApp_setData(MBApp *app,void *data) | |
18 { | |
19 app->private = (void *) data; | |
20 } | |
21 | |
22 mb_tman_t *MBApp_getTimer(MBApp *app) | |
23 { | |
24 return X_MB_tman(app->rt); | |
25 } | |
26 | |
27 void MBApp_loop(MBApp *en) | |
28 { | |
29 /* | |
30 * Start handle connections, includes one to X server. | |
31 * User start to interact with the application. | |
32 */ | |
33 X_MB_handle_connection(en->rt); | |
34 | |
35 /* | |
36 * Clean | |
37 */ | |
38 X_MB_free(en->rt); | |
39 free(en); | |
40 } |