]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/ottava-bracket.cc
lilypond-manuals.css: edit color scheme and some spacing
[lilypond.git] / lily / ottava-bracket.cc
index 7c115de2631e49f27128e184d4e0f370a7769946..cc33d8b152fd4a311a769d980184d2800bb1b37f 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2004--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2004--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
 #include "staff-symbol-referencer.hh"
 #include "note-column.hh"
 #include "directional-element-interface.hh"
-#include "tuplet-bracket.hh"
+#include "bracket.hh"
 #include "rhythmic-head.hh"
 #include "pointer-group-interface.hh"
 
 struct Ottava_bracket
 {
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_GROB_INTERFACE ();
 };
 
 /*
@@ -49,7 +48,7 @@ MAKE_SCHEME_CALLBACK (Ottava_bracket, print, 1);
 SCM
 Ottava_bracket::print (SCM smob)
 {
-  Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (smob));
+  Spanner *me = unsmob<Spanner> (smob);
   Interval span_points;
 
   Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
@@ -61,7 +60,7 @@ Ottava_bracket::print (SCM smob)
       Item *b = me->get_bound (d);
       broken[d] = (b->break_status_dir () != CENTER);
 
-      if (Note_column::has_interface (b))
+      if (has_interface<Note_column> (b))
         {
           extract_grob_set (b, "note-heads", heads);
           common = common_refpoint_of_array (heads, common, X_AXIS);
@@ -79,7 +78,7 @@ Ottava_bracket::print (SCM smob)
   SCM markup = me->get_property ("text");
   Stencil text;
   if (Text_interface::is_markup (markup))
-    text = *Stencil::unsmob (Text_interface::interpret_markup (layout->self_scm (),
+    text = *unsmob<Stencil> (Text_interface::interpret_markup (layout->self_scm (),
                                                               properties, markup));
 
   Drul_array<Real> shorten = robust_scm2interval (me->get_property ("shorten-pair"),
@@ -94,7 +93,7 @@ Ottava_bracket::print (SCM smob)
       Item *b = me->get_bound (d);
 
       Interval ext;
-      if (Note_column::has_interface (b))
+      if (has_interface<Note_column> (b))
         {
           extract_grob_set (b, "note-heads", heads);
           for (vsize i = 0; i < heads.size (); i++)
@@ -152,12 +151,11 @@ Ottava_bracket::print (SCM smob)
 
   Stencil b;
   Interval empty;
+
   if (!bracket_span_points.is_empty () && bracket_span_points.length () > 0.001)
-    b = Tuplet_bracket::make_bracket (me,
-                                      Y_AXIS, Offset (bracket_span_points.length (), 0),
-                                      edge_height,
-                                      empty,
-                                      flare, Drul_array<Real> (0, 0));
+    b = Bracket::make_bracket (
+      me, Y_AXIS, Offset (bracket_span_points.length (), 0),
+      edge_height, empty, flare, Drul_array<Real> (0, 0));
 
   /*
    * The vertical lines should not take space, for the following scenario: