Fix compilation without libstroke for print_bindings.
[fvwm.git] / fvwm / fvwm.h
blob07d8196cd43d43e812c12849ed329959618de464
1 /* -*-c-*- */
2 /* This module is based on Twm, but has been siginificantly modified
3 * by Rob Nation */
4 /*
5 * Copyright 1988 by Evans & Sutherland Computer Corporation,
6 * Salt Lake City, Utah
7 * Portions Copyright 1989 by the Massachusetts Institute of Technology
8 * Cambridge, Massachusetts
10 * All Rights Reserved
12 * Permission to use, copy, modify, and distribute this software and
13 * its documentation for any purpose and without fee is hereby
14 * granted, provided that the above copyright notice appear in all
15 * copies and that both that copyright notice and this permis-
16 * sion notice appear in supporting documentation, and that the
17 * names of Evans & Sutherland and M.I.T. not be used in advertising
18 * in publicity pertaining to distribution of the software without
19 * specific, written prior permission.
21 * EVANS & SUTHERLAND AND M.I.T. DISCLAIM ALL WARRANTIES WITH REGARD
22 * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
23 * ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND OR
24 * M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM-
25 * AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
26 * OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
27 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
28 * OR PERFORMANCE OF THIS SOFTWARE.
31 #ifndef FVWM_H
32 #define FVWM_H
34 /* ---------------------------- included header files ---------------------- */
36 #include <X11/Xlib.h>
37 #include <X11/Xutil.h>
38 #include <X11/cursorfont.h>
39 #include <X11/Intrinsic.h>
40 #include "libs/PictureBase.h"
41 #include "libs/Flocale.h"
42 #include "window_flags.h"
43 #include "condrc.h"
45 /* ---------------------------- global definitions ------------------------- */
47 #ifndef WithdrawnState
48 #define WithdrawnState 0
49 #endif
51 /* ---------------------------- global macros ------------------------------ */
54 * Fvwm trivia: There were 97 commands in the fvwm command table
55 * when the F_CMD_ARGS macro was written.
56 * dje 12/19/98.
59 /* Macro for args passed to fvwm commands... */
60 #define F_CMD_ARGS \
61 cond_rc_t *cond_rc, const exec_context_t *exc, char *action
62 #define F_PASS_ARGS cond_rc, exc, action
63 #define FUNC_FLAGS_TYPE unsigned char
65 /* access macros */
66 #define FW_W_FRAME(fw) ((fw)->wins.frame)
67 #define FW_W_PARENT(fw) ((fw)->wins.parent)
68 #define FW_W_CLIENT(fw) ((fw)->wins.client)
69 #define FW_W(fw) FW_W_CLIENT(fw)
70 #define FW_W_TITLE(fw) ((fw)->wins.title)
71 #define FW_W_BUTTON(fw,i) ((fw)->wins.button_w[(i)])
72 #define FW_W_SIDE(fw,i) ((fw)->wins.sides[(i)])
73 #define FW_W_CORNER(fw,i) ((fw)->wins.corners[(i)])
74 #define FW_W_ICON_TITLE(fw) ((fw)->wins.icon_title_w)
75 #define FW_W_ICON_PIXMAP(fw) ((fw)->wins.icon_pixmap_w)
76 #define FW_W_TRANSIENTFOR(fw) ((fw)->wins.transientfor)
78 /* ---------------------------- forward declarations ----------------------- */
80 struct exec_context_t;
82 #ifdef USEDECOR
83 /* definition in screen.h */
84 struct FvwmDecor;
85 #endif
87 /* ---------------------------- type definitions --------------------------- */
89 /* This structure carries information about the initial window state and
90 * placement. This information is gathered at various places: the (re)capture
91 * code, AddToWindow(), HandleMapRequestRaised(), ewmh_events.c and others.
93 * initial_state
94 * The initial window state. By default it carries the value DontCareState.
95 * Other states can be set if
96 * - an icon is recaptured or restarted with session management
97 * - the StartIconic style is set
98 * - GNOME, EWMH, foobar hints demand that the icon starts iconic
99 * The final value is calculated in HandleMapRequestRaised().
101 * do_override_ppos
102 * This flag is used in PlaceWindow(). If it is set, the position requested
103 * by the program is ignored unconditionally. This is used during the
104 * initial capture and later recapture operations.
106 * is_iconified_by_parent
107 * Preserves the information if the window is a transient window that was
108 * iconified along with its transientfor window. Set when the window is
109 * recaptured and used in HandleMapRequestRaised() to set the according
110 * window state flag. Deleted afterwards.
112 * is_menu
113 * Set in menus.c or in the recapture code if the new window is a tear off
114 * menu. Such windows get special treatment in AddWindow() and events.c.
116 * is_recapture
117 * Set for the initial capture and later recaptures.
119 * default_icon_x/y
120 * The icon position that was requested by the application in the icon
121 * position hint. May be overridden by a style (0/0 then). Set in
122 * HandleMapRequestRaised() and used in the icon placement code.
124 * initial_icon_x/y
125 * The icon position that is forced during a restart with SM. If set it
126 * overrides all other methods of icon placement. Set by session.c and used
127 * in the icon placement code.
129 * use_initial_icon_xy
130 * If set, the initial_icon_x/y values are used. Other wise they are
131 * ignored.
133 typedef struct
135 long initial_state;
136 struct
138 unsigned do_override_ppos : 1;
139 unsigned is_iconified_by_parent : 1;
140 unsigned is_menu : 1;
141 unsigned is_recapture : 1;
142 unsigned use_initial_icon_xy : 1;
143 } flags;
144 int initial_icon_x;
145 int initial_icon_y;
146 int default_icon_x;
147 int default_icon_y;
148 } initial_window_options_t;
151 For 1 style statement, there can be any number of IconBoxes.
152 The name list points at the first one in the chain.
154 typedef struct icon_boxes_struct
156 struct icon_boxes_struct *next; /* next icon_boxes or zero */
157 unsigned int use_count;
158 int IconBox[4]; /* x/y x/y for iconbox */
159 int IconScreen; /* Xinerama screen */
160 short IconGrid[2]; /* x incr, y incr */
161 char IconSign[4]; /* because of -0, need to save */
162 unsigned is_orphan : 1;
163 unsigned IconFlags : 3; /* some bits */
164 /* IconFill only takes 3 bits. Defaults are top, left, vert co-ord
165 * first eg: t l = 0,0,0; l t = 0,0,1; b r = 1,1,0 */
166 #define ICONFILLBOT (1<<0)
167 #define ICONFILLRGT (1<<1)
168 #define ICONFILLHRZ (1<<2)
169 } icon_boxes;
171 typedef struct
173 Pixel fore;
174 Pixel back;
175 } ColorPair;
177 typedef struct
179 Pixel fore;
180 Pixel back;
181 Pixel hilight;
182 Pixel shadow;
183 } color_quad;
185 typedef struct
187 int left;
188 int right;
189 int top;
190 int bottom;
191 } ewmh_strut;
193 typedef struct
195 /* common flags (former flags in bits 0-12) */
196 unsigned is_sticky_across_pages : 1;
197 unsigned is_sticky_across_desks : 1;
198 unsigned has_icon_font : 1;
199 unsigned has_no_border : 1;
200 unsigned has_window_font : 1;
201 unsigned title_dir : 2;
202 unsigned user_states : 32;
203 /* static flags that do not change dynamically after the window has
204 * been created */
205 struct
207 unsigned do_circulate_skip : 1;
208 unsigned do_circulate_skip_icon : 1;
209 unsigned do_circulate_skip_shaded : 1;
210 unsigned do_ewmh_donate_icon : 1;
211 unsigned do_ewmh_donate_mini_icon : 1;
212 unsigned do_ewmh_ignore_state_hints : 1;
213 unsigned do_ewmh_ignore_strut_hints : 1;
214 unsigned do_ewmh_mini_icon_override : 1;
215 unsigned do_ewmh_use_stacking_hints : 1;
216 unsigned do_ewmh_ignore_window_type : 1;
217 unsigned do_iconify_window_groups : 1;
218 unsigned do_ignore_gnome_hints : 1;
219 unsigned do_ignore_icon_boxes : 1;
220 unsigned do_ignore_restack : 1;
221 unsigned do_use_window_group_hint : 1;
222 unsigned do_lower_transient : 1;
223 unsigned do_not_show_on_map : 1;
224 unsigned do_raise_transient : 1;
225 unsigned do_resize_opaque : 1;
226 unsigned do_shrink_windowshade : 1;
227 unsigned do_stack_transient_parent : 1;
228 unsigned do_window_list_skip : 1;
229 unsigned ewmh_maximize_mode : 2; /* see ewmh.h */
230 unsigned has_depressable_border : 1;
231 unsigned has_mwm_border : 1;
232 unsigned has_mwm_buttons : 1;
233 unsigned has_mwm_override : 1;
234 unsigned has_no_icon_title : 1;
235 unsigned has_override_size : 1;
236 unsigned has_stippled_title : 1;
237 unsigned has_stippled_icon_title : 1;
238 /* default has to be 0, therefore no_, not in macros */
239 unsigned has_no_sticky_stippled_title : 1;
240 unsigned has_no_sticky_stippled_icon_title : 1;
241 unsigned icon_override : 2;
242 #define NO_ACTIVE_ICON_OVERRIDE 0
243 #define ICON_OVERRIDE 1
244 #define NO_ICON_OVERRIDE 2
245 #define ICON_OVERRIDE_MASK 0x3
246 unsigned is_bottom_title_rotated : 1;
247 unsigned is_fixed : 1;
248 unsigned is_fixed_ppos : 1;
249 unsigned is_uniconifiable : 1;
250 unsigned is_unmaximizable : 1;
251 unsigned is_unclosable : 1;
252 unsigned is_maximize_fixed_size_disallowed : 1;
253 unsigned is_icon_sticky_across_pages : 1;
254 unsigned is_icon_sticky_across_desks : 1;
255 unsigned is_icon_suppressed : 1;
256 unsigned is_left_title_rotated_cw : 1; /* cw = clock wise */
257 unsigned is_lenient : 1;
258 unsigned is_size_fixed : 1;
259 unsigned is_psize_fixed : 1;
260 unsigned is_right_title_rotated_cw : 1;
261 unsigned is_top_title_rotated : 1;
262 unsigned use_icon_position_hint : 1;
263 unsigned use_indexed_window_name : 1;
264 unsigned use_indexed_icon_name : 1;
265 #define WINDOWSHADE_LAZY 0
266 #define WINDOWSHADE_ALWAYS_LAZY 1
267 #define WINDOWSHADE_BUSY 2
268 #define WINDOWSHADE_LAZY_MASK 0x3
269 unsigned windowshade_laziness : 2;
270 unsigned use_title_decor_rotation : 1;
271 focus_policy_t focus_policy;
272 } s;
273 } common_flags_t;
275 typedef struct
277 common_flags_t common;
278 #define CR_MOTION_METHOD_AUTO 0
279 #define CR_MOTION_METHOD_USE_GRAV 1
280 #define CR_MOTION_METHOD_STATIC_GRAV 2
281 #define CR_MOTION_METHOD_MASK 0x3
282 unsigned cr_motion_method : 2;
283 unsigned was_cr_motion_method_detected : 1;
284 unsigned does_wm_delete_window : 1;
285 unsigned does_wm_take_focus : 1;
286 unsigned do_force_next_cr : 1;
287 unsigned do_force_next_pn : 1;
288 unsigned do_iconify_after_map : 1;
289 unsigned do_disable_constrain_size_fullscreen : 1;
290 /* Reuse this struct, don't free it, when destroying/recapturing
291 * window. */
292 unsigned do_reuse_destroyed : 1;
293 /* Does it have resize handles? */
294 unsigned has_handles : 1;
295 /* Icon change is pending */
296 unsigned has_icon_changed : 1;
297 /* Is this decorated with title */
298 unsigned has_title : 1;
299 /* wm_normal_hints update is pending? */
300 unsigned has_new_wm_normal_hints : 1;
301 /* ChangeDecor was used for window */
302 unsigned is_decor_changed : 1;
303 /* Sent an XUnmapWindow for iconifying, but didn't receive an
304 * UnmapNotify yet.*/
305 unsigned is_iconify_pending : 1;
306 /* window had the focus when the desk was switched. set if the window
307 * was mapped and got focused but the focus change was not announced
308 * to the modules yet. */
309 unsigned is_focused_on_other_desk : 1;
310 unsigned is_focus_change_broadcast_pending : 1;
311 /* is the window fully visible */
312 unsigned is_fully_visible : 1;
313 /* is it an icon now? */
314 unsigned is_iconified : 1;
315 /* To prevent iconified transients in a parent icon from counting for
316 * Next */
317 unsigned is_iconified_by_parent : 1;
318 /* is the pointer over the icon? */
319 unsigned is_icon_entered : 1;
320 unsigned is_icon_font_loaded : 1;
321 /* has the icon been moved by the user? */
322 unsigned is_icon_moved : 1;
323 /* is the icon window supplied by the app? */
324 unsigned is_icon_ours : 1;
325 /* is the icon shaped? */
326 unsigned is_icon_shaped : 1;
327 /* was the icon unmapped, even though the window is still iconified
328 * (Transients) */
329 unsigned is_icon_unmapped : 1;
330 /* temporary flag used in stack.c */
331 unsigned is_in_transient_subtree : 1;
332 /* is it mapped? */
333 unsigned is_mapped : 1;
334 /* Sent an XMapWindow, but didn't receive a MapNotify yet.*/
335 unsigned is_map_pending : 1;
336 /* is the window maximized? */
337 unsigned is_maximized : 1;
338 /* Set if the client changes its WM_NAME. The source of twm contains
339 * an explanation why we need this information. */
340 unsigned is_name_changed : 1;
341 /* is the window partially visible */
342 unsigned is_partially_visible : 1;
343 /* is the icon pixmap ours to free? */
344 unsigned is_pixmap_ours : 1;
345 /* fvwm places the window itself */
346 unsigned is_placed_by_fvwm : 1;
347 /* mark window to be destroyed after last complex func has finished. */
348 unsigned is_scheduled_for_destroy : 1;
349 /* mark window to be raised after function execution. */
350 unsigned is_scheduled_for_raise : 1;
351 unsigned is_size_inc_set : 1;
352 unsigned is_style_deleted : 1;
353 /* the window is a torn out fvwm menu */
354 unsigned is_tear_off_menu : 1;
355 /* is it a transient window? */
356 unsigned is_transient : 1;
357 unsigned is_window_drawn_once : 1;
358 /* To prevent double move in MoveViewport.*/
359 unsigned is_viewport_moved : 1;
360 unsigned is_window_being_moved_opaque : 1;
361 unsigned is_window_font_loaded : 1;
362 unsigned is_window_shaded : 1;
363 unsigned used_title_dir_for_shading : 1;
364 unsigned shaded_dir : 3;
365 unsigned using_default_icon_font : 1;
366 unsigned using_default_window_font : 1;
367 #define ICON_HINT_NEVER 0
368 #define ICON_HINT_ONCE 1
369 #define ICON_HINT_MULTIPLE 2
370 unsigned was_icon_hint_provided : 2;
371 unsigned was_icon_name_provided : 1;
372 unsigned was_never_drawn : 1;
373 unsigned has_ewmh_wm_name : 1;
374 unsigned has_ewmh_wm_icon_name : 1;
375 #define EWMH_NO_ICON 0 /* the application does not provide an ewmh icon */
376 #define EWMH_TRUE_ICON 1 /* the application does provide an ewmh icon */
377 #define EWMH_FVWM_ICON 2 /* the ewmh icon has been set by fvwm */
378 unsigned has_ewmh_wm_icon_hint : 2;
379 /* says if the app have an ewmh icon of acceptable size for a mini
380 * icon in its list of icons */
381 unsigned has_ewmh_mini_icon : 1;
382 unsigned has_ewmh_wm_pid : 1;
383 /* the ewmh icon is used as icon pixmap */
384 unsigned use_ewmh_icon : 1;
385 unsigned is_ewmh_modal : 1;
386 unsigned is_ewmh_fullscreen : 1;
387 #define EWMH_STATE_UNDEFINED_HINT 0
388 #define EWMH_STATE_NO_HINT 1
389 #define EWMH_STATE_HAS_HINT 2
390 unsigned has_ewmh_init_fullscreen_state : 2;
391 unsigned has_ewmh_init_hidden_state : 2;
392 unsigned has_ewmh_init_maxhoriz_state : 2;
393 unsigned has_ewmh_init_maxvert_state : 2;
394 unsigned has_ewmh_init_modal_state : 2;
395 unsigned has_ewmh_init_shaded_state : 2;
396 unsigned has_ewmh_init_skip_pager_state : 2;
397 unsigned has_ewmh_init_skip_taskbar_state : 2;
398 unsigned has_ewmh_init_sticky_state : 2;
399 unsigned has_ewmh_init_wm_desktop : 2;
400 } window_flags;
403 /* Actions allowed by modules. */
404 typedef struct action_flags
406 unsigned is_movable : 1;
407 unsigned is_deletable : 1;
408 unsigned is_destroyable : 1;
409 unsigned is_closable : 1;
410 unsigned is_maximizable : 1;
411 unsigned is_resizable : 1;
412 unsigned is_iconifiable : 1;
413 } action_flags;
416 /* Window name data structure for window conditions: a list of lists
417 of names to match, the boolean operation on the matches being an
418 AND of ORs. */
419 struct namelist /* matches to names in this list are ORed */
421 char *name;
422 struct namelist *next;
425 struct name_condition /* matches to namelists in this list are
426 ANDed, after possibly inverting each */
428 Bool invert;
429 struct namelist *namelist;
430 struct name_condition *next;
433 /* Window mask for Circulate and Direction functions */
434 typedef struct WindowConditionMask
436 struct
438 unsigned do_accept_focus : 1;
439 unsigned do_check_desk : 1;
440 unsigned do_check_desk_and_global_page : 1;
441 unsigned do_check_desk_and_page : 1;
442 unsigned do_check_global_page : 1;
443 unsigned do_check_overlapped : 1;
444 unsigned do_check_page : 1;
445 unsigned do_not_check_screen : 1;
446 unsigned needs_current_desk : 1;
447 unsigned needs_current_desk_and_global_page : 1;
448 unsigned needs_current_desk_and_page : 1;
449 unsigned needs_current_global_page : 1;
450 unsigned needs_current_page : 1;
451 #define NEEDS_ANY 0
452 #define NEEDS_TRUE 1
453 #define NEEDS_FALSE 2
454 unsigned needs_focus : 2;
455 unsigned needs_overlapped : 2;
456 unsigned needs_pointer : 2;
457 unsigned needs_same_layer : 1;
458 unsigned use_circulate_hit : 1;
459 unsigned use_circulate_hit_icon : 1;
460 unsigned use_circulate_hit_shaded : 1;
461 unsigned use_do_accept_focus : 1;
462 } my_flags;
463 window_flags flags;
464 window_flags flag_mask;
465 struct name_condition *name_condition;
466 int layer;
467 int placed_by_button_mask;
468 int placed_by_button_set_mask;
469 } WindowConditionMask;
471 typedef struct pl_penalty_struct
473 float normal;
474 float ontop;
475 float icon;
476 float sticky;
477 float below;
478 float strut;
479 } pl_penalty_struct;
481 typedef struct pl_percent_penalty_struct
483 int p99;
484 int p95;
485 int p85;
486 int p75;
487 } pl_percent_penalty_struct;
489 /* only style.c and add_window.c are allowed to access this struct! */
490 typedef struct style_flags
492 common_flags_t common;
493 unsigned do_decorate_transient : 1;
494 /* old placement flags */
495 #define PLACE_DUMB 0x0
496 #define PLACE_SMART 0x1
497 #define PLACE_CLEVER 0x2
498 #define PLACE_CLEVERNESS_MASK 0x3
499 #define PLACE_RANDOM 0x4
500 /* new placements value, try to get a minimal backward compatibility
501 * with the old flags:
502 * Dumb+Active = Manual,
503 * Dumb+Random = Cascade,
504 * Smart+Random = TileCascade,
505 * Smart+Active = TileManual,
506 * Random+Smart+Clever = MINOVERLAP which is the original Clever
507 * placement code,
508 * Active+Smart+Clever = MINOVERLAPPERCENT which is the "new" Clever
509 * placement code and was the original Clever placement code. Now the
510 * original placement code said:
511 * Active/Random+Dumb+Clever = Active/Random+Dumb (with Dumb Clever is
512 * ignored); These represent the not use value: 0x2=Active+Dumb+Clever,
513 * 0x6=Random+Dumb+Clever */
514 #define PLACE_MANUAL 0x0
515 #define PLACE_TILEMANUAL 0x1
516 #define PLACE_MANUAL_B 0x2
517 #define PLACE_MINOVERLAPPERCENT 0x3
518 #define PLACE_CASCADE 0x4
519 #define PLACE_TILECASCADE 0x5
520 #define PLACE_CASCADE_B 0x6
521 #define PLACE_MINOVERLAP 0x7
522 #define PLACE_POSITION 0x8
523 #define PLACE_MASK 0xF
524 unsigned placement_mode : 4;
525 unsigned ewmh_placement_mode : 2; /* see ewmh.h */
526 #define WS_CR_MOTION_METHOD_AUTO CR_MOTION_METHOD_AUTO
527 #define WS_CR_MOTION_METHOD_USE_GRAV CR_MOTION_METHOD_USE_GRAV
528 #define WS_CR_MOTION_METHOD_STATIC_GRAV CR_MOTION_METHOD_STATIC_GRAV
529 #define WS_CR_MOTION_METHOD_MASK CR_MOTION_METHOD_MASK
530 unsigned ws_cr_motion_method : 2;
531 unsigned do_save_under : 1;
532 unsigned do_start_iconic : 1;
533 unsigned do_start_lowered : 1;
534 unsigned do_start_shaded : 1;
535 unsigned start_shaded_dir : 3;
536 unsigned has_border_width : 1;
537 unsigned has_color_back : 1;
538 unsigned has_color_fore : 1;
539 unsigned has_color_back_hi : 1;
540 unsigned has_color_fore_hi : 1;
541 unsigned has_decor : 1;
542 unsigned has_edge_delay_ms_move : 1;
543 unsigned has_edge_delay_ms_resize : 1;
544 unsigned has_edge_resistance_move : 1;
545 unsigned has_edge_resistance_xinerama_move : 1;
546 unsigned has_handle_width : 1;
547 unsigned has_icon : 1;
548 unsigned has_icon_boxes : 1;
549 unsigned has_icon_size_limits : 1;
550 unsigned has_min_window_size : 1;
551 unsigned has_max_window_size : 1;
552 unsigned has_icon_background_padding : 1;
553 unsigned has_icon_background_relief : 1;
554 unsigned has_icon_title_relief : 1;
555 unsigned has_window_shade_steps : 1;
556 unsigned has_mini_icon : 1;
557 unsigned has_mwm_decor : 1;
558 unsigned has_mwm_functions : 1;
559 unsigned has_no_handles : 1;
560 unsigned has_no_title : 1;
561 unsigned has_ol_decor : 1;
562 unsigned has_snap_grid : 1;
563 unsigned has_snap_attraction : 1;
564 #if 0
565 unsigned has_condition_mask : 1;
566 #endif
567 unsigned is_button_disabled : NUMBER_OF_TITLE_BUTTONS;
568 unsigned is_unmanaged : 1;
569 #define BACKINGSTORE_DEFAULT 0
570 #define BACKINGSTORE_ON 1
571 #define BACKINGSTORE_OFF 2
572 #define BACKINGSTORE_MASK 0x3
573 unsigned use_backing_store : 2;
574 unsigned use_parent_relative : 1;
575 unsigned use_colorset : 1;
576 unsigned use_colorset_hi : 1;
577 unsigned use_border_colorset : 1;
578 unsigned use_border_colorset_hi : 1;
579 unsigned use_icon_title_colorset : 1;
580 unsigned use_icon_title_colorset_hi : 1;
581 unsigned use_icon_background_colorset : 1;
582 unsigned use_layer : 1;
583 unsigned use_no_pposition : 1;
584 unsigned use_no_usposition : 1;
585 unsigned use_no_transient_pposition : 1;
586 unsigned use_no_transient_usposition : 1;
587 unsigned use_start_on_desk : 1;
588 unsigned use_start_on_page_for_transient : 1;
589 unsigned use_start_on_screen : 1;
590 unsigned manual_placement_honors_starts_on_page : 1;
591 unsigned um_placement_honors_starts_on_page : 1;
592 unsigned capture_honors_starts_on_page : 1;
593 unsigned recapture_honors_starts_on_page : 1;
594 unsigned has_placement_penalty : 1;
595 unsigned has_placement_percentage_penalty : 1;
596 unsigned has_placement_position_string : 1;
597 unsigned has_initial_map_command_string : 1;
598 } style_flags;
600 typedef struct style_id_t
602 char *name;
603 XID window_id;
604 struct
606 unsigned has_name:1;
607 unsigned has_window_id:1;
608 } flags;
609 } style_id_t;
612 /* only style.c and add_window.c are allowed to access this struct! */
613 typedef struct window_style
615 struct window_style *next;
616 struct window_style *prev;
617 style_id_t id;
618 #if 0
619 WindowConditionMask *condition_mask;
620 #endif
621 char *icon_name;
622 char *mini_icon_name;
623 #ifdef USEDECOR
624 char *decor_name;
625 #endif
626 unsigned char min_icon_width;
627 unsigned char max_icon_width;
628 unsigned char min_icon_height;
629 unsigned char max_icon_height;
630 #define ICON_RESIZE_TYPE_NONE 0x0
631 #define ICON_RESIZE_TYPE_STRETCHED 0x1
632 #define ICON_RESIZE_TYPE_ADJUSTED 0x2
633 #define ICON_RESIZE_TYPE_SHRUNK 0x3
634 #define ICON_RESIZE_TYPE_MASK 0x3
635 unsigned icon_resize_type : 2;
636 unsigned char icon_background_padding;
637 signed char icon_background_relief;
638 signed char icon_title_relief;
639 char *icon_font;
640 char *window_font;
641 char *fore_color_name;
642 char *back_color_name;
643 char *fore_color_name_hi;
644 char *back_color_name_hi;
645 int colorset;
646 int colorset_hi;
647 int border_colorset;
648 int border_colorset_hi;
649 int icon_title_colorset;
650 int icon_title_colorset_hi;
651 int icon_background_colorset;
652 short border_width;
653 /* resize handle width */
654 short handle_width;
655 int layer;
656 int start_desk;
657 int start_page_x;
658 int start_page_y;
659 int start_screen;
660 int min_window_width;
661 int min_window_height;
662 int max_window_width;
663 int max_window_height;
664 int shade_anim_steps;
665 #if 1 /*!!!*/
666 /* attractiveness of window edges */
667 int snap_proximity;
668 /* mode of snap attraction */
669 int snap_mode;
670 /* snap grid size */
671 int snap_grid_x;
672 int snap_grid_y;
673 int edge_delay_ms_move;
674 int edge_delay_ms_resize;
675 int edge_resistance_move;
676 int edge_resistance_xinerama_move;
677 #endif
678 icon_boxes *icon_boxes;
679 float norm_placement_penalty;
680 pl_penalty_struct pl_penalty;
681 pl_percent_penalty_struct pl_percent_penalty;
682 char *pl_position_string;
683 char *initial_map_command_string;
684 style_flags flags;
685 style_flags flag_default;
686 style_flags flag_mask;
687 style_flags change_mask;
688 unsigned has_style_changed : 1;
689 } window_style;
691 typedef struct window_g
693 rectangle frame;
694 /* absolute geometry when not maximized */
695 rectangle normal;
696 /* maximized window geometry */
697 rectangle max;
698 /* defect between maximized geometry before and after
699 * constraining size. */
700 size_rect max_defect;
701 /* original delta between normalized and maximized window,
702 * used to keep unmaximized window at same screen position */
703 position max_offset;
704 } window_g;
706 /* for each window that is on the display, one of these structures
707 * is allocated and linked into a list
709 typedef struct FvwmWindow
711 /* name of the window */
712 FlocaleNameString name;
713 /* name of the icon */
714 FlocaleNameString icon_name;
715 char *visible_name;
716 char *visible_icon_name;
717 /* if non-null: Use this instead of any other names for matching
718 styles */
719 char *style_name;
720 int name_count;
721 int icon_name_count;
722 /* next fvwm window */
723 struct FvwmWindow *next;
724 /* prev fvwm window */
725 struct FvwmWindow *prev;
726 /* next (lower) fvwm window in stacking order*/
727 struct FvwmWindow *stack_next;
728 /* prev (higher) fvwm window in stacking order */
729 struct FvwmWindow *stack_prev;
730 /* border width before reparenting */
731 struct
733 /* the frame window */
734 Window frame;
735 /* It looks like you HAVE to reparent the app window into a
736 * window whose size = app window, or else you can't keep xv
737 * and matlab happy at the same time! */
738 Window parent;
739 /* the child window */
740 Window client;
741 /* the title bar window and button windows */
742 Window title;
743 Window button_w[NUMBER_OF_TITLE_BUTTONS];
744 /* sides of the border */
745 Window sides[4];
746 /* corner pieces */
747 Window corners[4];
748 /* icon title window */
749 Window icon_title_w;
750 /* icon picture window */
751 Window icon_pixmap_w;
752 Window transientfor;
753 } wins;
754 window_flags flags;
755 struct
757 unsigned buttons_drawn : NUMBER_OF_TITLE_BUTTONS;
758 unsigned buttons_lit : NUMBER_OF_TITLE_BUTTONS;
759 unsigned buttons_inverted : NUMBER_OF_TITLE_BUTTONS;
760 unsigned buttons_toggled : NUMBER_OF_TITLE_BUTTONS;
761 unsigned parts_drawn : 12;
762 unsigned parts_lit : 12;
763 unsigned parts_inverted : 12;
764 } decor_state;
765 int nr_left_buttons;
766 int nr_right_buttons;
767 #define BUTTON_INDEX(b) \
768 (((b) == 0) ? (NUMBER_OF_TITLE_BUTTONS - 1) : ((b) - 1))
769 #ifdef USEDECOR
770 struct FvwmDecor *decor;
771 #endif
772 /* is this a shaped window */
773 int wShaped;
774 Pixmap title_background_pixmap;
776 /* Note: if the type of this variable is changed, do update the
777 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h too! */
778 short boundary_width;
779 short unshaped_boundary_width;
780 short corner_width;
781 short visual_corner_width;
783 /* title font */
784 FlocaleFont *title_font;
785 /* /Y coordinate to draw the title name */
786 short title_text_offset;
787 short title_length;
788 /* Note: if the type of this variable is changed, do update the
789 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too!
791 short title_thickness;
792 rotation_t title_text_rotation;
793 struct
795 /* geometry of the icon picture window */
796 rectangle picture_w_g;
797 /* geometry of the icon title window */
798 rectangle title_w_g;
799 /* width of the text in the icon title */
800 int title_text_width;
801 } icon_g;
802 short icon_border_width;
804 /* Drawable depth for the icon */
805 int iconDepth;
806 /* pixmap for the icon */
807 Pixmap iconPixmap;
808 /* pixmap for the icon mask */
809 Pixmap icon_maskPixmap;
810 Pixmap icon_alphaPixmap;
811 int icon_nalloc_pixels;
812 Pixel *icon_alloc_pixels;
813 int icon_no_limit;
814 FlocaleFont *icon_font;
816 /* some parts of the window attributes */
817 struct
819 int backing_store;
820 int border_width;
821 int depth;
822 int bit_gravity;
823 unsigned is_bit_gravity_stored : 1;
824 Visual *visual;
825 Colormap colormap;
826 } attr_backup;
827 /* normal hints */
828 XSizeHints hints;
829 struct
831 int width_inc;
832 int height_inc;
833 } orig_hints;
834 /* WM hints */
835 XWMHints *wmhints;
836 XClassHint class;
837 /* Tells which desktop this window is on */
838 /* Note: if the type of this variable is changed, do update the
839 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too!
841 int Desk;
842 /* Where (if at all) was it focused */
843 int FocusDesk;
844 /* Desk to deiconify to, for StubbornIcons */
845 int DeIconifyDesk;
847 char *mini_pixmap_file;
848 FvwmPicture *mini_icon;
849 char *icon_bitmap_file;
851 struct window_g g;
852 long *mwm_hints;
853 int ol_hints;
854 int functions;
855 /* Colormap windows property */
856 Window *cmap_windows;
857 /* Should generally be 0 */
858 int number_cmap_windows;
859 color_quad colors;
860 color_quad hicolors;
861 color_quad border_colors;
862 color_quad border_hicolors;
864 int cs;
865 int cs_hi;
866 int border_cs;
867 int border_cs_hi;
868 int icon_title_cs;
869 int icon_title_cs_hi;
870 int icon_background_cs;
872 unsigned long buttons;
873 /* zero or more iconboxes */
874 icon_boxes *IconBoxes;
876 int default_layer;
877 /* Note: if the type of this variable is changed, do update the
878 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too!
880 int layer;
882 unsigned char min_icon_width;
883 unsigned char max_icon_width;
884 unsigned char min_icon_height;
885 unsigned char max_icon_height;
886 unsigned short icon_resize_type;
888 unsigned char icon_background_padding;
889 char icon_background_relief;
890 char icon_title_relief;
892 int min_window_width;
893 int min_window_height;
894 int max_window_width;
895 int max_window_height;
896 int shade_anim_steps;
897 unsigned char grabbed_buttons;
898 #if 1 /*!!!*/
899 /* attractiveness of window edges */
900 int snap_proximity;
901 /* mode of snap attraction */
902 int snap_mode;
903 /* snap grid size */
904 int snap_grid_x;
905 int snap_grid_y;
906 int edge_delay_ms_move;
907 int edge_delay_ms_resize;
908 int edge_resistance_move;
909 int edge_resistance_xinerama_move;
910 #endif
912 #define FM_NO_INPUT 0
913 #define FM_PASSIVE 1
914 #define FM_LOCALLY_ACTIVE 2
915 #define FM_GLOBALLY_ACTIVE 3
916 unsigned char focus_model;
918 pl_penalty_struct pl_penalty;
919 pl_percent_penalty_struct pl_percent_penalty;
921 unsigned char placed_by_button;
923 #define EWMH_WINDOW_TYPE_NONE_ID 0
924 #define EWMH_WINDOW_TYPE_DESKTOP_ID 1
925 #define EWMH_WINDOW_TYPE_DIALOG_ID 2
926 #define EWMH_WINDOW_TYPE_DOCK_ID 3
927 #define EWMH_WINDOW_TYPE_MENU_ID 4
928 #define EWMH_WINDOW_TYPE_NORMAL_ID 5
929 #define EWMH_WINDOW_TYPE_TOOLBAR_ID 6
930 /* Note: if the type of this variable is changed, do update the
931 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too!
933 int ewmh_window_type;
934 /* icon geometry */
935 rectangle ewmh_icon_geometry;
936 /* for computing the working area */
937 ewmh_strut strut;
938 /* for the dynamic working area */
939 ewmh_strut dyn_strut;
940 /* memories for the icons we set on the */
941 int ewmh_icon_height;
942 /* _NET_WM_ICON */
943 int ewmh_icon_width;
944 int ewmh_mini_icon_height;
945 int ewmh_mini_icon_width;
946 /* memory for the initial _NET_WM_STATE */
947 /* Note: if the type of this variable is changed, do update the
948 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too!
950 int ewmh_hint_layer;
951 int ewmh_normal_layer; /* for restoring non ewmh layer */
952 /* memory for the initial _NET_WM_STATE */
953 unsigned long ewmh_hint_desktop;
955 /* multi purpose scratch structure */
956 struct
958 void *p;
959 int i;
960 } scratch;
961 } FvwmWindow;
963 /* ---------------------------- exported variables (globals) --------------- */
965 /* ---------------------------- interface functions ------------------------ */
967 void SetMWM_INFO(Window window);
968 void fvmm_deinstall_signals(void);
970 #endif /* FVWM_H */