Skip to content

Commit

Permalink
Update bindings for StyleImageLayerRepeat
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jun 9, 2017
1 parent e46aa87 commit fd0ac4f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 29 deletions.
21 changes: 12 additions & 9 deletions components/style/gecko/generated/structs_debug.rs
Expand Up @@ -258,13 +258,6 @@ pub mod root {
pub const NS_STYLE_IMAGELAYER_POSITION_BOTTOM: ::std::os::raw::c_uint = 4;
pub const NS_STYLE_IMAGELAYER_POSITION_LEFT: ::std::os::raw::c_uint = 8;
pub const NS_STYLE_IMAGELAYER_POSITION_RIGHT: ::std::os::raw::c_uint = 16;
pub const NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT: ::std::os::raw::c_uint =
0;
pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT_X: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT_Y: ::std::os::raw::c_uint = 2;
pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT: ::std::os::raw::c_uint = 3;
pub const NS_STYLE_IMAGELAYER_REPEAT_SPACE: ::std::os::raw::c_uint = 4;
pub const NS_STYLE_IMAGELAYER_REPEAT_ROUND: ::std::os::raw::c_uint = 5;
pub const NS_STYLE_IMAGELAYER_SIZE_CONTAIN: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_IMAGELAYER_SIZE_COVER: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_MASK_MODE_ALPHA: ::std::os::raw::c_uint = 0;
Expand Down Expand Up @@ -6420,6 +6413,16 @@ pub mod root {
}
#[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum StyleImageLayerRepeat {
NoRepeat = 0,
RepeatX = 1,
RepeatY = 2,
Repeat = 3,
Space = 4,
Round = 5,
}
#[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum StyleDisplay {
None = 0,
Block = 1,
Expand Down Expand Up @@ -29977,8 +29980,8 @@ pub mod root {
#[repr(C)]
#[derive(Debug, Copy)]
pub struct nsStyleImageLayers_Repeat {
pub mXRepeat: u8,
pub mYRepeat: u8,
pub mXRepeat: root::mozilla::StyleImageLayerRepeat,
pub mYRepeat: root::mozilla::StyleImageLayerRepeat,
}
#[test]
fn bindgen_test_layout_nsStyleImageLayers_Repeat() {
Expand Down
21 changes: 12 additions & 9 deletions components/style/gecko/generated/structs_release.rs
Expand Up @@ -258,13 +258,6 @@ pub mod root {
pub const NS_STYLE_IMAGELAYER_POSITION_BOTTOM: ::std::os::raw::c_uint = 4;
pub const NS_STYLE_IMAGELAYER_POSITION_LEFT: ::std::os::raw::c_uint = 8;
pub const NS_STYLE_IMAGELAYER_POSITION_RIGHT: ::std::os::raw::c_uint = 16;
pub const NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT: ::std::os::raw::c_uint =
0;
pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT_X: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT_Y: ::std::os::raw::c_uint = 2;
pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT: ::std::os::raw::c_uint = 3;
pub const NS_STYLE_IMAGELAYER_REPEAT_SPACE: ::std::os::raw::c_uint = 4;
pub const NS_STYLE_IMAGELAYER_REPEAT_ROUND: ::std::os::raw::c_uint = 5;
pub const NS_STYLE_IMAGELAYER_SIZE_CONTAIN: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_IMAGELAYER_SIZE_COVER: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_MASK_MODE_ALPHA: ::std::os::raw::c_uint = 0;
Expand Down Expand Up @@ -6276,6 +6269,16 @@ pub mod root {
}
#[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum StyleImageLayerRepeat {
NoRepeat = 0,
RepeatX = 1,
RepeatY = 2,
Repeat = 3,
Space = 4,
Round = 5,
}
#[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum StyleDisplay {
None = 0,
Block = 1,
Expand Down Expand Up @@ -29432,8 +29435,8 @@ pub mod root {
#[repr(C)]
#[derive(Debug, Copy)]
pub struct nsStyleImageLayers_Repeat {
pub mXRepeat: u8,
pub mYRepeat: u8,
pub mXRepeat: root::mozilla::StyleImageLayerRepeat,
pub mYRepeat: root::mozilla::StyleImageLayerRepeat,
}
#[test]
fn bindgen_test_layout_nsStyleImageLayers_Repeat() {
Expand Down
19 changes: 8 additions & 11 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -2989,25 +2989,22 @@ fn static_assert() {
<%self:simple_image_array_property name="repeat" shorthand="${shorthand}" field_name="mRepeat">
use properties::longhands::${shorthand}_repeat::single_value::computed_value::RepeatKeyword;
use gecko_bindings::structs::nsStyleImageLayers_Repeat;
use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_REPEAT;
use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT;
use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_SPACE;
use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_ROUND;
use gecko_bindings::structs::StyleImageLayerRepeat;

fn to_ns(repeat: RepeatKeyword) -> u32 {
fn to_ns(repeat: RepeatKeyword) -> StyleImageLayerRepeat {
match repeat {
RepeatKeyword::Repeat => NS_STYLE_IMAGELAYER_REPEAT_REPEAT,
RepeatKeyword::Space => NS_STYLE_IMAGELAYER_REPEAT_SPACE,
RepeatKeyword::Round => NS_STYLE_IMAGELAYER_REPEAT_ROUND,
RepeatKeyword::NoRepeat => NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT,
RepeatKeyword::Repeat => StyleImageLayerRepeat::Repeat,
RepeatKeyword::Space => StyleImageLayerRepeat::Space,
RepeatKeyword::Round => StyleImageLayerRepeat::Round,
RepeatKeyword::NoRepeat => StyleImageLayerRepeat::NoRepeat,
}
}

let repeat_x = to_ns(servo.0);
let repeat_y = to_ns(servo.1);
nsStyleImageLayers_Repeat {
mXRepeat: repeat_x as u8,
mYRepeat: repeat_y as u8,
mXRepeat: repeat_x,
mYRepeat: repeat_y,
}
</%self:simple_image_array_property>

Expand Down

0 comments on commit fd0ac4f

Please sign in to comment.