devela/run/regime/cap/
definitions.rs1use crate::{ColorDepth, Extent2, NonMaxU16, NonMaxU32, set, test_size_of};
7
8#[doc = crate::_tags!(runtime)]
9#[doc = crate::_doc_meta!{
11 location("run/regime"),
12 test_size_of(RunCap = 28|224),
13}]
14#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
15pub struct RunCap {
16 pub audio: Option<RunCapAudio>,
18 pub color: Option<RunCapColor>,
20 pub image: Option<RunCapImage>,
22 pub input: Option<RunCapInput>,
24 pub system: Option<RunCapSystem>,
26 pub text: Option<RunCapText>,
28 pub window: Option<RunCapWindow>,
30}
31
32#[doc = crate::_tags!(runtime audio)]
33#[doc = crate::_doc_meta!{
35 location("run/regime"),
36 test_size_of(RunCapAudio = 1|8),
37}]
38#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
39pub struct RunCapAudio {
40 pub play: bool,
42}
43
44#[doc = crate::_tags!(runtime color)]
45#[doc = crate::_doc_meta!{
47 location("run/regime"),
48 test_size_of(RunCapColor = 4|32),
49}]
50#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
51pub struct RunCapColor {
52 pub depth: ColorDepth,
54 pub palette_size: Option<NonMaxU16>,
56 pub palette_set: bool,
58}
59
60#[doc = crate::_tags!(runtime image)]
61#[doc = crate::_doc_meta!{
63 location("run/regime"),
64 test_size_of(RunCapImage = 12|96),
65}]
66#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
67pub struct RunCapImage {
68 pub max_bitmap_extent: Option<Extent2<NonMaxU32>>,
70 pub pixel_native: bool,
72}
73
74set! {
75 #[doc = crate::_tags!(runtime interaction set)]
76 #[doc = crate::_doc_meta!{
78 location("run/regime"),
79 test_size_of(RunCapInput = 1|8),
80 }]
81 pub struct RunCapInput(u8) {
82 GAMEPAD = 0 ;
84 KEYBOARD = 1 ;
86 MIDI = 2 ;
88 MOUSE = 3;
90 TOUCHSCREEN = 4;
92 }
93}
94
95set! {
96 #[doc = crate::_tags!(runtime set)]
97 #[doc = crate::_doc_meta!{
99 location("run/regime"),
100 test_size_of(RunCapSystem = 2|16),
101 }]
102 pub struct RunCapSystem(u16) {
103 TIME = 0;
105 TIMER = 1;
107 RANDOM = 2;
109 ENV = 3;
111 FS = 4;
113 PROCESS = 5;
115 THREAD = 6;
117 NET = 7;
119 SIGNAL = 8;
121 }
122}
123
124set! {
125 #[doc = crate::_tags!(runtime text set)]
126 #[doc = crate::_doc_meta!{
128 location("run/regime"),
129 test_size_of(RunCapText = 1|8),
130 }]
131 pub struct RunCapText(u8) {
132 WRITE = 0;
134 CELL_GRID = 1;
136 PROPORTIONAL = 2;
138 CURSOR = 3;
140 STYLE = 4;
142 EDIT = 5;
144 COLOR_PAIR = 6;
146 MEASURE = 7;
148 }
149}
150
151test_size_of![RunCapWindow = 1]; #[doc = crate::_tags!(runtime)]
153#[doc = crate::_doc_meta!{location("run/regime")}]
155#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
156pub struct RunCapWindow {
157 pub multi: bool,
159}