Choco OS  V.0.16.9.0
Join to the chocolate world
oc_gui.h
Go to the documentation of this file.
1 
28 #ifndef INC_GUI_OC_GUI_H_
29 #define INC_GUI_OC_GUI_H_
30 
31 #include <oc_errors.h>
32 #include <oc_terminal.h>
33 #include <stdint.h>
34 
40 #define _________________________________________TYPES_SECTION______________________________________________________________________________
41 
44 typedef void * oC_Gui_Menu_t;
45 typedef uint8_t oC_Gui_MenuItemIndex_t;
46 
47 typedef struct
48 {
49  const char * Name;
50  const char * DetailedDescription;
52 
53 typedef enum
54 {
55  oC_Gui_MenuStyleType_Terminal ,
56  oC_Gui_MenuStyleType_Hd44780
57 } oC_Gui_MenuStyleType_t;
58 
59 typedef struct
60 {
61  oC_Gui_MenuStyleType_t StyleType;
62 
63  union
64  {
65  struct
66  {
67  oC_Terminal_Color_t BorderColor;
68  oC_Terminal_Color_t BackgroundColor;
69 
70  struct
71  {
72  oC_Terminal_Color_t ForegroundColor;
73  oC_Terminal_Color_t BackgroundColor;
74  } ActiveElement;
75 
76  struct
77  {
78  oC_Terminal_Color_t ForegroundColor;
79  oC_Terminal_Color_t BackgroundColor;
80  } NonActiveElement;
81 
82  struct
83  {
84  oC_Terminal_Color_t ForegroundColor;
85  oC_Terminal_Color_t BackgroundColor;
86  } TitleElement;
87  } TerminalStyle;
88  };
89 
91 
92 typedef enum
93 {
94  oC_Gui_MessageBoxType_Info ,
95  oC_Gui_MessageBoxType_Warning ,
96  oC_Gui_MessageBoxType_Error
97 } oC_Gui_MessageBoxType_t;
98 
99 typedef enum
100 {
101  oC_Gui_Button_Ok = (1<<0) ,
102  oC_Gui_Button_Cancel = (1<<1) ,
103  oC_Gui_Button_Next = (1<<2) ,
104  oC_Gui_Button_Previous = (1<<3) ,
105  oC_Gui_Button_Escape = (1<<4) ,
106  oC_Gui_Button_Details = (1<<5) ,
107  oC_Gui_Button_Restart = (1<<6) ,
108  oC_Gui_Button_Retry = (1<<7) ,
109  oC_Gui_Button_Skip = (1<<8) ,
110  oC_Gui_Button_Print = (1<<9) ,
111  oC_Gui_Button_TurnOn = (1<<10) ,
112  oC_Gui_Button_TurnOff = (1<<11) ,
113  oC_Gui_Button_Install = (1<<12)
114 } oC_Gui_Button_t;
115 
116 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
117 
124 #define _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
125 
128 extern oC_Gui_Menu_t oC_Gui_Menu_New ( const oC_Gui_MenuItem_t * MenuItems , uint32_t Count , const oC_Gui_MenuStyle_t * MenuStyle );
129 extern oC_ErrorCode_t oC_Gui_Menu_Delete ( oC_Gui_Menu_t * Menu );
130 extern oC_ErrorCode_t oC_Gui_Menu_Show ( oC_Gui_Menu_t Menu , uint32_t * outSelectedItemIndex );
131 
132 extern oC_ErrorCode_t oC_Gui_ShowMessageBox ( const char * Title , const char * Message , oC_Gui_MessageBoxType_t Type , oC_Gui_Button_t Buttons );
133 
134 #undef _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
135 
137 #endif /* INC_GUI_OC_GUI_H_ */
The file with interface for terminal handling.
oC_Terminal_Color_t
Definition: oc_terminal.h:48