8 http://www.newbreedsoftware.com/supertux/
13 #ifndef SUPERTUX_MENU_H
14 #define SUPERTUX_MENU_H
21 /* Kinds of menu items */
32 MN_HL /* horizontal line */
35 typedef struct menu_item_type
41 string_list_type* list;
46 menu_item_type* menu_item_create(MenuItemKind kind, char *text, int init_toggle, void* target_menu);
47 void menu_item_change_text (menu_item_type* pmenu_item, const char *text);
48 void menu_item_change_input(menu_item_type* pmenu_item, const char *text);
50 typedef struct menu_type
52 // center of the menu on the screen
64 void menu_init (menu_type* pmenu);
65 void menu_free (menu_type* pmenu);
66 void menu_additem(menu_type* pmenu, menu_item_type* pmenu_item);
67 menu_item_type* menu_additem(menu_type* pmenu, MenuItemKind kind, char *text, int init_toggle, void* target_menu);
68 void menu_action (menu_type* pmenu);
69 int menu_check (menu_type* pmenu);
70 void menu_draw (menu_type* pmenu);
71 void menu_set_current(menu_type* pmenu);
73 /* Action done on the menu */
75 MENU_ACTION_NONE = -1,
85 /* (global) menu variables */
86 extern MenuAction menuaction;
87 extern bool show_menu;
88 extern bool menu_change;
89 extern texture_type checkbox, checkbox_checked, back, arrow_left, arrow_right;
91 extern menu_type main_menu, game_menu, options_menu, highscore_menu, load_game_menu, save_game_menu;
92 extern menu_type* current_menu, * last_menu;
94 /* input implementation variables */
95 extern int delete_character;
96 extern char mn_input_char;
98 /* Reset the global menu variables */
99 void menu_reset(void);
101 /* "Calculate" and draw the menu */
102 void menu_process_current(void);
104 /* Check for a menu event */
105 void menu_event(SDL_keysym* keysym);
107 #endif /*SUPERTUX_MENU_H*/