* Experimental property collapse for clef and staff-symbol.
---
Generated by hanwen@cs.uu.nl,
From = lilypond-1.3.54.hwn1, To = lilypond-1.3.54.hwn2
usage
cd lilypond-source-dir; patch -E -p1 < lilypond-1.3.54.hwn2.diff
Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure
---- ../lilypond-1.3.54/CHANGES Thu May 25 00:20:46 2000
+--- ../lilypond-1.3.54.hwn1/CHANGES Thu May 25 19:52:28 2000
+++ b/CHANGES Fri May 26 01:15:04 2000
+@@ -1,5 +1,4 @@
+-1.3.1.3.54.hwn1
+-===========
+* Experimental property collapse for clef and staff-symbol.
+
+ * Massive search replace patch: store pointers and properties
+ separately, in preparation of property collapse.--- ../lilypond-1.3.54/CHANGES Thu May 25 00:20:46 2000
++ b/CHANGES Thu May 25 23:22:02 2000
@@ -1,3 +1,11 @@
1.3.54.jcn1
MAJOR_VERSION=1
MINOR_VERSION=3
PATCH_LEVEL=54
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=hwn2
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
{
align_item_p_ = new Grace_align_item;
Side_position_interface (align_item_p_).set_axis (X_AXIS);
- Side_position_interface (align_item_p_).set_direction (LEFT);
+ Side_position_interface (align_item_p_).set_direction (LEFT);
+
// needed for setting font size.
announce_element (Score_element_info (align_item_p_, 0));
}
if (!bar_p_)
{
bar_p_ = new Staff_bar;
- bar_p_->set_elt_property ("break-align-symbol", ly_symbol2scm ("Staff_bar"));
-
+ bar_p_->property_alist_ = get_property ("basicBarlineProperties");
+
// urg: "" != empty...
/*
TODO: use symbol.
{
if (text_p_)
{
- text_p_->set_elt_pointer ("side-support", staffs_);
+ text_p_->set_elt_pointer ("side-support-elements", staffs_);
typeset_element (text_p_);
text_p_ =0;
}
Bar::Bar ()
{
- set_elt_property ("breakable", SCM_BOOL_T);
}
SCM clef_glyph_; // no need for protection. Always referenced somewhere else.
Clef_engraver();
+
+ SCM basic_properties_;
+ Protected_scm current_settings_;
};
Clef_engraver::Clef_engraver()
{
+ current_settings_ = SCM_EOL;
+ basic_properties_ = SCM_EOL;
+
clef_glyph_ = SCM_EOL;
clef_p_ = 0;
clef_req_l_ = 0;
}
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"),
+ gh_int2scm (c0_position_i_)),
+ current_settings_);
+
return true;
}
void
Clef_engraver::do_creation_processing()
{
+ basic_properties_ = get_property ("basicClefItemProperties");
+
SCM def = get_property ("defaultClef");
if (gh_string_p (def))
{
if (!clef_p_)
{
Clef_item *c= new Clef_item;
- c->set_elt_property ("breakable", SCM_BOOL_T);
- c->set_elt_property ("break-align-symbol", ly_symbol2scm ("Clef_item"));
+ c-> property_alist_ = current_settings_;
announce_element (Score_element_info (c, clef_req_l_));
Staff_symbol_referencer_interface si(c);
{
if (clef_p_)
{
- SCM vis;
- if(to_boolean (clef_p_->remove_elt_property("non-default")))
+ SCM vis = 0;
+ if(to_boolean (clef_p_->get_elt_property("non-default")))
{
vis = ly_symbol2scm ("all-visible");
+ vis = scm_eval (vis);
}
- else
- vis = ly_symbol2scm ("begin-of-line-visible");
- vis = scm_eval (vis);
+ if (vis)
+ {
+ clef_p_->set_elt_property("visibility-lambda", vis);
+ if (octavate_p_)
+ octavate_p_->set_elt_property("visibility-lambda", vis);
+ }
- clef_p_->set_elt_property("visibility-lambda", vis);
- if (octavate_p_)
- octavate_p_->set_elt_property("visibility-lambda", vis);
-
typeset_element (clef_p_);
clef_p_ =0;
for (int i=0; i < clashes.size (); i++)
{
SCM sh
- = clashes[i]->remove_elt_property ("horizontal-shift");
+ = clashes[i]->get_elt_property ("horizontal-shift");
if (gh_number_p (sh))
shift.push (gh_scm2int (sh));
(c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+
#include "grace-engraver-group.hh"
#include "lily-guile.hh"
-
#include "score-element.hh"
#include "musical-request.hh"
Grace_engraver_group::finish ()
{
calling_self_b_ = true;
- removal_processing (); // ugr. We'd want to have this done by our parents.g
+ removal_processing (); // ugr. We'd want to have this done by our parents.
for (int i=0; i < announce_to_top_.size (); i++)
{
Engraver::announce_element (announce_to_top_[i]);
Moment when_mom ()const;
bool musical_b () const;
-
+ bool used_b () const;
void set_rank (int);
private:
#ifndef SLURGRAV_HH
#define SLURGRAV_HH
-#include "engraver.hh"
-class Slur_engraver :public Engraver {
- Link_array<Span_req> requests_arr_;
- Link_array<Span_req> new_slur_req_l_arr_;
- Link_array<Slur> slur_l_stack_;
- Link_array<Slur> end_slur_l_arr_;
-
- void set_melisma (bool);
-protected:
- virtual bool do_try_music (Music*);
- virtual void do_process_music();
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
- virtual void do_removal_processing ();
-
-public:
- VIRTUAL_COPY_CONS(Translator);
-
-};
#endif // SLURGRAV_HH
{
if (original_l_)
{
- property_alist_
- = handle_broken_smobs (original_l_->property_alist_,
- gh_int2scm (break_status_dir ()));
pointer_alist_
= handle_broken_smobs (original_l_->pointer_alist_,
gh_int2scm (break_status_dir ()));
Can't do this earlier, because try_visibility_lambda () might set
the elt property transparent, which would then be copied.
*/
- SCM vis = remove_elt_property ("visibility-lambda");
+ SCM vis = get_elt_property ("visibility-lambda");
if (gh_procedure_p (vis))
{
SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED);
if (!item_p_)
{
item_p_ = new Key_item;
+ item_p_->property_alist_ = get_property ("basicKeyProperties");
+
+
+ item_p_->set_elt_property ("c0-position", gh_int2scm (0));
+ item_p_->set_elt_property ("old-accidentals", SCM_EOL);
+ item_p_->set_elt_property ("new-accidentals", SCM_EOL);
+
Staff_symbol_referencer_interface st (item_p_);
st.set_interface ();
-
- item_p_->set_elt_property ("break-align-symbol", ly_symbol2scm ("Key_item"));
- item_p_->set_elt_property ("multi-octave",
- gh_bool2scm (key_.multi_octave_b_));
+ if (key_.multi_octave_b_)
+ item_p_->set_elt_property ("multi-octave", gh_bool2scm (key_.multi_octave_b_));
announce_element (Score_element_info (item_p_,keyreq_l_));
if (!def)
- item_p_->set_elt_property ("visibility-lambda",
- scm_eval (ly_symbol2scm ("all-visible")));
+ item_p_->set_elt_property ("visibility-lambda",
+ scm_eval (ly_symbol2scm ("all-visible")));
}
{
set_elt_property ("breakable", SCM_BOOL_T);
set_elt_property ("c0-position", gh_int2scm (0));
-
- set_elt_property ("old-accidentals", SCM_EOL);
- set_elt_property ("new-accidentals", SCM_EOL);
}
void
seem empty. We need to retain breakable columns, in case
someone forced a breakpoint.
*/
- if (!bfound
- || (acs[i]->get_elt_pointer ("elements") == SCM_EOL
- && !brb))
+ if (!bfound || !acs[i]->used_b ())
acs.del (i);
}
return acs;
{
if (text_p_)
{
- text_p_->set_elt_property ("side-support" , staffs_);
+ text_p_->set_elt_pointer("side-support-elements" , staffs_);
typeset_element (text_p_);
text_p_ =0;
}
return s != Moment(0);
}
+bool
+Paper_column::used_b ()const
+{
+ return gh_pair_p (get_elt_pointer ("elements")) || breakable_b ();
+}
self_scm_ = SCM_EOL;
used_b_ = true;
original_l_ =(Score_element*) &s;
- property_alist_ = SCM_EOL;
+ property_alist_ = s.property_alist_;
pointer_alist_ = SCM_EOL;
status_i_ = s.status_i_;
{
SCM s = get_elt_property (key);
SCM sym = ly_symbol2scm (key);
- property_alist_ = scm_assq_remove_x (property_alist_, sym);
+
+ property_alist_ = gh_cons (gh_cons (sym, SCM_UNDEFINED), property_alist_);
+
return s;
}
Score_element::set_elt_property (String k, SCM v)
{
SCM s = ly_symbol2scm (k.ch_C ());
- property_alist_ = scm_assq_set_x (property_alist_, s, v);
+ // non destructive
+ property_alist_ = gh_cons (gh_cons (s, v),property_alist_);
}
void
{
Score_element * sc = s->broken_into_l_arr_[i];
Line_of_score * l = sc->line_l ();
- s->broken_into_l_arr_[i]->property_alist_ =
- handle_broken_smobs (property_alist_,
- l ? l->self_scm_ : SCM_UNDEFINED);
- s->broken_into_l_arr_[i]->pointer_alist_ =
+ sc->pointer_alist_ =
handle_broken_smobs (pointer_alist_,
l ? l->self_scm_ : SCM_UNDEFINED);
}
typeset_all ();
- if (musical_column_l_->linked_b ())
- programming_error ("Last column in score should be non-musical");
set_columns (0,0);
}
{
if (*current[i])
{
- if ((*current[i])->linked_b())
+ if ((*current[i])->used_b())
+ // if ((*current[i])->linked_b())
{
scoreline_l_->add_column ((*current[i]));
-
}
else
{
void
Side_position_interface::add_support (Score_element*e)
{
- Pointer_group_interface (elt_l_, "side-support").add_element (e);
+ Pointer_group_interface (elt_l_, "side-support-elements").add_element (e);
}
{
Score_element* me = (Score_element*)cme;
Score_element *common = me->parent_l (axis);
- SCM support = me->get_elt_pointer ("side-support");
+ SCM support = me->get_elt_pointer ("side-support-elements");
for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
{
Score_element * e = unsmob_element (gh_car (s));
Side_position_interface::set_axis (Axis a)
{
// prop transparent ?
- if (elt_l_->get_elt_property ("side-support") == SCM_UNDEFINED)
- elt_l_->set_elt_property ("side-support" ,SCM_EOL);
+ if (elt_l_->get_elt_pointer ("side-support-elements") == SCM_UNDEFINED)
+ elt_l_->set_elt_pointer ("side-support-elements" ,SCM_EOL);
if (!elt_l_->has_offset_callback_b (aligned_side, a))
elt_l_->add_offset_callback (aligned_side, a);
bool
Side_position_interface::has_interface_b () const
{
- return elt_l_->get_elt_property ("side-support") != SCM_UNDEFINED;
+ return elt_l_->get_elt_pointer ("side-support-elements") != SCM_UNDEFINED;
}
bool
Side_position_interface::supported_b () const
{
- SCM s =elt_l_->get_elt_property ("side-support");
+ SCM s =elt_l_->get_elt_pointer ("side-support-elements");
return s != SCM_UNDEFINED && s != SCM_EOL;
}
#include "debug.hh"
#include "note-column.hh"
#include "translator-group.hh"
+#include "engraver.hh"
+
+class Slur_engraver :public Engraver {
+ Link_array<Span_req> requests_arr_;
+ Link_array<Span_req> new_slur_req_l_arr_;
+ Link_array<Slur> slur_l_stack_;
+ Link_array<Slur> end_slur_l_arr_;
+
+ void set_melisma (bool);
+protected:
+ virtual bool do_try_music (Music*);
+ virtual void do_process_music();
+ virtual void acknowledge_element (Score_element_info);
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
+ virtual void do_removal_processing ();
+
+public:
+ VIRTUAL_COPY_CONS(Translator);
+
+};
bool
Slur_engraver::do_try_music (Music *req_l)
dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0;
dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
- set_elt_property ("note-columns", SCM_EOL);
+ set_elt_pointer ("note-columns", SCM_EOL);
set_elt_property ("control-points", SCM_EOL);
}
void
Slur::add_column (Note_column*n)
{
- if (!gh_pair_p (n->get_elt_property ("note-heads")))
+ if (!gh_pair_p (n->get_elt_pointer ("note-heads")))
warning (_ ("Putting slur over rest. Ignoring."));
else
{
Span_bar*
Span_bar_engraver::get_span_bar_p() const
{
- return new Span_bar;
+ Span_bar * sp= new Span_bar;
+ return sp;
}
if (bar_l_arr_.size() >= 2 && !spanbar_p_)
{
spanbar_p_ = get_span_bar_p();
+ spanbar_p_-> property_alist_ = bar_l_arr_[0]->property_alist_;
spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS);
spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS);
- SCM v = bar_l_arr_[0]->get_elt_property ("visibility-lambda");
- if (gh_procedure_p (v))
- spanbar_p_->set_elt_property ("visibility-lambda",v);
-
- spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS);
announce_element (Score_element_info (spanbar_p_,0));
- if (!gh_string_p (spanbar_p_->get_elt_property ("glyph")))
- spanbar_p_-> set_elt_property ("glyph",
- bar_l_arr_[0]->get_elt_property ("glyph"));
}
}
}
-
void
Span_bar_engraver::do_pre_move_processing()
{
{
span_p_ = new Staff_symbol;
span_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
+
+
+ // ugh, should do generic
+ span_p_->property_alist_ = get_property ("staffSymbolBasicProperties");
announce_element (Score_element_info (span_p_, 0));
}
Real
Staff_symbol::staff_space ()const
{
- return gh_scm2double (get_elt_property ("staff-space"));
+ return gh_scm2double (get_elt_property ("staff-space")) *
+ paper_l ()->get_var ("staffspace");
}
if (req)
{
time_signature_p_ = new Time_signature;
+ time_signature_p_->property_alist_ = get_property ("basicTimeSignatureProperties");
time_signature_p_->set_elt_property ("fraction",
gh_cons (gh_int2scm (req->beats_i_),
gh_int2scm (req->one_beat_i_)));
- time_signature_p_->set_elt_property ("break-align-symbol", ly_symbol2scm( "Time_signature"));
}
Time_signature::Time_signature ()
{
- set_elt_property ("breakable", SCM_BOOL_T);
+
}
// ugh.!
\consists "Repeat_engraver";
+ staffSymbolBasicProperties = #'(
+ (staff-space . 1.0 )
+ (line-count . 5 )
+ )
+ basicTimeSignatureProperties = #`(
+ (break-align-symbol . Time_signature)
+ (visibility-lambda . ,all-visible)
+ (breakable . #t)
+ )
+ basicBarlineProperties = #`(
+ (break-align-symbol . Staff_bar)
+ (visibility-lambda . `begin-of-line-invisible)
+ (breakable . #t)
+ )
+
+ basicKeyProperties = #`(
+ (break-align-symbol . Key_item)
+ (visibility-lambda . ,begin-of-line-visible)
+ (breakable . #t)
+ )
+ basicClefItemProperties = #`(
+ (breakable . #t)
+ (break-align-symbol . Clef_item)
+ (visibility-lambda . ,begin-of-line-visible)
+ )
% name, glyph id, c0 position
supportedClefTypes = #'(
% params.ly
% generic paper parameters
-#'staff-height = \staffheight;
paperfile = \papersize + ".ly";
% paperfile = "a4.ly";
% urg, need grace_ versions of these too?
beam_thickness = 0.52 * (\staffspace - \stafflinethickness);
-#'beam-thickness = \beam_thickness; %% UGR
interbeam = (2.0 * \staffspace + \stafflinethickness - \beam_thickness) / 2.0;
arithmetic_basicspace = 2.0;
-
-
-#'Stem_tremolo::beam-width = 1.5 * \quartwidth ;
-
-#'Left_edge_item::visibility-lambda = #begin-of-line-visible
-
%
% UGH; junk these!
%
-#'Key_item::visibility-lambda = #begin-of-line-visible
-#'Breathing_sign::visibility-lambda = #begin-of-line-invisible
-
% catch suspect beam slopes, set slope to zero if
% outer stem is lengthened more than
beam_lengthened = 0.2 * \staffspace;
#'margin-shape = #'()
-
-
-%
#'Local_key_item::left-padding = #'0.2
#'Local_key_item::right-padding = #'0.4
-#'Staff_symbol::staff-space = \staffspace ;
-#'Staff_symbol::line-count = #5
+#'staff-height = \staffheight;
+#'beam-thickness = \beam_thickness; %% UGR
+#'Stem_tremolo::beam-width = 1.5 * \quartwidth ;
+#'Breathing_sign::visibility-lambda = #begin-of-line-invisible
+#'Left_edge_item::visibility-lambda = #begin-of-line-visible