]> git.donarmstrong.com Git - lilypond.git/blob - lily/directional-element-interface.cc
daf19d91a5c7607c716bb7151f82fee406cad4bf
[lilypond.git] / lily / directional-element-interface.cc
1 /*   
2   directional-element.cc -- implement Directional_element
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "directional-element-interface.hh"
11
12
13
14
15 bool
16 Directional_element_interface::has_interface (Grob*me) 
17 {
18   return ly_dir_p (me->get_grob_property ("direction"));
19 }
20
21 Direction
22 Directional_element_interface::get (Grob*me) 
23 {
24   // return dir_;
25   SCM d= me->get_grob_property ("direction");
26   if (!ly_dir_p (d))
27     return CENTER;
28       
29   return to_dir (d);
30 }
31
32 void
33 Directional_element_interface::set (Grob*me, Direction d) 
34 {
35   SCM sd = gh_int2scm (d);
36
37   /*
38     Vain attempt to save some conses.
39    */
40   if (me->get_grob_property ("direction") != sd)
41     me->set_grob_property ("direction", sd);
42 }