rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
files_screen.h
Go to the documentation of this file.
1
43
44#pragma once
45
46#include <stdbool.h>
47#include <stddef.h>
48#include <stdint.h>
49
50#include "card_state.h"
51#include "fm_req.h"
52#include "fm_rules.h"
53#include "fm_tree.h"
54#include "ui_screen.h"
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
64typedef struct {
73 bool (*submit)(fm_req_t *req, void *ctx);
79 bool (*idle)(void *ctx);
87 void (*progress)(uint64_t *done, uint64_t *total, void *ctx);
92 void (*cancel)(void *ctx);
101 void (*bench)(fm_bench_t *out, void *ctx);
108 const char *(*volume)(void *ctx);
116 void *ctx;
117} files_io_t;
118
130
136void files_screen_set_io(const files_io_t *io);
137
143
149int files_screen_active(void);
150
156const fm_tree_t *files_screen_pane(int i);
157
163int files_screen_scroll(int i);
164
171const char *files_screen_message(void);
172
177bool files_screen_busy(void);
178
187void files_size_text(char *out, size_t n, uint64_t bytes);
188
198void files_time_text(char *out, size_t n, int64_t mtime);
199
204const ui_screen_t *files_screen(void);
205
207void files_screen_invalidate(void);
208
209#ifdef __cplusplus
210}
211#endif
What the panel's SD (Secure Digital) card slot holds, as the last mount found it: no card,...
card_state_t
Mount state of the SD card.
Definition card_state.h:17
bool files_screen_busy(void)
Whether a request is under way on the card's task.
Definition files_screen.c:989
files_view_t files_screen_view(void)
The view on top.
Definition files_screen.c:963
int files_screen_scroll(int i)
A pane's first row on screen.
Definition files_screen.c:978
const ui_screen_t * files_screen(void)
The screen.
Definition files_screen.c:1137
int files_screen_active(void)
The active pane: the one OPEN, RENAME, DELETE, NEW and INFO act in, and whose entry COPY and MOVE tak...
Definition files_screen.c:968
void files_screen_invalidate(void)
Repaint the cached chrome into every framebuffer.
Definition files_screen.c:994
void files_time_text(char *out, size_t n, int64_t mtime)
A time as INFO writes it: "2024-05-17 12:34", read as UTC, or "" for -1. INFO hands it the stamp move...
Definition files_screen.c:924
void files_screen_set_io(const files_io_t *io)
Point the screen at the card's task. NULL leaves it without one: both panes show no card.
Definition files_screen.c:952
const char * files_screen_message(void)
The message line: the last result or refusal, worded in the language showing; "" for none....
Definition files_screen.c:983
const fm_tree_t * files_screen_pane(int i)
A pane as last read.
Definition files_screen.c:973
void files_size_text(char *out, size_t n, uint64_t bytes)
A size as the panes and INFO write it, no space before the unit: "300B", "4kB", "3....
Definition files_screen.c:907
files_view_t
What the screen shows over its panes.
Definition files_screen.h:122
@ FILES_VIEW_JOB
Definition files_screen.h:128
@ FILES_VIEW_NEW
Definition files_screen.h:126
@ FILES_VIEW_PANES
Definition files_screen.h:123
@ FILES_VIEW_NAME
Definition files_screen.h:127
@ FILES_VIEW_DELETE
Definition files_screen.h:124
@ FILES_VIEW_INFO
Definition files_screen.h:125
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,...
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
void * ctx
Definition files_screen.h:116
void(*) progress(uint64_t *done, uint64_t *total, void *ctx)
The bytes done of the job under way, for the progress box. May be NULL: no progress shows.
Definition files_screen.h:87
bool(*) submit(fm_req_t *req, void *ctx)
Hand req to the card's task. The screen does not touch req again until idle() is true.
Definition files_screen.h:73
void(*) cancel(void *ctx)
Ask the job under way to stop at its next chunk. May be NULL.
Definition files_screen.h:92
card_state_t(*) card(void *ctx)
What the slot holds, for a pane with no card. May be NULL: no card.
Definition files_screen.h:115
bool(*) idle(void *ctx)
Whether the request handed over last is answered.
Definition files_screen.h:79
void(*) bench(fm_bench_t *out, void *ctx)
The bench as the write gate and the rules see it now: ARMED, the logger's open files,...
Definition files_screen.h:101
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 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
Definition ui_screen.h:68
Screen router.