1 #ifndef AFTERCONF_H_FILE_INCLUDED
2 #define AFTERCONF_H_FILE_INCLUDED
3 
4 #include "../libAfterImage/asvisual.h"
5 #include "../libAfterStep/clientprops.h"
6 #include "../libAfterStep/colorscheme.h"
7 #include "../libAfterStep/mylook.h"
8 #include "../libAfterStep/aswindata.h"
9 #include "../libAfterStep/freestor.h"
10 
11 #include "keyword_macro.h"
12 
13 /***************************************************************************/
14 /*                        ASFunction parsing definitions                   */
15 /*                        this must go first as it is relying on IDs       */
16 /*                        defined in functions.h                           */
17 /****************************************************************************/
18 
19 #ifndef NorthWestGravity
20 #include <X11/Xlib.h>
21 #endif
22 
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 struct ASImageManager;
29 struct ASFontManager;
30 struct SyntaxDef;
31 struct MyLook;
32 struct ASWindowBox ;
33 struct FreeStorageElem;
34 struct ConfigDef;
35 struct FunctionData;
36 struct ComplexFunction;
37 struct ConfigItem;
38 struct ASColorScheme;
39 struct ConfigDef;
40 struct FreeStorageElem;
41 struct ASCategoryTree;
42 struct wild_reg_exp;
43 
44 extern struct SyntaxDef      BevelSyntax;
45 extern struct SyntaxDef      AlignSyntax;
46 extern struct SyntaxDef     *BevelSyntaxPtr;
47 
48 /* All top level syntax definitions are listed below : */
49 extern struct SyntaxDef      ArrangeSyntax;  /* really is an empty syntax */
50 extern struct SyntaxDef      AnimateSyntax;
51 extern struct SyntaxDef      SoundSyntax;
52 extern struct SyntaxDef      BaseSyntax;
53 extern struct SyntaxDef      CleanSyntax;
54 extern struct SyntaxDef      ColorSyntax;
55 extern struct SyntaxDef      DatabaseSyntax;
56 extern struct SyntaxDef      FeelSyntax;
57 extern struct SyntaxDef 	 FunctionSyntax;
58 extern struct SyntaxDef 	 PopupSyntax;
59 extern struct SyntaxDef 	 includeSyntax;
60 
61 extern struct SyntaxDef      WindowBoxSyntax;
62 extern struct SyntaxDef		 ThemeSyntax;
63 extern struct SyntaxDef     SupportedHintsSyntax;
64 
65 extern struct SyntaxDef      AutoExecSyntax;
66 extern struct SyntaxDef      LookSyntax;
67 extern struct SyntaxDef 	 AfterStepLookSyntax;
68 extern struct SyntaxDef 	 ModuleMyStyleSyntax;
69 extern struct SyntaxDef 	 AfterStepMyFrameSyntax;
70 extern struct SyntaxDef 	 AfterStepMyBackSyntax;
71 extern struct SyntaxDef 	 AfterStepTitleButtonSyntax;
72 
73 extern struct SyntaxDef 	 AfterStepFeelSyntax;
74 extern struct SyntaxDef 	 AfterStepCursorSyntax;
75 extern struct SyntaxDef 	 AfterStepMouseSyntax;
76 extern struct SyntaxDef 	 AfterStepKeySyntax;
77 extern struct SyntaxDef 	 AfterStepWindowBoxSyntax;
78 
79 extern struct SyntaxDef 	 AfterStepSyntax;
80 
81 extern struct SyntaxDef      PagerSyntax;
82 extern struct SyntaxDef      PagerPrivateSyntax;
83 extern struct SyntaxDef      PagerLookSyntax;
84 extern struct SyntaxDef      PagerFeelSyntax;
85 extern struct SyntaxDef		 WharfFeelSyntax;
86 extern struct SyntaxDef		 WharfLookSyntax;
87 extern struct SyntaxDef		 WharfPrivateSyntax;
88 extern struct SyntaxDef 	 WharfFolderSyntax;
89 extern struct SyntaxDef 	 WharfSyntax;
90 extern struct SyntaxDef      WinCommandSyntax;
91 extern struct SyntaxDef      WinListSyntax;
92 extern struct SyntaxDef      WinListPrivateSyntax;
93 extern struct SyntaxDef      WinListLookSyntax;
94 extern struct SyntaxDef      WinListFeelSyntax;
95 extern struct SyntaxDef      WinTabsSyntax;
96 extern struct SyntaxDef      PopupFuncSyntax;
97 
98 extern struct SyntaxDef      BalloonContentsSyntax;
99 extern struct SyntaxDef     *BalloonContentsSyntaxPtr;
100 
101 extern struct SyntaxDef      ASMountSyntax;
102 extern struct SyntaxDef      ASMountPrivateSyntax;
103 extern struct SyntaxDef      ASMountLookSyntax;
104 extern struct SyntaxDef      ASMountFeelSyntax;
105 
106 /* misc function stuff : */
107 #define FUNC_ID_START           F_NOP   /* 0 */
108 #define FUNC_ID_END           	F_FUNCTIONS_NUM
109 
110 extern struct SyntaxDef *pFuncSyntax;
111 extern struct SyntaxDef DummyFuncSyntax;
112 
113 /* used in some "special" function to correctly process trailing function definition */
114 unsigned long TrailingFuncSpecial (struct ConfigDef * config, int skip_tokens);
115 
116 struct FreeStorageElem **Func2FreeStorage (struct SyntaxDef * syntax,
117 				    struct FreeStorageElem ** tail,
118 				    struct FunctionData * func);
119 
120 struct TermDef          *txt2fterm (const char *txt, int quiet);
121 struct TermDef          *func2fterm (FunctionCode func, int quiet);
122 struct FunctionData     *String2Func ( const char *string, struct FunctionData *p_fdata, Bool quiet );
123 
124 
125 #define CONFIG_ID_START					(FUNC_ID_END+1)
126 #define CONFIG_root_ID					CONFIG_ID_START
127 #define CONFIG_Base_ID					(CONFIG_ID_START+1)
128 #define CONFIG_ColorScheme_ID			(CONFIG_ID_START+2)
129 #define CONFIG_Functions_ID				(CONFIG_ID_START+3)
130 #define CONFIG_Popups_ID				(CONFIG_ID_START+4)
131 #define CONFIG_Database_ID				(CONFIG_ID_START+5)
132 #define CONFIG_Module_ID				(CONFIG_ID_START+6)
133 
134 #define CONFIG_MODULE_TYPES				(CONFIG_ID_START+7)
135 #define CONFIG_AfterStep_ID				(CONFIG_MODULE_TYPES)
136 #define CONFIG_Pager_ID					(CONFIG_MODULE_TYPES+1)
137 #define CONFIG_Wharf_ID					(CONFIG_MODULE_TYPES+2)
138 #define CONFIG_WinList_ID				(CONFIG_MODULE_TYPES+3)
139 #define CONFIG_ASMount_ID				(CONFIG_MODULE_TYPES+4)
140 
141 
142 #define CONFIG_MODULE_SPECIFIC			(CONFIG_MODULE_TYPES+5)
143 #define CONFIG_AfterStepLook_ID			(CONFIG_MODULE_SPECIFIC)
144 #define CONFIG_AfterStepFeel_ID			(CONFIG_MODULE_SPECIFIC+1)
145 #define CONFIG_PagerLook_ID 			(CONFIG_MODULE_SPECIFIC+2)
146 #define CONFIG_PagerFeel_ID				(CONFIG_MODULE_SPECIFIC+3)
147 #define CONFIG_WharfLook_ID 			(CONFIG_MODULE_SPECIFIC+4)
148 #define CONFIG_WharfFeel_ID				(CONFIG_MODULE_SPECIFIC+5)
149 #define CONFIG_WharfFolders_ID 			(CONFIG_MODULE_SPECIFIC+6)
150 #define CONFIG_WinListLook_ID 			(CONFIG_MODULE_SPECIFIC+7)
151 #define CONFIG_WinListFeel_ID 			(CONFIG_MODULE_SPECIFIC+8)
152 #define CONFIG_ASMountLook_ID 			(CONFIG_MODULE_SPECIFIC+9)
153 #define CONFIG_ASMountFeel_ID 			(CONFIG_MODULE_SPECIFIC+10)
154 
155 
156 #define CONFIG_FILE_IDS			   		(CONFIG_MODULE_SPECIFIC+11)
157 #define CONFIG_LookFile_ID				(CONFIG_FILE_IDS)
158 #define CONFIG_FeelFile_ID 				(CONFIG_FILE_IDS+1)
159 #define CONFIG_StartDir_ID 				(CONFIG_FILE_IDS+2)
160 #define CONFIG_AutoExecFile_ID 			(CONFIG_FILE_IDS+3)
161 #define CONFIG_PagerFile_ID 			(CONFIG_FILE_IDS+4)
162 #define CONFIG_WharfFile_ID 			(CONFIG_FILE_IDS+5)
163 #define CONFIG_WinListFile_ID 			(CONFIG_FILE_IDS+6)
164 #define CONFIG_AfterStepFile_ID	 		(CONFIG_FILE_IDS+7)
165 #define CONFIG_BaseFile_ID				(CONFIG_FILE_IDS+8)
166 #define CONFIG_ColorSchemeFile_ID		(CONFIG_FILE_IDS+9)
167 #define CONFIG_DatabaseFile_ID			(CONFIG_FILE_IDS+10)
168 #define CONFIG_IncludeFile_ID			(CONFIG_FILE_IDS+11)
169 #define CONFIG_ASMountFile_ID 			(CONFIG_FILE_IDS+12)
170 
171 
172 #define CONFIG_FILES_IDS			    (CONFIG_FILE_IDS+13)
173 #define CONFIG_FunctionsFiles_ID		(CONFIG_FILES_IDS)
174 #define CONFIG_PopupsFiles_ID			(CONFIG_FILES_IDS+1)
175 #define CONFIG_LookFiles_ID				(CONFIG_FILES_IDS+2)
176 #define CONFIG_FeelFiles_ID				(CONFIG_FILES_IDS+3)
177 #define CONFIG_BackgroundFiles_ID		(CONFIG_FILES_IDS+4)
178 #define CONFIG_PrivateFiles_ID			(CONFIG_FILES_IDS+5)
179 #define CONFIG_SharedFiles_ID			(CONFIG_FILES_IDS+6)
180 
181 #define CONFIG_OPTIONS_IDS			    (CONFIG_FILES_IDS+7)
182 #define CONFIG_BaseOptions_ID			(CONFIG_OPTIONS_IDS)
183 #define CONFIG_ColorSchemeOptions_ID 	(CONFIG_OPTIONS_IDS+1)
184 #define CONFIG_MyStyles_ID				(CONFIG_OPTIONS_IDS+2)
185 #define CONFIG_MyFrames_ID				(CONFIG_OPTIONS_IDS+3)
186 #define CONFIG_MyBackgrounds_ID		 	(CONFIG_OPTIONS_IDS+4)
187 #define CONFIG_TitleButtons_ID		 	(CONFIG_OPTIONS_IDS+5)
188 #define CONFIG_Cursors_ID	  			(CONFIG_OPTIONS_IDS+6)
189 #define CONFIG_MouseBindings_ID			(CONFIG_OPTIONS_IDS+7)
190 #define CONFIG_KeyBindings_ID			(CONFIG_OPTIONS_IDS+8)
191 #define CONFIG_WindowBoxes_ID			(CONFIG_OPTIONS_IDS+9)
192 #define CONFIG_LookOptions_ID		 	(CONFIG_OPTIONS_IDS+10)
193 #define CONFIG_FeelOptions_ID			(CONFIG_OPTIONS_IDS+11)
194 #define CONFIG_AfterStepOptions_ID		(CONFIG_OPTIONS_IDS+12)
195 #define CONFIG_PagerOptions_ID			(CONFIG_OPTIONS_IDS+13)
196 #define CONFIG_WharfOptions_ID			(CONFIG_OPTIONS_IDS+14)
197 #define CONFIG_WinListOptions_ID		(CONFIG_OPTIONS_IDS+15)
198 #define CONFIG_Balloons_ID				(CONFIG_OPTIONS_IDS+16)
199 #define CONFIG_ASMountOptions_ID		(CONFIG_OPTIONS_IDS+17)
200 
201 
202 #define CONFIG_SUBOPTIONS_IDS	   	    (CONFIG_OPTIONS_IDS+18)
203 #define CONFIG_flags_ID					(CONFIG_SUBOPTIONS_IDS)
204 #define CONFIG_x_ID						(CONFIG_SUBOPTIONS_IDS+1)
205 #define CONFIG_y_ID						(CONFIG_SUBOPTIONS_IDS+2)
206 #define CONFIG_width_ID					(CONFIG_SUBOPTIONS_IDS+3)
207 #define CONFIG_height_ID 				(CONFIG_SUBOPTIONS_IDS+4)
208 
209 #define CONFIG_type_ID	 				(CONFIG_SUBOPTIONS_IDS+5)
210 #define CONFIG_tint_ID	 				(CONFIG_SUBOPTIONS_IDS+6)
211 #define CONFIG_pixmap_ID 				(CONFIG_SUBOPTIONS_IDS+7)
212 
213 #define CONFIG_hotkey_ID				(CONFIG_SUBOPTIONS_IDS+8)
214 #define CONFIG_text_ID					(CONFIG_SUBOPTIONS_IDS+9)
215 #define CONFIG_value_ID					(CONFIG_SUBOPTIONS_IDS+10)
216 #define CONFIG_unit_ID					(CONFIG_SUBOPTIONS_IDS+11)
217 
218 #define CONFIG_unpressed_ID				(CONFIG_SUBOPTIONS_IDS+12)
219 #define CONFIG_pressed_ID 				(CONFIG_SUBOPTIONS_IDS+13)
220 
221 #define CONFIG_source_ID 				(CONFIG_SUBOPTIONS_IDS+14)
222 #define CONFIG_context_ID 				(CONFIG_SUBOPTIONS_IDS+15)
223 #define CONFIG_mod_ID		 			(CONFIG_SUBOPTIONS_IDS+16)
224 
225 #define CONFIG_left_ID	  				(CONFIG_SUBOPTIONS_IDS+17)
226 #define CONFIG_right_ID	  				(CONFIG_SUBOPTIONS_IDS+18)
227 #define CONFIG_top_ID	  				(CONFIG_SUBOPTIONS_IDS+19)
228 #define CONFIG_bottom_ID  				(CONFIG_SUBOPTIONS_IDS+20)
229 
230 #define CONFIG_image_ID  				(CONFIG_SUBOPTIONS_IDS+21)
231 #define CONFIG_mask_ID  				(CONFIG_SUBOPTIONS_IDS+22)
232 
233 #define CONFIG_ID_END					(CONFIG_SUBOPTIONS_IDS+23)
234 
235 #define MODULE_Defaults_ID				(CONFIG_ID_END+1)
236 #define MODULE_DefaultsEnd_ID				(CONFIG_ID_END+2)
237 
238 #define INCLUDE_MODULE_DEFAULTS(syntax)	{0, "Defaults", 8, TT_FLAG, MODULE_Defaults_ID, syntax}
239 #define INCLUDE_MODULE_DEFAULTS_END	   	{TF_SYNTAX_TERMINATOR, "~Defaults", 9, TT_FLAG, MODULE_DefaultsEnd_ID, NULL}
240 
241 
242 
243 /* must call this one to fix all the pointers referencing libAfterStep */
244 void LinkAfterStepConfig();
245 struct FreeStorageElem;
246 struct MyStyleDefinition;
247 struct balloonConfig;
248 struct flag_options_xref;
249 
250 struct ASModuleConfigClass;
251 
252 typedef struct ASModuleConfig
253 {
254 	int type ; /* any of the CONFIG_ values above */
255 	struct ASModuleConfigClass *class ;
256 
257 	struct MyStyleDefinition *style_defs ;
258 
259     struct balloonConfig	**balloon_configs; /* in the same order as class->balloon_types */
260 
261     struct FreeStorageElem   *more_stuff;
262 
263 }ASModuleConfig;
264 
265 #define AS_MODULE_CONFIG(p) ((ASModuleConfig*)(p))
266 
267 #define AS_MODULE_CONFIG_TYPED(__p,__type_id,__type) \
268 	({const ASModuleConfig *__a = (const ASModuleConfig*)(__p); __a ? ( __a->type == __type_id ? (__type*)__a:NULL):NULL; })
269 
270 
271 
272 void init_asmodule_config( ASModuleConfig *config, Bool free_resources );
273 struct flag_options_xref;
274 
275 typedef struct ASModuleConfigClass
276 {
277 
278 	int        type ; /* any of the CONFIG_ values */
279 #define ASMC_HandlePublicLookOptions 	(0x01<<0)
280 #define ASMC_HandlePublicFeelOptions 	(0x01<<1)
281 #define ASMC_HandleLookMyStyles			(0x01<<2)
282 	ASFlagType flags ;
283 	int 	   config_struct_size ; /* sizeof(ConfigType) */
284 
285 	char *private_config_file ;
286 
287 	void  (*init_config_func)( ASModuleConfig *config, Bool free_resources);
288 	void  (*free_storage2config_func)(ASModuleConfig *config, struct FreeStorageElem *storage);
289 	void  (*merge_config_func)( ASModuleConfig *to, ASModuleConfig *from);
290 
291 	struct SyntaxDef *module_syntax ;
292 	struct SyntaxDef *look_syntax ;
293 	struct SyntaxDef *feel_syntax ;
294 
295 	struct flag_options_xref *flags_xref ;
296 	ptrdiff_t 		   set_flags_field_offset ;
297 
298 	/* balloons */
299 	int    *balloon_types ;	/* zero terminated list of base IDs of all supported types of balloons */
300 
301 }ASModuleConfigClass;
302 
303 
304 void destroy_ASModule_config( ASModuleConfig *config );
305 ASModuleConfig* create_ASModule_config( ASModuleConfigClass *class );
306 ASModuleConfig *parse_asmodule_config_all(ASModuleConfigClass *class );
307 
308 struct MyStyleDefinition *free_storage_elem2MyStyleDefinition (struct FreeStorageElem *fs, const char *default_name);
309 struct MyStyleDefinition *free_storage2MyStyleDefinitionsList (struct FreeStorageElem *fs);
310 struct FreeStorageElem *MyStyleDefinition2free_storage_elem (struct MyStyleDefinition *msd, struct SyntaxDef *syntax);
311 struct FreeStorageElem *MyStyleDefinitionsList2free_storage (struct MyStyleDefinition *msd, struct SyntaxDef *syntax);
312 
313 
314 
315 
316 /***************************************************************************/
317 /*                        Base file pasring definitions                    */
318 /***************************************************************************/
319 #define BASE_ID_START        	(MODULE_DefaultsEnd_ID+1)
320 #define BASE_MODULE_PATH_ID     BASE_ID_START
321 #define BASE_SOUND_PATH_ID      BASE_ID_START+1
322 #define BASE_ICON_PATH_ID     	BASE_ID_START+2
323 #define BASE_PIXMAP_PATH_ID     BASE_ID_START+3
324 #define BASE_FONT_PATH_ID       BASE_ID_START+4
325 #define BASE_CURSOR_PATH_ID     BASE_ID_START+5
326 #define BASE_MYNAME_PATH_ID     BASE_ID_START+6
327 #define BASE_GTKRC_PATH_ID      BASE_ID_START+7
328 #define BASE_GTKRC20_PATH_ID    BASE_ID_START+8
329 #define BASE_DESKTOP_SIZE_ID	BASE_ID_START+9
330 #define BASE_DESKTOP_SCALE_ID	BASE_ID_START+10
331 #define BASE_TermCommand_ID		BASE_ID_START+11
332 #define BASE_BrowserCommand_ID	BASE_ID_START+12
333 #define BASE_EditorCommand_ID	BASE_ID_START+13
334 #define BASE_NoSharedMemory_ID	BASE_ID_START+14
335 #define BASE_NoKDEGlobalsTheming_ID	BASE_ID_START+15
336 #define BASE_NoModuleNameCollisions_ID	BASE_ID_START+16
337 #define BASE_IconTheme_ID					BASE_ID_START+17
338 #define BASE_IconThemePath_ID			BASE_ID_START+18
339 #define BASE_IconThemeFallback_ID	BASE_ID_START+19
340 #define BASE_ID_END             	BASE_ID_START+20
341 
342 typedef struct
343 {
344 #define BASE_NO_SHARED_MEMORY			(0x01<<0)
345 #define BASE_NO_KDEGLOBALS_THEMING		(0x01<<1)
346 #define BASE_DESKTOP_SIZE_SET			(0x01<<16)
347 #define BASE_DESKTOP_SCALE_SET			(0x01<<17)
348 #define BASE_NoModuleNameCollisions_SET	(0x01<<18)
349 	ASFlagType flags, set_flags ;
350     char *module_path;
351     char *sound_path;
352     char *icon_path;
353     char *pixmap_path;
354     char *font_path;
355     char *cursor_path;
356     char *myname_path;
357     char *gtkrc_path;
358     char *gtkrc20_path;
359     ASGeometry desktop_size;
360     int desktop_scale;
361 	int NoModuleNameCollisions;
362 #define MAX_TOOL_COMMANDS	8
363 	char *term_command[MAX_TOOL_COMMANDS] ;
364 	char *browser_command[MAX_TOOL_COMMANDS] ;
365 	char *editor_command[MAX_TOOL_COMMANDS] ;
366     char *IconTheme;
367     char *IconThemePath;
368     char *IconThemeFallback;
369 
370     struct FreeStorageElem *more_stuff;
371 }BaseConfig;
372 
373 BaseConfig *ParseBaseOptions (const char *filename, char *myname);
374 void ExtractPath (BaseConfig * config,
375 			 char **module_path,
376 			 char **sound_path,
377 			 char **icon_path,
378 			 char **pixmap_path,
379 			 char **font_path,
380 			 char **cursor_path,
381 			 char **myname_path,
382 			 char **gtkrc_path,
383 			 char **gtkrc20_path);
384 
385 void BaseConfig2ASEnvironment( register BaseConfig *config, ASEnvironment **penv );
386 void ReloadASImageManager( ASImageManager **old_imageman );
387 Bool ReloadASEnvironment( struct ASImageManager **old_imageman, struct ASFontManager **old_fontman, BaseConfig **config_return,
388 						  Bool flush_images, Bool support_shared_images );
389 
390 /*
391  * all data members that has been used from BaseConfig structure, returned
392  * by this call must be set to NULL, or memory allocated for them will be
393  * deallocated by the following DestroyBaseConfig function !
394  */
395 
396 void DestroyBaseConfig (BaseConfig * config);
397 
398 /***************************************************************************/
399 /*                           MyStyles                                      */
400 /***************************************************************************/
401 #define MYSTYLE_ID_START				BASE_ID_END+1
402 #define MYSTYLE_MyStyle_ID				MYSTYLE_ID_START
403 #define MYSTYLE_Inherit_ID 				MYSTYLE_ID_START+1
404 #define MYSTYLE_Font_ID					MYSTYLE_ID_START+2
405 #define MYSTYLE_ForeColor_ID			MYSTYLE_ID_START+3
406 #define MYSTYLE_BackColor_ID			MYSTYLE_ID_START+4
407 #define MYSTYLE_TextStyle_ID			MYSTYLE_ID_START+5
408 #define MYSTYLE_BackGradient_ID			MYSTYLE_ID_START+6
409 #define MYSTYLE_BackMultiGradient_ID	MYSTYLE_ID_START+7
410 #define MYSTYLE_BackPixmap_ID  			MYSTYLE_ID_START+8
411 #define MYSTYLE_DrawTextBackground_ID 	MYSTYLE_ID_START+9
412 #define MYSTYLE_SliceXStart_ID			MYSTYLE_ID_START+10
413 #define MYSTYLE_SliceXEnd_ID			MYSTYLE_ID_START+11
414 #define MYSTYLE_SliceYStart_ID			MYSTYLE_ID_START+12
415 #define MYSTYLE_SliceYEnd_ID			MYSTYLE_ID_START+13
416 #define MYSTYLE_BlurSize_ID				MYSTYLE_ID_START+14
417 #define MYSTYLE_Overlay_ID				MYSTYLE_ID_START+15
418 
419 #define MYSTYLE_DONE_ID					MYSTYLE_ID_START+16
420 #define MYSTYLE_Name_ID					MYSTYLE_ID_START+17
421 #define MYSTYLE_Comment_ID				MYSTYLE_ID_START+18
422 
423 #define MYSTYLE_ID_END					MYSTYLE_ID_START+20
424 
425 #define MYSTYLE_Name					(0x01<<5)
426 #define MYSTYLE_Comment					(0x01<<6)
427 #define MYSTYLE_Font					(0x01<<7)
428 #define MYSTYLE_ForeColor				(0x01<<8)
429 #define MYSTYLE_BackColor				(0x01<<9)
430 #define MYSTYLE_TextStyle				(0x01<<10)
431 #define MYSTYLE_DrawTextBackground		(0x01<<11)
432 #define MYSTYLE_SliceXStart				(0x01<<12)
433 #define MYSTYLE_SliceXEnd				(0x01<<13)
434 #define MYSTYLE_SliceYStart				(0x01<<14)
435 #define MYSTYLE_SliceYEnd				(0x01<<15)
436 #define MYSTYLE_BlurSize				(0x01<<16)
437 #define MYSTYLE_SLICE_SET				(MYSTYLE_SliceXStart|MYSTYLE_SliceYStart|MYSTYLE_SliceXEnd|MYSTYLE_SliceYEnd)
438 
439 
440 #define MYSTYLE_TERMS \
441 	ASCF_DEFINE_KEYWORD_SA(MYSTYLE, TF_NO_MYNAME_PREPENDING, MyStyle, TT_QUOTED_TEXT, NULL, MyStyleDefinition, Name),\
442 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING, Name, 			TT_QUOTED_TEXT, NULL, MyStyleDefinition),\
443 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING|TF_QUOTES_OPTIONAL, Comment,		TT_QUOTED_TEXT, NULL, MyStyleDefinition),\
444 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING, Font,    		TT_FONT, NULL, MyStyleDefinition),\
445 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING, ForeColor,		TT_COLOR, NULL, MyStyleDefinition),\
446 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING, BackColor,		TT_COLOR, NULL, MyStyleDefinition),\
447 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING, TextStyle,		TT_INTEGER, NULL, MyStyleDefinition),\
448 	ASCF_DEFINE_KEYWORD_F(MYSTYLE, TF_NO_MYNAME_PREPENDING, DrawTextBackground, NULL,MYSTYLE_DrawTextBackground,0),\
449 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING, SliceXStart,  	TT_INTEGER,  NULL, MyStyleDefinition),\
450 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING, SliceXEnd,    	TT_INTEGER,  NULL, MyStyleDefinition),\
451 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING, SliceYStart,  	TT_INTEGER,  NULL, MyStyleDefinition),\
452 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING, SliceYEnd,		TT_INTEGER,  NULL, MyStyleDefinition),\
453 	ASCF_DEFINE_KEYWORD_S(MYSTYLE, TF_NO_MYNAME_PREPENDING, BlurSize,     	TT_GEOMETRY, NULL, MyStyleDefinition),\
454 	\
455 	ASCF_DEFINE_KEYWORD(MYSTYLE, TF_NO_MYNAME_PREPENDING|TF_NONUNIQUE|TF_QUOTES_OPTIONAL, Inherit, TT_QUOTED_TEXT, NULL),\
456 	ASCF_DEFINE_KEYWORD(MYSTYLE, TF_NO_MYNAME_PREPENDING, BackGradient, 	TT_INTEGER, NULL),\
457 	ASCF_DEFINE_KEYWORD(MYSTYLE, TF_NO_MYNAME_PREPENDING, BackMultiGradient, TT_INTEGER, NULL),\
458 	ASCF_DEFINE_KEYWORD(MYSTYLE, TF_NO_MYNAME_PREPENDING|TF_INDEXED, BackPixmap, TT_FILENAME, NULL),\
459 	ASCF_DEFINE_KEYWORD(MYSTYLE, TF_NO_MYNAME_PREPENDING, Overlay,	    	TT_INTEGER, NULL),\
460 	\
461 	{TF_NO_MYNAME_PREPENDING|TF_SYNTAX_TERMINATOR,"~MyStyle", 	8, TT_FLAG, MYSTYLE_DONE_ID		, NULL}
462 
463 extern struct SyntaxDef MyStyleSyntax;
464 /* use this in module term definition to add MyStyle parsing functionality */
465 #define INCLUDE_MYSTYLE {TF_NO_MYNAME_PREPENDING,"MyStyle", 7, TT_QUOTED_TEXT, MYSTYLE_MyStyle_ID, &MyStyleSyntax}
466 
467 extern struct flag_options_xref MyStyleFlags[];
468 
469 typedef struct MyStyleDefinition
470 {
471 	int type ; /* any of the CONFIG_ values above */
472 
473    	ASFlagType flags, set_flags;
474 
475 	char   *Name;
476 	char   *Comment;
477 
478 	char   *Font;
479     char   *ForeColor, *BackColor;
480     int 	TextStyle;
481 
482 	int SliceXStart, SliceXEnd, SliceYStart, SliceYEnd ;
483 	ASGeometry BlurSize;
484 
485 	/* these options require special processing , and don't require set_flags: */
486     int     inherit_num;
487     char  **inherit;
488 
489 	int 	texture_type ;
490 
491 	int     back_grad_type;
492     int     back_grad_npoints;
493     char  **back_grad_colors;
494     double *back_grad_offsets;
495 
496     char   *back_pixmap;
497 
498 	int 	overlay_type ;
499     char   *overlay;
500 
501     struct  FreeStorageElem *more_stuff;
502     struct  MyStyleDefinition *next;	/* as long as there could be several MyStyle definitions
503 					 * per config file, we arrange them all into the linked list
504 					 */
505 }MyStyleDefinition;
506 /* this function will process consequent MyStyle options from FreeStorage,
507  * create (if needed ) and initialize MyStyleDefinition structure
508  * new structures will be added at the tail of linked list.
509  * it will return the new tail.
510  * [options] will be changed to point to the next non-MyStyle FreeStorageElem
511  */
512 void DestroyMyStyleDefinitions (MyStyleDefinition ** list);
513 void HandleMyStyleSpecialTerm (MyStyleDefinition *msd, struct FreeStorageElem *fs);
514 Bool CheckMyStyleDefinitionSanity (MyStyleDefinition *msd);
515 
516 void mystyle_parse (char *tline, FILE * fd, char **myname, int *mystyle_list);
517 struct MyStyle* mystyle_create_from_definition (struct ASHashTable *list, MyStyleDefinition * def);
518 struct MyStyle* mystyle_find_or_get_from_file(struct ASHashTable *list, const char *name);
519 
520 void PrintMyStyleDefinitions (MyStyleDefinition * list);
521 int WriteMyStyleStorageToFile (const char *filename, FreeStorageElem *fs, ASFlagType flags);
522 
523 /*
524  * this function process a linked list of MyStyle definitions
525  * and create MyStyle for each valid definition
526  * this operation is destructive in the way that all
527  * data members of definitions that are used in MyStyle will be
528  * set to NULL, so to prevent them being deallocated by destroy function,
529  * and/or being used in other places
530  * ATTENTION !!!!!
531  * MyStyleDefinitions become unusable as the result, and get's destroyed
532  * pointer to a list becomes NULL !
533  */
534 void ProcessMyStyleDefinitions (MyStyleDefinition ** list);
535 
536 void MergeMyStyleText (MyStyleDefinition ** list, const char *name,
537                   const char *new_font, const char *new_fcolor, const char *new_bcolor, int new_style);
538 void MergeMyStyleTextureOld (MyStyleDefinition ** list, const char *name,
539                         int type, char *color_from, char *color_to, char *pixmap);
540 
541 struct FreeStorageElem *MyStyleSpecialTerms2FreeStorage (MyStyleDefinition *msd, struct SyntaxDef *syntax);
542 
543 /**************************************************************************/
544 /*                        MyFrame parsing definitions                     */
545 /**************************************************************************/
546 #define MYFRAME_ID_START	(MYSTYLE_ID_END+1)
547 
548 #define MYFRAME_START_ID 	(MYFRAME_ID_START)
549 #define MYFRAME_North_ID        (MYFRAME_ID_START+1)
550 #define MYFRAME_East_ID         (MYFRAME_ID_START+2)
551 #define MYFRAME_South_ID        (MYFRAME_ID_START+3)
552 #define MYFRAME_West_ID         (MYFRAME_ID_START+4)
553 #define MYFRAME_NorthWest_ID    (MYFRAME_ID_START+5)
554 #define MYFRAME_NorthEast_ID    (MYFRAME_ID_START+6)
555 #define MYFRAME_SouthWest_ID    (MYFRAME_ID_START+7)
556 #define MYFRAME_SouthEast_ID    (MYFRAME_ID_START+8)
557 #define MYFRAME_Side_ID                 (MYFRAME_ID_START+9)
558 #define MYFRAME_NoSide_ID               (MYFRAME_ID_START+10)
559 #define MYFRAME_Corner_ID               (MYFRAME_ID_START+11)
560 #define MYFRAME_NoCorner_ID             (MYFRAME_ID_START+12)
561 #define MYFRAME_TitleUnfocusedStyle_ID  (MYFRAME_ID_START+13)
562 #define MYFRAME_TitleFocusedStyle_ID    (MYFRAME_ID_START+14)
563 #define MYFRAME_TitleStickyStyle_ID     (MYFRAME_ID_START+15)
564 #define MYFRAME_FrameUnfocusedStyle_ID  (MYFRAME_ID_START+16)
565 #define MYFRAME_FrameFocusedStyle_ID    (MYFRAME_ID_START+17)
566 #define MYFRAME_FrameStickyStyle_ID     (MYFRAME_ID_START+18)
567 
568 #define MYFRAME_SideSize_ID             (MYFRAME_ID_START+19)
569 #define MYFRAME_CornerSize_ID           (MYFRAME_ID_START+20)
570 #define MYFRAME_SideAlign_ID            (MYFRAME_ID_START+21)
571 #define MYFRAME_CornerAlign_ID          (MYFRAME_ID_START+22)
572 #define MYFRAME_SideBevel_ID            (MYFRAME_ID_START+23)
573 #define MYFRAME_CornerBevel_ID          (MYFRAME_ID_START+24)
574 #define MYFRAME_SideFBevel_ID           (MYFRAME_ID_START+25)
575 #define MYFRAME_CornerFBevel_ID         (MYFRAME_ID_START+26)
576 #define MYFRAME_SideUBevel_ID           (MYFRAME_ID_START+27)
577 #define MYFRAME_CornerUBevel_ID         (MYFRAME_ID_START+28)
578 #define MYFRAME_SideSBevel_ID           (MYFRAME_ID_START+29)
579 #define MYFRAME_CornerSBevel_ID         (MYFRAME_ID_START+30)
580 #define MYFRAME_TitleBevel_ID           (MYFRAME_ID_START+31)
581 #define MYFRAME_TitleFBevel_ID          (MYFRAME_ID_START+32)
582 #define MYFRAME_TitleUBevel_ID          (MYFRAME_ID_START+33)
583 #define MYFRAME_TitleSBevel_ID          (MYFRAME_ID_START+34)
584 #define MYFRAME_TitleAlign_ID           (MYFRAME_ID_START+35)
585 #define MYFRAME_TitleCM_ID              (MYFRAME_ID_START+36)
586 #define MYFRAME_TitleFCM_ID             (MYFRAME_ID_START+37)
587 #define MYFRAME_TitleUCM_ID             (MYFRAME_ID_START+38)
588 #define MYFRAME_TitleSCM_ID             (MYFRAME_ID_START+39)
589 #define MYFRAME_TitleFHue_ID			(MYFRAME_ID_START+40)
590 #define MYFRAME_TitleUHue_ID			(MYFRAME_ID_START+41)
591 #define MYFRAME_TitleSHue_ID			(MYFRAME_ID_START+42)
592 #define MYFRAME_TitleFSat_ID			(MYFRAME_ID_START+43)
593 #define MYFRAME_TitleUSat_ID			(MYFRAME_ID_START+44)
594 #define MYFRAME_TitleSSat_ID			(MYFRAME_ID_START+45)
595 #define MYFRAME_Inherit_ID              (MYFRAME_ID_START+46)
596 #define MYFRAME_InheritDefaults_ID      (MYFRAME_ID_START+47)
597 #define MYFRAME_TitleHSpacing_ID 		(MYFRAME_ID_START+48)
598 #define MYFRAME_TitleVSpacing_ID 		(MYFRAME_ID_START+49)
599 #define MYFRAME_DONE_ID                 (MYFRAME_ID_START+50)
600 
601 #define MYFRAME_TitleBackground_ID_START	(MYFRAME_DONE_ID+1)
602 #define MYFRAME_LeftBtnBackground_ID		(MYFRAME_TitleBackground_ID_START+MYFRAME_TITLE_BACK_LBTN	)
603 #define MYFRAME_LeftSpacerBackground_ID 	(MYFRAME_TitleBackground_ID_START+MYFRAME_TITLE_BACK_LSPACER)
604 #define MYFRAME_LTitleSpacerBackground_ID 	(MYFRAME_TitleBackground_ID_START+MYFRAME_TITLE_BACK_LTITLE_SPACER)
605 #define MYFRAME_TitleBackground_ID      	(MYFRAME_TitleBackground_ID_START+MYFRAME_TITLE_BACK_LBL	)
606 #define MYFRAME_RTitleSpacerBackground_ID 	(MYFRAME_TitleBackground_ID_START+MYFRAME_TITLE_BACK_RTITLE_SPACER)
607 #define MYFRAME_RightSpacerBackground_ID 	(MYFRAME_TitleBackground_ID_START+MYFRAME_TITLE_BACK_RSPACER)
608 #define MYFRAME_RightBtnBackground_ID   	(MYFRAME_TitleBackground_ID_START+MYFRAME_TITLE_BACK_RBTN	)
609 #define MYFRAME_TitleBackground_ID_END      (MYFRAME_TitleBackground_ID_START+MYFRAME_TITLE_BACKS)
610 
611 #define MYFRAME_TitleBackgroundAlign_ID_START	(MYFRAME_TitleBackground_ID_END)
612 #define MYFRAME_LeftBtnBackAlign_ID				(MYFRAME_TitleBackgroundAlign_ID_START+MYFRAME_TITLE_BACK_LBTN	)
613 #define MYFRAME_LeftSpacerBackAlign_ID  		(MYFRAME_TitleBackgroundAlign_ID_START+MYFRAME_TITLE_BACK_LSPACER)
614 #define MYFRAME_LTitleSpacerBackAlign_ID  		(MYFRAME_TitleBackgroundAlign_ID_START+MYFRAME_TITLE_BACK_LTITLE_SPACER)
615 #define MYFRAME_TitleBackgroundAlign_ID 		(MYFRAME_TitleBackgroundAlign_ID_START+MYFRAME_TITLE_BACK_LBL	 )
616 #define MYFRAME_RTitleSpacerBackAlign_ID 		(MYFRAME_TitleBackgroundAlign_ID_START+MYFRAME_TITLE_BACK_RTITLE_SPACER)
617 #define MYFRAME_RightSpacerBackAlign_ID 		(MYFRAME_TitleBackgroundAlign_ID_START+MYFRAME_TITLE_BACK_RSPACER)
618 #define MYFRAME_RightBtnBackAlign_ID			(MYFRAME_TitleBackgroundAlign_ID_START+MYFRAME_TITLE_BACK_RBTN	 )
619 #define MYFRAME_TitleBackgroundAlign_ID_END     (MYFRAME_TitleBackgroundAlign_ID_START+MYFRAME_TITLE_BACKS)
620 
621 
622 #define MYFRAME_CondenseTitlebar_ID             (MYFRAME_TitleBackgroundAlign_ID_END+1)
623 #define MYFRAME_LeftTitlebarLayout_ID			(MYFRAME_TitleBackgroundAlign_ID_END+2)
624 #define MYFRAME_RightTitlebarLayout_ID			(MYFRAME_TitleBackgroundAlign_ID_END+3)
625 
626 #define MYFRAME_LeftBtnAlign_ID					(MYFRAME_TitleBackgroundAlign_ID_END+4)
627 #define MYFRAME_RightBtnAlign_ID				(MYFRAME_TitleBackgroundAlign_ID_END+5)
628 
629 #define MYFRAME_NoBorder_ID             		(MYFRAME_TitleBackgroundAlign_ID_END+6)
630 #define MYFRAME_AllowBorder_ID             		(MYFRAME_NoBorder_ID+1)
631 
632 #define MYFRAME_SideSlicing_ID             		(MYFRAME_AllowBorder_ID+1)
633 
634 #define MYFRAME_TitleBackSlicing_ID_START	(MYFRAME_SideSlicing_ID+1)
635 #define MYFRAME_LeftBtnBackSlicing_ID		(MYFRAME_TitleBackSlicing_ID_START+MYFRAME_TITLE_BACK_LBTN	)
636 #define MYFRAME_LeftSpacerBackSlicing_ID 	(MYFRAME_TitleBackSlicing_ID_START+MYFRAME_TITLE_BACK_LSPACER)
637 #define MYFRAME_LTitleSpacerBackSlicing_ID 	(MYFRAME_TitleBackSlicing_ID_START+MYFRAME_TITLE_BACK_LTITLE_SPACER)
638 #define MYFRAME_TitleBackSlicing_ID      	(MYFRAME_TitleBackSlicing_ID_START+MYFRAME_TITLE_BACK_LBL	)
639 #define MYFRAME_RTitleSpacerBackSlicing_ID 	(MYFRAME_TitleBackSlicing_ID_START+MYFRAME_TITLE_BACK_RTITLE_SPACER)
640 #define MYFRAME_RightSpacerBackSlicing_ID 	(MYFRAME_TitleBackSlicing_ID_START+MYFRAME_TITLE_BACK_RSPACER)
641 #define MYFRAME_RightBtnBackSlicing_ID   	(MYFRAME_TitleBackSlicing_ID_START+MYFRAME_TITLE_BACK_RBTN	)
642 #define MYFRAME_TitleBackSlicing_ID_END     (MYFRAME_TitleBackSlicing_ID_START+MYFRAME_TITLE_BACKS)
643 
644 #define MYFRAME_ID_END      (MYFRAME_TitleBackSlicing_ID_END+1)
645 
646 #define ALIGN_ID_START      (MYFRAME_ID_END+1)
647 #define ALIGN_Left_ID       (ALIGN_ID_START+1)
648 #define ALIGN_Top_ID        (ALIGN_ID_START+2)
649 #define ALIGN_Right_ID      (ALIGN_ID_START+3)
650 #define ALIGN_Bottom_ID     (ALIGN_ID_START+4)
651 #define ALIGN_HTiled_ID     (ALIGN_ID_START+5)
652 #define ALIGN_VTiled_ID     (ALIGN_ID_START+6)
653 #define ALIGN_HScaled_ID    (ALIGN_ID_START+7)
654 #define ALIGN_VScaled_ID    (ALIGN_ID_START+8)
655 #define ALIGN_LabelWidth_ID  (ALIGN_ID_START+9)
656 #define ALIGN_LabelHeight_ID (ALIGN_ID_START+10)
657 #define ALIGN_LabelSize_ID  (ALIGN_ID_START+11)
658 #define ALIGN_Center_ID     (ALIGN_ID_START+12)
659 #define ALIGN_HCenter_ID    (ALIGN_ID_START+13)
660 #define ALIGN_VCenter_ID    (ALIGN_ID_START+14)
661 #define ALIGN_None_ID 	   (ALIGN_ID_START+15)
662 #define ALIGN_ID_END        (ALIGN_ID_START+16)
663 
664 #define BEVEL_ID_START      (ALIGN_ID_END+1)
665 #define BEVEL_None_ID       (BEVEL_ID_START+1)
666 #define BEVEL_Left_ID       (BEVEL_ID_START+2)
667 #define BEVEL_Top_ID        (BEVEL_ID_START+3)
668 #define BEVEL_Right_ID      (BEVEL_ID_START+4)
669 #define BEVEL_Bottom_ID     (BEVEL_ID_START+5)
670 #define BEVEL_Extra_ID      (BEVEL_ID_START+6)
671 #define BEVEL_NoOutline_ID  (BEVEL_ID_START+7)
672 #define BEVEL_NoInline_ID   (BEVEL_ID_START+8)
673 #define BEVEL_ID_END        (BEVEL_ID_START+10)
674 
675 #define TBAR_LAYOUT_ID_START  		(BEVEL_ID_END+1)
676 #define TBAR_LAYOUT_Buttons_ID     	(TBAR_LAYOUT_ID_START+MYFRAME_TITLE_BACK_BTN)
677 #define TBAR_LAYOUT_Spacer_ID      	(TBAR_LAYOUT_ID_START+MYFRAME_TITLE_BACK_SPACER)
678 #define TBAR_LAYOUT_TitleSpacer_ID 	(TBAR_LAYOUT_ID_START+MYFRAME_TITLE_BACK_TITLE_SPACER)
679 
680 #define TBAR_LAYOUT_ID_END        	(TBAR_LAYOUT_ID_START+10)
681 
682 
683 /*********************************************************************
684  * Window decorations Frame can be defined as such :
685  *
686  * MyFrame "name"
687  *     [Inherit     "name"]
688  * #traditional form :
689  *     [North       <pixmap>]
690  *     [East        <pixmap>]
691  *     [South       <pixmap>]
692  *     [West        <pixmap>]
693  *     [NorthEast   <pixmap>]
694  *     [NorthWest   <pixmap>]
695  *     [SouthEast   <pixmap>]
696  *     [SouthWest   <pixmap>]
697  * #alternative form :
698  *     [Side        North|South|East|West|Any [<pixmap>]] - if pixmap is ommited -
699  *                                                          empty bevel will be drawn
700  *     [NoSide      North|South|East|West|Any]
701  *     [Corner      NorthEast|SouthEast|NorthWest|SouthWest|Any <pixmap>] - if pixmap is ommited -
702  *                                                                          empty bevel will be drawn
703  *     [NoCorner    NorthEast|SouthEast|NorthWest|SouthWest|Any]
704  * #new settings :
705  *     [TitleUnfocusedStyle   <style>
706  *     [TitleFocusedStyle     <style>
707  *     [TitleStickyStyle      <style>
708  *     [FrameUnfocusedStyle   <style>
709  *     [FrameFocusedStyle     <style>
710  *     [FrameStickyStyle      <style>
711  *     [TitleBackground       <pixmap>] - gets overlayed over background and under the text
712  * #additional attributes :
713  *     [SideSize        North|South|East|West|Any <WIDTHxLENGTH>] - pixmap will be scaled to this size
714  *     [SideAlign       North|South|East|West|Any Left,Top,Right,Bottom,HTiled,VTiled,HScaled,VScaled]
715  *     [SideBevel       North|South|East|West|Any None|[Left,Top,Right,Bottom,Extra,NoOutline]]
716  *     [SideFocusedBevel      North|South|East|West|Any None|[Left,Top,Right,Bottom,Extra,NoOutline]]
717  *     [SideUnfocusedBevel    North|South|East|West|Any None|[Left,Top,Right,Bottom,Extra,NoOutline]]
718  *     [SideStickyBevel       North|South|East|West|Any None|[Left,Top,Right,Bottom,Extra,NoOutline]]
719  *     [SideSlicing        North|South|East|West|Any <WIDTHxLENGTH+X+Y>] - pixmap will be sliced using: x,x+width,y,y+height
720  *     [CornerSize      NorthEast|SouthEast|NorthWest|SouthWest|Any <WIDTHxHEIGHT>]
721  *     [CornerAlign     NorthEast|SouthEast|NorthWest|SouthWest|Any Left,Top,Right,Bottom,HTiled,VTiled,HScaled,VScaled]
722  *     [CornerBevel     NorthEast|SouthEast|NorthWest|SouthWest|Any None|[Left,Top,Right,Bottom,Extra,NoOutline]]
723  *     [CornerFocusedBevel    NorthEast|SouthEast|NorthWest|SouthWest|Any None|[Left,Top,Right,Bottom,Extra,NoOutline]]
724  *     [CornerUnfocusedBevel  NorthEast|SouthEast|NorthWest|SouthWest|Any None|[Left,Top,Right,Bottom,Extra,NoOutline]]
725  *     [CornerStickyBevel     NorthEast|SouthEast|NorthWest|SouthWest|Any None|[Left,Top,Right,Bottom,Extra,NoOutline]]
726  *     [TitleBevel      None|[Left,Top,Right,Bottom,Extra,NoOutline]
727  *     [TitleFocusedBevel     None|[Left,Top,Right,Bottom,Extra,NoOutline]
728  *     [TitleUnfocusedBevel   None|[Left,Top,Right,Bottom,Extra,NoOutline]
729  *     [TitleStickyBevel      None|[Left,Top,Right,Bottom,Extra,NoOutline]
730  *     [TitleAlign      None|[Left,Top,Right,Bottom]
731  *     [TitleBackgroundAlign  None|[Left,Top,Right,Bottom,HTiled,VTiled,HScaled,VScaled,LabelSize]
732  *     [TitleCompositionMethod   testure_type]
733  *     [TitleFocusedCompositionMethod     testure_type]
734  *     [TitleUnfocusedCompositionMethod   testure_type]
735  *     [TitleStickyCompositionMethod      testure_type]
736  * 	   [CondenseTitlebar]
737  * 	   [LeftTitlebarLayout		Buttons,Spacer,TitleSpacer]
738  * 	   [RightTitlebarLayout		Buttons,Spacer,TitleSpacer]
739  * ~MyFrame
740  */
741 
742 extern struct SyntaxDef MyFrameSyntax;
743 /* use this in module term definition to add MyStyle parsing functionality */
744 #define INCLUDE_MYFRAME	{TF_NO_MYNAME_PREPENDING,"MyFrame", 7, TT_QUOTED_TEXT, MYFRAME_START_ID, &MyFrameSyntax}
745 
746 typedef struct MyFrameDefinition
747 {
748     struct MyFrameDefinition *next;
749 
750     char        *name;
751     ASFlagType   set_parts;
752     ASFlagType   parts_mask; /* first 8 bits represent one enabled side/corner each */
753     char        *parts[FRAME_PARTS];
754     char        *title_styles[BACK_STYLES];
755     char        *frame_styles[BACK_STYLES];
756 	char        *title_backs[MYFRAME_TITLE_BACKS];
757     ASFlagType   set_part_size ;
758     unsigned int part_width[FRAME_PARTS];
759     unsigned int part_length[FRAME_PARTS];
760 	ASGeometry   side_slicing[FRAME_SIDES];
761     ASFlagType   set_part_bevel ;
762     ASFlagType   part_fbevel[FRAME_PARTS];
763     ASFlagType   part_ubevel[FRAME_PARTS];
764     ASFlagType   part_sbevel[FRAME_PARTS];
765     ASFlagType   set_part_align ;
766     ASFlagType   part_align[FRAME_PARTS];
767     ASFlagType   set_title_attr ;
768     ASFlagType   title_fbevel, title_ubevel, title_sbevel;
769     ASFlagType   title_align ;
770 	ASFlagType   title_backs_align[MYFRAME_TITLE_BACKS];
771 	ASGeometry   title_backs_slicing[MYFRAME_TITLE_BACKS];
772     int          title_fcm, title_ucm, title_scm;
773 	char 		*title_fhue, *title_uhue, *title_shue;
774 	int          title_fsat, title_usat, title_ssat;
775 	int          title_h_spacing, title_v_spacing;
776     ASFlagType   condense_titlebar ;
777 	unsigned long left_layout, right_layout ;
778 	ASFlagType   left_btn_align, right_btn_align ;
779 
780 	ASFlagType   flags ;
781 	ASFlagType   set_flags ;
782 
783     char       **inheritance_list ;
784     int          inheritance_num ;
785 
786 }MyFrameDefinition;
787 
788 /* this functions work exactly like MyStyle stuff ( see above ) */
789 void PrintMyFrameDefinitions (MyFrameDefinition * list, int index);
790 MyFrameDefinition *AddMyFrameDefinition (MyFrameDefinition ** tail);
791 void DestroyMyFrameDefinitions (MyFrameDefinition ** list);
792 MyFrameDefinition **ProcessMyFrameOptions (struct FreeStorageElem * options,
793 					   MyFrameDefinition ** tail);
794 
795 /* converts MYFRAME defs back into FreeStorage */
796 struct FreeStorageElem **MyFrameDefs2FreeStorage (struct SyntaxDef * syntax,
797 					   struct FreeStorageElem ** tail,
798 					   MyFrameDefinition * defs);
799 
800 void myframe_parse (char *tline, FILE * fd, char **myname, int *myframe_list);
801 /**************************************************************************/
802 /**************************************************************************/
803 /*                        balloon pasring definitions                       */
804 /**************************************************************************/
805 
806 #define BALLOON_ID_START            (TBAR_LAYOUT_ID_END+1)
807 
808 #define BALLOON_Balloons_ID_OFFSET			0
809 #define BALLOON_USED_ID_OFFSET	 		   	0
810 #define BALLOON_BorderHilite_ID_OFFSET     	1
811 #define BALLOON_XOffset_ID_OFFSET          	2
812 #define BALLOON_YOffset_ID_OFFSET          	3
813 #define BALLOON_Delay_ID_OFFSET            	4
814 #define BALLOON_CloseDelay_ID_OFFSET       	5
815 #define BALLOON_Style_ID_OFFSET            	6
816 #define BALLOON_TextPaddingX_ID_OFFSET     	7
817 #define BALLOON_TextPaddingY_ID_OFFSET     	8
818 #define BALLOON_NoBalloons_ID_OFFSET	   	9
819 #define BALLOON_ID_END_OFFSET	   			10
820 
821 #define BALLOON_Balloons_ID			(BALLOON_ID_START+BALLOON_Balloons_ID_OFFSET)
822 #define BALLOON_USED_ID	 			BALLOON_Balloons_ID
823 #define BALLOON_BorderHilite_ID     (BALLOON_ID_START+BALLOON_BorderHilite_ID_OFFSET)
824 #define BALLOON_XOffset_ID          (BALLOON_ID_START+BALLOON_XOffset_ID_OFFSET)
825 #define BALLOON_YOffset_ID          (BALLOON_ID_START+BALLOON_YOffset_ID_OFFSET)
826 #define BALLOON_Delay_ID            (BALLOON_ID_START+BALLOON_Delay_ID_OFFSET)
827 #define BALLOON_CloseDelay_ID       (BALLOON_ID_START+BALLOON_CloseDelay_ID_OFFSET)
828 #define BALLOON_Style_ID            (BALLOON_ID_START+BALLOON_Style_ID_OFFSET)
829 #define BALLOON_TextPaddingX_ID     (BALLOON_ID_START+BALLOON_TextPaddingX_ID_OFFSET)
830 #define BALLOON_TextPaddingY_ID     (BALLOON_ID_START+BALLOON_TextPaddingY_ID_OFFSET)
831 #define BALLOON_NoBalloons_ID	 	(BALLOON_ID_START+BALLOON_NoBalloons_ID_OFFSET)
832 
833 #define BALLOON_SHOW_Name_OFFSET		0
834 #define BALLOON_SHOW_IconName_OFFSET	1
835 #define BALLOON_SHOW_ResClass_OFFSET	2
836 #define BALLOON_SHOW_ResName_OFFSET		3
837 #define BALLOON_SHOW_Comment_OFFSET		4
838 #define BALLOON_SHOW_Exec_OFFSET		5
839 #define BALLOON_SHOW_GenericName_OFFSET	6
840 #define BALLOON_SHOW_END_OFFSET			7
841 
842 #define BALLOON_SHOW_ID_START		(BALLOON_ID_START+BALLOON_ID_END_OFFSET+1)
843 #define BALLOON_Name_ID				(BALLOON_SHOW_ID_START+BALLOON_SHOW_Name_OFFSET)
844 #define BALLOON_IconName_ID			(BALLOON_SHOW_ID_START+BALLOON_SHOW_IconName_OFFSET)
845 #define BALLOON_ResClass_ID			(BALLOON_SHOW_ID_START+BALLOON_SHOW_ResClass_OFFSET)
846 #define BALLOON_ResName_ID			(BALLOON_SHOW_ID_START+BALLOON_SHOW_ResName_OFFSET)
847 #define BALLOON_Comment_ID			(BALLOON_SHOW_ID_START+BALLOON_SHOW_Comment_OFFSET)
848 #define BALLOON_Exec_ID				(BALLOON_SHOW_ID_START+BALLOON_SHOW_Exec_OFFSET)
849 #define BALLOON_GenericName_ID		(BALLOON_SHOW_ID_START+BALLOON_SHOW_GenericName_OFFSET)
850 #define BALLOON_SHOW_ID_END			(BALLOON_ID_START+BALLOON_SHOW_END_OFFSET)
851 
852 #define	BALLOON_ID_END				(BALLOON_SHOW_ID_END+1)
853 
854 #define TITLE_BALLOON_ID_START  (BALLOON_ID_START+BALLOON_ID_END_OFFSET)
855 #define MENU_BALLOON_ID_START   (TITLE_BALLOON_ID_START+BALLOON_ID_END_OFFSET)
856 
857 #define AFTERSTEP_BALLOON_ID_END   (MENU_BALLOON_ID_START+BALLOON_ID_END_OFFSET)
858 
859 #define BALLOON_FLAG_TERMS_O(o,prefix) \
860  {0, prefix "Balloons",    8+sizeof(prefix), TT_FLAG , 			(o)+BALLOON_Balloons_ID_OFFSET   , NULL}, \
861  {0, prefix "NoBalloons", 10+sizeof(prefix), TT_FLAG , 			(o)+BALLOON_NoBalloons_ID_OFFSET   , NULL}
862 
863 #define BALLOON_FEEL_TERMS_O(o,prefix) \
864  {0, prefix "BalloonXOffset", 14+sizeof(prefix), TT_INTEGER, 		(o)+BALLOON_XOffset_ID_OFFSET        , NULL}, \
865  {0, prefix "BalloonYOffset", 14+sizeof(prefix), TT_INTEGER, 		(o)+BALLOON_YOffset_ID_OFFSET        , NULL}, \
866  {0, prefix "BalloonDelay", 12+sizeof(prefix), TT_UINTEGER, 		(o)+BALLOON_Delay_ID_OFFSET      , NULL}, \
867  {0, prefix "BalloonCloseDelay", 17+sizeof(prefix), TT_UINTEGER, 	(o)+BALLOON_CloseDelay_ID_OFFSET , NULL}
868 
869 #define BALLOON_LOOK_TERMS_O(o,prefix) \
870  {0, prefix "BalloonBorderHilite",19+sizeof(prefix), TT_FLAG, 	(o)+BALLOON_BorderHilite_ID_OFFSET, &BevelSyntax}, \
871  {0, prefix "BalloonStyle", 12+sizeof(prefix), TT_QUOTED_TEXT, 	(o)+BALLOON_Style_ID_OFFSET , NULL}, \
872  {0, prefix "BalloonTextPaddingX",19+sizeof(prefix), TT_INTEGER, 	(o)+BALLOON_TextPaddingX_ID_OFFSET , NULL}, \
873  {0, prefix "BalloonTextPaddingY",19+sizeof(prefix), TT_INTEGER, 	(o)+BALLOON_TextPaddingY_ID_OFFSET , NULL}
874 
875 #define BALLOON_FLAG_TERM BALLOON_FLAG_TERMS_O(BALLOON_ID_START,"")
876 #define BALLOON_FEEL_TERMS BALLOON_FEEL_TERMS_O(BALLOON_ID_START,"")
877 #define BALLOON_LOOK_TERMS BALLOON_LOOK_TERMS_O(BALLOON_ID_START,"")
878 
879 #define BALLOON_TERMS BALLOON_FLAG_TERM,BALLOON_FEEL_TERMS,BALLOON_LOOK_TERMS
880 #define BALLOON_TERMS_O(o,prefix) BALLOON_FLAG_TERMS_O(o,prefix),BALLOON_FEEL_TERMS_O(o,prefix),BALLOON_LOOK_TERMS_O(o,prefix)
881 
882 /* custom balloon kinds used by AfterStep proper : */
883 #define TITLE_BALLOON_TERMS  	BALLOON_TERMS_O(TITLE_BALLOON_ID_START,"TitleButton")
884 #define MENU_BALLOON_TERMS  	BALLOON_TERMS_O(MENU_BALLOON_ID_START,"Menu")
885 
886 extern int ASDefaultBalloonTypes[];
887 
888 /* this flags aren't really part of ballon config, and could be used by different
889    modules in their own ways */
890 #define BALLOON_SHOW_Name			(0x01<<BALLOON_SHOW_Name_OFFSET)
891 #define BALLOON_SHOW_IconName		(0x01<<BALLOON_SHOW_IconName_OFFSET)
892 #define BALLOON_SHOW_ResClass		(0x01<<BALLOON_SHOW_ResClass_OFFSET)
893 #define BALLOON_SHOW_ResName		(0x01<<BALLOON_SHOW_ResName_OFFSET)
894 #define BALLOON_SHOW_Comment		(0x01<<BALLOON_SHOW_Comment_OFFSET)
895 #define BALLOON_SHOW_Exec			(0x01<<BALLOON_SHOW_Exec_OFFSET)
896 #define BALLOON_SHOW_GenericName	(0x01<<BALLOON_SHOW_GenericName_OFFSET)
897 
898 
899 typedef struct balloonConfig
900 {
901 	int type ; /* == CONFIG_Balloons_ID */
902 
903   unsigned long set_flags;	/* identifyes what option is set */
904   unsigned long flags;
905 #define BALLOON_Balloons			(0x01<<0)
906 #define BALLOON_USED 				BALLOON_Balloons
907 #define BALLOON_BorderHilite        (0x01<<1)
908 #define BALLOON_XOffset             (0x01<<2)
909 #define BALLOON_YOffset             (0x01<<3)
910 #define BALLOON_Delay               (0x01<<4)
911 #define BALLOON_CloseDelay			(0x01<<5)
912 #define BALLOON_Style               (0x01<<6)
913 #define BALLOON_TextPaddingX		(0x01<<7)
914 #define BALLOON_TextPaddingY		(0x01<<8)
915   ASFlagType BorderHilite;
916   int XOffset, YOffset;
917   unsigned int Delay, CloseDelay;
918   char *Style ;
919   int TextPaddingX, TextPaddingY;
920 
921   struct balloonConfig *next ; /* we may have different kinds of balloons */
922 }balloonConfig;
923 
924 balloonConfig *Create_balloonConfig ();
925 void Destroy_balloonConfig (balloonConfig * config);
926 balloonConfig *Process_balloonOptions (	struct FreeStorageElem * options,
927 										balloonConfig *config, int id_base );
928 
929 void Print_balloonConfig (balloonConfig * config);
930 struct FreeStorageElem **balloon2FreeStorage (struct SyntaxDef * syntax,
931 				       struct FreeStorageElem ** tail,
932 				       balloonConfig * config);
933 
934 void MergeBalloonOptions ( ASModuleConfig *asm_to, ASModuleConfig *asm_from);
935 struct ASBalloonLook;
936 void balloon_config2look( struct MyLook *look, struct ASBalloonLook *balloon_look, balloonConfig *config, const char *default_style );
937 
938 ASFlagType ParseBalloonContentsOptions( struct FreeStorageElem * options );
939 
940 
941 
942 
943 /***************************************************************************/
944 
945 /***************************************************************************/
946 extern char *pixmapPath;
947 /****************************************************************************/
948 /*                             Pager                                        */
949 /****************************************************************************/
950 /* flags used in configuration */
951 #define USE_LABEL   			(1<<0)
952 #define START_ICONIC			(1<<1)
953 #define REDRAW_BG				(1<<2)
954 #define STICKY_ICONS			(1<<3)
955 #define LABEL_BELOW_DESK 		(1<<4)
956 #define HIDE_INACTIVE_LABEL		(1<<5)
957 #define PAGE_SEPARATOR			(1<<6)
958 #define DIFFERENT_GRID_COLOR	(1<<7)
959 #define DIFFERENT_BORDER_COLOR	(1<<8)
960 #define SHOW_SELECTION          (1<<9)
961 #define FAST_STARTUP			(1<<10)
962 #define SET_ROOT_ON_STARTUP		(1<<11)
963 #define VERTICAL_LABEL          (1<<12)
964 #define PAGER_FLAGS_MAX_SHIFT   12
965 #define PAGER_FLAGS_DEFAULT	(USE_LABEL|REDRAW_BG|PAGE_SEPARATOR|SHOW_SELECTION)
966 /* set/unset flags : */
967 #define PAGER_SET_SHADE_BUTTON 		(1<<15)
968 #define PAGER_SET_GEOMETRY  		(1<<16)
969 #define PAGER_SET_ICON_GEOMETRY  	(1<<17)
970 #define PAGER_SET_ALIGN 			(1<<18)
971 #define PAGER_SET_SMALL_FONT 		(1<<19)
972 #define PAGER_SET_ROWS 				(1<<20)
973 #define PAGER_SET_COLUMNS 			(1<<21)
974 #define PAGER_SET_SELECTION_COLOR	(1<<22)
975 #define PAGER_SET_GRID_COLOR		(1<<23)
976 #define PAGER_SET_BORDER_COLOR		(1<<24)
977 #define PAGER_SET_BORDER_WIDTH		(1<<25)
978 #define PAGER_SET_ACTIVE_BEVEL      (1<<26)
979 #define PAGER_SET_INACTIVE_BEVEL    (1<<27)
980 
981 
982 /* ID's used in our config */
983 #define PAGER_ID_START      (AFTERSTEP_BALLOON_ID_END+1)
984 #define PAGER_GEOMETRY_ID 	(PAGER_ID_START)
985 #define PAGER_ICON_GEOMETRY_ID  (PAGER_ID_START+1)
986 #define PAGER_ALIGN_ID		(PAGER_ID_START+2)
987 #define PAGER_DRAW_BG_ID	(PAGER_ID_START+3)
988 #define PAGER_FAST_STARTUP_ID	(PAGER_ID_START+4)
989 #define PAGER_SET_ROOT_ID	(PAGER_ID_START+5)
990 #define PAGER_SMALL_FONT_ID	(PAGER_ID_START+6)
991 #define PAGER_START_ICONIC_ID	(PAGER_ID_START+7)
992 #define PAGER_ROWS_ID		(PAGER_ID_START+8)
993 #define PAGER_COLUMNS_ID	(PAGER_ID_START+9)
994 #define PAGER_STICKY_ICONS_ID	(PAGER_ID_START+10)
995 #define PAGER_LABEL_ID 		(PAGER_ID_START+11)
996 #define PAGER_STYLE_ID      (PAGER_ID_START+12)
997 #define PAGER_SHADE_BUTTON_ID   (PAGER_ID_START+13)
998 
999 #define PAGER_DECORATION_ID	(PAGER_ID_START+20)
1000 #define PAGER_MYSTYLE_ID	(PAGER_ID_START+21)
1001 #define PAGER_BALLOONS_ID	(PAGER_ID_START+22)
1002 
1003 #define PAGER_DECOR_NOLABEL_ID 		(PAGER_ID_START+30)
1004 #define PAGER_DECOR_NOSEPARATOR_ID 	(PAGER_ID_START+31)
1005 #define PAGER_DECOR_NOSELECTION_ID 	(PAGER_ID_START+32)
1006 #define PAGER_DECOR_SEL_COLOR_ID 	(PAGER_ID_START+33)
1007 #define PAGER_DECOR_GRID_COLOR_ID 	(PAGER_ID_START+34)
1008 #define PAGER_DECOR_BORDER_WIDTH_ID (PAGER_ID_START+35)
1009 #define PAGER_DECOR_BORDER_COLOR_ID	(PAGER_ID_START+36)
1010 #define PAGER_DECOR_LABEL_BELOW_ID	(PAGER_ID_START+37)
1011 #define PAGER_DECOR_HIDE_INACTIVE_ID    (PAGER_ID_START+38)
1012 #define PAGER_DECOR_VERTICAL_LABEL_ID   (PAGER_ID_START+39)
1013 #define PAGER_ActiveBevel_ID        (PAGER_ID_START+40)
1014 #define PAGER_InActiveBevel_ID      (PAGER_ID_START+41)
1015 
1016 #define PAGER_ID_END                (PAGER_ID_START+50)
1017 /* config data structure */
1018 
1019 typedef struct PagerConfig
1020   {
1021     int    rows, columns;
1022     ASGeometry geometry, icon_geometry;
1023 	int ndesks ;
1024     char **labels;
1025     char **styles;
1026     int    align;
1027     unsigned long flags, set_flags;
1028     char  *small_font_name;
1029     int    border_width;
1030     char  *shade_button[2];
1031 
1032     char *selection_color;
1033     char *grid_color;
1034     char *border_color;
1035 
1036 	int h_spacing, v_spacing ;
1037 
1038     balloonConfig *balloon_conf;
1039     MyStyleDefinition *style_defs;
1040     struct FreeStorageElem *more_stuff;
1041 
1042     /* these are generated after reading the config : */
1043     int gravity ;
1044     ARGB32  selection_color_argb;
1045     ARGB32  grid_color_argb;
1046     ARGB32  border_color_argb;
1047 #define DESK_ACTIVE     0
1048 #define DESK_INACTIVE   1
1049 #define DESK_STYLES     2
1050     struct MyStyle *MSDeskTitle[DESK_STYLES];
1051     struct MyStyle **MSDeskBack;
1052 
1053     ASFlagType  active_desk_bevel ;
1054     ASFlagType  inactive_desk_bevel ;
1055 
1056 }PagerConfig;
1057 
1058 PagerConfig *CreatePagerConfig (int ndesks);
1059 PagerConfig *ParsePagerOptions (const char *filename, char *myname, int desk1, int desk2);
1060 int WritePagerOptions (const char *filename, char *myname, int desk1, int desk2, PagerConfig * config, unsigned long flags);
1061 void DestroyPagerConfig (PagerConfig * config);
1062 
1063 /**************************************************************************/
1064 /***************************************************************************/
1065 /*                        MyBackground pasring definitions                 */
1066 /***************************************************************************/
1067 #define BGR_ID_START        	PAGER_ID_END
1068 #define BGR_MYBACKGROUND        BGR_ID_START
1069 #define BGR_USE		        BGR_ID_START+1
1070 #define BGR_CUT       		BGR_ID_START+2
1071 #define BGR_TINT	        BGR_ID_START+3
1072 #define BGR_SCALE	        BGR_ID_START+4
1073 #define BGR_ALIGN		BGR_ID_START+5
1074 #define BGR_PAD		        BGR_ID_START+6
1075 #define BGR_MYBACKGROUND_END    BGR_ID_START+7
1076 
1077 #define BGR_DESK_BACK     	BGR_ID_START+8
1078 #define BGR_ID_END        	BGR_ID_START+20
1079 
1080 typedef struct my_background_config
1081   {
1082 
1083     char *name;
1084     unsigned long flags;
1085     char *data;
1086     ASGeometry cut;
1087     char *tint;
1088     ASGeometry scale;
1089     char *pad;
1090     struct my_background_config *next;
1091   }
1092 MyBackgroundConfig;
1093 
1094 typedef struct desk_back_config
1095   {
1096     int desk;
1097     char *back_name;
1098     MyBackgroundConfig *back;
1099 
1100     struct desk_back_config *next;
1101   }
1102 DeskBackConfig;
1103 
1104 typedef struct
1105   {
1106     MyBackgroundConfig *my_backs;
1107     DeskBackConfig *my_desks;
1108 
1109     MyStyleDefinition *style_defs;
1110 
1111     struct FreeStorageElem *more_stuff;
1112   }
1113 ASetRootConfig;
1114 
1115 MyBackgroundConfig *ParseMyBackgroundOptions (struct FreeStorageElem * Storage, char *myname);
1116 ASetRootConfig *ParseASetRootOptions (const char *filename, char *myname);
1117 /*
1118  * all data members that has been used from ASetRootConfig structure, returned
1119  * by this call must be set to NULL, or memory allocated for them will be
1120  * deallocated by the following DestroyBaseConfig function !
1121  */
1122 
1123 void DestroyASetRootConfig (ASetRootConfig * config);
1124 void myback_parse (char *tline, FILE * fd, char **myname, int *mylook);
1125 void DestroyMyBackgroundConfig (MyBackgroundConfig ** head);
1126 
1127 
1128 /***************************************************************************/
1129 /***************************************************************************/
1130 /*                        WinList config parsing definitions               */
1131 /***************************************************************************/
1132 /* New winlist config :
1133  *
1134  *	*WinListGeometry		+x+y
1135  *  *WinListMinSize			WxH
1136  *  *WinListMaxSize			WxH
1137  *  *WinListMaxRows			count
1138  *  *WinListMaxColumns		count
1139  *  *WinListMinColWidth		width
1140  *  *WinListMaxColWidth		width
1141  *  *WinListFillRowsFirst
1142  *  *WinListUseSkipList
1143  *  *WinListUnfocusedStyle 	"style"
1144  *  *WinListFocusedStyle 	"style"
1145  *  *WinListStickyStyle 	"style"
1146  *	*WinListUseName			0|1|2|3   # 0 - Name, 1 - icon, 2 - res_name, 3 - res_class
1147  *  *WinListAlign           Left,Right,Top,Bottom
1148  *  *WinListBevel           None,Left,Right,Top, Bottom, NoOutline
1149  *  *WinListFBevel           None,Left,Right,Top, Bottom, NoOutline
1150  *  *WinListUBevel           None,Left,Right,Top, Bottom, NoOutline
1151  *  *WinListSBevel           None,Left,Right,Top, Bottom, NoOutline
1152  *  *WinListAction          [Click]1|2|3|4|5
1153  *  *WinListShapeToContents
1154  *
1155  * Depreciated functions :
1156  *
1157  *  *WinListMaxWidth        width
1158  *  *WinListOrientation		across|vertical
1159  *
1160  * Obsolete functions :
1161  *
1162  *  *WinListHideGeometry	WxH+x+y
1163  *  *WinListNoAnchor
1164  *  *WinListUseIconNames
1165  *  *WinListAutoHide
1166  */
1167 #define WINLIST_ID_START        		(BGR_ID_END+1)
1168 #define WINLIST_FillRowsFirst_ID		(WINLIST_ID_START)
1169 #define WINLIST_UseSkipList_ID			(WINLIST_ID_START+1)
1170 #define WINLIST_Geometry_ID				(WINLIST_ID_START+2)
1171 #define WINLIST_MinSize_ID				(WINLIST_ID_START+3)
1172 #define WINLIST_MaxSize_ID				(WINLIST_ID_START+4)
1173 #define WINLIST_MaxRows_ID				(WINLIST_ID_START+5)
1174 #define WINLIST_MaxColumns_ID			(WINLIST_ID_START+6)
1175 #define WINLIST_MaxColWidth_ID			(WINLIST_ID_START+7)
1176 #define WINLIST_MinColWidth_ID			(WINLIST_ID_START+8)
1177 #define WINLIST_UseName_ID				(WINLIST_ID_START+9)
1178 #define WINLIST_Align_ID                (WINLIST_ID_START+10)
1179 #define WINLIST_Bevel_ID                (WINLIST_ID_START+11)
1180 #define WINLIST_FBevel_ID               (WINLIST_ID_START+12)
1181 #define WINLIST_FocusedBevel_ID         WINLIST_FBevel_ID
1182 #define WINLIST_UBevel_ID               (WINLIST_ID_START+13)
1183 #define WINLIST_UnfocusedBevel_ID       WINLIST_UBevel_ID
1184 #define WINLIST_SBevel_ID               (WINLIST_ID_START+14)
1185 #define WINLIST_StickyBevel_ID          WINLIST_SBevel_ID
1186 #define WINLIST_Action_ID               (WINLIST_ID_START+15)
1187 #define WINLIST_UnfocusedStyle_ID       (WINLIST_ID_START+16)
1188 #define WINLIST_FocusedStyle_ID         (WINLIST_ID_START+17)
1189 #define WINLIST_StickyStyle_ID          (WINLIST_ID_START+18)
1190 #define WINLIST_UrgentStyle_ID          (WINLIST_ID_START+19)
1191 #define WINLIST_ShapeToContents_ID      (WINLIST_ID_START+20)
1192 #define WINLIST_CompositionMethod_ID    (WINLIST_ID_START+21)
1193 #define WINLIST_FCompositionMethod_ID   (WINLIST_ID_START+22)
1194 #define WINLIST_UCompositionMethod_ID   (WINLIST_ID_START+23)
1195 #define WINLIST_SCompositionMethod_ID   (WINLIST_ID_START+24)
1196 #define WINLIST_Spacing_ID              (WINLIST_ID_START+25)
1197 #define WINLIST_HSpacing_ID             (WINLIST_ID_START+26)
1198 #define WINLIST_VSpacing_ID             (WINLIST_ID_START+27)
1199 
1200 
1201 #define WINLIST_BALLOONS_ID             (WINLIST_ID_START+28)
1202 
1203 #define WINLIST_HideGeometry_ID         (WINLIST_ID_START+29)
1204 #define WINLIST_MaxWidth_ID             (WINLIST_ID_START+30)
1205 #define WINLIST_Orientation_ID          (WINLIST_ID_START+31)
1206 #define WINLIST_NoAnchor_ID             (WINLIST_ID_START+32)
1207 #define WINLIST_UseIconNames_ID         (WINLIST_ID_START+33)
1208 #define WINLIST_AutoHide_ID             (WINLIST_ID_START+34)
1209 
1210 #define WINLIST_ShowIcon_ID		  		(WINLIST_ID_START+35)
1211 #define WINLIST_IconLocation_ID         (WINLIST_ID_START+36)
1212 #define WINLIST_IconAlign_ID	        (WINLIST_ID_START+37)
1213 #define WINLIST_IconSize_ID				(WINLIST_ID_START+38)
1214 #define WINLIST_ScaleIconToTextHeight_ID (WINLIST_ID_START+39)
1215 #define WINLIST_NoCollides_ID 			(WINLIST_ID_START+40)
1216 #define WINLIST_AllowCollides_ID 		(WINLIST_ID_START+41)
1217 #define WINLIST_NoCollidesSpacing_ID	(WINLIST_ID_START+42)
1218 #define WINLIST_ShowHints_ID	  		(WINLIST_ID_START+43)
1219 
1220 #define WINLIST_ID_END                  (WINLIST_ID_START+50)
1221 
1222 /* config data structure */
1223 
1224 
1225 typedef struct WinListConfig
1226 {
1227 #define WINLIST_FillRowsFirst	(0x01<<0)
1228 #define WINLIST_UseSkipList		(0x01<<1)
1229 #define WINLIST_Geometry		(0x01<<2)
1230 #define WINLIST_MinSize			(0x01<<3)
1231 #define WINLIST_MaxSize			(0x01<<4)
1232 #define WINLIST_MaxRows			(0x01<<5)
1233 #define WINLIST_MaxColumns		(0x01<<6)
1234 #define WINLIST_MaxColWidth		(0x01<<7)
1235 #define WINLIST_MinColWidth		(0x01<<8)
1236 #define WINLIST_UseName			(0x01<<9)
1237 #define WINLIST_Align           (0x01<<10)
1238 #define WINLIST_FBevel          (0x01<<11)
1239 #define WINLIST_UBevel          (0x01<<12)
1240 #define WINLIST_SBevel          (0x01<<13)
1241 #define WINLIST_Bevel           (WINLIST_FBevel|WINLIST_UBevel|WINLIST_SBevel)
1242 #define WINLIST_ShapeToContents (0x01<<14)
1243 #define WINLIST_FCompositionMethod             (0x01<<15)
1244 #define WINLIST_UCompositionMethod             (0x01<<16)
1245 #define WINLIST_SCompositionMethod             (0x01<<17)
1246 #define WINLIST_CompositionMethod              (WINLIST_FCompositionMethod|WINLIST_UCompositionMethod|WINLIST_SCompositionMethod)
1247 
1248 #define WINLIST_HSpacing       	(0x01<<18)
1249 #define WINLIST_VSpacing       	(0x01<<19)
1250 #define WINLIST_Spacing       	(WINLIST_HSpacing|WINLIST_VSpacing)
1251 
1252 #define WINLIST_ShowIcon        (0x01<<20)
1253 #define WINLIST_IconLocation    (0x01<<21)
1254 #define WINLIST_IconAlign	    (0x01<<22)
1255 #define WINLIST_IconSize		(0x01<<23)
1256 #define WINLIST_ScaleIconToTextHeight (0x01<<24)
1257 #define WINLIST_NoCollidesSpacing	  (0x01<<25)
1258 #define WINLIST_ShowHints		(0x01<<26)
1259 
1260 
1261 #define 	ASWL_RowsFirst 				WINLIST_FillRowsFirst
1262 #define 	ASWL_UseSkipList			WINLIST_UseSkipList
1263 #define 	ASWL_ShowIcon				WINLIST_ShowIcon
1264 #define 	ASWL_ScaleIconToTextHeight	WINLIST_ScaleIconToTextHeight
1265 
1266 	ASModuleConfig asmodule_config;
1267 
1268 	ASFlagType	flags ;
1269 	ASFlagType	set_flags ;
1270 
1271     ASGeometry 	Geometry ;
1272     ASGeometry	   	MinSize ;
1273 	ASGeometry		MaxSize ;
1274 #define MAX_WINLIST_WINDOW_COUNT    512        /* 512 x 4 == 2048 == 1 page in memory */
1275 	unsigned int MaxRows, MaxColumns ;
1276 	unsigned int MaxColWidth, MinColWidth ;
1277 
1278 /* phony flags */
1279 #define WINLIST_UnfocusedStyle	0
1280 #define WINLIST_FocusedStyle 	0
1281 #define WINLIST_StickyStyle 	0
1282 #define WINLIST_UrgentStyle 	0
1283 	char *UnfocusedStyle ;
1284 	char *FocusedStyle ;
1285 	char *StickyStyle ;
1286 	char *UrgentStyle ;
1287 
1288 	ASNameTypes     UseName ; /* 0, 1, 2, 3 */
1289     ASFlagType      Align ;
1290     ASFlagType      FBevel, UBevel, SBevel ;
1291     int             UCompositionMethod, FCompositionMethod, SCompositionMethod;
1292     unsigned int    HSpacing, VSpacing;
1293     ASFlagType      IconAlign ;
1294 	int 			IconLocation ;
1295 	ASGeometry	 	IconSize ;
1296 
1297     char **Action[MAX_MOUSE_BUTTONS];
1298 
1299 	char **NoCollides ;
1300 	int  NoCollides_nitems ;
1301 	char **AllowCollides ;
1302 	int  AllowCollides_nitems ;
1303 
1304 	int NoCollidesSpacing ;
1305 
1306 #define WINLIST_DEFAULT_ShowHints	(BALLOON_SHOW_Name|BALLOON_SHOW_Comment)
1307 	ASFlagType ShowHints;
1308 
1309     /* calculated based on geometry : */
1310     int anchor_x, anchor_y ;
1311 	int gravity ;
1312 	struct wild_reg_exp **NoCollides_wrexp ;
1313 	struct wild_reg_exp **AllowCollides_wrexp ;
1314 }WinListConfig;
1315 
1316 ASModuleConfigClass *getWinListConfigClass() ;
1317 
1318 #define AS_WINLIST_CONFIG(p) AS_MODULE_CONFIG_TYPED(p,CONFIG_WinList_ID,WinListConfig)
1319 
1320 ASModuleConfig *CreateWinListConfig ();
1321 void DestroyWinListConfig (ASModuleConfig *config);
1322 void PrintWinListConfig (WinListConfig *config);
1323 int WriteWinListOptions (const char *filename, char *myname, WinListConfig * config, unsigned long flags);
1324 WinListConfig *ParseWinListOptions (const char *filename, char *myname);
1325 void MergeWinListOptions ( ASModuleConfig *to, ASModuleConfig *from);
1326 ASFlagType DigestWinListAlign( WinListConfig *Config, ASFlagType align );
1327 void CheckWinListConfigSanity(WinListConfig *Config,
1328 							  ASGeometry *default_geometry, int default_gravity,
1329 							  int max_columns_override, int max_rows_override );
1330 
1331 /***************************************************************************/
1332 /*                        ASMount config parsing definitions               */
1333 /***************************************************************************/
1334 /* ASMount config :
1335  *
1336  *	*ASMountTileSize		WxH
1337  *  *ASMountVertical
1338  *  *ASMountUnmountedStyle 	"style"
1339  *  *ASMountMountedStyle 	"style"
1340  *  *ASMountAlign           Left,Right,Top,Bottom
1341  *  *ASMountBevel           None,Left,Right,Top, Bottom, NoOutline
1342  *  *ASMountMountedBevel           None,Left,Right,Top, Bottom, NoOutline
1343  *  *ASMountUnmountedBevel           None,Left,Right,Top, Bottom, NoOutline
1344  *  *ASMountShapeToContents
1345  */
1346 #define ASMOUNT_ID_START        				(WINLIST_ID_END+1)
1347 #define ASMOUNT_TileSize_ID							(ASMOUNT_ID_START+3)
1348 #define ASMOUNT_Align_ID                (ASMOUNT_ID_START+10)
1349 #define ASMOUNT_Bevel_ID                (ASMOUNT_ID_START+11)
1350 #define ASMOUNT_MountedBevel_ID         (ASMOUNT_ID_START+12)
1351 #define ASMOUNT_UnmountedBevel_ID       (ASMOUNT_ID_START+13)
1352 #define ASMOUNT_UnmountedStyle_ID       (ASMOUNT_ID_START+14)
1353 #define ASMOUNT_MountedStyle_ID         (ASMOUNT_ID_START+15)
1354 #define ASMOUNT_ShapeToContents_ID      (ASMOUNT_ID_START+16)
1355 #define ASMOUNT_Vertical_ID 				    (ASMOUNT_ID_START+17)
1356 
1357 #define ASMOUNT_BALLOONS_ID             (ASMOUNT_ID_START+18)
1358 
1359 #define ASMOUNT_ShowHints_ID	  				(ASMOUNT_ID_START+19)
1360 
1361 #define ASMOUNT_ID_END                  (ASMOUNT_ID_START+30)
1362 
1363 /* config data structure */
1364 
1365 typedef struct ASMountConfig
1366 {
1367 #define ASMOUNT_TileSize				(0x01<<1)
1368 #define ASMOUNT_Align           (0x01<<2)
1369 #define ASMOUNT_MountedBevel    (0x01<<3)
1370 #define ASMOUNT_UnmountedBevel  (0x01<<4)
1371 #define ASMOUNT_Bevel           (WINLIST_FBevel|WINLIST_UBevel|WINLIST_SBevel)
1372 #define ASMOUNT_ShapeToContents (0x01<<5)
1373 #define ASMOUNT_Vertical				(0x01<<6)
1374 #define ASMOUNT_ShowHints				(0x01<<7)
1375 
1376 	ASModuleConfig asmodule_config;
1377 
1378 	ASFlagType	flags ;
1379 	ASFlagType	set_flags ;
1380 
1381   ASGeometry 	TileSize;
1382 
1383 /* phony flags */
1384 #define ASMOUNT_UnmountedStyle	0
1385 #define ASMOUNT_MountedStyle 	0
1386 	char *UnmountedStyle ;
1387 	char *MountedStyle ;
1388 
1389   ASFlagType      Align ;
1390   ASFlagType      MountedBevel, UnmountedBevel;
1391 
1392 }ASMountConfig;
1393 
1394 ASModuleConfigClass *getASMountConfigClass() ;
1395 
1396 #define AS_ASMOUNT_CONFIG(p) AS_MODULE_CONFIG_TYPED(p,CONFIG_ASMount_ID,ASMountConfig)
1397 
1398 ASModuleConfig *CreateASMountConfig ();
1399 void DestroyASMountConfig (ASModuleConfig *config);
1400 void PrintASMountConfig (ASMountConfig *config);
1401 int WriteASMountOptions (const char *filename, char *myname, WinListConfig * config, unsigned long flags);
1402 ASMountConfig *ParseASMountOptions (const char *filename, char *myname);
1403 void MergeASMountOptions ( ASModuleConfig *to, ASModuleConfig *from);
1404 ASFlagType DigestASMountAlign (ASMountConfig *Config, ASFlagType align );
1405 void CheckASMountConfigSanity(ASMountConfig *Config, ASGeometry *default_tile_size);
1406 
1407 /**************************************************************************/
1408 /*                        database pasring definitions                    */
1409 /**************************************************************************/
1410 #define GRAVITY_ID_START            (ASMOUNT_ID_END+1)
1411 
1412 #define GRAVITY_NorthWest_ID        (GRAVITY_ID_START+NorthWestGravity)
1413 #define GRAVITY_North_ID            (GRAVITY_ID_START+NorthGravity)
1414 #define GRAVITY_NorthEast_ID        (GRAVITY_ID_START+NorthEastGravity)
1415 #define GRAVITY_West_ID             (GRAVITY_ID_START+WestGravity)
1416 #define GRAVITY_Center_ID           (GRAVITY_ID_START+CenterGravity)
1417 #define GRAVITY_East_ID             (GRAVITY_ID_START+EastGravity)
1418 #define GRAVITY_SouthWest_ID        (GRAVITY_ID_START+SouthWestGravity)
1419 #define GRAVITY_South_ID            (GRAVITY_ID_START+SouthGravity)
1420 #define GRAVITY_SouthEast_ID        (GRAVITY_ID_START+SouthEastGravity)
1421 #define GRAVITY_Static_ID           (GRAVITY_ID_START+StaticGravity)
1422 #define GRAVITY_ID_END              (GRAVITY_ID_START+11)
1423 
1424 #define DATABASE_ID_START           (GRAVITY_ID_END+1)
1425 #define DATABASE_STYLE_ID            DATABASE_ID_START
1426 #define DATABASE_Icon_ID            (DATABASE_ID_START+1)
1427 #define DATABASE_NoIcon_ID          (DATABASE_ID_START+2)
1428 #define DATABASE_FocusStyle_ID		(DATABASE_ID_START+3)
1429 #define DATABASE_UnfocusStyle_ID	(DATABASE_ID_START+4)
1430 #define DATABASE_StickyStyle_ID		(DATABASE_ID_START+5)
1431 #define DATABASE_NoIconTitle_ID		(DATABASE_ID_START+6)
1432 #define DATABASE_IconTitle_ID		(DATABASE_ID_START+7)
1433 #define DATABASE_Focus_ID           (DATABASE_ID_START+8)
1434 #define DATABASE_NoFocus_ID         (DATABASE_ID_START+9)
1435 #define DATABASE_NoTitle_ID         (DATABASE_ID_START+10)
1436 #define DATABASE_Title_ID           (DATABASE_ID_START+11)
1437 #define DATABASE_NoHandles_ID		(DATABASE_ID_START+12)
1438 #define DATABASE_Handles_ID         (DATABASE_ID_START+13)
1439 #define DATABASE_NoButton_ID		(DATABASE_ID_START+14)
1440 #define DATABASE_Button_ID          (DATABASE_ID_START+15)
1441 #define DATABASE_WindowListSkip_ID	(DATABASE_ID_START+16)
1442 #define DATABASE_WindowListHit_ID	(DATABASE_ID_START+17)
1443 #define DATABASE_CirculateSkip_ID	(DATABASE_ID_START+18)
1444 #define DATABASE_CirculateHit_ID	(DATABASE_ID_START+19)
1445 #define DATABASE_StartIconic_ID		(DATABASE_ID_START+20)
1446 #define DATABASE_StartNormal_ID		(DATABASE_ID_START+21)
1447 #define DATABASE_Layer_ID           (DATABASE_ID_START+22)
1448 #define DATABASE_StaysOnTop_ID		(DATABASE_ID_START+23)
1449 #define DATABASE_StaysPut_ID		(DATABASE_ID_START+24)
1450 #define DATABASE_StaysOnBack_ID		(DATABASE_ID_START+25)
1451 #define DATABASE_AvoidCover_ID		(DATABASE_ID_START+26)
1452 #define DATABASE_AllowCover_ID		(DATABASE_ID_START+27)
1453 #define DATABASE_VerticalTitle_ID	(DATABASE_ID_START+28)
1454 #define DATABASE_HorizontalTitle_ID	(DATABASE_ID_START+29)
1455 #define DATABASE_Sticky_ID          (DATABASE_ID_START+30)
1456 #define DATABASE_Slippery_ID		(DATABASE_ID_START+31)
1457 #define DATABASE_BorderWidth_ID	 	(DATABASE_ID_START+32)
1458 #define DATABASE_HandleWidth_ID		(DATABASE_ID_START+33)
1459 #define DATABASE_StartsOnDesk_ID	(DATABASE_ID_START+34)
1460 #define DATABASE_ViewportX_ID		(DATABASE_ID_START+35)
1461 #define DATABASE_ViewportY_ID		(DATABASE_ID_START+36)
1462 #define DATABASE_StartsAnywhere_ID	(DATABASE_ID_START+37)
1463 #define DATABASE_NoFrame_ID         (DATABASE_ID_START+38)
1464 #define DATABASE_Frame_ID           (DATABASE_ID_START+39)
1465 #define DATABASE_Windowbox_ID       (DATABASE_ID_START+40)
1466 #define DATABASE_DefaultGeometry_ID        (DATABASE_ID_START+41)
1467 #define DATABASE_OverrideGravity_ID        (DATABASE_ID_START+42)
1468 #define DATABASE_HonorPPosition_ID         (DATABASE_ID_START+43)
1469 #define DATABASE_NoPPosition_ID            (DATABASE_ID_START+44)
1470 #define DATABASE_HonorGroupHints_ID        (DATABASE_ID_START+45)
1471 #define DATABASE_NoGroupHints_ID           (DATABASE_ID_START+46)
1472 #define DATABASE_HonorTransientHints_ID    (DATABASE_ID_START+47)
1473 #define DATABASE_NoTransientHints_ID       (DATABASE_ID_START+48)
1474 #define DATABASE_HonorMotifHints_ID        (DATABASE_ID_START+49)
1475 #define DATABASE_NoMotifHints_ID           (DATABASE_ID_START+50)
1476 #define DATABASE_HonorGnomeHints_ID        (DATABASE_ID_START+51)
1477 #define DATABASE_NoGnomeHints_ID           (DATABASE_ID_START+52)
1478 #define DATABASE_HonorKDEHints_ID          (DATABASE_ID_START+53)
1479 #define DATABASE_NoKDEHints_ID             (DATABASE_ID_START+54)
1480 #define DATABASE_HonorExtWMHints_ID        (DATABASE_ID_START+55)
1481 #define DATABASE_NoExtWMHints_ID           (DATABASE_ID_START+56)
1482 #define DATABASE_HonorXResources_ID        (DATABASE_ID_START+57)
1483 #define DATABASE_NoXResources_ID           (DATABASE_ID_START+58)
1484 #define DATABASE_FocusOnMap_ID             (DATABASE_ID_START+59)
1485 #define DATABASE_NoFocusOnMap_ID           (DATABASE_ID_START+60)
1486 #define DATABASE_LongLiving_ID             (DATABASE_ID_START+61)
1487 #define DATABASE_ShortLiving_ID            (DATABASE_ID_START+62)
1488 #define DATABASE_IgnoreConfig_ID           (DATABASE_ID_START+63)
1489 #define DATABASE_HonorConfig_ID            (DATABASE_ID_START+64)
1490 #define DATABASE_UseCurrentViewport_ID     (DATABASE_ID_START+65)
1491 #define DATABASE_UseAnyViewport_ID		   (DATABASE_ID_START+66)
1492 #define DATABASE_Fullscreen_ID             (DATABASE_ID_START+67)
1493 #define DATABASE_NoFullscreen_ID		   (DATABASE_ID_START+68)
1494 #define DATABASE_WindowOpacity_ID		   (DATABASE_ID_START+69)
1495 #define DATABASE_IgnoreRestack_ID          (DATABASE_ID_START+70)
1496 #define DATABASE_HonorRestack_ID            (DATABASE_ID_START+71)
1497 #define DATABASE_PagerHit_ID            (DATABASE_ID_START+72)
1498 #define DATABASE_PagerSkip_ID            (DATABASE_ID_START+73)
1499 
1500 
1501 #define DATABASE_ID_END             (DATABASE_ID_START+74)
1502 
1503 /* we use name_list structure 1 to 1 in here, as it does not requre any
1504    preprocessing from us
1505  */
1506 struct name_list;
1507 
1508 unsigned int translate_title_button (unsigned int user_button);
1509 unsigned int translate_title_button_back (unsigned int title_button);
1510 struct name_list *ParseDatabaseOptions (const char *filename, char *myname);
1511 struct name_list *string2DatabaseStyle (char *style_txt);
1512 
1513 int WriteDatabaseOptions (const char *filename, char *myname,
1514 			  struct name_list *config, unsigned long flags);
1515 Bool ReloadASDatabase();
1516 
1517 /**************************************************************************/
1518 /*                        Wharf pasring definitions                       */
1519 /**************************************************************************/
1520 
1521 #define WHARF_ID_START          (DATABASE_ID_END+1)
1522 #define WHARF_Wharf_ID			(WHARF_ID_START)
1523 #define WHARF_FolderEnd_ID		(WHARF_ID_START+1)
1524 #define WHARF_Geometry_ID		(WHARF_ID_START+2)
1525 #define WHARF_Rows_ID			(WHARF_ID_START+3)
1526 #define WHARF_Columns_ID		(WHARF_ID_START+4)
1527 #define WHARF_NoPush_ID			(WHARF_ID_START+5)
1528 #define WHARF_FullPush_ID		(WHARF_ID_START+6)
1529 #define WHARF_NoBorder_ID		(WHARF_ID_START+7)
1530 #define WHARF_WithdrawStyle_ID		(WHARF_ID_START+8)
1531 /* the NoWithdraw option is undocumented, deprecated, and
1532  ** may be removed at Wharf's maintainer's discretion */
1533 #define WHARF_NoWithdraw_ID  		(WHARF_ID_START+9)
1534 #define WHARF_ForceSize_ID 		(WHARF_ID_START+10)
1535 /* TextureType, MaxColors, BgColor, TextureColor, and Pixmap are obsolete */
1536 #define WHARF_TextureType_ID		(WHARF_ID_START+11)
1537 #define WHARF_MaxColors_ID 		(WHARF_ID_START+12)
1538 #define WHARF_BgColor_ID 		(WHARF_ID_START+13)
1539 #define WHARF_TextureColor_ID		(WHARF_ID_START+14)
1540 #define WHARF_Pixmap_ID 		(WHARF_ID_START+15)
1541 #define WHARF_AnimateStepsMain_ID	(WHARF_ID_START+16)
1542 #define WHARF_AnimateSteps_ID		(WHARF_ID_START+17)
1543 #define WHARF_AnimateDelay_ID		(WHARF_ID_START+18)
1544 #define WHARF_AnimateMain_ID 		(WHARF_ID_START+19)
1545 #define WHARF_Animate_ID		(WHARF_ID_START+20)
1546 
1547 #define WHARF_Player_ID 		(WHARF_ID_START+21)
1548 #define WHARF_Sound_ID 			(WHARF_ID_START+22)
1549 #define WHARF_ShowLabel_ID      (WHARF_ID_START+23)
1550 #define WHARF_LabelLocation_ID  (WHARF_ID_START+24)
1551 #define WHARF_FlipLabel_ID      (WHARF_ID_START+25)
1552 #define WHARF_FitContents_ID    (WHARF_ID_START+26)
1553 #define WHARF_ShapeToContents_ID    (WHARF_ID_START+27)
1554 #define WHARF_AlignContents_ID  (WHARF_ID_START+28)
1555 #define WHARF_Bevel_ID  (WHARF_ID_START+29)
1556 #define WHARF_CompositionMethod_ID  (WHARF_ID_START+30)
1557 #define WHARF_FolderOffset_ID   (WHARF_ID_START+31)
1558 #define WHARF_OrthogonalFolderOffset_ID   (WHARF_ID_START+32)
1559 #define WHARF_StretchBackground_ID   (WHARF_ID_START+33)
1560 #define WHARF_ShowHints_ID		(WHARF_ID_START+34)
1561 
1562 #define WHARF_ID_END            (WHARF_ID_START+35)
1563 #define WFUNC_START_ID			(WHARF_ID_END)
1564 
1565 #define WFUNC_Folders_ID		(WFUNC_START_ID)
1566 #define WFUNC_Swallow_ID		(WFUNC_START_ID+1)
1567 
1568 #define	WFUNC_ID_END			(WFUNC_START_ID+10)
1569 
1570 #define WHINT_START_ID			(WFUNC_ID_END)
1571 
1572 #define WHINT_Name_ID			(WHINT_START_ID)
1573 #define WHINT_Comment_ID		(WHINT_START_ID+1)
1574 #define WHINT_Exec_ID			(WHINT_START_ID+2)
1575 #define WHINT_GenericName_ID	(WHINT_START_ID+3)
1576 
1577 #define	WHINT_ID_END			(WHINT_START_ID+4)
1578 
1579 #define WHEV_PUSH		0
1580 #define WHEV_CLOSE_FOLDER	1
1581 #define WHEV_OPEN_FOLDER	2
1582 #define WHEV_CLOSE_MAIN		3
1583 #define WHEV_OPEN_MAIN		4
1584 #define WHEV_DROP		5
1585 #define WHEV_MAX_EVENTS		6
1586 
1587 #define WHEV_START_ID			(WHINT_ID_END)
1588 
1589 #define WHEV_Id2Code(id)		((id)-WHEV_START_ID)
1590 #define WHEV_Code2Id(code)		((code)+WHEV_START_ID)
1591 
1592 #define WHEV_PUSH_ID			WHEV_Code2Id(WHEV_PUSH)
1593 #define WHEV_CLOSE_FOLDER_ID		WHEV_Code2Id(WHEV_CLOSE_FOLDER)
1594 #define WHEV_OPEN_FOLDER_ID		WHEV_Code2Id(WHEV_OPEN_FOLDER)
1595 #define WHEV_CLOSE_MAIN_ID		WHEV_Code2Id(WHEV_CLOSE_MAIN)
1596 #define WHEV_OPEN_MAIN_ID		WHEV_Code2Id(WHEV_OPEN_MAIN)
1597 #define WHEV_DROP_ID			WHEV_Code2Id(WHEV_DROP)
1598 
1599 #define WHEV_END_ID			WHEV_Code2Id(WHEV_MAX_EVENTS)
1600 
1601 
1602 struct WharfFolder;
1603 struct FunctionData;
1604 
1605 typedef struct WharfButtonContent
1606 {
1607 	char **icon;
1608   	struct FunctionData *function;
1609 	Bool unavailable ;
1610 }WharfButtonContent ;
1611 
1612 typedef struct WharfButton
1613 {
1614 #define WHARF_BUTTON_WIDTH			(0x01<<0)
1615 #define WHARF_BUTTON_HEIGHT	  		(0x01<<1)
1616 #define WHARF_BUTTON_SIZE	  		(WHARF_BUTTON_HEIGHT|WHARF_BUTTON_WIDTH)
1617 #define WHARF_BUTTON_TRANSIENT		(0x01<<2)
1618 #define WHARF_BUTTON_DISABLED		(0x01<<3)
1619 #define WHARF_BUTTON_TITLE_IS_UTF8		(0x01<<4)
1620 #define WHARF_BUTTON_COMMENT_IS_UTF8	(0x01<<5)
1621 #define WHARF_BUTTON_GEN_NAME_IS_UTF8	(0x01<<6)
1622 
1623   unsigned long set_flags;
1624   char *title;
1625   char *comment;
1626   char *generic_name;
1627   unsigned int width, height;
1628 
1629   /* there could be several functions/icons assigned to the wharf button,
1630    * we will use the first available one (non-exec function or exec with available application ) */
1631   WharfButtonContent *contents ;
1632   int contents_num, selected_content ;
1633 
1634   struct WharfButton  *next;
1635   struct WharfButton  *folder;
1636 }
1637 WharfButton;
1638 
1639 #define  WHARF_GEOMETRY         (0x01<<0)
1640 #define  WHARF_ROWS             (0x01<<1)
1641 #define  WHARF_COLUMNS			(0x01<<2)
1642 #define  WHARF_WITHDRAW_STYLE	(0x01<<3)
1643 #define  WHARF_FORCE_SIZE		(0x01<<4)
1644 #define  WHARF_ANIMATE_STEPS		(0x01<<5)
1645 #define  WHARF_ANIMATE_STEPS_MAIN	(0x01<<6)
1646 #define  WHARF_ANIMATE_DELAY		(0x01<<7)
1647 #define  WHARF_ANIMATE_MAIN		(0x01<<8)
1648 #define  WHARF_ANIMATE			(0x01<<9)
1649 #define  WHARF_SOUND			(0x01<<10)
1650 #define  WHARF_SHOW_LABEL       (0x01<<11)
1651 #define  WHARF_LabelLocation 	 (0x01<<12)
1652 #define  WHARF_FlipLabel         (0x01<<13)
1653 #define  WHARF_FitContents  	 (0x01<<14)
1654 #define  WHARF_ShapeToContents   (0x01<<15)
1655 #define  WHARF_AlignContents	 (0x01<<16)
1656 #define  WHARF_Bevel             (0x01<<17)
1657 #define  WHARF_ShowHints         (0x01<<18)
1658 #define  WHARF_CompositionMethod (0x01<<19)
1659 #define  WHARF_FolderOffset	 	 (0x01<<20)
1660 #define  WHARF_OrthogonalFolderOffset  (0x01<<21)
1661 #define  WHARF_StretchBackground   (0x01<<22)
1662 
1663 /* obsolete stuff - delete as neccessary : */
1664 #define  WHARF_TEXTURE_TYPE		(0x01<<23)
1665 #define  WHARF_BG_COLOR			(0x01<<24)
1666 #define  WHARF_TEXTURE_COLOR	(0x01<<25)
1667 #define  WHARF_PIXMAP			(0x01<<26)
1668 #define  WHARF_NO_WITHDRAW		(0x01<<27)
1669 #define  WHARF_NO_PUSH			(0x01<<28)
1670 #define  WHARF_FULL_PUSH		(0x01<<29)
1671 #define  WHARF_NO_BORDER		(0x01<<30)
1672 
1673 
1674 typedef struct
1675 {
1676     unsigned long set_flags;
1677     unsigned long flags;
1678 
1679     ASGeometry geometry;
1680     unsigned int rows, columns;
1681 #define NO_WITHDRAW                         0
1682 #define WITHDRAW_ON_ANY_BUTTON              1
1683 #define WITHDRAW_ON_EDGE_BUTTON             2
1684 #define WITHDRAW_ON_ANY_BUTTON_AND_SHOW     3
1685 #define WITHDRAW_ON_EDGE_BUTTON_AND_SHOW    4
1686 #define WITHDRAW_ON_ANY(c)   ((c)->withdraw_style == WITHDRAW_ON_ANY_BUTTON  || (c)->withdraw_style == WITHDRAW_ON_ANY_BUTTON_AND_SHOW )
1687 #define WITHDRAW_ON_EDGE(c)  ((c)->withdraw_style == WITHDRAW_ON_EDGE_BUTTON || (c)->withdraw_style == WITHDRAW_ON_EDGE_BUTTON_AND_SHOW )
1688     unsigned int withdraw_style;
1689     ASGeometry force_size;
1690     unsigned int texture_type;
1691     char *bg_color, *texture_color;
1692     char *pixmap;
1693     unsigned int animate_steps, animate_steps_main, animate_delay;
1694     char *sounds[WHEV_MAX_EVENTS];
1695     WharfButton *root_folder;
1696 
1697     unsigned int LabelLocation;
1698 
1699 #define WHARF_DEFAULT_AlignContents 	ALIGN_CENTER
1700     ASFlagType   AlignContents;
1701 	ASFlagType   Bevel;
1702 
1703 #define WHARF_SHOW_HINT_Name			BALLOON_SHOW_Name
1704 #define WHARF_SHOW_HINT_Comment			BALLOON_SHOW_Comment
1705 #define WHARF_SHOW_HINT_Exec			BALLOON_SHOW_Exec
1706 #define WHARF_SHOW_HINT_GenericName		BALLOON_SHOW_GenericName
1707 #define WHARF_DEFAULT_ShowHints	(WHARF_SHOW_HINT_Name|WHARF_SHOW_HINT_Comment|WHARF_SHOW_HINT_Exec)
1708 	ASFlagType   ShowHints ;
1709 
1710     balloonConfig *balloon_conf;
1711     MyStyleDefinition *style_defs;
1712 
1713     struct FreeStorageElem *more_stuff;
1714 
1715 #define WHARF_DEFAULT_CompositionMethod 	TEXTURE_TRANSPIXMAP_ALPHA
1716     int CompositionMethod ;
1717 
1718 #define WHARF_DEFAULT_FolderOffset			-5
1719 #define WHARF_DEFAULT_OrthogonalFolderOffset		0
1720 	int FolderOffset, OrthogonalFolderOffset ;
1721 }
1722 WharfConfig;
1723 
1724 
1725 unsigned long WharfSpecialFunc (struct ConfigDef * config);
1726 WharfButton *CreateWharfButton ();
1727 WharfConfig *CreateWharfConfig ();
1728 
1729 void DestroyWharfButton (WharfButton **pbtn);
1730 void DestroyWharfConfig (WharfConfig * config);
1731 
1732 WharfConfig *ParseWharfOptions (const char *filename, char *myname);
1733 void PrintWharfConfig(WharfConfig *config );
1734 
1735 int WriteWharfOptions (const char *filename, char *myname,
1736 		       WharfConfig * config, unsigned long flags);
1737 
1738 /***************************************************************************/
1739 /***************************************************************************/
1740 /*                 Supported HINTS parsing definitions                     */
1741 /***************************************************************************/
1742 
1743 #define HINTS_ID_START              (WHEV_END_ID+1)
1744 #define HINTS_ICCCM_ID              (HINTS_ID_START+HINTS_ICCCM)
1745 #define HINTS_GroupLead_ID          (HINTS_ID_START+HINTS_GroupLead)
1746 #define HINTS_Transient_ID          (HINTS_ID_START+HINTS_Transient)
1747 #define HINTS_Motif_ID              (HINTS_ID_START+HINTS_Motif)
1748 #define HINTS_Gnome_ID              (HINTS_ID_START+HINTS_Gnome)
1749 #define HINTS_KDE_ID                (HINTS_ID_START+HINTS_KDE)
1750 #define HINTS_ExtendedWM_ID         (HINTS_ID_START+HINTS_ExtendedWM)
1751 #define HINTS_XResources_ID         (HINTS_ID_START+HINTS_XResources)
1752 #define HINTS_ASDatabase_ID         (HINTS_ID_START+HINTS_ASDatabase)
1753 #define HINTS_ID_END                (HINTS_ID_START+HINTS_Supported)
1754 
1755 /****************************************************************************/
1756 /*                                LOOK OPTIONS 	   		   	    */
1757 /****************************************************************************/
1758 #define DESK_CONFIG_BACK	0
1759 #define DESK_CONFIG_LAYOUT	1
1760 
1761 #define LOOK_ID_START               (HINTS_ID_END+1)
1762 
1763 #define LOOK_DEPRECIATED_ID_START	(LOOK_ID_START)
1764 #define LOOK_Font_ID			(LOOK_DEPRECIATED_ID_START)
1765 #define LOOK_WindowFont_ID		(LOOK_DEPRECIATED_ID_START+1)
1766 #define LOOK_MTitleForeColor_ID		(LOOK_DEPRECIATED_ID_START+2)
1767 #define LOOK_MTitleBackColor_ID		(LOOK_DEPRECIATED_ID_START+3)
1768 #define LOOK_MenuForeColor_ID		(LOOK_DEPRECIATED_ID_START+4)
1769 #define LOOK_MenuBackColor_ID		(LOOK_DEPRECIATED_ID_START+5)
1770 #define LOOK_MenuHiForeColor_ID		(LOOK_DEPRECIATED_ID_START+6)
1771 #define LOOK_MenuHiBackColor_ID		(LOOK_DEPRECIATED_ID_START+7)
1772 #define LOOK_MenuStippleColor_ID	(LOOK_DEPRECIATED_ID_START+8)
1773 #define LOOK_StdForeColor_ID		(LOOK_DEPRECIATED_ID_START+9)
1774 #define LOOK_StdBackColor_ID		(LOOK_DEPRECIATED_ID_START+10)
1775 #define LOOK_StickyForeColor_ID 	(LOOK_DEPRECIATED_ID_START+11)
1776 #define LOOK_StickyBackColor_ID 	(LOOK_DEPRECIATED_ID_START+12)
1777 #define LOOK_HiForeColor_ID		(LOOK_DEPRECIATED_ID_START+13)
1778 #define LOOK_HiBackColor_ID		(LOOK_DEPRECIATED_ID_START+14)
1779 #define LOOK_IconFont_ID		(LOOK_DEPRECIATED_ID_START+15)
1780 #define LOOK_TitleTextMode_ID		(LOOK_DEPRECIATED_ID_START+16)
1781 
1782 #define LOOK_TextureTypes_ID		(LOOK_DEPRECIATED_ID_START+17)
1783 #define LOOK_TextureMaxColors_ID	(LOOK_DEPRECIATED_ID_START+18)
1784 #define LOOK_TitleTextureColor_ID	(LOOK_DEPRECIATED_ID_START+19)	/* title */
1785 #define LOOK_UTitleTextureColor_ID	(LOOK_DEPRECIATED_ID_START+20)	/* unfoc tit */
1786 #define LOOK_STitleTextureColor_ID	(LOOK_DEPRECIATED_ID_START+21)	/* stic tit */
1787 #define LOOK_MTitleTextureColor_ID	(LOOK_DEPRECIATED_ID_START+22)	/* menu title */
1788 #define LOOK_MenuTextureColor_ID	(LOOK_DEPRECIATED_ID_START+23)	/* menu items */
1789 #define LOOK_MenuHiTextureColor_ID	(LOOK_DEPRECIATED_ID_START+24)	/* sel items */
1790 #define LOOK_MenuPixmap_ID		(LOOK_DEPRECIATED_ID_START+25)	/* menu entry */
1791 #define LOOK_MenuHiPixmap_ID		(LOOK_DEPRECIATED_ID_START+26)	/* hil m entr */
1792 #define LOOK_MTitlePixmap_ID		(LOOK_DEPRECIATED_ID_START+27)	/* menu title */
1793 #define LOOK_TitlePixmap_ID		(LOOK_DEPRECIATED_ID_START+28)	/* foc tit */
1794 #define LOOK_UTitlePixmap_ID		(LOOK_DEPRECIATED_ID_START+29)	/* unfoc tit */
1795 #define LOOK_STitlePixmap_ID		(LOOK_DEPRECIATED_ID_START+30)	/* stick tit */
1796 
1797 #define LOOK_ButtonTextureType_ID	(LOOK_DEPRECIATED_ID_START+31)
1798 #define LOOK_ButtonBgColor_ID		(LOOK_DEPRECIATED_ID_START+32)
1799 #define LOOK_ButtonTextureColor_ID	(LOOK_DEPRECIATED_ID_START+33)
1800 #define LOOK_ButtonMaxColors_ID		(LOOK_DEPRECIATED_ID_START+34)
1801 #define LOOK_ButtonPixmap_ID		(LOOK_DEPRECIATED_ID_START+35)
1802 
1803 #define LOOK_DEPRECIATED_ID_END		(LOOK_DEPRECIATED_ID_START+48)
1804 
1805 /* non depreciated options : */
1806 #define LOOK_SUPPORTED_ID_START		(LOOK_DEPRECIATED_ID_END)
1807 
1808 #define LOOK_IconBox_ID							(LOOK_SUPPORTED_ID_START+1)
1809 #define LOOK_MyStyle_ID							(LOOK_SUPPORTED_ID_START+3)
1810 #define LOOK_MyBackground_ID					(LOOK_SUPPORTED_ID_START+4)
1811 #define LOOK_DeskBack_ID						(LOOK_SUPPORTED_ID_START+5)
1812 #define LOOK_asetrootDeskBack_ID				(LOOK_SUPPORTED_ID_START+6)
1813 #define LOOK_MyFrame_ID							(LOOK_SUPPORTED_ID_START+7)
1814 #define LOOK_DefaultFrame_ID					(LOOK_SUPPORTED_ID_START+8)
1815 #define LOOK_DontDrawBackground_ID				(LOOK_SUPPORTED_ID_START+9)
1816 #define LOOK_CustomCursor_ID					(LOOK_SUPPORTED_ID_START+10)
1817 #define LOOK_CursorFore_ID						(LOOK_SUPPORTED_ID_START+11)
1818 #define LOOK_CursorBack_ID						(LOOK_SUPPORTED_ID_START+12)
1819 #define LOOK_Cursor_ID							(LOOK_SUPPORTED_ID_START+13)
1820 #define LOOK_MenuPinOn_ID						(LOOK_SUPPORTED_ID_START+14)
1821 #define LOOK_MArrowPixmap_ID					(LOOK_SUPPORTED_ID_START+15)
1822 #define LOOK_TitlebarNoPush_ID					(LOOK_SUPPORTED_ID_START+16)
1823 #define LOOK_TextureMenuItemsIndividually_ID	(LOOK_SUPPORTED_ID_START+17)
1824 #define LOOK_MenuMiniPixmaps_ID					(LOOK_SUPPORTED_ID_START+18)
1825 #define LOOK_TitleTextAlign_ID					(LOOK_SUPPORTED_ID_START+19)
1826 #define LOOK_TitleButtonSpacingLeft_ID			(LOOK_SUPPORTED_ID_START+20)
1827 #define LOOK_TitleButtonSpacingRight_ID			(LOOK_SUPPORTED_ID_START+21)
1828 #define LOOK_TitleButtonSpacing_ID				(LOOK_SUPPORTED_ID_START+22)
1829 #define LOOK_TitleButtonXOffsetLeft_ID			(LOOK_SUPPORTED_ID_START+23)
1830 #define LOOK_TitleButtonXOffsetRight_ID			(LOOK_SUPPORTED_ID_START+24)
1831 #define LOOK_TitleButtonXOffset_ID				(LOOK_SUPPORTED_ID_START+25)
1832 #define LOOK_TitleButtonYOffsetLeft_ID			(LOOK_SUPPORTED_ID_START+26)
1833 #define LOOK_TitleButtonYOffsetRight_ID			(LOOK_SUPPORTED_ID_START+27)
1834 #define LOOK_TitleButtonYOffset_ID				(LOOK_SUPPORTED_ID_START+28)
1835 #define LOOK_TitleButtonStyle_ID				(LOOK_SUPPORTED_ID_START+29)
1836 #define LOOK_TitleButtonOrder_ID				(LOOK_SUPPORTED_ID_START+30)
1837 #define LOOK_ResizeMoveGeometry_ID				(LOOK_SUPPORTED_ID_START+31)
1838 #define LOOK_StartMenuSortMode_ID				(LOOK_SUPPORTED_ID_START+32)
1839 #define LOOK_DrawMenuBorders_ID					(LOOK_SUPPORTED_ID_START+33)
1840 #define LOOK_ButtonSize_ID						(LOOK_SUPPORTED_ID_START+34)
1841 #define LOOK_ButtonIconSpacing_ID			 	(LOOK_SUPPORTED_ID_START+35)
1842 #define LOOK_ButtonBevel_ID					 	(LOOK_SUPPORTED_ID_START+36)
1843 #define LOOK_ButtonAlign_ID					 	(LOOK_SUPPORTED_ID_START+37)
1844 #define LOOK_SeparateButtonTitle_ID				(LOOK_SUPPORTED_ID_START+38)
1845 #define LOOK_RubberBand_ID						(LOOK_SUPPORTED_ID_START+39)
1846 #define LOOK_WindowStyle_ID_START				(LOOK_SUPPORTED_ID_START+40)
1847 
1848 #define LOOK_IconsGrowVertically_ID                             (LOOK_SUPPORTED_ID_START+41)
1849 
1850 #define LOOK_DefaultStyle_ID					LOOK_WindowStyle_ID_START
1851 #define LOOK_FWindowStyle_ID					(LOOK_WindowStyle_ID_START+1)
1852 #define LOOK_UWindowStyle_ID					(LOOK_WindowStyle_ID_START+2)
1853 #define LOOK_SWindowStyle_ID					(LOOK_WindowStyle_ID_START+3)
1854 #define LOOK_WindowStyle_ID_END					(LOOK_WindowStyle_ID_START+3)
1855 #define LOOK_MenuStyle_ID_START					(LOOK_WindowStyle_ID_END+1)
1856 #define LOOK_MenuItemStyle_ID					(LOOK_MenuStyle_ID_START)
1857 #define LOOK_MenuTitleStyle_ID					(LOOK_MenuStyle_ID_START+1)
1858 #define LOOK_MenuHiliteStyle_ID					(LOOK_MenuStyle_ID_START+2)
1859 #define LOOK_MenuStippleStyle_ID				(LOOK_MenuStyle_ID_START+3)
1860 #define LOOK_MenuSubItemStyle_ID				(LOOK_MenuStyle_ID_START+4)
1861 #define LOOK_MenuHiTitleStyle_ID				(LOOK_MenuStyle_ID_START+6)
1862 #define LOOK_MenuStyle_ID_END					(LOOK_MenuStyle_ID_START+6)
1863 #define LOOK_MenuItemCompositionMethod_ID		(LOOK_MenuStyle_ID_END+1)
1864 #define LOOK_MenuHiliteCompositionMethod_ID		(LOOK_MenuStyle_ID_END+2)
1865 #define LOOK_MenuStippleCompositionMethod_ID	(LOOK_MenuStyle_ID_END+3)
1866 #define LOOK_ShadeAnimationSteps_ID				(LOOK_MenuStyle_ID_END+4)
1867 #define LOOK_TitleButtonBalloonBorderHilite_ID	(LOOK_MenuStyle_ID_END+5)
1868 #define LOOK_TitleButtonBalloonXOffset_ID		(LOOK_MenuStyle_ID_END+6)
1869 #define LOOK_TitleButtonBalloonYOffset_ID		(LOOK_MenuStyle_ID_END+7)
1870 #define LOOK_TitleButtonBalloonDelay_ID			(LOOK_MenuStyle_ID_END+8)
1871 #define LOOK_TitleButtonBalloonCloseDelay_ID	(LOOK_MenuStyle_ID_END+9)
1872 #define LOOK_TitleButtonBalloonStyle_ID			(LOOK_MenuStyle_ID_END+10)
1873 #define LOOK_TitleButtonBalloons_ID				(LOOK_MenuStyle_ID_END+11)
1874 #define LOOK_TitleButton_ID						(LOOK_MenuStyle_ID_END+12)
1875 #define LOOK_KillBackgroundThreshold_ID			(LOOK_MenuStyle_ID_END+13)
1876 #define LOOK_DontAnimateBackground_ID			(LOOK_MenuStyle_ID_END+14)
1877 #define LOOK_CoverAnimationSteps_ID				(LOOK_MenuStyle_ID_END+15)
1878 #define LOOK_CoverAnimationType_ID				(LOOK_MenuStyle_ID_END+16)
1879 #define LOOK_SupportedHints_ID  				(LOOK_MenuStyle_ID_END+17)
1880 #define LOOK_MinipixmapSize_ID					(LOOK_MenuStyle_ID_END+18)
1881 
1882 #define LOOK_SUPPORTED_ID_END		(LOOK_MenuStyle_ID_END+32)
1883 #define LOOK_ID_END			(LOOK_SUPPORTED_ID_END)
1884 
1885 typedef struct DesktopConfig
1886 {
1887   int desk;
1888   char *back_name;
1889   char *layout_name;
1890   MyBackgroundConfig *back;
1891 
1892   struct DesktopConfig *next;
1893 }DesktopConfig;
1894 
1895 void DestroyDesktopConfig (DesktopConfig ** head);
1896 DesktopConfig *ParseDesktopOptions (DesktopConfig **plist, struct ConfigItem * item, int id);
1897 
1898 typedef struct LookConfig
1899 {
1900 
1901 /* this are values for different LOOK flags */
1902   unsigned long flags;
1903   unsigned long set_flags;
1904 
1905   ASBox *icon_boxes;
1906   short unsigned int icon_boxes_num;
1907 
1908   char *menu_arrow;		/* menu arrow */
1909   char *menu_pin_on;		/* menu pin */
1910   char *menu_pin_off;
1911 
1912   char *text_gradient[2];	/* title text */
1913   unsigned short int title_text_align;
1914   short int title_button_spacing;
1915   unsigned short int title_button_style;
1916   short int title_button_x_offset;
1917   short int title_button_y_offset;
1918   ASButton *normal_buttons[MAX_BUTTONS];       /* titlebar buttons for windows */
1919   ASButton *icon_buttons[MAX_BUTTONS];         /* titlebar buttons for iconifyed windows */
1920   ASGeometry resize_move_geometry;
1921   unsigned short int start_menu_sort_mode;
1922   unsigned short int draw_menu_borders;
1923   ASBox button_size;
1924 
1925   unsigned int rubber_band;
1926   unsigned int shade_animation_steps;
1927 
1928   char *window_styles[BACK_STYLES];
1929   char *menu_styles[MENU_BACK_STYLES];
1930 
1931   balloonConfig *title_balloon_conf;
1932   balloonConfig *menu_balloon_conf;
1933   MyStyleDefinition *style_defs;
1934   MyFrameDefinition *frame_defs;
1935   MyBackgroundConfig *back_defs;
1936   DesktopConfig      *desk_configs;
1937 
1938   char *menu_frame ;
1939 
1940   struct ASSupportedHints *supported_hints ;
1941 
1942   struct FreeStorageElem *more_stuff;
1943 
1944 }
1945 LookConfig;
1946 
1947 LookConfig *CreateLookConfig ();
1948 void DestroyLookConfig (LookConfig * config);
1949 
1950 ASFlagType ParseBevelOptions( struct FreeStorageElem * options );
1951 ASFlagType ParseAlignOptions( struct FreeStorageElem * options );
1952 void bevel_parse(char *text, FILE * fd, char **myname, int *pbevel);
1953 void align_parse(char *text, FILE * fd, char **myname, int *palign);
1954 
1955 LookConfig *ParseLookOptions (const char *filename, char *myname);
1956 struct MyLook *LookConfig2MyLook ( struct LookConfig *config, struct MyLook *look,
1957 			  			   	       struct ASImageManager *imman,
1958 								   struct ASFontManager *fontman,
1959                                    Bool free_resources, Bool do_init,
1960 								   unsigned long what_flags	);
1961 /***************************************************************************/
1962 /***************************************************************************/
1963 /*                        Directory Tree definitions                       */
1964 /***************************************************************************/
1965 #if 0
1966 #include "dirtree.h"
1967 
1968 /***************************************************************************/
1969 /***************************************************************************/
1970 /*                        Menu data definitions                            */
1971 /***************************************************************************/
1972 MenuData *dirtree2menu_data (struct ASHashTable **list, dirtree_t * tree, char *buf);
1973 MenuData *FreeStorage2MenuData( struct FreeStorageElem *storage, ConfigItem *item, struct ASHashTable *list );
1974 struct FreeStorageElem **MenuData2FreeStorage( struct SyntaxDef *syntax, struct FreeStorageElem **tail, MenuData *md );
1975 void      dir2menu_data (char *name, struct ASHashTable** list);
1976 void      file2menu_data (char *name, struct ASHashTable** list);
1977 
1978 void      load_standard_menu( struct ASHashTable** list );
1979 void      load_fixed_menu( struct ASHashTable** list  );
1980 #endif
1981 /***************************************************************************/
1982 /***************************************************************************/
1983 /*                  Complex Function data definitions                      */
1984 /***************************************************************************/
1985 ComplexFunction *FreeStorage2ComplexFunction( struct FreeStorageElem *storage, struct ConfigItem *item, struct ASHashTable *list );
1986 struct FreeStorageElem **ComplexFunction2FreeStorage( struct SyntaxDef *syntax, struct FreeStorageElem **tail, ComplexFunction *cf );
1987 /***************************************************************************/
1988 /***************************************************************************/
1989 /*                        FEEL parsing definitions                         */
1990 /***************************************************************************/
1991 
1992 #define INCLUDE_ID_START              (LOOK_ID_END+1)
1993 #define INCLUDE_include_ID            (INCLUDE_ID_START)
1994 #define INCLUDE_keepname_ID           (INCLUDE_ID_START+1)
1995 #define INCLUDE_extension_ID          (INCLUDE_ID_START+2)
1996 #define INCLUDE_miniextension_ID      (INCLUDE_ID_START+3)
1997 #define INCLUDE_minipixmap_ID         (INCLUDE_ID_START+4)
1998 #define INCLUDE_command_ID            (INCLUDE_ID_START+5)
1999 #define INCLUDE_order_ID       		  (INCLUDE_ID_START+6)
2000 #define INCLUDE_RecentSubmenuItems_ID (INCLUDE_ID_START+7)
2001 #define INCLUDE_name_ID          	  (INCLUDE_ID_START+8)
2002 #define INCLUDE_ID_END                (INCLUDE_ID_START+9)
2003 
2004 #define FEEL_ID_START                 (INCLUDE_ID_END+1)
2005 
2006 #define FEEL_ClickToFocus_ID          (FEEL_ID_START)
2007 #define FEEL_SloppyFocus_ID           (FEEL_ID_START+1)
2008 #define FEEL_AutoFocus_ID             (FEEL_ID_START+2)
2009 
2010 #define FEEL_DecorateTransients_ID    (FEEL_ID_START+3)
2011 
2012 #define FEEL_DontMoveOff_ID           (FEEL_ID_START+4)
2013 #define FEEL_NoPPosition_ID           (FEEL_ID_START+5)
2014 #define FEEL_StubbornPlacement_ID     (FEEL_ID_START+6)
2015 
2016 #define FEEL_MenusHigh_ID             (FEEL_ID_START+9)
2017 #define FEEL_CenterOnCirculate_ID     (FEEL_ID_START+10)
2018 
2019 #define FEEL_SuppressIcons_ID         (FEEL_ID_START+11)
2020 #define FEEL_IconTitle_ID             (FEEL_ID_START+12)
2021 #define FEEL_KeepIconWindows_ID       (FEEL_ID_START+13)
2022 #define FEEL_StickyIcons_ID           (FEEL_ID_START+14)
2023 #define FEEL_StubbornIcons_ID         (FEEL_ID_START+15)
2024 #define FEEL_StubbornIconPlacement_ID (FEEL_ID_START+16)
2025 #define FEEL_CirculateSkipIcons_ID    (FEEL_ID_START+17)
2026 
2027 #define FEEL_BackingStore_ID          (FEEL_ID_START+18)
2028 #define FEEL_AppsBackingStore_ID      (FEEL_ID_START+19)
2029 #define FEEL_SaveUnders_ID            (FEEL_ID_START+20)
2030 
2031 #define FEEL_PagingDefault_ID         (FEEL_ID_START+21)
2032 #define FEEL_AutoTabThroughDesks_ID   (FEEL_ID_START+22)
2033 
2034 #define FEEL_ClickTime_ID             (FEEL_ID_START+23)
2035 #define FEEL_OpaqueMove_ID            (FEEL_ID_START+24)
2036 #define FEEL_OpaqueResize_ID          (FEEL_ID_START+25)
2037 #define FEEL_AutoRaise_ID             (FEEL_ID_START+26)
2038 #define FEEL_AutoReverse_ID           (FEEL_ID_START+27)
2039 #define FEEL_DeskAnimationType_ID     (FEEL_ID_START+28)
2040 #define FEEL_DeskAnimationSteps_ID    (FEEL_ID_START+29)
2041 #define FEEL_XorValue_ID              (FEEL_ID_START+30)
2042 #define FEEL_Xzap_ID                  (FEEL_ID_START+31)
2043 #define FEEL_Yzap_ID                  (FEEL_ID_START+32)
2044 #define FEEL_Cursor_ID                (FEEL_ID_START+33)
2045 #define FEEL_CustomCursor_ID          (FEEL_ID_START+34)
2046 #define FEEL_ClickToRaise_ID          (FEEL_ID_START+35)
2047 #define FEEL_EdgeScroll_ID            (FEEL_ID_START+36)
2048 #define FEEL_EdgeResistance_ID        (FEEL_ID_START+37)
2049 #define FEEL_Popup_ID                 F_POPUP/*(FEEL_ID_START+38)*/
2050 #define FEEL_Function_ID              F_FUNCTION/*(FEEL_ID_START+39)*/
2051 #define FEEL_Mouse_ID                 (FEEL_ID_START+40)
2052 #define FEEL_Key_ID                   (FEEL_ID_START+41)
2053 #define FEEL_ShadeAnimationSteps_ID   (FEEL_ID_START+42)
2054 #define FEEL_CoverAnimationSteps_ID   (FEEL_ID_START+43)
2055 #define FEEL_CoverAnimationType_ID	  (FEEL_ID_START+44)
2056 
2057 #define FEEL_FollowTitleChanges_ID	 	(FEEL_ID_START+45)
2058 #define FEEL_PersistentMenus_ID		   	(FEEL_ID_START+46)
2059 #define FEEL_NoSnapKey_ID			   	(FEEL_ID_START+47)
2060 #define FEEL_EdgeAttractionScreen_ID	(FEEL_ID_START+48)
2061 #define FEEL_EdgeAttractionWindow_ID	(FEEL_ID_START+49)
2062 #define FEEL_DontRestoreFocus_ID	   	(FEEL_ID_START+50)
2063 #define FEEL_WindowBox_ID			   	(FEEL_ID_START+51)
2064 #define FEEL_DefaultWindowBox_ID	   	(FEEL_ID_START+52)
2065 #define FEEL_RecentSubmenuItems_ID	 	(FEEL_ID_START+53)
2066 #define FEEL_WinListSortOrder_ID	   	(FEEL_ID_START+54)
2067 #define FEEL_WinListHideIcons_ID	   	(FEEL_ID_START+55)
2068 #define FEEL_AnimateDeskChange_ID		(FEEL_ID_START+56)
2069 
2070 /* obsolete stuff : */
2071 #define FEEL_MWMFunctionHints_ID      	(FEEL_ID_START+45)
2072 #define FEEL_MWMDecorHints_ID         	(FEEL_ID_START+46)
2073 #define FEEL_MWMHintOverride_ID       	(FEEL_ID_START+47)
2074 
2075 #define FEEL_PLACEMENT_START_ID        	(FEEL_ID_START+48)
2076 #define FEEL_SmartPlacement_ID        	(FEEL_PLACEMENT_START_ID+0)
2077 #define FEEL_RandomPlacement_ID       	(FEEL_PLACEMENT_START_ID+1)
2078 #define FEEL_Tile_ID				  	(FEEL_PLACEMENT_START_ID+2)
2079 #define FEEL_Cascade_ID				  	(FEEL_PLACEMENT_START_ID+3)
2080 #define FEEL_UnderPointer_ID	  	(FEEL_PLACEMENT_START_ID+4)
2081 #define FEEL_WarpPointer_ID	  	(FEEL_PLACEMENT_START_ID+5)
2082 #define FEEL_Manual_ID				  	(FEEL_PLACEMENT_START_ID+6)
2083 
2084 #define FEEL_ID_END                   	(FEEL_PLACEMENT_START_ID+11)
2085 
2086 /************************************
2087  * WindowBox configuration may look something like this :
2088  * WindowBox   "some_name"
2089  * 		Area   WxH+X+Y
2090  * 		Virtual
2091  * 		MinWidth	width
2092  * 		MinHeight	height
2093  * 		MaxWidth	width
2094  * 		MaxHeight	height
2095  * 		FirstTry	SmartPlacement|RandomPlacement|Tile
2096  * 		ThenTry 	RandomPlacement|Cascade|Manual
2097  * 		VerticalPriority
2098  * 		ReverseOrder
2099  *      Desk        desk
2100  *      MinLayer    min_layer
2101  *      MaxLayer    max_layer
2102  * ~WindowBox
2103  */
2104 
2105 #define WINDOWBOX_ID_START	 			(FEEL_ID_END+1)
2106 #define WINDOWBOX_START_ID				(WINDOWBOX_ID_START)
2107 #define WINDOWBOX_Area_ID   	  		(WINDOWBOX_ID_START+1)
2108 #define WINDOWBOX_Virtual_ID      		(WINDOWBOX_ID_START+2)
2109 #define WINDOWBOX_MinWidth_ID	  		(WINDOWBOX_ID_START+3)
2110 #define WINDOWBOX_MinHeight_ID	  		(WINDOWBOX_ID_START+4)
2111 #define WINDOWBOX_MaxWidth_ID	  		(WINDOWBOX_ID_START+5)
2112 #define WINDOWBOX_MaxHeight_ID	  		(WINDOWBOX_ID_START+6)
2113 #define WINDOWBOX_FirstTry_ID	  		(WINDOWBOX_ID_START+7)
2114 #define WINDOWBOX_ThenTry_ID 	  		(WINDOWBOX_ID_START+8)
2115 #define WINDOWBOX_Desk_ID               (WINDOWBOX_ID_START+9)
2116 #define WINDOWBOX_MinLayer_ID           (WINDOWBOX_ID_START+10)
2117 #define WINDOWBOX_MaxLayer_ID           (WINDOWBOX_ID_START+11)
2118 #define WINDOWBOX_VerticalPriority_ID   (WINDOWBOX_ID_START+12)
2119 #define WINDOWBOX_ReverseOrder_ID       (WINDOWBOX_ID_START+13)
2120 #define WINDOWBOX_ReverseOrderHorizontal_ID	(WINDOWBOX_ID_START+14)
2121 #define WINDOWBOX_ReverseOrderVertical_ID  	(WINDOWBOX_ID_START+15)
2122 #define WINDOWBOX_XSpacing_ID			(WINDOWBOX_ID_START+16)
2123 #define WINDOWBOX_YSpacing_ID			(WINDOWBOX_ID_START+17)
2124 #define WINDOWBOX_DONE_ID               (WINDOWBOX_ID_START+18)
2125 
2126 #define WINDOWBOX_ID_END            	(WINDOWBOX_ID_START+19)
2127 
2128 /* we don't really need FeelConfig since feel does not cary
2129    any information that requires char2bin conversion and consecutive
2130    memory allocation/deallocation. Hence we use ASFeel as FeelConfig.
2131  */
2132 struct ASFeel;
2133 
2134 typedef struct FeelConfig
2135 {
2136 	struct ASFeel *feel ;
2137     char         **menu_locations ;
2138     int            menu_locs_num ;
2139 
2140 	struct FreeStorageElem *more_stuff ;
2141 
2142 }FeelConfig;
2143 
2144 void complex_function_parse (char *tline, FILE * fd, char *list, int *count);
2145 
2146 FeelConfig *CreateFeelConfig ();
2147 void DestroyFeelConfig (FeelConfig * config);
2148 FeelConfig *ParseFeelOptions (const char *filename, char *myname);
2149 void        LoadFeelMenus (FeelConfig *config);
2150 struct ASWindowBox *ProcessWindowBoxOptions (struct FreeStorageElem * options);
2151 void windowbox_parse (char *tline, FILE * fd, char **list, int *count);
2152 
2153 int WriteFeelOptions (const char *filename, char *myname,  FeelConfig * config, unsigned long flags);
2154 
2155 /* AutoExec config is basically a very limited subset of the feel config
2156  * therefore it does not deserve its own section : */
2157 
2158 typedef struct AutoExecConfig
2159 {
2160     ComplexFunction *init ;
2161     ComplexFunction *restart ;
2162 
2163     struct FreeStorageElem *more_stuff ;
2164 
2165 }AutoExecConfig;
2166 
2167 typedef struct ThemeConfig
2168 {
2169     ComplexFunction *install ;
2170     ComplexFunction *apply ;
2171 
2172     struct FreeStorageElem *more_stuff ;
2173 
2174 }ThemeConfig;
2175 
2176 #define THEME_INSTALL_FUNC_NAME "InstallTheme"
2177 #define THEME_APPLY_FUNC_NAME 	"ApplyTheme"
2178 
2179 AutoExecConfig *CreateAutoExecConfig ();
2180 void    DestroyAutoExecConfig (AutoExecConfig * config);
2181 AutoExecConfig *ParseAutoExecOptions (const char *filename, char *myname);
2182 int WriteAutoExecOptions (const char *filename, char *myname,  AutoExecConfig * config, unsigned long flags);
2183 
2184 void DestroyThemeConfig (ThemeConfig * config);
2185 ThemeConfig *ParseThemeFile (const char *filename, char *myname);
2186 /***************************************************************************/
2187 #define COLOR_ID_START	 				(WINDOWBOX_ID_END+1)
2188 #define COLOR_Base_ID					(COLOR_ID_START+ASMC_Base 					 )
2189 #define COLOR_Inactive1_ID				(COLOR_ID_START+ASMC_Inactive1 				 )
2190 #define COLOR_Inactive2_ID				(COLOR_ID_START+ASMC_Inactive2 				 )
2191 #define COLOR_Active_ID  				(COLOR_ID_START+ASMC_Active 				 )
2192 #define COLOR_InactiveText1_ID			(COLOR_ID_START+ASMC_InactiveText1 		 	 )
2193 #define COLOR_InactiveText2_ID			(COLOR_ID_START+ASMC_InactiveText2 			 )
2194 
2195 #define COLOR_ActiveText_ID				(COLOR_ID_START+ASMC_ActiveText 			 )
2196 #define COLOR_HighInactive_ID			(COLOR_ID_START+ASMC_HighInactive 			 )
2197 #define COLOR_HighActive_ID				(COLOR_ID_START+ASMC_HighActive 			 )
2198 #define COLOR_HighInactiveBack_ID		(COLOR_ID_START+ASMC_HighInactiveBack 		 )
2199 #define COLOR_HighActiveBack_ID			(COLOR_ID_START+ASMC_HighActiveBack 	  )
2200 #define COLOR_HighInactiveText_ID		(COLOR_ID_START+ASMC_HighInactiveText 		 )
2201 #define COLOR_HighActiveText_ID			(COLOR_ID_START+ASMC_HighActiveText			 )
2202 #define COLOR_DisabledText_ID			(COLOR_ID_START+ASMC_DisabledText			 )
2203 
2204 #define COLOR_BaseDark_ID				(COLOR_ID_START+ASMC_BaseDark				 )
2205 #define COLOR_BaseLight_ID				(COLOR_ID_START+ASMC_BaseLight				 )
2206 #define COLOR_Inactive1Dark_ID			(COLOR_ID_START+ASMC_Inactive1Dark			 )
2207 #define COLOR_Inactive1Light_ID			(COLOR_ID_START+ASMC_Inactive1Light			 )
2208 #define COLOR_Inactive2Dark_ID			(COLOR_ID_START+ASMC_Inactive2Dark			 )
2209 #define COLOR_Inactive2Light_ID			(COLOR_ID_START+ASMC_Inactive2Light			 )
2210 #define COLOR_ActiveDark_ID				(COLOR_ID_START+ASMC_ActiveDark				 )
2211 #define COLOR_ActiveLight_ID			(COLOR_ID_START+ASMC_ActiveLight			 )
2212 #define COLOR_HighInactiveDark_ID		(COLOR_ID_START+ASMC_HighInactiveDark		 )
2213 #define COLOR_HighInactiveLight_ID		(COLOR_ID_START+ASMC_HighInactiveLight		 )
2214 #define COLOR_HighActiveDark_ID			(COLOR_ID_START+ASMC_HighActiveDark			 )
2215 #define COLOR_HighActiveLight_ID		(COLOR_ID_START+ASMC_HighActiveLight		 )
2216 #define COLOR_HighInactiveBackDark_ID	(COLOR_ID_START+ASMC_HighInactiveBackDark	)
2217 #define COLOR_HighInactiveBackLight_ID 	(COLOR_ID_START+ASMC_HighInactiveBackLight)
2218 #define COLOR_HighActiveBackDark_ID		(COLOR_ID_START+ASMC_HighActiveBackDark		 )
2219 #define COLOR_HighActiveBackLight_ID	(COLOR_ID_START+ASMC_HighActiveBackLight  )
2220 #define COLOR_Cursor_ID					(COLOR_ID_START+ASMC_Cursor  )
2221 #define COLOR_Angle_ID					(COLOR_ID_START+ASMC_MainColors)
2222 #define COLOR_ID_END            		(COLOR_ID_START+ASMC_MainColors+1)
2223 
2224 typedef enum
2225 {
2226 #define COLOR_SET_FLAG(name)  COLOR_##name = (0x01<<(ASMC_##name))
2227 
2228 	COLOR_SET_FLAG(Base),
2229 	COLOR_SET_FLAG(Inactive1),
2230 	COLOR_SET_FLAG(Inactive2),
2231 	COLOR_SET_FLAG(Active),
2232 	COLOR_SET_FLAG(InactiveText1),
2233 	COLOR_SET_FLAG(InactiveText2),
2234 	COLOR_SET_FLAG(ActiveText),
2235 	COLOR_SET_FLAG(HighInactive),
2236 	COLOR_SET_FLAG(HighActive),
2237 	COLOR_SET_FLAG(HighInactiveBack),
2238 	COLOR_SET_FLAG(HighActiveBack),
2239 	COLOR_SET_FLAG(HighInactiveText),
2240 	COLOR_SET_FLAG(HighActiveText),
2241 	COLOR_SET_FLAG(DisabledText),
2242 	COLOR_SET_FLAG(BaseDark),
2243 	COLOR_SET_FLAG(BaseLight),
2244 	COLOR_SET_FLAG(Inactive1Dark),
2245 	COLOR_SET_FLAG(Inactive1Light),
2246 	COLOR_SET_FLAG(Inactive2Dark),
2247 	COLOR_SET_FLAG(Inactive2Light),
2248 	COLOR_SET_FLAG(ActiveDark),
2249 	COLOR_SET_FLAG(ActiveLight),
2250 	COLOR_SET_FLAG(HighInactiveDark),
2251 	COLOR_SET_FLAG(HighInactiveLight),
2252 	COLOR_SET_FLAG(HighActiveDark),
2253 	COLOR_SET_FLAG(HighActiveLight),
2254 	COLOR_SET_FLAG(HighInactiveBackDark),
2255 	COLOR_SET_FLAG(HighInactiveBackLight),
2256 	COLOR_SET_FLAG(HighActiveBackDark),
2257 	COLOR_SET_FLAG(HighActiveBackLight),
2258 	COLOR_SET_FLAG(Cursor),
2259 	COLOR_Angle = (0x01<<ASMC_MainColors)
2260 
2261 }ColorConfigSetFlags;
2262 
2263 
2264 typedef struct ColorConfig
2265 {
2266 	ASFlagType set_main_colors ;
2267 	ARGB32 main_colors[ASMC_MainColors] ;
2268 	int angle ;
2269 
2270     struct FreeStorageElem *more_stuff ;
2271 
2272 }ColorConfig;
2273 
2274 void DestroyColorConfig (ColorConfig * config);
2275 
2276 ColorConfig *ParseColorOptions (const char *filename, char *myname);
2277 int WriteColorOptions (const char *filename, char *myname, ColorConfig * config, unsigned long flags);
2278 
2279 ColorConfig *ASColorScheme2ColorConfig( ASColorScheme *cs );
2280 ASColorScheme *ColorConfig2ASColorScheme( ColorConfig *config );
2281 
2282 void LoadColorScheme();                        /* high level easy to use function */
2283 Bool translate_gtkrc_template_file( const char *template_fname, const char *output_fname );
2284 Bool UpdateGtkRC(ASEnvironment *e);
2285 Bool UpdateKCSRC();
2286 
2287 
2288 
2289 /***************************************************************************/
2290 /*                        WinTabs config parsing definitions               */
2291 /***************************************************************************/
2292 /* New winTabs config :
2293  *
2294  *  *WinTabsGeometry         WxH+X+Y
2295  *  *WinTabsMinTabMaxRows    rows
2296  *  *WinTabsMinTabMaxColumns cols
2297  *  *WinTabsMinTabWidth      width
2298  *  *WinTabsMaxTabWidth      width
2299  *  *WinTabsUnfocusedStyle   "style"
2300  *  *WinTabsFocusedStyle     "style"
2301  *  *WinTabsStickyStyle      "style"
2302  *  *WinTabsUseSkipList      width
2303  *  *WinTabsPattern          0|1|2|3 <pattern>  # 0 - Name, 1 - icon, 2 - res_name, 3 - res_class
2304  *  *WinTabsExcludePattern   0|1|2|3 <pattern>  # 0 - Name, 1 - icon, 2 - res_name, 3 - res_class
2305  *  *WinTabsAlign            Left,Right,Top,Bottom
2306  *  *WinTabsBevel            None,Left,Right,Top, Bottom, NoOutline
2307  *  *WinTabsFBevel           None,Left,Right,Top, Bottom, NoOutline
2308  *  *WinTabsUBevel           None,Left,Right,Top, Bottom, NoOutline
2309  *  *WinTabsSBevel           None,Left,Right,Top, Bottom, NoOutline
2310  *  *WinTabsGroupNameSeparator "string"
2311 */
2312 #define WINTABS_ID_START        		(COLOR_ID_END+1)
2313 #define WINTABS_Geometry_ID				(WINTABS_ID_START+1)
2314 #define WINTABS_MaxRows_ID				(WINTABS_ID_START+2)
2315 #define WINTABS_MaxColumns_ID			(WINTABS_ID_START+3)
2316 #define WINTABS_MaxTabWidth_ID          (WINTABS_ID_START+4)
2317 #define WINTABS_MinTabWidth_ID          (WINTABS_ID_START+5)
2318 #define WINTABS_Pattern_ID				(WINTABS_ID_START+6)
2319 #define WINTABS_UseSkipList_ID			(WINTABS_ID_START+7)
2320 #define WINTABS_Align_ID                (WINTABS_ID_START+8)
2321 #define WINTABS_Bevel_ID                (WINTABS_ID_START+9)
2322 #define WINTABS_FBevel_ID               (WINTABS_ID_START+10)
2323 #define WINTABS_UBevel_ID               (WINTABS_ID_START+11)
2324 #define WINTABS_SBevel_ID               (WINTABS_ID_START+12)
2325 #define WINTABS_UnfocusedStyle_ID       (WINTABS_ID_START+13)
2326 #define WINTABS_FocusedStyle_ID         (WINTABS_ID_START+14)
2327 #define WINTABS_StickyStyle_ID          (WINTABS_ID_START+15)
2328 #define WINTABS_CM_ID                   (WINTABS_ID_START+16)
2329 #define WINTABS_FCM_ID                  (WINTABS_ID_START+17)
2330 #define WINTABS_UCM_ID                  (WINTABS_ID_START+18)
2331 #define WINTABS_SCM_ID                  (WINTABS_ID_START+19)
2332 #define WINTABS_Spacing_ID              (WINTABS_ID_START+20)
2333 #define WINTABS_HSpacing_ID             (WINTABS_ID_START+21)
2334 #define WINTABS_VSpacing_ID             (WINTABS_ID_START+22)
2335 #define WINTABS_ExcludePattern_ID		(WINTABS_ID_START+23)
2336 #define WINTABS_AllDesks_ID				(WINTABS_ID_START+24)
2337 #define WINTABS_Title_ID				(WINTABS_ID_START+25)
2338 #define WINTABS_IconTitle_ID	 		(WINTABS_ID_START+26)
2339 #define WINTABS_SkipTransients_ID		(WINTABS_ID_START+27)
2340 #define WINTABS_GroupNameSeparator_ID	(WINTABS_ID_START+28)
2341 #define WINTABS_GroupTabs_ID			(WINTABS_ID_START+29)
2342 
2343 
2344 #define WINTABS_BALLOONS_ID             (WINTABS_ID_START+31)
2345 #define WINTABS_ID_END                  (WINTABS_ID_START+32)
2346 
2347 /* config data structure */
2348 
2349 typedef struct WinTabsConfig
2350 {
2351 #define WINTABS_UseSkipList		(0x01<<0)
2352 #define WINTABS_HideWhenEmpty  	(0x01<<1)
2353 #define WINTABS_AllDesks	  	(0x01<<2)
2354 #define WINTABS_Geometry		(0x01<<3)
2355 #define WINTABS_MaxRows			(0x01<<5)
2356 #define WINTABS_MaxColumns		(0x01<<6)
2357 #define WINTABS_MaxTabWidth     (0x01<<7)
2358 #define WINTABS_MinTabWidth     (0x01<<8)
2359 #define WINTABS_Align           (0x01<<10)
2360 #define WINTABS_FBevel          (0x01<<11)
2361 #define WINTABS_UBevel          (0x01<<12)
2362 #define WINTABS_SBevel          (0x01<<13)
2363 #define WINTABS_Bevel           (WINTABS_FBevel|WINTABS_UBevel|WINTABS_SBevel)
2364 #define WINTABS_FCM             (0x01<<15)
2365 #define WINTABS_UCM             (0x01<<16)
2366 #define WINTABS_SCM             (0x01<<17)
2367 #define WINTABS_CM              (WINTABS_FCM|WINTABS_UCM|WINTABS_SCM)
2368 
2369 #define WINTABS_H_SPACING       (0x01<<18)
2370 #define WINTABS_V_SPACING       (0x01<<19)
2371 #define WINTABS_PatternType	    (0x01<<20)
2372 #define WINTABS_ExcludePatternType	    (0x01<<21)
2373 #define WINTABS_SkipTransients	(0x01<<22)
2374 #define WINTABS_GroupTabs		(0x01<<23)
2375 
2376 
2377 #define ASWT_UseSkipList		WINTABS_UseSkipList
2378 #define ASWT_HideWhenEmpty		WINTABS_HideWhenEmpty
2379 
2380 	ASFlagType	flags ;
2381 	ASFlagType	set_flags ;
2382     ASGeometry  geometry ;
2383 #define MAX_WINTABS_WINDOW_COUNT    64
2384 	unsigned int max_rows, max_columns ;
2385     unsigned int min_tab_width, max_tab_width ;
2386 
2387 	char *unfocused_style ;
2388 	char *focused_style ;
2389 	char *sticky_style ;
2390 
2391 	ASNameTypes     pattern_type ; /* 0, 1, 2, 3 */
2392 	char 		   *pattern ;
2393 	ASNameTypes     exclude_pattern_type ; /* 0, 1, 2, 3 */
2394 	char 		   *exclude_pattern ;
2395     ASFlagType      name_aligment ;
2396     ASFlagType      fbevel, ubevel, sbevel ;
2397     int             ucm, fcm, scm;             /* composition methods */
2398     unsigned int    h_spacing, v_spacing ;
2399 	char 		   *title, *icon_title ;
2400 
2401 	char 		*GroupNameSeparator;
2402 
2403     balloonConfig *balloon_conf;
2404     MyStyleDefinition *style_defs;
2405 
2406     struct FreeStorageElem *more_stuff;
2407 
2408     /* calculated based on geometry : */
2409     int anchor_x, anchor_y ;
2410 	int gravity ;
2411 
2412 
2413 }WinTabsConfig;
2414 
2415 WinTabsConfig *CreateWinTabsConfig ();
2416 void DestroyWinTabsConfig (WinTabsConfig * config);
2417 void PrintWinTabsConfig (WinTabsConfig * config);
2418 int WriteWinTabsOptions (const char *filename, char *myname, WinTabsConfig * config, unsigned long flags);
2419 WinTabsConfig *ParseWinTabsOptions (const char *filename, char *myname);
2420 /***************************************************************************/
2421 
2422 /***************************************************************************/
2423 /*                        Animate pasring definitions                 */
2424 /***************************************************************************/
2425 
2426 
2427 #define ANIMATE_ID_START       		(WINTABS_ID_END+1)
2428 #define ANIMATE_COLOR_ID			ANIMATE_ID_START
2429 #define ANIMATE_DELAY_ID       		(ANIMATE_ID_START+1)
2430 #define ANIMATE_ITERATIONS_ID		(ANIMATE_ID_START+2)
2431 #define ANIMATE_TWIST_ID    		(ANIMATE_ID_START+3)
2432 #define ANIMATE_WIDTH_ID	        (ANIMATE_ID_START+4)
2433 #define ANIMATE_RESIZE_ID	        (ANIMATE_ID_START+5)
2434 
2435 typedef enum {
2436 	ART_Twist = 0,
2437 	ART_Flip,
2438 	ART_Turn,
2439 	ART_Zoom,
2440 	ART_Zoom3D,
2441 	ART_Random,
2442 	ART_None
2443 }AnimateResizeType;
2444 
2445 #define ANIMATE_RESIZE_ID_START		(ANIMATE_RESIZE_ID+1)
2446 #define ANIMATE_ResizeTwist_ID		(ANIMATE_RESIZE_ID_START+ART_Twist)
2447 #define ANIMATE_ResizeFlip_ID		(ANIMATE_RESIZE_ID_START+ART_Flip)
2448 #define ANIMATE_ResizeTurn_ID		(ANIMATE_RESIZE_ID_START+ART_Turn)
2449 #define ANIMATE_ResizeZoom_ID		(ANIMATE_RESIZE_ID_START+ART_Zoom)
2450 #define ANIMATE_ResizeZoom3D_ID		(ANIMATE_RESIZE_ID_START+ART_Zoom3D)
2451 #define ANIMATE_ResizeRandom_ID		(ANIMATE_RESIZE_ID_START+ART_Random)
2452 #define ANIMATE_RESIZE_ID_END		(ANIMATE_RESIZE_ID_START+ART_None)
2453 
2454 #define ANIMATE_ID_END        	ANIMATE_ID_START+20
2455 
2456 /* config data structure */
2457 
2458 typedef struct
2459 {
2460 #define ANIMATE_SET_DELAY		(0x01<<0)
2461 #define ANIMATE_SET_ITERATIONS	(0x01<<1)
2462 #define ANIMATE_SET_TWIST		(0x01<<2)
2463 #define ANIMATE_SET_WIDTH		(0x01<<3)
2464 #define ANIMATE_SET_RESIZE		(0x01<<4)
2465 	ASFlagType set_flags ;
2466 	char *color;
2467 
2468 #define ANIMATE_DEFAULT_DELAY		10         /* in milliseconds */
2469 #define ANIMATE_DEFAULT_ITERATIONS 	12
2470 
2471 	int delay;
2472 	int iterations;
2473 	int twist;
2474 	int width;
2475 	AnimateResizeType resize;
2476 
2477 	struct FreeStorageElem *more_stuff;
2478 
2479 }AnimateConfig;
2480 
2481 AnimateConfig *CreateAnimateConfig ();
2482 AnimateConfig *ParseAnimateOptions (const char *filename, char *myname);
2483 int WriteAnimateOptions (const char *filename, char *myname,
2484 			 AnimateConfig * config, unsigned long flags);
2485 void DestroyAnimateConfig (AnimateConfig * config);
2486 
2487 /**************************************************************************/
2488 /***************************************************************************/
2489 /*                        Clean pasring definitions                 */
2490 /***************************************************************************/
2491 
2492 
2493 #define CLEAN_ID_START       		(ANIMATE_ID_END+1)
2494 #define CLEAN_Clean_ID				CLEAN_ID_START
2495 #define CLEAN_ID_END        		CLEAN_ID_START+20
2496 
2497 /* config data structure */
2498 typedef struct CleanLineConfig
2499 {
2500   int seconds;
2501   FunctionData *action;
2502   struct CleanLineConfig *next ;
2503 }CleanLineConfig;
2504 
2505 
2506 typedef struct
2507 {
2508 	struct CleanLineConfig *lines ;
2509 	struct FreeStorageElem *more_stuff;
2510 
2511 }CleanConfig;
2512 
2513 CleanConfig *CreateCleanConfig ();
2514 CleanConfig *ParseCleanOptions (const char *filename, char *myname);
2515 int WriteCleanOptions (const char *filename, char *myname,
2516 			 CleanConfig * config, unsigned long flags);
2517 void DestroyCleanConfig (CleanConfig * config);
2518 
2519 /**************************************************************************/
2520 /***************************************************************************/
2521 /*                        Sound pasring definitions                 */
2522 /***************************************************************************/
2523 /***************************************************************************/
2524 /*                        Possible AfterStep communication events :        */
2525 /***************************************************************************/
2526 #define	EVENT_WindowAdded		0
2527 #define	EVENT_WindowNames    		1
2528 #define	EVENT_WindowDestroyed		2
2529 #define	EVENT_WindowActivated		3
2530 #define	EVENT_WindowRaised		4
2531 #define	EVENT_WindowIconified		5
2532 #define	EVENT_WindowDeiconified		6
2533 #define	EVENT_WindowShaded		7
2534 #define	EVENT_WindowUnshaded		8
2535 #define	EVENT_WindowStuck		9
2536 #define	EVENT_WindowUnstuck		10
2537 #define	EVENT_WindowMaximized		11
2538 #define	EVENT_WindowRestored		12
2539 #define	EVENT_BackgroundChanged		13
2540 #define	EVENT_DeskViewportChanged	14
2541 #define	EVENT_Startup			15
2542 #define	EVENT_Shutdown			16
2543 #define	EVENT_Config			17
2544 #define	EVENT_ModuleConfig		18
2545 #define	EVENT_PlaySound			19
2546 #define	AFTERSTEP_EVENTS_NUM 		20
2547 
2548 
2549 #define EVENT_ID_START          		(CLEAN_ID_END+1)
2550 
2551 #define EVENT_WindowAdded_ID            (EVENT_ID_START+EVENT_WindowAdded)
2552 #define EVENT_WindowNames_ID            (EVENT_ID_START+EVENT_WindowNames)
2553 #define EVENT_WindowDestroyed_ID        (EVENT_ID_START+EVENT_WindowDestroyed)
2554 #define EVENT_WindowActivated_ID        (EVENT_ID_START+EVENT_WindowActivated)
2555 #define EVENT_WindowRaised_ID           (EVENT_ID_START+EVENT_WindowRaised)
2556 #define EVENT_WindowIconified_ID        (EVENT_ID_START+EVENT_WindowIconified)
2557 #define EVENT_WindowDeiconified_ID      (EVENT_ID_START+EVENT_WindowDeiconified)
2558 #define EVENT_WindowShaded_ID           (EVENT_ID_START+EVENT_WindowShaded)
2559 #define EVENT_WindowUnshaded_ID         (EVENT_ID_START+EVENT_WindowUnshaded)
2560 #define EVENT_WindowStuck_ID            (EVENT_ID_START+EVENT_WindowStuck)
2561 #define EVENT_WindowUnstuck_ID          (EVENT_ID_START+EVENT_WindowUnstuck)
2562 #define EVENT_WindowMaximized_ID        (EVENT_ID_START+EVENT_WindowMaximized)
2563 #define EVENT_WindowRestored_ID         (EVENT_ID_START+EVENT_WindowRestored)
2564 #define EVENT_BackgroundChanged_ID      (EVENT_ID_START+EVENT_BackgroundChanged)
2565 #define EVENT_DeskViewportChanged_ID    (EVENT_ID_START+EVENT_DeskViewportChanged)
2566 #define EVENT_Startup_ID                (EVENT_ID_START+EVENT_Startup)
2567 #define EVENT_Shutdown_ID               (EVENT_ID_START+EVENT_Shutdown)
2568 #define EVENT_Config_ID               	(EVENT_ID_START+EVENT_Config)
2569 #define EVENT_ModuleConfig_ID          	(EVENT_ID_START+EVENT_ModuleConfig)
2570 
2571 #define EVENT_ID_END          			(EVENT_ID_START+AFTERSTEP_EVENTS_NUM)
2572 
2573 #define SOUND_ID_START        	(EVENT_ID_END+1)
2574 #define SOUND_PCMDEVICE_ID      (SOUND_ID_START+1)
2575 #define SOUND_DELAY_ID          (SOUND_ID_START+2)
2576 #define SOUND_RPLAY_HOST_ID     (SOUND_ID_START+3)
2577 #define SOUND_RPLAY_PRI_ID      (SOUND_ID_START+4)
2578 #define SOUND_DEBUG_ID      (SOUND_ID_START+5)
2579 #define SOUND_SOUND_ID          (SOUND_ID_START+6)
2580 #define SOUND_PATH_ID		(SOUND_ID_START+7)
2581 //#define SOUND_DEBUG_ID		(SOUND_ID_START+8)
2582 
2583 #define SOUND_ID_END            (SOUND_ID_START+10)
2584 
2585 /* config data structure */
2586 
2587 typedef struct
2588 {
2589         char *path;
2590 	char *pcmdevice;
2591   	char *sounds[AFTERSTEP_EVENTS_NUM] ;
2592 /*
2593 #define SOUND_SET_DELAY  		(0x01<<0)
2594 #define SOUND_SET_RPLAY_HOST		(0x01<<1)
2595 #define SOUND_SET_RPLAY_PRIORITY  	(0x01<<2)
2596 #define SOUND_SET_RPLAY_VOLUME  	(0x01<<3)
2597 */
2598 	ASFlagType set_flags ;
2599 
2600 	int delay;
2601 	int debug;
2602 //	char *rplay_host;
2603 //	int rplay_priority;
2604 //	int rplay_volume;
2605 
2606 	struct FreeStorageElem *more_stuff;
2607 }SoundConfig;
2608 
2609 SoundConfig *CreateSoundConfig ();
2610 SoundConfig *ParseSoundOptions (const char *filename, char *myname);
2611 int WriteSoundOptions (const char *filename, char *myname,
2612 		       SoundConfig * config, unsigned long flags);
2613 void DestroySoundConfig (SoundConfig * config);
2614 
2615 /**************************************************************************/
2616 /***************************************************************************/
2617 /*                        Ident pasring definitions                 */
2618 /***************************************************************************/
2619 
2620 
2621 #define IDENT_ID_START        	SOUND_ID_END
2622 
2623 #define IDENT_Geometry_ID 		(IDENT_ID_START)
2624 
2625 #define IDENT_ID_END        	IDENT_ID_START+10
2626 
2627 /* config data structure */
2628 
2629 typedef struct
2630 {
2631 #define IDENT_SET_GEOMETRY  (0x01<<0)
2632 	ASFlagType set_flags ;
2633 
2634 	ASGeometry geometry;
2635 
2636 	MyStyleDefinition *style_defs;
2637 	struct FreeStorageElem *more_stuff;
2638 
2639 
2640 	int gravity ;
2641 
2642 }
2643 IdentConfig;
2644 
2645 IdentConfig *CreateIdentConfig ();
2646 IdentConfig *ParseIdentOptions (const char *filename, char *myname);
2647 int WriteIdentOptions (const char *filename, char *myname,
2648 		       IdentConfig * config, unsigned long flags);
2649 void DestroyIdentConfig (IdentConfig * config);
2650 
2651 /**************************************************************************/
2652 
2653 /***************************************************************************/
2654 /* ALL POSSIBLE aFTERsTEP CONFIGS : */
2655 /***************************************************************************/
2656 
2657 #define ASCONFIG_ID_START        		(100000)
2658 #define ASCONFIG_Base_ID				(ASCONFIG_ID_START+1)
2659 #define ASCONFIG_Colorscheme_ID			(ASCONFIG_ID_START+2)
2660 #define ASCONFIG_Database_ID			(ASCONFIG_ID_START+3)
2661 #define ASCONFIG_AutoExec_ID			(ASCONFIG_ID_START+4)
2662 #define ASCONFIG_Command_ID				(ASCONFIG_ID_START+5)
2663 #define ASCONFIG_Look_ID				(ASCONFIG_ID_START+6)
2664 #define ASCONFIG_Feel_ID				(ASCONFIG_ID_START+7)
2665 #define ASCONFIG_Theme_ID				(ASCONFIG_ID_START+8)
2666 #define ASCONFIG_Pager_ID				(ASCONFIG_ID_START+9)
2667 #define ASCONFIG_Wharf_ID				(ASCONFIG_ID_START+10)
2668 #define ASCONFIG_WinList_ID				(ASCONFIG_ID_START+11)
2669 #define ASCONFIG_WinTabs_ID				(ASCONFIG_ID_START+12)
2670 #define ASCONFIG_ASMount_ID				(ASCONFIG_ID_START+13)
2671 #define ASCONFIG_ID_END                 (ASCONFIG_ID_START+16)
2672 
2673 extern struct SyntaxDef ASConfigSyntax;   /* THIS SYNTAX INCLUDES ALL OTHER SYNTAXES */
2674 
2675 /***************************************************************************/
2676 /***************************************************************************/
2677 /* Desktop Category loading from file or directory tree : 				   */
2678 /***************************************************************************/
2679 
2680 Bool load_category_tree( struct ASCategoryTree*	ct );
2681 
2682 void DestroyCategories();
2683 void ReloadCategories(Bool cached);
2684 void UpdateCategoriesCache();
2685 struct ASDesktopCategory;
2686 struct ASDesktopCategory *name2desktop_category( const char *name, struct ASCategoryTree **tree_return );
2687 
2688 
2689 /***************************************************************************/
2690 
2691 
2692 #ifdef __cplusplus
2693 }
2694 #endif
2695 
2696 
2697 #endif /* AFTERCONF_H_FILE_INCLUDED */
2698