other implementations.
#include "side-position-interface.hh"
#include "directional-element-interface.hh"
#include "multi-measure-rest.hh"
+#include "tie.hh"
class A2_engraver : public Engraver
{
if (!to_boolean (get_property ("noDirection"))
&& (Stem::has_interface (i.grob_l_)
|| Slur::has_interface (i.grob_l_)
- // || Tie::has_interface (i.grob_l_)
- || i.grob_l_->has_interface (ly_symbol2scm ("tie-interface"))
-
+ || Tie::has_interface (i.grob_l_)
/*
Usually, dynamics are removed by *_devnull_engravers for the
second voice. On the one hand, we don't want all dynamics for
hand, colliding of scripts may be worse.
So, we don't set directions for these when we're playing solo.
*/
- || (i.grob_l_->has_interface (ly_symbol2scm ("dynamic-interface"))
+ || (i.grob_l_->internal_has_interface (ly_symbol2scm ("dynamic-interface"))
&& state_ != SOLO)
- || (i.grob_l_->has_interface (ly_symbol2scm ("text-interface"))
+ || (i.grob_l_->internal_has_interface (ly_symbol2scm ("text-interface"))
&& state_ != SOLO)
))
{
Axis_group_interface::set_axes (me, a,a);
}
-bool
-Align_interface::has_interface (Grob*me)
-{
- return me && me->has_interface (ly_symbol2scm ("align-interface"));
-}
ADD_INTERFACE (Align_interface, "align-interface",
"forced-distance stacking-dir align-dir threshold alignment-done center-element elements axes");
-
+struct Foobar
+{
+ bool has_interface (Grob*);
+};
ADD_INTERFACE (Foobar, "aligned-interface",
"read by align-interface",
"minimum-space-pair extra-space");
#include "font-interface.hh"
#include "lookup.hh"
-bool
-Arpeggio::has_interface (Grob* me)
-{
- return me && me->has_interface (ly_symbol2scm ("arpeggio-interface"));
-}
MAKE_SCHEME_CALLBACK (Arpeggio, brew_molecule, 1);
SCM
{
Axis_group_engraver::acknowledge_grob (i);
if (Rhythmic_head::has_interface (i.grob_l_)
- || i.grob_l_->has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+ || i.grob_l_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
{
Hara_kiri_group_spanner::add_interesting_item (staffline_p_, i.grob_l_);
}
return childs;
}
-bool
-Axis_group_interface::has_interface (Grob*me)
-{
- return me && me->has_interface (ly_symbol2scm ("axis-group-interface"));
-}
ADD_INTERFACE (Axis_group_interface, "axis-group-interface",
}
-bool
-Bar_line::has_interface (Grob*m)
-{
- return m && m->has_interface (ly_symbol2scm ("bar-line-interface"));
-}
MAKE_SCHEME_CALLBACK (Bar_line,get_staff_bar_size,1);
if (ly_car (s) != SCM_BOOL_F)
return SCM_UNSPECIFIED;
+ // one wonders if such genericity is necessary --hwn.
SCM callbacks = me->get_grob_property ("position-callbacks");
for (SCM i = callbacks; gh_pair_p (i); i = ly_cdr (i))
gh_call1 (ly_car (i), smob);
}
-bool
-Beam::has_interface (Grob *me)
-{
- return me->has_interface (ly_symbol2scm ("beam-interface"));
-}
ADD_INTERFACE (Beam, "beam-interface",
take the best scoring combination.
",
- "beam-space concaveness-gap concaveness-threshold dir-function quant-score auto-knee-gap gap chord-tremolo beamed-stem-shorten shorten least-squares-dy direction damping flag-width-function neutral-direction positions thickness");
+ "position-callbacks beam-space concaveness-gap concaveness-threshold dir-function quant-score auto-knee-gap gap chord-tremolo beamed-stem-shorten shorten least-squares-dy direction damping flag-width-function neutral-direction positions thickness");
#include "break-algorithm.hh"
#include "paper-def.hh"
#include "debug.hh"
-#include "line-of-score.hh"
+#include "system.hh"
#include "paper-score.hh"
#include "paper-column.hh"
#include "cpu-timer.hh"
/*
Force break alignment itself to be done first, in the case
*/
- return Side_position_interface::aligned_on_self (element_smob, axis);
+ return Self_alignment_interface::aligned_on_self (element_smob, axis);
}
void
}
-
ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface",
"Items that are aligned in prefatory matter.
#include "font-interface.hh"
#include "grob.hh"
#include "paper-column.hh"
-#include "line-of-score.hh"
+#include "system.hh"
#include "staff-symbol-referencer.hh"
#include "text-item.hh"
#include <ctype.h>
#include "translator-group.hh"
-#include "key-item.hh"
+
#include "bar-line.hh"
#include "staff-symbol-referencer.hh"
#include "debug.hh"
return SCM_UNSPECIFIED;
}
-bool
-Clef::has_interface (Grob* me)
-{
- return me->has_interface (ly_symbol2scm ("clef-interface"));
-}
return SCM_EOL;
}
-bool
-Custos::has_interface (Grob*m)
-{
- return m && m->has_interface (ly_symbol2scm ("custos-interface"));
-}
ADD_INTERFACE (Custos, "custos-interface",
"A custos is a staff context symbol that appears at the end of a
return SCM_UNSPECIFIED;
}
-bool
-Dot_column::has_interface (Grob*m)
-{
- return m && m->has_interface (ly_symbol2scm ("dot-column-interface"));
-}
void
Extender_engraver::acknowledge_grob (Grob_info i)
{
// -> text_item
- if (i.grob_l_->has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+ if (i.grob_l_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
{
current_lyric_l_ = i.grob_l_;
if (extender_p_
Side_position_interface::set_axis (fingering, a);
- fingering->add_offset_callback (Side_position_interface::aligned_on_self_proc, other);
- fingering->add_offset_callback (Side_position_interface::centered_on_parent_proc, other);
+ fingering->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, other);
+ fingering->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, other);
fingering->set_grob_property ("script-priority",
gh_int2scm (100 + d* i));
#include "paper-score.hh"
#include "paper-def.hh"
#include "simple-spacer.hh"
-#include "line-of-score.hh"
+#include "system.hh"
/// How often to print operator pacification marks?
const int HAPPY_DOTS_I = 3;
#include "grob.hh"
#include "debug.hh"
#include "spanner.hh"
-#include "line-of-score.hh"
+#include "system.hh"
#include "item.hh"
#include "paper-column.hh"
#include "molecule.hh"
}
bool
-Grob::has_interface (SCM k)
+Grob::internal_has_interface (SCM k)
{
SCM ifs = get_grob_property ("interfaces");
"All grobs support this",
"X-offset-callbacks Y-offset-callbacks X-extent-callback molecule cause
Y-extent-callback molecule-callback extra-offset
+spacing-procedure
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");
-bool
-Hara_kiri_group_spanner::has_interface (Grob*me)
-{
- return me->has_interface (ly_symbol2scm ("hara-kiri-group-interface"));
-}
void
Hara_kiri_group_spanner::add_interesting_item (Grob* me,Grob* n)
Hyphen_engraver::acknowledge_grob (Grob_info i)
{
// -> text-item
- if (i.grob_l_->has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+ if (i.grob_l_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
{
current_lyric_l_ = i.grob_l_;
if (hyphen_p_
DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element, SCM axis));
};
+struct Break_aligned_interface
+{
+ static bool has_interface (Grob*);
+};
+
+
#endif // BREAK_ALIGN_INTERFACE_HH
public:
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
+ static bool has_interface (Grob*);
};
#endif // CHORD_NAME_HH
DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis));
static void do_shifts (Grob*);
static void add_column (Grob*me,Grob*ncol_l);
+ static bool has_interface(Grob*);
};
#endif // COLLISION_HH
public:
DECLARE_SCHEME_CALLBACK (quantised_position_callback, (SCM element, SCM axis));
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
+ bool has_interface (Grob*);
};
#endif // DOTS_HH
static SCM add_style (Grob*, SCM style, SCM alist_chain);
static bool wild_compare (SCM field_val, SCM val);
DECLARE_SCHEME_CALLBACK (properties_to_font_name, (SCM,SCM));
+ static bool has_interface (Grob*);
};
#endif /* FONT_INTERFACE_HH */
SCM ly_add_interface (SCM, SCM, SCM);
#define ADD_INTERFACE(cl,a,b,c) \
+bool cl::has_interface(Grob*me)\
+{\
+ return me->internal_has_interface (ly_symbol2scm (a));\
+}\
void cl ## _init_ifaces() {\
add_interface(a,b,c);\
}\
static SCM ly_set_grob_property (SCM, SCM,SCM);
static SCM ly_get_grob_property (SCM, SCM);
- bool has_interface (SCM intf);
+ bool internal_has_interface (SCM intf);
+ static bool has_interface (Grob*me);
virtual void handle_broken_dependencies ();
virtual void handle_prebroken_dependencies ();
Spanner* elt_l_;
Hyphen_spanner (Spanner*);
void set_textitem (Direction, Grob*);
+ bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
};
virtual System * line_l () const;
virtual Paper_column * column_l () const;
virtual void handle_prebroken_dependencies ();
+ static bool has_interface (Grob*);
protected:
virtual void discretionary_processing ();
void copy_breakable_items ();
-/*
- key-item.hh -- part of GNU LilyPond
- (c) 1996--2002 Han-Wen Nienhuys
-*/
-
-#ifndef KEYITEM_HH
-#define KEYITEM_HH
-
-#include "lily-guile.hh"
-#include "lily-proto.hh"
-
-
-struct Key_item
-{
-
- static void set_interface (Grob*);
- static bool has_interface (Grob*);
- DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
-};
-
-#endif // KEYITEM_HH
+#error
-/*
- line-of-score.hh -- part of GNU LilyPond
-
- (c) 1996--2002 Han-Wen Nienhuys
-*/
-
-#ifndef SCORELINE_HH
-#define SCORELINE_HH
-
-#include "protected-scm.hh"
-#include "column-x-positions.hh"
-#include "spanner.hh"
-
-class System : public Spanner
-{
-public:
- int rank_i_;
- void post_processing (bool);
-
- System (SCM);
- /// is #c# contained in #*this#?
- bool contains_b (Paper_column const *c) const;
- int element_count () const;
-
- void break_into_pieces (Array<Column_x_positions> const&);
- void output_lines ();
-
- Link_array<Item> broken_col_range (Item const*, Item const*) const;
- Link_array<Grob> column_l_arr () const;
-
- void add_column (Paper_column*);
- void typeset_grob (Grob*);
- void output_molecule (SCM, Offset);
- void output_scheme (SCM);
- void pre_processing ();
-protected:
- VIRTUAL_COPY_CONS (Grob);
-};
-
-#endif
+#error
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
static Molecule line_molecule (Grob* me, Real thick, Real dx, Real dy);
+ static bool has_interface (Grob*);
private:
static Offset get_broken_offset (Grob *me, Direction dir);
class Lyric_extender
{
public:
+ static bool has_interface (Grob*);
static void set_textitem (Spanner*, Direction, Grob*);
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
};
public:
VIRTUAL_COPY_CONS (Grob);
+ static bool has_interface (Grob*);
int rank_i_;
virtual void do_break_processing ();
virtual Paper_column *column_l () const;
class Percent_repeat_item_interface
{
public:
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK (beat_slash, (SCM ));
DECLARE_SCHEME_CALLBACK (double_percent, (SCM ));
static Molecule x_percent (Grob*,int,Real,Real );
static void set_right_head (Grob *, Item *);
static Item *get_right_head (Grob *);
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
+ static bool has_interface (Grob*);
private:
static Molecule brew_vaticana_molecule (Item *, Real,
public:
static void add_staff_sided (Grob*, Item*);
DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM ));
+ static bool has_interface (Grob*);
+
};
public:
DECLARE_SCHEME_CALLBACK (aligned_on_support_extents, (SCM element, SCM axis));
DECLARE_SCHEME_CALLBACK (aligned_on_support_refpoints, (SCM element, SCM axis));
- DECLARE_SCHEME_CALLBACK (aligned_on_self, (SCM element, SCM axis));
+
DECLARE_SCHEME_CALLBACK (aligned_side, (SCM element, SCM axis));
+
DECLARE_SCHEME_CALLBACK (quantised_position, (SCM element, SCM axis));
- DECLARE_SCHEME_CALLBACK (centered_on_parent, (SCM element, SCM axis));
static SCM general_side_position (Grob*, Axis, bool);
static void set_axis (Grob*,Axis);
};
+struct Self_alignment_interface
+{
+ static bool has_interface (Grob*);
+ DECLARE_SCHEME_CALLBACK (aligned_on_self, (SCM element, SCM axis));
+DECLARE_SCHEME_CALLBACK (centered_on_parent, (SCM element, SCM axis));
+};
+
+
#endif /* SIDE_POSITION_INTERFACE_HH */
/// set a minimum distance
static void add_rod (Grob*me, Grob * to, Real distance);
static void add_spring (Grob*me,Grob * to, Real dist, Real strength, bool);
-
+ static bool has_interface (Grob*);
static void remove_interface (Grob*);
static SCM get_minimum_distances (Grob*);
static SCM get_ideal_distances (Grob*);
static int compare (Spanner * const &,Spanner * const &);
virtual Grob* find_broken_piece (System*) const;
virtual SCM do_derived_mark ();
+ static bool has_interface (Grob*);
protected:
void set_my_columns ();
public:
static void set_interface (Grob*);
static bool has_interface (Grob*);
+ static bool ugly_hack (Grob*);
static void set_position (Grob*,Real);
DECLARE_SCHEME_CALLBACK (callback, (SCM element, SCM axis));
--- /dev/null
+
+/*
+ line-of-score.hh -- part of GNU LilyPond
+
+ (c) 1996--2002 Han-Wen Nienhuys
+*/
+
+#ifndef SCORELINE_HH
+#define SCORELINE_HH
+
+#include "protected-scm.hh"
+#include "column-x-positions.hh"
+#include "spanner.hh"
+
+class System : public Spanner
+{
+public:
+ int rank_i_;
+ void post_processing (bool);
+
+ System (SCM);
+ /// is #c# contained in #*this#?
+ bool contains_b (Paper_column const *c) const;
+ int element_count () const;
+
+ void break_into_pieces (Array<Column_x_positions> const&);
+ void output_lines ();
+ static bool has_interface (Grob*);
+
+ Link_array<Item> broken_col_range (Item const*, Item const*) const;
+ Link_array<Grob> column_l_arr () const;
+
+ void add_column (Paper_column*);
+ void typeset_grob (Grob*);
+ void output_molecule (SCM, Offset);
+ void output_scheme (SCM);
+ void pre_processing ();
+protected:
+ VIRTUAL_COPY_CONS (Grob);
+};
+
+#endif
+
static Molecule string2molecule (Grob *me, SCM text, SCM properties);
static Molecule markup_text2molecule (Grob *me, SCM markup_text, SCM properties);
+ static bool has_interface (Grob*);
+
+
private:
static Molecule lookup_character (Grob *me, Font_metric*, SCM char_name);
static Molecule lookup_text (Grob *me, Font_metric*, SCM text);
*/
struct Time_signature
{
+ static bool has_interface (Grob*);
static Molecule special_time_signature (Grob*,String,int,int) ;
static Molecule time_signature (Grob*,int, int);
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
}
if (dynamic_cast<Spanner*> (i.grob_l_)
- && i.grob_l_->has_interface (ly_symbol2scm ("dynamic-interface")))
+ && i.grob_l_->internal_has_interface (ly_symbol2scm ("dynamic-interface")))
return;
/*
#include "paper-column.hh"
#include "spanner.hh"
#include "lily-guile.hh"
-#include "line-of-score.hh"
+#include "system.hh"
#include "group-interface.hh"
Item::Item (SCM s)
return dynamic_cast<Item*> (unsmob_grob (s));
}
+
+
ADD_INTERFACE(Item,
"item-interface",
"",
(c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "key-item.hh"
+
#include "command-request.hh"
#include "musical-request.hh"
#include "item.hh"
struct Key_signature_interface
{
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
+
+ static bool has_interface (Grob*);
};
return mol.smobbed_copy ();
}
-bool
-Local_key_item::has_interface (Grob*m)
-{
- return m && m->has_interface (ly_symbol2scm ("accidentals-interface"));
-}
}
/* now try for a lyric */
- if (h->has_interface (ly_symbol2scm ("lyric-syllable-interface"))) {
+ if (h->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface"))) {
/* what's its LyricsVoice context name? */
String voice_context_id;
then ignore it and let the Extender_engraver take care of it (i.e. finish at next
lyric).
*/
- if (h->has_interface (ly_symbol2scm ("lyric-extender-interface"))) {
+ if (h->internal_has_interface (ly_symbol2scm ("lyric-extender-interface"))) {
String voice_context_id = get_context_id (i.origin_trans_l_->daddy_trans_l_, "LyricsVoice");
record_extender (trim_suffix (voice_context_id), h);
return;
#include "percent-repeat-item.hh"
#include "lookup.hh"
-bool
-Multi_measure_rest::has_interface (Grob*me)
-{
- return me->has_interface (ly_symbol2scm ("multi-measure-rest-interface"));
-}
MAKE_SCHEME_CALLBACK (Multi_measure_rest,percent,1);
SCM
return st? Stem::first_head (st): 0;
}
-bool
-Note_column::has_interface (Grob*me)
-{
- return me && me->has_interface (ly_symbol2scm ("note-column-interface"));
-}
/*
Return the first Accidentals grob that we find in a note-head.
return internal_brew_molecule (me, false).extent (a);
}
-bool
-Note_head::has_interface (Grob*m)
-{
- return m&& m->has_interface (ly_symbol2scm ("note-head-interface"));
-}
MAKE_SCHEME_CALLBACK (Note_head,brew_ez_molecule,1);
#include "separation-item.hh"
#include "staff-spacing.hh"
-bool
-Note_spacing::has_interface (Grob* g)
-{
- return g && g->has_interface (ly_symbol2scm ("note-spacing-interface"));
-}
void
Note_spacing::get_spacing (Grob *me, Item* right_col,
#include "font-metric.hh"
#include "spanner.hh"
#include "paper-def.hh"
-#include "line-of-score.hh"
+#include "system.hh"
#include "paper-column.hh"
#include "paper-score.hh"
#include "paper-column.hh"
return ly_interval2scm (unsmob_molecule (m)->extent (a));
}
-bool
-Rest::has_interface (Grob*m)
-{
- return m && m->has_interface (ly_symbol2scm ("rest-interface"));
-}
ADD_INTERFACE (Rest,"rest-interface",
-bool
-Rhythmic_head::has_interface (Grob*me)
-{
- return me && me->has_interface (ly_symbol2scm ("rhythmic-head-interface"));
-}
ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface",
#include "debug.hh"
-#include "line-of-score.hh"
+#include "system.hh"
#include "item.hh"
#include "score-engraver.hh"
#include "paper-score.hh"
return get_molecule (me, dir).smobbed_copy ();
}
-bool
-Script::has_interface (Grob*me)
+
+
+struct Text_script
{
- return me->has_interface (ly_symbol2scm ("script-interface"));
-}
+ static bool has_interface (Grob*);
+};
+struct Skript
+{
+ static bool has_interface (Grob*);
+};
ADD_INTERFACE (Text_script,"text-script-interface",
"Any text script",
--- /dev/null
+#include "side-position-interface.hh"
+#include "warn.hh"
+
+/*
+ Position centered on parent.
+ */
+MAKE_SCHEME_CALLBACK (Self_alignment_interface,centered_on_parent,2);
+SCM
+Self_alignment_interface::centered_on_parent (SCM element_smob, SCM axis)
+{
+ Grob *me = unsmob_grob (element_smob);
+ Axis a = (Axis) gh_scm2int (axis);
+ Grob *him = me->get_parent (a);
+
+ return gh_double2scm (him->extent (him,a).center ());
+}
+
+
+
+
+/**
+ callback that centers the element on itself
+
+ Requires that self-alignment-{X,Y} be set.
+ */
+MAKE_SCHEME_CALLBACK (Self_alignment_interface,aligned_on_self,2);
+SCM
+Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis)
+{
+ Grob *me = unsmob_grob (element_smob);
+ Axis a = (Axis) gh_scm2int (axis);
+ static SCM prop_syms[2];
+
+ if (!prop_syms[0])
+ {
+ prop_syms[X_AXIS] = ly_symbol2scm ("self-alignment-X");
+ prop_syms[Y_AXIS] = ly_symbol2scm ("self-alignment-Y");
+ }
+
+ SCM align (me->internal_get_grob_property (prop_syms[a]));
+ if (gh_number_p (align))
+ {
+ Interval ext (me->extent (me,a));
+
+ if (ext.empty_b ())
+ {
+ programming_error ("I'm empty. Can't align on self");
+ return gh_double2scm (0.0);
+ }
+ else
+ {
+ return gh_double2scm (- ext.linear_combination (gh_scm2double (align)));
+ }
+ }
+ else if (unsmob_grob (align))
+ {
+ return gh_double2scm (- unsmob_grob (align)->relative_coordinate (me, a));
+ }
+ return gh_double2scm (0.0);
+}
+
+
+ADD_INTERFACE (Self_alignment_interface, "self-alignment-interface",
+ "Position self using some alignment",
+ "self-alignment-X self-alignment-Y");
+
}
-bool
-Separating_group_spanner::has_interface (Grob*)
-{//todo
- assert (false);
-}
#include "debug.hh"
#include "group-interface.hh"
-bool
-Separation_item::has_interface (Grob *g)
-{
- return g->has_interface (ly_symbol2scm ("separation-item-interface"));
-}
void
Separation_item::add_item (Grob*s,Item* i)
}
-/**
- callback that centers the element on itself
-
- Requires that self-alignment-{X,Y} be set.
- */
-MAKE_SCHEME_CALLBACK (Side_position_interface,aligned_on_self,2);
-SCM
-Side_position_interface::aligned_on_self (SCM element_smob, SCM axis)
-{
- Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
- String s ("self-alignment-");
-
- s += (a == X_AXIS) ? "X" : "Y";
-
- SCM align (me->get_grob_property (s.ch_C ()));
- if (gh_number_p (align))
- {
- Interval ext (me->extent (me,a));
-
- if (ext.empty_b ())
- {
- programming_error ("I'm empty. Can't align on self");
- return gh_double2scm (0.0);
- }
- else
- {
- return gh_double2scm (- ext.linear_combination (gh_scm2double (align)));
- }
- }
- else if (unsmob_grob (align))
- {
- return gh_double2scm (- unsmob_grob (align)->relative_coordinate (me, a));
- }
- return gh_double2scm (0.0);
-}
-
Real
return gh_double2scm (o);
}
-/*
- Position centered on parent.
- */
-MAKE_SCHEME_CALLBACK (Side_position_interface,centered_on_parent,2);
-SCM
-Side_position_interface::centered_on_parent (SCM element_smob, SCM axis)
-{
- Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
- Grob *him = me->get_parent (a);
-
- return gh_double2scm (him->extent (him,a).center ());
-}
-
-
void
Side_position_interface::add_staff_support (Grob*me)
{
me->set_grob_property ("padding", gh_double2scm (p));
}
-bool
-Side_position_interface::has_interface (Grob*me)
-{
- return me->has_interface (ly_symbol2scm ("side-position-interface"));
-}
bool
Side_position_interface::supported_b (Grob*me)
}
-bool
-Slur::has_interface (Grob*me)
-{
- return me->has_interface (ly_symbol2scm ("slur-interface"));
-}
ADD_INTERFACE (Slur,"slur-interface",
}
-ADD_INTERFACE (Spaceable,"spaceable-grob-interface",
- "An grob (a Paper_column) that takes part in the
+
+ADD_INTERFACE (Spaceable_grob,"spaceable-grob-interface",
+ "A grob (a Paper_column) that takes part in the
spacing problem. ",
"measure-length penalty minimum-distances ideal-distances
left-neighbors right-neighbors");
#include <math.h>
#include <stdio.h>
-#include "line-of-score.hh"
+#include "system.hh"
#include "paper-def.hh"
#include "paper-score.hh"
#include "paper-column.hh"
static void do_measure (Rational, Grob*me,Link_array<Grob> *cols);
static void musical_column_spacing (Grob*,Item*,Item*, Real, Rational);
DECLARE_SCHEME_CALLBACK (set_springs, (SCM ));
+ static bool has_interface (Grob*);
};
/*
}
-bool
-Span_bar::has_interface (Grob*m)
-{
- return m && m->has_interface (ly_symbol2scm ("span-bar-interface"));
-}
ADD_INTERFACE (Span_bar,"span-bar-interface",
"A bar line that spans other barlines (typically used to get cross-staff barlines.",
#include "molecule.hh"
#include "paper-outputter.hh"
#include "paper-column.hh"
-#include "line-of-score.hh"
+#include "system.hh"
#include "group-interface.hh"
void
#include "note-column.hh"
#include "stem.hh"
-bool
-Staff_spacing::has_interface (Grob* g)
-{
- return g && g->has_interface (ly_symbol2scm ("staff-spacing-interface"));
-}
-
/*
Insert some more space for the next note, in case it has a stem in
the wrong direction
-
+#define has_interface ugly_hack
ADD_INTERFACE (Staff_symbol_referencer,"staff-symbol-referencer-interface",
"Object whose Y position is meaning with reference to a staff
symbol. Objects that have this interface should include
return ss;
}
-bool
-Staff_symbol::has_interface (Grob*m)
-{
- return m && m->has_interface (ly_symbol2scm ("staff-symbol-interface"));
-}
if (gh_string_p (s) || gh_pair_p (s))
/*
- if (i.grob_l_->has_interface (symbol ("lyric-syllable-interface")))
+ if (i.grob_l_->internal_has_interface (symbol ("lyric-syllable-interface")))
Tried catching lyric items to generate stanza numbers, but it
spoils lyric spacing.
lengthen stem if necessary
*/
-bool
-Stem_tremolo::has_interface (Grob *me)
-{
- return me->has_interface (ly_symbol2scm ("stem-tremolo-interface"));
-}
MAKE_SCHEME_CALLBACK (Stem_tremolo,dim_callback,2);
return info;
}
-bool
-Stem::has_interface (Grob*m)
-{
- return m && m->has_interface (ly_symbol2scm ("stem-interface"));
-}
-
ADD_INTERFACE (Stem,"stem-interface",
"A stem",
"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");
// centre on notehead ... if we have one.
if (notehead_l_) {
lyric->set_parent (notehead_l_, X_AXIS);
- lyric->add_offset_callback (Side_position_interface::centered_on_parent_proc, X_AXIS);
+ lyric->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS);
// reference is on the right of the notehead; move it left half way, and add translation
lyric->translate_axis (group_translation_f_- (notehead_l_->extent (notehead_l_, X_AXIS)).center (), X_AXIS);
}
return vi->smobbed_self ();
}
-
+struct Lyric_syllable
+{
+ static bool has_interface (Grob*);
+};
ADD_INTERFACE (Lyric_syllable,"lyric-syllable-interface",
"a single piece of lyrics",
"word-space alignment ignore-length-mismatch begin-alignment end-alignment");
}
-bool
-System_start_delimiter::has_interface (Grob*me)
-{
- return me->has_interface (ly_symbol2scm ("system-start-delimiter-interface"));
-}
Molecule
System_start_delimiter::simple_bar (Grob*me,Real h)
ADD_INTERFACE (System_start_delimiter,"system-start-delimiter-interface",
"#'style can be bar-line, bracket or brace",
- "bar-line-collapse-height brace-collapse-height bracket-collapse-height thickness arch-height arch-angle arch-thick arch-width bracket-thick glyph");
+ "collapse-height thickness arch-height arch-angle arch-thick arch-width bracket-thick glyph");
#include "input-smob.hh"
#include "axis-group-interface.hh"
#include "debug.hh"
-#include "line-of-score.hh"
+#include "system.hh"
#include "main.hh"
#include "paper-column.hh"
#include "paper-def.hh"
Paper_score contains one grob of this type. Control enters the
Grob dependency calculation from this single Line_of_score
object.",
- "between-system-string spacing-procedure all-elements columns");
+ "between-system-string all-elements columns");
-
ADD_INTERFACE (Text_item,"text-interface",
"A scheme markup text",
"text align baseline-skip lookup raise kern word-space magnify");
Grob *me= unsmob_grob (smob);
Spanner *spanner = dynamic_cast<Spanner*> (me);
- if (spanner->has_interface (ly_symbol2scm ("piano-pedal-interface")) )
+ if (spanner->internal_has_interface (ly_symbol2scm ("piano-pedal-interface")) )
{
setup_pedal_bracket(spanner);
}
height[LEFT] = 0;
Grob * textbit = me->get_parent(Y_AXIS);
extra_short = padding;
- if (textbit->has_interface(ly_symbol2scm("text-interface")))
+ if (textbit->internal_has_interface(ly_symbol2scm("text-interface")))
// for plain text, e.g., Sost. Ped.
{
SCM text = textbit->get_grob_property("text");
}
-
+struct Pianopedal
+{
+ static bool has_interface (Grob*);
+};
ADD_INTERFACE (Pianopedal,"piano-pedal-interface",
"",
"pedal-type edge-width edge-height shorten-pair text-start left-widen right-widen");
-
-
ADD_INTERFACE (Text_spanner,"text-spanner-interface",
"generic text spanner",
"dash-period if-text-padding dash-length edge-height edge-width edge-text shorten-pair type");
-bool
-Tie_column::has_interface (Grob*me)
-{
- return me->has_interface (ly_symbol2scm ("tie-column-interface"));
-}
/*
me->set_grob_property ("heads", gh_cons (SCM_EOL, SCM_EOL));
}
-bool
-Tie::has_interface (Grob*me)
-{
- return me->has_interface (ly_symbol2scm ("tie-interface"));
-}
Grob*
Tie::head (Grob*me, Direction d)
}
-bool
-Tuplet_bracket::has_interface (Grob*me)
-{
- return me->has_interface (ly_symbol2scm ("tuplet-bracket-interface"));
-}
ADD_INTERFACE (Tuplet_bracket,"tuplet-bracket-interface",
"A bracket with a number in the middle, used for tuplets.",
- "note-columns padding gap left-position right-position bracket-visibility number-visibility thickness direction");
+ "note-columns edge-width edge-height shorten-pair padding gap left-position right-position bracket-visibility number-visibility thickness direction");
&& (to_boolean (get_property ("unison"))
|| to_boolean (get_property ("unisilence")))))
for (char const **p = junk_interfaces; *p; p++)
- if (i.grob_l_->has_interface (ly_symbol2scm (*p)))
+ if (i.grob_l_->internal_has_interface (ly_symbol2scm (*p)))
{
/* Ugh, we can suicide them, but they remain living */
i.grob_l_->suicide ();