Prusa MINI Firmware overview
|
#include "window_file_list.h"
#include "gui.h"
#include "config.h"
#include "fatfs.h"
#include "dbg.h"
|
int | pattern_matching (const TCHAR *pat, const TCHAR *nam, int skip, int inf) |
|
void | window_file_list_inc (window_file_list_t *window, int dif) |
|
void | window_file_list_dec (window_file_list_t *window, int dif) |
|
int | file_item_cmp_by_is_dir (const FILINFO *ia, const FILINFO *ib) |
|
int | file_item_cmp_by_name (const void *a, const void *b) |
|
int | file_item_cmp_by_time (const void *a, const void *b) |
|
void | window_file_list_load (window_file_list_t *window, const char **filters, size_t filters_cnt, WF_Sort_t sort) |
|
void | window_file_set_item_index (window_file_list_t *window, int index) |
|
void | window_file_list_init (window_file_list_t *window) |
|
void | window_file_list_done (window_file_list_t *window) |
|
void | window_file_list_draw (window_file_list_t *window) |
|
void | window_file_list_event (window_file_list_t *window, uint8_t event, void *param) |
|
◆ pattern_matching()
◆ window_file_list_inc()
226 int visible_count = window->
win.
rect.
h / item_height;
227 int old = window->
index;
228 window->
index += dif;
234 if (window->
index != old)
◆ window_file_list_dec()
239 int old = window->
index;
240 window->
index -= dif;
241 if (window->
index < 0)
246 if (window->
index != old)
◆ file_item_cmp_by_is_dir()
◆ file_item_cmp_by_name()
◆ file_item_cmp_by_time()
◆ window_file_list_load()
79 _dbg(
"Findfirst error: %d", fres);
85 for (
size_t filt_no = 0; (!pattern_match) && (filt_no < filters_cnt); ++filt_no) {
◆ window_file_set_item_index()
119 if (window->
count > index) {
120 window->
index = index;
◆ window_file_list_init()
◆ window_file_list_done()
◆ window_file_list_draw()
142 int visible_count = rc_win.
h / item_height;
144 for (
i = 0;
i < visible_count &&
i < window->
count;
i++) {
158 rc_win.
w, item_height };
171 color_text = color_back;
187 color_back, color_text,
199 rc_win.
h = rc_win.
h - (
i * item_height);
202 rc_win.
y +=
i * item_height;
◆ window_file_list_event()
◆ WINDOW_CLS_FILE_LIST
int16_t WINDOW_CLS_FILE_LIST = 0 |
◆ window_class_file_list
#define RENDER_FLG(a, r)
Definition: display_helper.h:10
void() window_draw_t(void *window)
Definition: window.h:57
#define WINDOW_EVENT_CAPT_1
Definition: window.h:45
uint16_t y
Definition: guitypes.h:71
uint8_t h
Definition: guitypes.h:78
uint16_t w
Definition: guitypes.h:72
struct _window_file_list_t window_file_list_t
Definition: window_file_list.h:46
uint8_t bottom
Definition: guitypes.h:90
int count
Definition: window_file_list.h:69
#define AM_HID
Definition: ff.h:352
color_t color_text
Definition: guitypes.h:108
uint8_t top
Definition: guitypes.h:88
#define IDR_PNG_filescreen_icon_folder
Definition: resource.h:41
Definition: window_file_list.h:82
BYTE fattrib
Definition: ff.h:201
int file_item_cmp_by_time(const void *a, const void *b)
Definition: window_file_list.c:46
void window_file_list_dec(window_file_list_t *window, int dif)
Definition: window_file_list.c:238
#define WINDOW_EVENT_ENC_UP
Definition: window.h:41
#define ALIGN_CENTER
Definition: guitypes.h:19
font_t * font
Definition: guitypes.h:110
font_t * font
Definition: window_file_list.h:66
WORD fdate
Definition: ff.h:199
char altpath[F_MAXPATHNAMELENGTH - 12]
Definition: window_file_list.h:73
static padding_ui8_t padding_ui8(uint8_t l, uint8_t t, uint8_t r, uint8_t b)
Definition: guitypes.h:164
uint8_t i
Definition: screen_test_graph.c:72
#define WINDOW_CLS_USER
Definition: window.h:21
#define IDR_NULL
Definition: resource.h:6
static int rect_in_rect_ui16(rect_ui16_t rc, rect_ui16_t rc1)
Definition: guitypes.h:173
#define IDR_PNG_filescreen_icon_home
Definition: resource.h:40
#define NULL
Definition: usbd_def.h:53
void window_file_list_draw(window_file_list_t *window)
Definition: window_file_list.c:138
uint8_t alignment
Definition: window_file_list.h:68
int index
Definition: window_file_list.h:70
int file_item_cmp_by_is_dir(const FILINFO *ia, const FILINFO *ib)
Definition: window_file_list.c:30
display_fill_rect_t * fill_rect
Definition: display.h:33
uint8_t left
Definition: guitypes.h:87
void() window_done_t(void *window)
Definition: window.h:56
void window_file_list_done(window_file_list_t *window)
Definition: window_file_list.c:136
int file_item_cmp_by_name(const void *a, const void *b)
Definition: window_file_list.c:34
color_t color_text
Definition: window_file_list.h:65
padding_ui8_t padding
Definition: window_file_list.h:67
WORD ftime
Definition: ff.h:200
color_t color_back
Definition: guitypes.h:107
#define SDSORT_LIMIT
Definition: window_file_list.h:27
#define IDR_PNG_filescreen_icon_up_folder
Definition: resource.h:42
Definition: guitypes.h:86
#define ROPFN_SWAPBW
Definition: guitypes.h:32
list a
Definition: createSpeedLookupTable.py:29
FILINFO file_items[SDSORT_LIMIT]
Definition: window_file_list.h:74
void window_file_list_inc(window_file_list_t *window, int dif)
Definition: window_file_list.c:224
color_t color_back
Definition: window_file_list.h:64
void() window_event_t(void *window, uint8_t event, void *param)
Definition: window.h:58
Definition: guitypes.h:69
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
const uint8_t[]
Definition: 404_html.c:3
#define _dbg(...)
Definition: dbg.h:50
TCHAR fname[13]
Definition: ff.h:206
#define AM_SYS
Definition: ff.h:353
display_t * display
Definition: display.c:6
uint16_t h
Definition: guitypes.h:73
void window_file_list_event(window_file_list_t *window, uint8_t event, void *param)
Definition: window_file_list.c:207
rect_ui16_t rect
Definition: window.h:101
FRESULT
Definition: ff.h:214
#define AM_DIR
Definition: ff.h:354
FRESULT f_findnext(DIR *dp, FILINFO *fno)
#define WINDOW_EVENT_CLICK
Definition: window.h:46
#define WINDOW_FLG_FOCUSED
Definition: window.h:27
uint16_t x
Definition: guitypes.h:70
int pattern_matching(const TCHAR *pat, const TCHAR *nam, int skip, int inf)
int top_index
Definition: window_file_list.h:71
uint32_t color_t
Definition: guitypes.h:62
void() window_init_t(void *window)
Definition: window.h:55
static const char * filters[]
Definition: screen_filebrowser.cpp:44
gui_defaults_t gui_defaults
Definition: gui.c:20
void render_icon_align(rect_ui16_t rc, uint16_t id_res, color_t clr0, uint16_t flags)
Definition: display_helper.c:55
#define WINDOW_EVENT_BTN_DN
Definition: window.h:38
void window_file_list_init(window_file_list_t *window)
Definition: window_file_list.c:125
FRESULT f_closedir(DIR *dp)
Definition: ff.c:4291
uint32_t flg
Definition: window.h:81
FRESULT f_findfirst(DIR *dp, FILINFO *fno, const TCHAR *path, const TCHAR *pattern)
list b
Definition: createSpeedLookupTable.py:30
void screen_dispatch_event(window_t *window, uint8_t event, void *param)
Definition: screen.c:103
#define WINDOW_FLG_ENABLED
Definition: window.h:25
static void _window_invalidate(window_t *window)
Definition: window.h:257
#define WINDOW_EVENT_ENC_DN
Definition: window.h:40
window_t win
Definition: window_file_list.h:63
#define ALIGN_LEFT_CENTER
Definition: guitypes.h:21
uint8_t info[12]
Definition: masstorage.h:54