]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/direction.hh
Issue 2491: Macro for(UP_and_DOWN) and 3 similar.
[lilypond.git] / flower / include / direction.hh
index 50c41a4ab46f5b28b50135ffde9fced8639149e3..97c0f6d79bb59ee9f790c250a71f66c120df3a99 100644 (file)
@@ -60,7 +60,7 @@ operator - (Direction const d)
   return other_dir (d);
 }
 
-// huh?
+// to be deleted soon (after coping with issues 2491 and 2493
 inline Direction
 flip (Direction *i)
 {
@@ -71,6 +71,16 @@ flip (Direction *i)
   return *i;
 }
 
+#define UP_and_DOWN(d) \
+  Direction d = UP; d != CENTER; d = (d == UP ? DOWN : CENTER)
+
+#define DOWN_and_UP(d) \
+  Direction d = DOWN; d != CENTER; d = (d == DOWN ? UP : CENTER)
+
+#define LEFT_and_RIGHT(d) \
+  Direction d = LEFT; d != CENTER; d = (d == LEFT ? RIGHT : CENTER)
+
+
 /**
    if d > 0: the max operator
    if d < 0: the min operator