]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/direction.hh
8a59ac52f7c5d91b4274936c8493e2f3d62d17d1
[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--1999 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   MIN=-1,
22   MAX=1,
23   CENTER=0,
24   SMALLER=-1,
25   BIGGER=1,
26   START = -1,
27   STOP = 1
28 };
29
30 inline Direction
31 flip (Direction *i) {
32   if (*i == (Direction)1)
33     *i = (Direction)-1;
34   else if (*i == (Direction)-1)
35     *i = (Direction)1;
36   return *i;
37 }
38
39 /**
40    if d > 0: the max operator
41    if d < 0: the min operator
42  */
43 template<class T> T minmax (Direction d, T, T);
44
45 String direction_str (Direction, Axis);
46
47 #endif // DIRECTION_HH