8 /* ncurses doesn't support multiline menu items,
9 * so i wrote my own menu lib */
25 typedef struct Menu Menu;
26 typedef struct MenuItem MenuItem;
28 extern MenuItem* create_menuitem(char* title);
30 extern Menu* create_menu(char* menu_name, MenuItem** item_list);
32 extern WINDOW* get_menu_win(Menu* menu);
33 extern MenuItem* get_menu_item(Menu* menu, int index);
34 extern MenuItem** get_menu_itemlist(Menu* menu);
35 extern int get_selected_item(Menu* menu); // rename this to selected_index or sm
36 extern MenuItem* get_selected_menuitem(Menu* menu);
37 extern bool get_menu_focused(Menu* menu);
38 extern int get_menu_length(Menu* menu);
39 extern char* get_menu_name(Menu* menu);
40 extern void* get_menu_userdata(Menu* menu);
41 extern char* get_menuitem_title(MenuItem* menuitem);
42 extern char* get_menuitem_descrip(MenuItem* menuitem);
43 extern void* get_menuitem_userdata(MenuItem* menuitem);
45 extern int set_menu_win(Menu* menu, WINDOW* win);
46 extern int set_selected_item(Menu* menu, int selected_item);
47 extern int set_menu_focus(Menu* menu, bool focus);
48 extern int set_menu_userdata(Menu* menu, void* userdata);
49 extern int set_menu_renderitem(Menu* menu, void (*render_item)(Menu*, int, int));
50 extern int set_menu_itemheight(Menu* menu, int (*item_height)(MenuItem*));
51 extern int set_menuitem_title(MenuItem* menuitem, char* title);
52 extern int set_menuitem_descrip(MenuItem* menuitem, char* descrip);
53 extern int set_menuitem_userdata(MenuItem* menuitem, void* userdata);
55 extern int insert_item(Menu* menu, MenuItem* menuitem, int index);
56 extern int delete_item(Menu* menu, int index);
58 extern int menu_driver(Menu* menu, MenuAction action);
60 extern int render_menu(Menu* menu);
62 extern int free_menu(Menu* menu);