]> git.donarmstrong.com Git - lilypond.git/commitdiff
''
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 10 Apr 2002 15:38:40 +0000 (15:38 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 10 Apr 2002 15:38:40 +0000 (15:38 +0000)
12 files changed:
ChangeLog
lily/beam.cc
lily/dot-column.cc
lily/font-size-engraver.cc
lily/grob-interface.cc
lily/grob.cc
lily/include/beam.hh
lily/spacing-spanner.cc
lily/staff-spacing.cc
lily/stem.cc
scm/grob-description.scm
scm/grob-property-description.scm

index 3c3f7d47e64ae461f897cf02eee0a17d98c08681..3df59d362fa01fe2b0156282633fcb4723bb76d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2002-04-10  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/grob.cc (internal_get_grob_property): also typecheck
+       property reads. Catches even more undocced properties. Bugfixing
+       left for the uninspired masses.
+
+       * lily/beam.cc: remove end_after_line_breaking().
+
+       * lily/grob.cc (calculate_dependencies): remove list support for callbacks.
+
+       * lily/font-size-engraver.cc: only do font-interface.
+
 2002-04-10  Heikki Junes <hjunes@cc.hut.fi>
 
        * lilypond-font-lock.el: Handle notes with cautionary accidentals.
index 0e8bf56f3458302935d8cdfc10562738f5851688..ea36554c28c3fedee4726381f571f393434bc402 100644 (file)
@@ -353,6 +353,7 @@ Beam::after_line_breaking (SCM smob)
   for (SCM i = callbacks; gh_pair_p (i); i = ly_cdr (i))
     gh_call1 (ly_car (i), smob);
 
+  set_stem_lengths (me);  
   return SCM_UNSPECIFIED;
 }
 
@@ -884,16 +885,6 @@ Beam::slope_damping (SCM smob)
       
       me->set_grob_property ("positions", ly_interval2scm (pos));
     }
-    return SCM_UNSPECIFIED;
-}
-
-MAKE_SCHEME_CALLBACK (Beam, end_after_line_breaking, 1);
-SCM
-Beam::end_after_line_breaking (SCM smob)
-{
-  Grob *me = unsmob_grob (smob);
-  set_stem_lengths (me);
-  
   return SCM_UNSPECIFIED;
 }
 
index b37a995b1de29c92db248e99302e2948b0f3e28e..f2d5e10e97becae3eeac3d2e6c7ecacd12cfd656 100644 (file)
@@ -150,5 +150,5 @@ Dot_column::add_head (Grob * me, Grob *rh)
 
 ADD_INTERFACE (Dot_column, "dot-column-interface",
   "Interface that groups dots so they form a column",
-  "stem");
+  "direction stem");
 
index 6ca9eea7cacd2ff1ea54fe5f28b642f1a4b7f059..863bc6bf11d01c9a60c2ed4adde50b1e99f51820 100644 (file)
@@ -43,6 +43,6 @@ Font_size_engraver::acknowledge_grob (Grob_info gi)
 ENTER_DESCRIPTION(Font_size_engraver,
 /* descr */       "Puts fontSize into font-relative-size grob property.",
 /* creats*/       "",
-/* acks  */       "grob-interface",
+/* acks  */       "font-interface",
 /* reads */       "fontSize",
 /* write */       "");
index 283a49fe83281f401ddc8992a83f8e3f4f3d4e1b..f8ae9359832a83ad284164e32e3584b6ef74ce26 100644 (file)
@@ -56,8 +56,16 @@ init_iface_funcs ()
 ADD_SCM_INIT_FUNC(giface, init_iface_funcs);
 
 void
-check_interfaces_for_property (Grob *me, SCM sym)
+check_interfaces_for_property (Grob const *me, SCM sym)
 {
+  if (sym == ly_symbol2scm ("meta"))
+    {
+      /*
+       otherwise we get in a nasty recursion loop.
+       */
+      return ;
+
+    }
   SCM ifs =  me->get_grob_property ("interfaces");
 
 
index ea6fc27b5bf7dd4049a0e3c016dc75f4049da615..3202e931c31417b6644535a1fb60b6d5be81e124 100644 (file)
@@ -56,6 +56,20 @@ Grob::Grob (SCM basicprops)
 
   smobify_self ();
 
+
+  SCM meta = get_grob_property ("meta");
+  if (gh_pair_p (meta))
+    {
+      SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
+
+      /*
+       do it directly to bypass interface checks.
+       */
+      mutable_property_alist_ = gh_cons (gh_cons (ly_symbol2scm ("interfaces"),
+                                                 gh_cdr (ifs)),
+                                        mutable_property_alist_);
+    }
+  
   /*
     TODO:
 
@@ -94,18 +108,6 @@ Grob::Grob (SCM basicprops)
       dim_cache_[a].dimension_ = cb;
     }
 
-  SCM meta = get_grob_property ("meta");
-  if (gh_pair_p (meta))
-    {
-      SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
-
-      /*
-       do it directly to bypass interface checks.
-       */
-      mutable_property_alist_ = gh_cons (gh_cons (ly_symbol2scm ("interfaces"),
-                                                 gh_cdr (ifs)),
-                                        mutable_property_alist_);
-    }
 }
 
 Grob::Grob (Grob const&s)
