Propagate Layer changes via Style command on-the-fly.
[fvwm.git] / fvwm / fvwm.h
blobddeb8c90da4123f957f57c8efda43f39f4327c7e
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;
611 typedef struct snap_attraction_t
613 /* attractiveness of window edges */
614 int proximity;
615 /* mode of snap attraction */
616 int mode;
617 /* mode flags to do bit manipulation */
618 enum
620 SNAP_NONE = 0x00,
621 SNAP_WINDOWS = 0x01,
622 SNAP_ICONS = 0x02,
623 SNAP_SAME = 0x04,
624 SNAP_SCREEN = 0x08,
625 SNAP_SCREEN_WINDOWS = 0x10,
626 SNAP_SCREEN_ICONS = 0x20,
627 SNAP_SCREEN_ALL = 0x40,
628 } types;
629 } snap_attraction_t;
631 /* only style.c and add_window.c are allowed to access this struct! */
632 typedef struct window_style
634 struct window_style *next;
635 struct window_style *prev;
636 style_id_t id;
637 #if 0
638 WindowConditionMask *condition_mask;
639 #endif
640 char *icon_name;
641 char *mini_icon_name;
642 #ifdef USEDECOR
643 char *decor_name;
644 #endif
645 unsigned char min_icon_width;
646 unsigned char max_icon_width;
647 unsigned char min_icon_height;
648 unsigned char max_icon_height;
649 #define ICON_RESIZE_TYPE_NONE 0x0
650 #define ICON_RESIZE_TYPE_STRETCHED 0x1
651 #define ICON_RESIZE_TYPE_ADJUSTED 0x2
652 #define ICON_RESIZE_TYPE_SHRUNK 0x3
653 #define ICON_RESIZE_TYPE_MASK 0x3
654 unsigned icon_resize_type : 2;
655 unsigned char icon_background_padding;
656 signed char icon_background_relief;
657 signed char icon_title_relief;
658 char *icon_font;
659 char *window_font;
660 char *fore_color_name;
661 char *back_color_name;
662 char *fore_color_name_hi;
663 char *back_color_name_hi;
664 int colorset;
665 int colorset_hi;
666 int border_colorset;
667 int border_colorset_hi;
668 int icon_title_colorset;
669 int icon_title_colorset_hi;
670 int icon_background_colorset;
671 short border_width;
672 /* resize handle width */
673 short handle_width;
674 int layer;
675 int start_desk;
676 int start_page_x;
677 int start_page_y;
678 int start_screen;
679 int min_window_width;
680 int min_window_height;
681 int max_window_width;
682 int max_window_height;
683 int shade_anim_steps;
684 #if 1 /*!!!*/
685 snap_attraction_t snap_attraction;
686 /* snap grid size */
687 int snap_grid_x;
688 int snap_grid_y;
689 int edge_delay_ms_move;
690 int edge_delay_ms_resize;
691 int edge_resistance_move;
692 int edge_resistance_xinerama_move;
693 #endif
694 icon_boxes *icon_boxes;
695 float norm_placement_penalty;
696 pl_penalty_struct pl_penalty;
697 pl_percent_penalty_struct pl_percent_penalty;
698 char *pl_position_string;
699 char *initial_map_command_string;
700 style_flags flags;
701 style_flags flag_default;
702 style_flags flag_mask;
703 style_flags change_mask;
704 unsigned has_style_changed : 1;
705 } window_style;
707 typedef struct window_g
709 rectangle frame;
710 /* absolute geometry when not maximized */
711 rectangle normal;
712 /* maximized window geometry */
713 rectangle max;
714 /* defect between maximized geometry before and after
715 * constraining size. */
716 size_rect max_defect;
717 /* original delta between normalized and maximized window,
718 * used to keep unmaximized window at same screen position */
719 position max_offset;
720 } window_g;
722 /* for each window that is on the display, one of these structures
723 * is allocated and linked into a list
725 typedef struct FvwmWindow
727 /* name of the window */
728 FlocaleNameString name;
729 /* name of the icon */
730 FlocaleNameString icon_name;
731 char *visible_name;
732 char *visible_icon_name;
733 /* if non-null: Use this instead of any other names for matching
734 styles */
735 char *style_name;
736 int name_count;
737 int icon_name_count;
738 /* next fvwm window */
739 struct FvwmWindow *next;
740 /* prev fvwm window */
741 struct FvwmWindow *prev;
742 /* next (lower) fvwm window in stacking order*/
743 struct FvwmWindow *stack_next;
744 /* prev (higher) fvwm window in stacking order */
745 struct FvwmWindow *stack_prev;
746 /* border width before reparenting */
747 struct
749 /* the frame window */
750 Window frame;
751 /* It looks like you HAVE to reparent the app window into a
752 * window whose size = app window, or else you can't keep xv
753 * and matlab happy at the same time! */
754 Window parent;
755 /* the child window */
756 Window client;
757 /* the title bar window and button windows */
758 Window title;
759 Window button_w[NUMBER_OF_TITLE_BUTTONS];
760 /* sides of the border */
761 Window sides[4];
762 /* corner pieces */
763 Window corners[4];
764 /* icon title window */
765 Window icon_title_w;
766 /* icon picture window */
767 Window icon_pixmap_w;
768 Window transientfor;
769 } wins;
770 window_flags flags;
771 struct
773 unsigned buttons_drawn : NUMBER_OF_TITLE_BUTTONS;
774 unsigned buttons_lit : NUMBER_OF_TITLE_BUTTONS;
775 unsigned buttons_inverted : NUMBER_OF_TITLE_BUTTONS;
776 unsigned buttons_toggled : NUMBER_OF_TITLE_BUTTONS;
777 unsigned parts_drawn : 12;
778 unsigned parts_lit : 12;
779 unsigned parts_inverted : 12;
780 } decor_state;
781 int nr_left_buttons;
782 int nr_right_buttons;
783 #define BUTTON_INDEX(b) \
784 (((b) == 0) ? (NUMBER_OF_TITLE_BUTTONS - 1) : ((b) - 1))
785 #ifdef USEDECOR
786 struct FvwmDecor *decor;
787 #endif
788 /* is this a shaped window */
789 int wShaped;
790 Pixmap title_background_pixmap;
792 /* Note: if the type of this variable is changed, do update the
793 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h too! */
794 short boundary_width;
795 short unshaped_boundary_width;
796 short corner_width;
797 short visual_corner_width;
799 /* title font */
800 FlocaleFont *title_font;
801 /* /Y coordinate to draw the title name */
802 short title_text_offset;
803 short title_length;
804 /* Note: if the type of this variable is changed, do update the
805 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too!
807 short title_thickness;
808 rotation_t title_text_rotation;
809 struct
811 /* geometry of the icon picture window */
812 rectangle picture_w_g;
813 /* geometry of the icon title window */
814 rectangle title_w_g;
815 /* width of the text in the icon title */
816 int title_text_width;
817 } icon_g;
818 short icon_border_width;
820 /* Drawable depth for the icon */
821 int iconDepth;
822 /* pixmap for the icon */
823 Pixmap iconPixmap;
824 /* pixmap for the icon mask */
825 Pixmap icon_maskPixmap;
826 Pixmap icon_alphaPixmap;
827 int icon_nalloc_pixels;
828 Pixel *icon_alloc_pixels;
829 int icon_no_limit;
830 FlocaleFont *icon_font;
832 /* some parts of the window attributes */
833 struct
835 int backing_store;
836 int border_width;
837 int depth;
838 int bit_gravity;
839 unsigned is_bit_gravity_stored : 1;
840 Visual *visual;
841 Colormap colormap;
842 } attr_backup;
843 /* normal hints */
844 XSizeHints hints;
845 struct
847 int width_inc;
848 int height_inc;
849 } orig_hints;
850 /* WM hints */
851 XWMHints *wmhints;
852 XClassHint class;
853 /* Tells which desktop this window is on */
854 /* Note: if the type of this variable is changed, do update the
855 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too!
857 int Desk;
858 /* Where (if at all) was it focused */
859 int FocusDesk;
860 /* Desk to deiconify to, for StubbornIcons */
861 int DeIconifyDesk;
863 char *mini_pixmap_file;
864 FvwmPicture *mini_icon;
865 char *icon_bitmap_file;
867 struct window_g g;
868 long *mwm_hints;
869 int ol_hints;
870 int functions;
871 /* Colormap windows property */
872 Window *cmap_windows;
873 /* Should generally be 0 */
874 int number_cmap_windows;
875 color_quad colors;
876 color_quad hicolors;
877 color_quad border_colors;
878 color_quad border_hicolors;
880 int cs;
881 int cs_hi;
882 int border_cs;
883 int border_cs_hi;
884 int icon_title_cs;
885 int icon_title_cs_hi;
886 int icon_background_cs;
888 unsigned long buttons;
889 /* zero or more iconboxes */
890 icon_boxes *IconBoxes;
892 int default_layer;
893 /* Note: if the type of this variable is changed, do update the
894 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too!
896 int layer;
898 unsigned char min_icon_width;
899 unsigned char max_icon_width;
900 unsigned char min_icon_height;
901 unsigned char max_icon_height;
902 unsigned short icon_resize_type;
904 unsigned char icon_background_padding;
905 char icon_background_relief;
906 char icon_title_relief;
908 int min_window_width;
909 int min_window_height;
910 int max_window_width;
911 int max_window_height;
912 int shade_anim_steps;
913 unsigned char grabbed_buttons;
914 #if 1 /*!!!*/
915 snap_attraction_t snap_attraction;
916 /* snap grid size */
917 int snap_grid_x;
918 int snap_grid_y;
919 int edge_delay_ms_move;
920 int edge_delay_ms_resize;
921 int edge_resistance_move;
922 int edge_resistance_xinerama_move;
923 #endif
925 #define FM_NO_INPUT 0
926 #define FM_PASSIVE 1
927 #define FM_LOCALLY_ACTIVE 2
928 #define FM_GLOBALLY_ACTIVE 3
929 unsigned char focus_model;
931 pl_penalty_struct pl_penalty;
932 pl_percent_penalty_struct pl_percent_penalty;
934 unsigned char placed_by_button;
936 #define EWMH_WINDOW_TYPE_NONE_ID 0
937 #define EWMH_WINDOW_TYPE_DESKTOP_ID 1
938 #define EWMH_WINDOW_TYPE_DIALOG_ID 2
939 #define EWMH_WINDOW_TYPE_DOCK_ID 3
940 #define EWMH_WINDOW_TYPE_MENU_ID 4
941 #define EWMH_WINDOW_TYPE_NORMAL_ID 5
942 #define EWMH_WINDOW_TYPE_TOOLBAR_ID 6
943 /* Note: if the type of this variable is changed, do update the
944 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too!
946 int ewmh_window_type;
947 /* icon geometry */
948 rectangle ewmh_icon_geometry;
949 /* for computing the working area */
950 ewmh_strut strut;
951 /* for the dynamic working area */
952 ewmh_strut dyn_strut;
953 /* memories for the icons we set on the */
954 int ewmh_icon_height;
955 /* _NET_WM_ICON */
956 int ewmh_icon_width;
957 int ewmh_mini_icon_height;
958 int ewmh_mini_icon_width;
959 /* memory for the initial _NET_WM_STATE */
960 /* Note: if the type of this variable is changed, do update the
961 * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too!
963 int ewmh_hint_layer;
964 int ewmh_normal_layer; /* for restoring non ewmh layer */
965 /* memory for the initial _NET_WM_STATE */
966 unsigned long ewmh_hint_desktop;
968 /* multi purpose scratch structure */
969 struct
971 void *p;
972 int i;
973 } scratch;
974 } FvwmWindow;
976 /* ---------------------------- exported variables (globals) --------------- */
978 /* ---------------------------- interface functions ------------------------ */
980 void SetMWM_INFO(Window window);
981 void fvmm_deinstall_signals(void);
983 #endif /* FVWM_H */