File: appColorChooser.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 (139 lines) | stat: -rw-r--r-- 3,448 bytes parent folder | download | duplicates (2)
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/************************************************************************/
/*									*/
/*  Simple color chooser on an inspector page.				*/
/*									*/
/************************************************************************/

#   ifndef	APP_COLOR_CHOOSER_H
#   define	APP_COLOR_CHOOSER_H

#   include	<appGuiBase.h>
#   include	<appDraw.h>

struct ColorChooser;

typedef void (*ColorChooserCallback)(
				struct ColorChooser *		cc,
				int				which,
				void *				through,
				int				choice,
				const RGB8Color *		rgb8 );

typedef struct ColorChooserResources
    {
    char *	ccrAutomaticColor;
    char *	ccrMoreColors;
    } ColorChooserResources;

typedef struct ColorChooserPaletteColor
    {
    RGB8Color		ccpcRGB8Color;
    APP_COLOR_RGB	ccpcAllocatedColor;
    int			ccpcColorAllocated;
    int			ccpcStatus;
    } ColorChooserPaletteColor;

#   define	CCstatusFREE	0
#   define	CCstatusSYSTEM	1
#   define	CCstatusPALETTE	2

typedef struct ColorChooser
    {
    int					ccFilled;

    const ColorChooserResources *	ccResources;

    AppDrawnPulldown			ccPulldown;
    AppDrawingData			ccInplaceDrawingData;
    AppDrawingData			ccPulldownDrawingData;
    int					ccPulldownDrawingDataSet;
    APP_COLOR_RGB			ccPulldownBackgroundColor;

    AppColors				ccInplaceColors;
    AppColors				ccPulldownColors;

    int					ccInplaceColorAllocated;
    APP_COLOR_RGB			ccInplaceColor;
    APP_FONT *				ccTextFont;

    RGB8Color				ccColorChosen;
    int					ccColorExplicit;
    int					ccColorSet;

    ColorChooserCallback		ccCallback;
    void *				ccTarget;
    int					ccWhich;

    int					ccStripHigh;
    int					ccColumnWide;
    int					ccStrips;
    int					ccColumns;
    int					ccXShift;

    ColorChooserPaletteColor *		ccColors;
    int					ccColorCount;
    } ColorChooser;

typedef enum ColorChooserChoice
    {
    CHOICEccDEFAULT= 0,
    CHOICEccCOLOR,
    CHOICEccMORE,

    CHOICEcc_COUNT
    } ColorChooserChoice;

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

extern void appColorChooserSetColor(	ColorChooser *		cc,
					int			explicit,
					const RGB8Color *	rgb8 );

extern void appColorChooserUnset(	ColorChooser *		cc );

extern void appColorChooserSuggestPalette(
					ColorChooser *		cc,
					int			avoidZero,
					const RGB8Color *	colors,
					int			colorCount );

extern void appMakeColorChooserInRow(
				ColorChooser *			cc,
				APP_WIDGET			row,
				int				col,
				const ColorChooserResources *	ccr,
				ColorChooserCallback		callback,
				int				which,
				void *				through );

extern void appInitColorChooser(	ColorChooser *		cc );
extern void appCleanColorChooser(	ColorChooser *		cc );

extern void appMakeLabelAndColorChooserRow(
				APP_WIDGET *			pRow,
				APP_WIDGET *			pLabel,
				ColorChooser *			cc,
				APP_WIDGET			column,
				const char *			labelText,
				const ColorChooserResources *	ccr,
				ColorChooserCallback		callback,
				int				which,
				void *				through );

extern void appFinishColorChooser(
				ColorChooser *			cc,
				APP_FONT *			textFont );

extern void appColorChooserColorChosen(	PropertyMask *		isSetMask,
					int *			pChanged,
					RGB8Color *		rgb8To,
					int *			pExplicit,
					const RGB8Color *	rgb8Set,
					int			explicit,
					int			which );

#   endif	/*  APP_COLOR_CHOOSER_H */