# HG changeset patch # User Thinker K.F. Li # Date 1249544284 -28800 # Node ID 26c302b47de1a91d266125ec18e8d008f2aef7fc # Parent 58b6337fb3b2eb5f16623b05a9102c39e82a582b Change name of header files. diff -r 58b6337fb3b2 -r 26c302b47de1 examples/dynamic/hello.c --- a/examples/dynamic/hello.c Thu Aug 06 13:15:57 2009 +0800 +++ b/examples/dynamic/hello.c Thu Aug 06 15:38:04 2009 +0800 @@ -8,7 +8,7 @@ #include #include //#include "menu.h" -#include "mbapp.h" +#include "mb_af.h" mbaf_t *app; diff -r 58b6337fb3b2 -r 26c302b47de1 examples/dynamic/main.c --- a/examples/dynamic/main.c Thu Aug 06 13:15:57 2009 +0800 +++ b/examples/dynamic/main.c Thu Aug 06 15:38:04 2009 +0800 @@ -8,7 +8,7 @@ #include #include //#include "menu.h" -#include "mbapp.h" +#include "mb_af.h" diff -r 58b6337fb3b2 -r 26c302b47de1 examples/dynamic/mbbutton.c --- a/examples/dynamic/mbbutton.c Thu Aug 06 13:15:57 2009 +0800 +++ b/examples/dynamic/mbbutton.c Thu Aug 06 15:38:04 2009 +0800 @@ -2,7 +2,7 @@ #include #include #include -#include "mbapp.h" +#include "mb_af.h" diff -r 58b6337fb3b2 -r 26c302b47de1 examples/dynamic/text.c --- a/examples/dynamic/text.c Thu Aug 06 13:15:57 2009 +0800 +++ b/examples/dynamic/text.c Thu Aug 06 15:38:04 2009 +0800 @@ -8,7 +8,7 @@ #include #include //#include "menu.h" -#include "mbapp.h" +#include "m_af.h" mbaf_t *app; diff -r 58b6337fb3b2 -r 26c302b47de1 examples/menu/filebrowser.c --- a/examples/menu/filebrowser.c Thu Aug 06 13:15:57 2009 +0800 +++ b/examples/menu/filebrowser.c Thu Aug 06 15:38:04 2009 +0800 @@ -15,8 +15,8 @@ #include #include //#include "menu.h" -#include "mbapp.h" -#include +#include "mb_af.h" +#include diff -r 58b6337fb3b2 -r 26c302b47de1 examples/menu/main.c --- a/examples/menu/main.c Thu Aug 06 13:15:57 2009 +0800 +++ b/examples/menu/main.c Thu Aug 06 15:38:04 2009 +0800 @@ -14,8 +14,8 @@ #include #include //#include "menu.h" -#include "mbapp.h" -#include "animated_menu.h" +#include "mb_af.h" +#include "mb_ani_menu.h" diff -r 58b6337fb3b2 -r 26c302b47de1 include/Makefile.am --- a/include/Makefile.am Thu Aug 06 13:15:57 2009 +0800 +++ b/include/Makefile.am Thu Aug 06 15:38:04 2009 +0800 @@ -11,7 +11,7 @@ mb_prop.h \ mb_X_supp.h \ mb_img_ldr.h \ - mbapp.h \ - animated_menu.h \ + mb_af.h \ + mb_ani_menu.h \ mbbutton.h \ mb_so.h diff -r 58b6337fb3b2 -r 26c302b47de1 include/animated_menu.h --- a/include/animated_menu.h Thu Aug 06 13:15:57 2009 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -#ifndef __ANIMATED_MENU_H -#define __ANIMATED_MENU_H -typedef struct _mb_animated_menu { - char **titles; - int *menus_y; - int *items; - int top; - int cur; - int max; - int ready; - int speed; - mbaf_t *app; - mb_sprite_t *sprite; - mb_obj_t **objects; - mb_obj_t *lightbar; - void (*callback)(struct _mb_animated_menu *m, int sel); - void (*update_callback)(struct _mb_animated_menu *m, int sel); - mb_progm_t *progm; - X_kb_event_t pending_keys[16]; - int pending_pos, pending_last; -} mb_animated_menu_t; -/** \brief Create an instace of animated menu. - * - * The objectnames is used to extract symbols from the SVG file. - * ${objectnames}0 - ${objectnames}8 is the text object. - * ${objectnames}_lightbar is the lightbar. - * - */ -mb_animated_menu_t *mb_animated_menu_new(mbaf_t *app,mb_sprite_t *sp,char *objnames,char *menus[]); -void mb_animated_menu_set_speed(mb_animated_menu_t *m,int speed); -int mb_animated_menu_get_speed(mb_animated_menu_t *m); -void mb_animated_menu_set_callback(mb_animated_menu_t *m, void (*f)(mb_animated_menu_t *m, int sel)); -#endif diff -r 58b6337fb3b2 -r 26c302b47de1 include/mb_af.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/mb_af.h Thu Aug 06 15:38:04 2009 +0800 @@ -0,0 +1,23 @@ +#ifndef __APP_H +#define __APP_H + +typedef struct _mbapp mbaf_t; +struct _mbapp { + void *rt; + redraw_man_t *rdman; + mb_sprite_t *rootsprite; + mb_obj_t *root; + subject_t *kbevents; + void *private; +}; +mbaf_t *mbaf_init(const char *module, const char *module_dir); +void mbaf_set_data(mbaf_t *app,void *data); +mb_tman_t *mbaf_get_timer(mbaf_t *app); +void mbaf_loop(mbaf_t *app); +#define MBAF_DATA(app,type) ((type *) ((app)->private)) +#define MBAF_RDMAN(app) (((mbaf_t *) app)->rdman) +#define MBAF_KB_SUBJECT(app) ((app)->kbevents) + +#include "mbbutton.h" + +#endif /* __MBAF_H_ */ diff -r 58b6337fb3b2 -r 26c302b47de1 include/mb_ani_menu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/mb_ani_menu.h Thu Aug 06 15:38:04 2009 +0800 @@ -0,0 +1,33 @@ +#ifndef __ANIMATED_MENU_H +#define __ANIMATED_MENU_H +typedef struct _mb_animated_menu { + char **titles; + int *menus_y; + int *items; + int top; + int cur; + int max; + int ready; + int speed; + mbaf_t *app; + mb_sprite_t *sprite; + mb_obj_t **objects; + mb_obj_t *lightbar; + void (*callback)(struct _mb_animated_menu *m, int sel); + void (*update_callback)(struct _mb_animated_menu *m, int sel); + mb_progm_t *progm; + X_kb_event_t pending_keys[16]; + int pending_pos, pending_last; +} mb_animated_menu_t; +/** \brief Create an instace of animated menu. + * + * The objectnames is used to extract symbols from the SVG file. + * ${objectnames}0 - ${objectnames}8 is the text object. + * ${objectnames}_lightbar is the lightbar. + * + */ +mb_animated_menu_t *mb_animated_menu_new(mbaf_t *app,mb_sprite_t *sp,char *objnames,char *menus[]); +void mb_animated_menu_set_speed(mb_animated_menu_t *m,int speed); +int mb_animated_menu_get_speed(mb_animated_menu_t *m); +void mb_animated_menu_set_callback(mb_animated_menu_t *m, void (*f)(mb_animated_menu_t *m, int sel)); +#endif diff -r 58b6337fb3b2 -r 26c302b47de1 include/mbapp.h --- a/include/mbapp.h Thu Aug 06 13:15:57 2009 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -#ifndef __APP_H -#define __APP_H - -typedef struct _mbapp mbaf_t; -struct _mbapp { - void *rt; - redraw_man_t *rdman; - mb_sprite_t *rootsprite; - mb_obj_t *root; - subject_t *kbevents; - void *private; -}; -mbaf_t *mbaf_init(const char *module, const char *module_dir); -void mbaf_set_data(mbaf_t *app,void *data); -mb_tman_t *mbaf_get_timer(mbaf_t *app); -void mbaf_loop(mbaf_t *app); -#define MBAF_DATA(app,type) ((type *) ((app)->private)) -#define MBAF_RDMAN(app) (((mbaf_t *) app)->rdman) -#define MBAF_KB_SUBJECT(app) ((app)->kbevents) - -#include "mbbutton.h" - -#endif /* __MBAF_H_ */ diff -r 58b6337fb3b2 -r 26c302b47de1 inkscape/firefox/template/textmenu/app.c --- a/inkscape/firefox/template/textmenu/app.c Thu Aug 06 13:15:57 2009 +0800 +++ b/inkscape/firefox/template/textmenu/app.c Thu Aug 06 15:38:04 2009 +0800 @@ -1,7 +1,7 @@ #include #include -#include "mbapp.h" -#include "animated_menu.h" +#include "mb_af.h" +#include "mb_ani_menu.h" #include "%n.h" void myselect_callback(mb_animated_menu_t *m, int select) diff -r 58b6337fb3b2 -r 26c302b47de1 inkscape/firefox/template/textmenu/main.c --- a/inkscape/firefox/template/textmenu/main.c Thu Aug 06 13:15:57 2009 +0800 +++ b/inkscape/firefox/template/textmenu/main.c Thu Aug 06 15:38:04 2009 +0800 @@ -2,8 +2,8 @@ #include #include //#include "menu.h" -#include "mbapp.h" -#include "animated_menu.h" +#include "mb_af.h" +#include "mb_ani_menu.h" #include "%n.h" @@ -40,7 +40,7 @@ mb_obj_t *button; MyAppData data; - myApp = mbaf_init("list"); + myApp = mbaf_init("list", ""); mbaf_set_data(myApp,&data); _MyApp_InitContent(argc,argv); diff -r 58b6337fb3b2 -r 26c302b47de1 src/mbaf/animated_menu.c --- a/src/mbaf/animated_menu.c Thu Aug 06 13:15:57 2009 +0800 +++ b/src/mbaf/animated_menu.c Thu Aug 06 15:38:04 2009 +0800 @@ -2,8 +2,8 @@ #include #include //#include "menu.h" -#include "mbapp.h" -#include +#include "mb_af.h" +#include "mb_ani_menu.h" static void mb_animated_menu_update(mb_animated_menu_t *m); static void set_text(coord_t *g, char *text) { diff -r 58b6337fb3b2 -r 26c302b47de1 src/mbaf/mbapp.c --- a/src/mbaf/mbapp.c Thu Aug 06 13:15:57 2009 +0800 +++ b/src/mbaf/mbapp.c Thu Aug 06 15:38:04 2009 +0800 @@ -1,5 +1,5 @@ #include -#include +#include mbaf_t *mbaf_init(const char *module, const char *module_dir) { diff -r 58b6337fb3b2 -r 26c302b47de1 src/mbaf/mbbutton.c --- a/src/mbaf/mbbutton.c Thu Aug 06 13:15:57 2009 +0800 +++ b/src/mbaf/mbbutton.c Thu Aug 06 15:38:04 2009 +0800 @@ -2,7 +2,7 @@ #include #include #include -#include "mbapp.h" +#include "mb_af.h"