1 /************************************************************************/
2 /*									*/
3 /*  Declarations for shapes.						*/
4 /*									*/
5 /*  Distances are in EMU's.						*/
6 /*  12700 EMU/Point.							*/
7 /*  635 EMU/Twip.							*/
8 /*  914400 EMU/Inch.							*/
9 /*  360000 EMU/cm.							*/
10 /*									*/
11 /*  With the exception of 'shplid', the ShapeProperties that come from	*/
12 /*  regular rtf only apply for the top level 'shp' or shpgrp'.		*/
13 /*									*/
14 /************************************************************************/
15 
16 #   ifndef	DOC_SHAPE_H
17 #   define	DOC_SHAPE_H
18 
19 struct DrawingSurface;
20 
21 #   include	<utilColor.h>
22 #   include	<geo2DInteger.h>
23 #   include	<utilMemoryBuffer.h>
24 #   include	<geoAffineTransform.h>
25 #   include	<docShapeProperties.h>
26 #   include	<docPictureProperties.h>
27 #   include	"docDocumentTree.h"
28 #   include	<docShapeDrawing.h>
29 #   include	<bitmap.h>
30 
31 typedef struct DrawingShape
32     {
33 			/************************************************/
34 			/*  Properties as found in regular rtf tags.	*/
35 			/*  Are only set for the top level shape in a	*/
36 			/*  hierarchy.					*/
37 			/************************************************/
38     ShapeProperties	dsShapeProperties;
39 
40 			/************************************************/
41 			/*  Position.					*/
42 			/************************************************/
43     unsigned char	dsIsChildShape;
44 
45 			/************************************************/
46 			/*  Drawing.					*/
47 			/************************************************/
48     ShapeDrawing	dsDrawing;
49 
50 			/************************************************/
51 			/*  Embedding in the document.			*/
52 			/************************************************/
53     int				dsShapeNumber;
54     SelectionScope		dsSelectionScope;
55     DocumentTree		dsDocumentTree;
56     struct DrawingShape **	dsChildren;
57     int				dsChildCount;
58 
59     PictureProperties		dsPictureProperties;
60     MemoryBuffer		dsPictureData;
61     struct DrawingSurface *	dsDrawingSurface;
62     RasterImage			dsRasterImage;
63 
64     } DrawingShape;
65 
66 # define DSflipHORIZONTAL( ds ) \
67     ( ( (ds)->dsIsChildShape && (ds)->dsDrawing.sd_fRelFlipH ) || (ds)->dsDrawing.sd_fFlipH )
68 
69 # define DSflipVERTICAL( ds ) \
70     ( ( (ds)->dsIsChildShape && (ds)->dsDrawing.sd_fRelFlipV ) || (ds)->dsDrawing.sd_fFlipV )
71 
72 /************************************************************************/
73 /*									*/
74 /*  Routine declarations.						*/
75 /*									*/
76 /************************************************************************/
77 
78 void docInitShapeAllocated(		DrawingShape *		ds );
79 extern void docInitDrawingShape(	DrawingShape *		ds );
80 extern void docCleanDrawingShape(	DrawingShape *		ds );
81 
82 extern void docDeleteDrawingShape(	struct BufferDocument *	bd,
83 					DrawingShape *		ds );
84 
85 extern void docShapeStartShapeTransform(
86 				AffineTransform2D *		at,
87 				const DrawingShape *		ds,
88 				const DocumentRectangle *	dr,
89 				int				xSize,
90 				int				ySize );
91 
92 extern void docShapeInternalTransform(	AffineTransform2D *	at,
93 					const DrawingShape *	ds );
94 
95 extern int docShapeGetFill(	int *			pFill,
96 				RGB8Color *		rgb8,
97 				const DrawingShape *	ds );
98 
99 extern int docShapeGetLine(	int *			pFill,
100 				RGB8Color *		rgb8,
101 				const DrawingShape *	ds );
102 
103 extern void docShapeGetRects(	DocumentRectangle *		drHere,
104 				DocumentRectangle *		drNorm,
105 				const DocumentRectangle *	drTwips,
106 				const DrawingShape *		ds );
107 
108 extern void docShapeGetChildRect(
109 				DocumentRectangle *		drChild,
110 				const DrawingShape *		dsChild,
111 				const DocumentRectangle *	dr,
112 				const DrawingShape *		ds );
113 
114 #   endif	/*  DOC_SHAPE_H	*/
115