source file of the GNU LilyPond music typesetter
- (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "dot-column.hh"
#include <cstdio>
-#include <math.h>
+#include <cmath>
#include <map>
+using namespace std;
#include "dots.hh"
#include "rhythmic-head.hh"
TODO: let Dot_column communicate with stem via Note_column.
*/
-MAKE_SCHEME_CALLBACK (Dot_column, force_shift_callback, 2);
+MAKE_SCHEME_CALLBACK (Dot_column, side_position, 1);
SCM
-Dot_column::force_shift_callback (SCM element_smob, SCM axis)
+Dot_column::side_position (SCM smob)
{
- Grob *me = unsmob_grob (element_smob);
- (void) axis;
- assert (scm_to_int (axis) == Y_AXIS);
- me = me->get_parent (X_AXIS);
-
- if (!to_boolean (me->get_property ("positioning-done")))
- {
- me->set_property ("positioning-done", SCM_BOOL_T);
-
- do_shifts (me);
- }
- return scm_from_double (0.0);
-}
-
-MAKE_SCHEME_CALLBACK (Dot_column, side_position, 2);
-SCM
-Dot_column::side_position (SCM element_smob, SCM axis)
-{
- Grob *me = unsmob_grob (element_smob);
- (void) axis;
- assert (scm_to_int (axis) == X_AXIS);
-
+ Grob *me = unsmob_grob (smob);
Grob *stem = unsmob_grob (me->get_object ("stem"));
if (stem
&& !Stem::get_beam (stem)
This will add the stem to the support if a flag collision happens.
*/
- Stem::stem_end_position (stem);
+ stem->get_property ("stem-end-position");
}
- return Side_position_interface::aligned_side (element_smob, axis);
+
+ return Side_position_interface::x_aligned_side (smob);
}
struct Dot_position
}
};
-typedef std::map<int, Dot_position> Dot_configuration;
+typedef map<int, Dot_position> Dot_configuration;
/*
Value CFG according.
}
}
+MAKE_SCHEME_CALLBACK(Dot_column, calc_positioning_done, 1);
SCM
-Dot_column::do_shifts (Grob *me)
+Dot_column::calc_positioning_done (SCM smob)
{
+ Grob *me = unsmob_grob (smob);
Link_array<Grob> dots
= extract_grob_array (me, "dots");
for (Dot_configuration::const_iterator i (cfg.begin ());
i != cfg.end (); i++)
{
+ /*
+ Junkme?
+ */
Staff_symbol_referencer::set_position (i->second.dot_, i->first);
}
-
- return SCM_UNSPECIFIED;
+ return SCM_BOOL_T;
}
void
Side_position_interface::add_support (me, rh);
Pointer_group_interface::add_grob (me, ly_symbol2scm ("dots"), d);
- d->add_offset_callback (Dot_column::force_shift_callback_proc, Y_AXIS);
+ d->set_property ("Y-offset", Grob::x_parent_positioning_proc);
Axis_group_interface::add_element (me, d);
}
}
-ADD_INTERFACE (Dot_column, "dot-column-interface",
+ADD_INTERFACE (Dot_column,
+ "dot-column-interface",
+
"Groups dot objects so they form a column, and position dots so they do not "
"clash with staff lines ",
- "positioning-done direction stem");
+
+ /* properties */
+ "positioning-done "
+ "direction "
+ "stem");