33#define SCREEN_W UI_PANEL_W
36#define SCREEN_H UI_BODY_H
45#define FS_FONT_LABEL (&gfx_font_10x20)
46#define FS_FONT_FINE (&gfx_font_8x16)
47#define FS_FONT_BODY (&gfx_font_12x24)
51#define FS_R (SCREEN_W - UI_MARGIN)
52#define FS_W (FS_R - FS_L)
69#define FS_PANE_X(i) (FS_L + (i) * (FS_PANE_W + FS_PANE_GAP))
71#define FS_HDR_H UI_TAP_MIN
75#define FS_UP(i) gfx_rect_make(FS_PANE_X(i), FS_HDR_Y, FS_UP_W, FS_HDR_H)
77#define FS_PREV(i) gfx_rect_make(FS_PANE_X(i) + FS_PANE_W - 2 * FS_PG_W - 4, \
78 FS_HDR_Y, FS_PG_W, FS_HDR_H)
80#define FS_NEXT(i) gfx_rect_make(FS_PANE_X(i) + FS_PANE_W - FS_PG_W, \
81 FS_HDR_Y, FS_PG_W, FS_HDR_H)
87#define FS_LIST(i) gfx_rect_make(FS_PANE_X(i), FS_LIST_Y, FS_PANE_W, \
88 FS_HEAD_H + FS_ROWS * FS_ROW_H + 4)
92#define FS_BAR(i) gfx_rect_make(FS_PANE_X(i) + FS_PANE_W - 8 - FS_BAR_W, \
93 FS_LIST_Y + FS_HEAD_H, FS_BAR_W, \
94 FS_ROWS * FS_ROW_H - 4)
97#define FS_ROW_W (FS_PANE_W - FS_ROW_IN - 8 - FS_BAR_W - 8)
118#define FOOT_Y (SCREEN_H - UI_ALERT_H - 4 - FOOT_H)
120#define FOOT_W_FIRST 140
126#define FS_FOOT_X(i) (FS_L + (((i) == 0) ? 0 \
127 : FOOT_W_FIRST + FOOT_GAP \
128 + ((i) - 1) * (FOOT_W + FOOT_GAP)))
130#define FS_FOOT(i) gfx_rect_make(FS_FOOT_X(i), FOOT_Y, \
131 ((i) == 0) ? FOOT_W_FIRST : FOOT_W, \
147_Static_assert(FS_RESCAN == 0,
"RESCAN is the first, wide button");
148_Static_assert(FS_OPEN ==
FOOT_N - 1,
"OPEN is the last button");
160#define FS_BOX gfx_rect_make(162, FS_BOX_Y, 700, FS_BOX_H)
161#define FS_Q_CANCEL gfx_rect_make(186, 304, 300, 56)
162#define FS_Q_DELETE gfx_rect_make(538, 304, 300, 56)
164#define FS_JOB_CANCEL gfx_rect_make(362, 304, 300, 56)
166#define FS_JOB_BAR gfx_rect_make(186, 228, 652, 24)
176#define FS_INFO_BOX gfx_rect_make(112, FS_INFO_Y, 800, FS_INFO_H)
178#define FS_INFO_KEY_W 160
179#define FS_INFO_CLOSE gfx_rect_make(362, 364, 300, 56)
186#define FS_NEW_ROW_H UI_CHOICE_ROW_H
187#define FS_NEW_H (2 * FS_NEW_ROW_H + 8)
189#define FS_NEW_X (FS_FOOT_X(FS_NEW) + FOOT_W - FS_NEW_W)
190#define FS_NEW_Y (FOOT_Y - 8 - FS_NEW_H)
192#define FS_NEW_LIST gfx_rect_make(FS_NEW_X, FS_NEW_Y, FS_NEW_W, FS_NEW_H)
194#define FS_NEW_ROW(i) gfx_rect_make(FS_NEW_X + 4, \
195 FS_NEW_Y + 4 + (i) * FS_NEW_ROW_H, \
196 FS_NEW_W - 8, FS_NEW_ROW_H)
202#define FS_TK_AREA gfx_rect_make(FS_L, 4, FS_W, FOOT_Y + FOOT_H - 4)
206#define FS_JOB_BOX_S 0.25f
236 "the footer ends 4px above the alert band");
237_Static_assert(
FOOT_H >=
UI_TAP_MIN,
"the footer's buttons are a finger tall");
239 "the footer's buttons end at the right margin");
242 "UP, PREV and NEXT are a finger tall and wide");
244 "UP ends 8px short of PREV");
247 "the header row ends 8px above the list");
249 "the lists end above the message line");
251 "the message line's two lines end 4px above the footer");
253 "a row holds its icon, 28 cells of name and the size");
255 "the scroll bar's thumb is 32px or more on a full page");
257 "NEW's choice ends 8px above the footer");
260 "INFO ends 4px above the alert band");
262 "the question ends 4px above the alert band");
265#define FS_MSG_MAX 192
The folders of the panel's SD (Secure Digital) card, and the files in them with a fixed name.
#define CARD_DIR_MAX
Room for a folder path and its terminator: two folders of 8 characters and the "/" between them are 1...
Definition card_tree.h:113
void fs_render(gfx_canvas_t *c, int buffer_index)
FILES drawn: the panes and the footer, or a box over them, and the keyboard on top.
Definition files_draw.c:601
const char * fs_kind_word(int kind)
The words of entry kind kind.
Definition files_draw.c:29
void fs_cancel_press(void)
Drop a press under way: the touch stream lost an event.
Definition files_events.c:96
void fs_event(const touch_event_t *e)
One touch event, in the screen's coordinates.
Definition files_events.c:344
void fs_clamp_scroll(int i)
Pane i's scroll held to its rows.
Definition files_screen.c:521
#define FOOT_N
Definition files_int.h:123
void fs_quiet(void)
The message line says nothing.
Definition files_screen.c:116
#define FS_FOOT_X(i)
Footer button i's left edge: x 8 for the first, then 146px on and 124px a button after it.
Definition files_int.h:126
const char * fs_message(char *buf, size_t n)
The message line in the language showing.
Definition files_screen.c:121
fs_msg_kind_t
What the message line holds.
Definition files_int.h:268
@ FS_MSG_NONE
Definition files_int.h:269
@ FS_MSG_TEXT
Definition files_int.h:270
@ FS_MSG_ERR
Definition files_int.h:271
fs_name_for_t
What a name is typed for.
Definition files_int.h:213
@ FS_NAME_RENAME
Definition files_int.h:216
@ FS_NAME_FILE
Definition files_int.h:215
@ FS_NAME_FOLDER
Definition files_int.h:214
#define FS_ROW_H
Definition files_int.h:84
fs_hit_t
What a press came down on.
Definition files_int.h:220
@ FS_HIT_JOB_CANCEL
Definition files_int.h:232
@ FS_HIT_INFO_CLOSE
Definition files_int.h:230
@ FS_HIT_BAR
Definition files_int.h:227
@ FS_HIT_NEXT
Definition files_int.h:225
@ FS_HIT_NEW_ROW
Definition files_int.h:231
@ FS_HIT_UP
Definition files_int.h:223
@ FS_HIT_PREV
Definition files_int.h:224
@ FS_HIT_Q_CANCEL
Definition files_int.h:228
@ FS_HIT_Q_DELETE
Definition files_int.h:229
@ FS_HIT_ROW
Definition files_int.h:226
#define FS_NEW_H
Definition files_int.h:187
#define SCREEN_H
The body's height, 540px: the router owns the band and hands this screen the body.
Definition files_int.h:36
#define FS_UP_W
Definition files_int.h:73
void fs_bar_thumb(int i, int *y, int *h)
The scroll bar's thumb of pane i.
Definition files_screen.c:535
const fm_entry_t * fs_selected(void)
The selected entry of the active pane.
Definition files_screen.c:509
#define FS_ROW_W
A row's width: from the inset to 8px short of the bar.
Definition files_int.h:97
void fs_say_err(fm_err_t err, const char *name)
The message line says why err, for name (fs_err_text()).
Definition files_screen.c:106
#define FS_MSG_Y
The message line under the panes: two lines of the 12 x 24 face, 84 cells each, 24px apart,...
Definition files_int.h:105
bool fs_paged(int i)
Whether a pane's folder holds more than its page.
Definition files_screen.c:514
#define FS_HDR_Y
Definition files_int.h:70
fs_state_t fs_s
The screen's state, defined in files_screen.c.
Definition files_screen.c:36
void fs_err_text(fm_err_t err, const char *name, char *out, size_t n)
The words of a refusal or a failure, for name.
Definition files_screen.c:145
#define FS_ICON
Definition files_int.h:98
#define FOOT_W
Definition files_int.h:119
#define FS_INFO_Y
The INFO box: 800 x 420px, its rows in the 10 x 20 face at a pitch of FS_INFO_LH under the heading,...
Definition files_int.h:173
void fs_foot(fs_foot_t b)
Act on footer button b: a tap on it, live or dimmed.
Definition files_screen.c:711
#define FS_HEAD_H
Definition files_int.h:83
#define FS_NEW_Y
Definition files_int.h:190
#define FS_PG_W
Definition files_int.h:72
#define FS_LIST_Y
Definition files_int.h:82
#define FS_SIZE_W
Definition files_int.h:99
void fs_delete_doomed(void)
The DELETE question's DELETE: the job that deletes it.
Definition files_screen.c:839
#define FS_MSG_LH
Definition files_int.h:106
#define FS_HDR_H
Definition files_int.h:71
#define FOOT_Y
Definition files_int.h:118
void fs_name_typed(const char *name)
The keyboard closed with name: the job that makes or renames.
Definition files_screen.c:862
bool fs_foot_live(fs_foot_t b, fm_err_t *why)
Whether footer button b takes a press now, and why not.
Definition files_screen.c:613
void fs_say(bool ok, ui_text_id_t id, const char *a, const char *b)
The message line says id, with up to two names.
Definition files_screen.c:95
#define FS_R
Definition files_int.h:51
#define FS_BOX_H
Definition files_int.h:158
#define FOOT_H
The footer, body y 440 to 492, ending 4px above the router's alert band (y 496), in LOGS' order: RESC...
Definition files_int.h:117
int fs_bar_scroll_at(int i, int top)
The scroll of pane i that puts the thumb's top nearest top.
Definition files_screen.c:553
#define FS_NEW_ROW_H
Definition files_int.h:186
#define MAX_FBS
Definition files_int.h:37
#define FS_INFO_H
Definition files_int.h:174
#define FS_ROWS
Definition files_int.h:85
void fs_row_tap(int i, int row)
A tap on row row of pane i: the pane active and the row selected; a tap on the selected row of the ac...
Definition files_screen.c:824
void fs_job_cancel(void)
CANCEL on the progress box.
Definition files_screen.c:896
#define FS_PANE_W
The two panes, 500px wide at x 8 and x 516, 8px apart.
Definition files_int.h:66
#define FS_BOX_Y
The DELETE question and the progress box, in place of the panes and the footer: 700 x 280px,...
Definition files_int.h:157
void fs_turn(int i, fm_go_t go, bool up)
Read another page of pane i, or the folder above it.
Definition files_screen.c:807
void fs_new_name(bool folder)
NEW's choice: the keyboard for the new entry's name.
Definition files_screen.c:853
fs_foot_t
The footer's buttons, left to right: each one's number is its place in the footer.
Definition files_int.h:136
#define FS_PANE_X(i)
Pane i's left edge: 8 or 516.
Definition files_int.h:69
FILES: the SD (Secure Digital) card in two panes, commander style, and the operations on its files an...
files_view_t
What the screen shows over its panes.
Definition files_screen.h:122
fm_err_t
What a call of the core or of the card came to. FM_OK is 0; every other value is a refusal or a failu...
Definition fm_io.h:51
#define FM_NAME_BUF
Room for a listed name and its terminator: FM_LIST_NAME_MAX (63) bytes, as the panel's directory walk...
Definition fm_io.h:44
#define FM_PATH_SIZE
Room for a path and its terminator.
Definition fm_name.h:54
One request of the FILES screen to the card's task, and the runner that answers it: a page of a pane,...
What the file manager may do to a name: the places the bench keeps, the files the logger writes,...
One pane of the file manager: a folder of the card, the page of its entries on show,...
#define FM_PAGE_MAX
Rows of one page, as LOGS' page (LOG_VIEWER_MAX_FILES).
Definition fm_tree.h:48
fm_go_t
Which page fm_tree_page() reads.
Definition fm_tree.h:65
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
The card's task as the screen reaches it. Every function may be called on the task that renders; none...
Definition files_screen.h:64
The bench as the rules see it, filled by the caller each time it asks. Every pointer may be NULL.
Definition fm_rules.h:101
One entry of a page.
Definition fm_tree.h:53
What INFO reads of one entry.
Definition fm_req.h:62
One request. The screen fills the fields of its kind, the runner writes the answer into the same requ...
Definition fm_req.h:74
One pane. The fields are the pane's; read them, change them through the functions.
Definition fm_tree.h:77
The screen's state.
Definition files_int.h:275
files_view_t view
Definition files_int.h:278
int press_row
Definition files_int.h:348
fm_req_t req
Definition files_int.h:297
bool dragged
Definition files_int.h:350
fm_entry_t doomed
Definition files_int.h:311
ui_text_id_t msg_id
Definition files_int.h:334
bool tap_have
Definition files_int.h:341
int bar_grab
Definition files_int.h:351
bool drawn_gate
Definition files_int.h:329
fs_msg_kind_t msg_kind
Definition files_int.h:333
int press_scroll0
Definition files_int.h:349
fm_err_t pane_err[2]
Definition files_int.h:284
uint64_t prog_total
Definition files_int.h:303
bool have_io
Definition files_int.h:277
int press
Definition files_int.h:346
fm_bench_t bench
Definition files_int.h:326
fm_go_t need_go[2]
Definition files_int.h:290
uint64_t prog_done
Definition files_int.h:302
uint8_t tap_id
Definition files_int.h:343
fm_info_t info
Definition files_int.h:317
char msg_a[FM_NAME_BUF]
Definition files_int.h:336
char select_after[2][FM_NAME_BUF]
The name a pane selects once its next page is read: a new folder, a new file, a renamed entry.
Definition files_int.h:308
ui_textkey_t tk
Definition files_int.h:321
int scroll[2]
Definition files_int.h:281
float busy_s
Definition files_int.h:301
char info_dir[FM_PATH_SIZE]
Definition files_int.h:316
int press_pane
Definition files_int.h:347
fm_tree_t pane[2]
Definition files_int.h:280
bool valid[MAX_FBS]
Definition files_int.h:353
bool busy
Definition files_int.h:298
unsigned mount
Definition files_int.h:286
char auto_dir[CARD_DIR_MAX]
Definition files_int.h:328
bool keep_place[2]
The pane's wish waiting is RESCAN's: its answer keeps the pane's place (place_keep() in files_screen....
Definition files_int.h:294
char user_dir[CARD_DIR_MAX]
Definition files_int.h:327
fm_err_t msg_err
Definition files_int.h:335
char msg_b[FM_NAME_BUF]
Definition files_int.h:337
int16_t tap_y0
Definition files_int.h:345
bool cancel_asked
Definition files_int.h:304
int doomed_pane
Definition files_int.h:312
int16_t tap_x0
Definition files_int.h:344
files_io_t io
Definition files_int.h:276
fs_name_for_t name_for
Definition files_int.h:322
bool need_look
Definition files_int.h:291
int req_pane
Definition files_int.h:299
bool read[2]
Definition files_int.h:283
fm_entry_t info_entry
Definition files_int.h:315
bool need[2]
Definition files_int.h:289
bool message_ok
Definition files_int.h:338
bool tap_moved
Definition files_int.h:342
bool req_keep
Definition files_int.h:300
uint32_t drawn_tk_rev
Definition files_int.h:323
fm_err_t info_err
Definition files_int.h:318
char enter_name[FM_NAME_BUF]
Definition files_int.h:285
int active
Definition files_int.h:282
A DOWN, MOVE or UP of one contact.
Definition touch_types.h:69
A keyboard: what it was opened for, what is typed, and the press it holds.
Definition ui_textkey.h:114
Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker....
The panel's geometry, in one place.
#define UI_TAP_MIN
The smallest touch target for a control, in pixels: 48px, 7.2mm.
Definition ui_layout.h:71
#define UI_ALERT_H
The alert band the router draws across the bottom of the panel while an alert shows.
Definition ui_layout.h:43
The interface's words, one table per language.
ui_text_id_t
The screens' strings, TX_<ID> for each UI_TEXT() of ui_text.def.
Definition ui_text.h:43
An on-screen keyboard for a short name: capitals, digits, space and the marks a name or a file needs,...