2019-02-23 15:38:34 -08:00
|
|
|
bitflags! {
|
|
|
|
/// Constants shared by multiple CSS Box Alignment properties
|
|
|
|
///
|
|
|
|
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
|
2022-04-14 16:31:14 +02:00
|
|
|
#[derive(MallocSizeOf)]
|
2019-02-23 15:38:34 -08:00
|
|
|
#[repr(C)]
|
|
|
|
pub struct AlignFlags: u8 {
|
|
|
|
/// 'auto'
|
|
|
|
const AUTO = 0;
|
|
|
|
/// 'normal'
|
|
|
|
const NORMAL = 1;
|
|
|
|
/// 'start'
|
|
|
|
const START = 1 << 1;
|
|
|
|
/// 'end'
|
|
|
|
const END = 1 << 2;
|
2023-09-09 06:28:48 +09:00
|
|
|
const ALIAS = Self::END.bits();
|
2019-02-23 15:38:34 -08:00
|
|
|
/// 'flex-start'
|
|
|
|
const FLEX_START = 1 << 3;
|
2023-09-09 06:28:48 +09:00
|
|
|
const MIXED = 1 << 4 | AlignFlags::FLEX_START.bits() | AlignFlags::END.bits();
|
|
|
|
const MIXED_SELF = 1 << 5 | AlignFlags::FLEX_START.bits() | AlignFlags::END.bits();
|
2019-02-23 15:38:34 -08:00
|
|
|
}
|
|
|
|
}
|
2019-02-23 17:24:09 -08:00
|
|
|
|
2020-07-30 10:15:04 -04:00
|
|
|
bitflags! {
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct DebugFlags: u32 {
|
|
|
|
/// Flag with the topmost bit set of the u32
|
|
|
|
const BIGGEST_ALLOWED = 1 << 31;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-07 16:03:55 +02:00
|
|
|
bitflags! {
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct LargeFlags: u64 {
|
|
|
|
/// Flag with a very large shift that usually would be narrowed.
|
|
|
|
const LARGE_SHIFT = 1u64 << 44;
|
2023-09-09 06:28:48 +09:00
|
|
|
const INVERTED = !Self::LARGE_SHIFT.bits();
|
2022-06-07 16:03:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-10 06:42:35 +09:00
|
|
|
// bitflags 2 allows to define types out-of-line for custom derives
|
|
|
|
// #[derive(SomeTrait)]
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct OutOfLine(u32);
|
|
|
|
|
|
|
|
bitflags! {
|
|
|
|
impl OutOfLine: u32 {
|
|
|
|
const A = 1;
|
|
|
|
const B = 2;
|
|
|
|
const AB = Self::A.bits() | Self::B.bits();
|
|
|
|
}
|
|
|
|
}
|
2022-06-07 16:03:55 +02:00
|
|
|
|
2019-02-23 17:24:09 -08:00
|
|
|
#[no_mangle]
|
2023-09-10 06:42:35 +09:00
|
|
|
pub extern "C" fn root(
|
|
|
|
flags: AlignFlags,
|
|
|
|
bigger_flags: DebugFlags,
|
|
|
|
largest_flags: LargeFlags,
|
|
|
|
out_of_line: OutOfLine,
|
|
|
|
) {
|
|
|
|
}
|