| 1 |
struct UnknownUnit; |
| 2 |
struct LayoutUnit; |
| 3 |
|
| 4 |
#[repr(C)] |
| 5 |
struct TypedLength<T, Unit>(T, PhantomData<Unit>); |
| 6 |
|
| 7 |
#[repr(C)] |
| 8 |
struct TypedSideOffsets2D<T, U> { |
| 9 |
top: T, |
| 10 |
right: T, |
| 11 |
bottom: T, |
| 12 |
left: T, |
| 13 |
_phantom: PhantomData<U>, |
| 14 |
} |
| 15 |
|
| 16 |
#[repr(C)] |
| 17 |
struct TypedSize2D<T, U> { |
| 18 |
width: T, |
| 19 |
height: T, |
| 20 |
_phantom: PhantomData<U>, |
| 21 |
} |
| 22 |
|
| 23 |
#[repr(C)] |
| 24 |
struct TypedPoint2D<T, U> { |
| 25 |
x: T, |
| 26 |
y: T, |
| 27 |
_phantom: PhantomData<U>, |
| 28 |
} |
| 29 |
|
| 30 |
#[repr(C)] |
| 31 |
struct TypedRect<T, U> { |
| 32 |
origin: TypedPoint2D<T, U>, |
| 33 |
size: TypedSize2D<T, U>, |
| 34 |
_phantom: PhantomData<U>, |
| 35 |
} |
| 36 |
|
| 37 |
#[repr(C)] |
| 38 |
struct TypedTransform2D<T, Src, Dst> { |
| 39 |
m11: T, m12: T, |
| 40 |
m21: T, m22: T, |
| 41 |
m31: T, m32: T, |
| 42 |
_phantom: PhantomData<U>, |
| 43 |
} |
| 44 |
|
| 45 |
type Length<T> = TypedLength<T, UnknownUnit>; |
| 46 |
type SideOffsets2D<T> = TypedSideOffsets2D<T, UnknownUnit>; |
| 47 |
type Size2D<T> = TypedSize2D<T, UnknownUnit>; |
| 48 |
type Point2D<T> = TypedPoint2D<T, UnknownUnit>; |
| 49 |
type Rect<T> = TypedRect<T, UnknownUnit>; |
| 50 |
|
| 51 |
type LayoutLength = TypedLength<f32, LayoutUnit>; |
| 52 |
type LayoutSideOffsets2D = TypedSideOffsets2D<f32, LayoutUnit>; |
| 53 |
type LayoutSize2D = TypedSize2D<f32, LayoutUnit>; |
| 54 |
type LayoutPoint2D = TypedPoint2D<f32, LayoutUnit>; |
| 55 |
type LayoutRect = TypedRect<f32, LayoutUnit>; |
| 56 |
|
| 57 |
#[no_mangle] |
| 58 |
pub extern "C" fn root( |
| 59 |
length_a: TypedLength<f32, UnknownUnit>, |
| 60 |
length_b: TypedLength<f32, LayoutUnit>, |
| 61 |
length_c: Length<f32>, |
| 62 |
length_d: LayoutLength, |
| 63 |
side_offsets_a: TypedSideOffsets2D<f32, UnknownUnit>, |
| 64 |
side_offsets_b: TypedSideOffsets2D<f32, LayoutUnit>, |
| 65 |
side_offsets_c: SideOffsets2D<f32>, |
| 66 |
side_offsets_d: LayoutSideOffsets2D, |
| 67 |
size_a: TypedSize2D<f32, UnknownUnit>, |
| 68 |
size_b: TypedSize2D<f32, LayoutUnit>, |
| 69 |
size_c: Size2D<f32>, |
| 70 |
size_d: LayoutSize2D, |
| 71 |
point_a: TypedPoint2D<f32, UnknownUnit>, |
| 72 |
point_b: TypedPoint2D<f32, LayoutUnit>, |
| 73 |
point_c: Point2D<f32>, |
| 74 |
point_d: LayoutPoint2D, |
| 75 |
rect_a: TypedRect<f32, UnknownUnit>, |
| 76 |
rect_b: TypedRect<f32, LayoutUnit>, |
| 77 |
rect_c: Rect<f32>, |
| 78 |
rect_d: LayoutRect, |
| 79 |
transform_a: TypedTransform2D<f32, UnknownUnit, LayoutUnit>, |
| 80 |
transform_b: TypedTransform2D<f32, LayoutUnit, UnknownUnit> |
| 81 |
) { } |