Prusa MINI Firmware overview
window_menu.h
Go to the documentation of this file.
1 // window_menu.h
2 
3 #ifndef _WINDOW_MENU_H
4 #define _WINDOW_MENU_H
5 
6 #include "window.h"
7 
9 
10 #pragma pack(push)
11 #pragma pack(1)
12 
13 typedef enum {
14  WI_LABEL = 0, // types - exclusive
19 
20  WI_DISABLED = 1 << 8, // flags - non exclusive
21  WI_HIDDEN = 1 << 9,
23 
24 //do I need label struct?
25 /*
26 typedef struct
27 {
28  int32_t value;
29  const void * options;
30 }WI_LABEL_t;
31 */
32 
33 //WI_SPIN
34 //where all values are divided by 1000
35 typedef struct
36 {
37  int32_t value;
38  const int32_t *range;
39 } WI_SPIN_t;
40 
41 //WI_SPIN_FL
42 typedef struct
43 {
44  float value;
45  const char *prt_format;
46  const float *range;
47 } WI_SPIN_FL_t;
48 
49 //WI_SWITCH | WI_SELECT
50 //array of char strings ended by NULL for array length variability.
51 //char * strings[3] = {"Low", "High", "Medium", NULL}
52 typedef struct
53 {
54  int32_t index;
55  const char **strings;
57 
58 typedef struct _window_menu_item_t {
59  char label[23];
60  uint16_t id_icon;
61  /**
62  * Type : WI_LABEL || WI_SPIN || WI_SWITCH || WI_SELECT
63  * visibility bit WI_DISABLED | WI_HIDDEN
64  */
65  uint16_t type;
66 
67  union {
71  };
73 
74 typedef struct _window_class_menu_t {
77 
78 typedef void(window_menu_items_t)(window_menu_t *pwindow_menu,
79  uint16_t index,
80  window_menu_item_t **ppitem,
81  void *data);
82 
83 typedef struct _window_menu_t {
92  int count;
93  int index;
94  int top_index;
97  void *data;
98  uint8_t src_event; // source event
99  void *src_param; // source event data
100 } window_menu_t;
101 
102 #pragma pack(pop)
103 
104 #ifdef __cplusplus
105 extern "C" {
106 #endif //__cplusplus
107 
109 
110 #ifdef __cplusplus
111 }
112 #endif //__cplusplus
113 
114 #endif //_WINDOW_MENU_H
WI_SPIN_FL_t::range
const float * range
Definition: window_menu.h:46
WI_SWITCH_SELECT_t::strings
const char ** strings
Definition: window_menu.h:55
_window_menu_t::alignment
uint8_t alignment
Definition: window_menu.h:91
_window_class_menu_t
Definition: window_menu.h:74
_font_t
Definition: guitypes.h:76
_window_class_menu_t::cls
window_class_t cls
Definition: window_menu.h:75
_window_menu_t::font
font_t * font
Definition: window_menu.h:88
window_item_type_t
window_item_type_t
Definition: window_menu.h:13
data
uint8_t data[8]
Definition: masstorage.h:49
_window_menu_t::data
void * data
Definition: window_menu.h:97
WI_SWITCH_SELECT_t
Definition: window_menu.h:52
WI_SPIN
Definition: window_menu.h:15
window_class_menu_t
struct _window_class_menu_t window_class_menu_t
WI_SPIN_t::range
const int32_t * range
Definition: window_menu.h:38
_window_menu_t::icon_rect
rect_ui16_t icon_rect
Definition: window_menu.h:90
_window_menu_t::color_text
color_t color_text
Definition: window_menu.h:86
_window_menu_item_t::wi_spin_fl
WI_SPIN_FL_t wi_spin_fl
Definition: window_menu.h:69
WI_HIDDEN
Definition: window_menu.h:21
WI_DISABLED
Definition: window_menu.h:20
_window_t
Definition: window.h:76
window_menu_t
struct _window_menu_t window_menu_t
Definition: window_menu.h:8
void
void
Definition: png.h:1083
window_menu_items_t
void() window_menu_items_t(window_menu_t *pwindow_menu, uint16_t index, window_menu_item_t **ppitem, void *data)
Definition: window_menu.h:78
WI_SWITCH
Definition: window_menu.h:16
WI_SPIN_t::value
int32_t value
Definition: window_menu.h:37
WI_SPIN_FL_t::value
float value
Definition: window_menu.h:44
_window_menu_t::mode
uint8_t mode
Definition: window_menu.h:95
_window_menu_t::padding
padding_ui8_t padding
Definition: window_menu.h:89
_padding_ui8_t
Definition: guitypes.h:86
window_class_menu
const window_class_menu_t window_class_menu
Definition: window_menu.c:319
_window_menu_t::src_event
uint8_t src_event
Definition: window_menu.h:98
WI_SPIN_FL_t::prt_format
const char * prt_format
Definition: window_menu.h:45
WI_SPIN_FL
Definition: window_menu.h:18
_window_menu_item_t::label
char label[23]
Definition: window_menu.h:59
_window_menu_t::menu_items
window_menu_items_t * menu_items
Definition: window_menu.h:96
_rect_ui16_t
Definition: guitypes.h:69
WI_LABEL
Definition: window_menu.h:14
_window_menu_item_t
Definition: window_menu.h:58
uint8_t
const uint8_t[]
Definition: 404_html.c:3
_window_class_t
Definition: window.h:67
_window_menu_t::color_back
color_t color_back
Definition: window_menu.h:85
_window_menu_t::color_disabled
color_t color_disabled
Definition: window_menu.h:87
_window_menu_item_t::type
uint16_t type
Definition: window_menu.h:65
_window_menu_t::index
int index
Definition: window_menu.h:93
_window_menu_t::src_param
void * src_param
Definition: window_menu.h:99
window.h
WI_SELECT
Definition: window_menu.h:17
WI_SPIN_FL_t
Definition: window_menu.h:42
WI_SWITCH_SELECT_t::index
int32_t index
Definition: window_menu.h:54
_window_menu_t
Definition: window_menu.h:83
color_t
uint32_t color_t
Definition: guitypes.h:62
_window_menu_item_t::id_icon
uint16_t id_icon
Definition: window_menu.h:60
_window_menu_t::top_index
int top_index
Definition: window_menu.h:94
_window_menu_item_t::wi_switch_select
WI_SWITCH_SELECT_t wi_switch_select
Definition: window_menu.h:70
WI_SPIN_t
Definition: window_menu.h:35
_window_menu_t::win
window_t win
Definition: window_menu.h:84
_window_menu_item_t::wi_spin
WI_SPIN_t wi_spin
Definition: window_menu.h:68
window_menu_item_t
struct _window_menu_item_t window_menu_item_t
_window_menu_t::count
int count
Definition: window_menu.h:92