]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/side-position-interface.cc: remove add_staff_support ()
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 27 Jan 2004 01:32:22 +0000 (01:32 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 27 Jan 2004 01:32:22 +0000 (01:32 +0000)
Change all callers to use staff-padding.

* lily/auto-beam-engraver.cc (create_beam): opps. Don't use
make_spanner().

* lily/a2-engraver.cc (process_acknowledged_grobs):

* lily/text-engraver.cc: remove scriptHorizontal property.

* lily/side-position-interface.cc (out_of_staff): move contents of
out_of_staff into aligned_side.
remove out_of_staff().

* lily/side-position-interface.cc: add staff-padding support to
Side_position_interface::aligned_side.

18 files changed:
ChangeLog
lily/a2-engraver.cc
lily/auto-beam-engraver.cc
lily/beam-engraver.cc
lily/clef-engraver.cc
lily/dynamic-engraver.cc
lily/fingering-engraver.cc
lily/include/side-position-interface.hh
lily/multi-measure-rest-engraver.cc
lily/new-fingering-engraver.cc
lily/piano-pedal-engraver.cc
lily/script-engraver.cc
lily/script.cc
lily/side-position-interface.cc
lily/text-engraver.cc
lily/text-spanner-engraver.cc
scm/define-grobs.scm
scm/define-translator-properties.scm

index 52df389069954063ca29c152511ee54ebbe671da..56facfc86af83b9a4e3ba842d8aada39629b3025 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2004-01-27  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/side-position-interface.cc: remove add_staff_support ()
+       Change all callers to use staff-padding.
+
+       * lily/auto-beam-engraver.cc (create_beam): opps. Don't use
+       make_spanner().
+
+       * lily/a2-engraver.cc (process_acknowledged_grobs): 
+
+       * lily/text-engraver.cc: remove scriptHorizontal property.
+
        * lily/beam.cc (least_squares): also set least-squares-dy for
        special case of slanted 2-stem beam to center.
 
index 703c222837dc03e2a33084df6fa863f8c1de7e5d..e50fffae20eb9808aa89a03b51c0d5807e9ded33 100644 (file)
@@ -80,7 +80,7 @@ A2_engraver::process_acknowledged_grobs ()
                text = get_property ("aDueText");
            }
          
-         Side_position_interface::set_direction (text_, dir);
+         set_grob_direction (text_, dir);
          text_->set_grob_property ("text", text);
        }
     }
@@ -193,7 +193,6 @@ A2_engraver::stop_translation_timestep ()
 {
   if (text_)
     {
-      Side_position_interface::add_staff_support (text_);
       typeset_grob (text_);
       text_ = 0;
     }
index 16bfd35141f5fa83e2c265b51f0739827c78c03d..42e3935d8de364475545a473d8ad6fff3931cadb 100644 (file)
@@ -244,7 +244,7 @@ Auto_beam_engraver::create_beam ()
      return 0;
     }
   
-  Spanner* beam = internal_make_spanner (beam_settings_);
+  Spanner* beam = new Spanner (beam_settings_);
   for (int i = 0; i < stems_->size (); i++)
     {
       /*
index 599bced280e3f7c84ac28c886aef4a58228933c5..27cfca60699fd9deddfb44491dffb9feb0b4cd7f 100644 (file)
@@ -169,8 +169,7 @@ Beam_engraver::process_music ()
       beam_info_ = new Beaming_info_list;
       
       /* urg, must copy to Auto_beam_engraver too */
-      announce_grob(beam_, evs_drul_[START]->self_scm());
+      announce_grob (beam_, evs_drul_[START]->self_scm());
     }
 
 }
index 61845036438eac948807439e01ddac8357f387af..7facbbb69a9bfebb5906a4a28fe3b4b1c74ba66d 100644 (file)
@@ -181,7 +181,6 @@ Clef_engraver::stop_translation_timestep ()
 
       if (octavate_)
        {
-         Side_position_interface::add_staff_support (octavate_);         
          typeset_grob (octavate_);
        }
 
