]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/define-grobs.scm (all-grob-descriptions): calc
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 21 Oct 2006 10:45:15 +0000 (10:45 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 21 Oct 2006 10:45:15 +0000 (10:45 +0000)
connect-to-neighbor

* lily/horizontal-bracket.cc (make_bracket): support
connect-to-neighbor.

ChangeLog
lily/horizontal-bracket.cc
lily/include/translator.icc
lily/tuplet-bracket.cc
scm/define-grobs.scm

index 986174f39fafe657fc4ebf42486bf4711684bba3..94a092ed80ad6e83c4d21781acc1dfac0bb95ff0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-10-21  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+       * scm/define-grobs.scm (all-grob-descriptions): calc
+       connect-to-neighbor
+
+       * lily/horizontal-bracket.cc (make_bracket): support
+       connect-to-neighbor. 
+
        * lily/ttf.cc (make_index_to_charcode_map): remove debugging gobs.
 
        * VERSION (PACKAGE_NAME): release 2.9.26
index 80baa95de5742306d454fdbee80c4eef0e179160..00dd0b653ff4d3f095b6574895b2219cb5c5e0d9 100644 (file)
@@ -30,6 +30,7 @@ Horizontal_bracket::make_bracket (Grob *me,
   Drul_array<Real> shorten = robust_scm2interval (me->get_property ("shorten-pair"),
                                                  Interval (0, 0));
 
+  
   // Make sure that it points in the correct direction:
   scale_drul (&edge_height, Real (-dir));
  
@@ -37,6 +38,22 @@ Horizontal_bracket::make_bracket (Grob *me,
   Offset start;
   start[a] = length;
 
+  Drul_array<bool> connect_to_other =
+    robust_scm2booldrul (me->get_property ("connect-to-neighbor"),
+                        Drul_array<bool> (false, false));
+
+  Direction d = LEFT;
+  do
+    {
+      if (connect_to_other[d])
+       {
+         edge_height[d] = 0.0;
+         flare[d] = 0.0;
+         shorten[d] = 0.0;
+       }
+    }
+  while (flip (&d) != LEFT);
+             
   /*
     ugh, Tuplet_bracket should use Horizontal_bracket, not the other way around. 
   */
@@ -70,15 +87,26 @@ MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1);
 SCM
 Horizontal_bracket::print (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);
+  Spanner *me = unsmob_spanner (smob);
   extract_grob_set (me, "columns", gs);
+
+  vector<Grob*> enclosed = gs;
   if (!gs.size ())
     {
       me->suicide ();
       return SCM_EOL;
     }
 
-  Stencil b = make_enclosing_bracket (me, me, gs, X_AXIS, get_grob_direction (me));
+  Direction d = LEFT;
+  do
+    {
+      Item *b = me->get_bound (d);
+      if (b->break_status_dir ())
+       enclosed.push_back (b);
+    }
+  while (flip (&d) != LEFT);
+  
+  Stencil b = make_enclosing_bracket (me, me, enclosed, X_AXIS, get_grob_direction (me));
   return b.smobbed_copy ();
 }
 
@@ -92,5 +120,6 @@ ADD_INTERFACE (Horizontal_bracket,
               "columns "
               "edge-height "
               "shorten-pair "
+              "connect-to-neighbor "
               );
 
index bf9e9be8d5bcc2432ad2f7e1d478099f8358f2d7..6eb9e10405352c0aed4e3e5c0b797b52d3abf7b2 100644 (file)
 #include "std-vector.hh"
 #include "translator.hh"
 
+/*
+  TODO: derive "foo-bar-interface" from Foo_bar classname.
+ */
+
 /**
    A macro to automate administration of translators.
 */
index 68852c8353cb867f48c8fb56f4c53d8ebd24da83..a5f8b6c2424610c46f7464ad76ca611a0bc3660e 100644 (file)
@@ -420,8 +420,7 @@ Tuplet_bracket::make_bracket (Grob *me, // for line properties.
   Direction d = LEFT;
   do
     straight_corners[d] += -d * shorten[d] / length * dz;
-  while (flip (&d) != LEFT)
-    ;
+  while (flip (&d) != LEFT);
 
   if (gap.is_empty ())
     gap = Interval (0, 0);
index 6899237dc333da91d34fa462489cc91b8f0f5548..99492119c78baa03a4d4a0aebc9724605312fd08 100644 (file)
        (thickness . 1.0)
        (stencil . ,ly:horizontal-bracket::print)
        (Y-offset . ,ly:side-position-interface::y-aligned-side)
+       (connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors)
+       
        (padding . 0.2)
        (staff-padding . 0.2)
        (direction . ,DOWN)