6 void video_draw_box(int style, int attr, char *title, int separate, int x, int y, int w, int h);
7 void video_draw_text(int x, int y, int attr, char *text);
8 void video_save_rect(int x, int y, int w, int h, void *save_area, int clearchar, int clearattr);
9 void video_restore_rect(int x, int y, int w, int h, void *save_area);
13 #define MAX_MENU_OPTIONS 200
17 int used; /* flag if this entry is used */
18 int entry_x; /* Character column of the menu entry */
19 int entry_y; /* Character line of the entry */
20 int option_x; /* Character colum of the option (entry is same) */
23 option_data_t odata[MAX_MENU_OPTIONS];
25 int normal_attr = 0x0F;
26 int select_attr = 0x2F;
27 int disabled_attr = 0x07;
31 int menu_init (menu_t *root)
36 s = getenv("menu_normal");
37 if (s) normal_attr = atoi(s);
39 s = getenv("menu_select");
40 if (s) select_attr = atoi(s);
42 s = getenv("menu_disabled");
43 if (s) disabled_attr = atoi(s);
45 for (i=0; i<MAX_MENU_OPTIONS; i++) odata[i].used = 0;
50 option_data_t *menu_alloc_odata(void)
53 for (int i=0; i<MAX_MENU_OPTIONS; i++)
55 if (odata[i].used == 0) return &odata[i];
60 void menu_free_odata(option_data_t *odata)
65 void menu_layout (menu_t *menu)