| 1 | #ifndef GUI_H |
|---|
| 2 | #define GUI_H |
|---|
| 3 | |
|---|
| 4 | typedef unsigned int coord; |
|---|
| 5 | typedef unsigned short color; |
|---|
| 6 | |
|---|
| 7 | #define MAKE_COLOR(bg, fg) ((color)((((char)(bg))<<8)|((char)(fg)))) |
|---|
| 8 | |
|---|
| 9 | // Don't delete or re-order entries unless guiHandlers (gui.c) table is updated to match |
|---|
| 10 | enum Gui_Mode_ { |
|---|
| 11 | GUI_MODE_NONE = 0, |
|---|
| 12 | GUI_MODE_ALT, |
|---|
| 13 | GUI_MODE_MENU, |
|---|
| 14 | GUI_MODE_MBOX, |
|---|
| 15 | GUI_MODE_OSD, |
|---|
| 16 | GUI_MODE_COUNT |
|---|
| 17 | }; |
|---|
| 18 | |
|---|
| 19 | typedef unsigned int gui_mode_t; |
|---|
| 20 | |
|---|
| 21 | #define GUI_MODE_MAGICNUM 0xd36c1559 |
|---|
| 22 | |
|---|
| 23 | // Specific behaviour of gui mode |
|---|
| 24 | #define GUI_MODE_FLAG_NODRAWRESTORE 1 |
|---|
| 25 | #define GUI_MODE_FLAG_NORESTORE_ON_SWITCH 2 |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | // Values (bit-flag) for gui_draw argument |
|---|
| 29 | #define GUI_REDRAWFLAG_ERASEGUARD 1 |
|---|
| 30 | #define GUI_REDRAWFLAG_MODE_WAS_CHANGED 2 |
|---|
| 31 | #define GUI_REDRAWFLAG_DRAW_RESTORED 4 |
|---|
| 32 | |
|---|
| 33 | // Structure to store gui redraw and kbd process handlers for each mode |
|---|
| 34 | typedef struct |
|---|
| 35 | { |
|---|
| 36 | void (*redraw)(int); // Called to redraw screen |
|---|
| 37 | void (*kbd_process)(void); // Main button handler for mode |
|---|
| 38 | void (*kbd_process_menu_btn)(void); // Menu button handler for mode |
|---|
| 39 | int flags; |
|---|
| 40 | unsigned int magicnum; // Safety check for modules |
|---|
| 41 | } gui_handler; |
|---|
| 42 | |
|---|
| 43 | void gui_default_kbd_process_menu_btn(); |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | extern void gui_redraw(); |
|---|
| 47 | extern void gui_force_restore(); |
|---|
| 48 | |
|---|
| 49 | extern void draw_pixel(coord x, coord y, color cl); |
|---|
| 50 | |
|---|
| 51 | extern gui_mode_t gui_get_mode(); |
|---|
| 52 | extern void gui_set_mode(gui_mode_t mode); |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | #ifdef OPT_SCRIPTING |
|---|
| 57 | extern void gui_update_script_submenu(); |
|---|
| 58 | #endif |
|---|
| 59 | |
|---|
| 60 | #endif |
|---|