Axis_group_interface (staffline_p_).set_interface ();
Axis_group_interface (staffline_p_).set_axes (Y_AXIS, Y_AXIS);
- Item * it = get_staff_info().command_pcol_l ();
+ Score_element * it = unsmob_element (get_property ("currentCommandColumn"));
Pointer_group_interface (it, "bounded-by-me").add_element (staffline_p_);
staffline_p_->set_bound(LEFT,it);
&& gh_number_p (gh_cdr (dims)))
staffline_p_->set_elt_property ("extra-extent-Y", dims);
- Item * it = get_staff_info().command_pcol_l ();
+Score_element * it = unsmob_element (get_property ("currentCommandColumn"));
Pointer_group_interface (it, "bounded-by-me").add_element (staffline_p_);
staffline_p_->set_bound(RIGHT,it);
}
-Staff_info
-Engraver_group_engraver::get_staff_info() const
-{
- Staff_info inf = Engraver::get_staff_info();
- return inf;
-}
+
#include "score-element.hh"
#include "group-interface.hh"
-void
-Engraver::fill_staff_info (Staff_info&)
-{
-
-}
void
Engraver::announce_element (Score_element_info i)
return dynamic_cast<Paper_def*>(output_def_l_);
}
-
-Staff_info
-Engraver::get_staff_info() const
-{
- if (daddy_grav_l())
- return daddy_grav_l()->get_staff_info();
- Staff_info info;
- return info;
-}
-
-
-
-
-
Engraver_group_engraver*
Engraver::daddy_grav_l () const
{
if (extender_p_)
{
req_l_->warning (_ ("unterminated extender"));
- extender_p_->set_bound(RIGHT, get_staff_info ().command_pcol_l ());
+ extender_p_->set_bound(RIGHT, unsmob_element (get_property ("currentCommandColumn")));
}
}
Axis_group_interface (last_musical_col_l_).add_element (align_l_);
}
- last_musical_col_l_ = get_staff_info ().musical_pcol_l ();
+ last_musical_col_l_ = dynamic_cast<Paper_column*>( unsmob_element (get_property ("currentMusicalColumn")));
}
void
if (hyphen_p_)
{
req_l_->warning (_ ("unterminated hyphen"));
- hyphen_p_->set_bound(RIGHT, get_staff_info ().command_pcol_l ());
+ hyphen_p_->set_bound(RIGHT, unsmob_element (get_property ("currentCommandColumn")));
}
}
public:
VIRTUAL_COPY_CONS(Translator);
- virtual Staff_info get_staff_info() const;
virtual void do_announces();
virtual void announce_element (Score_element_info);
};
Announce element. Default: pass on to daddy. Utility
*/
virtual void announce_element (Score_element_info);
-
- /**
- Get information on the staff. Default: ask daddy.
- */
- virtual Staff_info get_staff_info() const;
- virtual void fill_staff_info (Staff_info&);
-
public:
VIRTUAL_COPY_CONS(Translator);
Engraver_group_engraver * daddy_grav_l() const;
protected:
/* Engraver_group_engraver interface */
- virtual Staff_info get_staff_info() const;
+
virtual bool do_try_music (Music*);
virtual void do_creation_processing();
virtual void do_removal_processing();
-/*
- staff-info.hh -- declare Staff_info
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef STAFF_INFO_HH
-#define STAFF_INFO_HH
-
-#include "lily-proto.hh"
-
-/** struct to pass staff info along a Engraver hierarchy.
-
- JUNKME.
- */
-struct Staff_info {
- Paper_column *musical_l_;
- Paper_column *command_l_;
-
- Paper_column * command_pcol_l();
- Paper_column * musical_pcol_l();
- Staff_info();
-};
-
-#endif // STAFF_INFO_HH
Line_group_engraver_group::do_removal_processing()
{
Engraver_group_engraver::do_removal_processing ();
- Item * it = get_staff_info().command_pcol_l ();
+ Score_element * it
+ = unsmob_element (get_property (ly_symbol2scm ("currentCommandColumn")));
Pointer_group_interface (it, "bounded-by-me").add_element (staffline_p_);
staffline_p_->set_bound(RIGHT,it);
Line_group_engraver_group::do_creation_processing()
{
create_line_spanner ();
- Item * it = get_staff_info().command_pcol_l ();
+ Score_element * it
+ = unsmob_element (get_property (ly_symbol2scm ("currentCommandColumn")));
staffline_p_->set_bound(LEFT,it);
Pointer_group_interface (it, "bounded-by-me").add_element (staffline_p_);
if (news[i])
*current[i] = news[i];
}
-}
-
-Staff_info
-Score_engraver::get_staff_info() const
-{
- Staff_info inf = Engraver_group_engraver::get_staff_info();
- inf.command_l_ = command_column_l_;
- inf.musical_l_ = musical_column_l_;
-
- return inf;
+ if (new_musical_l)
+ set_property ("currentMusicalColumn", new_musical_l->self_scm_);
+ if (new_command_l)
+ set_property ("currentCommandColumn", new_command_l->self_scm_);
}
Music_output*
{
sep_span_p_ = new Separating_group_spanner (SCM_EOL);
announce_element (Score_element_info (sep_span_p_, 0));
- sep_span_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
+ sep_span_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
}
void
Separating_line_group_engraver::do_removal_processing ()
{
- sep_span_p_->set_bound (RIGHT, get_staff_info ().command_pcol_l ());
+ sep_span_p_->set_bound (RIGHT, unsmob_element (get_property ("currentCommandColumn")));
typeset_element (sep_span_p_);
sep_span_p_ =0;
}
Spacing_engraver::do_creation_processing ()
{
spacing_p_ =new Spacing_spanner (SCM_EOL);
- spacing_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
+ spacing_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
announce_element (Score_element_info (spacing_p_, 0));
}
void
Spacing_engraver::do_removal_processing ()
{
- Paper_column * p = get_staff_info ().command_pcol_l ();
-
+ Score_element * p = unsmob_element (get_property ("currentCommandColumn"));
spacing_p_->set_bound (RIGHT, p);
typeset_element (spacing_p_);
spacing_p_ =0;
shortest_playing = shortest_playing <? starter;
Paper_column * sc
- = dynamic_cast<Paper_column*> (get_staff_info ().musical_pcol_l ());
+ = dynamic_cast<Paper_column*> (unsmob_element (get_property ("currentMusicalColumn")));
SCM sh = smobify (new Moment (shortest_playing));
SCM st = smobify (new Moment (starter));
if (!left || !right)
return;
- if (left == right)
- {
- warning (_f ("Spanner `%s' has equal left and right spanpoints",
- classname (this)));
- }
-
/*
Check if our parent in X-direction spans equally wide
or wider than we do.
{
set_parent (i, X_AXIS);
}
-
- if (spanned_drul_[Direction(-d)] == spanned_drul_[d]
- && i)
- warning (_f ("Spanner `%s' has equal left and right spanpoints",
- classname (this)));
}
while (flip (&d) != LEFT);
}
+void
+add_bound_item (Spanner* sp, Item*it)
+{
+ if (!sp->get_bound (LEFT))
+ sp->set_bound (LEFT, it);
+ else
+ sp->set_bound (RIGHT, it);
+}
-/*
- staff-info.cc -- implement Staff_info
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "proto.hh"
-
-#include "staff-info.hh"
-#include "paper-column.hh"
-
-Staff_info::Staff_info()
-{
- command_l_ =0;
- musical_l_ =0;
-}
-
-
-Paper_column*
-Staff_info::command_pcol_l()
-{
- return command_l_;
-}
-
-Paper_column*
-Staff_info::musical_pcol_l()
-{
- return musical_l_;
-}
-
Staff_symbol_engraver::do_creation_processing()
{
span_p_ = new Staff_symbol (get_property ("staffSymbolBasicProperties"));
- span_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
+ span_p_->set_bound(LEFT,unsmob_element (get_property ("currentCommandColumn")));
announce_element (Score_element_info (span_p_, 0));
}
if (gh_number_p (n))
span_p_->set_elt_property ("line-count", n);
- span_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
+ span_p_->set_bound(RIGHT,unsmob_element (get_property ("currentCommandColumn")));
typeset_element (span_p_);
span_p_ =0;
}
System_start_delimiter_engraver::do_creation_processing()
{
delim_ = new System_start_delimiter (get_property ("basicSystemStartDelimiterProperties"));
- delim_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
+ delim_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
/*
You can't override the glyph using \property, you must do it in
if (gh_number_p (collapse))
delim_->set_elt_property ("collapse-height", collapse);
- delim_->set_bound (RIGHT, get_staff_info ().command_pcol_l ());
+ delim_->set_bound (RIGHT, unsmob_element (get_property ("currentCommandColumn")));
typeset_element (delim_);
}
valign_p_->set_elt_property ("stacking-dir",
gh_int2scm (DOWN));
- valign_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
+ valign_p_->set_bound(LEFT,unsmob_element (get_property ("currentCommandColumn")));
announce_element (Score_element_info (valign_p_ , 0));
}
valign_p_->set_elt_property ("threshold",
gh_cons (min,max));
}
- valign_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
+ valign_p_->set_bound(RIGHT,unsmob_element (get_property ("currentCommandColumn")));
typeset_element (valign_p_);
valign_p_ =0;
}