1 /************************************************************************/ 2 /* */ 3 /* Various definitions relating to document geometry. */ 4 /* */ 5 /************************************************************************/ 6 7 # ifndef UTIL_DOCUMENT_GEOMETRY_H 8 # define UTIL_DOCUMENT_GEOMETRY_H 9 10 # include "utilPropMask.h" 11 # include "geo2DInteger.h" 12 13 typedef struct DocumentGeometry 14 { 15 int dgPageWideTwips; 16 int dgPageHighTwips; 17 18 int dgLeftMarginTwips; 19 int dgTopMarginTwips; 20 int dgRightMarginTwips; 21 int dgBottomMarginTwips; 22 23 int dgHeaderPositionTwips; 24 int dgFooterPositionTwips; 25 26 int dgGutterTwips; 27 unsigned char dgMirrorMargins; 28 } DocumentGeometry; 29 30 /************************************************************************/ 31 /* */ 32 /* Update masks for document geometry. */ 33 /* */ 34 /* NOTE: This range is continued in Ted/docBuf.h for the section and */ 35 /* document properties. Adding a bit here may make it necessary to */ 36 /* shift the masks there as well. */ 37 /* */ 38 /************************************************************************/ 39 40 typedef enum GeometryProperty 41 { 42 DGprop_NONE= -1, 43 44 DGpropPAGE_WIDTH= 0, 45 DGpropPAGE_HEIGHT, 46 DGpropLEFT_MARGIN, 47 DGpropRIGHT_MARGIN, 48 DGpropTOP_MARGIN, 49 DGpropBOTTOM_MARGIN, 50 DGpropHEADER_POSITION, 51 DGpropFOOTER_POSITION, 52 DGpropGUTTER, 53 DGpropMARGMIR, 54 55 DGprop_COUNT 56 } GeometryProperty; 57 58 /************************************************************************/ 59 /* */ 60 /* Routine declarations. */ 61 /* */ 62 /************************************************************************/ 63 64 extern void utilInitDocumentGeometry( DocumentGeometry * dg ); 65 66 extern void utilUpdDocumentGeometry( 67 PropertyMask * dpDoneMask, 68 DocumentGeometry * dgTo, 69 const PropertyMask * dgSetMask, 70 const DocumentGeometry * dgSet ); 71 72 extern void utilDocumentGeometryGetBodyRect( 73 DocumentRectangle * dr, 74 const DocumentGeometry * dg ); 75 76 extern void utilDocumentGeometryGetHeaderRect( 77 DocumentRectangle * dr, 78 const DocumentGeometry * dg ); 79 80 extern void utilDocumentGeometryGetFooterRect( 81 DocumentRectangle * dr, 82 const DocumentGeometry * dg ); 83 84 extern void utilDocumentGeometryGetPageBoundingBox( 85 DocumentRectangle * dr, 86 const DocumentGeometry * dg, 87 int hasHeader, 88 int hasFooter ); 89 90 extern void utilOverridePaperSize( 91 DocumentGeometry * dgTo, 92 const DocumentGeometry * dgFrom ); 93 94 # endif 95