Prusa MINI Firmware overview
window_frame.c File Reference
#include "window_frame.h"
#include "gui.h"

Functions

void window_frame_init (window_frame_t *window)
 
void window_frame_done (window_frame_t *window)
 
void window_frame_draw (window_frame_t *window)
 
void window_frame_event (window_frame_t *window, uint8_t event, void *param)
 

Variables

const window_class_frame_t window_class_frame
 

Function Documentation

◆ window_frame_init()

void window_frame_init ( window_frame_t window)
5  {
6  if (rect_empty_ui16(window->win.rect)) //use display rect curent is empty
7  window->win.rect = rect_ui16(0, 0, display->w, display->h);
9  window->color_back = COLOR_BLACK;
10 }
Here is the call graph for this function:

◆ window_frame_done()

void window_frame_done ( window_frame_t window)
12  {
13 }

◆ window_frame_draw()

void window_frame_draw ( window_frame_t window)
15  {
16  if (window->win.f_visible) {
17  if (window->win.f_invalid) {
18  rect_ui16_t rc = window->win.rect;
19  display->fill_rect(rc, window->color_back);
20  window->win.f_invalid = 0;
22  }
23  window_draw_children(window->win.id);
24  }
25 }
Here is the call graph for this function:

◆ window_frame_event()

void window_frame_event ( window_frame_t window,
uint8_t  event,
void param 
)
27  {
28  int16_t id;
29  int dif;
30  switch (event) {
35  break;
37  dif = (int)param;
38  id = window_focused();
39  while (dif--)
40  id = window_prev_enabled(id);
41  if (id >= 0)
42  window_set_focus(id);
43  break;
45  dif = (int)param;
46  id = window_focused();
47  while (dif--)
48  id = window_next_enabled(id);
49  if (id >= 0)
50  window_set_focus(id);
51  break;
53  break;
55  if (window_parent(window_focused()) != window->win.id) {
56  id = window_first_child(0);
57  if (!window_is_enabled(id))
58  id = window_next_enabled(id);
59  window_set_focus(id);
60  }
61  break;
62  }
63 }
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ window_class_frame

window_draw_t
void() window_draw_t(void *window)
Definition: window.h:57
WINDOW_EVENT_CAPT_0
#define WINDOW_EVENT_CAPT_0
Definition: window.h:44
WINDOW_EVENT_CAPT_1
#define WINDOW_EVENT_CAPT_1
Definition: window.h:45
_display_t::h
uint16_t h
Definition: display.h:26
WINDOW_EVENT_ENC_UP
#define WINDOW_EVENT_ENC_UP
Definition: window.h:41
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_FLG_PARENT
#define WINDOW_FLG_PARENT
Definition: window.h:32
window_frame_t
struct _window_frame_t window_frame_t
_window_frame_t::color_back
color_t color_back
Definition: window_frame.h:20
_display_t::fill_rect
display_fill_rect_t * fill_rect
Definition: display.h:33
_window_t::id
int16_t id
Definition: window.h:79
window_first_child
int16_t window_first_child(int16_t id)
Definition: window.c:218
_window_t::f_invalid
uint32_t f_invalid
Definition: window.h:87
window_frame_init
void window_frame_init(window_frame_t *window)
Definition: window_frame.c:5
window_done_t
void() window_done_t(void *window)
Definition: window.h:56
rect_empty_ui16
static int rect_empty_ui16(rect_ui16_t rc)
Definition: guitypes.h:177
WINDOW_CLS_FRAME
#define WINDOW_CLS_FRAME
Definition: window.h:9
window_draw_children
void window_draw_children(int16_t id)
Definition: window.c:284
window_set_focus
void window_set_focus(int16_t id)
Definition: window.c:480
window_set_capture
void window_set_capture(int16_t id)
Definition: window.c:500
window_focused_ptr
window_t * window_focused_ptr
Definition: window.c:19
window_event_t
void() window_event_t(void *window, uint8_t event, void *param)
Definition: window.h:58
_rect_ui16_t
Definition: guitypes.h:69
display
display_t * display
Definition: display.c:6
_window_t::rect
rect_ui16_t rect
Definition: window.h:101
_window_frame_t::win
window_t win
Definition: window_frame.h:19
window_invalidate_children
void window_invalidate_children(int16_t id)
Definition: window.c:320
window_frame_event
void window_frame_event(window_frame_t *window, uint8_t event, void *param)
Definition: window_frame.c:27
_window_t::f_visible
uint32_t f_visible
Definition: window.h:85
WINDOW_EVENT_CLICK
#define WINDOW_EVENT_CLICK
Definition: window.h:46
window_frame_draw
void window_frame_draw(window_frame_t *window)
Definition: window_frame.c:15
window_next_enabled
int16_t window_next_enabled(int16_t id)
Definition: window.c:211
COLOR_BLACK
#define COLOR_BLACK
Definition: guitypes.h:40
_display_t::w
uint16_t w
Definition: display.h:25
window_is_enabled
int window_is_enabled(int16_t id)
Definition: window.c:257
createSpeedLookupTable.int
int
Definition: createSpeedLookupTable.py:15
window_init_t
void() window_init_t(void *window)
Definition: window.h:55
WINDOW_EVENT_BTN_DN
#define WINDOW_EVENT_BTN_DN
Definition: window.h:38
window_frame_done
void window_frame_done(window_frame_t *window)
Definition: window_frame.c:12
window_focused
int16_t window_focused(void)
Definition: window.c:165
_window_t::flg
uint32_t flg
Definition: window.h:81
screen_dispatch_event
void screen_dispatch_event(window_t *window, uint8_t event, void *param)
Definition: screen.c:103
window_parent
int16_t window_parent(int16_t id)
Definition: window.c:173
_window_t::f_tag
uint32_t f_tag
Definition: window.h:98
WINDOW_FLG_ENABLED
#define WINDOW_FLG_ENABLED
Definition: window.h:25
window_prev_enabled
int16_t window_prev_enabled(int16_t id)
Definition: window.c:204
WINDOW_EVENT_ENC_DN
#define WINDOW_EVENT_ENC_DN
Definition: window.h:40