5 #include "include/config.h"
7 /// a single submenu item
8 typedef struct submenu_item
{
9 /// Icon used for rendering of this item
15 /// item description in localized form (used if value is not negative)
18 /// item id (MUST BE VALID, we assert it is != -1 to optimize rendering)
25 typedef struct submenu_list
{
26 struct submenu_item item
;
28 struct submenu_list
*prev
, *next
;
31 typedef struct menu_hint_item
{
35 struct menu_hint_item
*next
;
38 /// a single menu item. Linked list impl (for the ease of rendering)
39 typedef struct menu_item
{
40 /// Icon used for rendering of this item
46 /// item description in localised form (used if value is not negative)
51 /// submenu, selection and page start (only used in static mode)
52 struct submenu_list
*submenu
, *current
, *pagestart
;
56 void (*refresh
)(struct menu_item
*curMenu
);
58 void (*execCross
)(struct menu_item
*curMenu
);
60 void (*execTriangle
)(struct menu_item
*curMenu
);
62 void (*execCircle
)(struct menu_item
*curMenu
);
64 void (*execSquare
)(struct menu_item
*curMenu
);
67 struct menu_hint_item
*hints
;
70 typedef struct menu_list
{
71 struct menu_item
*item
;
73 struct menu_list
*prev
, *next
;
79 void menuAppendItem(menu_item_t
* item
);
81 void submenuRebuildCache(submenu_list_t
* submenu
);
82 submenu_list_t
* submenuAppendItem(submenu_list_t
** submenu
, int icon_id
, char *text
, int id
, int text_id
);
83 void submenuRemoveItem(submenu_list_t
** submenu
, int id
);
84 void submenuDestroy(submenu_list_t
** submenu
);
85 void submenuSort(submenu_list_t
** submenu
);
87 char *submenuItemGetText(submenu_item_t
* it
);
88 char *menuItemGetText(menu_item_t
* it
);
89 config_set_t
* menuLoadConfig();
90 void menuSaveConfig();
92 void menuRenderMain();
93 void menuRenderMenu();
94 void menuRenderInfo();
95 void menuHandleInputMain();
96 void menuHandleInputMenu();
97 void menuHandleInputInfo();
99 // Sets the selected item if it is found in the menu list
100 void menuSetSelectedItem(menu_item_t
*item
);
102 void menuAddHint(menu_item_t
*menu
, int text_id
, int icon_id
);
103 void menuRemoveHints(menu_item_t
*menu
);