Prusa MINI Firmware overview
window_header.h
Go to the documentation of this file.
1 /*
2  * window_header.h
3  *
4  * Created on: 19. 7. 2019
5  * Author: mcbig
6  */
7 
8 #ifndef WINDOW_HEADER_H_
9 #define WINDOW_HEADER_H_
10 
11 #include "gui.h"
12 #include "marlin_events.h"
13 
14 typedef enum {
19 
20 typedef enum {
21  HEADER_ICON_USB, // must be first!
24  // for next icon, update HEADER_ICON_COUNT define !
26 
27 #define HEADER_ICON_COUNT HEADER_ICON_WIFI + 1
28 
29 #pragma pack(push)
30 #pragma pack(1)
31 
32 typedef struct _window_class_header_t {
35 
36 typedef struct _window_header_t {
38 
44  uint16_t id_res;
46  const char *label;
47 
48  // char time[10];
50 
51 #pragma pack(pop)
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif //__cplusplus
56 
57 extern int16_t WINDOW_CLS_HEADER;
58 
60 
61 void p_window_header_set_icon(window_header_t *window, uint16_t id_res);
62 
66 
68  header_icons_t icon);
69 void p_window_header_set_text(window_header_t *window, const char *text);
71 
72 #define window_header_events(window) \
73  p_window_header_event_clr(window, MARLIN_EVT_MediaInserted); \
74  p_window_header_event_clr(window, MARLIN_EVT_MediaRemoved); \
75  p_window_header_event_clr(window, MARLIN_EVT_MediaError);
76 
77 #ifdef __cplusplus
78 }
79 #endif //__cplusplus
80 
81 #endif /* WINDOW_HEADER_H_ */
RENDER_FLG
#define RENDER_FLG(a, r)
Definition: display_helper.h:10
window_draw_t
void() window_draw_t(void *window)
Definition: window.h:57
p_window_header_icon_on
void p_window_header_icon_on(window_header_t *window, header_icons_t icon)
Definition: window_header.c:133
window_class_header_t
struct _window_class_header_t window_class_header_t
_rect_ui16_t::y
uint16_t y
Definition: guitypes.h:71
_rect_ui16_t::w
uint16_t w
Definition: guitypes.h:72
_font_t
Definition: guitypes.h:76
window_header_draw
void window_header_draw(window_header_t *window)
Definition: window_header.c:63
marlin_client.h
IDR_PNG_header_icon_usb
#define IDR_PNG_header_icon_usb
Definition: resource.h:63
_window_frame_t
Definition: window_frame.h:18
_gui_defaults_t::color_text
color_t color_text
Definition: guitypes.h:108
_window_class_header_t::cls
window_class_t cls
Definition: window_header.h:33
ALIGN_CENTER
#define ALIGN_CENTER
Definition: guitypes.h:19
rect_ui16
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
_window_header_t::font
font_t * font
Definition: window_header.h:41
_gui_defaults_t::font
font_t * font
Definition: guitypes.h:110
HEADER_ISTATE_OFF
Definition: window_header.h:15
HEADER_ISTATE_ON
Definition: window_header.h:16
IDR_PNG_header_icon_lan
#define IDR_PNG_header_icon_lan
Definition: resource.h:64
i
uint8_t i
Definition: screen_test_graph.c:72
WINDOW_CLS_USER
#define WINDOW_CLS_USER
Definition: window.h:21
IDR_NULL
#define IDR_NULL
Definition: resource.h:6
WINDOW_FLG_VISIBLE
#define WINDOW_FLG_VISIBLE
Definition: window.h:24
window_header_done
void window_header_done(window_header_t *window)
Definition: window_header.c:61
window_frame_draw
void window_frame_draw(window_frame_t *window)
Definition: window_frame.c:15
MARLIN_EVT_MediaInserted
#define MARLIN_EVT_MediaInserted
Definition: marlin_events.h:11
window_header.h
NULL
#define NULL
Definition: usbd_def.h:53
WINDOW_CLS_HEADER
int16_t WINDOW_CLS_HEADER
Definition: window_header.c:24
_display_t::fill_rect
display_fill_rect_t * fill_rect
Definition: display.h:33
marlin_events.h
_window_header_t::alignment
uint8_t alignment
Definition: window_header.h:43
_gui_defaults_t::padding
padding_ui8_t padding
Definition: guitypes.h:112
netif.h
_window_header_t::color_text
color_t color_text
Definition: window_header.h:40
window_header_init
void window_header_init(window_header_t *window)
Definition: window_header.c:26
window_done_t
void() window_done_t(void *window)
Definition: window.h:56
_window_header_t::icons
header_states_t icons[HEADER_ICON_COUNT]
Definition: window_header.h:45
eth0
struct netif eth0
Definition: lwip.c:72
HEADER_ICON_USB
Definition: window_header.h:21
_window_t
Definition: window.h:76
_window_header_t
Definition: window_header.h:36
header_states_t
header_states_t
Definition: window_header.h:14
ROPFN_DISABLE
#define ROPFN_DISABLE
Definition: guitypes.h:33
media_is_inserted
bool media_is_inserted()
Definition: Marlin_CardReader.cpp:17
netif
Definition: netif.h:225
_gui_defaults_t::color_back
color_t color_back
Definition: guitypes.h:107
_window_class_header_t
Definition: window_header.h:32
_padding_ui8_t
Definition: guitypes.h:86
_window_header_t::color_back
color_t color_back
Definition: window_header.h:39
p_window_header_icon_off
void p_window_header_icon_off(window_header_t *window, header_icons_t icon)
Definition: window_header.c:126
_rect_ui16_t
Definition: guitypes.h:69
render_text_align
void render_text_align(rect_ui16_t rc, const char *text, font_t *font, color_t clr0, color_t clr1, padding_ui8_t padding, uint16_t flags)
Definition: display_helper.c:6
dhcp.h
uint8_t
const uint8_t[]
Definition: 404_html.c:3
_window_class_t
Definition: window.h:67
_window_header_t::padding
padding_ui8_t padding
Definition: window_header.h:42
display
display_t * display
Definition: display.c:6
_rect_ui16_t::h
uint16_t h
Definition: guitypes.h:73
_window_header_t::win
window_t win
Definition: window_header.h:37
_window_t::rect
rect_ui16_t rect
Definition: window.h:101
_window_header_t::id_res
uint16_t id_res
Definition: window_header.h:44
HEADER_ICON_WIFI
Definition: window_header.h:23
window_class_header
const window_class_header_t window_class_header
Definition: window_header.c:183
IDR_PNG_header_icon_wifi
#define IDR_PNG_header_icon_wifi
Definition: resource.h:65
p_window_header_icon_off
void p_window_header_icon_off(window_header_t *window, header_icons_t icon)
Definition: window_header.c:126
_rect_ui16_t::x
uint16_t x
Definition: guitypes.h:70
config.h
WINDOW_CLS_HEADER
int16_t WINDOW_CLS_HEADER
Definition: window_header.c:24
p_window_header_get_state
header_states_t p_window_header_get_state(window_header_t *window, header_icons_t icon)
Definition: window_header.c:147
header_icons_t
header_icons_t
Definition: window_header.h:20
color_t
uint32_t color_t
Definition: guitypes.h:62
p_window_header_get_state
header_states_t p_window_header_get_state(window_header_t *window, header_icons_t icon)
Definition: window_header.c:147
window_init_t
void() window_init_t(void *window)
Definition: window.h:55
gui.h
MARLIN_EVT_MediaRemoved
#define MARLIN_EVT_MediaRemoved
Definition: marlin_events.h:13
gui_defaults
gui_defaults_t gui_defaults
Definition: gui.c:20
render_icon_align
void render_icon_align(rect_ui16_t rc, uint16_t id_res, color_t clr0, uint16_t flags)
Definition: display_helper.c:55
window_class_header
const window_class_header_t window_class_header
Definition: window_header.c:183
p_window_header_icon_active
void p_window_header_icon_active(window_header_t *window, header_icons_t icon)
Definition: window_header.c:140
p_window_header_icon_on
void p_window_header_icon_on(window_header_t *window, header_icons_t icon)
Definition: window_header.c:133
window_header_t
struct _window_header_t window_header_t
HEADER_ISTATE_ACTIVE
Definition: window_header.h:17
p_window_header_set_text
void p_window_header_set_text(window_header_t *window, const char *text)
Definition: window_header.c:152
p_window_header_set_icon
void p_window_header_set_icon(window_header_t *window, uint16_t id_res)
Definition: window_header.c:121
HEADER_ICON_LAN
Definition: window_header.h:22
p_window_header_event_clr
int p_window_header_event_clr(window_header_t *window, uint8_t evt_id)
Definition: window_header.c:157
_window_t::flg
uint32_t flg
Definition: window.h:81
p_window_header_set_icon
void p_window_header_set_icon(window_header_t *window, uint16_t id_res)
Definition: window_header.c:121
HEADER_ICON_COUNT
#define HEADER_ICON_COUNT
Definition: window_header.h:27
p_window_header_event_clr
int p_window_header_event_clr(window_header_t *window, uint8_t evt_id)
Definition: window_header.c:157
WINDOW_FLG_INVALID
#define WINDOW_FLG_INVALID
Definition: window.h:26
_window_invalidate
static void _window_invalidate(window_t *window)
Definition: window.h:257
p_window_header_icon_active
void p_window_header_icon_active(window_header_t *window, header_icons_t icon)
Definition: window_header.c:140
p_window_header_set_text
void p_window_header_set_text(window_header_t *window, const char *text)
Definition: window_header.c:152
marlin_event_clr
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
netif_is_up
#define netif_is_up(netif)
Definition: netif.h:401
_window_header_t::label
const char * label
Definition: window_header.h:46
ALIGN_LEFT_CENTER
#define ALIGN_LEFT_CENTER
Definition: guitypes.h:21