-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmenu.h
49 lines (35 loc) · 1.04 KB
/
menu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef MENU_INCLUDED
#define MENU_INCLUDED
typedef struct menu menu;
struct menu{
char *title;
char **items;
unsigned int num_items;
unsigned int current_choice;
unsigned int width;
unsigned char color;
unsigned char select_color;
unsigned char selected;
WINDOW *win;
};
typedef struct text_entry text_entry;
struct text_entry{
char *title;
unsigned char cursor_pos;
unsigned int width;
unsigned char color;
unsigned char select_color;
unsigned char done;
WINDOW *win;
};
menu create_menu(char *title, char **items, unsigned int num_items, unsigned char color, unsigned char select_color);
text_entry create_text_entry(char *title, unsigned char color, unsigned char select_color);
void free_menu(menu m);
void free_text_entry(text_entry t);
void render_menu(menu m);
void render_text_entry(text_entry t, char *buffer);
void do_menu(menu *m);
void do_text_entry(text_entry *t, char *buffer, unsigned int buffer_size);
void iterate_menu(menu *m);
void iterate_text_entry(text_entry *t, char *buffer, unsigned int buffer_size);
#endif