This commit is contained in:
Emilio Cobos Álvarez 2016-08-15 03:34:02 -07:00
parent 46afc56c41
commit 9a5ffb128a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 50 additions and 36 deletions

View file

@ -106,8 +106,6 @@ COMPILATION_TARGETS = {
"Maybe", # <- AlignedStorage, which means templated union, which "Maybe", # <- AlignedStorage, which means templated union, which
# means impossible to represent in stable rust as of # means impossible to represent in stable rust as of
# right now. # right now.
# Union handling falls over for templated types.
"StyleShapeSource", "StyleClipPath", "StyleShapeOutside",
], ],
}, },
# Generation of the ffi bindings. # Generation of the ffi bindings.

View file

@ -6389,25 +6389,33 @@ fn bindgen_test_layout_StyleBasicShape() {
assert_eq!(::std::mem::align_of::<StyleBasicShape>() , 8usize); assert_eq!(::std::mem::align_of::<StyleBasicShape>() , 8usize);
} }
#[repr(C)] #[repr(C)]
pub struct StyleShapeSource; #[derive(Debug)]
#[repr(C)] pub struct StyleShapeSource<ReferenceBox> {
pub struct StyleClipPath { pub StyleShapeSource_nsStyleStruct_h_unnamed_26: StyleShapeSource_nsStyleStruct_h_unnamed_26<ReferenceBox>,
pub _bindgen_opaque_blob: [u64; 2usize], pub mType: StyleShapeSourceType,
} pub mReferenceBox: ReferenceBox,
#[test]
fn bindgen_test_layout_StyleClipPath() {
assert_eq!(::std::mem::size_of::<StyleClipPath>() , 16usize);
assert_eq!(::std::mem::align_of::<StyleClipPath>() , 8usize);
} }
#[repr(C)] #[repr(C)]
pub struct StyleShapeOutside { #[derive(Debug, Copy, Clone)]
pub _bindgen_opaque_blob: [u64; 2usize], pub struct StyleShapeSource_nsStyleStruct_h_unnamed_26<ReferenceBox> {
pub mBasicShape: __BindgenUnionField<*mut StyleBasicShape>,
pub mURL: __BindgenUnionField<*mut FragmentOrURL>,
pub _bindgen_data_: u64,
pub _phantom0: ::std::marker::PhantomData<ReferenceBox>,
} }
#[test] impl <ReferenceBox> StyleShapeSource_nsStyleStruct_h_unnamed_26<ReferenceBox>
fn bindgen_test_layout_StyleShapeOutside() { {
assert_eq!(::std::mem::size_of::<StyleShapeOutside>() , 16usize); pub unsafe fn mBasicShape(&mut self) -> *mut *mut StyleBasicShape {
assert_eq!(::std::mem::align_of::<StyleShapeOutside>() , 8usize); let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn mURL(&mut self) -> *mut *mut FragmentOrURL {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
} }
pub type StyleClipPath = StyleShapeSource<StyleClipPathGeometryBox>;
pub type StyleShapeOutside = StyleShapeSource<StyleShapeOutsideShapeBox>;
#[repr(C)] #[repr(C)]
pub struct nsStyleDisplay { pub struct nsStyleDisplay {
pub mBinding: RefPtr<URLValue>, pub mBinding: RefPtr<URLValue>,
@ -6461,7 +6469,7 @@ pub struct nsStyleDisplay {
pub mAnimationFillModeCount: u32, pub mAnimationFillModeCount: u32,
pub mAnimationPlayStateCount: u32, pub mAnimationPlayStateCount: u32,
pub mAnimationIterationCountCount: u32, pub mAnimationIterationCountCount: u32,
pub mShapeOutside: [u64; 2usize], pub mShapeOutside: StyleShapeOutside,
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleDisplay() { fn bindgen_test_layout_nsStyleDisplay() {
@ -6794,7 +6802,7 @@ fn bindgen_test_layout_nsStyleFilter() {
#[repr(C)] #[repr(C)]
pub struct nsStyleSVGReset { pub struct nsStyleSVGReset {
pub mMask: nsStyleImageLayers, pub mMask: nsStyleImageLayers,
pub mClipPath: [u64; 2usize], pub mClipPath: StyleClipPath,
pub mStopColor: nscolor, pub mStopColor: nscolor,
pub mFloodColor: nscolor, pub mFloodColor: nscolor,
pub mLightingColor: nscolor, pub mLightingColor: nscolor,

View file

@ -6367,25 +6367,33 @@ fn bindgen_test_layout_StyleBasicShape() {
assert_eq!(::std::mem::align_of::<StyleBasicShape>() , 8usize); assert_eq!(::std::mem::align_of::<StyleBasicShape>() , 8usize);
} }
#[repr(C)] #[repr(C)]
pub struct StyleShapeSource; #[derive(Debug)]
#[repr(C)] pub struct StyleShapeSource<ReferenceBox> {
pub struct StyleClipPath { pub StyleShapeSource_nsStyleStruct_h_unnamed_26: StyleShapeSource_nsStyleStruct_h_unnamed_26<ReferenceBox>,
pub _bindgen_opaque_blob: [u64; 2usize], pub mType: StyleShapeSourceType,
} pub mReferenceBox: ReferenceBox,
#[test]
fn bindgen_test_layout_StyleClipPath() {
assert_eq!(::std::mem::size_of::<StyleClipPath>() , 16usize);
assert_eq!(::std::mem::align_of::<StyleClipPath>() , 8usize);
} }
#[repr(C)] #[repr(C)]
pub struct StyleShapeOutside { #[derive(Debug, Copy, Clone)]
pub _bindgen_opaque_blob: [u64; 2usize], pub struct StyleShapeSource_nsStyleStruct_h_unnamed_26<ReferenceBox> {
pub mBasicShape: __BindgenUnionField<*mut StyleBasicShape>,
pub mURL: __BindgenUnionField<*mut FragmentOrURL>,
pub _bindgen_data_: u64,
pub _phantom0: ::std::marker::PhantomData<ReferenceBox>,
} }
#[test] impl <ReferenceBox> StyleShapeSource_nsStyleStruct_h_unnamed_26<ReferenceBox>
fn bindgen_test_layout_StyleShapeOutside() { {
assert_eq!(::std::mem::size_of::<StyleShapeOutside>() , 16usize); pub unsafe fn mBasicShape(&mut self) -> *mut *mut StyleBasicShape {
assert_eq!(::std::mem::align_of::<StyleShapeOutside>() , 8usize); let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn mURL(&mut self) -> *mut *mut FragmentOrURL {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
} }
pub type StyleClipPath = StyleShapeSource<StyleClipPathGeometryBox>;
pub type StyleShapeOutside = StyleShapeSource<StyleShapeOutsideShapeBox>;
#[repr(C)] #[repr(C)]
pub struct nsStyleDisplay { pub struct nsStyleDisplay {
pub mBinding: RefPtr<URLValue>, pub mBinding: RefPtr<URLValue>,
@ -6439,7 +6447,7 @@ pub struct nsStyleDisplay {
pub mAnimationFillModeCount: u32, pub mAnimationFillModeCount: u32,
pub mAnimationPlayStateCount: u32, pub mAnimationPlayStateCount: u32,
pub mAnimationIterationCountCount: u32, pub mAnimationIterationCountCount: u32,
pub mShapeOutside: [u64; 2usize], pub mShapeOutside: StyleShapeOutside,
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleDisplay() { fn bindgen_test_layout_nsStyleDisplay() {
@ -6771,7 +6779,7 @@ fn bindgen_test_layout_nsStyleFilter() {
#[repr(C)] #[repr(C)]
pub struct nsStyleSVGReset { pub struct nsStyleSVGReset {
pub mMask: nsStyleImageLayers, pub mMask: nsStyleImageLayers,
pub mClipPath: [u64; 2usize], pub mClipPath: StyleClipPath,
pub mStopColor: nscolor, pub mStopColor: nscolor,
pub mFloodColor: nscolor, pub mFloodColor: nscolor,
pub mLightingColor: nscolor, pub mLightingColor: nscolor,