File: docItemShading.h

package info (click to toggle)
ted 2.16-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,944 kB
  • ctags: 20,273
  • sloc: ansic: 167,980; makefile: 12,518; sh: 263
file content (125 lines) | stat: -rw-r--r-- 3,157 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/************************************************************************/
/*									*/
/*  Item Shading.							*/
/*									*/
/************************************************************************/

#   ifndef	DOC_ITEM_SHADING_H
#   define	DOC_ITEM_SHADING_H

#   include	"utilPropMask.h"
#   include	<bmcolor.h>

typedef enum ShadingPattern
    {
    DOCspSOLID= 0,

    DOCspBGHORIZ,
    DOCspBGVERT,
    DOCspBGFDIAG,
    DOCspBGBDIAG,
    DOCspBGCROSS,
    DOCspBGDCROSS,
    DOCspBGDKHORIZ,
    DOCspBGDKVERT,
    DOCspBGDKFDIAG,
    DOCspBGDKBDIAG,
    DOCspBGDKCROSS,
    DOCspBGDKDCROSS,

    DOCsp_COUNT
    } ShadingPattern;

#   define DOCsp_BITS	4

/************************************************************************/
/*									*/
/*  1)  The shading of a BufferItem such as a table cell or a		*/
/*	paragraph.							*/
/*  2)  Numbers for the properties.					*/
/*  3)  Expanded form of the shading for the use in tools. (Remove the	*/
/*	indirection via the palette).					*/
/*									*/
/************************************************************************/

/*  1  */
typedef struct ItemShading
    {
    short		isBackColor;
    short		isForeColor;

    unsigned int	isLevel:14;
    unsigned int	isPattern:DOCsp_BITS;
    } ItemShading;

/*  2  */
typedef enum ShadingProperty
    {
    ISprop_NONE= -1,

    ISpropBACK_COLOR= 0,
    ISpropFORE_COLOR,
    ISpropLEVEL,
    ISpropPATTERN,

    ISprop_COUNT
    } ShadingProperty;

/*  3  */
typedef struct ExpandedItemShading
    {
    int			eisBackColorExplicit;
    int			eisForeColorExplicit;
    RGB8Color		eisBackColor;
    RGB8Color		eisForeColor;

    unsigned int	eisLevel;
    unsigned int	eisPattern;
    } ExpandedItemShading;

#   define	docCopyItemShading( is1, is2 ) *(is1)= *(is2)
#   define	docCleanItemShading( is ) /*void*/

/************************************************************************/
/*									*/
/*  Routine declarations.						*/
/*									*/
/************************************************************************/

extern void docInitItemShading(		ItemShading *		is );
extern void docInitExpandedItemShading(	ExpandedItemShading *	eis );

extern void docUpdateItemShading(
				PropertyMask *			pIsDoneMask,
				ItemShading *			isTo,
				const PropertyMask *		isSetMask,
				const ItemShading *		isFrom,
				const int *			colorMap );

extern void docUpdateExpandedItemShading(
				PropertyMask *			pIsDoneMask,
				ExpandedItemShading *		eisTo,
				const PropertyMask *		isSetMask,
				const ExpandedItemShading *	eisFrom );

extern void docExpandItemShading(	ExpandedItemShading *	eis,
					const ItemShading *	is,
					const RGB8Color *	colors,
					int			colorCount );

extern int docIndirectItemShading(
				PropertyMask *			pDoneMask,
				ItemShading *			is,
				const PropertyMask *		setMask,
				const ExpandedItemShading *	eis,
				RGB8Color **			pColors,
				int *				pColorCount );

extern void docItemShadingDifference(
				PropertyMask *			pIsUpdMask,
				const ItemShading *		isTo,
				const ItemShading *		isFrom,
				const PropertyMask *		isSetMask,
				const int *			colorMap );

#   endif	/*  DOC_ITEM_SHADING_H  */