Debian Codegraph @

squeek2lvgl/examples/us-terminal-with-scancodes/sq2lv_layouts.h

raw
1 /**
2 * Auto-generated with squeek2lvgl
3 **/
4
5 #ifndef SQ2LV_LAYOUTS_H
6 #define SQ2LV_LAYOUTS_H
7
8 #include "lvgl/lvgl.h"
9
10 #define SQ2LV_SCANCODES_ENABLED 1
11
12 /* Key attributes */
13 #define SQ2LV_CTRL_NON_CHAR (LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_CHECKED)
14 #define SQ2LV_CTRL_MOD_ACTIVE (LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_CHECKABLE)
15 #define SQ2LV_CTRL_MOD_INACTIVE (LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_CHECKABLE | LV_BTNMATRIX_CTRL_CHECKED)
16
17 /* Layout IDs, values can be used as indexes into the sq2lv_layouts array */
18 typedef enum {
19 SQ2LV_LAYOUT_NONE = -1,
20 SQ2LV_LAYOUT_TERMINAL_US = 0
21 } sq2lv_layout_id_t;
22
23 /* Layer type */
24 typedef struct {
25 /* Number of keys */
26 const int num_keys;
27 /* Key caps */
28 const char * const * const keycaps;
29 /* Key attributes */
30 const lv_btnmatrix_ctrl_t * const attributes;
31 /* Number of modifier keys */
32 const int num_modifiers;
33 /* Button indexes of modifier keys */
34 const int * const modifier_idxs;
35 /* Number of buttons that trigger a layer switch */
36 const int num_switchers;
37 /* Button indexes that trigger a layer switch */
38 const int * const switcher_idxs;
39 /* Indexes of layers to jump to when triggering layer switch buttons */
40 const int * const switcher_dests;
41 /* Total number of scancodes */
42 const int num_scancodes;
43 /* Flat array of scancodes */
44 const int * const scancodes;
45 /* Start index in scancodes array for key cap */
46 const int * const scancode_idxs;
47 /* Number of scancodes for key cap */
48 const int * const scancode_nums;
49 } sq2lv_layer_t;
50
51 /* Layout type */
52 typedef struct {
53 /* Layout name */
54 const char * const name;
55 /* Layout short name */
56 const char * const short_name;
57 /* Total number of layers */
58 const int num_layers;
59 /* Layers array */
60 const sq2lv_layer_t * const layers;
61 } sq2lv_layout_t;
62
63 /* Layouts */
64 extern const int sq2lv_num_layouts;
65 extern const sq2lv_layout_t sq2lv_layouts[];
66
67 /* Layout names (suitable for use in lv_dropdown_t) */
68 extern const char * const sq2lv_layout_names;
69 extern const char * const sq2lv_layout_short_names;
70
71 /* Unique scancodes from all layout (suitable for setting up uinput devices) */
72 extern const int sq2lv_num_unique_scancodes;
73 extern const int sq2lv_unique_scancodes[];
74
75 #endif /* SQ2LV_LAYOUTS_H */