.cargo/vendor/cbindgen/tests/expectations/display_list.c
raw| 1 | #include <stdarg.h> |
| 2 | #include <stdbool.h> |
| 3 | #include <stdint.h> |
| 4 | #include <stdlib.h> |
| 5 | |
| 6 | typedef struct { |
| 7 | float x; |
| 8 | float y; |
| 9 | float w; |
| 10 | float h; |
| 11 | } Rect; |
| 12 | |
| 13 | typedef struct { |
| 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 { |
| 28 | DisplayItem_Tag tag; |
| 29 | Rect _0; |
| 30 | Color _1; |
| 31 | } Fill_Body; |
| 32 | |
| 33 | typedef struct { |
| 34 | DisplayItem_Tag tag; |
| 35 | uint32_t id; |
| 36 | Rect bounds; |
| 37 | } Image_Body; |
| 38 | |
| 39 | typedef union { |
| 40 | DisplayItem_Tag tag; |
| 41 | Fill_Body fill; |
| 42 | Image_Body image; |
| 43 | } DisplayItem; |
| 44 | |
| 45 | bool push_item(DisplayItem item); |