1 /************************************************************************/
2 /*									*/
3 /*  Application inspector with different subject pages.			*/
4 /*									*/
5 /************************************************************************/
6 
7 #   ifndef	APP_INSPECTOR_H
8 #   define	APP_INSPECTOR_H
9 
10 #   include	<stdio.h>
11 
12 #   include	"appGuiBase.h"
13 #   include	"appFrame.h"
14 #   include	"appTool.h"
15 #   include	"guiOptionmenu.h"
16 
17 /************************************************************************/
18 /*									*/
19 /*  Facilities to make property inspectors.				*/
20 /*									*/
21 /************************************************************************/
22 
23 struct AppInspector;
24 
25 typedef void (*InspectorSubjectGotColor)(
26 			void *				through,
27 			int				property,
28 			const RGB8Color *		rgb8 );
29 
30 typedef void (*InspectorNotifySubject)(
31 			struct AppInspector *		ai,
32 			int				from,
33 			int				to );
34 
35 typedef struct InspectorSubject
36     {
37     APP_WIDGET			isPage;
38     APP_WIDGET			isMenuitem;
39     void *			isPrivate;
40     int				isEnabled;
41 
42     APP_WIDGET			isNextPrevRow;
43     APP_WIDGET				isPrevButton;
44     APP_WIDGET				isNextButton;
45 
46     APP_WIDGET			isMoveUpButton;
47     APP_WIDGET			isMoveDownButton;
48 
49     APP_WIDGET			isSelectButton;
50     APP_WIDGET			isDeleteButton;
51 
52     APP_WIDGET			isInsertButton;
53     APP_WIDGET			isAppendButton;
54 
55     APP_WIDGET			isApplyRow;
56     APP_WIDGET				isRevertButton;
57     APP_WIDGET				isApplyButton;
58 
59     InspectorSubjectGotColor	isGotColor;
60     } InspectorSubject;
61 
62 typedef struct AppInspector
63     {
64     struct EditApplication *	aiApplication;
65 
66     APP_WIDGET			aiTopWidget;
67     APP_WIDGET			aiPaned;
68 
69     AppOptionmenu		aiSubjectOptionmenu;
70 
71     APP_WIDGET			aiSeparator;
72     APP_WIDGET			aiPageParent;
73     APP_WIDGET			aiSeparator2;
74 
75     APP_WIDGET			aiCloseButton;
76 
77     InspectorNotifySubject	aiNotifySubject;
78 
79     void *			aiRgbChooser;		/*  RgbChooserPage */
80     int				aiRgbSubjectNumber;
81 
82     AppToolDestroy		aiDestroy;
83     void *			aiTarget;
84 
85     int				aiSubjectCount;
86     int				aiCurrentSubject;
87 
88     InspectorSubject *		aiSubjects;
89     } AppInspector;
90 
91 typedef struct AppInspectorResources
92     {
93     char *		airCloseText;
94     } AppInspectorResources;
95 
96 typedef struct InspectorSubjectResources
97     {
98     const char *	isrSubjectName;
99     const char *	isrApplyToSubject;
100     const char *	isrRevert;
101 
102     const char *	isrNextButtonText;
103     const char *	isrPrevButtonText;
104 
105     const char *	isrMoveDownButtonText;
106     const char *	isrMoveUpButtonText;
107 
108     const char *	isrSelectButtonText;
109     const char *	isrDeleteButtonText;
110 
111     const char *	isrInsertButtonText;
112     const char *	isrAppendButtonText;
113     } InspectorSubjectResources;
114 
115 /************************************************************************/
116 /*									*/
117 /*  Routine declarations.						*/
118 /*									*/
119 /************************************************************************/
120 
121 extern void appInspectorSelectSubject(	AppInspector *		ai,
122 					int			subject );
123 
124 extern void appFinishInspector(		AppInspector *		ai );
125 
126 extern void appEnableInspector(		AppInspector *		ai,
127 					int			enabled );
128 
129 extern void appEnableInspectorSubject(	AppInspector *		ai,
130 					int			subject ,
131 					int			enabled );
132 
133 extern void appInspectorGotColor(
134 				AppInspector *			ai,
135 				int				subjectPage,
136 				int				property,
137 				const RGB8Color *		rgb8 );
138 
139 extern void appInspectorShowRgbPage(	AppInspector *		ai,
140 					int			fromSubject,
141 					int			fromProperty,
142 					const RGB8Color *	rgb8 );
143 
144 extern void appInspectorSetRgbPage(	AppInspector *		ai,
145 					void *			vrcp,
146 					int			subject );
147 
148 extern int appInspectorAddSubject(	AppInspector *				ai,
149 				const InspectorSubjectResources *	isr );
150 
151 extern void appInspectorDeleteSubject(	AppInspector *		ai,
152 					int			subject );
153 
154 extern void appInspectorPageChosen(	int			subject,
155 					void *			vai );
156 
157 extern void appInspectorChoosePage(	AppInspector *		ai,
158 					int			andMenu,
159 					int			pageNumber );
160 
161 extern AppInspector * 	appMakeInspector(
162 				    EditApplication *		ea,
163 				    APP_WIDGET			option,
164 				    InspectorSubjectResources * isr,
165 				    int				subjectCount,
166 				    AppToolDestroy		closeInspector,
167 				    void *			through );
168 
169 extern void appInspectorMakePageParent( AppInspector *	ai );
170 
171 extern int appMakeVerticalInspectorPage(	APP_WIDGET *	pPage,
172 						APP_WIDGET *	pMenuitem,
173 						AppInspector *	ai,
174 						const char *	label );
175 
176 extern void appInspectorEnablePage(	AppInspector *	ai,
177 					int		pageNumber,
178 					int		enabled );
179 
180 #   endif
181