]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.3.36 release/1.3.36
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 17 Mar 2000 10:59:49 +0000 (11:59 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 17 Mar 2000 10:59:49 +0000 (11:59 +0100)
===========

* textEmptyDimension changed into textNonEmpty, default: off,
ie. texts don't occupy space.

* Use STL map for Lookup::lookup_p_tab_p_

* Abstracted Axis_group_element into Axis_group_interface, and removed
Axis_group_element. This eliminates some multiple inheritance in the
backend

1.3.35.j

36 files changed:
CHANGES
VERSION
lily/align-element.cc
lily/axis-group-element.cc [deleted file]
lily/axis-group-engraver.cc
lily/axis-group-interface.cc [new file with mode: 0644]
lily/axis-group-item.cc [new file with mode: 0644]
lily/axis-group-spanner.cc [new file with mode: 0644]
lily/break-align-engraver.cc
lily/break-align-item.cc
lily/collision.cc
lily/directional-element.cc [deleted file]
lily/dot-column.cc
lily/grace-position-engraver.cc
lily/hara-kiri-vertical-group-spanner.cc
lily/include/align-element.hh
lily/include/axis-group-element.hh [deleted file]
lily/include/axis-group-interface.hh [new file with mode: 0644]
lily/include/axis-group-item.hh
lily/include/axis-group-spanner.hh
lily/include/music.hh
lily/include/paper-def.hh
lily/line-group-group-engraver.cc
lily/line-of-score.cc
lily/note-column.cc
lily/paper-column.cc
lily/paper-def.cc
lily/rest.cc
lily/rhythmic-head.cc
lily/scm-hash.cc
lily/score-engraver.cc
lily/text-engraver.cc
lily/vertical-align-engraver.cc
make/out/lilypond.lsm
make/out/lilypond.spec
scripts/convert-mudela.py

diff --git a/CHANGES b/CHANGES
index 90f59ba8bce959a8df5423d98ae3276e71e004c1..25d8b6894f91f509872f3e55c47cc77cd42cf4b7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,15 @@
+.3.35.hwn1
+===========
+
+* textEmptyDimension changed into textNonEmpty, default: off,
+ie. texts don't occupy space.
+
+* Use STL map for Lookup::lookup_p_tab_p_
+
+* Abstracted Axis_group_element into Axis_group_interface, and removed
+Axis_group_element. This eliminates some multiple inheritance in the
+backend
+
 1.3.35.jcn1
 ===========
 
diff --git a/VERSION b/VERSION
index c59e0bd757523c35a6dbe98a27574d3a3967327f..c53e8e4d15e3b2bcadd42bf45efc0914665b74f0 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=35
-MY_PATCH_LEVEL=jcn1
+PATCH_LEVEL=36
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index d892e733162ed09aadb16cea0fbcefe6860257f9..a8b34c069324cd7bffbf7b5967af5c7b3c549918 100644 (file)
@@ -10,8 +10,8 @@
 #include "interval.hh"
 #include "direction.hh"
 #include "debug.hh"
-#include "hash-table-iter.hh"
 #include "dimension-cache.hh"
+#include "axis-group-interface.hh"
 
 /*
   This callback is set in the children of the align element. It does
@@ -34,7 +34,7 @@ void
 Align_element::add_element (Score_element* s)
 {
   s->add_offset_callback (alignment_callback, axis ());
-  Axis_group_element::add_element (s);
+  axis_group (this).add_element (s);
 }
 
 /*
@@ -55,7 +55,8 @@ Align_element::do_side_processing (Axis a)
   Array<Interval> dims;
 
   Link_array<Score_element> elems;
-  Link_array<Score_element> all_elts (elem_l_arr ());
+  Link_array<Score_element> all_elts
+    = Group_interface__extract_elements (this, (Score_element*) 0, "elements");
   for (int i=0; i < all_elts.size(); i++) 
     {
       Interval y = all_elts[i]->extent(a) + all_elts[i]->relative_coordinate (this, a);
@@ -139,11 +140,10 @@ Align_element::axis () const
 void
 Align_element::set_axis (Axis a)
 {
-  set_axes (a, a);
+  axis_group (this).set_axes (a, a);
 }
 
-
-
-
-
-
+Align_element::Align_element ()
+{
+  axis_group (this).set_interface ();
+}
diff --git a/lily/axis-group-element.cc b/lily/axis-group-element.cc
deleted file mode 100644 (file)
index d323551..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-  axis-group-element.cc -- implement Axis_group_element
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "axis-group-element.hh"
-#include "dimension-cache.hh"
-#include "group-interface.hh"
-
-Link_array<Score_element>
-Axis_group_element::elem_l_arr () const
-{  
-  return
-    Group_interface__extract_elements (this, (Score_element*)0, "elements");
-}
-
-Link_array<Score_element> 
-Axis_group_element::get_children ()
-{
-  Link_array<Score_element> childs;
-  Link_array<Score_element> elems = elem_l_arr ();
-
-  for (int i=0; i < elems.size (); i++) 
-    {
-      Score_element* e = elems[i];
-      childs.push (e) ;
-      Axis_group_element * axis_group= dynamic_cast <Axis_group_element *> (e);
-      if (axis_group)
-       childs.concat (axis_group->get_children ());      
-    }
-  
-  return childs;
-}
-
-Axis_group_element::Axis_group_element()
-{
-  set_elt_property ("elements", SCM_EOL);
-  set_elt_property ("transparent", SCM_BOOL_T);
-}
-
-void
-Axis_group_element::set_axes (Axis a1, Axis a2)
-{
-  SCM ax = gh_cons (gh_int2scm (a1), SCM_EOL);
-  if (a1 != a2)
-    ax= gh_cons (gh_int2scm (a2), ax);
-
-  
-  set_elt_property ("axes", ax);
-
-  if (a1 != X_AXIS && a2 != X_AXIS)
-    set_empty (X_AXIS);
-  if (a1 != Y_AXIS && a2 != Y_AXIS)
-    set_empty (Y_AXIS);
-  
-  dim_cache_[a1]->set_callback(extent_callback);
-  dim_cache_[a2]->set_callback (extent_callback);
-}
-
-Interval
-Axis_group_element::extent_callback (Dimension_cache const *c) 
-{
-  Axis a = c->axis ();
-  Axis_group_element * me
-    = dynamic_cast<Axis_group_element*> (c->element_l ()); 
-
-  Interval r;
-  for (SCM s = me->get_elt_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
-    {
-      SCM e=gh_car (s); 
-      Score_element * se = SMOB_TO_TYPE (Score_element, e);
-
-      Interval dims = se->extent (a);
-      if (!dims.empty_b ())
-       r.unite (dims + se->relative_coordinate (me, a));
-    }
-
-  return r;
-}
-
-
-bool
-Axis_group_element::axis_b (Axis a )const
-{
-  return dim_cache_[a]->extent_callback_l_ == extent_callback;
-}
-
-
-void
-Axis_group_element::add_element (Score_element *e)
-{
-  used_b_ =true;
-  e->used_b_ = true;
-
-  for (SCM ax = get_elt_property ("axes"); ax != SCM_EOL ; ax = gh_cdr (ax))
-    {
-      Axis a = (Axis) gh_scm2int (gh_car (ax));
-      
-      if (!e->parent_l (a))
-       e->set_parent (this, a);
-    }
-  Group_interface gi (this);
-  gi.add_element (e);
-
-  add_dependency (e);
-}
-
index f9d813035ad3211b6fec84172869d397ca7a97ec..50b76990e5ddc5ab8b3e6662aeec3e4cc2654451 100644 (file)
@@ -9,6 +9,7 @@
 #include "axis-group-engraver.hh"
 #include "axis-group-spanner.hh"
 #include "paper-column.hh"
+#include "axis-group-interface.hh"
 
 Axis_group_engraver::Axis_group_engraver ()
 {
@@ -19,7 +20,7 @@ void
 Axis_group_engraver::do_creation_processing ()
 {
   staffline_p_ = get_spanner_p ();
-  staffline_p_->set_axes (Y_AXIS, Y_AXIS);
+  axis_group (staffline_p_).set_axes (Y_AXIS, Y_AXIS);
   staffline_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
   announce_element (Score_element_info (staffline_p_, 0));
 }
@@ -49,16 +50,9 @@ Axis_group_engraver::process_acknowledged ()
   /* UGH UGH UGH */
   for (int i=0; i < elts_.size (); i++)
     {
-      if (!elts_[i]->parent_l (Y_AXIS))
-       staffline_p_->add_element (elts_[i]);
-      else
-       if (
-           // elts_[i]->get_elt_property ("Axis_group_element::add_extra_element") == SCM_UNDEFINED &&
-           ! dynamic_cast<Axis_group_element*> (elts_[i]->parent_l (Y_AXIS)))
-              
-       {
-         staffline_p_->add_element (elts_[i]);
-       }
+      Score_element *par = elts_[i]->parent_l (Y_AXIS);
+      if (!par || !axis_group (par).has_interface_b ())
+       axis_group (staffline_p_).add_element (elts_[i]);
     }
   elts_.clear ();
 }
diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc
new file mode 100644 (file)
index 0000000..d00b7a1
--- /dev/null
@@ -0,0 +1,134 @@
+/*   
+  axis-group-interface.cc --  implement Axis_group_interface
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "axis-group-interface.hh"
+#include "score-element.hh"
+#include "dimension-cache.hh"
+
+Axis_group_interface::Axis_group_interface (Score_element*s)
+  : Group_interface (s)
+{
+  elt_l_ = s;
+}
+
+Axis_group_interface
+axis_group (Score_element*s)
+{
+  return Axis_group_interface (s);
+}
+
+void
+Axis_group_interface::add_element (Score_element *e)
+{
+  elt_l_->used_b_ = true;
+  e->used_b_ = true;
+
+  for (SCM ax = elt_l_->get_elt_property ("axes"); ax != SCM_EOL ; ax = gh_cdr (ax))
+    {
+      Axis a = (Axis) gh_scm2int (gh_car (ax));
+      
+      if (!e->parent_l (a))
+       e->set_parent (elt_l_, a);
+    }
+
+  Group_interface::add_element (e);
+
+  elt_l_->add_dependency (e);
+}
+
+
+bool
+Axis_group_interface::axis_b (Axis a )const
+{
+  return elt_l_->dim_cache_[a]->extent_callback_l_ == group_extent_callback;
+}
+
+Interval
+Axis_group_interface::group_extent_callback (Dimension_cache const *c) 
+{
+  Axis a = c->axis ();
+  Score_element * me = c->element_l ();
+
+  Interval r;
+  for (SCM s = me->get_elt_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
+    {
+      SCM e=gh_car (s); 
+      Score_element * se = SMOB_TO_TYPE (Score_element, e);
+
+      Interval dims = se->extent (a);
+      if (!dims.empty_b ())
+       r.unite (dims + se->relative_coordinate (me, a));
+    }
+
+  return r;
+}
+
+
+void
+Axis_group_interface::set_interface ()
+{
+  if (!has_interface_b ())
+    {
+      elt_l_->set_elt_property ("elements", SCM_EOL);
+      elt_l_->set_elt_property ("transparent", SCM_BOOL_T);
+      elt_l_->set_elt_property ("axes" , SCM_EOL);
+      group (elt_l_, "interfaces").add_thing (ly_symbol2scm ("Axis_group"));
+    }
+}
+
+void
+Axis_group_interface::set_axes (Axis a1, Axis a2)
+{
+  // set_interface () ? 
+
+  SCM ax = gh_cons (gh_int2scm (a1), SCM_EOL);
+  if (a1 != a2)
+    ax= gh_cons (gh_int2scm (a2), ax);
+
+  
+  elt_l_->set_elt_property ("axes", ax);
+
+  if (a1 != X_AXIS && a2 != X_AXIS)
+    elt_l_->set_empty (X_AXIS);
+  if (a1 != Y_AXIS && a2 != Y_AXIS)
+    elt_l_->set_empty (Y_AXIS);
+  
+  elt_l_->dim_cache_[a1]->set_callback (Axis_group_interface::group_extent_callback);
+  elt_l_->dim_cache_[a2]->set_callback (Axis_group_interface::group_extent_callback);
+}
+
+Link_array<Score_element> 
+Axis_group_interface::get_children ()
+{
+  Link_array<Score_element> childs;
+  childs.push (elt_l_) ;
+
+  if (!has_interface_b ())
+    return childs;
+  
+  for (SCM ep = elt_l_->get_elt_property ("elements"); gh_pair_p (ep); ep = gh_cdr (ep))
+    {
+      Score_element* e = unsmob_element (gh_car (ep));
+      if (e)
+       childs.concat (axis_group (e).get_children ());
+    }
+  
+  return childs;
+}
+
+bool
+Axis_group_interface::has_interface_b ()
+{
+  SCM memq = scm_memq (ly_symbol2scm ("Axis_group"),
+             elt_l_->get_elt_property ("interfaces"));
+  
+  return (memq != SCM_BOOL_F);
+}
+
+
diff --git a/lily/axis-group-item.cc b/lily/axis-group-item.cc
new file mode 100644 (file)
index 0000000..e3dfe35
--- /dev/null
@@ -0,0 +1,16 @@
+/*   
+  axis-group-item.cc --  implement Axis_group_interface
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "axis-group-item.hh"
+#include "axis-group-interface.hh"
+
+Axis_group_item ::Axis_group_item ()
+{
+  axis_group (this).set_interface ();
+}
diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc
new file mode 100644 (file)
index 0000000..00266e0
--- /dev/null
@@ -0,0 +1,16 @@
+/*   
+  axis-group-spanner.cc --  implement Axis_group_spanner
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "axis-group-spanner.hh"
+#include "axis-group-interface.hh"
+
+Axis_group_spanner::Axis_group_spanner()
+{
+  axis_group (this).set_interface ();
+}
index c111645eee452692c112815e21d62e1be4f259f5..82f6dd904df42a5a566b2a52ebef46a6b0e9bee1 100644 (file)
@@ -10,6 +10,7 @@
 #include "protected-scm.hh"
 #include "break-align-item.hh"
 #include "axis-group-item.hh"
+#include "axis-group-interface.hh"
 
 class Break_align_engraver : public Engraver
 {
@@ -111,12 +112,12 @@ Break_align_engraver::acknowledge_element (Score_element_info inf)
       else
        {
          group = new Axis_group_item;
-         group->set_axes (X_AXIS,X_AXIS);
+         axis_group(group).set_axes (X_AXIS,X_AXIS);
          group->set_elt_property ("origin", name);
          group->set_parent (align_l_, Y_AXIS);
          announce_element (Score_element_info (group, 0));
          column_alist_ = scm_assoc_set_x (column_alist_, name, group->self_scm_);
        }
-      group->add_element (item_l);
+      axis_group (group).add_element (item_l);
     }
 }
index 0d67818da9448c8cbbde633ed2f58a4093e9fc0b..c0c2ac4807b28c756757595a2e67c4b3851294bc 100644 (file)
@@ -16,6 +16,7 @@
 #include "paper-score.hh"
 #include "paper-def.hh"
 #include "paper-column.hh"
+#include "group-interface.hh"
 
 /*
   Handle spacing for prefatory matter. 
@@ -33,7 +34,9 @@ Break_align_item::before_line_breaking ()
 
 
   Link_array<Score_element> elems;
-  Link_array<Score_element> all_elems (elem_l_arr ());
+  Link_array<Score_element> all_elems
+    = Group_interface__extract_elements (this, (Score_element*)0,
+                                        "elements");
   
   for (int i=0; i < all_elems.size(); i++) 
     {
index 161016104ca00ebf238b4d7c1f8742fbe027cf03..f423d2a4a2dda420b43fe5c3c9e4d8889cd94633 100644 (file)
 #include "note-column.hh"
 #include "note-head.hh"
 #include "paper-def.hh"
+#include "axis-group-interface.hh"
+
 
 Collision::Collision()
 {
-  set_axes (X_AXIS, Y_AXIS);
+  axis_group (this).set_axes (X_AXIS, Y_AXIS);
 }
 
 void
 Collision::add_column (Note_column* ncol_l)
 {
-  add_element (ncol_l);
+  axis_group (this).add_element (ncol_l);
   add_dependency (ncol_l);
 }
 
diff --git a/lily/directional-element.cc b/lily/directional-element.cc
deleted file mode 100644 (file)
index e69de29..0000000
index d9331f89074bc6dddcfc3ded34995ebde9a4ad3e..29a5789a22a6d043b8a922d73a2e754f941cdd83 100644 (file)
@@ -13,6 +13,8 @@
 #include "staff-symbol-referencer.hh"
 #include "directional-element-interface.hh"
 #include "side-position-interface.hh"
+#include "axis-group-interface.hh"
+
 
 void
 Dot_column::add_dots (Dots *d)
@@ -21,7 +23,7 @@ Dot_column::add_dots (Dots *d)
   gi.add_element (d);
 
   add_dependency (d);
-  add_element (d);
+  axis_group (this).add_element (d);
 }
 
 void
@@ -51,7 +53,7 @@ Dot_column::Dot_column ()
   gi.set_interface ();
   
   directional_element (this).set (RIGHT);
-  set_axes(X_AXIS,X_AXIS);
+  axis_group (this).set_axes(X_AXIS,X_AXIS);
 }
 
 /*
index 866b3a2d80fb8a99698103407b7aaf411dc17f30..735ba6b69a894fcd9b4866ffe1ab50e1751ae362 100644 (file)
@@ -14,6 +14,8 @@
 #include "paper-column.hh"
 #include "dimension-cache.hh"
 #include "side-position-interface.hh"
+#include "axis-group-interface.hh"
+
 
 class Grace_position_engraver:public Engraver
 {
@@ -91,7 +93,7 @@ Grace_position_engraver::do_pre_move_processing ()
       warning (_("Unattached grace notes.  Attaching to last musical column."));
       
       align_l_->set_parent (0, X_AXIS);
-      last_musical_col_l_->add_element (align_l_);
+      axis_group(last_musical_col_l_).add_element (align_l_);
     }
 
   last_musical_col_l_ = get_staff_info ().musical_pcol_l ();
index b6a6416455f916245eb170d377120d1576c20545..ba10c73d46bb87dc5834df6c3cccc9ad54514e76 100644 (file)
@@ -8,6 +8,7 @@
   Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "axis-group-interface.hh"
 #include "hara-kiri-vertical-group-spanner.hh"
 #include "debug.hh"
 #include "item.hh"
@@ -15,7 +16,7 @@
 Hara_kiri_group_spanner::Hara_kiri_group_spanner()
 {
   set_elt_property ("items-worth-living", SCM_EOL);
-  set_axes(Y_AXIS,Y_AXIS);
+  axis_group (this).set_axes(Y_AXIS,Y_AXIS);
 }
 
 void 
@@ -34,7 +35,7 @@ Hara_kiri_group_spanner::after_line_breaking ()
   if (gh_pair_p (worth))
     return;
 
-  Link_array<Score_element> childs = get_children ();
+  Link_array<Score_element> childs = axis_group (this).get_children ();
   for (int i = 0; i < childs.size (); i++)
     {
       Score_element* s = childs[i];
index b4fae226423f29d196f32294b44ced9804e23929..19a4e9dcc995708eeae767f74406e1eea74622da 100644 (file)
 #ifndef VERTICAL_ALIGN_ITEM_HH
 #define VERTICAL_ALIGN_ITEM_HH
 
-#include "axis-group-element.hh"
-#include "interval.hh"
-#include "direction.hh"
-#include "axes.hh"
-#include "hash-table.hh"
+#include "score-element.hh"
 
 /**
   Order elements top to bottom/left to right/right to left etc..
 
 
 */
