#include "stem.hh"
#include "rhythmic-head.hh"
#include "engraver.hh"
+#include "note-column.hh"
class Script_engraver : public Engraver
{
// todo -> use result of articulation-to-scriptdef directly as basic prop list.
Grob *p =new Item (get_property ("Script"));
art = ly_cdr (art);
- p->set_grob_property ("molecule", ly_car (art));
+ p->set_grob_property ("script-molecule", ly_car (art));
art = ly_cdr (art);
bool follow_staff = gh_scm2bool (ly_car (art));
art = ly_cdr (art);
SCM force_dir = l->get_mus_property ("direction");
- if (isdir_b (force_dir) && !to_dir (force_dir))
+ if (ly_dir_p (force_dir) && !to_dir (force_dir))
force_dir = ly_car (art);
art = ly_cdr (art);
SCM priority = ly_car (art);
- if (isdir_b (force_dir) && to_dir (force_dir))
+ if (ly_dir_p (force_dir) && to_dir (force_dir))
p->set_grob_property ("direction", force_dir);
else if (to_dir (relative_stem_dir))
p->set_grob_property ("side-relative-direction", relative_stem_dir);
SCM axisprop = get_property ("scriptHorizontal");
bool xaxis = to_boolean (axisprop);
Side_position_interface::set_axis (p, xaxis ? X_AXIS : Y_AXIS);
-
+
if (!follow_staff && ! xaxis)
p->set_grob_property ("staff-support", SCM_BOOL_T);
script_p_arr_.push (p);
- announce_grob (p, l);
+ announce_grob (p, l->self_scm());
}
}
{
Grob *e = script_p_arr_[i];
- if (!e->get_parent (X_AXIS))
- {
- e->set_parent (inf.grob_l_, X_AXIS);
- }
if (Side_position_interface::get_axis (e) == X_AXIS
&& !e->get_parent (Y_AXIS))
{
}
Side_position_interface::add_support (e,inf.grob_l_);
}
- }
+ }
+ else if (Note_column::has_interface (inf.grob_l_))
+ {
+
+ /*
+ We make note column the parent of the script. That's not
+ correct, but due to seconds in a chord, noteheads may be
+ swapped around horizontally. We don't know which note head to
+ put it on, so we postpone this decision to
+ Script_interface::before_line_breaking ().
+
+ */
+ for (int i=0; i < script_p_arr_.size (); i++)
+ {
+ Grob *e = script_p_arr_[i];
+
+ if (!e->get_parent (X_AXIS) &&
+ Side_position_interface::get_axis (e) == Y_AXIS)
+ {
+ e->set_parent (inf.grob_l_, X_AXIS);
+ }
+ }
+ }
}
void
{
for (int i=0; i < script_p_arr_.size (); i++)
{
+
+ /*
+ TODO: junk staff-support.
+ */
Grob * sc = script_p_arr_[i];
if (to_boolean (sc->get_grob_property ("staff-support")))
{
/* descr */ " Handles note ornaments generated by @code{\\script}.
",
/* creats*/ "Script",
-/* acks */ "stem-interface rhythmic-head-interface",
+/* acks */ "stem-interface rhythmic-head-interface note-column-interface",
/* reads */ "scriptDefinitions scriptHorizontal",
/* write */ "");