+1.3.55.hwn1
+===========
+
+* Molecules are now generated via callbacks exclusively; most calls to
+set_elt_property ("transparent) have been replaced by suicide().
+
1.3.54.hwn2
===========
--- /dev/null
+\score {
+ \notes \relative c'' {
+ c4 <d4 \context Staff = "another" e4> f
+ }
+}
Spanner*
Axis_group_engraver::get_spanner_p () const
{
- return new Spanner (SCM_EOL);
+ return new Spanner (get_property ("basicVerticalAxisGroupProperties"));
}
void
if (!has_interface_b ())
{
elt_l_->set_elt_pointer ("elements", SCM_EOL);
- elt_l_->set_elt_property ("transparent", SCM_BOOL_T); // junk this?
+
Group_interface (elt_l_, "interfaces").add_thing (ly_symbol2scm ("Axis_group"));
}
return Molecule ();
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Bar);
Molecule
Bar::compound_barline (String str, Real h) const
if (!gh_string_p (g))
{
- set_elt_property ("transparent", SCM_BOOL_T);
- set_extent_callback (0, X_AXIS);
+ set_elt_property ("molecule-callback", SCM_BOOL_T);
+ set_extent_callback (0, X_AXIS);
+ // leave y_extent for spanbar?
}
else if (! gh_equal_p (g, orig))
set_elt_property ("glyph", g);
if (visible_stem_count () < 2)
{
warning (_ ("beam has less than two stems"));
- // set_elt_property ("transparent", SCM_BOOL_T);
+
}
if (!directional_element (this).get ())
return leftbeams;
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS (Beam);
Molecule
Beam::do_brew_molecule () const
return filter_solutions (sol);
}
+/**
+ Compute the bounding box dimensions in direction of A.
+ */
Interval
Bezier::extent (Axis a)const
{
return iv;
}
+/**
+ Flip around axis A
+ */
+
void
Bezier::flip (Axis a)
{
{
}
+
+
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Breathing_sign);
+
Molecule
Breathing_sign::do_brew_molecule () const
{
if (gh_boolean_p (chord_inversion))
find_inversion_b = gh_scm2bool (chord_inversion);
- chord_name_p_ = new Chord_name (SCM_EOL);
+ chord_name_p_ = new Chord_name (get_property ("basicChordNameProperties"));
Chord chord = to_chord (pitch_arr_, tonic_req_, inversion_req_, bass_req_,
find_inversion_b);
return mol;
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Chord_name);
+
Molecule
Chord_name::do_brew_molecule () const
{
{
if (repeat_ && !beam_p_)
{
- beam_p_ = new Beam (SCM_EOL);
+ beam_p_ = new Beam (get_property ("basicBeamProperties"));
beam_p_->set_elt_property ("chord-tremolo", SCM_BOOL_T);
#include "paper-def.hh"
#include "lookup.hh"
-
/*
construct from parser output
*/
c0_position_i_ -= (int) octave_dir_ * 7;
-
current_settings_ = gh_cons (gh_cons (ly_symbol2scm ("glyph"), clef_glyph_), basic_properties_);
current_settings_ =
gh_cons (gh_cons (ly_symbol2scm ("c0-position"),
clef_p_ = c;
}
Staff_symbol_referencer_interface si(clef_p_);
- clef_p_->set_elt_property ("glyph", clef_glyph_);
+
si.set_position (clef_position_i_);
if (octave_dir_)
{
: Item (s)
{}
+
+/*
+FIXME: should use symbol.
+
+FIXME: this should be schemified.
+*/
void
Clef_item::before_line_breaking ()
{
SCM glyph = get_elt_property ("glyph");
- /*
- FIXME: should use symbol.
- */
if (gh_string_p (glyph))
{
String s = ly_scm2string (glyph);
/*
FIXME: should use fontsize property to set clef changes.
*/
- if (break_status_dir() != RIGHT && style != "fullSizeChanges")
+ if (get_elt_property ("non-default") &&
+ break_status_dir() != RIGHT && style != "fullSizeChanges")
{
s += "_change";
+ set_elt_property ("glyph", ly_str02scm (s.ch_C()));
}
- s = "clefs-" + s;
- set_elt_property ("glyph", ly_str02scm (s.ch_C()));
}
else
{
- set_elt_property ("transparent", SCM_BOOL_T);
+ suicide ();
+ return;
}
-
+
+ // ugh.
if (style == "transparent") // UGH. JUNKME
{
- set_elt_property ("transparent", SCM_BOOL_T);
+ set_elt_property ("molecule-callback", SCM_BOOL_T);
set_extent_callback (0, X_AXIS);
}
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Crescendo)
Molecule
Crescendo::do_brew_molecule () const
{
if (!isdir_b (dir) || !gh_pair_p (dyns))
{
Crescendo * me = (Crescendo*)this;
- me->set_elt_property ("transparent", SCM_BOOL_T);
+ me->suicide ();
Molecule m;
return m;
Dots::after_line_breaking ()
{
SCM d= get_elt_property ("dot-count");
- if (!gh_number_p (d) || !gh_scm2int (d))
- {
- set_elt_property ("transparent", SCM_BOOL_T);
- set_extent_callback (0, X_AXIS);
- set_extent_callback (0, Y_AXIS);
- }
- else
+ if (gh_number_p (d) && gh_scm2int (d))
{
if (!directional_element (this).get ())
directional_element (this).set (UP);
}
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Dots);
Molecule
Dots::do_brew_molecule () const
{
Molecule mol (lookup_l ()->blank (Box (Interval (0,0),
Interval (0,0))));
- Molecule d = lookup_l ()->afm_find (String ("dots-dot"));
- Real dw = d.extent (X_AXIS).length ();
- d.translate_axis (-dw, X_AXIS);
+ SCM c = get_elt_property ("dot-count");
+ if (!gh_number_p (c))
+ {
+ Molecule d = lookup_l ()->afm_find (String ("dots-dot"));
+
+ Real dw = d.extent (X_AXIS).length ();
+ d.translate_axis (-dw, X_AXIS);
- for (int i = gh_scm2int (get_elt_property ("dot-count")); i--; )
- {
- d.translate_axis (2*dw,X_AXIS);
- mol.add_molecule (d);
+ for (int i = gh_scm2int (c); i--; )
+ {
+ d.translate_axis (2*dw,X_AXIS);
+ mol.add_molecule (d);
+ }
}
-
return mol;
}
Dynamic_line_spanner::Dynamic_line_spanner (SCM s)
: Spanner (s)
{
- set_elt_property ("transparent", SCM_BOOL_T);
Side_position_interface (this).set_axis (Y_AXIS);
Axis_group_interface (this).set_interface ();
Axis_group_interface (this).set_axes (X_AXIS, Y_AXIS);
else
{
span_start_req_l_ = span_req_l_drul_[START];
- cresc_p_ = new Crescendo (SCM_EOL);
+ cresc_p_ = new Crescendo (get_property ("basicCrescendoProperties"));
cresc_p_->set_elt_property
("grow-direction",
gh_int2scm ((span_req_l_drul_[START]->span_type_str_ == "crescendo")
if ( line_l () != s->line_l ())
programming_error ("Killing other children too");
- s->set_elt_property ("transparent", SCM_BOOL_T);
- s->set_extent_callback (0, X_AXIS);
- s->set_extent_callback (0, Y_AXIS);
-
+ s->suicide ();
}
set_extent_callback (0, X_AXIS);
set_extent_callback (0, Y_AXIS);
set_extent_callback (Score_element::point_dimension_callback,Y_AXIS);
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Hyphen_spanner)
Molecule
Hyphen_spanner::do_brew_molecule () const
{
Molecule compound_barline (String, Real height) const;
Molecule simple_barline (Real wid, Real height) const;
+ static SCM scheme_molecule (SCM);
+
protected:
virtual void before_line_breaking ();
class Beam : public Spanner
{
public:
+ static SCM scheme_molecule (SCM);
+
int stem_count () const;
Stem* stem (int) const;
class Breathing_sign : public Item
{
public:
+ static SCM scheme_molecule (SCM);
+
VIRTUAL_COPY_CONS(Score_element);
Breathing_sign (SCM s);
protected:
virtual Molecule do_brew_molecule () const;
};
-
-
#endif // BREATHING_SIGN_HH
class Chord_name : public Item
{
public:
- VIRTUAL_COPY_CONS (Score_element);
+ static SCM scheme_molecule (SCM);
+
+VIRTUAL_COPY_CONS (Score_element);
Molecule ly_word2molecule (SCM scm) const;
Molecule ly_text2molecule (SCM scm) const;
Chord_name(SCM s);
*/
class Crescendo : public Spanner {
public:
- Crescendo(SCM);
+ static SCM scheme_molecule (SCM);
+
+Crescendo(SCM);
protected:
VIRTUAL_COPY_CONS(Score_element);
virtual Molecule do_brew_molecule() const;
virtual Molecule do_brew_molecule () const;
virtual void after_line_breaking ();
public:
+ static SCM scheme_molecule (SCM);
+
Dots (SCM);
};
extend beond, lasting the whole duration of the melissima
(as in MUP, urg).
*/
-class Extender_spanner : public Spanner
+class Lyric_extender : public Spanner
{
public:
- Extender_spanner (SCM);
+ Lyric_extender (SCM);
void set_textitem (Direction, Item*);
+ static SCM scheme_molecule (SCM);
+
protected:
virtual Molecule do_brew_molecule () const;
public:
Hyphen_spanner (SCM);
void set_textitem (Direction, Item*);
+ static SCM scheme_molecule (SCM);
+
protected:
virtual Molecule do_brew_molecule () const;
Key_item (SCM);
void add (int pitch, int acc);
void add_old (int pitch, int acc);
+ static SCM scheme_molecule (SCM);
+
protected:
virtual Molecule do_brew_molecule() const;
Molecule accidental (int,bool,bool) const;
public:
Local_key_item (SCM );
- void add_pitch (Musical_pitch, bool cautionary, bool natural);
+ static SCM scheme_molecule (SCM);
+
+void add_pitch (Musical_pitch, bool cautionary, bool natural);
protected:
virtual void before_line_breaking ();
virtual Molecule do_brew_molecule() const;
void translate_axis (Real,Axis);
Interval extent (Axis) const;
+ /**
+ codify THIS into a Scheme expression.
+ */
+ SCM create_scheme () const;
bool empty_b() const;
};
SCM fontify_atom (Font_metric*, SCM atom);
+Molecule create_molecule (SCM scheme_molecule);
{
public:
Multi_measure_rest (SCM);
+ static SCM scheme_molecule (SCM);
+
void add_column (Item*);
Molecule compound_rest (int)const;
{
public:
static int compare (Note_head * const &a, Note_head *const &b) ;
+ static SCM scheme_molecule (SCM);
+
Molecule ledger_line (Interval) const;
Note_head (SCM);
virtual void after_line_breaking ();
virtual Molecule do_brew_molecule () const;
public:
- Rest (SCM s);
+ static SCM scheme_molecule (SCM);
+
+Rest (SCM s);
};
#endif // REST_HH
/// generate rods & springs
virtual void do_space_processing ();
virtual void discretionary_processing ();
-
+ virtual void do_derived_mark ();
/// do calculations before determining horizontal spacing
virtual void before_line_breaking ();
/// do calculations after determining horizontal spacing
be handled by GUILE gc. */
virtual ~Score_element ();
- /// generate the molecule
- virtual Molecule do_brew_molecule () const;
///executed directly after the item is added to the Paper_score
virtual void do_add_processing ();
-
+ virtual Molecule do_brew_molecule ()const;
+
static Interval dim_cache_callback (Dimension_cache const*);
public:
static SCM ly_set_elt_property (SCM, SCM,SCM);
static SCM ly_get_elt_property (SCM, SCM);
-
+ static SCM scheme_molecule (SCM);
virtual void handle_broken_dependencies ();
virtual void handle_prebroken_dependencies ();
Score_element * unsmob_element (SCM);
+#define MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(TYPE) \
+SCM \
+TYPE::scheme_molecule (SCM smob) \
+{ \
+ TYPE * b = dynamic_cast<TYPE*> (unsmob_element (smob)); \
+ return b ? b->do_brew_molecule ().create_scheme () : SCM_EOL; \
+} \
+ \
+void \
+TYPE ## __init_functions () \
+{ \
+ scm_make_gsubr (#TYPE "::scheme_molecule", 1, 0, 0, \
+ (SCM(*)(...))TYPE::scheme_molecule); \
+} \
+ \
+ADD_SCM_INIT_FUNC(TYPE ## _molecule, TYPE ## __init_functions); \
+
#endif // STAFFELEM_HH
Molecule get_molecule (Direction d) const;
public:
Script (SCM);
+ static SCM scheme_molecule (SCM);
+
protected:
virtual void before_line_breaking ();
virtual void after_line_breaking ();
VIRTUAL_COPY_CONS(Score_element);
void add_column (Note_column*);
+ static SCM scheme_molecule (SCM);
+
protected:
virtual Array<Rod> get_rods () const;
virtual Array<Spring> get_springs () const;
virtual Score_element* find_broken_piece (Line_of_score*) const;
+ virtual void do_derived_mark ();
protected:
void set_my_columns ();
VIRTUAL_COPY_CONS(Score_element);
int steps_i() const;
int line_count () const;
Staff_symbol (SCM s);
+ static SCM scheme_molecule (SCM);
+
protected:
VIRTUAL_COPY_CONS(Score_element);
virtual Molecule do_brew_molecule() const;
static Interval dim_callback (Score_element*, Axis);
public:
- Stem_tremolo (SCM);
+ static SCM scheme_molecule (SCM);
+
+Stem_tremolo (SCM);
void set_stem (Stem *);
};
class Stem : public Item
{
public:
+ static SCM scheme_molecule (SCM);
+
+
+
/// log of the duration. Eg. 4 -> 16th note -> 2 flags
int flag_i () const;
Real get_default_stem_end_position () const;
void position_noteheads();
-
Real stem_end_position () const;
static Real off_callback (Score_element const*, Axis);
-protected:
Molecule flag () const;
virtual void before_line_breaking();
class Sustain_pedal : public Item
{
public:
- VIRTUAL_COPY_CONS (Score_element);
+ static SCM scheme_molecule (SCM);
+
+VIRTUAL_COPY_CONS (Score_element);
Sustain_pedal (SCM);
protected:
virtual Molecule do_brew_molecule () const;
{
public:
System_start_delimiter (SCM);
- VIRTUAL_COPY_CONS (Score_element);
+ static SCM scheme_molecule (SCM);
+
+VIRTUAL_COPY_CONS (Score_element);
protected:
virtual void after_line_breaking();
virtual Molecule do_brew_molecule () const;
{
public:
VIRTUAL_COPY_CONS (Score_element);
- Text_item (SCM s);
+ static SCM scheme_molecule (SCM);
+
+Text_item (SCM s);
protected:
virtual Molecule do_brew_molecule () const;
};
Note_head* head (Direction) const;
Real position_f () const;
+ static SCM scheme_molecule (SCM);
+
virtual Direction get_default_dir() const;
protected:
virtual Molecule do_brew_molecule() const;
public:
Time_signature (SCM);
+ static SCM scheme_molecule (SCM);
+
/*
TODO: make this SCM!
{
public:
Tuplet_spanner (SCM);
-
+ static SCM scheme_molecule (SCM);
+
+
void add_column (Note_column*);
void add_beam (Beam*);
protected:
{
public:
Volta_spanner (SCM);
-
+ static SCM scheme_molecule (SCM);
void add_column (Note_column*);
void add_bar (Bar*);
Item::Item (SCM s)
: Score_element (s)
-
{
broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0;
}
SCM result = gh_apply (vis, args);
bool trans = gh_scm2bool (gh_car (result));
bool empty = gh_scm2bool (gh_cdr (result));
-
- if (empty)
+
+ if (empty && trans)
+ suicide ();
+ else if (empty)
{
set_extent_callback (0, X_AXIS);
set_extent_callback (0, Y_AXIS);
}
- if (trans)
- set_elt_property ("transparent", SCM_BOOL_T);
+ else if (trans)
+ set_elt_property ("molecule-callback", SCM_BOOL_T);
}
}
+
*/
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Key_item)
Molecule
-Key_item::do_brew_molecule() const
+Key_item::do_brew_molecule () const
{
Molecule mol;
{
if (!text_item_p_ && interesting_.size ())
{
- text_item_p_ = new Text_item (SCM_EOL);
+ text_item_p_ = new Text_item (get_property ("basicTextProperties") );
Side_position_interface si (text_item_p_);
si.set_axis (Y_AXIS);
text_item_p_->set_parent (interesting_[0].elem_l_, Y_AXIS);
r = r->column_l ();
SCM s = get_elt_pointer ("columns");
- while (gh_car (s) != r->self_scm_)
+ while (gh_pair_p (s) && gh_car (s) != r->self_scm_)
s = gh_cdr (s);
-
- s = gh_cdr (s);
+ if (gh_pair_p (s))
+ s = gh_cdr (s);
- while (gh_car (s) != l->self_scm_)
+ while (gh_pair_p (s) && gh_car (s) != l->self_scm_)
{
Paper_column *c
= dynamic_cast<Paper_column*> (unsmob_element (gh_car (s)));
/*
UGH. clean me up
*/
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Local_key_item)
Molecule
-Local_key_item::do_brew_molecule() const
+Local_key_item::do_brew_molecule () const
{
Molecule mol;
Staff_symbol_referencer_interface si (this);
--- /dev/null
+/*
+ lyric-extender.cc -- implement Lyric_extender
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+/*
+ TODO: too complicated implementation. Why the dx_drul?.
+ */
+
+#
+#include "dimension-cache.hh"
+#include "box.hh"
+#include "debug.hh"
+#include "lookup.hh"
+#include "molecule.hh"
+#include "paper-column.hh"
+#include "paper-def.hh"
+#include "extender-spanner.hh"
+
+Lyric_extender::Lyric_extender (SCM s)
+ : Spanner (s)
+
+{
+ dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
+ set_extent_callback (Score_element::point_dimension_callback, Y_AXIS);
+}
+
+
+
+
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Lyric_extender)
+Molecule
+Lyric_extender::do_brew_molecule () const
+{
+ Molecule mol;
+
+ Real w = spanner_length ();
+
+ w += (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]);
+ Real h = paper_l ()->get_var ("extender_height");
+ Molecule a = lookup_l ()->filledbox ( Box (Interval (0,w), Interval (0,h)));
+ a.translate (Offset (dx_f_drul_[LEFT], 0));
+
+ mol.add_molecule (a);
+
+ return mol;
+}
+
+
+
+void
+Lyric_extender::after_line_breaking ()
+{
+ // UGH
+ Real gap = paper_l ()->get_var ("interline");
+
+ Direction d = LEFT;
+ do
+ {
+ Item* t = get_bound (d)
+ ? get_bound (d) : get_bound ((Direction)-d);
+ if (d == LEFT)
+ dx_f_drul_[d] += t->extent (X_AXIS).length ();
+ else
+ dx_f_drul_[d] -= d * gap / 2;
+ }
+ while (flip(&d) != LEFT);
+}
+
+
+void
+Lyric_extender::set_textitem (Direction d, Item* textitem_l)
+{
+ set_bound (d, textitem_l);
+ add_dependency (textitem_l);
+}
+
+
{
return expr_;
}
+
+Molecule
+create_molecule (SCM scm_mol)
+{
+ if (!gh_pair_p (scm_mol))
+ return Molecule ();
+
+ SCM exp = gh_car (scm_mol);
+ scm_mol = gh_cdr (scm_mol);
+ Box b ;
+ if (gh_pair_p (scm_mol))
+ {
+ Interval i1 = ly_scm2interval (gh_car (scm_mol));
+ Interval i2 = ly_scm2interval (gh_cdr (scm_mol));
+ b = Box (i1,i2);
+ }
+ return Molecule (b, exp);
+}
+
+SCM
+Molecule::create_scheme () const
+{
+ return gh_cons (expr_,
+ gh_cons (ly_interval2scm (dim_[X_AXIS]),
+ ly_interval2scm (dim_[Y_AXIS])));
+}
[TODO] 17
* variable-sized multi-measure rest symbol: |====| ??
*/
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Multi_measure_rest)
Molecule
Multi_measure_rest::do_brew_molecule () const
{
Multi_measure_rest::after_line_breaking ()
{
if (!gh_pair_p (get_elt_pointer ("columns")))
- set_elt_property ("transparent", SCM_BOOL_T);
+ {
+ suicide ();
+ }
+
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Note_head);
Molecule
Note_head::do_brew_molecule() const
for (int i=0; i < note_req_l_arr_.size (); i++)
{
- Note_head *note_p = new Note_head (SCM_EOL);
+ Note_head *note_p = new Note_head (get_property ("basicNoteHeadProperties"));
Staff_symbol_referencer_interface si (note_p);
si.set_interface ();
if (note_req_l->duration_.dots_i_)
{
- Dots * d = new Dots (SCM_EOL);
+ Dots * d = new Dots (get_property ("basicDotsProperties"));
Staff_symbol_referencer_interface sd (d);
sd.set_interface ();
else
{
assert (!volta_span_p_);
- volta_span_p_ = new Volta_spanner (SCM_EOL);
+ volta_span_p_ = new Volta_spanner (get_property ("basicVoltaSpannerProperties"));
announce_element (Score_element_info (volta_span_p_,0));
volta_span_p_->set_elt_property ("text",
ly_str02scm (t.ch_C()));
return to_duration (r->balltype_i (), r->dot_count ()).length_mom ();
}
+/*
+ ugh
+ */
static Rhythmic_head*
col2rhythmic_head (Note_column* c)
{
display_count = gh_scm2int (s);
for (; i > display_count; i--)
col2rhythmic_head (rest_l_arr[i-1])
- ->set_elt_property ("transparent", SCM_BOOL_T);
+ ->set_elt_property ("molecule-callback", SCM_BOOL_T);
}
else
display_count = rest_l_arr.size ();
#include "musical-request.hh"
#include "dots.hh"
#include "rest.hh"
+
/*
Should merge with Note_head_engraver
*/
{
if (rest_req_l_ && !rest_p_)
{
- rest_p_ = new Rest (SCM_EOL);
+ rest_p_ = new Rest (get_property ("basicRestProperties"));
Staff_symbol_referencer_interface si (rest_p_);
si.set_interface ();
if (rest_req_l_->duration_.dots_i_)
{
- dot_p_ = new Dots (SCM_EOL);
+ dot_p_ = new Dots (get_property ("basicDotsProperties"));
Staff_symbol_referencer_interface si (dot_p_);
si.set_interface ();
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Rest)
Molecule
Rest::do_brew_molecule () const
{
property_alist_ = gh_cons (gh_cons (sym, val), property_alist_);
}
-
void
Score_element::set_elt_pointer (const char* k, SCM v)
{
Interval
Score_element::molecule_extent (Score_element const *s, Axis a )
{
- Molecule m = s->do_brew_molecule();
+ Molecule m = s->get_molecule ();
return m.extent(a);
}
Molecule
Score_element::get_molecule () const
{
- if (to_boolean (get_elt_property ("transparent")))
- return Molecule ();
+ SCM proc = get_elt_property ("molecule-callback");
+ if (gh_procedure_p (proc))
+ return create_molecule (gh_apply (proc, gh_list (this->self_scm_, SCM_UNDEFINED)));
- return do_brew_molecule ();
+ return Molecule ();
}
}
-/*
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Score_element)
+
+ /*
ugh.
*/
+
Molecule
-Score_element::do_brew_molecule() const
+Score_element::do_brew_molecule () const
{
SCM glyph = get_elt_property ("glyph");
if (gh_string_p (glyph))
{
return lookup_l ()->afm_find (String (ly_scm2string (glyph)));
-
}
else
{
pointer_alist_ = SCM_EOL;
set_extent_callback (0, Y_AXIS);
set_extent_callback (0, X_AXIS);
-}
+ for (int a= X_AXIS; a <= Y_AXIS; a++)
+ {
+ dim_cache_[a].off_callbacks_.clear ();
+ }
+}
void
Score_element::handle_prebroken_dependencies()
{
}
-
Score_element*
Score_element::find_broken_piece (Line_of_score*) const
{
return SCM_EOL;
}
scm_gc_mark (s->pointer_alist_);
+
+ s->do_derived_mark ();
+ if (s->parent_l (Y_AXIS))
+ scm_gc_mark (s->parent_l (Y_AXIS)->self_scm_);
+ if (s->parent_l (X_AXIS))
+ scm_gc_mark (s->parent_l (X_AXIS)->self_scm_);
+
return s->property_alist_;
}
return 1;
}
+void
+Score_element::do_derived_mark ()
+{
+}
+
void
Score_element::do_smobify_self ()
{
continue;
}
// todo -> use result of articulation-to-scriptdef directly as basic prop list.
- Script *p =new Script (SCM_EOL);
+ Script *p =new Script (get_property ("basicScriptProperties"));
Side_position_interface stafy (p);
i.set_direction (d);
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Script)
Molecule
Script::do_brew_molecule () const
{
{
// push a new slur onto stack.
//(use temp. array to wait for all slur STOPs)
- Slur * s_p =new Slur (SCM_EOL);
+ Slur * s_p =new Slur (get_property ("basicSlurProperties"));
requests_arr_.push (slur_req_l);
start_slur_l_arr_.push (s_p);
#include "group-interface.hh"
#include "staff-symbol-referencer.hh"
-
-
class Slur_bezier_bow : public Bezier_bow
{
public:
if (!encompass_arr.size ())
{
- set_elt_property ("transparent", SCM_BOOL_T);
- set_extent_callback (0, X_AXIS);
- set_extent_callback (0, Y_AXIS);
+ suicide();
return;
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Slur);
+
/*
Ugh should have dash-length + dash-period
*/
{
set_extent_callback (0, X_AXIS);
set_extent_callback (0, Y_AXIS);
- set_elt_property ("transparent", SCM_BOOL_T);
}
/*
{
if (!gh_pair_p (get_elt_pointer ("elements")))
{
- set_elt_property ("transparent", SCM_BOOL_T);
- set_extent_callback (0, X_AXIS);
- set_extent_callback (0, Y_AXIS);
+ suicide ();
}
SCM gl = get_elt_property ("glyph");
if (!gh_string_p (gl))
{
- set_elt_property ("transparent", SCM_BOOL_T);
- set_extent_callback (0, X_AXIS);
- set_extent_callback (0, Y_AXIS);
+ suicide ();
+ return ;
}
else {
String type_str = ly_scm2string (gl);
{
iv[LEFT] = spanned_drul_[LEFT]->column_l ()->rank_i ();
}
- if ( spanned_drul_[RIGHT])
+ if (spanned_drul_[RIGHT])
{
iv[RIGHT] = spanned_drul_[RIGHT]->column_l ()->rank_i ();
}
return 0.0;
}
+
+void
+Spanner::do_derived_mark ()
+{
+ Direction d = LEFT;
+ do
+ if (spanned_drul_[d])
+ scm_gc_mark (spanned_drul_[d]->self_scm_);
+ while (flip (&d) != LEFT);
+}
+
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Staff_symbol)
Molecule
-Staff_symbol::do_brew_molecule() const
+Staff_symbol::do_brew_molecule () const
{
Score_element * common
= get_bound (LEFT)->common_refpoint (get_bound (RIGHT), X_AXIS);
int duration_log = r->duration_.durlog_i_;
if (!stem_p_)
{
- stem_p_ = new Stem (SCM_EOL);
+ stem_p_ = new Stem (get_property ("basicStemProperties"));
Staff_symbol_referencer_interface st(stem_p_);
st.set_interface ();
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Stem_tremolo)
Molecule
Stem_tremolo::do_brew_molecule () const
{
if (invisible_b ())
{
- set_elt_property ("transparent", SCM_BOOL_T);
- set_extent_callback (0, Y_AXIS);
- set_extent_callback (0, X_AXIS);
+ remove_elt_property ("molecule-callback");
+ // suicide();
}
-
+
set_spacing_hints ();
}
}
-const Real ANGLE = 20* (2.0*M_PI/360.0); // ugh!
+const Real ANGLE = 20* (2.0*M_PI/360.0); // ugh! Should be settable.
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Stem)
Molecule
Stem::do_brew_molecule () const
{
if (scm_ilength (get_elt_pointer ("elements")) <= 1 && gl == ly_symbol2scm ("bar-line"))
{
- set_elt_property ("transparent", SCM_BOOL_T);
- set_extent_callback (0, X_AXIS);
- set_extent_callback (0, Y_AXIS);
+ suicide ();
}
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(System_start_delimiter);
Molecule
System_start_delimiter::do_brew_molecule ()const
{
if (gh_number_p (s) && l < gh_scm2double (s))
{
System_start_delimiter * me = (System_start_delimiter*)this;
- me->set_elt_property ("transparent", SCM_BOOL_T);
- me->set_extent_callback (0, X_AXIS);
- me->set_extent_callback (0, Y_AXIS);
+ me->suicide ();
return m;
}
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Text_item)
+
Molecule
Text_item::do_brew_molecule () const
{
set_elt_pointer ("ties", SCM_EOL);
set_extent_callback (0, X_AXIS);
set_extent_callback (0, Y_AXIS);
- set_elt_property ("transparent", SCM_BOOL_T);
}
void
}
}
-
+ SCM basic = get_property ("basicTieProperties");
SCM sparse = get_property ("sparseTies");
if (to_boolean (sparse))
{
SCM pair = gh_list_ref (head_list, gh_int2scm (i/2));
- Tie * p = new Tie (SCM_EOL);
+ Tie * p = new Tie (basic);
p->set_head (LEFT, dynamic_cast<Item*> (unsmob_element (gh_car (pair))));
p->set_head (RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdr (pair))));
}
else for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s))
{
- Tie * p = new Tie (SCM_EOL);
+ Tie * p = new Tie (basic);
p->set_head (LEFT, dynamic_cast<Item*> (unsmob_element (gh_caar (s))));
p->set_head (RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdar (s))));
}
else if (tie_p_arr_.size () > 1 && !tie_column_p_)
{
- tie_column_p_ = new Tie_column (SCM_EOL);
+ tie_column_p_ = new Tie_column (get_property ("basicTieColumnProperties"));
for (int i = tie_p_arr_.size (); i--; )
tie_column_p_->add_tie (tie_p_arr_ [i]);
announce_element (Score_element_info (tie_column_p_, 0));
if (!head (LEFT) && !head (RIGHT))
{
programming_error ("Tie without heads.");
- set_elt_property ("transparent", SCM_BOOL_T);
- set_extent_callback (0, X_AXIS);
- set_extent_callback (0, Y_AXIS);
+ suicide ();
return;
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Tie)
Molecule
Tie::do_brew_molecule () const
{
}
// ugh.!
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Time_signature)
Molecule
Time_signature::do_brew_molecule () const
{
if (i < started_span_p_arr_.size () && started_span_p_arr_[i])
continue;
- Tuplet_spanner* glep = new Tuplet_spanner (SCM_EOL);
+ Tuplet_spanner* glep = new Tuplet_spanner (get_property ("basicTupletSpannerProperties"));
if (i >= started_span_p_arr_.size ())
started_span_p_arr_.push (glep);
else
/*
TODO.
*/
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Tuplet_spanner)
Molecule
Tuplet_spanner::do_brew_molecule () const
{
if (!column_arr.size ())
{
- set_elt_property ("transparent", SCM_BOOL_T);
- set_extent_callback (0, X_AXIS);
- set_extent_callback (0, Y_AXIS);
+ suicide ();
}
Direction d = directional_element (this).get ();
*/
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Volta_spanner)
Molecule
Volta_spanner::do_brew_molecule () const
{