chiark / gitweb /
mformat 2: Rename various functions to have _mf1
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 May 2022 11:03:42 +0000 (12:03 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 May 2022 23:18:19 +0000 (00:18 +0100)
These entrypoints are going to be specific to format 1.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/shapelib.rs

index aa96ab0ca605fac736c6b3b351ec38067598501b..833d209a7b722254c99741ca520b1f1c52848918 100644 (file)
@@ -38,7 +38,8 @@ pub trait OutlineDefn: Debug + Sync + Send + 'static {
   /// Called to *check* the group configuration before load, but
   /// with a dummy svg_gz of [1,1].  That must correctly predict
   /// success with other sizes.
-  fn load(&self, lgi: &GroupData, svg_sz: PosC<f64>) -> Result<Outline,LLE>;
+  fn load_mf1(&self, lgi: &GroupData, svg_sz: PosC<f64>)
+              -> Result<Outline,LLE>;
 }
 #[derive(Debug,Clone,Copy)]
 pub struct ShapeCalculable { }
@@ -575,7 +576,7 @@ impl Catalogue {
 
 impl FaceTransform {
   #[throws(LLE)]
-  fn from_group(d: &GroupDetails) -> Self {
+  fn from_group_mf1(d: &GroupDetails) -> Self {
     // by this point d.size has already been scaled by scale
     let scale = if ! d.orig_size.is_empty() && ! d.size.is_empty() {
       izip!(&d.orig_size, &d.size)
@@ -643,8 +644,8 @@ impl GroupData {
 
   #[throws(LibraryLoadError)]
   fn load_shape(&self, svg_sz: PosC<f64>) -> (FaceTransform, Outline) {
-    let xform = FaceTransform::from_group(&self.d)?;
-    let outline = self.d.outline.load(&self, svg_sz)?;
+    let xform = FaceTransform::from_group_mf1(&self.d)?;
+    let outline = self.d.outline.load_mf1(&self, svg_sz)?;
     (xform, outline)
   }
 }
@@ -706,7 +707,7 @@ struct RectDefn { }
 #[typetag::deserialize(name="Rect")]
 impl OutlineDefn for RectDefn {
   #[throws(LibraryLoadError)]
-  fn load(&self, lgd: &GroupData, _svg_sz: PosC<f64>) -> Outline {
+  fn load_mf1(&self, lgd: &GroupData, _svg_sz: PosC<f64>) -> Outline {
     Self::get(lgd)?.into()
   }
 }
@@ -744,7 +745,7 @@ struct CircleDefn { }
 #[typetag::deserialize(name="Circle")]
 impl OutlineDefn for CircleDefn {
   #[throws(LibraryLoadError)]
-  fn load(&self, lgd: &GroupData, _svg_sz: PosC<f64>) -> Outline {
+  fn load_mf1(&self, lgd: &GroupData, _svg_sz: PosC<f64>) -> Outline {
     CircleShape {
       diam: Self::get_size(lgd)?,
     }.into()