~ubuntu-branches/ubuntu/precise/lilypond/precise

« back to all changes in this revision

Viewing changes to flower/include/direction.hh

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2006-12-19 10:18:12 UTC
  • mfrom: (3.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061219101812-7awtjkp0i393wxty
Tags: 2.8.7-3
scripts/midi2ly.py: When setting DATADIR, find Lilypond python files
in the @TOPLEVEL_VERSION@ directory, not 'current'.  Patch thanks to
Chris Lamb (chris@chris-lamb.co.uk).  (Closes: #400550)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
  source file of the GNU LilyPond music typesetter
5
5
 
6
 
  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
6
  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
7
*/
8
8
 
9
 
 
10
9
#ifndef DIRECTION_HH
11
10
#define DIRECTION_HH
12
11
 
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
 
};
 
12
#include "axis.hh"
 
13
 
 
14
enum Direction
 
15
  {
 
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,
 
27
 
 
28
    /*
 
29
      This is necessary to safely write loops,
 
30
      since
 
31
 
 
32
      dir <= RIGHT
 
33
 
 
34
      is otherwise transformed into true unconditionally.
 
35
    */
 
36
    DIRECTION_LIMIT = 2,
 
37
    DIRECTION_NEG_LIMIT = -2,
 
38
  };
29
39
 
30
40
inline Direction
31
41
other_dir (Direction const d)
41
51
 
42
52
// huh?
43
53
inline Direction
44
 
flip (Direction *i) {
 
54
flip (Direction *i)
 
55
{
45
56
  if (*i == (Direction)1)
46
 
    *i = (Direction)-1;
47
 
  else if (*i == (Direction)-1)
 
57
    *i = (Direction) - 1;
 
58
  else if (*i == (Direction) - 1)
48
59
    *i = (Direction)1;
49
60
  return *i;
50
61
}
52
63
/**
53
64
   if d > 0: the max operator
54
65
   if d < 0: the min operator
55
 
 */
 
66
*/
56
67
template<class T> T minmax (Direction d, T, T);
57
68
 
58
69
// String direction_string (Direction, Axis);