index 79377e0176ae57ad60d9b3c5f869cfef4efcc0d1..9d62bec204d1d00b38b05671e52fe94d69bfb108 100644 (file)
@@ -363,9 +363,6 @@ Dynamic_engraver::typeset_all ()
     }
   if (finished_line_spanner_)
     {
-      /* To make sure that this works */
-      Side_position_interface::add_staff_support (finished_line_spanner_);
-      
       /*
        We used to have
        
index 5430c213a17a01366be473149b3e06a2ed8e68f7..6084cac0a736f5a92bf02753f79bc720e7162025 100644 (file)
@@ -128,7 +128,6 @@ Fingering_engraver::stop_translation_timestep ()
   for (int i=0; i < fingerings_.size (); i++)
     {
       Item *ti = fingerings_[i];
-      Side_position_interface::add_staff_support (ti);
       typeset_grob (ti);
     }
   fingerings_.clear ();
index ea3a0a969778d4c6a09b74d25c847c9b907c3b5c..2bc38644134f1c72f55896df065bf0110b642307 100644 (file)
@@ -26,21 +26,15 @@ public:
   
   DECLARE_SCHEME_CALLBACK (aligned_side, (SCM element, SCM axis));  
 
-  DECLARE_SCHEME_CALLBACK (out_of_staff, (SCM element, SCM axis));  
-
   DECLARE_SCHEME_CALLBACK (quantised_position, (SCM element, SCM axis));
 
   static SCM general_side_position (Grob*, Axis, bool);
-  static void set_axis (Grob*,Axis);
-  static void set_minimum_space (Grob*,Real);
-  static void set_padding (Grob*,Real);
   static Axis get_axis (Grob*) ;
-  static bool supported_b (Grob*) ;
+  static void set_axis (Grob*,  Axis) ;
   static bool has_interface (Grob*) ;
   static void add_support (Grob*,Grob*);
   static void add_staff_support (Grob*);
   static Direction get_direction (Grob*);
-  static void set_direction (Grob*,Direction);
 };
 
 
index 097f6da63a5f27318091a3b205886b92a2f1849d..b645c18f2fd4167f3b4f8eb31fdf871065aa1af7 100644 (file)
@@ -180,7 +180,6 @@ Multi_measure_rest_engraver::stop_translation_timestep ()
       for (int i = 0 ; i < numbers_.size(); i++)
        {
          typeset_grob (numbers_[i]);
-         Side_position_interface::add_staff_support (numbers_[i]);
        }
       
       /*
@@ -200,7 +199,6 @@ Multi_measure_rest_engraver::stop_translation_timestep ()
          for (int i = 0; i < last_numbers_.size ();i++)
            {
              typeset_grob (last_numbers_[i]);
-             Side_position_interface::add_staff_support (last_numbers_[i]);
            }
        }
       last_rest_ = 0;
index c9ff3030059cf8f6d171c99f4f51a1f9c3688927..043b432121c96f007b7d80e5aec801a6ee2b34cf 100644 (file)
@@ -299,9 +299,10 @@ New_fingering_engraver::stop_translation_timestep ()
       
       SCM follow = scm_assoc (ly_symbol2scm ("follow-into-staff"), articulations_[i].description_);
       if (gh_pair_p (follow) && to_boolean (gh_cdr (follow)))
-       sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
-      else
-       Side_position_interface::add_staff_support (sc);
+       {
+         sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
+         sc->set_grob_property ("staff-padding" , SCM_EOL);
+       }
       typeset_grob (sc);
     }
 
index 8ab24223261fc643c7f60031170ee62ac3b681b1..c4fab9af8736a11197da4fe7d468c64eaefb5bb1 100644 (file)
@@ -544,7 +544,6 @@ Piano_pedal_engraver::typeset_all ()
 
       if (p->finished_line_spanner_)
        {
-         Side_position_interface::add_staff_support (p->finished_line_spanner_);
          Grob * l = p->finished_line_spanner_->get_bound (LEFT);
          Grob * r = p->finished_line_spanner_->get_bound (RIGHT);      
          if (!r && l)
index ab53d64710d1be371841a38e3e85d34b7653060f..3324488400d04e6fe97b76d8fde591d3472018c9 100644 (file)
@@ -203,9 +203,10 @@ Script_engraver::stop_translation_timestep ()
 
       SCM follow = scm_assoc (ly_symbol2scm ("follow-into-staff"), scripts_[i].description_);
       if (gh_pair_p (follow) && to_boolean (gh_cdr (follow)))
-       sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
-      else
-       Side_position_interface::add_staff_support (sc);
+       {
+         sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
+         sc->set_grob_property ("staff-padding", SCM_EOL);
+       }
       typeset_grob (sc);
     }
   scripts_.clear ();
index 72d022130980d65d8d2ccb7b1a4fc676d6472df0..fc00cc16d62151b68111cfabb3388dd9af71ef98 100644 (file)
@@ -60,7 +60,7 @@ Script_interface::before_line_breaking (SCM smob)
       d = DOWN;
     }
   
-  Side_position_interface::set_direction (me,d);
+  set_grob_direction (me, d);
 
   if (Grob * par = me->get_parent (X_AXIS))
     {
index 3aa8e58568670706bd8af810ec3f2af01e20b59b..94c3f5d3493c8824aff51162fb217dc85a37e312 100644 (file)
@@ -221,15 +221,6 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis)
   return gh_double2scm (o);
 }
 
-void
-Side_position_interface::add_staff_support (Grob*me)
-{
-  Grob* st = Staff_symbol_referencer::get_staff_symbol (me);
-  if (st && get_axis (me) == Y_AXIS)
-    {
-      add_support (me,st);
-    }
-}
 
 void
 Side_position_interface::set_axis (Grob*me, Axis a)
@@ -251,32 +242,6 @@ Side_position_interface::get_axis (Grob*me)
   return Y_AXIS;
 }
 
-void
-Side_position_interface::set_direction (Grob*me, Direction d)
-{
-  me->set_grob_property ("direction", gh_int2scm (d));
-}
-
-void
-Side_position_interface::set_minimum_space (Grob*me, Real m)
-{
-  me->set_grob_property ("minimum-space", gh_double2scm (m));
-}
-
-void
-Side_position_interface::set_padding (Grob*me, Real p)
-{
-  me->set_grob_property ("padding", gh_double2scm (p));
-}
-
-
-bool
-Side_position_interface::supported_b (Grob*me) 
-{
-  SCM s = me->get_grob_property ("side-support-elements"); 
-  return gh_pair_p (s);
-}
-
 
 
 
index 3d849d36d918cfdd9bd2112c24371f6421422fbe..490a49eca7272aab397f27b78155f248cc565b47 100644 (file)
@@ -89,12 +89,8 @@ Text_engraver::process_acknowledged_grobs ()
 
       Item *text = new Item (get_property (basic.to_str0 ()));
 
-      /*
-       FIXME -> need to use basic props.
-       */
-      SCM axisprop = get_property ("scriptHorizontal");
       
-      Axis ax = to_boolean (axisprop) ? X_AXIS : Y_AXIS;
+      Axis ax = Y_AXIS;
       Side_position_interface::set_axis (text, ax);
 
       // Hmm
@@ -110,7 +106,7 @@ Text_engraver::process_acknowledged_grobs ()
 
       Direction dir = to_dir (r->get_mus_property ("direction"));
       if (dir)
-       Side_position_interface::set_direction (text, dir);
+       set_grob_direction (text, dir);
 
 
       SCM mark = r->get_mus_property ("text");
@@ -127,8 +123,6 @@ Text_engraver::stop_translation_timestep ()
   for (int i=0; i < texts_.size (); i++)
     {
       Item *ti = texts_[i];
-      if (!to_boolean (get_property ("scriptHorizontal")))
-       Side_position_interface::add_staff_support (ti);
       typeset_grob (ti);
     }
   texts_.clear ();
@@ -145,5 +139,5 @@ ENTER_DESCRIPTION(Text_engraver,
 /* creats*/       "TextScript",
 /* accepts */     "text-script-event",
 /* acks  */      "rhythmic-head-interface stem-interface",
-/* reads */       "scriptHorizontal",
+/* reads */       "",
 /* write */       "");
index a683befb81ac793d5878198f2d47728424d9d4be..dd95d7d03c6b78651ee43b9fffa8ff480c9fb4d9 100644 (file)
@@ -118,7 +118,6 @@ Text_spanner_engraver::typeset_all ()
 {  
   if (finished_)
     {
-      Side_position_interface::add_staff_support (finished_);
       if (!finished_->get_bound (RIGHT))
        {
          Grob* e = unsmob_grob (get_property ("currentMusicalColumn"));
index 395eab13f48ccc8fb9d17de6d1baadde4b123f42..09707316d8b381ed6e1c28c080bd27f3b2bcd5b3 100644 (file)
        (axes . (1))
        (Y-extent-callback . ,Axis_group_interface::group_extent_callback)      
        (Y-offset-callbacks . (,Side_position_interface::aligned_side))
+       (staff-padding . 0.1)
        (padding . 0.6)
        (minimum-space . 1.2)
        (direction . -1)
      . (
        (molecule-callback . ,Text_item::brew_molecule)
        (padding . 0.6)
-       (staff-padding . 0.5)
+       (staff-padding . 0.6)
        (self-alignment-X . 0)
        (self-alignment-Y . 0)
        (script-priority . 100)
        (self-alignment-X . 0)
        (direction . 1)
        (padding . 1.3)
+       (staff-padding . 1.3)
        (font-family . number)
        (meta . ((interfaces . (side-position-interface self-alignment-interface font-interface spanner-interface text-interface))))
        ))
        (self-alignment-X . 0)
        (direction . 1)
        (padding . 1.5)
+       (staff-padding . 1.5)
        (font-family . roman)
        (meta . ((interfaces . (side-position-interface self-alignment-interface font-interface spanner-interface text-interface))))
        ))
        (molecule-callback . ,Text_item::brew_molecule)
        (font-shape . italic)
        (padding . 0.4)
+       (staff-padding . 0.2)
        (font-size . -4)
        (font-family . roman)
        (meta . ((interfaces . (text-interface self-alignment-interface side-position-interface font-interface item-interface ))))
        ;; This value is sensitive: if too large, staccato dots will move a
        ;; space a away.
        (padding . 0.25)
+       (staff-padding . 0.25)
        ;; (script-priority . 0) priorities for scripts, see script.scm
        (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent))
        (before-line-breaking-callback . ,Script_interface::before_line_breaking)
        (Y-offset-callbacks . (,Side_position_interface::aligned_side))
        
        (padding . 1.2)
