[librsvg: 5/8] Rename FilterPrimitiveFoo to FeFoo



commit 1dd198efd6759cae99e0ea7b741d789caab60082
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu May 16 19:51:57 2019 -0500

    Rename FilterPrimitiveFoo to FeFoo
    
    Elements for filter primitives are called feBlend, feDisplacementMap,
    etc.
    
    This strategically makes the names shorter so *that* fucking table can
    be aligned nicely while maintaining the maximum line length :)

 rsvg_internals/src/create_node.rs   | 112 ++++++++++++++++++------------------
 rsvg_internals/src/filters/merge.rs |   4 +-
 rsvg_internals/src/node.rs          |  70 +++++++++++-----------
 3 files changed, 93 insertions(+), 93 deletions(-)
---
diff --git a/rsvg_internals/src/create_node.rs b/rsvg_internals/src/create_node.rs
index e8d0f7de..c6758dd4 100644
--- a/rsvg_internals/src/create_node.rs
+++ b/rsvg_internals/src/create_node.rs
@@ -48,66 +48,66 @@ macro_rules! n {
 mod creators {
     use super::*;
 
-    n!(create_circle,                    Circle,                           NodeCircle::new);
-    n!(create_clip_path,                 ClipPath,                         NodeClipPath::new);
-    n!(create_blend,                     FilterPrimitiveBlend,             Blend::new);
-    n!(create_color_matrix,              FilterPrimitiveColorMatrix,       ColorMatrix::new);
-    n!(create_component_transfer,        FilterPrimitiveComponentTransfer, ComponentTransfer::new);
-    n!(create_component_transfer_func_a, ComponentTransferFunctionA,       FuncX::new_a);
-    n!(create_component_transfer_func_b, ComponentTransferFunctionB,       FuncX::new_b);
-    n!(create_component_transfer_func_g, ComponentTransferFunctionG,       FuncX::new_g);
-    n!(create_component_transfer_func_r, ComponentTransferFunctionR,       FuncX::new_r);
-    n!(create_composite,                 FilterPrimitiveComposite,         Composite::new);
-    n!(create_convolve_matrix,           FilterPrimitiveConvolveMatrix,    ConvolveMatrix::new);
-    n!(create_defs,                      Defs,                             NodeNonRendering::new);
-    n!(create_diffuse_lighting,          FilterPrimitiveDiffuseLighting,   Lighting::new_diffuse);
-    n!(create_distant_light,             DistantLight,                     LightSource::new_distant_light);
-    n!(create_displacement_map,          FilterPrimitiveDisplacementMap,   DisplacementMap::new);
-    n!(create_ellipse,                   Ellipse,                          NodeEllipse::new);
-    n!(create_filter,                    Filter,                           NodeFilter::new);
-    n!(create_flood,                     FilterPrimitiveFlood,             Flood::new);
-    n!(create_gaussian_blur,             FilterPrimitiveGaussianBlur,      GaussianBlur::new);
-    n!(create_group,                     Group,                            NodeGroup::new);
-    n!(create_image,                     Image,                            NodeImage::new);
-    n!(create_fe_image,                  FilterPrimitiveImage,             Image::new);
-    n!(create_linear_gradient,           LinearGradient,                   NodeGradient::new_linear);
-    n!(create_line,                      Line,                             NodeLine::new);
-    n!(create_link,                      Link,                             NodeLink::new);
-    n!(create_marker,                    Marker,                           NodeMarker::new);
-    n!(create_mask,                      Mask,                             NodeMask::new);
-    n!(create_merge,                     FilterPrimitiveMerge,             Merge::new);
-    n!(create_merge_node,                FilterPrimitiveMergeNode,         MergeNode::new);
-    n!(create_morphology,                FilterPrimitiveMorphology,        Morphology::new);
-    n!(create_non_rendering,             NonRendering,                     NodeNonRendering::new);
-    n!(create_offset,                    FilterPrimitiveOffset,            Offset::new);
-    n!(create_path,                      Path,                             NodePath::new);
-    n!(create_pattern,                   Pattern,                          NodePattern::new);
-    n!(create_point_light,               PointLight,                       LightSource::new_point_light);
-    n!(create_polygon,                   Polygon,                          NodePoly::new_closed);
-    n!(create_polyline,                  Polyline,                         NodePoly::new_open);
-    n!(create_radial_gradient,           RadialGradient,                   NodeGradient::new_radial);
-    n!(create_rect,                      Rect,                             NodeRect::new);
-    n!(create_specular_lighting,         FilterPrimitiveSpecularLighting,  Lighting::new_specular);
-    n!(create_spot_light,                SpotLight,                        LightSource::new_spot_light);
-    n!(create_stop,                      Stop,                             NodeStop::new);
-    n!(create_style,                     Style,                            NodeStyle::new);
-    n!(create_svg,                       Svg,                              NodeSvg::new);
-    n!(create_switch,                    Switch,                           NodeSwitch::new);
-    n!(create_symbol,                    Symbol,                           NodeSymbol::new);
-    n!(create_text,                      Text,                             NodeText::new);
-    n!(create_tref,                      TRef,                             NodeTRef::new);
-    n!(create_tspan,                     TSpan,                            NodeTSpan::new);
-    n!(create_tile,                      FilterPrimitiveTile,              Tile::new);
-    n!(create_turbulence,                FilterPrimitiveTurbulence,        Turbulence::new);
-    n!(create_use,                       Use,                              NodeUse::new);
+    n!(create_circle,                    Circle,                     NodeCircle::new);
+    n!(create_clip_path,                 ClipPath,                   NodeClipPath::new);
+    n!(create_blend,                     FeBlend,                    Blend::new);
+    n!(create_color_matrix,              FeColorMatrix,              ColorMatrix::new);
+    n!(create_component_transfer,        FeComponentTransfer,        ComponentTransfer::new);
+    n!(create_component_transfer_func_a, ComponentTransferFunctionA, FuncX::new_a);
+    n!(create_component_transfer_func_b, ComponentTransferFunctionB, FuncX::new_b);
+    n!(create_component_transfer_func_g, ComponentTransferFunctionG, FuncX::new_g);
+    n!(create_component_transfer_func_r, ComponentTransferFunctionR, FuncX::new_r);
+    n!(create_composite,                 FeComposite,                Composite::new);
+    n!(create_convolve_matrix,           FeConvolveMatrix,           ConvolveMatrix::new);
+    n!(create_defs,                      Defs,                       NodeNonRendering::new);
+    n!(create_diffuse_lighting,          FeDiffuseLighting,          Lighting::new_diffuse);
+    n!(create_distant_light,             DistantLight,               LightSource::new_distant_light);
+    n!(create_displacement_map,          FeDisplacementMap,          DisplacementMap::new);
+    n!(create_ellipse,                   Ellipse,                    NodeEllipse::new);
+    n!(create_filter,                    Filter,                     NodeFilter::new);
+    n!(create_flood,                     FeFlood,                    Flood::new);
+    n!(create_gaussian_blur,             FeGaussianBlur,             GaussianBlur::new);
+    n!(create_group,                     Group,                      NodeGroup::new);
+    n!(create_image,                     Image,                      NodeImage::new);
+    n!(create_fe_image,                  FeImage,                    Image::new);
+    n!(create_linear_gradient,           LinearGradient,             NodeGradient::new_linear);
+    n!(create_line,                      Line,                       NodeLine::new);
+    n!(create_link,                      Link,                       NodeLink::new);
+    n!(create_marker,                    Marker,                     NodeMarker::new);
+    n!(create_mask,                      Mask,                       NodeMask::new);
+    n!(create_merge,                     FeMerge,                    Merge::new);
+    n!(create_merge_node,                FeMergeNode,                MergeNode::new);
+    n!(create_morphology,                FeMorphology,               Morphology::new);
+    n!(create_non_rendering,             NonRendering,               NodeNonRendering::new);
+    n!(create_offset,                    FeOffset,                   Offset::new);
+    n!(create_path,                      Path,                       NodePath::new);
+    n!(create_pattern,                   Pattern,                    NodePattern::new);
+    n!(create_point_light,               PointLight,                 LightSource::new_point_light);
+    n!(create_polygon,                   Polygon,                    NodePoly::new_closed);
+    n!(create_polyline,                  Polyline,                   NodePoly::new_open);
+    n!(create_radial_gradient,           RadialGradient,             NodeGradient::new_radial);
+    n!(create_rect,                      Rect,                       NodeRect::new);
+    n!(create_specular_lighting,         FeSpecularLighting,         Lighting::new_specular);
+    n!(create_spot_light,                SpotLight,                  LightSource::new_spot_light);
+    n!(create_stop,                      Stop,                       NodeStop::new);
+    n!(create_style,                     Style,                      NodeStyle::new);
+    n!(create_svg,                       Svg,                        NodeSvg::new);
+    n!(create_switch,                    Switch,                     NodeSwitch::new);
+    n!(create_symbol,                    Symbol,                     NodeSymbol::new);
+    n!(create_text,                      Text,                       NodeText::new);
+    n!(create_tref,                      TRef,                       NodeTRef::new);
+    n!(create_tspan,                     TSpan,                      NodeTSpan::new);
+    n!(create_tile,                      FeTile,                     Tile::new);
+    n!(create_turbulence,                FeTurbulence,               Turbulence::new);
+    n!(create_use,                       Use,                        NodeUse::new);
 
     // hack to partially support conical gradient
-    n!(create_conical_gradient,          RadialGradient,                   NodeGradient::new_radial);
+    n!(create_conical_gradient,          RadialGradient,             NodeGradient::new_radial);
 
     // hack to make multiImage sort-of work
-    n!(create_multi_image,               Switch,                           NodeSwitch::new);
-    n!(create_sub_image,                 Group,                            NodeGroup::new);
-    n!(create_sub_image_ref,             Image,                            NodeImage::new);
+    n!(create_multi_image,               Switch,                     NodeSwitch::new);
+    n!(create_sub_image,                 Group,                      NodeGroup::new);
+    n!(create_sub_image_ref,             Image,                      NodeImage::new);
 }
 
 use creators::*;
diff --git a/rsvg_internals/src/filters/merge.rs b/rsvg_internals/src/filters/merge.rs
index 8d2595c7..e67be776 100644
--- a/rsvg_internals/src/filters/merge.rs
+++ b/rsvg_internals/src/filters/merge.rs
@@ -129,7 +129,7 @@ impl Filter for Merge {
         let mut bounds = self.base.get_bounds(ctx);
         for child in node
             .children()
-            .filter(|c| c.get_type() == NodeType::FilterPrimitiveMergeNode)
+            .filter(|c| c.get_type() == NodeType::FeMergeNode)
         {
             if child.is_in_error() {
                 return Err(FilterError::ChildNodeInError);
@@ -146,7 +146,7 @@ impl Filter for Merge {
         let mut output_surface = None;
         for child in node
             .children()
-            .filter(|c| c.get_type() == NodeType::FilterPrimitiveMergeNode)
+            .filter(|c| c.get_type() == NodeType::FeMergeNode)
         {
             output_surface = Some(
                 child.with_impl(|c: &MergeNode| c.render(ctx, draw_ctx, bounds, output_surface))?,
diff --git a/rsvg_internals/src/node.rs b/rsvg_internals/src/node.rs
index 1d4db0e3..62be59a4 100644
--- a/rsvg_internals/src/node.rs
+++ b/rsvg_internals/src/node.rs
@@ -390,24 +390,24 @@ pub enum NodeType {
     TSpan,
     Use,
 
-    // Filter primitives
-    FilterPrimitiveBlend,
-    FilterPrimitiveColorMatrix,
-    FilterPrimitiveComponentTransfer,
-    FilterPrimitiveComposite,
-    FilterPrimitiveConvolveMatrix,
-    FilterPrimitiveDiffuseLighting,
-    FilterPrimitiveDisplacementMap,
-    FilterPrimitiveFlood,
-    FilterPrimitiveGaussianBlur,
-    FilterPrimitiveImage,
-    FilterPrimitiveMerge,
-    FilterPrimitiveMergeNode,
-    FilterPrimitiveMorphology,
-    FilterPrimitiveOffset,
-    FilterPrimitiveSpecularLighting,
-    FilterPrimitiveTile,
-    FilterPrimitiveTurbulence,
+    // Filter primitives, these start with "Fe" as element names are e.g. "feBlend"
+    FeBlend,
+    FeColorMatrix,
+    FeComponentTransfer,
+    FeComposite,
+    FeConvolveMatrix,
+    FeDiffuseLighting,
+    FeDisplacementMap,
+    FeFlood,
+    FeGaussianBlur,
+    FeImage,
+    FeMerge,
+    FeMergeNode,
+    FeMorphology,
+    FeOffset,
+    FeSpecularLighting,
+    FeTile,
+    FeTurbulence,
 }
 
 impl RsvgNode {
@@ -453,23 +453,23 @@ impl RsvgNode {
             NodeType::TRef => "tref",
             NodeType::TSpan => "tspan",
             NodeType::Use => "use",
-            NodeType::FilterPrimitiveBlend => "feBlend",
-            NodeType::FilterPrimitiveColorMatrix => "feColorMatrix",
-            NodeType::FilterPrimitiveComponentTransfer => "feComponentTransfer",
-            NodeType::FilterPrimitiveComposite => "feComposite",
-            NodeType::FilterPrimitiveConvolveMatrix => "feConvolveMatrix",
-            NodeType::FilterPrimitiveDiffuseLighting => "feDiffuseLighting",
-            NodeType::FilterPrimitiveDisplacementMap => "feDisplacementMap",
-            NodeType::FilterPrimitiveFlood => "feFlood",
-            NodeType::FilterPrimitiveGaussianBlur => "feGaussianBlur",
-            NodeType::FilterPrimitiveImage => "feImage",
-            NodeType::FilterPrimitiveMerge => "feMerge",
-            NodeType::FilterPrimitiveMergeNode => "feMergeNode",
-            NodeType::FilterPrimitiveMorphology => "feMorphology",
-            NodeType::FilterPrimitiveOffset => "feOffset",
-            NodeType::FilterPrimitiveSpecularLighting => "feSpecularLighting",
-            NodeType::FilterPrimitiveTile => "feTile",
-            NodeType::FilterPrimitiveTurbulence => "feTurbulence",
+            NodeType::FeBlend => "feBlend",
+            NodeType::FeColorMatrix => "feColorMatrix",
+            NodeType::FeComponentTransfer => "feComponentTransfer",
+            NodeType::FeComposite => "feComposite",
+            NodeType::FeConvolveMatrix => "feConvolveMatrix",
+            NodeType::FeDiffuseLighting => "feDiffuseLighting",
+            NodeType::FeDisplacementMap => "feDisplacementMap",
+            NodeType::FeFlood => "feFlood",
+            NodeType::FeGaussianBlur => "feGaussianBlur",
+            NodeType::FeImage => "feImage",
+            NodeType::FeMerge => "feMerge",
+            NodeType::FeMergeNode => "feMergeNode",
+            NodeType::FeMorphology => "feMorphology",
+            NodeType::FeOffset => "feOffset",
+            NodeType::FeSpecularLighting => "feSpecularLighting",
+            NodeType::FeTile => "feTile",
+            NodeType::FeTurbulence => "feTurbulence",
         }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]