Fix InstrumentSwitch grob definition.
[lilypond.git] / flower / include / direction.hh
blob5400a5220d727e635f6647e429af6aec725eb761
1 /*
2 direction.hh -- declare Direction
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
9 #ifndef DIRECTION_HH
10 #define DIRECTION_HH
12 #include "axis.hh"
14 enum Direction
16 UP = 1,
17 DOWN=-1,
18 LEFT=-1,
19 RIGHT = 1,
20 MIN=-1,
21 MAX = 1,
22 CENTER = 0,
23 SMALLER=-1,
24 BIGGER = 1,
25 START = -1,
26 STOP = 1,
29 This is necessary to safely write loops,
30 since
32 dir <= RIGHT
34 is otherwise transformed into true unconditionally.
36 DIRECTION_LIMIT = 2,
37 DIRECTION_NEG_LIMIT = -2,
40 inline Direction
41 other_dir (Direction const d)
43 return (Direction) (-d);
46 inline Direction
47 operator - (Direction const d)
49 return other_dir (d);
52 // huh?
53 inline Direction
54 flip (Direction *i)
56 if (*i == (Direction)1)
57 *i = (Direction) - 1;
58 else if (*i == (Direction) - 1)
59 *i = (Direction)1;
60 return *i;
63 /**
64 if d > 0: the max operator
65 if d < 0: the min operator
67 template<class T> T minmax (Direction d, T, T);
69 // String direction_string (Direction, Axis);
71 #endif // DIRECTION_HH