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