@@ -129,6 +131,25 @@ Grob::~Grob ()
 }
 
 
+
+extern void check_interfaces_for_property (Grob const *me, SCM sym);
+
+void
+Grob::internal_set_grob_property (SCM s, SCM v)
+{
+#ifndef NDEBUG
+  if (internal_type_checking_global_b)
+    {
+      assert (type_check_assignment (s, v, ly_symbol2scm ("backend-type?")));
+      check_interfaces_for_property(this, s);
+    }
+#endif
+
+  
+  mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, s, v);
+}
+
+
 SCM
 Grob::internal_get_grob_property (SCM sym) const
 {
@@ -137,6 +158,15 @@ Grob::internal_get_grob_property (SCM sym) const
     return ly_cdr (s);
 
   s = scm_sloppy_assq (sym, immutable_property_alist_);
+  
+#ifndef NDEBUG
+  if (internal_type_checking_global_b && gh_pair_p (s))
+    {
+      assert (type_check_assignment (sym, gh_cdr (s), ly_symbol2scm ("backend-type?")));
+      check_interfaces_for_property(this, sym);
+    }
+#endif
+
   return (s == SCM_BOOL_F) ? SCM_EOL : ly_cdr (s); 
 }
 
@@ -155,44 +185,6 @@ Grob::remove_grob_property (const char* key)
 }
 
 
-#if 0
-/*
-  Puts the k, v in the immutable_property_alist_, which is convenient for
-  storing variables that are needed during the breaking process. (eg.
-  System::rank : int)
- */
-void
-Grob::set_immutable_grob_property (const char*k, SCM v)
-{
-  SCM s = ly_symbol2scm (k);
-  set_immutable_grob_property (s, v);
-}
-
-void
-Grob::set_immutable_grob_property (SCM s, SCM v)
-{
-  immutable_property_alist_ = gh_cons (gh_cons (s,v), mutable_property_alist_);
-  mutable_property_alist_ = scm_assq_remove_x (mutable_property_alist_, s);
-}
-#endif
-
-extern void check_interfaces_for_property (Grob *me, SCM sym);
-
-void
-Grob::internal_set_grob_property (SCM s, SCM v)
-{
-#ifndef NDEBUG
-  if (internal_type_checking_global_b)
-    {
-      assert (type_check_assignment (s, v, ly_symbol2scm ("backend-type?")));
-      check_interfaces_for_property(this, s);
-    }
-#endif
-
-  
-  mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, s, v);
-}
-
 
 MAKE_SCHEME_CALLBACK (Grob,molecule_extent,2);
 SCM
@@ -259,15 +251,11 @@ Grob::calculate_dependencies (int final, int busy, SCM funcname)
        ->calculate_dependencies (final, busy, funcname);
     }
 
-  // ughugh.
-  String s = ly_symbol2string (funcname);
-  SCM proc = get_grob_property (s.ch_C ());
+  
+  SCM proc = internal_get_grob_property (funcname);
   if (gh_procedure_p (proc))
     gh_call1 (proc, this->self_scm ());
-  else if (gh_list_p (proc))
-    for (SCM i = proc; gh_pair_p (i); i = ly_cdr (i))
-      gh_call1 (ly_car (i), this->self_scm ());
-  
   status_c_= final;
 }
 
@@ -958,6 +946,6 @@ ADD_INTERFACE (Grob, "grob-interface",
   "All grobs support this",
   "X-offset-callbacks Y-offset-callbacks X-extent-callback molecule cause
 Y-extent-callback molecule-callback extra-offset
-staff-symbol interfaces dependencies extra-extent-X causes
+staff-symbol interfaces dependencies extra-extent-X causes meta
 layer before-line-breaking-callback after-line-breaking-callback extra-extent-Y minimum-extent-X minimum-extent-Y transparent");
 
index 4f32cfe0e88790ef3e8a80bc538af426adc965ba..dcc7ba17905d98930d84933f0902c53bcd0acbd2 100644 (file)
@@ -29,7 +29,6 @@ public:
   DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM ));
   DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
-  DECLARE_SCHEME_CALLBACK (end_after_line_breaking, (SCM));
 
   /* position callbacks */
   DECLARE_SCHEME_CALLBACK (least_squares, (SCM));
index 68fe674790a84836cf9e4d629832f97e7b433415..2a86f22ff574a018a15bda50a0cbe41dfce5ea2d 100644 (file)
@@ -768,5 +768,5 @@ gets 2 note heads width (i.e. the space following a note is 1 note
 head width) A 16th note is followed by 0.5 note head width. The
 quarter note is followed by  3 NHW, the half by 4 NHW, etc.
 ",
