screen.h revision 7a2631fc
1/*
2 *
3Copyright 1989, 1998  The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group.
24 * */
25
26/***********************************************************************
27 *
28 * twm per-screen data include file
29 *
30 * 11-3-88 Dave Payne, Apple Computer			File created
31 *
32 ***********************************************************************/
33
34#ifndef _SCREEN_
35#define _SCREEN_
36
37#include <X11/Xlib.h>
38#include <X11/Xutil.h>
39#include <X11/cursorfont.h>
40#include "list.h"
41#include "menus.h"
42#include "iconmgr.h"
43
44typedef struct _StdCmap {
45    struct _StdCmap *next;		/* next link in chain */
46    Atom atom;				/* property from which this came */
47    int nmaps;				/* number of maps below */
48    XStandardColormap *maps;		/* the actual maps */
49} StdCmap;
50
51#define SIZE_HINDENT 10
52#define SIZE_VINDENT 2
53
54typedef struct _TitlebarPixmaps {
55    Pixmap xlogo;
56    Pixmap resize;
57    Pixmap question;
58    Pixmap menu;
59    Pixmap delete;
60} TitlebarPixmaps;
61
62typedef struct ScreenInfo
63{
64    int screen;			/* the default screen */
65    int d_depth;		/* copy of DefaultDepth(dpy, screen) */
66    Visual *d_visual;		/* copy of DefaultVisual(dpy, screen) */
67    int Monochrome;		/* is the display monochrome ? */
68    int MyDisplayWidth;		/* my copy of DisplayWidth(dpy, screen) */
69    int MyDisplayHeight;	/* my copy of DisplayHeight(dpy, screen) */
70    int MaxWindowWidth;		/* largest window to allow */
71    int MaxWindowHeight;	/* ditto */
72
73    TwmWindow TwmRoot;		/* the head of the twm window list */
74
75    Window Root;		/* the root window */
76    Window SizeWindow;		/* the resize dimensions window */
77    Window InfoWindow;		/* the information window */
78
79    name_list *Icons;		/* list of icon pixmaps */
80    TitlebarPixmaps tbpm;	/* titlebar pixmaps */
81    Pixmap UnknownPm;		/* the unknown icon pixmap */
82    Pixmap siconifyPm;		/* the icon manager iconify pixmap */
83    Pixmap pullPm;		/* pull right menu icon */
84    unsigned int pullW, pullH;	/* size of pull right menu icon */
85    Pixmap hilitePm;		/* focus highlight window background */
86    int hilite_pm_width, hilite_pm_height;  /* cache the size */
87
88    MenuRoot *MenuList;		/* head of the menu list */
89    MenuRoot *LastMenu;		/* the last menu (mostly unused?) */
90    MenuRoot *Windows;		/* the TwmWindows menu */
91
92    TwmWindow *Ring;		/* one of the windows in window ring */
93    TwmWindow *RingLeader;	/* current winodw in ring */
94
95    MouseButton Mouse[MAX_BUTTONS+1][NUM_CONTEXTS][MOD_SIZE];
96    MouseButton DefaultFunction;
97    MouseButton WindowFunction;
98
99    struct {
100      Colormaps *cmaps; 	/* current list of colormap windows */
101      int maxCmaps;		/* maximum number of installed colormaps */
102      unsigned long first_req;	/* seq # for first XInstallColormap() req in
103				   pass thru loading a colortable list */
104      int root_pushes;		/* current push level to install root
105				   colormap windows */
106      TwmWindow *pushed_window;	/* saved window to install when pushes drops
107				   to zero */
108    } cmapInfo;
109
110    struct {
111	StdCmap *head, *tail;		/* list of maps */
112	StdCmap *mru;			/* most recently used in list */
113	int mruindex;			/* index of mru in entry */
114    } StdCmapInfo;
115
116    struct {
117	int nleft, nright;		/* numbers of buttons in list */
118	TitleButton *head;		/* start of list */
119	int border;			/* button border */
120	int pad;			/* button-padding */
121	int width;			/* width of single button & border */
122	int leftx;			/* start of left buttons */
123	int titlex;			/* start of title string */
124	int rightoff;			/* offset back from right edge */
125    } TBInfo;
126    ColorPair BorderTileC;	/* border tile colors */
127    ColorPair TitleC;		/* titlebar colors */
128    ColorPair MenuC;		/* menu colors */
129    ColorPair MenuTitleC;	/* menu title colors */
130    ColorPair IconC;		/* icon colors */
131    ColorPair IconManagerC;	/* icon manager colors */
132    XColor PointerForeground;	/* pointer foreground color */
133    XColor PointerBackground;	/* pointer background color */
134    ColorPair DefaultC;		/* default colors */
135    Pixel BorderColor;		/* color of window borders */
136    Pixel MenuShadowColor;	/* menu shadow color */
137    Pixel MenuBorderColor;	/* menu border color */
138    Pixel IconBorderColor;	/* icon border color */
139    Pixel IconManagerHighlight;	/* icon manager highlight */
140
141    Cursor TitleCursor;		/* title bar cursor */
142    Cursor FrameCursor;		/* frame cursor */
143    Cursor IconCursor;		/* icon cursor */
144    Cursor IconMgrCursor;	/* icon manager cursor */
145    Cursor ButtonCursor;	/* title bar button cursor */
146    Cursor MoveCursor;		/* move cursor */
147    Cursor ResizeCursor;	/* resize cursor */
148    Cursor WaitCursor;		/* wait a while cursor */
149    Cursor MenuCursor;		/* menu cursor */
150    Cursor SelectCursor;	/* dot cursor for f.move, etc. from menus */
151    Cursor DestroyCursor;	/* skull and cross bones, f.destroy */
152
153    name_list *BorderColorL;
154    name_list *IconBorderColorL;
155    name_list *BorderTileForegroundL;
156    name_list *BorderTileBackgroundL;
157    name_list *TitleForegroundL;
158    name_list *TitleBackgroundL;
159    name_list *IconForegroundL;
160    name_list *IconBackgroundL;
161    name_list *IconManagerFL;
162    name_list *IconManagerBL;
163    name_list *IconMgrs;
164    name_list *NoTitle;		/* list of window names with no title bar */
165    name_list *MakeTitle;	/* list of window names with title bar */
166    name_list *AutoRaise;	/* list of window names to auto-raise */
167    name_list *IconNames;	/* list of window names and icon names */
168    name_list *NoHighlight;	/* list of windows to not highlight */
169    name_list *NoStackModeL;	/* windows to ignore stack mode requests */
170    name_list *NoTitleHighlight;/* list of windows to not highlight the TB*/
171    name_list *DontIconify;	/* don't iconify by unmapping */
172    name_list *IconMgrNoShow;	/* don't show in the icon manager */
173    name_list *IconMgrShow;	/* show in the icon manager */
174    name_list *IconifyByUn;	/* windows to iconify by unmapping */
175    name_list *StartIconified;	/* windows to start iconic */
176    name_list *IconManagerHighlightL;	/* icon manager highlight colors */
177    name_list *SqueezeTitleL;		/* windows of which to squeeze title */
178    name_list *DontSqueezeTitleL;	/* windows of which not to squeeze */
179    name_list *WindowRingL;	/* windows in ring */
180    name_list *WarpCursorL;	/* windows to warp cursor to on deiconify */
181
182    GC NormalGC;		/* normal GC for everything */
183    GC MenuGC;			/* gc for menus */
184    GC DrawGC;			/* GC to draw lines for move and resize */
185
186    unsigned long Black;
187    unsigned long White;
188    unsigned long XORvalue;	/* number to use when drawing xor'ed */
189    MyFont TitleBarFont;	/* title bar font structure */
190    MyFont MenuFont;		/* menu font structure */
191    MyFont IconFont;		/* icon font structure */
192    MyFont SizeFont;		/* resize font structure */
193    MyFont IconManagerFont;	/* window list font structure */
194    MyFont DefaultFont;
195    IconMgr iconmgr;		/* default icon manager */
196    struct IconRegion *FirstRegion;	/* pointer to icon regions */
197    struct IconRegion *LastRegion;	/* pointer to the last icon region */
198    char *IconDirectory;	/* icon directory to search */
199    int SizeStringOffset;	/* x offset in size window for drawing */
200    int SizeStringWidth;	/* minimum width of size window */
201    int BorderWidth;		/* border width of twm windows */
202    int IconBorderWidth;	/* border width of icon windows */
203    int MenuBorderWidth;	/* border width of twm menus */
204    int UnknownWidth;		/* width of the unknown icon */
205    int UnknownHeight;		/* height of the unknown icon */
206    int TitleHeight;		/* height of the title bar window */
207    TwmWindow *Focus;		/* the twm window that has focus */
208    int EntryHeight;		/* menu entry height */
209    int FramePadding;		/* distance between decorations and border */
210    int TitlePadding;		/* distance between items in titlebar */
211    int ButtonIndent;		/* amount to shrink buttons on each side */
212    int NumAutoRaises;		/* number of autoraise windows on screen */
213    short NoDefaults;		/* do not add in default UI stuff */
214    short UsePPosition;		/* what do with PPosition, see values below */
215    short AutoRelativeResize;	/* start resize relative to position in quad */
216    short FocusRoot;		/* is the input focus on the root ? */
217    short WarpCursor;		/* warp cursor on de-iconify ? */
218    short ForceIcon;		/* force the icon to the user specified */
219    short NoGrabServer;		/* don't do server grabs */
220    short NoRaiseMove;		/* don't raise window following move */
221    short NoRaiseResize;	/* don't raise window following resize */
222    short NoRaiseDeicon;	/* don't raise window on deiconify */
223    short NoRaiseWarp;		/* don't raise window on warp */
224    short DontMoveOff;		/* don't allow windows to be moved off */
225    short DoZoom;		/* zoom in and out of icons */
226    short TitleFocus;		/* focus on window in title bar ? */
227    short NoTitlebar;		/* put title bars on windows */
228    short DecorateTransients;	/* put title bars on transients */
229    short IconifyByUnmapping;	/* simply unmap windows when iconifying */
230    short ShowIconManager;	/* display the window list */
231    short IconManagerDontShow;	/* show nothing in the icon manager */
232    short BackingStore;		/* use backing store for menus */
233    short SaveUnder;		/* use save under's for menus */
234    short RandomPlacement;	/* randomly place windows that no give hints */
235    short OpaqueMove;		/* move the window rather than outline */
236    short Highlight;		/* should we highlight the window borders */
237    short StackMode;		/* should we honor stack mode requests */
238    short TitleHighlight;	/* should we highlight the titlebar */
239    short MoveDelta;		/* number of pixels before f.move starts */
240    short ZoomCount;		/* zoom outline count */
241    short SortIconMgr;		/* sort entries in the icon manager */
242    short Shadow;		/* show the menu shadow */
243    short InterpolateMenuColors;/* make pretty menus */
244    short NoIconManagers;	/* Don't create any icon managers */
245    short ClientBorderWidth;	/* respect client window border width */
246    short SqueezeTitle;		/* make title as small as possible */
247    short HaveFonts;		/* set if fonts have been loaded */
248    short FirstTime;		/* first time we've read .twmrc */
249    short CaseSensitive;	/* be case-sensitive when sorting names */
250    short WarpUnmapped;		/* allow warping to unmapped windows */
251
252    FuncKey FuncKeyRoot;
253} ScreenInfo;
254
255extern int MultiScreen;
256extern int NumScreens;
257extern ScreenInfo **ScreenList;
258extern ScreenInfo *Scr;
259extern int FirstScreen;
260
261#define PPOS_OFF 0
262#define PPOS_ON 1
263#define PPOS_NON_ZERO 2
264/* may eventually want an option for having the PPosition be the initial
265   location for the drag lines */
266
267#endif /* _SCREEN_ */
268