| 1 |
#include <stdarg.h> |
| 2 |
#include <stdbool.h> |
| 3 |
#include <stdint.h> |
| 4 |
#include <stdlib.h> |
| 5 |
|
| 6 |
typedef struct Rect { |
| 7 |
float x; |
| 8 |
float y; |
| 9 |
float w; |
| 10 |
float h; |
| 11 |
} Rect; |
| 12 |
|
| 13 |
typedef struct Color { |
| 14 |
uint8_t r; |
| 15 |
uint8_t g; |
| 16 |
uint8_t b; |
| 17 |
uint8_t a; |
| 18 |
} Color; |
| 19 |
|
| 20 |
enum DisplayItem_Tag { |
| 21 |
Fill, |
| 22 |
Image, |
| 23 |
ClearScreen, |
| 24 |
}; |
| 25 |
typedef uint8_t DisplayItem_Tag; |
| 26 |
|
| 27 |
typedef struct Fill_Body { |
| 28 |
DisplayItem_Tag tag; |
| 29 |
struct Rect _0; |
| 30 |
struct Color _1; |
| 31 |
} Fill_Body; |
| 32 |
|
| 33 |
typedef struct Image_Body { |
| 34 |
DisplayItem_Tag tag; |
| 35 |
uint32_t id; |
| 36 |
struct Rect bounds; |
| 37 |
} Image_Body; |
| 38 |
|
| 39 |
typedef union DisplayItem { |
| 40 |
DisplayItem_Tag tag; |
| 41 |
Fill_Body fill; |
| 42 |
Image_Body image; |
| 43 |
} DisplayItem; |
| 44 |
|
| 45 |
bool push_item(union DisplayItem item); |