1 /*
2  * twm per-screen data include file
3  *
4  *
5  * Copyright 1989 Massachusetts Institute of Technology
6  *
7  * $XConsortium: screen.h,v 1.62 91/05/01 17:33:09 keith Exp $
8  *
9  * 11-3-88 Dave Payne, Apple Computer                   File created
10  *
11  * Copyright 1992 Claude Lecommandeur.
12  */
13 
14 #ifndef _CTWM_SCREEN_H
15 #define _CTWM_SCREEN_H
16 
17 /* Needed for doxygen to get at the #define's for config (like EMWH) */
18 #ifdef DOXYGEN
19 # include "ctwm_config.h"
20 #endif
21 
22 #include "menus.h"  // embedded MouseButton/Func{Button,Key}
23 #include "workspace_structs.h"  // embedded ScreenInfo.workSpaceMgr
24 
25 
26 /**
27  * Type for iconification styles.  Options correspond to the values in
28  * IconifyStyle config var.  \sa ScreenInfo.IconifyStyle   \todo Maybe
29  * should just be moved inline in ScreenInfo struct, since it's never
30  * directly used elsewhere.
31  */
32 typedef enum {
33 	ICONIFY_NORMAL,
34 	ICONIFY_MOSAIC,
35 	ICONIFY_ZOOMIN,
36 	ICONIFY_ZOOMOUT,
37 	ICONIFY_FADE,
38 	ICONIFY_SWEEP,
39 } IcStyle;
40 
41 
42 /**
43  * Information about some XStandardColormap we're using.  See Xlib docs
44  * for details.
45  */
46 struct StdCmap {
47 	struct StdCmap *next;               /* next link in chain */
48 	Atom atom;                          /* property from which this came */
49 	int nmaps;                          /* number of maps below */
50 	XStandardColormap *maps;            /* the actual maps */
51 };
52 
53 
54 /**
55  * Internal padding in the size window.  \sa ScreenInfo.SizeWindow
56  * \todo Possibly these should be in another header...
57  */
58 #define SIZE_HINDENT 10
59 #define SIZE_VINDENT 2  ///< \copydoc #SIZE_HINDENT
60 
61 
62 /**
63  * Stash for memoizing various pixmaps used in titlebars.
64  * \sa the TBPM_* constants in image.h
65  * \todo This probably doesn't need to live on its own, since it only
66  * exists to define a member in the ScreenInfo struct.  Maybe it should
67  * just be moved to being defined nested in there...
68  */
69 struct TitlebarPixmaps {
70 	Pixmap xlogo;    ///< #TBPM_XLOGO
71 	Pixmap resize;   ///< #TBPM_RESIZE
72 	Pixmap question; ///< #TBPM_QUESTION
73 	Pixmap menu;     ///< #TBPM_MENU
74 	Pixmap delete;   ///< #TBPM_DOT
75 };
76 
77 
78 /**
79  * Info and control for each X Screen we control.
80  *
81  * We start up on an X Display (e.g., ":0"), and by default try to take
82  * over each X Screen on that display (e.g, ":0.0", ":0.1", ...).  Each
83  * of those Screens will have its own ScreenInfo.
84  *
85  * This contains pure physical or X info (size, coordinates, color
86  * depth), ctwm info (lists of windows on it, window rings, how it fits
87  * with other Screens we control), most of the config file settings which
88  * may differ from Screen to Screen, menus, special windows (Occupy,
89  * Identify, etc), and piles of other stuff.
90  *
91  * \note
92  * Possibly this should be broken up somewhat.  e.g., much of the
93  * config-related bits pulled out into their own structure, which could
94  * allow decoupling the config parsing from the X screens a bit.
95  */
96 struct ScreenInfo {
97 	int screen;       ///< Which screen (i.e., the x after the dot in ":0.x")
98 
99 	/// Whether we're taking over this screen.  Usually true, unless
100 	/// running captive or \--cfgchk
101 	bool takeover;
102 
103 	int d_depth;      ///< Copy of DefaultDepth(dpy, screen)
104 	Visual *d_visual; ///< Copy of DefaultVisual(dpy, screen)
105 	int Monochrome;   ///< Is the display monochrome?
106 
107 	/**
108 	 * The x coordinate of the root window relative to RealRoot.  This is
109 	 * usually 0, except in the case of captive mode where it shows where
110 	 * we are on the real screen, or when we have VirtualScreens and are
111 	 * positioning our real Screens on a virtual RealRoot.
112 	 */
113 	int rootx;
114 	/// The y coordinate of the root window relative to RealRoot.
115 	/// \copydetails rootx
116 	int rooty;
117 
118 	int rootw; ///< Copy of DisplayWidth(dpy, screen)
119 	int rooth; ///< Copy of DisplayHeight(dpy, screen)
120 
121 	/**
122 	 * \defgroup scr_captive_bits Captive ctwm bits
123 	 * These are various fields related to running a captive ctwm (i.e.,
124 	 * with \--window).  They'll generally be empty for non-captive
125 	 * invocations, or describe our position inside the "outside" world
126 	 * if we are.
127 	 * @{
128 	 */
129 	/// The name of the captive root window if any.  Autogen'd or set
130 	/// with \--name
131 	char *captivename;
132 	/// The x coordinate of the captive root window if any.
133 	int crootx;
134 	/// The y coordinate of the captive root window if any.
135 	int crooty;
136 	/// Initially copy of DisplayWidth(dpy, screen).  See also
137 	/// ConfigureCaptiveRootWindow()
138 	int crootw;
139 	/// Initially copy of DisplayHeight(dpy, screen).
140 	/// \copydetails crootw
141 	int crooth;
142 	/// @}
143 
144 	int MaxWindowWidth;   ///< Largest window width to allow
145 	int MaxWindowHeight;  ///< Largest window height to allow
146 
147 	/// The head of the screen's twm window list.  This is used for
148 	/// places where we need to iterate over the TwmWindow's in a single
149 	/// Screen, by following the TwmWindow.next pointers.
150 	TwmWindow *FirstWindow;
151 
152 	Colormaps RootColormaps;  ///< The colormaps of the root window
153 
154 
155 	/**
156 	 * \defgroup scr_roots Various root and pseudo-root Windows.
157 	 * These are the various forms of root and almost-root windows that
158 	 * things on this Screen reside in.  It's probable that there's a lot
159 	 * of confusion of these, and they get set, reset, and used
160 	 * incorrectly in a lot of places.  We mostly get away with it
161 	 * because in normal usage, they're often all identical.
162 	 *
163 	 * \verbatim
164 	 *
165 	 *  +--RealRoot-----------------------------------------------------------+
166 	 *  | the root of the display (most uses of this are probably incorrect!) |
167 	 *  |                                                                     |
168 	 *  |   +--CaptiveRoot--------------------------------------------------+ |
169 	 *  |   | when captive window is used (most uses are likely incorrect!) | |
170 	 *  |   |                                                               | |
171 	 *  |   | +--XineramaRoot---------------------------------------------+ | |
172 	 *  |   | | the root that encompasses all virtual screens             | | |
173 	 *  |   | |                                                           | | |
174 	 *  |   | | +--Root-----------+ +--Root--------+ +--Root------------+ | | |
175 	 *  |   | | | one or more     | | Most cases   | |                  | | | |
176 	 *  |   | | | virtual screens | | use Root.    | |                  | | | |
177 	 *  |   | | |                 | |              | |                  | | | |
178 	 *  |   | | |                 | |              | |                  | | | |
179 	 *  |   | | +-----------------+ +--------------+ +------------------+ | | |
180 	 *  |   | +-----------------------------------------------------------+ | |
181 	 *  |   +---------------------------------------------------------------+ |
182 	 *  +---------------------------------------------------------------------+
183 	 * \endverbatim
184 	 *
185 	 * @{
186 	 */
187 
188 	/**
189 	 * Root window for the current vscreen.  Initially either the real X
190 	 * RootWindow(), or the existing or created Window for a captive
191 	 * ctwm.  Gets reset to a vscreen's window in InitVirtualScreens().
192 	 */
193 	Window Root;
194 
195 	/**
196 	 * Root window holding our vscreens.  Initialized to the same value
197 	 * as ScreenInfo.Root, and isn't changed afterward.
198 	 */
199 	Window XineramaRoot;
200 	/// The captive root window, if any, or None
201 	Window CaptiveRoot;
202 	/// The actual X root window of the display.  This is always X's
203 	/// RootWindow().
204 	Window RealRoot;
205 	/// @}
206 
207 
208 	/**
209 	 * Dimensions/coordinates window.  This is the small window (usually
210 	 * in the upper left of the screen, unless
211 	 * ScreenInfo.CenterFeedbackWindow is set) that shows
212 	 * dimensions/coordinates for resize/move operations.
213 	 */
214 	Window SizeWindow;
215 
216 	/**
217 	 * Window info window.  This is the window that pops up with the
218 	 * various information when you f.identify a window, and also the
219 	 * truncated version of that that f.version pulls up.
220 	 */
221 	struct _InfoWindow {
222 		Window       win;          ///< Actual X window
223 		bool         mapped;       ///< Whether it's currently up
224 		int          lines;        ///< Current number of lines
225 		unsigned int width;        ///< Current size
226 		unsigned int height;       ///< Current size
227 	} InfoWindow; ///< \copydoc ScreenInfo::_InfoWindow
228 	/*
229 	 * Naming this struct type is pointless, but necessary for doxygen to
230 	 * not barf on it.  The copydoc is needed so the desc shows up in the
231 	 * ScreenInfo docs as well as the struct's own.
232 	 */
233 
234 	/**
235 	 * \defgroup scr_maskwin Screen masking window stuff
236 	 * These are bits for a window that covers up everything on the
237 	 * screen during startup if we're showing the "Welcome window"
238 	 * splash screen.  That is, if ScreenInfo.ShowWelcomeWindow is true.
239 	 * @{
240 	 */
241 	/// Startup splash screen masking window if
242 	/// ScreenInfo.ShowWelcomeWindow
243 	Window WindowMask;
244 	/// Utility window for animated icons
245 	Window ShapeWindow;
246 	/// Image to show on ScreenInfo.WindowMask
247 	Image *WelcomeImage;
248 	/// GC for drawing ScreenInfo.WelcomeImage on ScreenInfo.WindowMask
249 	GC     WelcomeGC;
250 	/// Colormap for ScreenInfo.WindowMask
251 	Colormap WelcomeCmap;
252 	/// @}
253 
254 	name_list *ImageCache;  ///< Cached pixmaps used in image loading
255 	TitlebarPixmaps tbpm;   ///< Memoized titlebar pixmaps
256 	Image *UnknownImage;    ///< Fallback icon pixmap
257 	Pixmap siconifyPm;      ///< In-icon manager iconifed marker pixmap
258 	Pixmap pullPm;          ///< In-menu submenu item marker icon
259 	unsigned int pullW;     ///< Dimensions of ScreenInfo.pullPm
260 	unsigned int pullH;     ///< Dimensions of ScreenInfo.pullPm
261 
262 	/**
263 	 * Name of titlebar focus hilite image if any.  This is an
264 	 * alternative to the builtin shading on the titlebar when a window
265 	 * has focus.  See Pixmaps config var.
266 	 */
267 	char *HighlightPixmapName;
268 
269 	/// \defgroup scr_menu_bits Various menus
270 	/// These hold references to the various menus on the Screen.
271 	/// @{
272 	MenuRoot *MenuList;    ///< Head of the menu list
273 	MenuRoot *LastMenu;    ///< Temp var used in creating the Screen's menus
274 	MenuRoot *Windows;     ///< f.menu TwmWindows
275 	MenuRoot *Icons;       ///< f.menu TwmIcons
276 	MenuRoot *Workspaces;  ///< f.menu TwmWorkspaces
277 	MenuRoot *AllWindows;  ///< f.menu TwmAllWindows
278 
279 	/*Added by dl 2004 */
280 	MenuRoot *AllIcons;    ///< f.menu TwmAllIcons
281 
282 	/* Added by Dan Lilliehorn (dl@dl.nu) 2000-02-29)     */
283 	MenuRoot *Keys;        ///< f.menu TwmKeys
284 	MenuRoot *Visible;     ///< f.menu TwmVisible
285 
286 	/// @}
287 
288 	TwmWindow *Ring;       ///< One of the windows in the Screen's ring
289 	TwmWindow *RingLeader; ///< Current window in ring
290 
291 	MouseButton DefaultFunction;   ///< DefaultFunction config var
292 	MouseButton WindowFunction;    ///< WindowFunction config var
293 	MouseButton ChangeWorkspaceFunction; ///< ChangeWorkspaceFunction config var
294 	MouseButton DeIconifyFunction; ///< DeIconifyFunction config var
295 	MouseButton IconifyFunction;   ///< IconifyFunction config var
296 
297 	/// Various colormaps used on the Screen.  These probably have little
298 	/// effect in a world where 24bpp is a baseline...
299 	struct _cmapInfo {
300 		Colormaps *cmaps;  ///< Current list of colormap windows
301 		int maxCmaps;      ///< Maximum number of installed colormaps
302 		/// seq # for first XInstallColormap() req in pass thru loading a
303 		/// colortable list
304 		unsigned long first_req;
305 		/// current push level to install root colormap windows
306 		int root_pushes;
307 		/// saved colormaps to install when pushes drops to zero
308 		Colormaps *pushed_cmaps;
309 	} cmapInfo; ///< \copydoc ScreenInfo::_cmapInfo
310 	///< \todo Somebody needs to understand and document this better.
311 	// x-ref trailing comment on InfoWindow above
312 
313 	/**
314 	 * Various XStandardColormaps on the screen.  See Xlib documentation
315 	 * for XStandardColormaps (e.g.,
316 	 * <https://www.x.org/releases/X11R7.7/doc/libX11/libX11/libX11.html#Standard_Colormaps>)
317 	 * if you need to make sense of it.
318 	 */
319 	struct _StdCmapInfo {
320 		StdCmap *head;         ///< list of maps
321 		StdCmap *tail;         ///< list of maps
322 		StdCmap *mru;          ///< Most recently used in list
323 		int mruindex;          ///< index of mru in entry
324 	} StdCmapInfo; ///< \copydoc ScreenInfo::_StdCmapInfo
325 	///< \todo Somebody needs to understand and document this better.
326 	// x-ref trailing comment on InfoWindow above
327 
328 	/**
329 	 * Various titlebar buttons that will be put in the window
330 	 * decorations for the screen.  This is setup by
331 	 * InitTitlebarButtons() and possibly added to via
332 	 * Left/RightTitleButton config vars.
333 	 * \sa CreateWindowTitlebarButtons() where this gets used to build
334 	 * the titlebar of an individual window.
335 	 */
336 	struct _TBInfo {
337 		int nleft;         ///< numbers of buttons on left side
338 		int nright;        ///< numbers of buttons on right side
339 		TitleButton *head; ///< start of list
340 		int border;        ///< button border
341 		int pad;           ///< button-padding
342 		int width;         ///< width of single button & border
343 		int leftx;         ///< start of left buttons
344 		int titlex;        ///< start of title
345 		int rightoff;      ///< offset back from right edge
346 		int titlew;        ///< width of title part
347 	} TBInfo; ///< \copydoc ScreenInfo::_TBInfo
348 	// x-ref trailing comment on InfoWindow above
349 
350 	/**
351 	 * \defgroup scr_color_bits Various color definitions.
352 	 * These define various colors we use for things on the screen.
353 	 * They tend to come from things inside a Color {} section in the
354 	 * config.  There are often correspondences between the "simple"
355 	 * ColorPair or Pixel values (for the "normal" colors of each type)
356 	 * and a name_list (for per-window settings of that type).
357 	 * @{
358 	 */
359 	/// Border tile colors.  \sa ScreenInfo.BorderTileForegroundL
360 	/// \sa ScreenInfo.BorderTileBackgroundL
361 	ColorPair BorderTileC;
362 
363 	/// Titlebar colors  \sa ScreenInfo.TitleForegroundL
364 	/// \sa ScreenInfo.TitleBackgroundL
365 	ColorPair TitleC;
366 
367 	/// Menu colors
368 	ColorPair MenuC;
369 
370 	/// Menu title colors
371 	ColorPair MenuTitleC;
372 
373 	/// %Icon colors.  \sa ScreenInfo.IconForegroundL
374 	/// \sa ScreenInfo.IconBackgroundL
375 	ColorPair IconC;
376 
377 	/// %Icon manager colors.  \sa ScreenInfo.IconManagerFL
378 	/// \sa ScreenInfo.IconManagerBL
379 	ColorPair IconManagerC;
380 
381 	/// Default colors
382 	ColorPair DefaultC;
383 
384 	/// Color of window borders.  \sa ScreenInfo.BorderColorL
385 	ColorPair BorderColorC;
386 
387 	/// Specialized border colors for windows.  From BorderColor config
388 	/// var.  \sa ScreenInfo.BorderColorC
389 	name_list *BorderColorL;
390 
391 	/// Specialized border colors for icons.  From IconBorderColor config
392 	/// var.  \sa ScreenInfo.IconBorderColor
393 	name_list *IconBorderColorL;
394 
395 	/// Specialized border coloring.  From BorderTileForeground config
396 	/// var.  \sa ScreenInfo.BorderTileC
397 	name_list *BorderTileForegroundL;
398 
399 	/// \copydoc ScreenInfo::BorderTileForegroundL
400 	name_list *BorderTileBackgroundL;
401 
402 	/// Specialized titlebar foreground coloring.  From TitleForeground
403 	/// config var.  \sa ScreenInfo.TitleC
404 	name_list *TitleForegroundL;
405 
406 	/// Specialized titlebar background coloring.  From TitleBackground
407 	/// config var.  \sa ScreenInfo.TitleC
408 	name_list *TitleBackgroundL;
409 
410 	/// Specialized icon foreground coloring.  From IconForeground
411 	/// config var.  \sa ScreenInfo.IconC
412 	name_list *IconForegroundL;
413 
414 	/// Specialized icon background coloring.  From IconBackground
415 	/// config var.  \sa ScreenInfo.IconC
416 	name_list *IconBackgroundL;
417 
418 	/// Specialized icon manager foreground coloring.  From
419 	/// IconManagerForeground config var.  \sa ScreenInfo.IconManagerC
420 	name_list *IconManagerFL;
421 
422 	/// Specialized icon manager background coloring.  From
423 	/// IconManagerBackground config var.  \sa ScreenInfo.IconManagerC
424 	name_list *IconManagerBL;
425 
426 	/// Color to highlight focused windows in icon manager.
427 	/// \sa ScreenInfo.IconManagerHighlight
428 	name_list *IconManagerHighlightL;
429 
430 	/// Menu shadow color
431 	Pixel MenuShadowColor;
432 
433 	/// %Icon border color.  \sa ScreenInfo.IconBorderColorL
434 	Pixel IconBorderColor;
435 
436 	/// %Icon manager highlight color.
437 	/// \sa ScreenInfo.IconManagerHighlightL
438 	Pixel IconManagerHighlight;
439 
440 	/// The contrast of the clear shadow
441 	short ClearShadowContrast;
442 
443 	/// The contrast of the dark shadow
444 	short DarkShadowContrast;
445 	/// @}
446 
447 	/**
448 	 * \defgroup scr_icon_bits Various icon control bits.
449 	 * Various configurations for how icons get displayed and laid out.
450 	 * @{
451 	 */
452 	/// How icon images/titles are aligned.  From IconJustification
453 	/// config var.  X-ref IconRegion.TitleJustification.
454 	TitleJust IconJustification;
455 
456 	/// How icons are laid out horizontally inside a region.  From
457 	/// IconRegionJustificationconfig var.
458 	IRJust IconRegionJustification;
459 
460 	/// How icons are laid out vertically inside a region.  From
461 	/// IconRegionAlignement config var.
462 	IRAlignement IconRegionAlignement;
463 
464 	/// How to animate window iconification, if any.  From IconifyStyle
465 	/// config var.
466 	IcStyle IconifyStyle;       /* ICONIFY_* */
467 	/// Limit on icon title size.  From MaxIconTitleWidth config var.
468 	int MaxIconTitleWidth;
469 #ifdef EWMH
470 	int PreferredIconWidth;     ///< Width from IconSize config var
471 	int PreferredIconHeight;    ///< Height from IconSize config var
472 #endif
473 	/// @}
474 
475 	/// How title text is aligned in window titlebars.  From
476 	/// TitleJustification config var.  \note Despite the naming
477 	/// similarity, this is *not* related to
478 	/// IconRegion.TitleJustification.  That comes instead from
479 	/// ScreenInfo.IconJustification.
480 	TitleJust TitleJustification;
481 
482 	/// \defgroup scr_cursors Various cursors used on the screen.
483 	/// These all come from the Cursors config var, or defaults.
484 	/// @{
485 	Cursor TitleCursor;    ///< title bar cursor
486 	Cursor FrameCursor;    ///< frame cursor
487 	Cursor IconCursor;     ///< icon cursor
488 	Cursor IconMgrCursor;  ///< icon manager cursor
489 	Cursor ButtonCursor;   ///< title bar button cursor
490 	Cursor MoveCursor;     ///< move cursor
491 	Cursor ResizeCursor;   ///< resize cursor
492 	Cursor WaitCursor;     ///< wait a while cursor
493 	Cursor MenuCursor;     ///< menu cursor
494 	Cursor SelectCursor;   ///< dot cursor for f.move, etc. from menus
495 	Cursor DestroyCursor;  ///< skull and cross bones, f.destroy
496 	Cursor AlterCursor;    ///< cursor for alternate keymaps
497 	/// @}
498 
499 	/// Info about the WorkSpaceManager (and Occupy window) for the screen.
500 	WorkSpaceMgr workSpaceMgr;
501 	bool workSpaceManagerActive; ///< Whether the WSM is being shown
502 
503 	/// \defgroup scr_vscreen_bits VScreen bits
504 	/// @{
505 	VirtualScreen *vScreenList;    ///< Linked list of per-VS info
506 	VirtualScreen *currentvs;      ///< Currently active VS
507 	name_list     *VirtualScreens; ///< List of defined VS's
508 	int           numVscreens;     ///< Number of defined VS's
509 	/// @}
510 
511 	name_list   *OccupyAll;       ///< OccupyAll config var
512 	name_list   *UnmapByMovingFarAway; ///< UnmapByMovingFarAway config var
513 	name_list   *DontSetInactive; ///< DontSetInactive config var
514 	name_list   *AutoSqueeze;     ///< AutoSqueeze config var
515 	name_list   *StartSqueezed;   ///< StartSqueezed config var
516 
517 	bool  use3Dmenus;        ///< UseThreeDMenus config var
518 	bool  use3Dtitles;       ///< UseThreeDTitles config var
519 	bool  use3Diconmanagers; ///< UseThreeDIconManagers config var
520 	bool  use3Dborders;      ///< UseThreeDBorders config var
521 	bool  use3Dwmap;         ///< UseThreeDWMap config var
522 	bool  SunkFocusWindowTitle;  ///< SunkFocusWindowTitle config var
523 	short WMgrVertButtonIndent;  ///< WMgrVertButtonIndent config var
524 	short WMgrHorizButtonIndent; ///< WMgrHorizButtonIndent config var
525 	short WMgrButtonShadowDepth; ///< WMgrButtonShadowDepth config var
526 	bool  BeNiceToColormap; ///< BeNiceToColormap config var
527 	bool  BorderCursors;    ///< BorderResizeCursors config var
528 	/// AutoPopup config flag.  \sa ScreenInfo.AutoPopupL
529 	bool  AutoPopup;
530 	short BorderShadowDepth;      ///< BorderShadowDepth config var
531 	short TitleButtonShadowDepth; ///< TitleButtonShadowDepth config var
532 	short TitleShadowDepth;       ///< TitleShadowDepth config var
533 	short MenuShadowDepth;        ///< MenuShadowDepth config var
534 	short IconManagerShadowDepth; ///< IconManagerShadowDepth config var
535 	/// ReallyMoveInWorkspaceManager config var
536 	bool  ReallyMoveInWorkspaceManager;
537 	/// AlwaysShowWindowWhenMovingFromWorkspaceManager config var
538 	bool  ShowWinWhenMovingInWmgr;
539 	bool  ReverseCurrentWorkspace; ///< ReverseCurrentWorkspace config var
540 	bool  DontWarpCursorInWMap;  ///< DontWarpCursorInWMap config var
541 	short XMoveGrid;             ///< XMoveGrid config var
542 	short YMoveGrid;             ///< YMoveGrid config var
543 	bool  CenterFeedbackWindow;  ///< CenterFeedbackWindow config var
544 	bool  ShrinkIconTitles;      ///< ShrinkIconTitles config var
545 	bool  AutoRaiseIcons;        ///< AutoRaiseIcons config var
546 	bool  AutoFocusToTransients; ///< AutoFocusToTransients config var
547 	bool  PackNewWindows;        ///< PackNewWindows config var
548 
549 	/// Stash of various OTP info about the windows on the screen.  This
550 	/// is only used internally in various otp.c code; nothing else
551 	/// currently references it.
552 	struct OtpPreferences *OTP;
553 	/// Stash of OTP info about icons on the screen. \copydetails OTP
554 	struct OtpPreferences *IconOTP;
555 	/// Pointer to the start of the OTP winlists for the screen.
556 	struct OtpWinList *bottomOwl;
557 
558 	/// From IconManagers config var.  This is a mapping from the window
559 	/// name pattern to the IconMgr structure it should go in.  All the
560 	/// IM's for the screen wind up in the iconmgr element.
561 	/// \sa ScreenInfo.iconmgr
562 	name_list *IconMgrs;
563 
564 	/// AutoPopup config var (list).  Windows that popup when changed.
565 	/// \sa ScreenInfo.AutoPopup
566 	name_list *AutoPopupL;
567 
568 	/// NoBorder config var.  Windows without borders.
569 	name_list *NoBorder;
570 
571 	/// NoIconTitle config var (list).  Windows to not show a title on
572 	/// the icons for.  \sa ScreenInfo.NoIconTitlebar
573 	name_list *NoIconTitle;
574 
575 	/// NoTitle config var (list).  Windows to not put a titlebar on.
576 	/// \sa ScreenInfo.NoTitlebar
577 	name_list *NoTitle;
578 
579 	/// MakeTitle config var.  Windows to pup a titlebar on when general
580 	/// NoTitle is set.  \sa ScreenInfo.NoTitlebar \sa ScreenInfo.NoTitle
581 	name_list *MakeTitle;
582 
583 	/// AutoRaise config var (list).  Windows to automatically raise when
584 	/// pointed to (possible after a delay).
585 	/// \sa ScreenInfo.AutoRaiseDefault \sa ScreenInfo.RaiseDelay
586 	name_list *AutoRaise;
587 
588 	/// WarpOnDeIconify config var.  Windows to occupy over to current
589 	/// workspace on deiconification.  \note Minor nomenclature issue;
590 	/// 'Warp' in name suggests we move to the win, but it actually means
591 	/// move the win to us.
592 	name_list *WarpOnDeIconify;
593 
594 	/// AutoLower config var (list).  Windows to automatically lower when
595 	/// pointed away from.  \sa ScreenInfo.AutoLowerDefault
596 	name_list *AutoLower;
597 
598 	/// Icons config var.  Manually specified icons for particular
599 	/// windows.
600 	name_list *IconNames;
601 
602 	/// NoHightlight config var (list).  Windows to not highlight border
603 	/// of when focused.  \sa ScreenInfo.Highlight
604 	name_list *NoHighlight;
605 
606 	/// NoStackMode config var (list).  Windows to ignore
607 	/// application-initiated restacking requests from.
608 	/// \sa ScreenInfo.StackMode
609 	name_list *NoStackModeL;
610 
611 	/// NoTitleHighlight config var (list).  Windows to not highlight in
612 	/// titlevar when focused.  \sa ScreenInfo.TitleHighlight
613 	name_list *NoTitleHighlight;
614 
615 	/// DontIconifyByUnmapping config var.  Windows to iconify by making
616 	/// an icon for, overriding IconifyByUnmapping setting.
617 	name_list *DontIconify;
618 
619 	/// IconManagerDontShow config var (list).
620 	/// \sa ScreenInfo.IconManagerDontShow
621 	name_list *IconMgrNoShow;
622 
623 	/// IconManagerShow config var.  Windows to show in icon manager even
624 	/// if global IconManagerDontShow is set.
625 	name_list *IconMgrShow;
626 
627 	/// IconifyByUnmapping config var (list).  \sa ScreenInfo.IconifyByUnmapping
628 	name_list *IconifyByUn;
629 
630 	/// StartIconified config var.
631 	name_list *StartIconified;
632 
633 	/// SqueezeTitle config var (list).  \sa ScreenInfo.SqueezeTitle
634 	name_list *SqueezeTitleL;
635 
636 	/// DontSqueezeTitle config var (list).  \sa ScreenInfo.SqueezeTitle
637 	name_list *DontSqueezeTitleL;
638 
639 	/// AlwaysSqueezeToGravity config var (list).
640 	/// \sa ScreenInfo.AlwaysSqueezeToGravity
641 	name_list *AlwaysSqueezeToGravityL;
642 
643 	/// WindowRing config var (list).  Windows to put in warp ring.
644 	/// \sa ScreenInfo.WindowRingAll
645 	name_list *WindowRingL;
646 
647 	/// WindowRingExclude config var.  Windows to exclude from warp ring.
648 	name_list *WindowRingExcludeL;
649 
650 	/// WarpCursor config var (list).  Windows to warp to on deiconify.
651 	/// \sa ScreenInfo.WarpCursor
652 	name_list *WarpCursorL;
653 
654 	/// DontSave config var.  Windows to not save info in session manager.
655 	name_list *DontSave;
656 
657 	/// WindowGeometries config var.  Default geometries for windows.
658 	name_list *WindowGeometries;
659 
660 	/// IgnoreTransient config var.  Windows that we should pretend
661 	/// aren't transient even if they are.
662 	name_list *IgnoreTransientL;
663 
664 	/// OpaqueMove config var (list).  Windows to move opaquely rather
665 	/// than in outline.  \sa ScreenInfo.DoOpaqueMove
666 	name_list *OpaqueMoveList;
667 
668 	/// NoOpaqueMove config var (list).  Windows to not move opaquely.
669 	/// \sa ScreenInfo.DoOpaqueMove
670 	name_list *NoOpaqueMoveList;
671 
672 	/// OpaqueResize config var (list).  Windows to resize opaquely
673 	/// rather than in outline.  \sa ScreenInfo.DoOpaqueResize
674 	name_list *OpaqueResizeList;
675 
676 	/// NoOpaqueResize config var (list).  Windows to not resize
677 	/// opaquely.  \sa ScreenInfo.DoOpaqueResize
678 	name_list *NoOpaqueResizeList;
679 
680 	/// IconMenuDontShow config var.  Windows whose icons to not list in
681 	/// TwmIcons menu.
682 	name_list *IconMenuDontShow;
683 
684 
685 	/**
686 	 * \defgroup scr_gc_bits Various graphics contexts
687 	 * These are X Graphics Contexts, which are used for various sorts of
688 	 * drawing in X.  Stuff that needs to draw lines, or write out text,
689 	 * all needs to use a GC.  X-ref
690 	 * <https://www.x.org/releases/X11R7.7/doc/libX11/libX11/libX11.html#Graphics_Context_Functions>
691 	 * for upstream details.
692 	 * @{
693 	 */
694 	GC NormalGC; ///< normal GC for everything
695 	GC MenuGC;   ///< GC for menus
696 	GC DrawGC;   ///< GC to draw lines for move and resize
697 	GC BorderGC; ///< GC for drawing 3D borders
698 	GC rootGC;   ///< GC for internal pixmaps in image.c / image_bitmap.c
699 	/// @}
700 
701 	Pixel Black; ///< Stash of "Black" X color for the screen
702 	Pixel White; ///< Stash of "White" X color for the screen
703 	unsigned long XORvalue;  ///< XorValue config var, or default
704 
705 	/// \defgroup scr_font_bits Various font settings
706 	/// Definitions of various fonts to use on the Screen.
707 	/// @{
708 	MyFont TitleBarFont;     ///< TitleFont config var
709 	MyFont MenuFont;         ///< MenuFont config var
710 	MyFont IconFont;         ///< IconFont config var
711 	MyFont SizeFont;         ///< SizeFont config var
712 	MyFont IconManagerFont;  ///< IconManagerFont config var
713 	MyFont DefaultFont;      ///< Hardcoded fallback font
714 	/// @}
715 
716 	/// Head of linked list of Screen's icon managers.  The head is also
717 	/// the default icon manager for the screen.  \sa ScreenInfo.IconMgrs
718 	IconMgr *iconmgr;
719 
720 	/// Head of the list of IconRegion structs on the Screen.  Built out
721 	/// from %IconRegion config var.
722 	struct IconRegion *FirstRegion;
723 
724 	/// Tail of the list of IconRegion structs on the Screen.  Used as an
725 	/// optimization in configuring the list on startup.  \todo Is this
726 	/// actually necessary?  Does the order matter?
727 	struct IconRegion *LastRegion;
728 
729 	/// Pointer to head of list of window regions on screen.  Built from
730 	/// %WindowRegion config var.
731 	struct WindowRegion *FirstWindowRegion;
732 
733 	/// Pointer to head of list of windowboxes on screen.  Built from
734 	/// %WindowBox config var.
735 	WindowBox *FirstWindowBox;
736 
737 	char *IconDirectory;    ///< IconDirectory config var
738 	char *PixmapDirectory;  ///< PixmapDirectory config var
739 
740 	int SizeStringOffset;   ///< X offset in size window for drawing
741 	int SizeStringWidth;    ///< Minimum width of size window
742 
743 	int BorderWidth;        ///< BorderWidth config var
744 	int BorderLeft;         ///< BorderLeft config var
745 	int BorderRight;        ///< BorderRight config var
746 	int BorderTop;          ///< BorderTop config var
747 	int BorderBottom;       ///< BorderBottom config var
748 	int ThreeDBorderWidth;  ///< ThreeDBorderWidth config var
749 	int IconBorderWidth;    ///< IconBorderWidth config var
750 
751 	/// Height of the title bar window.  Calculated from font height and
752 	/// padding.  \todo Maybe this should be in ScreenInfo.TBInfo above?
753 	/// Same can be said for a number of following fields that are
754 	/// titlebar related...
755 	int TitleHeight;
756 
757 	TwmWindow *Focus;    ///< The twm window that has focus.
758 	int EntryHeight;     ///< Menu entry height.  Calc'd from font height.
759 
760 	/// FramePadding config var.  Distance between titlebar contents and
761 	/// frame.
762 	int FramePadding;
763 	/// TitlePadding config var.  Distance between items in titlebar.
764 	int TitlePadding;
765 
766 	/// ButtonIndent config var.  Amount to shrink titlebar buttons.
767 	int ButtonIndent;
768 	int NumAutoRaises;   ///< Number of autoraise windows on screen
769 	int NumAutoLowers;   ///< Number of autolower windows on screen
770 	int TransientOnTop;  ///< TransientOnTop config var
771 
772 	/// AutoRaise config flag.  \sa ScreenInfo.AutoRaise
773 	bool AutoRaiseDefault;
774 
775 	/// AutoLower config flag.  \sa ScreenInfo.AutoLower
776 	bool AutoLowerDefault;
777 
778 	bool NoDefaults;    ///< NoDefaults config var
779 	UsePPoss UsePPosition;     ///< UsePPosition config var
780 	bool UseSunkTitlePixmap;  ///< UseSunkTitlePixmap config var
781 	bool AutoRelativeResize;  ///< AutoRelativeResize config var
782 
783 	/// Whether focus is allowed to move.  At one point this allegedly
784 	/// meant something like "is the input focus on the root?".  In
785 	/// current use, however, it's used as a flag for whether to
786 	/// auto-move focus to a new window; it's set to false in the
787 	/// ClickToFocus case, as well as when f.focus is called on a window,
788 	/// and then prevents Enter notifications from setting focus on new
789 	/// windows.
790 	/// \todo Rename to something better fitting.
791 	bool  FocusRoot;
792 
793 	bool WarpCursor;    ///< WarpCursor config var.  \sa ScreenInfo.WarpCursorL
794 	bool ForceIcon;     ///< ForceIcons config var
795 	bool NoGrabServer;  ///< NoGrabServer config var
796 	bool NoRaiseMove;   ///< NoRaiseOnMove config var
797 	bool NoRaiseResize; ///< NoRaiseOnResize config var
798 	bool NoRaiseDeicon; ///< NoRaiseOnDeiconify config var
799 	bool RaiseOnWarp;   ///< NoRaiseOnWarp config var (inverse)
800 	bool DontMoveOff;   ///< DontMoveOff config var
801 	int MoveOffResistance;  ///< MoveOffResistence config var
802 	int MovePackResistance; ///< MovePackResistence config var
803 
804 	/// Whether we're animating [de]iconification zooms.  From Zoom
805 	/// config var.  \sa ScreenInfo.ZoomCount
806 	bool DoZoom;
807 
808 	bool TitleFocus;       ///< NoTitleFocus config var (inverse)
809 	bool IconManagerFocus; ///< NoIconManagerFocus config var (inverse)
810 
811 	/// NoIconTitle config var.  \sa ScreenInfo.NoIconTitle
812 	bool NoIconTitlebar;
813 
814 	/// NoTitle config var.  \sa ScreenInfo.NoTitle
815 	bool NoTitlebar;
816 
817 	bool DecorateTransients; ///< DecorateTransients config var
818 
819 	/// IconifyByUnmapping config var.  \sa ScreenInfo.IconifyByUn
820 	bool IconifyByUnmapping;
821 
822 	bool ShowIconManager; ///< ShowIconManager config var
823 	bool ShowWorkspaceManager; ///< ShowWorkSpaceManager config var
824 
825 	/// IconManagerDontShow config var.  \sa ScreenInfo.IconMgrNoShow
826 	bool IconManagerDontShow;
827 
828 	bool AutoOccupy;   ///< AutoOccupy config var
829 	bool AutoPriority; ///< AutoPriority config var
830 	bool TransientHasOccupation; ///< TransientHasOccupation config var
831 	bool DontPaintRootWindow;    ///< DontPaintRootWindow config var
832 	bool BackingStore; ///< BackingStore config var
833 	bool SaveUnder;    ///< NoSaveUnders config var (inverse)
834 	RandPlac RandomPlacement;  ///< RandomPlacement config var (1st arg)
835 	short RandomDisplacementX; ///< RandomPlacement config var (2nd arg)
836 	short RandomDisplacementY; ///< RandomPlacement config var (2nd arg)
837 
838 	/// Whether we're doing a window opaque move.  This is set at runtime
839 	/// for each particular move we start doing, acting as a "what are we
840 	/// in the middle of" flag.  It will get figured based on various
841 	/// things, like TwmWindow.OpaqueMove and
842 	/// ScreenInfo.OpaqueMoveThreshold.
843 	bool OpaqueMove;
844 
845 	/// OpaqueMove config var.  \sa ScreenInfo.OpaqueMoveList
846 	bool DoOpaqueMove;
847 
848 	unsigned short OpaqueMoveThreshold;  ///< OpaqueMoveThreshold config var
849 
850 	/// OpaqueResize config var.  \sa ScreenInfo.OpaqueResizeList
851 	bool DoOpaqueResize;
852 
853 	/// Whether we're in the midst of an opaque resizing.  Transiently
854 	/// set at runtime based on things like TwmWindow.OpaqueResize and
855 	/// ScreenInfo.OpaqueResizeThreshold.  X-ref ScreenInfo.OpaqueMove
856 	/// for its counterpart in the window-moving department.
857 	bool OpaqueResize;
858 
859 	unsigned short OpaqueResizeThreshold; ///< OpaqueResizeThreshold config var
860 
861 	/// NoHighlight config var (inverse).  \sa ScreenInfo.NoHighlight
862 	bool Highlight;
863 
864 	/// NoStackMode config var (inverse).  \sa ScreenInfo.NoStackModeL
865 	bool StackMode;
866 
867 	/// NoTitleHighlight config var (inverse).  \sa ScreenInfo.NoTitleHighlight
868 	bool TitleHighlight;
869 
870 	/// MoveDelta config var.  Number of pixels before f.move starts
871 	short MoveDelta;
872 
873 	/// Zoom config var.  Number of animated steps in [de]iconifying.
874 	short ZoomCount;
875 
876 	bool SortIconMgr;  ///< SortIconManager config var
877 	bool Shadow;       ///< NoMenuShadows config var (inverse)
878 	bool InterpolateMenuColors;  ///< InterpolateMenuColors config var
879 	bool StayUpMenus;  ///< StayUpMenus config var
880 	bool WarpToDefaultMenuEntry; ///< WarpToDefaultMenuEntry config var
881 	bool ClickToFocus; ///< ClickToFocus config var
882 	bool SloppyFocus;  ///< SloppyFocus config var
883 	bool SaveWorkspaceFocus; ///< SaveWorkspaceFocus config var
884 	bool NoIconManagers;     ///< NoIconManagers config var
885 	bool ClientBorderWidth;  ///< ClientBorderWidth config var
886 
887 	/// SqueezeTitle and/or DontSqueezeTitle config vars.
888 	/// \sa ScreenInfo.SqueezeTitleL  \sa ScreenInfo.DontSqueezeTitleL
889 	bool SqueezeTitle;
890 
891 	/// AlwaysSqueezeToGravity config var.
892 	/// \sa ScreenInfo.AlwaysSqueezeToGravityL
893 	bool AlwaysSqueezeToGravity;
894 
895 	/// Whether fonts have been loaded yet in the startup process
896 	bool HaveFonts;
897 
898 	/// Some sort of attempt to determine whether this is the first
899 	/// config file we've parsed for this screen (which is bogus, since
900 	/// we only parse one file for each screen!), but also used in some
901 	/// color getting for obscure reasons.  This needs careful
902 	/// consideration and auditing; it may be just bogus.  X-ref work
903 	/// vtwm did in adjusting its use in GetColor() to avoid all the
904 	/// save/restore dances on calls around it, and the \#ifdef inside
905 	/// GetColor().  \todo Evaulate to determine whether it should exist.
906 	bool FirstTime;
907 
908 	bool  CaseSensitive; ///< NoCaseSensitive config var (inverse)
909 	bool  WarpUnmapped;  ///< WarpUnmapped config var
910 	bool  WindowRingAll; ///< WindowRing config var.  \sa ScreenInfo.WindowRingL
911 	bool  WarpRingAnyWhere;       ///< WarpRingOnScreen config var (inverse)
912 	bool  ShortAllWindowsMenus;   ///< ShortAllWindowsMenus config var
913 	short OpenWindowTimeout;      ///< OpenWindowTimeout config var
914 	bool  RaiseWhenAutoUnSqueeze; ///< RaiseWhenAutoUnSqueeze config var
915 	bool  RaiseOnClick;           ///< RaiseOnClick config var
916 	short RaiseOnClickButton;     ///< RaiseOnClickButton config var
917 	unsigned int IgnoreModifier;  ///< IgnoreModifier config var
918 	bool IgnoreCaseInMenuSelection;  ///< IgnoreCaseInMenuSelection config var
919 	bool NoWarpToMenuTitle;          ///< NoWarpToMenuTitle config var
920 	bool NoImagesInWorkSpaceManager; ///< NoImagesInWorkSpaceManager config var
921 
922 	/// DontToggleWorkspaceManagerState config var
923 	bool DontToggleWorkspaceManagerState;
924 
925 	/// Whether to show the welcome window.  Related to the
926 	/// DontShowWelcomeWindow config var or the \--nowelcome command-line
927 	/// arg.  \ingroup scr_maskwin
928 	bool ShowWelcomeWindow;
929 
930 	bool NameDecorations;  ///< DontNameDecorations config var (inverse)
931 
932 	/// Whether to be strict about what encoding of window naming
933 	/// properties (WM_NAME etc) we accept.  From StrictWinNameEncoding
934 	/// config var.
935 	bool StrictWinNameEncoding;
936 
937 	/// ForceFocus config var.  Forcing focus-setting on windows.
938 	/// \sa ScreenInfo.ForceFocusL
939 	bool      ForceFocus;
940 	/// \copybrief ForceFocus \sa ScreenInfo.ForceFocus
941 	name_list *ForceFocusL;
942 
943 	FuncKey FuncKeyRoot;       ///< Key bindings
944 	FuncButton FuncButtonRoot; ///< Mouse click bindings
945 
946 #ifdef EWMH
947 	/// Special-purpose window for WM_S<screennum> window selection.  See
948 	/// ICCCM sections 4.3, 2.8.
949 	Window icccm_Window;
950 
951 	/// List of known client windows.  Stashed in _NET_CLIENT_LIST
952 	/// property.
953 	long *ewmh_CLIENT_LIST;
954 	int ewmh_CLIENT_LIST_size; ///< Allocated ScreenInfo.ewmh_CLIENT_LIST memory
955 	int ewmh_CLIENT_LIST_used; ///< Used ScreenInfo.ewmh_CLIENT_LIST slots
956 
957 	/// List of EWMH struts.  From _NET_WM_STRUT properties.  EWMH config
958 	/// for windows that reserve spaces at the sides of a screen (e.g.,
959 	/// taskbars, panels, etc).
960 	EwmhStrut *ewmhStruts;
961 
962 	name_list *EWMHIgnore; ///< EWMHIgnore config var.  Messages to ignore.
963 #endif /* EWMH */
964 
965 	name_list *MWMIgnore; ///< Motif WM messages to ignore
966 };
967 
968 
969 
970 /*
971  * A few global vars that talk about Screen stuff
972  */
973 extern int NumScreens;  ///< How many Screens are on our display
974 extern ScreenInfo **ScreenList; ///< List of ScreenInfo structs for each Screen
975 extern ScreenInfo *Scr; ///< The ScreenInfo struct for the current Screen
976 
977 
978 #endif /* _CTWM_SCREEN_H */
979