lilypond-1.5.9
[lilypond.git] / lily / directional-element-interface.cc
blob7f986d51ee1070ff2c7c15f5fd91a3640d72bb82
1 /*
2 directional-element.cc -- implement Directional_element
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
10 #include "directional-element-interface.hh"
13 SCM Directional_element_interface::direction_sym;
15 static void
16 init_functions ()
18 Directional_element_interface::direction_sym = scm_permanent_object (ly_symbol2scm ("direction"));
20 ADD_SCM_INIT_FUNC (Directional, init_functions);
23 bool
24 Directional_element_interface::has_interface (Grob*me)
26 return isdir_b (me->get_grob_property (direction_sym));
29 Direction
30 Directional_element_interface::get (Grob*me)
32 // return dir_;
33 SCM d= me->get_grob_property (direction_sym);
34 if (!isdir_b (d))
35 return CENTER;
37 return to_dir (d);
40 void
41 Directional_element_interface::set (Grob*me, Direction d)
43 SCM sd = gh_int2scm (d);
45 if (me->get_grob_property (direction_sym) != sd)
46 me->set_grob_property (direction_sym, sd);