X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Faxes.hh;h=f0f438af1fc145bc632b72a3d79cc523c1f70ebf;hb=91e7cbaa6e54e004365d28e0f10c9362a7f13320;hp=bb10a4995292467876cea42aa4d5f7ddda81ecd3;hpb=2745cbd907f8216a4cc1fc5f488ae19efdfdbd10;p=lilypond.git diff --git a/flower/include/axes.hh b/flower/include/axes.hh index bb10a49952..f0f438af1f 100644 --- a/flower/include/axes.hh +++ b/flower/include/axes.hh @@ -3,33 +3,35 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2003 Han-Wen Nienhuys + (c) 1997--2005 Han-Wen Nienhuys */ #ifndef AXES_HH #define AXES_HH +#include + enum Axis { X_AXIS =0, Y_AXIS =1, NO_AXES=2, }; - -class String; - -String axis_name_string (Axis); - - -/** - the operator ++ for Axis. - */ -Axis other_axis (Axis); -Axis post_incr (Axis &); -Axis incr (Axis &); -//Axis operator++ (Axis); - - +static inline +Axis +incr (Axis &a) +{ + assert (a < NO_AXES); + a = Axis (int (a) + 1); + return a; +} + +static inline +Axis +other_axis (Axis a) +{ + return a == Y_AXIS ? X_AXIS : Y_AXIS; +} #endif // AXES_HH