1 /* -*-c-*- */
2 
3 #ifndef FVWM_STYLE_H
4 #define FVWM_STYLE_H
5 
6 #include "fvwm.h"
7 #include "update.h"
8 
9 /* access to the special flags of a style */
10 /* call these with a pointer to a style_flags struct */
11 #define SDO_DECORATE_TRANSIENT(sf) \
12 	((sf)->do_decorate_transient)
13 #define SDO_SAVE_UNDER(sf) \
14 	((sf)->do_save_under)
15 #define SDO_START_LOWERED(sf) \
16 	((sf)->do_start_lowered)
17 #define SDO_START_SHADED(sf) \
18 	((sf)->do_start_shaded)
19 #define SHAS_BORDER_WIDTH(sf) \
20 	((sf)->has_border_width)
21 #define SHAS_COLOR_BACK(sf) \
22 	((sf)->has_color_back)
23 #define SHAS_COLOR_FORE(sf) \
24 	((sf)->has_color_fore)
25 #define SHAS_HANDLE_WIDTH(sf) \
26 	((sf)->has_handle_width)
27 #define SHAS_ICON(sf) \
28 	((sf)->has_icon)
29 #define SHAS_ICON_BOXES(sf) \
30 	((sf)->has_icon_boxes)
31 #define SHAS_ICON_SIZE_LIMITS(sf) \
32 	((sf)->has_icon_size_limits)
33 #define SHAS_ICON_BACKGROUND_PADDING(sf) \
34 	((sf)->has_icon_background_padding)
35 #define SHAS_ICON_BACKGROUND_RELIEF(sf) \
36 	((sf)->has_icon_background_relief)
37 #define SHAS_ICON_TITLE_RELIEF(sf) \
38 	((sf)->has_icon_title_relief)
39 #define SHAS_MIN_WINDOW_SIZE(sf) \
40 	((sf)->has_min_window_size)
41 #define SHAS_MAX_WINDOW_SIZE(sf) \
42 	((sf)->has_max_window_size)
43 #define SHAS_WINDOW_SHADE_STEPS(sf) \
44 	((sf)->has_window_shade_steps)
45 #define SHAS_MINI_ICON(sf) \
46 	((sf)->has_mini_icon)
47 #define SHAS_MWM_DECOR(sf) \
48 	((sf)->has_mwm_decor)
49 #define SHAS_MWM_FUNCTIONS(sf) \
50 	((sf)->has_mwm_functions)
51 #define SHAS_NO_HANDLES(sf) \
52 	((sf)->has_no_handles)
53 #define SHAS_NO_TITLE(sf) \
54 	((sf)->has_no_title)
55 #define SHAS_OL_DECOR(sf) \
56 	((sf)->has_ol_decor)
57 #define SIS_BUTTON_DISABLED(sf) \
58 	((sf)->is_button_disabled)
59 #define SIS_UNMANAGED(sf) \
60 	((sf)->is_unmanaged)
61 #define SPLACEMENT_MODE(sf) \
62 	((sf)->placement_mode)
63 #define SEWMH_PLACEMENT_MODE(sf) \
64 	((sf)->ewmh_placement_mode)
65 #define SUSE_BACKING_STORE(sf) \
66 	((sf)->use_backing_store)
67 #define SUSE_PARENT_RELATIVE(sf) \
68 	((sf)->use_parent_relative)
69 #define SUSE_COLORSET(sf) \
70 	((sf)->use_colorset)
71 #define SUSE_COLORSET_HI(sf) \
72 	((sf)->use_colorset_hi)
73 #define SUSE_BORDER_COLORSET(sf) \
74 	((sf)->use_border_colorset)
75 #define SUSE_BORDER_COLORSET_HI(sf) \
76 	((sf)->use_border_colorset_hi)
77 #define SUSE_ICON_TITLE_COLORSET(sf) \
78 	((sf)->use_icon_title_colorset)
79 #define SUSE_ICON_TITLE_COLORSET_HI(sf) \
80 	((sf)->use_icon_title_colorset_hi)
81 #define SUSE_ICON_BACKGROUND_COLORSET(sf) \
82 	((sf)->use_icon_background_colorset)
83 #define SUSE_LAYER(sf) \
84 	((sf)->use_layer)
85 #define SUSE_NO_PPOSITION(sf) \
86 	((sf)->use_no_pposition)
87 #define SUSE_NO_USPOSITION(sf) \
88 	((sf)->use_no_usposition)
89 #define SUSE_NO_TRANSIENT_PPOSITION(sf) \
90 	((sf)->use_no_transient_pposition)
91 #define SUSE_NO_TRANSIENT_USPOSITION(sf) \
92 	((sf)->use_no_transient_usposition)
93 #define SUSE_START_ON_DESK(sf) \
94 	((sf)->use_start_on_desk)
95 #define SUSE_START_ON_PAGE_FOR_TRANSIENT(sf) \
96 	((sf)->use_start_on_page_for_transient)
97 #define SUSE_START_ON_SCREEN(sf) \
98 	((sf)->use_start_on_screen)
99 #define SMANUAL_PLACEMENT_HONORS_STARTS_ON_PAGE(sf) \
100 	((sf)->manual_placement_honors_starts_on_page)
101 #define SCAPTURE_HONORS_STARTS_ON_PAGE(sf) \
102 	((sf)->capture_honors_starts_on_page)
103 #define SRECAPTURE_HONORS_STARTS_ON_PAGE(sf) \
104 	((sf)->recapture_honors_starts_on_page)
105 #define SHAS_PLACEMENT_PENALTY(sf) \
106 	((sf)->has_placement_penalty)
107 #define SHAS_PLACEMENT_PERCENTAGE_PENALTY(sf) \
108 	((sf)->has_placement_percentage_penalty)
109 #define SHAS_PLACEMENT_POSITION_STRING(sf) \
110 	((sf)->has_placement_position_string
111 #define SCR_MOTION_METHOD(sf) \
112 	((sf)->ws_cr_motion_method)
113 
114 /* access the various copies of the common flags structure. */
115 #define SCF(st) \
116 	((st).flags.common)
117 #define SCFS(st) \
118 	((st).flags.common.s)
119 #define SCM(st) \
120 	((st).flag_mask.common)
121 #define SCMS(st) \
122 	((st).flag_mask.common.s)
123 #define SCD(st) \
124 	((st).flag_default.common)
125 #define SCDS(st) \
126 	((st).flag_default.common.s)
127 #define SCC(st) \
128 	((st).change_mask.common)
129 #define SCCS(st) \
130 	((st).change_mask.common.s)
131 #define SFC(sf) \
132 	((sf).common)
133 
134 /* access to common flags */
135 #define S_FOCUS_POLICY(c) \
136 	((c).s.focus_policy)
137 #define S_TITLE_DIR(c) \
138 	((c).title_dir)
139 #define S_SET_TITLE_DIR(c,x) \
140 	((c).title_dir = (x))
141 #define S_USER_STATES(c) \
142 	((c).user_states)
143 #define S_SET_USER_STATES(c,x) \
144 	((c).user_states = (x))
145 #define S_ADD_USER_STATES(c,x) \
146 	((c).user_states = ((c).user_states | (x)))
147 #define S_IS_STICKY_ACROSS_PAGES(c) \
148 	((c).is_sticky_across_pages)
149 #define S_SET_IS_STICKY_ACROSS_PAGES(c,x) \
150 	((c).is_sticky_across_pages = !!(x))
151 #define S_IS_STICKY_ACROSS_DESKS(c) \
152 	((c).is_sticky_across_desks)
153 #define S_SET_IS_STICKY_ACROSS_DESKS(c,x) \
154 	((c).is_sticky_across_desks = !!(x))
155 #define S_DO_CIRCULATE_SKIP(c) \
156 	((c).s.do_circulate_skip)
157 #define S_SET_DO_CIRCULATE_SKIP(c,x) \
158 	((c).s.do_circulate_skip = !!(x))
159 #define S_DO_CIRCULATE_SKIP_ICON(c) \
160 	((c).s.do_circulate_skip_icon)
161 #define S_SET_DO_CIRCULATE_SKIP_ICON(c,x) \
162 	((c).s.do_circulate_skip_icon = !!(x))
163 #define S_DO_CIRCULATE_SKIP_SHADED(c) \
164 	((c).s.do_circulate_skip_shaded)
165 #define S_SET_DO_CIRCULATE_SKIP_SHADED(c,x) \
166 	((c).s.do_circulate_skip_shaded = !!(x))
167 #define S_DO_ICONIFY_WINDOW_GROUPS(c) \
168 	((c).s.do_iconify_window_groups)
169 #define S_SET_DO_ICONIFY_WINDOW_GROUPS(c,x) \
170 	((c).s.do_iconify_window_groups = !!(x))
171 #define S_DO_IGNORE_ICON_BOXES(c) \
172 	((c).s.do_ignore_icon_boxes)
173 #define S_SET_DO_IGNORE_ICON_BOXES(c,x) \
174 	((c).s.do_ignore_icon_boxes = !!(x))
175 #define S_DO_IGNORE_RESTACK(c) \
176 	((c).s.do_ignore_restack)
177 #define S_SET_DO_IGNORE_RESTACK(c,x) \
178 	((c).s.do_ignore_restack = !!(x))
179 #define S_DO_USE_WINDOW_GROUP_HINT(c) \
180 	((c).s.do_use_window_group_hint)
181 #define S_SET_DO_USE_WINDOW_GROUP_HINT(c,x) \
182 	((c).s.do_use_window_group_hint = !!(x))
183 #define S_DO_LOWER_TRANSIENT(c) \
184 	((c).s.do_lower_transient)
185 #define S_SET_DO_LOWER_TRANSIENT(c,x) \
186 	((c).s.do_lower_transient = !!(x))
187 #define S_DO_NOT_SHOW_ON_MAP(c) \
188 	((c).s.do_not_show_on_map)
189 #define S_SET_DO_NOT_SHOW_ON_MAP(c,x) \
190 	((c).s.do_not_show_on_map = !!(x))
191 #define S_DO_RAISE_TRANSIENT(c) \
192 	((c).s.do_raise_transient)
193 #define S_SET_DO_RAISE_TRANSIENT(c,x) \
194 	((c).s.do_raise_transient = !!(x))
195 #define S_DO_RESIZE_OPAQUE(c) \
196 	((c).s.do_resize_opaque)
197 #define S_SET_DO_RESIZE_OPAQUE(c,x) \
198 	((c).s.do_resize_opaque = !!(x))
199 #define S_DO_SHRINK_WINDOWSHADE(c) \
200 	((c).s.do_shrink_windowshade)
201 #define S_SET_DO_SHRINK_WINDOWSHADE(c,x) \
202 	((c).s.do_shrink_windowshade = !!(x))
203 #define S_DO_STACK_TRANSIENT_PARENT(c) \
204 	((c).s.do_stack_transient_parent)
205 #define S_SET_DO_STACK_TRANSIENT_PARENT(c,x) \
206 	((c).s.do_stack_transient_parent = !!(x))
207 #define S_DO_WINDOW_LIST_SKIP(c) \
208 	((c).s.do_window_list_skip)
209 #define S_SET_DO_WINDOW_LIST_SKIP(c,x) \
210 	((c).s.do_window_list_skip = !!(x))
211 #define S_HAS_NO_BORDER(c) \
212 	((c).has_no_border)
213 #define S_SET_HAS_NO_BORDER(c,x) \
214 	((c).has_no_border = !!(x))
215 #define S_HAS_DEPRESSABLE_BORDER(c) \
216 	((c).s.has_depressable_border)
217 #define S_SET_HAS_DEPRESSABLE_BORDER(c,x) \
218 	((c).s.has_depressable_border = !!(x))
219 #define S_HAS_ICON_FONT(c) \
220 	((c).has_icon_font)
221 #define S_SET_HAS_ICON_FONT(c,x) \
222 	((c).has_icon_font = !!(x))
223 #define S_HAS_MWM_BORDER(c) \
224 	((c).s.has_mwm_border)
225 #define S_SET_HAS_MWM_BORDER(c,x) \
226 	((c).s.has_mwm_border = !!(x))
227 #define S_HAS_MWM_BUTTONS(c) \
228 	((c).s.has_mwm_buttons)
229 #define S_SET_HAS_MWM_BUTTONS(c,x) \
230 	((c).s.has_mwm_buttons = !!(x))
231 #define S_HAS_MWM_OVERRIDE(c) \
232 	((c).s.has_mwm_override)
233 #define S_SET_HAS_MWM_OVERRIDE(c,x) \
234 	((c).s.has_mwm_override = !!(x))
235 #define S_HAS_NO_STICKY_STIPPLED_ICON_TITLE(c) \
236 	((c).s.has_no_sticky_stippled_icon_title)
237 #define S_SET_HAS_NO_STICKY_STIPPLED_ICON_TITLE(c,x) \
238 	((c).s.has_no_sticky_stippled_icon_title = !!(x))
239 #define S_HAS_NO_ICON_TITLE(c) \
240 	((c).s.has_no_icon_title)
241 #define S_SET_HAS_NO_ICON_TITLE(c,x) \
242 	((c).s.has_no_icon_title = !!(x))
243 #define S_HAS_OVERRIDE_SIZE(c) \
244 	((c).s.has_override_size)
245 #define S_SET_HAS_OVERRIDE_SIZE(c,x) \
246 	((c).s.has_override_size = !!(x))
247 #define S_HAS_STIPPLED_TITLE(c) \
248 	((c).s.has_stippled_title)
249 #define S_SET_HAS_STIPPLED_TITLE(c,x) \
250 	((c).s.has_stippled_title = !!(x))
251 #define S_HAS_NO_STICKY_STIPPLED_TITLE(c) \
252 	((c).s.has_no_sticky_stippled_title)
253 #define S_SET_HAS_NO_STICKY_STIPPLED_TITLE(c,x) \
254 	((c).s.has_no_sticky_stippled_title = !!(x))
255 #define S_HAS_STIPPLED_ICON_TITLE(c) \
256 	((c).s.has_stippled_icon_title)
257 #define S_SET_HAS_STIPPLED_ICON_TITLE(c,x) \
258 	((c).s.has_stippled_icon_title = !!(x))
259 #define S_HAS_WINDOW_FONT(c) \
260 	((c).has_window_font)
261 #define S_SET_HAS_WINDOW_FONT(c,x) \
262 	((c).has_window_font = !!(x))
263 #define S_ICON_OVERRIDE(c) \
264 	((c).s.icon_override)
265 #define S_SET_ICON_OVERRIDE(c,x) \
266 	((c).s.icon_override = (x))
267 #define S_IS_BOTTOM_TITLE_ROTATED(c) \
268 	((c).s.is_bottom_title_rotated)
269 #define S_SET_IS_BOTTOM_TITLE_ROTATED(c,x) \
270 	((c).s.is_bottom_title_rotated = !!(x))
271 #define S_IS_FIXED(c) \
272 	((c).s.is_fixed)
273 #define S_SET_IS_FIXED(c,x) \
274 	((c).s.is_fixed = !!(x))
275 #define S_IS_FIXED_PPOS(c) \
276 	((c).s.is_fixed_ppos)
277 #define S_SET_IS_FIXED_PPOS(c,x) \
278 	((c).s.is_fixed_ppos = !!(x))
279 #define S_SET_IS_UNICONIFIABLE(c,x) \
280 	((c).s.is_uniconifiable = !!(x))
281 #define S_SET_IS_UNMAXIMIZABLE(c,x) \
282 	((c).s.is_unmaximizable = !!(x))
283 #define S_SET_IS_UNCLOSABLE(c,x) \
284 	((c).s.is_unclosable = !!(x))
285 #define S_SET_MAXIMIZE_FIXED_SIZE_DISALLOWED(c,x) \
286 	((c).s.is_maximize_fixed_size_disallowed = !!(x))
287 #define S_IS_ICON_STICKY_ACROSS_PAGES(c) \
288 	((c).s.is_icon_sticky_across_pages)
289 #define S_SET_IS_ICON_STICKY_ACROSS_PAGES(c,x) \
290 	((c).s.is_icon_sticky_across_pages = !!(x))
291 #define S_IS_ICON_STICKY_ACROSS_DESKS(c) \
292 	((c).s.is_icon_sticky_across_desks)
293 #define S_SET_IS_ICON_STICKY_ACROSS_DESKS(c,x) \
294 	((c).s.is_icon_sticky_across_desks = !!(x))
295 #define S_IS_ICON_SUPPRESSED(c) \
296 	((c).s.is_icon_suppressed)
297 #define S_SET_IS_ICON_SUPPRESSED(c,x) \
298 	((c).s.is_icon_suppressed = !!(x))
299 #define S_IS_LEFT_TITLE_ROTATED_CW(c) \
300 	((c).s.is_left_title_rotated_cw)
301 #define S_SET_IS_LEFT_TITLE_ROTATED_CW(c,x) \
302 	((c).s.is_left_title_rotated_cw = !!(x))
303 #define S_IS_SIZE_FIXED(c) \
304 	((c).s.is_size_fixed)
305 #define S_SET_IS_SIZE_FIXED(c,x) \
306 	((c).s.is_size_fixed = !!(x))
307 #define S_IS_PSIZE_FIXED(c) \
308 	((c).s.is_psize_fixed)
309 #define S_SET_IS_PSIZE_FIXED(c,x) \
310 	((c).s.is_psize_fixed = !!(x))
311 #define S_IS_RIGHT_TITLE_ROTATED_CW(c) \
312 	((c).s.is_right_title_rotated_cw)
313 #define S_SET_IS_RIGHT_TITLE_ROTATED_CW(c,x) \
314 	((c).s.is_right_title_rotated_cw = !!(x))
315 #define S_IS_TOP_TITLE_ROTATED(c) \
316 	((c).s.is_top_title_rotated)
317 #define S_SET_IS_TOP_TITLE_ROTATED(c,x) \
318 	((c).s.is_top_title_rotated = !!(x))
319 #define S_USE_ICON_POSITION_HINT(c) \
320 	((c).s.use_icon_position_hint)
321 #define S_SET_USE_ICON_POSITION_HINT(c,x) \
322 	((c).s.use_icon_position_hint = !!(x))
323 #define S_USE_INDEXED_WINDOW_NAME(c) \
324 	((c).s.use_indexed_window_name)
325 #define S_SET_USE_INDEXED_WINDOW_NAME(c,x) \
326 	((c).s.use_indexed_window_name = !!(x))
327 #define S_USE_INDEXED_ICON_NAME(c) \
328 	((c).s.use_indexed_icon_name)
329 #define S_SET_USE_INDEXED_ICON_NAME(c,x) \
330 	((c).s.use_indexed_icon_name = !!(x))
331 #define S_WINDOWSHADE_LAZINESS(c) \
332 	((c).s.windowshade_laziness)
333 #define S_SET_WINDOWSHADE_LAZINESS(c,x) \
334 	((c).s.windowshade_laziness = (x))
335 #define S_USE_TITLE_DECOR_ROTATION(c) \
336 	((c).s.use_title_decor_rotation)
337 #define S_SET_USE_TITLE_DECOR_ROTATION(c,x) \
338 	((c).s.use_title_decor_rotation = !!(x))
339 #define S_DO_EWMH_MINI_ICON_OVERRIDE(c) \
340 	((c).s.do_ewmh_mini_icon_override)
341 #define S_SET_DO_EWMH_MINI_ICON_OVERRIDE(c,x) \
342 	((c).s.do_ewmh_mini_icon_override = !!(x))
343 #define S_DO_EWMH_DONATE_ICON(c) \
344 	((c).s.do_ewmh_donate_icon)
345 #define S_SET_DO_EWMH_DONATE_ICON(c,x) \
346 	((c).s.do_ewmh_donate_icon = !!(x))
347 #define S_DO_EWMH_DONATE_MINI_ICON(c) \
348 	((c).s.do_ewmh_donate_mini_icon)
349 #define S_SET_DO_EWMH_DONATE_MINI_ICON(c,x) \
350 	((c).s.do_ewmh_donate_mini_icon = !!(x))
351 #define S_DO_EWMH_USE_STACKING_HINTS(c) \
352 	((c).s.do_ewmh_use_stacking_hints)
353 #define S_SET_DO_EWMH_USE_STACKING_HINTS(c,x) \
354 	((c).s.do_ewmh_use_stacking_hints = !!(x))
355 #define S_DO_EWMH_IGNORE_STRUT_HINTS(c) \
356 	((c).s.do_ewmh_ignore_strut_hints)
357 #define S_SET_DO_EWMH_IGNORE_STRUT_HINTS(c,x) \
358 	((c).s.do_ewmh_ignore_strut_hints = !!(x))
359 #define S_DO_EWMH_IGNORE_STATE_HINTS(c) \
360 	((c).s.do_ewmh_ignore_state_hints)
361 #define S_SET_DO_EWMH_IGNORE_STATE_HINTS(c,x) \
362 	((c).s.do_ewmh_ignore_state_hints = !!(x))
363 #define S_DO_EWMH_IGNORE_WINDOW_TYPE(c) \
364 	((c).s.do_ewmh_ignore_window_type)
365 #define S_SET_DO_EWMH_IGNORE_WINDOW_TYPE(c,x) \
366 	((c).s.do_ewmh_ignore_window_type = !!(x))
367 #define S_EWMH_MAXIMIZE_MODE(c) \
368 	((c).s.ewmh_maximize_mode)
369 #define S_SET_EWMH_MAXIMIZE_MODE(c,x) \
370 	((c).s.ewmh_maximize_mode = (x))
371 
372 /* access to style_id */
373 #define SID_GET_NAME(id) \
374 	((id).name)
375 #define SID_SET_NAME(id,x) \
376 	((id).name = (x))
377 #define SID_GET_WINDOW_ID(id) \
378 	((id).window_id)
379 #define SID_SET_WINDOW_ID(id,x) \
380 	((id).window_id = (x))
381 #define SID_SET_HAS_NAME(id,x) \
382 	((id).flags.has_name = !!(x))
383 #define SID_GET_HAS_NAME(id) \
384 	((id).flags.has_name)
385 #define SID_SET_HAS_WINDOW_ID(id,x) \
386 	((id).flags.has_window_id = !!(x))
387 #define SID_GET_HAS_WINDOW_ID(id) \
388 	((id).flags.has_window_id)
389 
390 /* access to other parts of a style (call with the style itself) */
391 #define SGET_NEXT_STYLE(s) \
392 	((s).next)
393 #define SSET_NEXT_STYLE(s,x) \
394 	((s).next = (x))
395 #define SGET_PREV_STYLE(s) \
396 	((s).prev)
397 #define SSET_PREV_STYLE(s,x) \
398 	((s).prev = (x))
399 #define SGET_ID(s) \
400 	((s).id)
401 #define SGET_NAME(s) \
402 	SID_GET_NAME(SGET_ID(s))
403 #define SSET_NAME(s,x) \
404 	SID_SET_NAME(SGET_ID(s),x)
405 #define SGET_WINDOW_ID(s) \
406 	SID_GET_WINDOW_ID(SGET_ID(s))
407 #define SSET_WINDOW_ID(s,x) \
408 	SID_SET_WINDOW_ID(SGET_ID(s),x)
409 #define SSET_ID_HAS_NAME(s,x) \
410         SID_SET_HAS_NAME(SGET_ID(s), x)
411 #define SGET_ID_HAS_NAME(s) \
412 	SID_GET_HAS_NAME(SGET_ID(s))
413 #define SSET_ID_HAS_WINDOW_ID(s,x) \
414 	SID_SET_HAS_WINDOW_ID(SGET_ID(s),x)
415 #define SGET_ID_HAS_WINDOW_ID(s) \
416 	SID_GET_HAS_WINDOW_ID(SGET_ID(s))
417 #define SGET_ICON_NAME(s) \
418 	((s).icon_name)
419 #define SSET_ICON_NAME(s,x) \
420 	((s).icon_name = (x))
421 #define SGET_MINI_ICON_NAME(s) \
422 	((s).mini_icon_name)
423 #define SSET_MINI_ICON_NAME(s,x) \
424 	((s).mini_icon_name = (x))
425 #define SGET_DECOR_NAME(s) \
426 	((s).decor_name)
427 #define SSET_DECOR_NAME(s,x) \
428 	((s).decor_name = (x))
429 #define SGET_FORE_COLOR_NAME(s) \
430 	((s).fore_color_name)
431 #define SSET_FORE_COLOR_NAME(s,x) \
432 	((s).fore_color_name = (x))
433 #define SGET_BACK_COLOR_NAME(s) \
434 	((s).back_color_name)
435 #define SSET_BACK_COLOR_NAME(s,x) \
436 	((s).back_color_name = (x))
437 #define SGET_FORE_COLOR_NAME_HI(s) \
438 	((s).fore_color_name_hi)
439 #define SSET_FORE_COLOR_NAME_HI(s,x) \
440 	((s).fore_color_name_hi = (x))
441 #define SGET_BACK_COLOR_NAME_HI(s) \
442 	((s).back_color_name_hi)
443 #define SSET_BACK_COLOR_NAME_HI(s,x) \
444 	((s).back_color_name_hi = (x))
445 #define SGET_ICON_FONT(s) \
446 	((s).icon_font)
447 #define SSET_ICON_FONT(s,x) \
448 	((s).icon_font = (x))
449 #define SGET_WINDOW_FONT(s) \
450 	((s).window_font)
451 #define SSET_WINDOW_FONT(s,x) \
452 	((s).window_font = (x))
453 #define SGET_COLORSET(s) \
454 	((s).colorset)
455 #define SSET_COLORSET(s,x) \
456 	((s).colorset = (x))
457 #define SSET_BORDER_COLORSET(s,x) \
458 	((s).border_colorset = (x))
459 #define SGET_BORDER_COLORSET(s) \
460 	((s).border_colorset)
461 #define SGET_COLORSET_HI(s) \
462 	((s).colorset_hi)
463 #define SSET_COLORSET_HI(s,x) \
464 	((s).colorset_hi = (x))
465 #define SGET_BORDER_COLORSET_HI(s) \
466 	((s).border_colorset_hi)
467 #define SSET_BORDER_COLORSET_HI(s,x) \
468 	((s).border_colorset_hi = (x))
469 #define SSET_ICON_TITLE_COLORSET(s,x) \
470 	((s).icon_title_colorset = (x))
471 #define SGET_ICON_TITLE_COLORSET(s) \
472 	((s).icon_title_colorset)
473 #define SSET_ICON_TITLE_COLORSET_HI(s,x) \
474 	((s).icon_title_colorset_hi = (x))
475 #define SGET_ICON_TITLE_COLORSET_HI(s) \
476 	((s).icon_title_colorset_hi)
477 #define SSET_ICON_BACKGROUND_COLORSET(s,x) \
478 	((s).icon_background_colorset = (x))
479 #define SGET_ICON_BACKGROUND_COLORSET(s) \
480 	((s).icon_background_colorset)
481 #define SGET_FLAGS_POINTER(s) \
482 	(&((s).flags))
483 #define SGET_BORDER_WIDTH(s) \
484 	((s).border_width)
485 #define SSET_BORDER_WIDTH(s,x) \
486 	((s).border_width = (x))
487 #define SGET_HANDLE_WIDTH(s) \
488 	((s).handle_width)
489 #define SSET_HANDLE_WIDTH(s,x) \
490 	((s).handle_width = (x))
491 #define SGET_LAYER(s) \
492 	((s).layer)
493 #define SSET_LAYER(s,x) \
494 	((s).layer = (x))
495 #define SGET_START_DESK(s) \
496 	((s).start_desk)
497 #define SSET_START_DESK(s,x) \
498 	((s).start_desk = (x))
499 #define SGET_START_PAGE_X(s) \
500 	((s).start_page_x)
501 #define SSET_START_PAGE_X(s,x) \
502 	((s).start_page_x = (x))
503 #define SGET_START_PAGE_Y(s) \
504 	((s).start_page_y)
505 #define SSET_START_PAGE_Y(s,x) \
506 	((s).start_page_y = (x))
507 #define SGET_START_SCREEN(s) \
508 	((s).start_screen)
509 #define SSET_START_SCREEN(s,x) \
510 	((s).start_screen = (x))
511 #define SSET_STARTS_SHADED_DIR(s,x) \
512 	((s).flags.start_shaded_dir = (x))
513 #define SGET_STARTS_SHADED_DIR(s)		\
514 	((s).flags.start_shaded_dir)
515 #define SGET_MIN_ICON_WIDTH(s) \
516 	((s).min_icon_width)
517 #define SSET_MIN_ICON_WIDTH(s,x) \
518 	((s).min_icon_width = (x))
519 #define SGET_MIN_ICON_HEIGHT(s) \
520 	((s).min_icon_height)
521 #define SSET_MIN_ICON_HEIGHT(s,x) \
522 	((s).min_icon_height = (x))
523 #define SGET_MAX_ICON_WIDTH(s) \
524 	((s).max_icon_width)
525 #define SSET_MAX_ICON_WIDTH(s,x) \
526 	((s).max_icon_width = (x))
527 #define SGET_MAX_ICON_HEIGHT(s) \
528 	((s).max_icon_height)
529 #define SSET_MAX_ICON_HEIGHT(s,x) \
530 	((s).max_icon_height = (x))
531 #define SGET_ICON_RESIZE_TYPE(s) \
532 	((s).icon_resize_type)
533 #define SSET_ICON_RESIZE_TYPE(s,x) \
534 	((s).icon_resize_type = (x))
535 #define SGET_ICON_BACKGROUND_RELIEF(s) \
536 	((s).icon_background_relief)
537 #define SSET_ICON_BACKGROUND_RELIEF(s,x) \
538 	((s).icon_background_relief = (x))
539 #define SGET_ICON_BACKGROUND_PADDING(s) \
540 	((s).icon_background_padding)
541 #define SSET_ICON_BACKGROUND_PADDING(s,x) \
542 	((s).icon_background_padding = (x))
543 #define SGET_ICON_TITLE_RELIEF(s) \
544 	((s).icon_title_relief)
545 #define SSET_ICON_TITLE_RELIEF(s,x) \
546 	((s).icon_title_relief = (x))
547 #define SGET_MIN_WINDOW_WIDTH(s) \
548 	((s).min_window_width)
549 #define SGET_MIN_WINDOW_WIDTH_IS_C(s) \
550 	((s).min_window_width_is_c)
551 #define SSET_MIN_WINDOW_WIDTH(s,x) \
552 	((s).min_window_width = (x))
553 #define SSET_MIN_WINDOW_WIDTH_IS_C(s,x) \
554 	((s).min_window_width_is_c = (x))
555 #define SGET_MAX_WINDOW_WIDTH(s) \
556 	((s).max_window_width)
557 #define SGET_MAX_WINDOW_WIDTH_IS_C(s) \
558 	((s).max_window_width_is_c)
559 #define SSET_MAX_WINDOW_WIDTH(s,x) \
560 	((s).max_window_width = (x))
561 #define SSET_MAX_WINDOW_WIDTH_IS_C(s,x) \
562 	((s).max_window_width_is_c = (x))
563 #define SGET_MIN_WINDOW_HEIGHT(s) \
564 	((s).min_window_height)
565 #define SGET_MIN_WINDOW_HEIGHT_IS_C(s) \
566 	((s).min_window_height_is_c)
567 #define SSET_MIN_WINDOW_HEIGHT(s,x) \
568 	((s).min_window_height = (x))
569 #define SSET_MIN_WINDOW_HEIGHT_IS_C(s,x) \
570 	((s).min_window_height_is_c = (x))
571 #define SGET_MAX_WINDOW_HEIGHT(s) \
572 	((s).max_window_height)
573 #define SGET_MAX_WINDOW_HEIGHT_IS_C(s) \
574 	((s).max_window_height_is_c)
575 #define SSET_MAX_WINDOW_HEIGHT(s,x) \
576 	((s).max_window_height = (x))
577 #define SSET_MAX_WINDOW_HEIGHT_IS_C(s,x) \
578 	((s).max_window_height_is_c = (x))
579 #define SGET_WINDOW_SHADE_STEPS(s) \
580 	((s).shade_anim_steps)
581 #define SSET_WINDOW_SHADE_STEPS(s,x) \
582 	((s).shade_anim_steps = (x))
583 #define SGET_SNAP_PROXIMITY(s) \
584 	((s).snap_attraction.proximity)
585 #define SSET_SNAP_PROXIMITY(s,x) \
586 	((s).snap_attraction.proximity = (x))
587 #define SGET_SNAP_MODE(s) \
588 	((s).snap_attraction.mode)
589 #define SSET_SNAP_MODE(s,x) \
590 	((s).snap_attraction.mode = (x))
591 #define SGET_SNAP_GRID_X(s) \
592 	((s).snap_grid_x)
593 #define SSET_SNAP_GRID_X(s,x) \
594 	((s).snap_grid_x = (x))
595 #define SGET_SNAP_GRID_Y(s) \
596 	((s).snap_grid_y)
597 #define SSET_SNAP_GRID_Y(s,x) \
598 	((s).snap_grid_y = (x))
599 #define SGET_EDGE_DELAY_MS_MOVE(s) \
600 	((s).edge_delay_ms_move)
601 #define SSET_EDGE_DELAY_MS_MOVE(s,x) \
602 	((s).edge_delay_ms_move = (x))
603 #define SGET_EDGE_DELAY_MS_RESIZE(s) \
604 	((s).edge_delay_ms_resize)
605 #define SSET_EDGE_DELAY_MS_RESIZE(s,x) \
606 	((s).edge_delay_ms_resize = (x))
607 #define SGET_EDGE_RESISTANCE_MOVE(s) \
608 	((s).edge_resistance_move)
609 #define SSET_EDGE_RESISTANCE_MOVE(s,x) \
610 	((s).edge_resistance_move = (x))
611 #define SGET_EDGE_RESISTANCE_XINERAMA_MOVE(s) \
612 	((s).edge_resistance_xinerama_move)
613 #define SSET_EDGE_RESISTANCE_XINERAMA_MOVE(s,x) \
614 	((s).edge_resistance_xinerama_move = (x))
615 #define SGET_ICON_BOXES(s) \
616 	((s).icon_boxes)
617 #define SSET_ICON_BOXES(s,x) \
618 	((s).icon_boxes = (x))
619 #define SGET_PLACEMENT_PENALTY_PTR(s) \
620 	(&(s).pl_penalty)
621 #define SGET_NORMAL_PLACEMENT_PENALTY(s) \
622 	((s).pl_penalty.normal)
623 #define SGET_ONTOP_PLACEMENT_PENALTY(s) \
624 	((s).pl_penalty.ontop)
625 #define SGET_ICON_PLACEMENT_PENALTY(s) \
626 	((s).pl_penalty.icon)
627 #define SGET_STICKY_PLACEMENT_PENALTY(s) \
628 	((s).pl_penalty.sticky)
629 #define SGET_BELOW_PLACEMENT_PENALTY(s) \
630 	((s).pl_penalty.below)
631 #define SGET_EWMH_STRUT_PLACEMENT_PENALTY(s) \
632 	((s).pl_penalty.strut)
633 #define SSET_NORMAL_PLACEMENT_PENALTY(s,x) \
634 	((s).pl_penalty.normal = (x))
635 #define SSET_ONTOP_PLACEMENT_PENALTY(s,x) \
636 	((s).pl_penalty.ontop = (x))
637 #define SSET_ICON_PLACEMENT_PENALTY(s,x) \
638 	((s).pl_penalty.icon = (x))
639 #define SSET_STICKY_PLACEMENT_PENALTY(s,x) \
640 	((s).pl_penalty.sticky = (x))
641 #define SSET_BELOW_PLACEMENT_PENALTY(s,x) \
642 	((s).pl_penalty.below = (x))
643 #define SSET_EWMH_STRUT_PLACEMENT_PENALTY(s,x) \
644 	((s).pl_penalty.strut = (x))
645 #define SGET_PLACEMENT_PERCENTAGE_PENALTY_PTR(s) \
646 	(&(s).pl_percent_penalty)
647 #define SGET_99_PLACEMENT_PERCENTAGE_PENALTY(s) \
648 	((s).pl_percent_penalty.p99)
649 #define SGET_95_PLACEMENT_PERCENTAGE_PENALTY(s) \
650 	((s).pl_percent_penalty.p95)
651 #define SGET_85_PLACEMENT_PERCENTAGE_PENALTY(s) \
652 	((s).pl_percent_penalty.p85)
653 #define SGET_75_PLACEMENT_PERCENTAGE_PENALTY(s) \
654 	((s).pl_percent_penalty.p75)
655 #define SSET_99_PLACEMENT_PERCENTAGE_PENALTY(s,x) \
656 	((s).pl_percent_penalty.p99 = (x))
657 #define SSET_95_PLACEMENT_PERCENTAGE_PENALTY(s,x) \
658 	((s).pl_percent_penalty.p95 = (x))
659 #define SSET_85_PLACEMENT_PERCENTAGE_PENALTY(s,x) \
660 	((s).pl_percent_penalty.p85 = (x))
661 #define SSET_75_PLACEMENT_PERCENTAGE_PENALTY(s,x) \
662 	((s).pl_percent_penalty.p75 = (x))
663 #define SGET_PLACEMENT_POSITION_STRING(s) \
664 	((s).pl_position_string)
665 #define SSET_PLACEMENT_POSITION_STRING(s,x)	\
666 	((s).pl_position_string = (x))
667 #define SGET_INITIAL_MAP_COMMAND_STRING(s) \
668 	((s).initial_map_command_string)
669 #define SSET_INITIAL_MAP_COMMAND_STRING(s,x)	\
670 	((s).initial_map_command_string = (x))
671 #define SGET_TITLE_FORMAT_STRING(s) \
672 	((s).title_format_string)
673 #define SSET_TITLE_FORMAT_STRING(s,x) \
674 	((s).title_format_string = (x))
675 #define SGET_ICON_TITLE_FORMAT_STRING(s) \
676 	((s).icon_title_format_string)
677 #define SSET_ICON_TITLE_FORMAT_STRING(s,x) \
678 	((s).icon_title_format_string = (x))
679 
680 /* function prototypes */
681 void lookup_style(FvwmWindow *fw, window_style *styles);
682 Bool blockcmpmask(char *blk1, char *blk2, char *mask, int length);
683 void check_window_style_change(
684 	FvwmWindow *t, update_win *flags, window_style *ret_style);
685 void reset_style_changes(void);
686 void update_style_colorset(int colorset);
687 void update_window_color_style(FvwmWindow *fw, window_style *style);
688 void update_window_color_hi_style(FvwmWindow *fw, window_style *style);
689 void update_icon_title_cs_style(FvwmWindow *fw, window_style *pstyle);
690 void update_icon_title_cs_hi_style(FvwmWindow *fw, window_style *pstyle);
691 void update_icon_background_cs_style(FvwmWindow *fw, window_style *pstyle);
692 void free_icon_boxes(icon_boxes *ib);
693 void style_destroy_style(style_id_t s_id);
694 void print_styles(int verbose);
695 
696 #endif /* FVWM_STYLE_H */
697