Mercurial > MadButterfly
changeset 227:a6e559fb76d7
Add dynamic loading function for sprite
author | wycc |
---|---|
date | Wed, 17 Dec 2008 08:10:51 +0800 |
parents | b24d7889cbda |
children | 25bc0e753b88 |
files | examples/dynamic/main.c include/mb_redraw_man.h src/Makefile.am |
diffstat | 3 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/dynamic/main.c Tue Dec 16 21:24:26 2008 +0800 +++ b/examples/dynamic/main.c Wed Dec 17 08:10:51 2008 +0800 @@ -27,6 +27,7 @@ typedef struct _mb_button { + mb_obj_t obj; engine_t *en; coord_t *root; coord_t *active;
--- a/include/mb_redraw_man.h Tue Dec 16 21:24:26 2008 +0800 +++ b/include/mb_redraw_man.h Wed Dec 17 08:10:51 2008 +0800 @@ -168,5 +168,17 @@ #define rdman_get_redraw_subject(rdman) ((rdman)->redraw) #define rdman_get_root(rdman) ((rdman)->root_coord) +/*! \brief Load sprite dymanicly from the shared object module. + * + * The search path can be changed by sprite_set_search_path. The name can have a relative path in the front of it. + * This function will search the object in the current working directory and then search the system search path. + * + */ +mb_sprite_t *sprite_load(const char *name, redraw_man_t *rdman, coord_t *root); + +/*! \brief Set the search path of dymanic object loading. + * + */ +void sprite_set_search_path(char *path); #endif /* __REDRAW_MAN_H_ */
--- a/src/Makefile.am Tue Dec 16 21:24:26 2008 +0800 +++ b/src/Makefile.am Wed Dec 17 08:10:51 2008 +0800 @@ -7,7 +7,7 @@ libmbfly_la_SOURCES = animate.c chgcolor.c coord.c event.c geo.c \ observer.c paint.c redraw_man.c rotate.c shape_path.c \ shape_rect.c shape_text.c shift.c subtree_free.c timer.c \ - timertool.c tools.c visibility.c X_supp.c prop.c + timertool.c tools.c visibility.c X_supp.c prop.c sprite.c libmbfly_la_CPPFLAGS = @cairo_CFLAGS@ libmbfly_la_LDFLAGS = @cairo_LIBS@