-class Align_element : public virtual Axis_group_element {
+class Align_element : public virtual Score_element {
 public:
   Axis axis () const;
 
+  Align_element ();
   void set_axis (Axis);
   int get_count (Score_element*)const;
   void add_element (Score_element *);
diff --git a/lily/include/axis-group-element.hh b/lily/include/axis-group-element.hh
deleted file mode 100644 (file)
index 75cf8d1..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  axis-group-element.hh -- declare Axis_group_element
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef AXIS_GROUP_ELEMENT_HH
-#define AXIS_GROUP_ELEMENT_HH
-
-#include "score-element.hh"
-
-
-/** 
-  Treat a group of elements a unity in either or both axis sense .
-  This is a wrapper around Axis_group_administration
-
-  FIXME: remove this class, and make interface of it, so we can remove multiple inheritance.
-*/
-class Axis_group_element : public virtual Score_element
-{
-protected:
-  virtual Link_array<Score_element> elem_l_arr() const;
-  static Interval extent_callback (Dimension_cache const*);
-
-public:
-  void add_element (Score_element*);
-  bool axis_b (Axis) const;
-  Axis_group_element ();
-  void set_axes (Axis,Axis);
-
-  Link_array<Score_element> get_children ();
-};
-
-#endif // AXIS_GROUP_ELEMENT_HH
diff --git a/lily/include/axis-group-interface.hh b/lily/include/axis-group-interface.hh
new file mode 100644 (file)
index 0000000..9ceee2f
--- /dev/null
@@ -0,0 +1,31 @@
+/*   
+  axis-group-interface.hh -- declare Axis_group_interface
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef AXIS_GROUP_INTERFACE_HH
+#define AXIS_GROUP_INTERFACE_HH
+
+#include "group-interface.hh"
+
+struct Axis_group_interface : Group_interface
+{
+  Axis_group_interface (Score_element*);
+  static Interval group_extent_callback (Dimension_cache const*);
+  void add_element (Score_element*);
+  void set_axes (Axis,Axis);
+  bool axis_b (Axis)const;
+  Link_array<Score_element> get_children ();
+  bool has_interface_b ();
+  void set_interface ();
+};
+
+Axis_group_interface
+axis_group (Score_element*);
+
+#endif /* AXIS_GROUP_INTERFACE_HH */
+
index 0f88cc78bb23d94e64aee7147191ff5b0b27abb5..aa2e6392bc670a77444e91539edee6cab5971d01 100644 (file)
 #ifndef AXIS_ITEM_HH
 #define AXIS_ITEM_HH
 
-#include "axis-group-element.hh" 
 #include "item.hh"
 
-/**
-  A grouping item. Its special support is in do_breakable_col_processing().
- */
-class Axis_group_item : public virtual Axis_group_element, public virtual Item
+class Axis_group_item :  public virtual Item
 {
 public:
+  Axis_group_item ();
   VIRTUAL_COPY_CONS(Score_element);
 };
 
index d421973f5058d361958dc8c487184e068144fad5..9d48108c2ee9c6a2e8d45402a7113d2451910ef7 100644 (file)
 #define AXIS_GROUP_SPANNER_HH
 
 #include "spanner.hh"
-#include "axis-group-element.hh"
 
 /**
    An element which groups a line in a certain direction. The most
    useful example of this is the Vertical_group_spanner
 */
-class Axis_group_spanner : public virtual Axis_group_element,
-                          public virtual Spanner
+class Axis_group_spanner : public virtual Spanner
 
 {
 public:
+  Axis_group_spanner ();
   VIRTUAL_COPY_CONS(Score_element);
 };
 
index fc8d7162ddfa4fd99d660fa03ea5a56c1a2ab9ad..ce355795d97dba423846a152a5f270d647932bee 100644 (file)
@@ -30,8 +30,6 @@
   */
 class Music:public Input {
 public:
-    
-
   virtual Musical_pitch to_relative_octave (Musical_pitch);
 
   /// The duration of this piece of music
index 987c0f25da3d3f3345915d2c8114f471c71887d6..4970d49905f1182ee6fd33ee4c0c19f8a113365f 100644 (file)
@@ -9,6 +9,9 @@
 
 #ifndef PAPER_DEF_HH
 #define PAPER_DEF_HH
+
+#include <map>
+
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 #include "real.hh"
@@ -44,7 +47,7 @@
 */
 class Paper_def : public Music_output_def 
 {
-  Hash_table<int, Lookup *> *lookup_p_tab_p_;
+  map<int, Lookup *> *lookup_p_tab_p_;
   static int default_count_i_;
 
 protected:
index a0f8d10dbce7b8afc283e3df34a4e6a1dc624d03..99dc54a202df3341af7827d8e402ed649e09d667 100644 (file)
@@ -13,6 +13,8 @@
 #include "debug.hh"
 #include "line-group-group-engraver.hh"
 #include "paper-column.hh"
+#include "axis-group-interface.hh"
+
 
 Line_group_engraver_group::Line_group_engraver_group()
 {
@@ -24,7 +26,7 @@ void
 Line_group_engraver_group::typeset_element (Score_element *elem)
 {
   if (!elem->parent_l (Y_AXIS))      
-    staffline_p_->add_element (elem);
+    axis_group (staffline_p_).add_element (elem);
   Engraver_group_engraver::typeset_element (elem);
 }
 
@@ -52,7 +54,7 @@ void
 Line_group_engraver_group::create_line_spanner ()
 {
   staffline_p_ = new Axis_group_spanner ;
-  staffline_p_->set_axes (Y_AXIS,Y_AXIS);
+  axis_group (staffline_p_).set_axes (Y_AXIS,Y_AXIS);
 }
 
 
index 3bba1d479bd35869be7f12f57e8ef71404326c94..478a07289d7fd26a55ded33594ef2f9e397218ff 100644 (file)
 #include "warn.hh"
 #include "main.hh"
 #include "debug.hh"
+#include "axis-group-interface.hh"
+
 
 Line_of_score::Line_of_score()
 {
   set_elt_property ("columns", SCM_EOL);
-  set_axes (Y_AXIS,X_AXIS);
+  axis_group (this).set_axes (Y_AXIS,X_AXIS);
 }
 
 
@@ -65,7 +67,7 @@ Line_of_score::add_column (Paper_column*p)
 {
   set_elt_property ("columns",
                    gh_cons (p->self_scm_, get_elt_property ("columns")));
-  add_element (p);
+  axis_group (this).add_element (p);
 }
 
 void
index ab801410ffb37bbc853b01236342497baaeeeaf9..3b9a26e89b230cffcfbcc72019846a33a293de1d 100644 (file)
@@ -7,7 +7,7 @@
 */
 #include <math.h>              // ceil
 
-
+#include "axis-group-interface.hh"
 #include "dot-column.hh"
 #include "note-column.hh"
 #include "beam.hh"
@@ -42,7 +42,7 @@ Note_column::Note_column()
 {
   set_elt_property ("rests", SCM_EOL);
   set_elt_property ("note-heads", SCM_EOL);  
-  set_axes (X_AXIS, Y_AXIS);
+  axis_group (this).set_axes (X_AXIS, Y_AXIS);
 }
 
 Stem *
@@ -92,7 +92,7 @@ Note_column::set_stem (Stem * stem_l)
   set_elt_property ("stem", stem_l->self_scm_);
 
   add_dependency (stem_l);
-  add_element (stem_l);
+  axis_group (this).add_element (stem_l);
 }
 
 
@@ -110,7 +110,7 @@ Note_column::add_head (Rhythmic_head *h)
       Group_interface gi (this, "note-heads");
       gi.add_element (nh);
     }
-  add_element (h);
+  axis_group (this).add_element (h);
 }
 
 /**
@@ -133,7 +133,7 @@ Note_column::translate_rests (int dy_i)
 void
 Note_column::set_dotcol (Dot_column *d)
 {
-  add_element (d);
+  axis_group (this).add_element (d);
 }
 
 /*
index 3117df5b95a8daefef222ae587feafdd9996f36c..14f1340464e2f2c334e437b18d8132350720d73d 100644 (file)
@@ -9,6 +9,7 @@
 #include "paper-column.hh"
 #include "paper-score.hh"
 #include "debug.hh"
+#include "axis-group-interface.hh"
 
 void
 Paper_column::add_rod (Paper_column * p, Real d)
@@ -126,7 +127,7 @@ Paper_column::Paper_column (Moment w)
   scm_unprotect_object (when);
   set_elt_property ("when", when);
   
-  set_axes (X_AXIS, X_AXIS);
+  axis_group (this).set_axes (X_AXIS, X_AXIS);
 
   line_l_=0;
   rank_i_ = -1;
index 2f60f9e14ce2f65295ed3210c2eedc141a736e2b..9234da4d1c89b793c002e1932b9f34d50a487b54 100644 (file)
@@ -7,6 +7,7 @@
 */
 
 #include <math.h>
+
 #include "all-font-metrics.hh"
 #include "string.hh"
 #include "misc.hh"
 
 Paper_def::Paper_def ()
 {
-  lookup_p_tab_p_ = new Hash_table<int, Lookup*>;
-  lookup_p_tab_p_->hash_func_ = int_hash;
+  lookup_p_tab_p_ = new map<int, Lookup*>;
 }
 
 
 Paper_def::~Paper_def ()
 {
-  for (Hash_table_iter<int, Lookup*> ai(*lookup_p_tab_p_); ai.ok (); ai++)
+  for (map<int,Lookup*>::const_iterator ai = lookup_p_tab_p_->begin();
+       ai != lookup_p_tab_p_->end (); ai++)
     {
-      delete ai.val ();
+      delete (*ai).second;
     }
   
   delete lookup_p_tab_p_;
@@ -45,13 +46,13 @@ Paper_def::Paper_def (Paper_def const&s)
   : Music_output_def (s)
 {
   shape_int_a_ = s.shape_int_a_;
-  lookup_p_tab_p_ = new Hash_table<int, Lookup*>;
-  lookup_p_tab_p_->hash_func_ = int_hash;
+  lookup_p_tab_p_ = new map<int, Lookup*>;
   
-  for (Hash_table_iter<int, Lookup*> ai(*s.lookup_p_tab_p_); ai.ok (); ai++)
+  for (map<int,Lookup*>::const_iterator ai = s.lookup_p_tab_p_->begin();
+       ai != s.lookup_p_tab_p_->end (); ai++)
     {
-      Lookup * l = new Lookup (*ai.val ());
-      set_lookup (ai.key(), l);
+      Lookup * l = new Lookup (* (*ai).second);
+      set_lookup ((*ai).first, l);      
     }
 }
 
@@ -112,9 +113,10 @@ Paper_def::line_dimensions_int (int n) const
 void
 Paper_def::set_lookup (int i, Lookup*l)
 {
-  if (lookup_p_tab_p_->elem_b (i))
+  map<int,Lookup*> :: const_iterator it (lookup_p_tab_p_->find (i));
+  if (it != lookup_p_tab_p_->end ())
     {
-      delete lookup_p_tab_p_->elem (i);
+      delete (*it).second;
     }
   (*lookup_p_tab_p_)[i] = l;
 }
@@ -139,9 +141,11 @@ Paper_def::print () const
 #ifndef NPRINT
   Music_output_def::print ();
   DEBUG_OUT << "Paper {";
-  for (Hash_table_iter<int, Lookup*> ai(*lookup_p_tab_p_); ai.ok (); ai++)
+  for (map<int,Lookup*>::const_iterator ai = lookup_p_tab_p_->begin();
+       ai != lookup_p_tab_p_->end (); ai++)
     {
-      DEBUG_OUT << "Lookup: " << ai.key () << " = " << ai.val ()->font_name_ << '\n';
+      DEBUG_OUT << "Lookup: " << (*ai).first
+               << " = " << (*ai).second->font_name_ << '\n';
     }
   DEBUG_OUT << "}\n";
 #endif
index 0c4aafee6697b6aa4187c71b005aca14a470ca5a..89c2d1a9e0ad51c65007809668fffb08652bab00 100644 (file)
@@ -11,7 +11,6 @@
 #include "lookup.hh"
 #include "rest.hh"
 #include "dots.hh"
-#include "axis-group-element.hh"
 #include "paper-score.hh"
 #include "staff-symbol-referencer.hh"
 
index 015fa2f9aa99ee7436c3cebc57aa760670a0d357..64d2bd4bdd6f716e4de9141be933f4038cf9c21b 100644 (file)
@@ -13,7 +13,6 @@
 #include "lookup.hh"
 #include "rest.hh"
 #include "dots.hh"
-#include "axis-group-element.hh"
 #include "paper-score.hh"
 #include "stem.hh"
 #include "staff-symbol-referencer.hh"
index 90009ffcd74905d5f4e382ae387c3de789fd9d82..551a050a2a29b4d7e940ef50413f6d36bf9d9005 100644 (file)
@@ -12,9 +12,6 @@
 #include "hash-table-iter.hh"
 
 
-#ifdef usestl
-
-
 Scheme_hash_table::Scheme_hash_table ()
 {
   self_scm_ = SCM_EOL;
@@ -130,104 +127,4 @@ Scheme_hash_table::to_alist () const
 IMPLEMENT_UNSMOB(Scheme_hash_table,scheme_hash);
 IMPLEMENT_SMOBS(Scheme_hash_table);
 
-#else
-Scheme_hash_table::Scheme_hash_table ()
-{
-  hash_func_ = ly_scm_hash;
-  self_scm_ = SCM_EOL;
-  smobify_self ();
-}
-
-void
-Scheme_hash_table::operator =(Scheme_hash_table const & src)
-{
-  Hash_table<SCM,SCM>::operator = (src);
-       
-  // we do not copy the self_scm_ field!
-}
-
-void
-Scheme_hash_table::do_smobify_self ()
-{
-}
-
 
-SCM
-Scheme_hash_table::mark_smob (SCM s)
-{
-  /*
-    can't typecheck naively, since GC bit lives in CAR of S
-   */
-  //assert (SMOB_IS_TYPE_B (Scheme_hash_table, s));
-  
-  Scheme_hash_table *me = SMOB_TO_TYPE(Scheme_hash_table,s);
-  for (Hash_table_iter<SCM,SCM> i (*me); i.ok(); i++)
-    {
-      scm_gc_mark (i.key());
-      scm_gc_mark (i.val ());
-    }
-  return SCM_EOL;
-}
-
-
-Scheme_hash_table::Scheme_hash_table (Scheme_hash_table const &src)
-  : Hash_table<SCM,SCM> (src)
-{
-  hash_func_ = src.hash_func_;
-  self_scm_ = SCM_EOL;
-  smobify_self ();
-}
-
-int
-Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state*)
-{
-  assert (SMOB_IS_TYPE_B (Scheme_hash_table, s));
-  char str[1000];
-  sprintf (str, "#<Scheme_hash_table 0x%0x ", s);
-  scm_puts (str, p);      
-  Scheme_hash_table *me = SMOB_TO_TYPE(Scheme_hash_table,s);
-  for (Hash_table_iter<SCM,SCM> i (*me); i.ok(); i++)
-    {
-      scm_display (i.key(), p);
-      scm_puts (" = ",p);      
-      scm_display (i.val (), p);
-      scm_puts ("\n",p);            
-    }
-  scm_puts ("> ",p);        
-  return 1;
-}
-
-
-void
-Scheme_hash_table::set (SCM k, SCM v)
-{
-  elem (k ) = v; 
-  scm_unprotect_object (v);
-}
-
-SCM
-Scheme_hash_table::get (SCM k)const
-{
-  return const_elem (k);
-}
-
-
-Scheme_hash_table::~Scheme_hash_table( )
-{
-  unsmobify_self ();
-}
-
-SCM
-Scheme_hash_table::to_alist () const
-{
-  SCM l = SCM_EOL;
-  for (Hash_table_iter<SCM,SCM> i (*this); i.ok(); i++)
-    l = gh_cons (gh_cons (i.key (), i.val()), l);
-  return l;  
-}
-
-
-#include "ly-smobs.icc"
-IMPLEMENT_UNSMOB(Scheme_hash_table,scheme_hash);
-IMPLEMENT_SMOBS(Scheme_hash_table);
-#endif
index 0885d2b3389a114cdc284ba52746c3e917760bf8..15d490bca65693e3dc9de9ae341fbc8de06c1a35 100644 (file)
@@ -5,6 +5,7 @@
 
   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
+
 #include "debug.hh"
 #include "dimension-cache.hh"
 #include "line-of-score.hh"
@@ -15,6 +16,7 @@
 #include "paper-column.hh"
 #include "command-request.hh"
 #include "paper-def.hh"
+#include "axis-group-interface.hh"
 
 Score_engraver::Score_engraver()
 {
@@ -145,14 +147,12 @@ Score_engraver::typeset_all()
          if (!elem_p->parent_l (X_AXIS))
            {
              bool br = to_boolean (elem_p->remove_elt_property ("breakable"));
-             if (br)
-               command_column_l_->add_element(elem_p);
-             else
-               musical_column_l_->add_element(elem_p);
+             Axis_group_interface gi ((br) ? command_column_l_ : musical_column_l_) ;
+             gi.add_element(elem_p);
            }
        }
       if (!elem_p->parent_l(Y_AXIS))
-       scoreline_l_->add_element (elem_p);
+       axis_group (scoreline_l_).add_element (elem_p);
     }
   elem_p_arr_.clear();
 }
index ad69deef943190671c4744386da9e3d3dcdd083d..97b7a18a24055e383eb235b569e815ef8afe3dbb 100644 (file)
@@ -102,11 +102,9 @@ Text_engraver::do_process_music ()
       if (r->style_str_.length_i ())
        text->set_elt_property ("style", ly_str02scm (r->style_str_.ch_C()));
       
-      SCM empty = get_property ("textEmptyDimension");
-      if (to_boolean (empty))
-       {
-         text->set_empty (X_AXIS);
-       }
+      SCM empty = get_property ("textNonEmpty");
+      if (!to_boolean (empty))
+       text->set_empty (X_AXIS);
 
       announce_element (Score_element_info (text, r));
       texts_.push (text);
index 46da33759686b50cd59595f040fa8890397a0036..2c2d48d9ad901edb1cc997a92a11c31f8b01a02a 100644 (file)
@@ -12,6 +12,7 @@
 #include "axis-align-spanner.hh"
 #include "axis-group-spanner.hh"
 #include "span-bar.hh"
+#include "axis-group-interface.hh"
 
 Vertical_align_engraver::Vertical_align_engraver()
 {
@@ -54,9 +55,11 @@ Vertical_align_engraver::qualifies_b (Score_element_info i) const
 {
   int sz = i.origin_trans_l_arr ((Translator*)this).size()  ;
 
-  Axis_group_element * elt = dynamic_cast<Axis_group_element *> (i.elem_l_);
 
-  return sz > 1 && elt && !elt->parent_l (Y_AXIS) && elt->axis_b (Y_AXIS);
+  Axis_group_interface agi(i.elem_l_);
+
+  return sz > 1 && agi.has_interface_b ()
+    && !i.elem_l_->parent_l (Y_AXIS) && agi.axis_b (Y_AXIS);
 }
 
 void
index f0df4de561fa6e5a6fe518019a7f9e332de705b7..5bcf0d68f4b17bcc766284ca13a7bb502cf7b263 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.3.35
-Entered-date: 16MAR00
+Version: 1.3.36
+Entered-date: 17MAR00
 Description: 
 Keywords: music notation typesetting midi fonts engraving
 Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       1000k lilypond-1.3.35.tar.gz 
+       1000k lilypond-1.3.36.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.3.35.tar.gz 
+       1000k lilypond-1.3.36.tar.gz 
 Copying-policy: GPL
 End
index f3e0fbcedd4767edfddd4932e38b3d4982561721..c9f2186c30b19fb1e805afcdf9323c829197de41 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 1.3.35
+Version: 1.3.36
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.35.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.36.tar.gz
 Summary: A program for printing sheet music.
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 # get Packager from (undocumented?) ~/.rpmmacros!
index ede540b40bbe600abeb43234b535990b7580187a..7714a5695c0b7ec9afb5ef4a5e3d91b3c619696c 100644 (file)
@@ -414,6 +414,18 @@ if 1:
 
        conversions.append ((1,3,18), conv, 'staffLineLeading -> staffSpace')
 
+if 1:
+       def conv (str):
+               str = re.sub ('textEmptyDimension *= *##t',
+                             'textNonEmpty = ##f',
+                             str)
+               str = re.sub ('textEmptyDimension *= *##f',
+                             'textNonEmpty = ##t',
+                             str)
+               return str
+
+       conversions.append ((1,3,35), conv, 'textEmptyDimension -> textNonEmpty')
+
 ############################