X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fdimensions.hh;h=bc93a975ae590015457352db62bb3f9bd9ba450c;hb=fce447b68f92a29ba4a94f45fb134c15b90ae121;hp=777d80e89c001fd3e81b7fa2dab29818bafee567;hpb=59ed0cee2aae58a3f0483f21261c68aee406fa10;p=lilypond.git diff --git a/lily/include/dimensions.hh b/lily/include/dimensions.hh index 777d80e89c..bc93a975ae 100644 --- a/lily/include/dimensions.hh +++ b/lily/include/dimensions.hh @@ -2,17 +2,48 @@ #define DIMENSIONS_HH #include "real.hh" -#include "string.hh" +class String; -const Real INCH_TO_PT=72.270; -const Real CM_TO_PT=INCH_TO_PT/2.54; -const Real MM_TO_PT=CM_TO_PT/10; -const Real PT_TO_PT =1.0; -#define PT *PT_TO_PT -#define MM *MM_TO_PT -#define CM *CM_TO_PT -#define INCH *INCH_TO_PT +const Real INCH_TO_PT = 72.270; +const Real CM_TO_PT = (INCH_TO_PT / 2.54); +const Real MM_TO_PT = (CM_TO_PT / 10); +const Real PT_TO_PT = 1.0; +const Real INCH_TO_BP = 72; +const Real BIGPOINT_TO_POINT = (INCH_TO_PT / INCH_TO_BP); +const Real CHAR_TO_PT = 1.0; +const Real PT_TO_MM = (1.0 / MM_TO_PT); -#endif // DIMENSIONS_HH +#ifdef POINTS + +#define INTERNAL_UNIT "pt" + +#define PT * (PT_TO_PT) +#define MM * (MM_TO_PT) +#define CM * (CM_TO_PT) +#define INCH * (INCH_TO_PT) +#define BIGPOINT * (BIGPOINT_TO_POINT) +#define CHAR * (CHAR_TO_PT) + +#else // mm + +#define INTERNAL_UNIT "mm" + +#define PT * (PT_TO_PT * PT_TO_MM) +#define MM * (MM_TO_PT * PT_TO_MM) +#define CM * (CM_TO_PT *PT_TO_MM) +#define INCH * (INCH_TO_PT * PT_TO_MM) +#define BIGPOINT * (BIGPOINT_TO_POINT * PT_TO_MM) +#define CHAR * (CHAR_TO_PT * PT_TO_MM) + +#endif + +String print_dimen (Real); +const Real point_constant = 1 PT; +const Real inch_constant = 1 INCH; +const Real cm_constant = 1 CM; +const Real mm_constant = 1 MM; +const Real bigpoint_constant = 1 BIGPOINT; + +#endif /* DIMENSIONS_HH */