]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/direction.hh
release: 1.1.15
[lilypond.git] / lily / include / direction.hh
1 /*
2   direction.hh -- declare Direction
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef DIRECTION_HH
11 #define DIRECTION_HH
12
13 #include "axes.hh"
14
15 enum Direction 
16 {
17   UP=1,
18   DOWN=-1,
19   LEFT=-1,
20   RIGHT=1,
21   CENTER=0,
22   SMALLER=-1,
23   BIGGER=1,
24   START = -1,
25   STOP = 1
26 };
27
28 inline Direction
29 flip (Direction *i) {
30   if (*i == (Direction)1)
31     *i = (Direction)-1;
32   else if (*i == (Direction)-1)
33     *i = (Direction)1;
34   return *i;
35 }
36
37 /**
38    if d > 0: the max operator
39    if d < 0: the min operator
40  */
41 template<class T> T minmax (Direction d, T, T);
42
43 String direction_str (Direction, Axis);
44
45 #endif // DIRECTION_HH