+       (staff-padding . 1.2)
        (minimum-space . 1.0)
        (direction . -1)
        (meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface spanner-interface))))
        (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
        (direction . -1)
        (padding . 0.5)
+       (staff-padding . 0.5)
        (script-priority . 200)
        ;; todo: add X self alignment?
        (baseline-skip . 2)
        (molecule-callback . ,Text_spanner::brew_molecule)
        (font-family . roman)
        (style . dashed-line)
-
+       (staff-padding . 0.1)
+       
        ;; urg, only for (de)cresc. text spanners
        (if-text-padding . 1.0)
        (dash-fraction . 0.2)
        (axes . (1))
        (Y-extent-callback . ,Axis_group_interface::group_extent_callback)      
        (Y-offset-callbacks . (,Side_position_interface::aligned_side))
-       
        (padding . 1.2)
+       (staff-padding . 1.2)
        (minimum-space . 1.0)
        (direction . -1)
        (meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface spanner-interface))))
index 3f11acf9d6b942afde0817658ef650d84588c6a0..af3b54b492c725ae0bd7809e16fecf6ae8b2d00e 100644 (file)
@@ -377,10 +377,6 @@ Description of scripts. This is used by Script_engraver for typesetting note-sup
                                 "If a multimeasure rest takes less
 than this number of measures, no number is printed. ")
 
-(translator-property-description 'scriptHorizontal boolean? "  Put
-scripts left or right of note heads.  Support for this is limited.
-Accidentals will collide with scripts.
-")
 (translator-property-description 'skipBars boolean? "If set to true, then
 skip the empty bars that are produced by multimeasure notes and rests.
 These bars will not appear on the printed output.  If not set (the