+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.
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;
}
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;
}
ADD_INTERFACE (Dot_column, "dot-column-interface",
"Interface that groups dots so they form a column",
- "stem");
+ "direction stem");
ENTER_DESCRIPTION(Font_size_engraver,
/* descr */ "Puts fontSize into font-relative-size grob property.",
/* creats*/ "",
-/* acks */ "grob-interface",
+/* acks */ "font-interface",
/* reads */ "fontSize",
/* write */ "");
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");
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:
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)
}
+
+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
{
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);
}
}
-#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
->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;
}
"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");
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));
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");
ADD_INTERFACE (Staff_spacing,"staff-spacing-interface",
"",
- "left-items right-items");
+ "stem-spacing-correction left-items right-items");
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");
(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
(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.
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.")
")
(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.")
(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.")