.cargo/vendor/cbindgen/tests/expectations/display_list.compat.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 | #ifdef __cplusplus |
| 22 | : uint8_t |
| 23 | #endif // __cplusplus |
| 24 | { |
| 25 | Fill, |
| 26 | Image, |
| 27 | ClearScreen, |
| 28 | }; |
| 29 | #ifndef __cplusplus |
| 30 | typedef uint8_t DisplayItem_Tag; |
| 31 | #endif // __cplusplus |
| 32 | |
| 33 | typedef struct { |
| 34 | DisplayItem_Tag tag; |
| 35 | Rect _0; |
| 36 | Color _1; |
| 37 | } Fill_Body; |
| 38 | |
| 39 | typedef struct { |
| 40 | DisplayItem_Tag tag; |
| 41 | uint32_t id; |
| 42 | Rect bounds; |
| 43 | } Image_Body; |
| 44 | |
| 45 | typedef union { |
| 46 | DisplayItem_Tag tag; |
| 47 | Fill_Body fill; |
| 48 | Image_Body image; |
| 49 | } DisplayItem; |
| 50 | |
| 51 | #ifdef __cplusplus |
| 52 | extern "C" { |
| 53 | #endif // __cplusplus |
| 54 | |
| 55 | bool push_item(DisplayItem item); |
| 56 | |
| 57 | #ifdef __cplusplus |
| 58 | } // extern "C" |
| 59 | #endif // __cplusplus |