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

Functions

void window_icon_init (window_icon_t *window)
 
void window_icon_draw (window_icon_t *window)
 

Variables

const window_class_icon_t window_class_icon
 

Function Documentation

◆ window_icon_init()

void window_icon_init ( window_icon_t window)
5  {
6  window->color_back = COLOR_BLACK;
7  window->id_res = 0;
8  window->alignment = ALIGN_CENTER;
9 }

◆ window_icon_draw()

void window_icon_draw ( window_icon_t window)
11  {
12  if (window->win.flg & WINDOW_FLG_INVALID) {
13  //point_ui16_t pt = {window->win.rect.x, window->win.rect.y};
14  //display->draw_icon(pt, window->id_res, window->color_back, (window->win.flg & WINDOW_FLG_FOCUSED)?ROPFN_SWAPBW:0);
15  uint8_t ropfn = 0;
16  if ((window->win.flg & WINDOW_FLG_DISABLED)) { // that could not be set, but what if
17  ropfn |= ROPFN_DISABLE;
18  }
19  if ((window->win.flg & WINDOW_FLG_FOCUSED)) {
20  ropfn |= ROPFN_SWAPBW;
21  }
22 
23  render_icon_align(window->win.rect, window->id_res, window->color_back,
24  RENDER_FLG(window->alignment, ropfn));
25  window->win.flg &= ~WINDOW_FLG_INVALID;
26  }
27 }
Here is the call graph for this function:

Variable Documentation

◆ window_class_icon

const window_class_icon_t window_class_icon
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
window_icon_t
struct _window_icon_t window_icon_t
_window_icon_t::id_res
uint16_t id_res
Definition: window_icon.h:14
window_icon_draw
void window_icon_draw(window_icon_t *window)
Definition: window_icon.c:11
_window_icon_t::alignment
uint8_t alignment
Definition: window_icon.h:15
ALIGN_CENTER
#define ALIGN_CENTER
Definition: guitypes.h:19
_window_icon_t::color_back
color_t color_back
Definition: window_icon.h:13
_window_icon_t::win
window_t win
Definition: window_icon.h:12
window_icon_init
void window_icon_init(window_icon_t *window)
Definition: window_icon.c:5
ROPFN_DISABLE
#define ROPFN_DISABLE
Definition: guitypes.h:33
ROPFN_SWAPBW
#define ROPFN_SWAPBW
Definition: guitypes.h:32
uint8_t
const uint8_t[]
Definition: 404_html.c:3
WINDOW_FLG_DISABLED
#define WINDOW_FLG_DISABLED
Definition: window.h:30
_window_t::rect
rect_ui16_t rect
Definition: window.h:101
WINDOW_CLS_ICON
#define WINDOW_CLS_ICON
Definition: window.h:12
WINDOW_FLG_FOCUSED
#define WINDOW_FLG_FOCUSED
Definition: window.h:27
COLOR_BLACK
#define COLOR_BLACK
Definition: guitypes.h:40
window_init_t
void() window_init_t(void *window)
Definition: window.h:55
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_t::flg
uint32_t flg
Definition: window.h:81
WINDOW_FLG_INVALID
#define WINDOW_FLG_INVALID
Definition: window.h:26