*/
#include "align-interface.hh"
-
#include "score-element.hh"
#include "group-interface.hh"
#include "axis-group-interface.hh"
This callback is set in the children of the align element. It does
not compute anything, but a side effect of a->do_side_processing ()
is that the elements are placed correctly. */
-Real
-Align_interface::alignment_callback (Score_element *sc, Axis ax)
+MAKE_SCHEME_CALLBACK(Align_interface,alignment_callback,2);
+SCM
+Align_interface::alignment_callback (SCM element_smob, SCM axis)
{
- Score_element * par = sc->parent_l (ax);
+ Score_element * sun = unsmob_element (element_smob);
+ Axis ax = (Axis )gh_scm2int (axis);
+ Score_element * par = sun->parent_l (ax);
if (par && !to_boolean (par->get_elt_property ("alignment-done")))
{
Align_interface::do_side_processing (par, ax);
}
- return 0.0;
+ return gh_double2scm (0.0);
}
void
Align_interface::add_element (Score_element*me,Score_element* s)
{
- s->add_offset_callback (alignment_callback, Align_interface::axis (me));
+ s->add_offset_callback (Align_interface::alignment_callback_proc, Align_interface::axis (me));
Axis_group_interface::add_element (me, s);
}
#include "axes.hh"
#include "lily-proto.hh"
+#include "lily-guile.hh"
+
/*
Order elements top to bottom/left to right/right to left etc.
*/
struct Align_interface {
- static Real alignment_callback (Score_element *,Axis);
+ DECLARE_SCHEME_CALLBACK(alignment_callback, (SCM element, SCM axis));
static void do_side_processing (Score_element*,Axis a);
static void set_axis (Score_element*,Axis);
static Axis axis (Score_element*) ;
static int get_count (Score_element*,Score_element*);
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
- static Real center_on_element (Score_element *c, Axis);
+ DECLARE_SCHEME_CALLBACK(center_on_element, (SCM element, SCM axis));
};
#endif /* ALIGN_INTERFACE_HH */
static void set_interface (Score_element*);
static Molecule compound_barline (Score_element*, String, Real height) ;
static Molecule simple_barline (Score_element*, Real wid, Real height) ;
- static SCM get_staff_bar_size (SCM);
- static SCM brew_molecule (SCM);
- static SCM before_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(get_staff_bar_size, (SCM ));
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
+ DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
};
#endif // BAR_HH
#include "lily-guile.hh"
+
/** a beam connects multiple stems.
Beam adjusts the stems its owns to make sure that they reach the
static Item* last_visible_stem (Score_element*);
static bool has_interface (Score_element*);
static void set_interface (Score_element*);
- static Real rest_collision_callback (Score_element *,Axis);
+ DECLARE_SCHEME_CALLBACK(rest_collision_callback, (SCM element, SCM axis));
Beam (SCM);
static void add_stem (Score_element*,Score_element*);
static void set_beaming (Score_element*,Beaming_info_list *);
static void set_stemlens (Score_element*);
static int get_multiplicity (Score_element*me);
- static SCM brew_molecule (SCM);
- static SCM before_line_breaking (SCM);
- static SCM after_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
+ DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
+ DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
static Molecule stem_beams (Score_element*,Item *here, Item *next, Item *prev);
private:
class Break_align_interface
{
public:
- static SCM before_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
static void do_alignment (Score_element*);
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
static void add_element (Score_element*me, Score_element*add);
- static Real alignment_callback (Score_element*, Axis);
- static Real self_align_callback (Score_element*, Axis);
+ DECLARE_SCHEME_CALLBACK(alignment_callback, (SCM element, SCM axis));
+ DECLARE_SCHEME_CALLBACK(self_align_callback, (SCM element, SCM axis));
};
#endif // BREAK_ALIGN_ITEM_HH
class Breathing_sign
{
public:
- static SCM brew_molecule (SCM);
- static Real offset_callback (Score_element *, Axis);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
+ DECLARE_SCHEME_CALLBACK(offset_callback, (SCM element, SCM axis));
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
};
class Chord_name
{
public:
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static Molecule ly_word2molecule (Score_element*, SCM scm, Real* x) ;
static Molecule ly_text2molecule (Score_element*, SCM scm) ;
- static SCM after_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
};
#endif // CHORD_NAME_HH
*/
struct Clef
{
- static SCM before_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
static bool has_interface (Score_element*);
static void set_interface (Score_element*);
};
public:
static SCM automatic_shift (Score_element*);
static SCM forced_shift (Score_element*);
- static Real force_shift_callback (Score_element *, Axis);
+ DECLARE_SCHEME_CALLBACK(force_shift_callback, (SCM element, SCM axis));
static void do_shifts (Score_element*);
static void add_column (Score_element*me,Score_element*ncol_l);
};
struct Crescendo
{
public:
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static void set_interface(Score_element*);
static bool has_interface (Score_element*);
};
static void add_head (Score_element * dotcol, Score_element* rh );
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
- static Real force_shift_callback (Score_element * , Axis);
+ DECLARE_SCHEME_CALLBACK(force_shift_callback, (SCM ,SCM));
static SCM do_shifts (SCM dotlist);
};
#endif // DOT_COLUMN_HH
#include "lily-guile.hh"
+
/**
The dots to go with a notehead/rest. A separate class, since they
are a party in collision resolution.
class Dots // interface
{
public:
- static Real quantised_position_callback(Score_element*, Axis);
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(quantised_position_callback, (SCM element, SCM axis));
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
#endif // DOTS_HH
public:
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
- static SCM before_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
};
#endif /* GRACE_ALIGN_ITEM_HH */
Spanner* elt_l_;
Hyphen_spanner (Spanner*);
void set_textitem (Direction, Score_element*);
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
#endif // HYPHEN_SPANNER_HH
static int calculate_position(Score_element*,SCM pair) ;
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
#endif // KEYITEM_HH
typedef SCM(*Scheme_function_unknown)();
#if __GNUC_MINOR__ >= 96
-typedef SCM(*Scheme_function_1)(SCM);
+typedef SCM(*Scheme_function_1)(SCM);
+typedef SCM(*Scheme_function_2)(SCM,SCM);
#else
typedef SCM(*Scheme_function_1)(...);
+typedef SCM(*Scheme_function_2)(...);
#endif
-#define MAKE_SCHEME_CALLBACK(TYPE, FUNC) \
-static SCM TYPE ## _ ## FUNC ## _proc;\
+#define DECLARE_SCHEME_CALLBACK(NAME,ARGS) \
+ static SCM NAME ARGS; \
+ static SCM NAME ## _proc
+
+#define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT) \
+SCM TYPE :: FUNC ## _proc;\
void \
TYPE ## _ ## FUNC ## _init_functions () \
{ \
- TYPE ## _ ## FUNC ## _proc = gh_new_procedure1_0 (#TYPE "::" #FUNC, \
- ((Scheme_function_1)TYPE :: FUNC)); \
+ TYPE :: FUNC ## _proc = gh_new_procedure ## ARGCOUNT ## _0 (#TYPE "::" #FUNC, \
+ ((Scheme_function_ ## ARGCOUNT)TYPE :: FUNC)); \
} \
\
ADD_SCM_INIT_FUNC(TYPE ## _ ## FUNC ## _callback, TYPE ## _ ## FUNC ## _init_functions); \
{
static Molecule parenthesize (Score_element*me, Molecule) ;
public:
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static void add_pitch (Score_element*me, Musical_pitch, bool cautionary, bool natural);
static bool has_interface (Score_element*);
static void set_interface (Score_element*);
Spanner*elt_l_;
Lyric_extender (Spanner*);
void set_textitem (Direction, Score_element*);
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
#endif // EXTENDER_SPANNER_HH
public:
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static void add_column (Score_element*,Item*);
- static SCM set_spacing_rods (SCM);
+ DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM ));
};
#endif /* MULTI_MEASURE_REST_HH */
class Note_head
{
public:
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static Molecule ledger_line (Interval, Score_element*) ;
static bool has_interface (Score_element*);
};
+
/*
Move rests in note-columns so that they do not collide.
static void add_column (Score_element*me,Score_element*);
static void set_interface (Score_element*me);
static bool has_interface (Score_element*);
- static Real force_shift_callback (Score_element *, Axis);
+ DECLARE_SCHEME_CALLBACK(force_shift_callback, (SCM element, SCM axis));
static SCM do_shift (Score_element*,SCM);
};
#endif // REST_COLLISION_HH
class Rest
{
public:
- static SCM after_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
static bool has_interface (Score_element*);
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
#endif // REST_HH
static Item * stem_l (Score_element*) ;
static Item * dots_l (Score_element*) ;
static int dot_count (Score_element*) ;
- static SCM after_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
static bool has_interface (Score_element*);
static void set_interface (Score_element*);
};
{
public:
static void add_staff_sided (Score_element*, Item*);
- static SCM before_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
};
static Molecule get_molecule (Score_element*,Direction d);
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
- static SCM brew_molecule (SCM);
- static SCM after_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
+ DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
};
#endif /* Stem_SCRIPT_HH */
public:
static void add_spacing_unit (Score_element*me, Item*);
static void set_interface (Score_element*);
- static SCM set_spacing_rods (SCM);
+ DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM ));
};
#endif /* SEPARATING_GROUP_SPANNER_HH */
#include "item.hh"
+
+
+
/**
Position victim object (ELT_L_) next to other objects (the support).
struct Side_position
{
public:
- static Real side_position (Score_element *, Axis);
- static Real aligned_on_self (Score_element *, Axis);
- static Real aligned_side (Score_element *, Axis);
- static Real quantised_position (Score_element *, Axis);
- static Real centered_on_parent (Score_element *, Axis);
+ DECLARE_SCHEME_CALLBACK(side_position, (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 void set_axis (Score_element*,Axis);
static void set_minimum_space (Score_element*,Real);
static void set_padding (Score_element*,Real);
static void set_interface (Score_element*);
static void do_measure (Score_element*,Link_array<Score_element>) ;
- static SCM set_springs (SCM);
+ DECLARE_SCHEME_CALLBACK(set_springs, (SCM ));
static Real stem_dir_correction (Score_element*,Score_element*,Score_element*) ;
static Real default_bar_spacing (Score_element*,Score_element*,Score_element*,Moment) ;
static Real note_spacing (Score_element*,Score_element*,Score_element*,Moment) ;
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
static void set_position (Score_element*,Real);
- static Real callback (Score_element *, Axis a);
+ DECLARE_SCHEME_CALLBACK(callback, (SCM element, SCM axis));
/**
Leading are the lead strips between the sticks (lines) of
static Real staff_space (Score_element*) ;
static int steps_i(Score_element*) ;
static int line_count (Score_element*);
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static bool has_interface (Score_element*);
static void set_interface (Score_element*);
};
class System_start_delimiter
{
public:
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static void set_interface (Score_element*me);
static bool has_interface (Score_element*);
- static SCM after_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
static void try_collapse (Score_element*);
static Molecule staff_bracket (Score_element*,Real) ;
static Molecule staff_brace (Score_element*,Real) ;
static void set_interface (Score_element*me);
static bool has_interface (Score_element*);
static void add_tie (Score_element*me,Score_element*);
- static SCM after_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
static void set_directions (Score_element*me);
};
static bool has_interface (Score_element*);
static Score_element * head (Score_element*,Direction) ;
static Real position_f (Score_element*) ;
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static Direction get_default_dir(Score_element*) ;
static SCM get_control_points (SCM);
- static SCM set_spacing_rods (SCM);
+ DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM ));
};
#endif // TIE_HH
{
static Molecule special_time_signature (Score_element*,String,int,int) ;
static Molecule time_signature (Score_element*,int, int);
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
#endif // METER_HH
class Tuplet_spanner
{
public:
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
static void calc_dy (Score_element*,Real *) ;
static void calc_position_and_height (Score_element*,Real*,Real *dy);
- static SCM after_line_breaking (SCM);
+ DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
static Direction get_default_dir (Score_element*);
};
public:
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
- static SCM brew_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static void add_column (Score_element*, Score_element*col);
static void add_bar (Score_element*me, Item*bar);
};
// centre on notehead ... if we have one.
if(notehead_l_) {
lyric->set_parent(notehead_l_, X_AXIS);
- lyric->add_offset_callback (Side_position::centered_on_parent, X_AXIS);
+ lyric->add_offset_callback (Side_position::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(X_AXIS)).center(), X_AXIS);
}