]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/vaticana-ligature.cc
Doc [nl]: Translation update.
[lilypond.git] / lily / vaticana-ligature.cc
index d07a1ba370e36dc575bd7d9f95341b0449c4beb1..7a00cff3003b9075d3278a9f11cc72900dd8eaeb 100644 (file)
@@ -1,21 +1,32 @@
 /*
-  vaticana-ligature.cc -- implement Vaticana_ligature
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2003--2011 Juergen Reuter <reuter@ipd.uka.de>
 
-  (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "vaticana-ligature.hh"
 
-
-#include "item.hh"
+#include "bezier.hh"
 #include "font-interface.hh"
+#include "international.hh"
+#include "item.hh"
 #include "lookup.hh"
-#include "staff-symbol-referencer.hh"
 #include "note-head.hh"
 #include "output-def.hh"
-#include "bezier.hh"
+#include "staff-symbol-referencer.hh"
 #include "warn.hh"
 
 Stencil
@@ -25,7 +36,7 @@ vaticana_brew_cauda (Grob *me,
                     Real thickness,
                     Real blotdiameter)
 {
-  bool on_staffline = Staff_symbol_referencer::on_staffline (me, pos);
+  bool on_staffline = Staff_symbol_referencer::on_line (me, pos);
   int interspaces = Staff_symbol_referencer::line_count (me) - 1;
   bool above_staff = pos > interspaces;
 
@@ -126,7 +137,7 @@ vaticana_brew_flexa (Grob *me,
   if (solid)
     {
       Stencil solid_head
-       = Lookup::bezier_sandwich (top_curve, bottom_curve);
+       = Lookup::bezier_sandwich (top_curve, bottom_curve, 0.0);
       stencil.add_stencil (solid_head);
     }
   else // outline
@@ -134,13 +145,13 @@ vaticana_brew_flexa (Grob *me,
       Bezier inner_top_curve = top_curve;
       inner_top_curve.translate (Offset (0.0, -line_thickness));
       Stencil top_edge
-       = Lookup::bezier_sandwich (top_curve, inner_top_curve);
+       = Lookup::bezier_sandwich (top_curve, inner_top_curve, 0.0);
       stencil.add_stencil (top_edge);
 
       Bezier inner_bottom_curve = bottom_curve;
       inner_bottom_curve.translate (Offset (0.0, +line_thickness));
       Stencil bottom_edge
-       = Lookup::bezier_sandwich (bottom_curve, inner_bottom_curve);
+       = Lookup::bezier_sandwich (bottom_curve, inner_bottom_curve, 0.0);
       stencil.add_stencil (bottom_edge);
 
       /*
@@ -174,9 +185,9 @@ vaticana_brew_join (Grob *me, int delta_pitch,
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   if (!delta_pitch)
     {
-      me->programming_error (_f ("Vaticana_ligature: "
-                                "zero join (delta_pitch == 0)"));
-      return Stencil ();
+      me->programming_error (_ ("Vaticana_ligature: "
+                               "zero join (delta_pitch == 0)"));
+      return Lookup::blank (Box (Interval (0, 0), Interval (0, 0)));
     }
   Interval x_extent = Interval (0, join_thickness);
   Interval y_extent = (delta_pitch > 0)
@@ -194,23 +205,23 @@ vaticana_brew_primitive (Grob *me)
     {
       me->programming_error ("Vaticana_ligature: "
                             "undefined glyph-name -> ignoring grob");
-      return Stencil ();
+      return Lookup::blank (Box (Interval (0, 0), Interval (0, 0)));
     }
 
-  String glyph_name = ly_scm2string (glyph_name_scm);
+  string glyph_name = ly_scm2string (glyph_name_scm);
 
   Stencil out;
   Real thickness = robust_scm2double (me->get_property ("thickness"), 1);
 
   Real line_thickness
-    = thickness * me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
+    = thickness * me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
 
   Real blotdiameter
-    = (me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter")));
+    = (me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter")));
 
   int pos = Staff_symbol_referencer::get_rounded_position (me);
 
-  SCM delta_pitch_scm = me->get_property ("delta-pitch");
+  SCM delta_pitch_scm = me->get_property ("delta-position");
   int delta_pitch;
   if (delta_pitch_scm != SCM_EOL)
     delta_pitch = scm_to_int (delta_pitch_scm);
@@ -223,7 +234,7 @@ vaticana_brew_primitive (Grob *me)
   bool add_cauda = to_boolean (me->get_property ("add-cauda"));
   bool add_join = to_boolean (me->get_property ("add-join"));
 
-  if (!String::compare (glyph_name, ""))
+  if (glyph_name == "")
     {
       /*
        * This is an empty head.  This typically applies for the right
@@ -237,13 +248,13 @@ vaticana_brew_primitive (Grob *me)
       out
        = Lookup::blank (Box (Interval (0, 0.5 * flexa_width), Interval (0, 0)));
     }
-  else if (!String::compare (glyph_name, "flexa"))
+  else if (glyph_name == "flexa")
     out = vaticana_brew_flexa (me, true, line_thickness);
   else
     {
       out
        = Font_interface::get_default_font (me)->
-       find_by_name ("noteheads." + glyph_name);
+       find_by_name ("noteheads.s" + glyph_name);
     }
   out.translate_axis (x_offset, X_AXIS);
   Real head_width = out.extent (X_AXIS).length ();
@@ -292,8 +303,17 @@ Vaticana_ligature::print (SCM)
   return SCM_EOL;
 }
 
-ADD_INTERFACE (Vaticana_ligature, "vaticana-ligature-interface",
-              "A vaticana style gregorian ligature",
-              "glyph-name flexa-height flexa-width thickness add-cauda "
-              "add-stem add-join delta-pitch x-offset "
-              "ligature-primitive-callback");
+ADD_INTERFACE (Vaticana_ligature,
+              "A vaticana style Gregorian ligature.",
+
+              /* properties */
+              "glyph-name "
+              "flexa-height "
+              "flexa-width "
+              "thickness "
+              "add-cauda "
+              "add-stem "
+              "add-join "
+              "delta-position "
+              "x-offset "
+              );