X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=headers%2Fmenu.h;h=b1ef7ee2210a0dc21dcc6b297c163e753a718b6f;hb=676735938747a951747af87ce2e6789553dc83b2;hp=e678c1ec8eff5a586c1d4968ad4a56dec7c622b3;hpb=ef44630f65b5f9238efd8555cc8c5fb5bbf97ea1;p=taskasaur.git diff --git a/headers/menu.h b/headers/menu.h index e678c1e..b1ef7ee 100644 --- a/headers/menu.h +++ b/headers/menu.h @@ -1,9 +1,33 @@ + +#ifndef __MENU_H__ +#define __MENU_H__ + /* ncurses doesn't support multiline menu items, * so i wrote my own menu lib */ +typedef enum { + MENU_UP = 0, + MENU_DOWN, + MENU_TOP, + MENU_BOTTOM, + MENU_MOVE_UP, + MENU_MOVE_DOWN, + MENU_DELETE +} MenuAction; + typedef struct Menu Menu; typedef struct MenuItem MenuItem; -extern Menu* create_menu(MenuItem* item_list); -extern int set_menu_items(Menu* menu, MenuItem* item_list); +extern MenuItem* create_menuitem(char* contents); + +extern Menu* create_menu(MenuItem** item_list); +extern int set_menu_win(Menu* menu, WINDOW* win); extern MenuItem* get_menu_items(Menu* menu); + +extern int menu_driver(Menu* menu, MenuAction action); + +extern int render_menu(Menu* menu); + +extern int free_menu(Menu* menu); + +#endif