rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
ui_workbench.h
Go to the documentation of this file.
1
25#pragma once
26
27#include <stdbool.h>
28#include <stdint.h>
29
30#include "gfx.h"
31#include "touch_types.h"
32#include "ui_tabs.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
39typedef enum {
40 UI_WB_LIVE = 0,
41 UI_WB_TEST,
42 UI_WB_PROGRAM,
43 UI_WB_SETTINGS,
44 UI_WB_TASKS
46
48#define UI_WB_HAS(task) (1u << (unsigned)(task))
49
50/*
51 * Geometry in the screen's own coordinates (the body under the band). A
52 * tab is 112px: PROGRAMMIEREN, the longest label, is 13 cells of 8px.
53 * Four tabs take 460px, which the 488px page area of a workbench holds.
54 * The page area and the output card start at UI_WB_PAGE_Y.
55 */
56#define UI_WB_STRIP_X 9
57#define UI_WB_STRIP_Y 6
58#define UI_WB_STRIP_H 24
59#define UI_WB_TAB_W 112
60#define UI_WB_TAB_GAP 4
61#define UI_WB_PAGE_Y 38
62
63typedef struct {
64 ui_tabs_t tabs;
66 uint8_t task[UI_WB_TASKS];
68
74void ui_wb_strip_init(ui_wb_strip_t *w, unsigned tasks, int16_t x, int16_t y);
75
78
80bool ui_wb_strip_has(const ui_wb_strip_t *w, ui_wb_task_t task);
81
87
90
97
100
103
110
113
114void ui_wb_strip_render(const ui_wb_strip_t *w, gfx_canvas_t *c);
115
116#ifdef __cplusplus
117}
118#endif
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
Definition gfx.h:129
Definition gfx.h:81
A DOWN, MOVE or UP of one contact.
Definition touch_types.h:69
A row of tabs: their labels, where they are, which is selected and the press under way.
Definition ui_tabs.h:27
Definition ui_workbench.h:63
uint8_t task[UI_WB_TASKS]
Definition ui_workbench.h:66
Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker....
The pane selector: one bench, several views of it.
gfx_rect_t ui_wb_strip_rect(const ui_wb_strip_t *w)
The strip's row.
Definition ui_workbench.c:104
bool ui_wb_strip_event(ui_wb_strip_t *w, const touch_event_t *evt)
Definition ui_workbench.c:87
bool ui_wb_strip_has(const ui_wb_strip_t *w, ui_wb_task_t task)
Definition ui_workbench.c:57
bool ui_wb_strip_pressed(const ui_wb_strip_t *w)
Definition ui_workbench.c:92
void ui_wb_strip_cancel(ui_wb_strip_t *w)
Definition ui_workbench.c:97
gfx_rect_t ui_wb_strip_tab_rect(const ui_wb_strip_t *w, ui_wb_task_t task)
Definition ui_workbench.c:114
void ui_wb_strip_open(ui_wb_strip_t *w)
Definition ui_workbench.c:79
void ui_wb_strip_init(ui_wb_strip_t *w, unsigned tasks, int16_t x, int16_t y)
Definition ui_workbench.c:17
bool ui_wb_strip_select(ui_wb_strip_t *w, ui_wb_task_t task)
Definition ui_workbench.c:62
ui_wb_task_t ui_wb_strip_task(const ui_wb_strip_t *w)
Definition ui_workbench.c:38
ui_wb_task_t
Definition ui_workbench.h:39