source file of the GNU LilyPond music typesetter
- (c) 2000--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "hara-kiri-group-spanner.hh"
void
Axis_group_interface::add_element (Grob*me,Grob *e)
{
- for (SCM ax = me->get_grob_property ("axes"); ax != SCM_EOL ; ax = ly_cdr (ax))
+ for (SCM ax = me->get_property ("axes"); ax != SCM_EOL ; ax = ly_cdr (ax))
{
- Axis a = (Axis) gh_scm2int (ly_car (ax));
+ Axis a = (Axis) ly_scm2int (ly_car (ax));
if (!e->get_parent (a))
e->set_parent (me, a);
}
bool
-Axis_group_interface::axis_b (Grob*me,Axis a)
+Axis_group_interface::has_axis (Grob*me,Axis a)
{
/*
urg. FIXME, check for Hara_kiri_group_spanner shouldn't be necessary?
*/
- return me->has_extent_callback_b (group_extent_callback_proc, a) ||
- (me->has_extent_callback_b (Hara_kiri_group_spanner::y_extent_proc, a));
+ return me->has_extent_callback (group_extent_callback_proc, a) ||
+ (me->has_extent_callback (Hara_kiri_group_spanner::y_extent_proc, a));
}
Interval
Axis_group_interface::relative_group_extent (Axis a, Grob *common, SCM elts)
{
Interval r;
- for (SCM s = elts; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = elts; ly_c_pair_p (s); s = ly_cdr (s))
{
Grob * se = unsmob_grob (ly_car (s));
Interval dims = se->extent (common, a);
- if (!dims.empty_b ())
+ if (!dims.is_empty ())
r.unite (dims);
}
return r;
Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (scm_axis);
+ Axis a = (Axis) ly_scm2int (scm_axis);
- SCM elts = me->get_grob_property ("elements");
+ SCM elts = me->get_property ("elements");
Grob * common = common_refpoint_of_list (elts, me, a);
Real my_coord = me->relative_coordinate (common, a);
- Interval r (relative_group_extent (a, common,elts));
+ Interval r (relative_group_extent (a, common, elts));
return ly_interval2scm (r - my_coord);
}
SCM sa1= scm_int2num (a1);
SCM sa2 = scm_int2num (a2);
- SCM axes = me->get_grob_property ("axes");
+ SCM axes = me->get_property ("axes");
- if (!gh_pair_p (axes)
- || scm_memq (sa1, axes) == SCM_BOOL_F
- || scm_memq (sa2, axes) == SCM_BOOL_F)
+ if (!ly_c_pair_p (axes)
+ || scm_c_memq (sa1, axes) == SCM_BOOL_F
+ || scm_c_memq (sa2, axes) == SCM_BOOL_F)
{
- SCM ax = gh_cons (sa1, SCM_EOL);
+ SCM ax = scm_cons (sa1, SCM_EOL);
if (a1 != a2)
- ax= gh_cons (sa2, ax);
- me->set_grob_property ("axes", ax);
+ ax= scm_cons (sa2, ax);
+ me->set_property ("axes", ax);
}
if (a1 != X_AXIS && a2 != X_AXIS)
/*
why so convoluted ? (fixme/documentme?)
*/
- if (me->has_extent_callback_b (Grob::molecule_extent_proc, a1))
+ if (me->has_extent_callback (Grob::stencil_extent_proc, a1))
me->set_extent (Axis_group_interface::group_extent_callback_proc,a1);
- if (me->has_extent_callback_b (Grob::molecule_extent_proc, a2))
+ if (me->has_extent_callback (Grob::stencil_extent_proc, a2))
me->set_extent (Axis_group_interface::group_extent_callback_proc,a2);
}
if (!has_interface (me))
return childs;
- for (SCM ep = me->get_grob_property ("elements"); gh_pair_p (ep); ep = ly_cdr (ep))
+ for (SCM ep = me->get_property ("elements"); ly_c_pair_p (ep); ep = ly_cdr (ep))
{
Grob* e = unsmob_grob (ly_car (ep));
if (e)
ADD_INTERFACE (Axis_group_interface, "axis-group-interface",
- "a group of coupled grobs",
- "axes");
+ "An object that groups other layout objects.",
+ "axes elements");