Skip to content

Commit

Permalink
Add mix-blend-mode to public API
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Sep 17, 2021
1 parent adf4ee0 commit 44f91d8
Show file tree
Hide file tree
Showing 11 changed files with 547 additions and 17 deletions.
29 changes: 27 additions & 2 deletions api.json
Original file line number Diff line number Diff line change
Expand Up @@ -3638,7 +3638,7 @@
{"TransformOrigin": {}},
{"PerspectiveOrigin": {}},
{"BackfaceVisibility": {}},
{"BlendMode": {}},
{"MixBlendMode": {}},
{"Filter": {}},
{"BackdropFilter": {}},
{"TextShadow": {}}
Expand Down Expand Up @@ -5371,6 +5371,27 @@
{ "Exact": { "type": "StyleBackfaceVisibility" }}
]
},
"StyleMixBlendModeValue": {
"external": "azul_impl::css::StyleMixBlendModeValue",
"derive": ["Copy"],
"enum_fields": [
{ "Auto": { }} ,
{ "None": { }} ,
{ "Inherit": { }} ,
{ "Initial": { }} ,
{ "Exact": { "type": "StyleMixBlendMode" }}
]
},
"StyleFilterVecValue": {
"external": "azul_impl::css::StyleFilterVecValue",
"enum_fields": [
{ "Auto": { }} ,
{ "None": { }} ,
{ "Inherit": { }} ,
{ "Initial": { }} ,
{ "Exact": { "type": "StyleFilterVec" }}
]
},
"CssProperty": {
"doc": "Parsed CSS key-value pair",
"external": "azul_impl::css::CssProperty",
Expand Down Expand Up @@ -5444,7 +5465,11 @@
{"Transform": {"type": "StyleTransformVecValue"}},
{"TransformOrigin": {"type": "StyleTransformOriginValue"}},
{"PerspectiveOrigin": {"type": "StylePerspectiveOriginValue"}},
{"BackfaceVisibility": {"type": "StyleBackfaceVisibilityValue"}}
{"BackfaceVisibility": {"type": "StyleBackfaceVisibilityValue"}},
{"MixBlendMode": {"type": "StyleMixBlendModeValue"}},
{"Filter": {"type": "StyleFilterVecValue"}},
{"BackdropFilter": {"type": "StyleFilterVecValue"}},
{"TextShadow": {"type": "StyleBoxShadowValue"}}
],
"functions": {
"get_key_string": {
Expand Down
14 changes: 13 additions & 1 deletion api/_patches/azul.rs/css.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
StyleBackgroundRepeatVec,
StyleTransformVec,
StyleFontFamilyVec,
StyleFilterVec,
};

macro_rules! css_property_from_type {($prop_type:expr, $content_type:ident) => ({
Expand Down Expand Up @@ -79,6 +80,10 @@
CssPropertyType::PerspectiveOrigin => CssProperty::PerspectiveOrigin(StylePerspectiveOriginValue::$content_type),
CssPropertyType::TransformOrigin => CssProperty::TransformOrigin(StyleTransformOriginValue::$content_type),
CssPropertyType::BackfaceVisibility => CssProperty::BackfaceVisibility(StyleBackfaceVisibilityValue::$content_type),
CssPropertyType::MixBlendMode => CssProperty::MixBlendMode(StyleMixBlendModeValue::$content_type),
CssPropertyType::Filter => CssProperty::Filter(StyleFilterVecValue::$content_type),
CssPropertyType::BackdropFilter => CssProperty::BackdropFilter(StyleFilterVecValue::$content_type),
CssPropertyType::TextShadow => CssProperty::TextShadow(StyleBoxShadowValue::$content_type),
}
})}

Expand Down Expand Up @@ -157,6 +162,10 @@
CssProperty::PerspectiveOrigin(_) => CssPropertyType::PerspectiveOrigin,
CssProperty::TransformOrigin(_) => CssPropertyType::TransformOrigin,
CssProperty::BackfaceVisibility(_) => CssPropertyType::BackfaceVisibility,
CssProperty::MixBlendMode(_) => CssPropertyType::MixBlendMode,
CssProperty::Filter(_) => CssPropertyType::Filter,
CssProperty::BackdropFilter(_) => CssPropertyType::BackdropFilter,
CssProperty::TextShadow(_) => CssPropertyType::TextShadow,
}
}

Expand Down Expand Up @@ -236,7 +245,10 @@
pub const fn transform_origin(input: StyleTransformOrigin) -> Self { CssProperty::TransformOrigin(StyleTransformOriginValue::Exact(input)) }
pub const fn perspective_origin(input: StylePerspectiveOrigin) -> Self { CssProperty::PerspectiveOrigin(StylePerspectiveOriginValue::Exact(input)) }
pub const fn backface_visiblity(input: StyleBackfaceVisibility) -> Self { CssProperty::BackfaceVisibility(StyleBackfaceVisibilityValue::Exact(input)) }

pub const fn mix_blend_mode(input: StyleMixBlendMode) -> Self { CssProperty::MixBlendMode(StyleMixBlendModeValue::Exact(input)) }
pub const fn filter(input: StyleFilterVec) -> Self { CssProperty::Filter(StyleFilterVecValue::Exact(input)) }
pub const fn backdrop_filter(input: StyleFilterVec) -> Self { CssProperty::BackdropFilter(StyleFilterVecValue::Exact(input)) }
pub const fn text_shadow(input: StyleBoxShadow) -> Self { CssProperty::TextShadow(StyleBoxShadowValue::Exact(input)) }
}

const FP_PRECISION_MULTIPLIER: f32 = 1000.0;
Expand Down
3 changes: 2 additions & 1 deletion api/_patches/azul.rs/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@
impl_vec_clone!(AzInputNodeAndIndex, AzInputNodeAndIndexVec, AzInputNodeAndIndexVecDestructor);
impl_vec!(AzLogicalRect, AzLogicalRectVec, AzLogicalRectVecDestructor, az_logical_rect_vec_destructor, AzLogicalRectVec_delete);
impl_vec_clone!(AzLogicalRect, AzLogicalRectVec, AzLogicalRectVecDestructor);

impl_vec!(AzStyleFilter, AzStyleFilterVec, AzStyleFilterVecDestructor, az_style_filter_vec_destructor, AzStyleFilterVec_delete);
impl_vec_clone!(AzStyleFilter, AzStyleFilterVec, AzStyleFilterVecDestructor);

impl_vec!(AzAccessibilityState, AzAccessibilityStateVec, AzAccessibilityStateVecDestructor, az_accessibility_state_vec_destructor, AzAccessibilityStateVec_delete);
impl_vec_clone!(AzAccessibilityState, AzAccessibilityStateVec, AzAccessibilityStateVecDestructor);
Expand Down
Loading

0 comments on commit 44f91d8

Please sign in to comment.