Skip to content

Commit

Permalink
Regenerate bindings and fix up for nsStyleImageLayers_Position change…
Browse files Browse the repository at this point in the history
…s in Gecko bug 1295084.
  • Loading branch information
bholley committed Aug 26, 2016
1 parent 8e39313 commit 7e72e5c
Show file tree
Hide file tree
Showing 4 changed files with 664 additions and 597 deletions.
17 changes: 9 additions & 8 deletions components/style/gecko_conversions.rs
Expand Up @@ -82,14 +82,15 @@ impl From<nsStyleCoord_CalcValue> for LengthOrPercentage {

pub mod basic_shape {
use euclid::size::Size2D;
use gecko_bindings::structs;
use gecko_bindings::structs::StyleClipPathGeometryBox;
use gecko_bindings::structs::{StyleBasicShape, StyleBasicShapeType, StyleFillRule};
use gecko_bindings::structs::{nsStyleCoord, nsStyleCorners, nsStyleImageLayers_Position};
use gecko_bindings::structs::{nsStyleCoord, nsStyleCorners};
use gecko_bindings::sugar::ns_style_coord::{CoordDataMut, CoordDataValue};
use gecko_values::GeckoStyleCoordConvertible;
use std::borrow::Borrow;
use values::computed::basic_shape::*;
use values::computed::position::Position;
use values::computed::position;
use values::computed::{BorderRadiusSize, LengthOrPercentage};

// using Borrow so that we can have a non-moving .into()
Expand Down Expand Up @@ -196,10 +197,10 @@ pub mod basic_shape {
}

// Can't be a From impl since we need to set an existing
// nsStyleImageLayers_Position, not create a new one
impl From<Position> for nsStyleImageLayers_Position {
fn from(other: Position) -> Self {
nsStyleImageLayers_Position {
// Position, not create a new one
impl From<position::Position> for structs::Position {
fn from(other: position::Position) -> Self {
structs::Position {
mXPosition: other.horizontal.into(),
mYPosition: other.vertical.into()
}
Expand All @@ -214,10 +215,10 @@ pub mod basic_shape {
}
}

impl<T: Borrow<nsStyleImageLayers_Position>> From<T> for Position {
impl<T: Borrow<structs::Position>> From<T> for position::Position {
fn from(other: T) -> Self {
let other = other.borrow();
Position {
position::Position {
horizontal: other.mXPosition.into(),
vertical: other.mYPosition.into(),
}
Expand Down
2 changes: 1 addition & 1 deletion ports/geckolib/gecko_bindings/bindings.rs
Expand Up @@ -342,7 +342,7 @@ extern "C" {
pub fn Gecko_NewBasicShape(type_: StyleBasicShapeType)
-> *mut StyleBasicShape;
pub fn Gecko_FillAllBackgroundLists(layers: *mut nsStyleImageLayers,
maxLen: u32);
max_len: u32);
pub fn Gecko_AddRefCalcArbitraryThread(aPtr: *mut Calc);
pub fn Gecko_ReleaseCalcArbitraryThread(aPtr: *mut Calc);
pub fn Gecko_Construct_nsStyleFont(ptr: *mut nsStyleFont);
Expand Down

0 comments on commit 7e72e5c

Please sign in to comment.