]> git.donarmstrong.com Git - lilypond.git/blob - lily/directional-element-interface.cc
Merge with git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond.git
[lilypond.git] / lily / directional-element-interface.cc
1 /*
2   directional-element-interface.cc -- implement Directional_element
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "directional-element-interface.hh"
10 #include "warn.hh"
11
12 Direction
13 get_grob_direction (Grob *me)
14 {
15   SCM d = me->get_property ("direction");
16   if (d == ly_symbol2scm ("calculation-in-progress"))
17     {
18       programming_error ("Grob direction requested while calculation in progress. ");
19       return UP;
20     }
21   if (!is_direction (d))
22     return CENTER;
23
24   return to_dir (d);
25 }
26
27 void
28 set_grob_direction (Grob *me, Direction d)
29 {
30   SCM sd = scm_from_int (d);
31   me->set_property ("direction", sd);
32 }