-  "spacing-increment shortest-duration-space");
+  "grace-space-factor spacing-increment shortest-duration-space");
 
index 8d7a5db7c37cf33dadf996103ab8d88798a26ead..fa18624f99e717d169306692d0a1dc8a2e38889e 100644 (file)
@@ -245,4 +245,4 @@ Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed)
 
 ADD_INTERFACE (Staff_spacing,"staff-spacing-interface",
   "",
-  "left-items right-items");
+  "stem-spacing-correction left-items right-items");
index 726f71a2ab8e8382e553cd870d7843c4eb5ecd8c..ff8a4c4a99cba4ad70506413670d5a6e0aebe898 100644 (file)
@@ -808,5 +808,5 @@ Stem::has_interface (Grob*m)
 
 ADD_INTERFACE (Stem,"stem-interface",
   "A stem",
-  "thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head heads direction length style no-stem-extend flag-style dir-forced");
+  "adjust-if-on-staffline thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head heads direction length style no-stem-extend flag-style dir-forced");
 
index 5f775ddd5ca3352550d071a271476bf6c642167a..a237b014d10818ddb771a29eb561eae53769eccb 100644 (file)
@@ -63,7 +63,7 @@
        (thin-kern . 3.0)
        (hair-thickness . 1.6)
        (thick-thickness . 6.0)
-       (meta . ((interfaces . (bar-line-interface font-interface))))
+       (meta . ((interfaces . (bar-line-interface  break-aligned-interface font-interface))))
        ))
 
     
        ;; TODO: should be in SLT.
        (thickness . 0.48) ; in staff-space
        (before-line-breaking-callback . ,Beam::before_line_breaking)
-       (after-line-breaking-callback . (,Beam::after_line_breaking
-                                        ,Beam::end_after_line_breaking))
+       (after-line-breaking-callback . ,Beam::after_line_breaking)
        (neutral-direction . -1)
        (dir-function . ,beam-dir-majority-median)
        (beamed-stem-shorten . (1.0 0.5))
        (breakable . #t)
        (style . C)
        (font-family . number)
-       (meta . ((interfaces . (time-signature-interface  font-interface))))
+       (meta . ((interfaces . (time-signature-interface break-aligned-interface font-interface))))
        ))
 
     (TupletBracket
index 81e149a7fe38298e72b545436bdef56e90a2a653..f1a1c2dbc51bee5e1819990badf7460097137d1f 100644 (file)
@@ -72,7 +72,7 @@ In the case of alignment grobs, this should contain only one number.")
 (grob-property-description 'beam-width number? "width of the tremolo sign.")
 (grob-property-description 'beamed-lengths list? "list of stem lengths given beam multiplicity .")
 (grob-property-description 'beamed-minimum-lengths list? "list of minimum stem lengths given beam multiplicity.")
-(grob-property-description 'beamed-stem-shorten number? "shorten beamed stems in forced direction.")
+(grob-property-description 'beamed-stem-shorten list? "shorten beamed stems in forced direction.")
 (grob-property-description 'beaming number-pair? "number of beams extending to left and right.")
 (grob-property-description 'beautiful number? "number that dictates when a slur should be de-uglyfied.  It correlates with the enclosed area between noteheads and slurs.  A value of 0.1 yields only undisturbed slurs, a value of 5 will tolerate quite high blown slurs.")
 (grob-property-description 'before-line-breaking-callback procedure? "Procedure taking grob as argument.
@@ -228,6 +228,8 @@ and will have no effect.
 measure. Used in some spacing situations.")
 (grob-property-description 'measure-count integer? "number of measures for a multimeasure rest.")
 (grob-property-description 'merge-differently-dotted boolean? " Merge noteheads in collisions, even if they have a different number of dots. This normal notation for some types of polyphonic music. The value of this setting is used by @ref{note-collision-interface} .")
+
+(grob-property-description 'meta list? "Alist of meta information of this grob.")
 (grob-property-description 'minimum-distance number? "minimum distance between notes and rests.")
 (grob-property-description 'minimum-distances list? "list of rods (ie. (OBJ . DIST) pairs).")
 (grob-property-description 'minimum-extent-X number-pair? "minimum size in X dimension, measured in staff space.")
@@ -249,6 +251,7 @@ FIXME: also pair? (cons LEFT RIGHT)
 
 ")
 (grob-property-description 'molecule-callback procedure? "Function taking grob as argument, returning a Scheme encoded Molecule.")
+
 (grob-property-description 'molecule molecule? "Cached output of the molecule-callback.")
 
 (grob-property-description 'new-accidentals list? "list of (pitch, accidental) pairs.")
@@ -448,3 +451,4 @@ columns.
 (grob-property-description 'note-columns pair? "list of NoteColumn grobs.")
 
 (grob-property-description 'if-text-padding number? "padding in case texts are there.")
+(grob-property-description 'grace-space-factor number? "space grace at this fraction of the increment.")