for sending bugreports.
@item @uref{http://mail.gnu.org/mailman/listinfo/lilypond-cvs,lilypond-cvs@@gnu.org}
- for commit messages from the CVS repository, and log files from the
+ for log files from the
autobuild.
@end itemize
lily_cookie_io_functions_t io_funcs);
int lily_cookie_fclose (void *);
- int lily_cookie_fprintf (void *file, char const *format, ...);
+ int lily_cookie_fprintf (void *file, char const *format, ...)
+ __attribute__ ((format (printf, 2, 3)));
int lily_cookie_putc (int c, void *file);
#ifdef __cplusplus
#if ! HAVE_SNPRINTF /* GNU extension. */
int snprintf (char *str, size_t n, char const *format, ...);
+ __attribute__ ((format (printf, 3, 4)));
#endif
#if ! HAVE_VSNPRINTF /* GNU extension. */
static int dec2int (string dec_string);
static double dec2double (string dec_string);
static string double_string (double f, char const *fmt = 0);
- static string form_string (char const *format, ...);
+ static string form_string (char const *format, ...) __attribute__ ((format (printf, 1,2)));
static string vform_string (char const *format, va_list args);
static int hex2int (string str);
static unsigned hex2unsigned (string str);
#include "accidental-placement.hh"
#include "arpeggio.hh"
+#include "spanner.hh"
#include "context.hh"
+#include "item.hh"
#include "engraver.hh"
#include "international.hh"
#include "pitch.hh"
#include "accidental-placement.hh"
+#include "item.hh"
#include "rhythmic-head.hh"
#include "accidental-interface.hh"
#include "music.hh"
}
ADD_INTERFACE (Accidental_placement,
- "accidental-placement-interface",
"Resolve accidental collisions.",
/* properties */
/*
TODO: should move avoid-slur into item?
*/
-ADD_INTERFACE (Accidental_interface, "accidental-interface",
+ADD_INTERFACE (Accidental_interface,
"a single accidental",
"accidentals "
"avoid-slur "
}
ADD_INTERFACE (Align_interface,
- "align-interface",
"Order grobs from top to bottom, left to right, right to left or bottom "
"to top. "
"stacking-dir "
"threshold "
);
-
-struct Foobar
-{
- bool has_interface (Grob *);
-};
-
#include "engraver.hh"
#include "axis-group-interface.hh"
+#include "item.hh"
#include "note-head.hh"
#include "pitch-interval.hh"
#include "pointer-group-interface.hh"
return SCM_EOL;
}
-ADD_INTERFACE (Ambitus, "ambitus-interface",
+ADD_INTERFACE (Ambitus ,
"The line between note heads for a pitch range.",
/* props */
#include "side-position-interface.hh"
#include "stream-event.hh"
#include "note-column.hh"
+#include "item.hh"
#include "translator.icc"
#include "arpeggio.hh"
+#include "grob.hh"
#include "output-def.hh"
#include "stem.hh"
#include "staff-symbol-referencer.hh"
return ly_interval2scm (arpeggio.extent (X_AXIS));
}
-ADD_INTERFACE (Arpeggio, "arpeggio-interface",
+ADD_INTERFACE (Arpeggio,
"Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads.",
/* properties */
}
}
-ADD_INTERFACE (Axis_group_interface, "axis-group-interface",
+ADD_INTERFACE (Axis_group_interface,
"An object that groups other layout objects.",
#include "engraver.hh"
-
#include "stream-event.hh"
#include "item.hh"
{
public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE ();
};
MAKE_SCHEME_CALLBACK (Balloon_interface, print, 1);
return fr.smobbed_copy ();
}
-ADD_INTERFACE (Balloon_interface, "text-balloon-interface",
+ADD_INTERFACE (Balloon_interface,
"A collection of routines to put text balloons around an object.",
/* properties */
ADD_INTERFACE (Bar_line,
- "bar-line-interface",
"Bar line.\n"
"\n"
#include <algorithm>
using namespace std;
+#include "grob.hh"
#include "align-interface.hh"
#include "international.hh"
#include "output-def.hh"
}
ADD_INTERFACE (Beam,
- "beam-interface",
"A beam. \n\n"
"The @code{thickness} property is the weight of beams, "
#include "axis-group-interface.hh"
#include "context.hh"
#include "translator-group.hh"
+#include "item.hh"
#include "translator.icc"
column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ());
- Break_align_interface::add_element (align_, group);
+ Break_alignment_interface::add_element (align_, group);
}
Axis_group_interface::add_element (group, item);
}
"Align grobs with corresponding @code{break-align-symbols} into "
"groups, and order the groups according to @code{breakAlignOrder}. "
"The left edge of the alignment gets a separate group, with a symbol @code{left-edge}. ",
- /* create */ "BreakAlignment BreakAlignGroup LeftEdge",
+ /* create */ "BreakAlignment "
+ "BreakAlignGroup "
+ "LeftEdge ",
/* read */ "",
/* write */ "");
+++ /dev/null
-/*
- break-align-interface.cc -- implement Break_align_interface
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
-*/
-
-
-#include "break-align-interface.hh"
-
-#include "align-interface.hh"
-#include "axis-group-interface.hh"
-#include "dimensions.hh"
-#include "international.hh"
-#include "output-def.hh"
-#include "paper-column.hh"
-#include "pointer-group-interface.hh"
-#include "self-alignment-interface.hh"
-#include "side-position-interface.hh"
-#include "warn.hh"
-
-
-MAKE_SCHEME_CALLBACK (Break_align_interface, self_align_callback, 1);
-SCM
-Break_align_interface::self_align_callback (SCM smob)
-{
- Grob *me = unsmob_grob (smob);
-
- Item *item = dynamic_cast<Item *> (me);
- Direction bsd = item->break_status_dir ();
- if (bsd == LEFT)
- me->set_property ("self-alignment-X", scm_from_int (RIGHT));
-
- /*
- Force break alignment itself to be done first, in the case
- */
- return Self_alignment_interface::aligned_on_self (me, X_AXIS);
-}
-
-/*
- This is tricky: we cannot modify 'elements, since callers are
- iterating the same list. Reordering the list in-place, or resetting
- 'elements will skip elements in the loops of callers.
-
- So we return the correct order as an array.
-*/
-SCM
-Break_align_interface::break_align_order (Item *me)
-{
- SCM order_vec = me->get_property ("break-align-orders");
- if (!scm_is_vector (order_vec)
- || scm_c_vector_length (order_vec) < 3)
- return SCM_BOOL_F;
-
- SCM order = scm_vector_ref (order_vec,
- scm_from_int (me->break_status_dir () + 1));
-
-
- return order;
-}
-
-
-vector<Grob*>
-Break_align_interface::ordered_elements (Grob *grob)
-{
- Item *me = dynamic_cast<Item *> (grob);
- extract_grob_set (me, "elements", elts);
-
-
- SCM order = break_align_order (me);
-
- if (order == SCM_BOOL_F)
- return elts;
-
- vector<Grob*> writable_elts (elts);
- /*
- Copy in order specified in BREAK-ALIGN-ORDER.
- */
- vector<Grob*> new_elts;
- for (; scm_is_pair (order); order = scm_cdr (order))
- {
- SCM sym = scm_car (order);
-
- for (vsize i = writable_elts.size (); i--;)
- {
- Grob *g = writable_elts[i];
- if (g && sym == g->get_property ("break-align-symbol"))
- {
- new_elts.push_back (g);
- writable_elts.erase (writable_elts.begin () + i);
- }
- }
- }
-
- return new_elts;
-}
-
-void
-Break_align_interface::add_element (Grob *me, Grob *toadd)
-{
- Align_interface::add_element (me, toadd);
-}
-
-MAKE_SCHEME_CALLBACK(Break_align_interface, calc_positioning_done, 1)
-SCM
-Break_align_interface::calc_positioning_done (SCM smob)
-{
- Grob *grob = unsmob_grob (smob);
- Item *me = dynamic_cast<Item *> (grob);
-
- vector<Grob*> elems = ordered_elements (me);
- vector<Interval> extents;
-
- int last_nonempty = -1;
- for (vsize i = 0; i < elems.size (); i++)
- {
- Interval y = elems[i]->extent (elems[i], X_AXIS);
- extents.push_back (y);
- if (!y.is_empty ())
- last_nonempty = i;
- }
-
- vsize idx = 0;
- while (idx < extents.size () && extents[idx].is_empty ())
- idx++;
-
- vector<Real> offsets;
- offsets.resize (elems.size ());
- for (vsize i = 0; i < offsets.size ();i++)
- offsets[i] = 0.0;
-
- Real extra_right_space = 0.0;
- vsize edge_idx = VPOS;
- while (idx < elems.size ())
- {
- vsize next_idx = idx + 1;
- while (next_idx < elems.size ()
- && extents[next_idx].is_empty ())
- next_idx++;
-
- Grob *l = elems[idx];
- Grob *r = 0;
-
- if (next_idx < elems.size ())
- r = elems[next_idx];
-
- SCM alist = SCM_EOL;
-
- /*
- Find the first grob with a space-alist entry.
- */
- extract_grob_set (l, "elements", elts);
-
- for (vsize i = elts.size (); i--;)
- {
- Grob *elt = elts[i];
-
- if (edge_idx == VPOS
- && (elt->get_property ("break-align-symbol")
- == ly_symbol2scm ("left-edge")))
- edge_idx = idx;
-
- SCM l = elt->get_property ("space-alist");
- if (scm_is_pair (l))
- {
- alist = l;
- break;
- }
- }
-
- SCM rsym = r ? SCM_EOL : ly_symbol2scm ("right-edge");
-
- /*
- We used to use #'cause to find out the symbol and the spacing
- table, but that gets icky when that grob is suicided for some
- reason.
- */
- if (r)
- {
- extract_grob_set (r, "elements", elts);
- for (vsize i = elts.size ();
- !scm_is_symbol (rsym) && i--;)
- {
- Grob *elt = elts[i];
- rsym = elt->get_property ("break-align-symbol");
- }
- }
-
- if (rsym == ly_symbol2scm ("left-edge"))
- edge_idx = next_idx;
-
- SCM entry = SCM_EOL;
- if (scm_is_symbol (rsym))
- entry = scm_assq (rsym, alist);
-
- bool entry_found = scm_is_pair (entry);
- if (!entry_found)
- {
- string sym_string;
- if (scm_is_symbol (rsym))
- sym_string = ly_symbol2string (rsym);
-
- string orig_string;
- if (unsmob_grob (l->get_property ("cause")))
- orig_string = unsmob_grob (l->get_property ("cause"))->name ();
-
- programming_error (_f ("No spacing entry from %s to `%s'",
- orig_string.c_str (),
- sym_string.c_str ()));
- }
-
- Real distance = 1.0;
- SCM type = ly_symbol2scm ("extra-space");
-
- if (entry_found)
- {
- entry = scm_cdr (entry);
-
- distance = scm_to_double (scm_cdr (entry));
- type = scm_car (entry);
- }
-
- if (r)
- {
- if (type == ly_symbol2scm ("extra-space"))
- offsets[next_idx] = extents[idx][RIGHT] + distance
- - extents[next_idx][LEFT];
- /* should probably junk minimum-space */
- else if (type == ly_symbol2scm ("minimum-space"))
- offsets[next_idx] = max (extents[idx][RIGHT], distance);
- }
- else
- {
- extra_right_space = distance;
- if (idx < offsets.size() - 1)
- offsets[idx+1] = extents[idx][RIGHT] + distance;
- }
-
- idx = next_idx;
- }
-
- Real here = 0.0;
- Interval total_extent;
-
- Real alignment_off = 0.0;
- for (vsize i = 0; i < offsets.size (); i++)
- {
- here += offsets[i];
- if (i == edge_idx)
- alignment_off = -here;
- total_extent.unite (extents[i] + here);
- }
-
- if (total_extent.is_empty ())
- return SCM_BOOL_T;
-
- if (me->break_status_dir () == LEFT)
- alignment_off = -total_extent[RIGHT] - extra_right_space;
- else if (edge_idx == VPOS)
- alignment_off = -total_extent[LEFT];
-
- here = alignment_off;
- for (vsize i = 0; i < offsets.size (); i++)
- {
- here += offsets[i];
- elems[i]->translate_axis (here, X_AXIS);
- }
-
- return SCM_BOOL_T;
-}
-
-ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface",
- "Items that are aligned in prefatory matter.\n"
- "\n"
- "The spacing of these items is controlled by the @code{space-alist}\n"
- "property. It contains a list @code{break-align-symbol}s with a specification\n"
- "of the associated space. The space specification can be "
- "@table @code\n"
- "@item (minimum-space . @var{spc}))\n"
- " Pad space until the distance is @var{spc}\n"
- "@item (fixed-space . @var{spc})\n"
- " Set a fixed space\n"
- "@item (semi-fixed-space . @var{spc})\n"
- " Set a space. Half of it is fixed and half is stretchable. \n"
- "(does not work at start of line. fixme)\n"
- "@item (extra-space . @var{spc})\n"
- " Add @var{spc} amount of space.\n"
- "@end table\n"
- "\n"
- "Special keys for the alist are @code{first-note} and @code{next-note}, signifying\n"
- "the first note on a line, and the next note halfway a line.\n"
- "\n"
- "Rules for this spacing are much more complicated than this. \n"
- "See [Wanske] page 126 -- 134, [Ross] pg 143 -- 147\n",
-
- /* properties */
- "break-align-symbol "
- "space-alist "
- );
-
-ADD_INTERFACE (Break_align_interface, "break-alignment-interface",
- "The object that performs break aligment. See @ref{break-aligned-interface}.",
-
- /* properties */
- "positioning-done "
- "break-align-orders");
-
-
-MAKE_SCHEME_CALLBACK(Break_alignment_align_interface, self_align_callback, 1)
-SCM
-Break_alignment_align_interface::self_align_callback (SCM grob)
-{
- Grob *me = unsmob_grob (grob);
- Item *alignment = dynamic_cast<Item*> (me->get_parent (X_AXIS));
- if (!Break_align_interface::has_interface (alignment))
- return scm_from_int (0);
-
- SCM my_align = me->get_property ("break-align-symbol");
- SCM order = Break_align_interface::break_align_order (alignment);
-
- vector<Grob*> elements = Break_align_interface::ordered_elements (alignment);
- if (elements.size () == 0)
- return scm_from_int (0);
-
- int last_idx_found = -1;
- vsize i = 0;
- for (SCM s = order; scm_is_pair (s); s = scm_cdr (s))
- {
- if (i < elements.size ()
- && elements[i]->get_property ("break-align-symbol") == scm_car (s))
- {
- last_idx_found = i;
- i ++;
- }
-
- if (scm_car (s) == my_align)
- break ;
- }
-
- Direction which_edge = LEFT;
- if (vsize (last_idx_found + 1) < elements.size())
- last_idx_found ++;
- else
- which_edge = RIGHT;
-
- Grob *common = me->common_refpoint (elements[last_idx_found], X_AXIS);
-
- return scm_from_double (robust_relative_extent (elements[last_idx_found], common, X_AXIS)[which_edge]
- - me->relative_coordinate (common, X_AXIS));
-}
-
-ADD_INTERFACE (Break_alignment_align_interface, "break-alignment-align-interface",
- "Object that is aligned on a break aligment. ",
-
- /* properties */
- "break-align-symbol "
- )
-
-
--- /dev/null
+/*
+ break-align-interface.cc -- implement Break_alignment_interface
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
+
+
+#include "break-align-interface.hh"
+
+#include "align-interface.hh"
+#include "axis-group-interface.hh"
+#include "dimensions.hh"
+#include "international.hh"
+#include "output-def.hh"
+#include "paper-column.hh"
+#include "pointer-group-interface.hh"
+#include "self-alignment-interface.hh"
+#include "side-position-interface.hh"
+#include "warn.hh"
+
+
+MAKE_SCHEME_CALLBACK (Break_alignment_interface, self_align_callback, 1);
+SCM
+Break_alignment_interface::self_align_callback (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+
+ Item *item = dynamic_cast<Item *> (me);
+ Direction bsd = item->break_status_dir ();
+ if (bsd == LEFT)
+ me->set_property ("self-alignment-X", scm_from_int (RIGHT));
+
+ /*
+ Force break alignment itself to be done first, in the case
+ */
+ return Self_alignment_interface::aligned_on_self (me, X_AXIS);
+}
+
+/*
+ This is tricky: we cannot modify 'elements, since callers are
+ iterating the same list. Reordering the list in-place, or resetting
+ 'elements will skip elements in the loops of callers.
+
+ So we return the correct order as an array.
+*/
+SCM
+Break_alignment_interface::break_align_order (Item *me)
+{
+ SCM order_vec = me->get_property ("break-align-orders");
+ if (!scm_is_vector (order_vec)
+ || scm_c_vector_length (order_vec) < 3)
+ return SCM_BOOL_F;
+
+ SCM order = scm_vector_ref (order_vec,
+ scm_from_int (me->break_status_dir () + 1));
+
+
+ return order;
+}
+
+
+vector<Grob*>
+Break_alignment_interface::ordered_elements (Grob *grob)
+{
+ Item *me = dynamic_cast<Item *> (grob);
+ extract_grob_set (me, "elements", elts);
+
+
+ SCM order = break_align_order (me);
+
+ if (order == SCM_BOOL_F)
+ return elts;
+
+ vector<Grob*> writable_elts (elts);
+ /*
+ Copy in order specified in BREAK-ALIGN-ORDER.
+ */
+ vector<Grob*> new_elts;
+ for (; scm_is_pair (order); order = scm_cdr (order))
+ {
+ SCM sym = scm_car (order);
+
+ for (vsize i = writable_elts.size (); i--;)
+ {
+ Grob *g = writable_elts[i];
+ if (g && sym == g->get_property ("break-align-symbol"))
+ {
+ new_elts.push_back (g);
+ writable_elts.erase (writable_elts.begin () + i);
+ }
+ }
+ }
+
+ return new_elts;
+}
+
+void
+Break_alignment_interface::add_element (Grob *me, Grob *toadd)
+{
+ Align_interface::add_element (me, toadd);
+}
+
+MAKE_SCHEME_CALLBACK(Break_alignment_interface, calc_positioning_done, 1)
+SCM
+Break_alignment_interface::calc_positioning_done (SCM smob)
+{
+ Grob *grob = unsmob_grob (smob);
+ Item *me = dynamic_cast<Item *> (grob);
+
+ vector<Grob*> elems = ordered_elements (me);
+ vector<Interval> extents;
+
+ int last_nonempty = -1;
+ for (vsize i = 0; i < elems.size (); i++)
+ {
+ Interval y = elems[i]->extent (elems[i], X_AXIS);
+ extents.push_back (y);
+ if (!y.is_empty ())
+ last_nonempty = i;
+ }
+
+ vsize idx = 0;
+ while (idx < extents.size () && extents[idx].is_empty ())
+ idx++;
+
+ vector<Real> offsets;
+ offsets.resize (elems.size ());
+ for (vsize i = 0; i < offsets.size ();i++)
+ offsets[i] = 0.0;
+
+ Real extra_right_space = 0.0;
+ vsize edge_idx = VPOS;
+ while (idx < elems.size ())
+ {
+ vsize next_idx = idx + 1;
+ while (next_idx < elems.size ()
+ && extents[next_idx].is_empty ())
+ next_idx++;
+
+ Grob *l = elems[idx];
+ Grob *r = 0;
+
+ if (next_idx < elems.size ())
+ r = elems[next_idx];
+
+ SCM alist = SCM_EOL;
+
+ /*
+ Find the first grob with a space-alist entry.
+ */
+ extract_grob_set (l, "elements", elts);
+
+ for (vsize i = elts.size (); i--;)
+ {
+ Grob *elt = elts[i];
+
+ if (edge_idx == VPOS
+ && (elt->get_property ("break-align-symbol")
+ == ly_symbol2scm ("left-edge")))
+ edge_idx = idx;
+
+ SCM l = elt->get_property ("space-alist");
+ if (scm_is_pair (l))
+ {
+ alist = l;
+ break;
+ }
+ }
+
+ SCM rsym = r ? SCM_EOL : ly_symbol2scm ("right-edge");
+
+ /*
+ We used to use #'cause to find out the symbol and the spacing
+ table, but that gets icky when that grob is suicided for some
+ reason.
+ */
+ if (r)
+ {
+ extract_grob_set (r, "elements", elts);
+ for (vsize i = elts.size ();
+ !scm_is_symbol (rsym) && i--;)
+ {
+ Grob *elt = elts[i];
+ rsym = elt->get_property ("break-align-symbol");
+ }
+ }
+
+ if (rsym == ly_symbol2scm ("left-edge"))
+ edge_idx = next_idx;
+
+ SCM entry = SCM_EOL;
+ if (scm_is_symbol (rsym))
+ entry = scm_assq (rsym, alist);
+
+ bool entry_found = scm_is_pair (entry);
+ if (!entry_found)
+ {
+ string sym_string;
+ if (scm_is_symbol (rsym))
+ sym_string = ly_symbol2string (rsym);
+
+ string orig_string;
+ if (unsmob_grob (l->get_property ("cause")))
+ orig_string = unsmob_grob (l->get_property ("cause"))->name ();
+
+ programming_error (_f ("No spacing entry from %s to `%s'",
+ orig_string.c_str (),
+ sym_string.c_str ()));
+ }
+
+ Real distance = 1.0;
+ SCM type = ly_symbol2scm ("extra-space");
+
+ if (entry_found)
+ {
+ entry = scm_cdr (entry);
+
+ distance = scm_to_double (scm_cdr (entry));
+ type = scm_car (entry);
+ }
+
+ if (r)
+ {
+ if (type == ly_symbol2scm ("extra-space"))
+ offsets[next_idx] = extents[idx][RIGHT] + distance
+ - extents[next_idx][LEFT];
+ /* should probably junk minimum-space */
+ else if (type == ly_symbol2scm ("minimum-space"))
+ offsets[next_idx] = max (extents[idx][RIGHT], distance);
+ }
+ else
+ {
+ extra_right_space = distance;
+ if (idx < offsets.size() - 1)
+ offsets[idx+1] = extents[idx][RIGHT] + distance;
+ }
+
+ idx = next_idx;
+ }
+
+ Real here = 0.0;
+ Interval total_extent;
+
+ Real alignment_off = 0.0;
+ for (vsize i = 0; i < offsets.size (); i++)
+ {
+ here += offsets[i];
+ if (i == edge_idx)
+ alignment_off = -here;
+ total_extent.unite (extents[i] + here);
+ }
+
+ if (total_extent.is_empty ())
+ return SCM_BOOL_T;
+
+ if (me->break_status_dir () == LEFT)
+ alignment_off = -total_extent[RIGHT] - extra_right_space;
+ else if (edge_idx == VPOS)
+ alignment_off = -total_extent[LEFT];
+
+ here = alignment_off;
+ for (vsize i = 0; i < offsets.size (); i++)
+ {
+ here += offsets[i];
+ elems[i]->translate_axis (here, X_AXIS);
+ }
+
+ return SCM_BOOL_T;
+}
+
+
+
+MAKE_SCHEME_CALLBACK(Break_alignable_interface, self_align_callback, 1)
+SCM
+Break_alignable_interface::self_align_callback (SCM grob)
+{
+ Grob *me = unsmob_grob (grob);
+ Item *alignment = dynamic_cast<Item*> (me->get_parent (X_AXIS));
+ if (!Break_alignment_interface::has_interface (alignment))
+ return scm_from_int (0);
+
+ SCM my_align = me->get_property ("break-align-symbol");
+ SCM order = Break_alignment_interface::break_align_order (alignment);
+
+ vector<Grob*> elements = Break_alignment_interface::ordered_elements (alignment);
+ if (elements.size () == 0)
+ return scm_from_int (0);
+
+ int last_idx_found = -1;
+ vsize i = 0;
+ for (SCM s = order; scm_is_pair (s); s = scm_cdr (s))
+ {
+ if (i < elements.size ()
+ && elements[i]->get_property ("break-align-symbol") == scm_car (s))
+ {
+ last_idx_found = i;
+ i ++;
+ }
+
+ if (scm_car (s) == my_align)
+ break ;
+ }
+
+ Direction which_edge = LEFT;
+ if (vsize (last_idx_found + 1) < elements.size())
+ last_idx_found ++;
+ else
+ which_edge = RIGHT;
+
+ Grob *common = me->common_refpoint (elements[last_idx_found], X_AXIS);
+
+ return scm_from_double (robust_relative_extent (elements[last_idx_found], common, X_AXIS)[which_edge]
+ - me->relative_coordinate (common, X_AXIS));
+}
+
+ADD_INTERFACE (Break_alignable_interface,
+ "Object that is aligned on a break aligment. ",
+
+ /* properties */
+ "break-align-symbol "
+ )
+
+
+
+ADD_INTERFACE (Break_aligned_interface,
+ "Items that are aligned in prefatory matter.\n"
+ "\n"
+ "The spacing of these items is controlled by the @code{space-alist}\n"
+ "property. It contains a list @code{break-align-symbol}s with a specification\n"
+ "of the associated space. The space specification can be "
+ "@table @code\n"
+ "@item (minimum-space . @var{spc}))\n"
+ " Pad space until the distance is @var{spc}\n"
+ "@item (fixed-space . @var{spc})\n"
+ " Set a fixed space\n"
+ "@item (semi-fixed-space . @var{spc})\n"
+ " Set a space. Half of it is fixed and half is stretchable. \n"
+ "(does not work at start of line. fixme)\n"
+ "@item (extra-space . @var{spc})\n"
+ " Add @var{spc} amount of space.\n"
+ "@end table\n"
+ "\n"
+ "Special keys for the alist are @code{first-note} and @code{next-note}, signifying\n"
+ "the first note on a line, and the next note halfway a line.\n"
+ "\n"
+ "Rules for this spacing are much more complicated than this. \n"
+ "See [Wanske] page 126 -- 134, [Ross] pg 143 -- 147\n",
+
+ /* properties */
+ "break-align-symbol "
+ "space-alist "
+ );
+
+ADD_INTERFACE (Break_alignment_interface,
+ "The object that performs break aligment. See @ref{break-aligned-interface}.",
+
+ /* properties */
+ "positioning-done "
+ "break-align-orders");
return scm_from_double (inter * sz * d);
}
-ADD_INTERFACE (Breathing_sign, "breathing-sign-interface",
+ADD_INTERFACE (Breathing_sign,
"A breathing sign.",
"direction "
return SCM_UNSPECIFIED;
}
-ADD_INTERFACE (Chord_name, "chord-name-interface",
+ADD_INTERFACE (Chord_name,
"A chord name.",
#include <cctype>
using namespace std;
+#include "item.hh"
#include "context.hh"
#include "bar-line.hh"
#include "staff-symbol-referencer.hh"
return out.smobbed_copy ();
}
-ADD_INTERFACE (Clef, "clef-interface",
+ADD_INTERFACE (Clef,
"A clef sign",
/* properties */
#include "pointer-group-interface.hh"
#include "pitch.hh"
#include "stream-event.hh"
+#include "item.hh"
#include "translator.icc"
return out.smobbed_copy ();
}
-ADD_INTERFACE (Cluster, "cluster-interface",
+ADD_INTERFACE (Cluster,
"A graphically drawn musical cluster. "
"\n\n"
"@code{padding} adds to the vertical extent of the shape (top and "
{
public:
DECLARE_SCHEME_CALLBACK (height, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 1);
}
ADD_INTERFACE (Cluster_beacon,
- "cluster-beacon-interface",
"A place holder for the cluster spanner to determine the vertical "
"extents of a cluster spanner at this X position.",
#include "note-column.hh"
#include "note-collision.hh"
#include "axis-group-interface.hh"
+#include "item.hh"
class Collision_engraver : public Engraver
{
return stencil.smobbed_copy ();
}
-ADD_INTERFACE (Custos, "custos-interface",
+ADD_INTERFACE (Custos,
"A custos object.",
"style "
"neutral-position "
#include "side-position-interface.hh"
#include "engraver.hh"
#include "translator.icc"
+#include "item.hh"
class Dot_column_engraver : public Engraver
{
}
ADD_INTERFACE (Dot_column,
- "dot-column-interface",
"Groups dot objects so they form a column, and position dots so they do not "
"clash with staff lines ",
return mol.smobbed_copy ();
}
-ADD_INTERFACE (Dots, "dots-interface",
+ADD_INTERFACE (Dots,
"The dots to go with a notehead or rest."
"@code{direction} sets the preferred direction to move in case of staff "
"line collisions.",
#include <cctype>
using namespace std;
+#include "item.hh"
#include "duration.hh"
#include "engraver.hh"
#include "note-column.hh"
#include "staff-symbol-referencer.hh"
#include "stream-event.hh"
#include "warn.hh"
+#include "item.hh"
+#include "spanner.hh"
#include "translator.icc"
{
public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
/*
}
ADD_INTERFACE (Dynamic_text_spanner,
- "dynamic-text-spanner-interface",
"A text spanner for crescendo texts",
"bound-padding "
struct Enclosing_bracket
{
- static bool has_interface (Grob*);
+ DECLARE_GROB_INTERFACE();
public:
DECLARE_SCHEME_CALLBACK(print, (SCM));
ADD_INTERFACE(Enclosing_bracket,
- "enclosing-bracket-interface",
"Brackets alongside bass figures.",
#include "pointer-group-interface.hh"
#include "stream-event.hh"
#include "warn.hh"
+#include "spanner.hh"
#include "translator.icc"
struct Figured_bass_continuation
{
- static bool has_interface (Grob*);
+ DECLARE_GROB_INTERFACE();
public:
DECLARE_SCHEME_CALLBACK(print, (SCM));
}
ADD_INTERFACE(Figured_bass_continuation,
- "figured-bass-continuation-interface",
"Simple extender line between bounds.",
/* props */
#include "context.hh"
#include "spanner.hh"
+#include "item.hh"
#include "side-position-interface.hh"
#include "translator.icc"
#include "axis-group-interface.hh"
#include "side-position-interface.hh"
#include "stem.hh"
#include "stream-event.hh"
+#include "item.hh"
#include "translator.icc"
return g->get_property_alist_chain (defaults);
}
-ADD_INTERFACE (Font_interface, "font-interface",
+ADD_INTERFACE (Font_interface,
"Any symbol that is typeset through fixed sets of glyphs, "
" (ie. fonts)",
LY_DEFINE (ly_camel_case_to_lisp_identifier, "ly:camel-case->lisp-identifier",
1, 0, 0, (SCM name_sym),
- "Convert FooBar to foo-bar style symbol.")
+ "Convert FooBar_Bla to foo-bar-bla style symbol.")
{
SCM_ASSERT_TYPE(scm_is_symbol (name_sym), name_sym,
SCM_ARG1, __FUNCTION__, "symbol");
*/
const string in = ly_symbol2string (name_sym);
-
- vector<char> out;
-
- /* don't add '-' before first character */
- out.push_back (tolower (in[0]));
-
- for (size_t inpos = 1; inpos < in.size (); inpos++)
- {
- if (isupper (in[inpos]))
- out.push_back ('-');
- out.push_back (tolower (in[inpos]));
- }
+ string result = camel_case_to_lisp_identifier (in);
- string result (&out[0], out.size ());
return ly_symbol2scm (result.c_str ());
}
subclass like VaticanaLigatureEngraver. The property is lateron
read by the associated item class, such as VaticanaLigature.--jr
*/
-ADD_INTERFACE (Gregorian_ligature, "gregorian-ligature-interface",
+ADD_INTERFACE (Gregorian_ligature,
"A gregorian ligature",
"virga stropha inclinatum auctum descendens ascendens "
"oriscus quilisma deminutum cavum linea pes-or-flexa "
Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), b);
}
-ADD_INTERFACE (Grid_line_interface, "grid-line-interface",
+ADD_INTERFACE (Grid_line_interface,
"A line that spanned between grid-points. ",
"elements thickness");
-ADD_INTERFACE (Grid_point_interface, "grid-point-interface",
+ADD_INTERFACE (Grid_point_interface,
"A spanning point for grid lines. ",
"");
#include "international.hh"
#include "protected-scm.hh"
#include "std-string.hh"
+#include "string-convert.hh"
#include "warn.hh"
+#include "misc.hh"
-void add_interface (char const *symbol,
+SCM add_interface (char const *cxx_name,
char const *descr,
char const *vars)
{
- SCM s = ly_symbol2scm (symbol);
+ string suffix ("-interface");
+ string lispy_name = camel_case_to_lisp_identifier (cxx_name);
+ vsize end = max (int (0), int (lispy_name.length () - suffix.length ()));
+ if (lispy_name.substr (end) != suffix)
+ lispy_name += suffix;
+
+ SCM s = ly_symbol2scm (lispy_name.c_str ());
SCM d = scm_makfrom0str (descr);
SCM l = parse_symbol_list (vars);
ly_add_interface (s, d, l);
+
+ return s;
}
void
}
-ADD_INTERFACE (Grob, "grob-interface",
+ADD_INTERFACE (Grob,
"A grob represents a piece of music notation\n"
"\n"
"All grobs have an X and Y-position on the page. These X and Y positions\n"
return mol.smobbed_copy ();
}
-ADD_INTERFACE (Hairpin, "hairpin-interface",
+ADD_INTERFACE (Hairpin,
"A hairpin crescendo/decrescendo.",
/* props */
Pointer_group_interface::add_unordered_grob (me, ly_symbol2scm ("items-worth-living"), n);
}
-ADD_INTERFACE (Hara_kiri_group_spanner, "hara-kiri-group-interface",
+ADD_INTERFACE (Hara_kiri_group_spanner,
"A group spanner that keeps track of interesting items. If it "
"doesn't contain any after linebreaking, then it "
"will remove itself and all its children.",
#include "pointer-group-interface.hh"
#include "side-position-interface.hh"
#include "stream-event.hh"
+#include "spanner.hh"
+#include "item.hh"
#include "translator.icc"
#include "staff-symbol-referencer.hh"
#include "tuplet-bracket.hh"
#include "axis-group-interface.hh"
+#include "spanner.hh"
+#include "item.hh"
Stencil
}
ADD_INTERFACE (Horizontal_bracket,
-
- "horizontal-bracket-interface",
"A horizontal bracket encompassing notes.",
/* props */
#include "box.hh"
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
class Accidental_interface
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static string get_fontcharname (string style, int alteration);
static vector<Box> accurate_boxes (Grob *me,
Grob **common);
#ifndef ACCIDENTAL_PLACEMENT_HH
#define ACCIDENTAL_PLACEMENT_HH
+#include "grob-interface.hh"
#include "grob.hh"
class Accidental_placement
vector<Grob*> *real_acc);
DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* ACCIDENTAL_PLACEMENT_HH */
#include "lily-proto.hh"
#include "lily-guile.hh"
#include "std-vector.hh"
+#include "grob-interface.hh"
struct Align_interface
{
static void add_element (Grob *, Grob *);
static int get_count (Grob *, Grob *);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Real get_pure_child_y_translation (Grob *, Grob *child, int start, int end);
};
#define AMBITUS_HH
#include "lily-guile.hh"
-
-class Grob;
+#include "lily-proto.hh"
+#include "grob-interface.hh"
struct Ambitus
{
DECLARE_SCHEME_CALLBACK (print, (SCM smob));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Slice get_positions (Grob *);
static Interval head_width (Grob *me, Grob *common);
};
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
+
class Arpeggio
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (brew_chord_bracket, (SCM));
DECLARE_SCHEME_CALLBACK (width, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* ARPEGGIO_HH */
#include "std-vector.hh"
#include "lily-proto.hh"
#include "lily-guile.hh"
+#include "grob-interface.hh"
-/**
- */
struct Axis_group_interface
{
static SCM generic_group_extent (Grob *me, Axis a);
static void set_axes (Grob *, Axis, Axis);
static bool has_axis (Grob *, Axis);
static void get_children (Grob *, vector<Grob*> *);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* AXIS_GROUP_INTERFACE_HH */
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
-/**
- A vertical bar.
-*/
class Bar_line
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Stencil dashed_bar_line (Grob *me, Real h, Real thick);
static Stencil compound_barline (Grob *, string, Real height, bool rounded);
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
/**
A vertical bar.
class Bar
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Stencil compound_barline (Grob *, string, Real height);
static Stencil simple_barline (Grob *, Real wid, Real height);
#ifndef BEAM_HH
#define BEAM_HH
+#include "grob-interface.hh"
#include "std-vector.hh"
#include "lily-proto.hh"
#include "lily-guile.hh"
static int visible_stem_count (Grob *);
static Grob *first_visible_stem (Grob *);
static Grob *last_visible_stem (Grob *);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static void add_stem (Grob *, Grob *);
static bool is_knee (Grob *);
static void set_beaming (Grob *, Beaming_pattern const *);
/*
- break-align-interface.hh -- declare Break_align_interface
+ break-align-interface.hh -- declare Break_alignment_interface
source file of the GNU LilyPond music typesetter
#ifndef BREAK_ALIGN_INTERFACE_HH
#define BREAK_ALIGN_INTERFACE_HH
-#include "item.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
-class Break_align_interface
+class Break_alignment_interface
{
public:
static vector<Grob*> ordered_elements (Grob *me);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static void add_element (Grob *me, Grob *add);
static SCM break_align_order (Item *me);
DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element));
struct Break_aligned_interface
{
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
-struct Break_alignment_align_interface
+struct Break_alignable_interface
{
DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif // BREAK_ALIGN_INTERFACE_HH
#ifndef BREATHING_SIGN_HH
#define BREATHING_SIGN_HH
+#include "grob-interface.hh"
#include "lily-guile.hh"
class Grob;
DECLARE_SCHEME_CALLBACK (finalis, (SCM));
DECLARE_SCHEME_CALLBACK (offset_callback, (SCM element));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif // BREATHING_SIGN_HH
#define CHORD_NAME_HH
#include "stencil.hh"
+#include "grob-interface.hh"
class Chord_name
{
public:
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif // CHORD_NAME_HH
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
struct Clef
{
DECLARE_SCHEME_CALLBACK (calc_glyph_name, (SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* CLEF_HH */
#define CLUSTER_HH
#include "stencil.hh"
+#include "grob-interface.hh"
class Cluster
{
public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
- // DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
- static bool has_interface (Grob *);
- // DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
+ DECLARE_GROB_INTERFACE();
};
#endif // CLUSTER_HH
#define CUSTOS_HH
#include "lily-guile.hh"
-
-class Grob;
-class Stencil;
+#include "lily-proto.hh"
+#include "grob-interface.hh"
struct Custos
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
private:
static void add_streepjes (Grob *me, int pos, int interspaces, Stencil *custos_);
#define DOT_COLUMN_HH
#include "lily-guile.hh"
+#include "grob-interface.hh"
+
class Grob;
static int compare (Grob *const &, Grob *const &);
static void add_head (Grob *dotcol, Grob *rh);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (side_position, (SCM));
DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
};
#include "lily-proto.hh"
#include "lily-guile.hh"
+#include "grob-interface.hh"
class Dots
{
public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif // DOTS_HH
#define FONT_INTERFACE_HH
#include "font-metric.hh"
+#include "grob-interface.hh"
struct Font_interface
{
static SCM text_font_alist_chain (Grob *);
static SCM music_font_alist_chain (Grob *);
static Font_metric *get_default_font (Grob *);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* FONT_INTERFACE_HH */
class Grob;
#include "std-string.hh"
+#include "grob-interface.hh"
+
class Gregorian_ligature
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static string prefixes_to_str (Grob *);
};
#include "lily-proto.hh"
#include "lily-guile.hh"
+#include "grob-interface.hh"
+
class Grid_line_interface
{
static void add_grid_point (Grob *me, Grob *b);
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (width, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
class Grid_point_interface
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* GRID_LINE_INTERFACE_HH */
#include "lily-guile.hh"
-#define ADD_INTERFACE(cl, a, b, c) \
+#define DECLARE_GROB_INTERFACE() \
+ static SCM interface_symbol_; \
+ static bool has_interface (Grob*)
+
+#define ADD_INTERFACE(cl, b, c) \
+ SCM cl::interface_symbol_; \
bool cl::has_interface (Grob *me) \
{ \
- return me->internal_has_interface (ly_symbol2scm (a)); \
+ return me->internal_has_interface (interface_symbol_); \
} \
void cl ## _init_ifaces () \
{ \
- add_interface (a, b, c); \
+ cl::interface_symbol_ = add_interface (#cl, b, c); \
} \
ADD_SCM_INIT_FUNC (cl ## ifaces, cl ## _init_ifaces);
-void add_interface (char const *symbol,
+SCM add_interface (char const *cxx_name,
char const *descr,
char const *vars);
/* interfaces */
bool internal_has_interface (SCM intf);
- static bool has_interface (Grob *me);
+ DECLARE_GROB_INTERFACE();
/* offsets */
void translate_axis (Real, Axis);
#ifndef HAIRPIN_HH
#define HAIRPIN_HH
+#include "grob-interface.hh"
#include "lily-guile.hh"
#include "lily-proto.hh"
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
static void consider_suicide (Spanner*);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif // HAIRPIN_HH
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
class Hara_kiri_group_spanner
{
DECLARE_SCHEME_CALLBACK (pure_height, (SCM smob, SCM start, SCM end));
DECLARE_SCHEME_CALLBACK (force_hara_kiri_in_y_parent_callback, (SCM));
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static bool request_suicide (Grob *me, int start, int end);
static void consider_suicide (Grob *me);
static void add_interesting_item (Grob *me, Grob *n);
#include "lily-guile.hh"
#include "lily-proto.hh"
#include "std-vector.hh"
+#include "grob-interface.hh"
struct Horizontal_bracket
{
static Stencil make_enclosing_bracket (Grob *me, Grob *refpoint,
vector<Grob*> grobs,
Axis a, Direction dir);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* HORIZONTAL_BRACKET_HH */
#ifndef ITEM_HH
#define ITEM_HH
+#include "grob-interface.hh"
#include "box.hh"
#include "grob.hh"
virtual Paper_column *get_column () const;
virtual void handle_prebroken_dependencies ();
virtual Interval_t<int> spanned_rank_iv ();
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
protected:
virtual void discretionary_processing ();
void copy_breakable_items ();
#define LINE_INTERFACE_HH
#include "lily-proto.hh"
+#include "grob-interface.hh"
struct Line_interface
{
static Stencil line (Grob *me, Offset from, Offset to);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Stencil make_dashed_line (Real th, Offset from, Offset to, Real, Real);
static Stencil make_line (Real th, Offset from, Offset to);
static Stencil make_arrow (Offset beg, Offset end, Real thick,
#define LINE_SPANNER_HH
#include "lily-guile.hh"
+#include "grob-interface.hh"
class Grob;
class Stencil;
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
static Stencil line_stencil (Grob *me, Offset f, Offset t);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
private:
static Offset get_broken_offset (Grob *me, Direction dir);
#ifndef EXTENDER_SPANNER_HH
#define EXTENDER_SPANNER_HH
-#include "spanner.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
/*
Extenders must be entered manually for now.
class Lyric_extender
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (print, (SCM));
};
#ifndef HYPHEN_SPANNER_HH
#define HYPHEN_SPANNER_HH
-#include "spanner.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
-struct Hyphen_spanner
+struct Lyric_hyphen
{
public:
DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
- bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (print, (SCM));
};
#ifndef MEASURE_GROUPING_SPANNER_HH
#define MEASURE_GROUPING_SPANNER_HH
-#include "grob.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
+
class Measure_grouping
{
public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* MEASURE_GROUPING_SPANNER_HH */
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
class Melody_spanner
{
public:
- static bool has_interface (Grob*);
+ DECLARE_GROB_INTERFACE();
static void add_stem (Grob*, Grob*);
DECLARE_SCHEME_CALLBACK(calc_neutral_stem_direction, (SCM));
};
#include "lily-proto.hh"
#include "lily-guile.hh"
+#include "grob-interface.hh"
+
/*
* These are all possible mensural ligature primitives.
{
DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* MENSURAL_LIGATURE_HH */
Real directed_round (Real f, Direction d);
Real peak_around (Real epsilon, Real threshold, Real x);
+string camel_case_to_lisp_identifier (string in);
+
#endif
#ifndef MULTI_MEASURE_REST_HH
#define MULTI_MEASURE_REST_HH
+#include "grob-interface.hh"
#include "lily-guile.hh"
#include "rod.hh"
class Multi_measure_rest
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (percent, (SCM));
static void add_column (Grob *, Item *);
#include "lily-proto.hh"
#include "lily-guile.hh"
#include "std-vector.hh"
+#include "grob-interface.hh"
+
/**
Resolve conflicts between various Note_columns (chords).
static Drul_array<vector<Grob*> > get_clash_groups (Grob *me);
DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM smob));
static void add_column (Grob *me, Grob *ncol);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif // COLLISION_HH
#ifndef NOTE_COLUMN_HH
#define NOTE_COLUMN_HH
-#include "item.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
+
/** a struct for treating a group of noteheads (noteheads, stem
(chord) and scripts) as a single entity.
static void set_dotcol (Grob *me, Grob *);
static void add_head (Grob *me, Grob *);
static bool has_rests (Grob *me);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Item *get_stem (Grob *);
};
#define NOTEHEAD_HH
#include "stencil.hh"
+#include "grob-interface.hh"
/** ball at the end of the stem. Also takes care of ledger lines.
DECLARE_SCHEME_CALLBACK (brew_ez_stencil, (SCM));
DECLARE_SCHEME_CALLBACK (stem_x_shift, (SCM));
DECLARE_SCHEME_CALLBACK (calc_stem_attachment, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Real stem_attachment_coordinate (Grob *, Axis a);
static int get_balltype (Grob *);
#ifndef NOTE_SPACING_HH
#define NOTE_SPACING_HH
+#include "grob-interface.hh"
#include "lily-proto.hh"
class Note_spacing
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static void get_spacing (Grob *me, Item *, Real, Real, Real *, Real *);
static void stem_dir_correction (Grob *me, Item *next_col, Real incr,
#include "item.hh"
#include "rod.hh"
+#include "lily-proto.hh"
class Paper_column : public Item
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static int get_rank (Grob *);
static bool is_musical (Grob *);
static Moment when_mom (Grob *);
#ifndef PERCENT_REPEAT_ITEM_HH
#define PERCENT_REPEAT_ITEM_HH
-#include "grob.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
class Percent_repeat_item_interface
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (beat_slash, (SCM));
DECLARE_SCHEME_CALLBACK (double_percent, (SCM));
static Stencil x_percent (Grob *, int, Real, Real);
#ifndef REST_COLLISION_HH
#define REST_COLLISION_HH
+#include "grob-interface.hh"
#include "lily-proto.hh"
#include "lily-guile.hh"
public:
static void add_column (Grob *me, Grob *);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element));
DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element));
DECLARE_SCHEME_CALLBACK (force_shift_callback_rest, (SCM element, SCM off));
#define REST_HH
#include "lily-guile.hh"
+#include "grob-interface.hh"
class Grob;
{
public:
DECLARE_SCHEME_CALLBACK (y_offset_callback, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static string glyph_name (Grob *, int, string, bool);
static SCM brew_internal_stencil (Grob*, bool);
static SCM generic_extent_callback (Grob*, Axis);
#ifndef RHYTHMIC_HEAD_HH
#define RHYTHMIC_HEAD_HH
+#include "grob-interface.hh"
#include "lily-guile.hh"
#include "lily-proto.hh"
static Item *get_dots (Grob *);
static int dot_count (Grob *);
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif // RHYTHMIC_HEAD_HH
#include "lily-guile.hh"
#include "lily-proto.hh"
-
+#include "grob-interface.hh"
#include "std-vector.hh"
class Script_column
static void add_side_positioned (Grob *, Grob *);
DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
DECLARE_SCHEME_CALLBACK (row_before_line_breaking, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static void order_grobs (vector<Grob*> grobs);
};
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
/**
Articulation marks (and the like) that are attached to notes/stems.
{
public:
static Stencil get_stencil (Grob *, Direction d);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
};
#ifndef SELF_ALIGNMENT_INTERFACE_HH
#define SELF_ALIGNMENT_INTERFACE_HH
-#include "spanner.hh"
+#include "lily-proto.hh"
+#include "grob-interface.hh"
struct Self_alignment_interface
{
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static SCM aligned_on_self (Grob *me, Axis a);
static SCM centered_on_object (Grob *me, Axis a);
struct Semi_tie_column
{
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM));
};
struct Semi_tie
{
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
#ifndef SEPARATING_GROUP_SPANNER_HH
#define SEPARATING_GROUP_SPANNER_HH
-#include "spanner.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
class Separating_group_spanner
{
public:
static void add_spacing_unit (Grob *me, Item *);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
};
#include "lily-proto.hh"
#include "direction.hh"
+#include "grob-interface.hh"
struct Separation_item
{
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Interval conditional_width (Grob *, Grob *);
static Interval width (Grob *);
static Interval relative_width (Grob *, Grob *);
#ifndef SIDE_POSITION_INTERFACE_HH
#define SIDE_POSITION_INTERFACE_HH
-#include "spanner.hh"
-#include "item.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
/*
TODO: move out unrelated callbacks.
bool pure, int start, int end, Real *current_off);
static Axis get_axis (Grob *);
static void set_axis (Grob *, Axis);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static void add_support (Grob *, Grob *);
static void add_staff_support (Grob *);
static Direction get_direction (Grob *);
#include "lily-proto.hh"
#include "lily-guile.hh"
#include "std-vector.hh"
+#include "grob-interface.hh"
class Slur
{
DECLARE_SCHEME_CALLBACK (height, (SCM));
DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM));
DECLARE_SCHEME_CALLBACK (pure_outside_slur_callback, (SCM, SCM, SCM, SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Bezier get_curve (Grob *me);
};
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
struct Spaceable_grob
{
static void add_spring (Grob *me, Grob *to, Real dist, Real strength);
static void get_spring (Grob *me, Grob *other, Real *dist, Real *inv_strength);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static void remove_interface (Grob *);
static SCM get_minimum_distances (Grob *);
static SCM get_ideal_distances (Grob *);
(c) 2002--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
+#include "grob-interface.hh"
+#include "lily-proto.hh"
struct Spacing_interface
{
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#include "lily-guile.hh"
#include "rational.hh"
#include "std-vector.hh"
+#include "grob-interface.hh"
struct Spacing_options
{
DECLARE_SCHEME_CALLBACK (set_springs, (SCM));
DECLARE_SCHEME_CALLBACK (calc_common_shortest_duration, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* SPACING_SPANNER_HH */
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
/**
This is a barline that is spanned across other bar lines. This is
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Interval get_spanned_interval (Grob *);
static void add_bar (Grob *, Grob *);
static void evaluate_glyph (Grob *);
#include "grob.hh"
#include "rod.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
/** A symbol which is attached between two columns. A spanner is a
symbol which spans across several columns, so its final appearance
static bool less (Spanner *const &, Spanner *const &);
virtual Grob *find_broken_piece (System *) const;
virtual void derived_mark () const;
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
virtual System *get_system () const;
protected:
#define STAFF_SPACING_HH
#include "lily-proto.hh"
+#include "grob-interface.hh"
class Staff_spacing
{
public:
static void next_notes_correction (Grob *, Grob *, Real *, Real *);
static void next_note_correction (Grob *, Grob *, Interval, Real*, Real *);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static void get_spacing_params (Grob *, Real *, Real *);
static Interval bar_y_positions (Grob *);
#ifndef STAFF_SYMBOL_REFERENCER_HH
#define STAFF_SYMBOL_REFERENCER_HH
-#include "grob.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
/**
A notation object that needs access to variables of the staff (no
class Staff_symbol_referencer
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static bool ugly_hack (Grob *);
static void set_position (Grob *, Real);
DECLARE_SCHEME_CALLBACK (callback, (SCM element));
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
/**
TODO: add linethickness as parameter.
static int line_count (Grob *);
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (height, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif // STAFF_SYMBOL_HH
#include "lily-proto.hh"
#include "lily-guile.hh"
+#include "grob-interface.hh"
class Stem_tremolo
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (calc_slope, (SCM));
DECLARE_SCHEME_CALLBACK (calc_width, (SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
#include "lily-proto.hh"
#include "lily-guile.hh"
#include "stem-info.hh"
+#include "grob-interface.hh"
class Stem
{
static Real stem_end_position (Grob *);
static Stencil flag (Grob *);
static Stencil get_translated_flag (Grob*);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static void set_spacing_hints (Grob *);
DECLARE_SCHEME_CALLBACK (print, (SCM));
#include "lily-guile.hh"
#include "lily-proto.hh"
+#include "grob-interface.hh"
/*
Braces/brackets across staves.
public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static void try_collapse (Grob *);
static Stencil staff_bracket (Grob *, Real);
static Stencil old_staff_bracket (Grob *, Real);
#include "spanner.hh"
#include "grob-array.hh"
#include "skyline.hh"
+#include "grob-interface.hh"
/*
If you keep following offset reference points, you will always end
int spanner_count () const;
void break_into_pieces (vector<Column_x_positions> const &);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
vector<Item*> broken_col_range (Item const *, Item const *) const;
vector<Grob*> columns () const;
#define TEXT_ITEM
#include "stencil.hh"
+#include "grob-interface.hh"
+
class Text_interface
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (interpret_markup, (SCM, SCM, SCM));
DECLARE_SCHEME_CALLBACK (interpret_string, (SCM, SCM, SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static bool is_markup (SCM);
};
#define TEXT_SPANNER_HH
#include "lily-guile.hh"
-
-class Grob;
+#include "grob-interface.hh"
+#include "lily-proto.hh"
class Text_spanner
{
public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
#endif /* TEXT_SPANNER_HH */
#include "lily-proto.hh"
#include "lily-guile.hh"
+#include "grob-interface.hh"
class Tie_column
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static void add_tie (Grob *me, Grob *);
DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
#include "lily-guile.hh"
#include "lily-proto.hh"
#include "skyline.hh"
+#include "grob-interface.hh"
{
public:
static void set_head (Grob *, Direction, Grob *head);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Grob *head (Grob *, Direction);
static int get_column_rank (Grob *, Direction);
static int get_position (Grob *);
#ifndef METER_HH
#define METER_HH
-#include "item.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
/**
Print a time_signature sign.
*/
struct Time_signature
{
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Stencil special_time_signature (Grob *, SCM, int, int);
static Stencil numbered_time_signature (Grob *, int, int);
DECLARE_SCHEME_CALLBACK (print, (SCM));
#include "lily-guile.hh"
#include "lily-proto.hh"
#include "std-vector.hh"
+#include "grob-interface.hh"
class Tuplet_bracket
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_connect_to_neighbors, (SCM smob));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
static Grob* get_common_x (Spanner *);
static void add_tuplet_bracket (Grob *me, Grob *smaller_bracket);
static void get_bounds (Grob *, Grob **, Grob **);
#define VATICANA_LIGATURE_HH
#include "stencil.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
struct Vaticana_ligature
{
DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
/*
#define VOLTA_SPANNER_HH
#include "spanner.hh"
+#include "grob-interface.hh"
+#include "lily-proto.hh"
class Volta_bracket_interface
{
public:
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (print, (SCM));
static void modify_edge_height (Spanner *);
static void add_column (Grob *, Grob *col);
}
ADD_INTERFACE (Item,
- "item-interface",
- "\n"
- "\n"
+
"Grobs can be distinguished in their role in the horizontal spacing.\n"
"Many grobs define constraints on the spacing by their sizes. For\n"
"example, note heads, clefs, stems, and all other symbols with a fixed\n"
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
/*
return mol.smobbed_copy ();
}
-ADD_INTERFACE (Key_signature_interface, "key-signature-interface",
+ADD_INTERFACE (Key_signature_interface,
"A group of accidentals, to be printed as signature sign.",
"style c0-position alteration-alist");
Interval x_extent,
Real left_shorten);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
Stencil
}
ADD_INTERFACE (Ledger_line_spanner,
- "ledger-line-interface",
"This spanner draws the ledger lines of a staff.\n"
"This is a separate grob because it has to process\n"
"all potential collisions between all note heads.",
/* properties */
+ "gap "
+ "length-fraction "
+ "minimum-length-fraction "
"note-heads "
"thickness "
- "minimum-length-fraction "
- "length-fraction "
- "gap");
+ );
struct Ledgered_interface
{
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
ADD_INTERFACE (Ledgered_interface,
- "ledgered-interface",
"Objects that need ledger lines, typically "
- "note heads. See also @ref{ledger-line-interface}.",
+ "note heads. See also @ref{ledger-line-spanner-interface}.",
"no-ledgers");
#include "tuplet-bracket.hh"
#include "spanner.hh"
#include "stream-event.hh"
+#include "spanner.hh"
+#include "item.hh"
+
#include "translator.icc"
/*
#include "staff-symbol-referencer.hh"
#include "lookup.hh"
#include "output-def.hh"
+#include "grob.hh"
Stencil
Line_interface::make_arrow (Offset begin, Offset end,
return stil;
}
-ADD_INTERFACE (Line_interface, "line-interface",
+ADD_INTERFACE (Line_interface,
"Generic line objects. Any object using lines supports this. Normally, "
"you get a straight line. If @code{dash-period} is defined, a dashed line is "
"produced; the length of the dashes is tuned with "
}
}
-ADD_INTERFACE (Line_spanner, "line-spanner-interface",
+ADD_INTERFACE (Line_spanner,
"Generic line drawn between two objects, e.g. for use with glissandi.\n"
"The property @code{style} can be @code{line}, "
"@code{dashed-line}, @code{trill}, \n"
#include "lyric-extender.hh"
-
+#include "spanner.hh"
+#include "item.hh"
#include "warn.hh"
#include "lookup.hh"
#include "paper-column.hh"
return mol.smobbed_copy ();
}
-ADD_INTERFACE (Lyric_extender, "lyric-extender-interface",
+ADD_INTERFACE (Lyric_extender,
"The extender is a simple line at the baseline of the lyric "
"that helps show the length of a melissima (tied/slurred note).",
/*
- hyphen-spanner.cc -- implement Hyphen_spanner
+ hyphen-spanner.cc -- implement Lyric_hyphen
source file of the GNU LilyPond music typesetter
#include "output-def.hh"
#include "paper-column.hh"
#include "moment.hh"
+#include "spanner.hh"
/*
TODO: should extract hyphen dimensions or hyphen glyph from the
font.
*/
-MAKE_SCHEME_CALLBACK (Hyphen_spanner, print, 1);
+MAKE_SCHEME_CALLBACK (Lyric_hyphen, print, 1);
SCM
-Hyphen_spanner::print (SCM smob)
+Lyric_hyphen::print (SCM smob)
{
Spanner *me = unsmob_spanner (smob);
Drul_array<Item *> bounds (me->get_bound (LEFT),
return total.smobbed_copy ();
}
-MAKE_SCHEME_CALLBACK (Hyphen_spanner, set_spacing_rods, 1);
+MAKE_SCHEME_CALLBACK (Lyric_hyphen, set_spacing_rods, 1);
SCM
-Hyphen_spanner::set_spacing_rods (SCM smob)
+Lyric_hyphen::set_spacing_rods (SCM smob)
{
Grob *me = unsmob_grob (smob);
return SCM_UNSPECIFIED;
}
-ADD_INTERFACE (Hyphen_spanner,
+ADD_INTERFACE (Lyric_hyphen,
- "lyric-hyphen-interface",
-
"A centered hyphen is a simple line between "
"lyrics used to divide syllables",
setup_paths (argv[0]);
setup_guile_env ();
+#if 0
/* Debugging aid. */
try
{
{
error (_f ("exception caught: %s", e.what ()));
};
-
+#else
+ scm_boot_guile (argc, argv, main_with_guile, 0);
+#endif
+
/* Only reachable if GUILE exits. That is an error. */
return 1;
}
#include "side-position-interface.hh"
#include "global-context.hh"
#include "engraver.hh"
+#include "spanner.hh"
#include "translator.icc"
return m.smobbed_copy ();
}
-ADD_INTERFACE (Measure_grouping, "measure-grouping-interface",
+ADD_INTERFACE (Measure_grouping,
"This object indicates groups of beats. "
"Valid choices for @code{style} are @code{bracket} and @code{triangle}.",
"thickness style height");
stem->set_property ("neutral-direction", Melody_spanner::calc_neutral_stem_direction_proc);
}
-ADD_INTERFACE (Melody_spanner, "melody-spanner-interface",
+ADD_INTERFACE (Melody_spanner,
"Context dependent typesetting decisions.",
"stems "
return SCM_EOL;
}
-ADD_INTERFACE (Mensural_ligature, "mensural-ligature-interface",
+ADD_INTERFACE (Mensural_ligature,
"A mensural ligature",
"delta-position "
return 1.0;
return max (- epsilon * (x - threshold) / ((x + epsilon) * threshold), 0.0);
}
+
+
+string
+camel_case_to_lisp_identifier (string in)
+{
+ vector<char> out;
+
+ /* don't add '-' before first character */
+ out.push_back (tolower (in[0]));
+
+ for (size_t inpos = 1; inpos < in.size (); inpos++)
+ {
+ if (isupper (in[inpos]))
+ out.push_back ('-');
+ out.push_back (tolower (in[inpos]));
+ }
+
+ string result (&out[0], out.size ());
+ replace_all (result, '_', '-');
+
+ return result;
+}
+
#include "staff-symbol-referencer.hh"
#include "stream-event.hh"
#include "moment.hh"
+#include "spanner.hh"
#include "translator.icc"
return SCM_UNSPECIFIED;
}
-ADD_INTERFACE (Multi_measure_rest, "multi-measure-rest-interface",
+ADD_INTERFACE (Multi_measure_rest,
"A rest that spans a whole number of measures.",
/* properties */
#include "side-position-interface.hh"
#include "stem.hh"
#include "stream-event.hh"
+#include "item.hh"
#include "warn.hh"
#include "translator.icc"
#include "note-head.hh"
#include "output-def.hh"
#include "pointer-group-interface.hh"
+#include "item.hh"
#include "rhythmic-head.hh"
#include "staff-symbol-referencer.hh"
#include "side-position-interface.hh"
Axis_group_interface::add_element (me, ncol);
}
-ADD_INTERFACE (Note_collision_interface, "note-collision-interface",
+ADD_INTERFACE (Note_collision_interface,
"An object that handles collisions between notes with different stem "
"directions and horizontal shifts. Most of the interesting properties "
"are to be set in @ref{note-column-interface}: these are "
#include "axis-group-interface.hh"
#include "directional-element-interface.hh"
#include "international.hh"
+#include "item.hh"
#include "note-head.hh"
#include "output-def.hh"
#include "pointer-group-interface.hh"
return unsmob_grob (me->get_object ("arpeggio"));
}
-ADD_INTERFACE (Note_column, "note-column-interface",
+ADD_INTERFACE (Note_column,
"Stem and noteheads combined",
/* properties */
#include "side-position-interface.hh"
#include "staff-symbol-referencer.hh"
#include "context.hh"
+#include "spanner.hh"
+#include "item.hh"
+
/**
Create line-spanner grobs for lines that connect note heads.
}
-ADD_INTERFACE (Note_head, "note-head-interface",
+ADD_INTERFACE (Note_head,
"Note head",
/* properties */
*/
}
-ADD_INTERFACE (Note_spacing, "note-spacing-interface",
+ADD_INTERFACE (Note_spacing,
"This object calculates spacing wishes for individual voices.",
struct Ottava_bracket
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
/*
}
ADD_INTERFACE (Ottava_bracket,
- "ottava-bracket-interface",
-
"An ottava bracket",
/*
#include "note-column.hh"
#include "side-position-interface.hh"
#include "engraver.hh"
+#include "spanner.hh"
+#include "item.hh"
class Ottava_spanner_engraver : public Engraver
{
ADD_INTERFACE (Paper_column,
-
- "paper-column-interface",
"@code{Paper_column} objects form the top-most X-parents for items."
" The are two types of columns: musical columns, where are attached to, and "
" non-musical columns, where bar-lines, clefs etc. are attached to. "
#include "stem.hh"
#include "stream-event.hh"
#include "text-interface.hh"
+#include "item.hh"
#include "translator.icc"
*/
#include "percent-repeat-item.hh"
-
-
+#include "item.hh"
#include "lookup.hh"
#include "font-interface.hh"
return m.smobbed_copy ();
}
-ADD_INTERFACE (Percent_repeat_item_interface, "percent-repeat-interface",
+ADD_INTERFACE (Percent_repeat_item_interface,
"Repeats that look like percent signs",
- "slope thickness");
+
+ "slope "
+ "thickness ");
struct Piano_pedal_bracket
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
MAKE_SCHEME_CALLBACK (Piano_pedal_bracket, print, 1);
}
ADD_INTERFACE (Piano_pedal_bracket,
- "piano-pedal-bracket-interface",
"The bracket of the piano pedal. "
"It can be tuned through the regular "
#include "stream-event.hh"
#include "string-convert.hh"
#include "warn.hh"
-#include "protected-scm.hh"
+#include "spanner.hh"
+#include "item.hh"
+
#include "translator.icc"
+
/*
TODO:
(c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
+
+#include "engraver.hh"
+
#include "staff-symbol-referencer.hh"
#include "note-head.hh"
#include "rhythmic-head.hh"
-#include "engraver.hh"
+#include "grob.hh"
class Pitch_squash_engraver : public Engraver
{
#include "engraver.hh"
#include "rest-collision.hh"
#include "note-column.hh"
+#include "item.hh"
class Rest_collision_engraver : public Engraver
{
return SCM_UNSPECIFIED;
}
-ADD_INTERFACE (Rest_collision, "rest-collision-interface",
+ADD_INTERFACE (Rest_collision,
"Move around ordinary rests (not multi-measure-rests) to avoid "
"conflicts.",
return ly_interval2scm (unsmob_stencil (m)->extent (a));
}
-ADD_INTERFACE (Rest, "rest-interface",
+ADD_INTERFACE (Rest,
"A rest symbol.",
/* properties */
#include "rhythmic-head.hh"
#include "stem.hh"
#include "note-column.hh"
+#include "item.hh"
#include "dot-column.hh"
#include "pointer-group-interface.hh"
ADD_INTERFACE (Rhythmic_head,
- "rhythmic-head-interface",
-
"Note head or rest",
"dot "
#include "engraver.hh"
#include "script-column.hh"
#include "side-position-interface.hh"
+#include "item.hh"
#include "translator.icc"
class Script_column_engraver : public Engraver
{
Grob *script_column_;
- vector<Item*> scripts_;
+ vector<Grob*> scripts_;
public:
TRANSLATOR_DECLARATIONS (Script_column_engraver);
while (flip (&d) != DOWN);
}
-ADD_INTERFACE (Script_column, "script-column-interface",
+ADD_INTERFACE (Script_column,
"An interface that sorts scripts "
"according to their @code{script-priority}",
#include "script-interface.hh"
#include "directional-element-interface.hh"
+#include "item.hh"
#include "warn.hh"
#include "font-interface.hh"
#include "side-position-interface.hh"
struct Text_script
{
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
-ADD_INTERFACE (Text_script, "text-script-interface",
+ADD_INTERFACE (Text_script,
"An object that is put above or below a note",
/* properties */
/*
Hmm. Where should we put add-stem-support ?
*/
-ADD_INTERFACE (Script_interface, "script-interface",
+ADD_INTERFACE (Script_interface,
"An object that is put above or below a note",
"add-stem-support "
"avoid-slur "
#include "engraver.hh"
#include "accidental-placement.hh"
+#include "item.hh"
#include "script-column.hh"
#include "side-position-interface.hh"
#include "self-alignment-interface.hh"
#include "warn.hh"
+#include "grob.hh"
MAKE_SCHEME_CALLBACK (Self_alignment_interface, y_aligned_on_self, 1);
SCM
a);
}
-ADD_INTERFACE (Self_alignment_interface, "self-alignment-interface",
+ADD_INTERFACE (Self_alignment_interface,
"Position this object on itself and/or on its parent. To this end, the following functions "
" are provided: \n"
"@table @code \n"
ADD_INTERFACE(Semi_tie_column,
- "semi-tie-column-interface",
"The interface for a column of l.v. ties.",
/* properties */
ADD_INTERFACE(Semi_tie,
- "semi-tie-interface",
-
"A tie which is only on one side connected to note heads. ",
/* properties */
Pointer_group_interface::add_unordered_grob (me, ly_symbol2scm ("elements"), i);
}
-ADD_INTERFACE (Separating_group_spanner, "separation-spanner-interface",
+ADD_INTERFACE (Separating_group_spanner,
"A spanner that calculates spacing constraints (\"rods\") "
"using the @code{separation-item-interface} grobs in @code{elements}.",
#include "note-spacing.hh"
#include "accidental-placement.hh"
#include "context.hh"
+#include "spanner.hh"
#include "grob-array.hh"
#include "pointer-group-interface.hh"
return last_grob;
}
-ADD_INTERFACE (Separation_item, "separation-item-interface",
+ADD_INTERFACE (Separation_item,
"Item that computes widths to generate spacing rods. "
"This is done in concert with @ref{separation-spanner-interface}.",
"padding X-extent conditional-elements elements");
return NO_AXES;
}
-ADD_INTERFACE (Side_position_interface, "side-position-interface",
+ADD_INTERFACE (Side_position_interface,
"Position a victim object (this one) next to other objects (the "
"support). The property @code{direction} signifies where to put the "
"victim object relative to the support (left or right, up or down?)\n\n "
Slur::add_column (Grob *me, Grob *n)
{
Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-columns"), n);
- add_bound_item (dynamic_cast<Spanner *> (me), dynamic_cast<Item *> (n));
+ add_bound_item (dynamic_cast<Spanner *> (me), n);
}
void
}
-ADD_INTERFACE (Slur, "slur-interface",
+ADD_INTERFACE (Slur,
"A slur",
me->set_object ("ideal-distances", SCM_EOL);
}
-ADD_INTERFACE (Spaceable_grob, "spaceable-grob-interface",
+ADD_INTERFACE (Spaceable_grob,
"A layout object that takes part in the spacing problem. ",
for (vsize i = elts.size (); i--;)
{
Grob *g = elts[i];
- if (g && Break_align_interface::has_interface (g))
+ if (g && Break_alignment_interface::has_interface (g))
{
extract_grob_set (g, "elements", gelts);
for (vsize j = gelts.size (); j--;)
Spaceable_grob::add_spring (l, r, distance, inverse_strength);
}
-ADD_INTERFACE (Spacing_spanner, "spacing-spanner-interface",
+ADD_INTERFACE (Spacing_spanner,
"The space taken by a note is dependent on its duration. Doubling a\n"
"duration adds spacing-increment to the space. The most common shortest\n"
"note gets @code{shortest-duration-space}. Notes that are even shorter are\n"
);
-ADD_INTERFACE (Spacing_interface, "spacing-interface",
+ADD_INTERFACE (Spacing_interface,
"Something to do with line breaking and spacing. "
"Kill this one after determining line breaks.",
#include "pointer-group-interface.hh"
#include "side-position-interface.hh"
#include "staff-symbol-referencer.hh"
+#include "item.hh"
/**
Make arpeggios that span multiple staves. Catch arpeggios, and span a
return scm_from_double (iv.length ());
}
-ADD_INTERFACE (Span_bar, "span-bar-interface",
+ADD_INTERFACE (Span_bar,
"A bar line that spanned between other barlines. This interface is "
" used for bar lines that connect different staves.",
}
ADD_INTERFACE (Spanner,
- "spanner-interface",
"Some objects are horizontally spanned between objects. For\n"
"example, slur, beam, tie, etc. These grobs form a subtype called\n"
"@code{Spanner}. All spanners have two span-points (these must be\n"
*fixed += correction_fixed;
}
-ADD_INTERFACE (Staff_spacing, "staff-spacing-interface",
+ADD_INTERFACE (Staff_spacing,
"This object calculates spacing details from a "
" breakable symbol (left) to another object. For example, it takes care "
" of optical spacing from a bar lines to a note.",
#include "staff-symbol-referencer.hh"
-
#include "staff-symbol.hh"
+#include "grob.hh"
#include "output-def.hh"
#include "libc-extension.hh"
< Staff_symbol_referencer::get_position (b);
}
-ADD_INTERFACE (Staff_symbol_referencer, "staff-symbol-referencer-interface",
+ADD_INTERFACE (Staff_symbol_referencer,
"An object whose Y position is meant relative to a staff "
"symbol. "
"These usually have @code{Staff_symbol_referencer::callback} "
-ADD_INTERFACE (Staff_symbol, "staff-symbol-interface",
+ADD_INTERFACE (Staff_symbol,
"This spanner draws the lines of a staff. "
"A staff symbol definines a vertical unit, the staff space. "
"Quantities that go by a half staff space are called positions "
#include "engraver.hh"
#include "side-position-interface.hh"
#include "text-interface.hh"
+#include "item.hh"
class Stanza_number_engraver : public Engraver
{
return s.smobbed_copy ();
}
-ADD_INTERFACE (Stem_tremolo, "stem-tremolo-interface",
+ADD_INTERFACE (Stem_tremolo,
"A beam slashing a stem to indicate a tremolo.",
"beam-thickness "
*/
#include "stem.hh"
+#include "spanner.hh"
#include <cmath> // rint
using namespace std;
}
/* FIXME: Too many properties */
-ADD_INTERFACE (Stem, "stem-interface",
+ADD_INTERFACE (Stem,
"The stem represent the graphical stem. "
"In addition, it internally connects note heads, beams and"
"tremolos. "
}
ADD_INTERFACE (System_start_delimiter,
- "system-start-delimiter-interface",
"The brace, bracket or bar in front of the system. "
,
{
public:
static Stencil get_stencil (Grob *);
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
DECLARE_SCHEME_CALLBACK (print, (SCM));
};
ADD_INTERFACE (System_start_text,
- "system-start-text-interface",
"Text in front of the system.",
/* properties */
}
-ADD_INTERFACE (System, "system-interface",
+ADD_INTERFACE (System,
"This is the toplevel object: each object in a score "
"ultimately has a System object as its X and Y parent. ",
#include "stem.hh"
#include "stream-event.hh"
#include "text-interface.hh"
+#include "item.hh"
#include "translator.icc"
class Text_engraver : public Engraver
{
vector<Stream_event *> evs_;
- vector<Item*> texts_;
+ vector<Grob*> texts_;
public:
TRANSLATOR_DECLARATIONS (Text_engraver);
protected:
ly_symbol2scm ("markup-signature"))));
}
-ADD_INTERFACE (Text_interface, "text-interface",
+ADD_INTERFACE (Text_interface,
"A scheme markup text, see @usermanref{Text markup}.",
"baseline-skip "
"text "
#include "international.hh"
#include "note-column.hh"
#include "side-position-interface.hh"
+#include "spanner.hh"
#include "stream-event.hh"
#include "translator.icc"
if (spans[i])
{
Side_position_interface::add_support (spans[i], info.grob ());
- add_bound_item (spans[i], dynamic_cast<Item *> (info.grob ()));
+ add_bound_item (spans[i], info.grob ());
}
}
}
}
ADD_INTERFACE (Text_spanner,
- "text-spanner-interface",
"generic text spanner",
-ADD_INTERFACE (Tie_column, "tie-column-interface",
+ADD_INTERFACE (Tie_column,
"Object that sets directions of multiple ties in a tied chord",
/* properties */
}
ADD_INTERFACE (Tie,
- "tie-interface",
-
"A horizontal curve connecting two noteheads. \n\n"
,
#include "engraver-group.hh"
+#include "item.hh"
#include "international.hh"
#include "misc.hh"
#include "time-signature.hh"
#include "time-signature.hh"
+#include "grob.hh"
#include "font-interface.hh"
#include "international.hh"
#include "output-def.hh"
return m;
}
-ADD_INTERFACE (Time_signature, "time-signature-interface",
+ADD_INTERFACE (Time_signature,
"A time signature, in different styles.\n"
" The following values for 'style are are recognized:\n"
"\n"
#include "note-column.hh"
#include "side-position-interface.hh"
#include "stream-event.hh"
+#include "spanner.hh"
#include "translator.icc"
if (spans[i])
{
Side_position_interface::add_support (spans[i], info.grob ());
- add_bound_item (spans[i], dynamic_cast<Item *> (info.grob ()));
+ add_bound_item (spans[i], info.grob ());
}
}
}
= (TT_Postscript *) FT_Get_Sfnt_Table (face, ft_sfnt_post);
if (pt->maxMemType42)
- lily_cookie_fprintf (out, "%%%%VMUsage: %ld %ld\n", 0, 0);
+ lily_cookie_fprintf (out, "%%%%VMUsage: %d %d\n", 0, 0);
lily_cookie_fprintf (out, "%d dict begin\n", 11);
lily_cookie_fprintf (out, "/FontName /%s def\n",
lily_cookie_fprintf (out, "/FontType 42 def\n");
lily_cookie_fprintf (out, "/FontInfo 8 dict dup begin\n");
lily_cookie_fprintf (out, "/version (%d.%d) def\n",
- (ht->Font_Revision >> 16),
- (ht->Font_Revision &((1 << 16) -1)));
+ int (ht->Font_Revision >> 16),
+ int (ht->Font_Revision &((1 << 16) -1)));
#if 0
if (strings[0])
}
ADD_INTERFACE (Tuplet_bracket,
- "tuplet-bracket-interface",
"A bracket with a number in the middle, used for tuplets. "
"When the bracket spans a line break, the value of "
"@code{break-overshoot} determines how far it extends "
#include "stream-event.hh"
#include "tuplet-bracket.hh"
#include "warn.hh"
+#include "item.hh"
#include "translator.icc"
struct Tuplet_number
{
DECLARE_SCHEME_CALLBACK(print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE();
};
ADD_INTERFACE (Tuplet_number,
- "tuplet-number-interface",
"The number for a bracket. "
,
return SCM_EOL;
}
-ADD_INTERFACE (Vaticana_ligature, "vaticana-ligature-interface",
+ADD_INTERFACE (Vaticana_ligature,
"A vaticana style gregorian ligature",
/* properties */
Side_position_interface::add_support (me, c);
}
-ADD_INTERFACE (Volta_bracket_interface, "volta-bracket-interface",
+ADD_INTERFACE (Volta_bracket_interface,
"Volta bracket with number",
/* properties */
#include "context.hh"
#include "international.hh"
#include "note-column.hh"
+#include "item.hh"
#include "side-position-interface.hh"
#include "staff-symbol.hh"
#include "text-interface.hh"
(X-offset . ,(ly:make-simple-closure
`(,+
,(ly:make-simple-closure
- (list ly:break-alignment-align-interface::self-align-callback))
+ (list ly:break-alignable-interface::self-align-callback))
,(ly:make-simple-closure
(list ly:self-alignment-interface::x-aligned-on-self)))))
((class . Item)
(interfaces . (side-position-interface
text-interface
- break-alignment-align-interface
+ break-alignable-interface
self-alignment-interface
font-interface
))))
. (
(non-musical . #t)
(stacking-dir . 1)
- (positioning-done . ,ly:break-align-interface::calc-positioning-done)
+ (positioning-done . ,ly:break-alignment-interface::calc-positioning-done)
(X-extent . ,ly:axis-group-interface::width)
(break-align-orders . ;; end of line
#((
(meta . ((class . Item)
(interfaces . (font-interface
break-aligned-interface
- percent-repeat-interface))))))
+ percent-repeat-item-interface))))))
(DoublePercentRepeatCounter
. (
(meta . ((class . Item)
(interfaces . (side-position-interface
self-alignment-interface
- percent-repeat-interface
+ percent-repeat-item-interface
font-interface
text-interface))))))
(DynamicLineSpanner
(length-fraction . 0.25)
(layer . 0)
(meta . ((class . Spanner)
- (interfaces . (ledger-line-interface))))))
+ (interfaces . (ledger-line-spanner-interface))))))
(LeftEdge
. (
(minimum-length . 0.3)
(minimum-distance . 0.1)
(padding . 0.07)
- (springs-and-rods . ,ly:hyphen-spanner::set-spacing-rods)
- (stencil . ,ly:hyphen-spanner::print)
+ (springs-and-rods . ,ly:lyric-hyphen::set-spacing-rods)
+ (stencil . ,ly:lyric-hyphen::print)
(Y-extent . (0 . 0))
(meta . ((class . Spanner)
(interfaces . (lyric-interface
(LyricSpace
. ((minimum-distance . 0.45)
- (springs-and-rods . ,ly:hyphen-spanner::set-spacing-rods)
+ (springs-and-rods . ,ly:lyric-hyphen::set-spacing-rods)
(padding . 0.0)
(Y-extent . #f)
(X-extent . #f)
(meta . ((class . Spanner)
(interfaces . (multi-measure-rest-interface
font-interface
- percent-repeat-interface))))))
+ percent-repeat-item-interface))))))
(PercentRepeatCounter
. (
(stencil . ,ly:text-interface::print)
(meta . ((class . Spanner)
(interfaces . (side-position-interface
self-alignment-interface
- percent-repeat-interface
+ percent-repeat-item-interface
font-interface
text-interface))))))
(X-offset . ,(ly:make-simple-closure
`(,+
,(ly:make-simple-closure
- (list ly:break-alignment-align-interface::self-align-callback))
+ (list ly:break-alignable-interface::self-align-callback))
,(ly:make-simple-closure
(list ly:self-alignment-interface::x-aligned-on-self)))))
(meta . ((class . Item)
(interfaces . (text-interface
side-position-interface
- break-alignment-align-interface
+ break-alignable-interface
font-interface
mark-interface
self-alignment-interface))))))
(thickness . 0.48)
(slope . 1.7)
(meta . ((class . Item)
- (interfaces . (percent-repeat-interface))))))
+ (interfaces . (percent-repeat-item-interface))))))
(RepeatTie
. (
(meta . ((class . Spanner)
(interfaces . (only-prebreak-interface
spacing-interface
- separation-spanner-interface))))))
+ separating-group-spanner-interface))))))
(Slur
. ((details . ,default-slur-details)
(skyline-spacing . #t)
(meta . ((class . Spanner)
(interfaces . (axis-group-interface
- hara-kiri-group-interface
+ hara-kiri-group-spanner-interface
vertically-spaceable-interface))))))
ly:hara-kiri-group-spanner::force-hara-kiri-callback
ly:hara-kiri-group-spanner::y-extent
ly:horizontal-bracket::print
- ly:hyphen-spanner::print
- ly:hyphen-spanner::set-spacing-rods
+ ly:lyric-hyphen::print
+ ly:lyric-hyphen::set-spacing-rods
ly:key-signature-interface::print
ly:line-spanner::print
ly:lyric-extender::print