| 1 |
bitflags! { |
| 2 |
/// Constants shared by multiple CSS Box Alignment properties |
| 3 |
/// |
| 4 |
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants. |
| 5 |
#[derive(MallocSizeOf)] |
| 6 |
#[repr(C)] |
| 7 |
pub struct AlignFlags: u8 { |
| 8 |
/// 'auto' |
| 9 |
const AUTO = 0; |
| 10 |
/// 'normal' |
| 11 |
const NORMAL = 1; |
| 12 |
/// 'start' |
| 13 |
const START = 1 << 1; |
| 14 |
/// 'end' |
| 15 |
const END = 1 << 2; |
| 16 |
const ALIAS = Self::END.bits; |
| 17 |
/// 'flex-start' |
| 18 |
const FLEX_START = 1 << 3; |
| 19 |
const MIXED = 1 << 4 | AlignFlags::FLEX_START.bits | AlignFlags::END.bits; |
| 20 |
const MIXED_SELF = 1 << 5 | AlignFlags::FLEX_START.bits | AlignFlags::END.bits; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
/// An arbitrary identifier for a native (OS compositor) surface |
| 25 |
#[repr(C)] |
| 26 |
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)] |
| 27 |
pub struct NativeSurfaceId(pub u64); |
| 28 |
|
| 29 |
impl NativeSurfaceId { |
| 30 |
/// A special id for the native surface that is used for debug / profiler overlays. |
| 31 |
pub const DEBUG_OVERLAY: NativeSurfaceId = NativeSurfaceId(u64::MAX); |
| 32 |
} |
| 33 |
|
| 34 |
#[repr(C)] |
| 35 |
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)] |
| 36 |
#[cfg_attr(feature = "capture", derive(Serialize))] |
| 37 |
#[cfg_attr(feature = "replay", derive(Deserialize))] |
| 38 |
pub struct NativeTileId { |
| 39 |
pub surface_id: NativeSurfaceId, |
| 40 |
pub x: i32, |
| 41 |
pub y: i32, |
| 42 |
} |
| 43 |
|
| 44 |
impl NativeTileId { |
| 45 |
/// A special id for the native surface that is used for debug / profiler overlays. |
| 46 |
pub const DEBUG_OVERLAY: NativeTileId = NativeTileId { |
| 47 |
surface_id: NativeSurfaceId::DEBUG_OVERLAY, |
| 48 |
x: 0, |
| 49 |
y: 0, |
| 50 |
}; |
| 51 |
} |
| 52 |
|
| 53 |
#[no_mangle] |
| 54 |
pub extern "C" fn root(flags: AlignFlags, tile: NativeTileId) {} |