(c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-
+#include <ctype.h>
#include "bar.hh"
-#include "clef-item.hh"
#include "command-request.hh"
#include "dimension-cache.hh"
#include "engraver-group-engraver.hh"
#include "side-position-interface.hh"
#include "staff-symbol-referencer.hh"
#include "staff-symbol.hh"
-#include "text-item.hh"
+#include "item.hh"
+#include "group-interface.hh"
/**
put stuff over or next to bars. Examples: bar numbers, marginal notes,
VIRTUAL_COPY_CONS(Translator);
Mark_engraver ();
protected:
- Text_item* text_p_;
- Protected_scm visibility_lambda_;
+ Item* text_p_;
Protected_scm staffs_;
protected:
void
Mark_engraver::do_creation_processing ()
{
- String t = "markVisibilityFunction";
- SCM proc = get_property (t);
-
- if (gh_procedure_p (proc))
- visibility_lambda_ = proc;
}
-
void
Mark_engraver::acknowledge_element (Score_element_info inf)
{
{
/*
Ugh. Figure out how to do this right at beginning of line, (without
- creating class Bar_script : public Text_item).
+ creating class Bar_script : public Item).
*/
text_p_->set_parent (s, X_AXIS);
}
{
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;
}
{
if (text_p_)
return;
-
- text_p_ = new Text_item;
- text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh
+
+ SCM s = get_property ("basicMarkProperties");
+ text_p_ = new Item (s);
+
+ Group_interface (text_p_, "interfaces").add_thing (ly_symbol2scm ("Mark"));
Side_position_interface staffside(text_p_);
staffside.set_axis (Y_AXIS);
+ /*
+ -> Generic props.
+ */
SCM prop = get_property ("markDirection");
if (!isdir_b (prop))
{
gh_double2scm(paper_l ()->get_var ("interline")));
}
- if (gh_procedure_p (visibility_lambda_))
- text_p_->set_elt_property ("visibility-lambda",
- visibility_lambda_);
announce_element (Score_element_info (text_p_, rq));
}
text_p_->set_elt_property ("text",
ly_str02scm ( t.ch_C()));
- SCM st = ly_str02scm ((t.index_any_i ("0123456789") >= 0 )
- ? "mark" : "large");
+
+ String style = "mark";
+ for (int i=0; i < t.length_i(); i++)
+ {
+ if (!isdigit(t[i]))
+ {
+ style = "large";
+ break;
+ }
+ }
+ SCM st = ly_str02scm (style.ch_C());
text_p_->set_elt_property ("style", st);
}
}