1 /************************************************************************/
2 /*									*/
3 /*  Border properties.							*/
4 /*									*/
5 /************************************************************************/
6 
7 #   ifndef	DOC_BORDER_PROP_H
8 #   define	DOC_BORDER_PROP_H
9 
10 #   include	<utilPropMask.h>
11 #   include	<utilColor.h>
12 #   include	<utilPalette.h>
13 
14 /************************************************************************/
15 /*									*/
16 /*  Border Styles: How they are drawn.					*/
17 /*									*/
18 /************************************************************************/
19 
20 typedef enum BorderStyle
21     {
22     DOCbsNONE= 0,
23     DOCbsS,
24     DOCbsTH,
25     DOCbsSH,
26 
27     DOCbsDB,
28     DOCbsHAIR,
29     DOCbsDOT,
30     DOCbsDASH,
31     DOCbsDASHD,
32     DOCbsDASHDD,
33     DOCbsTRIPLE,
34 
35     DOCbsTNTHSG,
36     DOCbsTHTNSG,
37     DOCbsTNTHTNSG,
38     DOCbsTNTHMG,
39     DOCbsTHTNMG,
40     DOCbsTNTHTNMG,
41     DOCbsTNTHLG,
42     DOCbsTHTNLG,
43     DOCbsTNTHTNLG,
44 
45     DOCbsWAVY,
46     DOCbsWAVYDB,
47     DOCbsDASHSM,
48     DOCbsDASHDOTSTR,
49     DOCbsEMBOSS,
50     DOCbsENGRAVE,
51     DOCbsFRAME,
52     DOCbsOUTSET,
53 
54     DOCbsTBL,
55     DOCbsNIL,
56 
57     DOCbs_COUNT
58     } BorderStyle;
59 
60 #   define	DOCisBORDER(bp) ( \
61 		    (bp)->bpStyle != DOCbsNONE && \
62 		    (bp)->bpStyle != DOCbsTBL && \
63 		    (bp)->bpStyle != DOCbsNIL )
64 
65 #   define BRDRW_MAX	75		/*  Maximum width		*/
66 #   define BRDRW_MAX2	(2*BRDRW_MAX)	/*  Maximum double width	*/
67 
68 typedef struct BorderProperties
69     {
70     unsigned char	bpColor;
71     unsigned char	bpPenWideTwips;
72     unsigned char	bpStyle;		/*  (enum)		*/
73     unsigned short	bpSpacingTwips;		/*  Only used for	*/
74 						/*  paragraph borders	*/
75     unsigned char	bpArt;
76 
77     } BorderProperties;
78 
79 typedef struct ExpandedBorderProperties
80     {
81     int			ebpColorExplicit;
82     RGB8Color		ebpColor;
83 
84     int			ebpPenWideTwips;
85     int			ebpStyle;
86     int			ebpSpacingTwips;
87     int			ebpArt;
88     } ExpandedBorderProperties;
89 
90 typedef enum BorderProperty
91     {
92     BRDRprop_NONE= -1,
93 
94     BRDRpropCOLOR= 0,
95     BRDRpropSPACING,
96     BRDRpropPEN_WIDE,
97     BRDRpropSTYLE,
98     BRDRpropART,
99 
100     BRDRprop_COUNT
101     } BorderProperty;
102 
103 #   define	docCleanBorderProperties( bp ) /*void*/
104 
105 /************************************************************************/
106 /*									*/
107 /*  Routine Declarations.						*/
108 /*									*/
109 /************************************************************************/
110 
111 extern void docInitBorderProperties(	BorderProperties *	bp );
112 
113 extern void docUpdateBorderProperties(
114 				    PropertyMask * 		pBpDoneMask,
115 				    BorderProperties *		bpTo,
116 				    const PropertyMask * 	bpSetMask,
117 				    const BorderProperties *	bpFrom );
118 
119 extern void docCopyBorderProperties(BorderProperties *		bpTo,
120 				    const BorderProperties *	bpFrom,
121 				    const int *			colorMap );
122 
123 extern int docBordersDiffer(	const BorderProperties *	bp1,
124 				const BorderProperties *	bp2,
125 				const int *			colorMap );
126 
127 extern void docExpandBorderProperties(
128 				ExpandedBorderProperties *	ebp,
129 				const BorderProperties *	bp,
130 				const ColorPalette *		cp );
131 
132 extern int docIndirectBorderProperties(
133 			PropertyMask *				pBpDoneMask,
134 			BorderProperties *			bp,
135 			const PropertyMask * 			bpSetMask,
136 			const ExpandedBorderProperties *	ebp,
137 			ColorPalette *				cp );
138 
139 extern void docInitExpandedBorderProperties(
140 				ExpandedBorderProperties *	ebp );
141 
142 extern int docBorderThick(	int *				pWide,
143 				const BorderProperties *	bp );
144 
145 extern void docStretchInsetForBorder(	int *				pInset,
146 					const BorderProperties *	bp );
147 
148 extern void docAddBorderToInset(	int *				pInset,
149 					const BorderProperties *	bp );
150 
151 extern int docSetBorderProperty(	BorderProperties *	bp,
152 					int			prop,
153 					int			arg );
154 
155 extern int docGetBorderProperty(	const BorderProperties * bp,
156 					int			prop );
157 
158 #   endif	/*  DOC_BORDER_PROP_H  */
159