Navit SVN

/work/compile/navit/src/navit/menu.h

00001 
00020 #ifndef NAVIT_MENU_H
00021 #define NAVIT_MENU_H
00022 
00023 enum menu_type {
00024         menu_type_submenu,
00025         menu_type_menu,
00026         menu_type_toggle,
00027 };
00028 
00029 struct container;
00030 struct menu;
00031 struct callback;
00032 
00033 struct menu_methods {
00034         struct menu_priv *(*add)(struct menu_priv *menu, struct menu_methods *meth, char *name, enum menu_type type, struct callback *cb);
00035         void (*set_toggle)(struct menu_priv *menu, int active);
00036         int (*get_toggle)(struct menu_priv *menu);
00037         void (*popup)(struct menu_priv *menu);
00038 };
00039 
00040 struct menu {
00041         struct menu_priv *priv;
00042         struct menu_methods meth;
00043 };
00044 
00045 /* prototypes */
00046 struct menu *menu_add(struct menu *menu, char *name, enum menu_type type, struct callback *cb);
00047 void menu_popup(struct menu *menu);
00048 /* end of prototypes */
00049 #endif