| 1 |
#include <stdarg.h> |
| 2 |
#include <stdbool.h> |
| 3 |
#include <stdint.h> |
| 4 |
#include <stdlib.h> |
| 5 |
|
| 6 |
/** |
| 7 |
* Constants shared by multiple CSS Box Alignment properties |
| 8 |
* |
| 9 |
* These constants match Gecko's `NS_STYLE_ALIGN_*` constants. |
| 10 |
*/ |
| 11 |
typedef struct { |
| 12 |
uint8_t bits; |
| 13 |
} StyleAlignFlags; |
| 14 |
/** |
| 15 |
* 'auto' |
| 16 |
*/ |
| 17 |
#define StyleAlignFlags_AUTO (StyleAlignFlags){ .bits = (uint8_t)0 } |
| 18 |
/** |
| 19 |
* 'normal' |
| 20 |
*/ |
| 21 |
#define StyleAlignFlags_NORMAL (StyleAlignFlags){ .bits = (uint8_t)1 } |
| 22 |
/** |
| 23 |
* 'start' |
| 24 |
*/ |
| 25 |
#define StyleAlignFlags_START (StyleAlignFlags){ .bits = (uint8_t)(1 << 1) } |
| 26 |
/** |
| 27 |
* 'end' |
| 28 |
*/ |
| 29 |
#define StyleAlignFlags_END (StyleAlignFlags){ .bits = (uint8_t)(1 << 2) } |
| 30 |
#define StyleAlignFlags_ALIAS (StyleAlignFlags){ .bits = (uint8_t)(StyleAlignFlags_END).bits } |
| 31 |
/** |
| 32 |
* 'flex-start' |
| 33 |
*/ |
| 34 |
#define StyleAlignFlags_FLEX_START (StyleAlignFlags){ .bits = (uint8_t)(1 << 3) } |
| 35 |
#define StyleAlignFlags_MIXED (StyleAlignFlags){ .bits = (uint8_t)(((1 << 4) | (StyleAlignFlags_FLEX_START).bits) | (StyleAlignFlags_END).bits) } |
| 36 |
#define StyleAlignFlags_MIXED_SELF (StyleAlignFlags){ .bits = (uint8_t)(((1 << 5) | (StyleAlignFlags_FLEX_START).bits) | (StyleAlignFlags_END).bits) } |
| 37 |
|
| 38 |
/** |
| 39 |
* An arbitrary identifier for a native (OS compositor) surface |
| 40 |
*/ |
| 41 |
typedef struct { |
| 42 |
uint64_t _0; |
| 43 |
} StyleNativeSurfaceId; |
| 44 |
/** |
| 45 |
* A special id for the native surface that is used for debug / profiler overlays. |
| 46 |
*/ |
| 47 |
#define StyleNativeSurfaceId_DEBUG_OVERLAY (StyleNativeSurfaceId){ ._0 = UINT64_MAX } |
| 48 |
|
| 49 |
typedef struct { |
| 50 |
StyleNativeSurfaceId surface_id; |
| 51 |
int32_t x; |
| 52 |
int32_t y; |
| 53 |
} StyleNativeTileId; |
| 54 |
/** |
| 55 |
* A special id for the native surface that is used for debug / profiler overlays. |
| 56 |
*/ |
| 57 |
#define StyleNativeTileId_DEBUG_OVERLAY (StyleNativeTileId){ .surface_id = StyleNativeSurfaceId_DEBUG_OVERLAY, .x = 0, .y = 0 } |
| 58 |
|
| 59 |
#ifdef __cplusplus |
| 60 |
extern "C" { |
| 61 |
#endif // __cplusplus |
| 62 |
|
| 63 |
void root(StyleAlignFlags flags, StyleNativeTileId tile); |
| 64 |
|
| 65 |
#ifdef __cplusplus |
| 66 |
} // extern "C" |
| 67 |
#endif // __cplusplus |