1 /************************************************************************/
2 /*									*/
3 /*  Picture Properties.							*/
4 /*									*/
5 /************************************************************************/
6 
7 #   ifndef	DOC_PICTURE_PROPERTIES_H
8 #   define	DOC_PICTURE_PROPERTIES_H
9 
10 #   include	<utilPropMask.h>
11 
12 /************************************************************************/
13 /*									*/
14 /*  Properties of a picture.						*/
15 /*									*/
16 /************************************************************************/
17 
18 typedef struct PictureProperties
19     {
20     unsigned char	pipType;
21     signed char		pipMapMode;
22 
23     int			pip_xWinExt;	/*  Of metafile picture.	*/
24     int			pip_yWinExt;	/*  Of metafile picture.	*/
25 
26 					/********************************/
27     int			pipTwipsWide;	/*  Width of object.		*/
28     int			pipTwipsHigh;	/*  Height of object.		*/
29 					/*  NOTE: this is a property of	*/
30 					/*  the image. Not of the way	*/
31 					/*  in which it is included.	*/
32 					/*  That is controlled by the	*/
33 					/*  scale.			*/
34 					/********************************/
35 
36     int			pipScaleXSet;
37     int			pipScaleYSet;
38     int			pipScaleXUsed;
39     int			pipScaleYUsed;
40 
41     int			pipTopCropTwips;
42     int			pipBottomCropTwips;
43     int			pipLeftCropTwips;
44     int			pipRightCropTwips;
45 
46     unsigned long	pipBliptag;
47 
48     int			pipMetafileBitmapBpp;
49     int			pipBmUnitsPerInch;
50     int			pipBmBitsPerPixel;
51     int			pipBmPlanes;
52     int			pipBmBytesPerRow;
53 
54     unsigned int	pipPictureIsWordArt:1;
55     unsigned int	pipMetafileIsBitmap:1;
56     unsigned int	pipPictIsScaled:1;
57     } PictureProperties;
58 
59 #   define docPictureIsCropped(pip) ( \
60 		(pip)->pipLeftCropTwips > 0	|| \
61 		(pip)->pipRightCropTwips > 0	|| \
62 		(pip)->pipTopCropTwips > 0	|| \
63 		(pip)->pipBottomCropTwips > 0	)
64 
65 /************************************************************************/
66 /*									*/
67 /*  Numbers of picture properies.					*/
68 /*									*/
69 /************************************************************************/
70 
71 typedef enum PictureProperty
72     {
73     PIPpropTYPE= 0,
74 
75     PIPpropPICX_WIN_EXT,
76     PIPpropPICY_WIN_EXT,
77 
78     PIPpropPICTWIPS_WIDE,
79     PIPpropPICTWIPS_HIGH,
80 
81     PIPpropPICSCALE_X,
82     PIPpropPICSCALE_Y,
83 
84     PIPpropPICCROP_TOP,
85     PIPpropPICCROP_BOTTOM,
86     PIPpropPICCROP_LEFT,
87     PIPpropPICCROP_RIGHT,
88 
89     PIPpropBLIPTAG,
90 
91     PIPpropPICBPP,
92     PIPpropBLIPUPI,
93     PIPpropWBMBITSPIXEL,
94     PIPpropWBMPLANES,
95     PIPpropWBMWIDTHBYTES,
96 
97     PIPpropDEFSHP,
98     PIPpropPICBMP,
99     PIPpropPICSCALED,
100 
101     PIPprop_COUNT
102     } PictureProperty;
103 
104 /************************************************************************/
105 
106 # define PICshpSHPPICT		0
107 # define PICshpNONSHPPICT	1
108 # define PICshpPICT		2
109 
110 /************************************************************************/
111 /*									*/
112 /*  Routine declarations.						*/
113 /*									*/
114 /************************************************************************/
115 
116 extern void docInitPictureProperties(	PictureProperties *	pip );
117 
118 extern int docUpdPictureProperties(
119 				PropertyMask *			pDoneMask,
120 				PictureProperties *		pipTo,
121 				const PropertyMask *		pipUpdMask,
122 				const PictureProperties *	pipFrom );
123 
124 extern void docPicturePropertyDifference(
125 				PropertyMask *			pDifMask,
126 				const PictureProperties *	pip1,
127 				const PropertyMask *		cmpMask,
128 				const PictureProperties *	pip2 );
129 
130 extern int docSetPictureProperty(	PictureProperties *	pip,
131 					int			prop,
132 					int			val );
133 
134 extern int docGetPictureProperty(	const PictureProperties *	pip,
135 					int				prop );
136 
137 #   endif	/*  DOC_PICTURE_PROPERTIES_H	*/
138