13e747e6dSmrg/*
2ffd25bcaSmrg *
33e747e6dSmrgCopyright 1989, 1998  The Open Group
43e747e6dSmrg
53e747e6dSmrgPermission to use, copy, modify, distribute, and sell this software and its
63e747e6dSmrgdocumentation for any purpose is hereby granted without fee, provided that
73e747e6dSmrgthe above copyright notice appear in all copies and that both that
83e747e6dSmrgcopyright notice and this permission notice appear in supporting
93e747e6dSmrgdocumentation.
103e747e6dSmrg
113e747e6dSmrgThe above copyright notice and this permission notice shall be included in
123e747e6dSmrgall copies or substantial portions of the Software.
133e747e6dSmrg
143e747e6dSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
153e747e6dSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
163e747e6dSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
173e747e6dSmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
183e747e6dSmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
193e747e6dSmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
203e747e6dSmrg
213e747e6dSmrgExcept as contained in this notice, the name of The Open Group shall not be
223e747e6dSmrgused in advertising or otherwise to promote the sale, use or other dealings
233e747e6dSmrgin this Software without prior written authorization from The Open Group.
243e747e6dSmrg * */
253e747e6dSmrg
263e747e6dSmrg/***********************************************************************
273e747e6dSmrg *
283e747e6dSmrg * twm per-screen data include file
293e747e6dSmrg *
30f66df612Smrg * 11-3-88 Dave Payne, Apple Computer                   File created
313e747e6dSmrg *
323e747e6dSmrg ***********************************************************************/
333e747e6dSmrg
346d8e82c3Smrg#ifndef SCREEN_H
356d8e82c3Smrg#define SCREEN_H
363e747e6dSmrg
373e747e6dSmrg#include <X11/Xlib.h>
383e747e6dSmrg#include <X11/Xutil.h>
393e747e6dSmrg#include <X11/cursorfont.h>
403e747e6dSmrg#include "list.h"
413e747e6dSmrg#include "menus.h"
423e747e6dSmrg#include "iconmgr.h"
433e747e6dSmrg
443e747e6dSmrgtypedef struct _StdCmap {
45f66df612Smrg    struct _StdCmap *next;      /* next link in chain */
46f66df612Smrg    Atom atom;                  /* property from which this came */
47f66df612Smrg    int nmaps;                  /* number of maps below */
48f66df612Smrg    XStandardColormap *maps;    /* the actual maps */
493e747e6dSmrg} StdCmap;
503e747e6dSmrg
513e747e6dSmrg#define SIZE_HINDENT 10
523e747e6dSmrg#define SIZE_VINDENT 2
533e747e6dSmrg
543e747e6dSmrgtypedef struct _TitlebarPixmaps {
553e747e6dSmrg    Pixmap xlogo;
563e747e6dSmrg    Pixmap resize;
573e747e6dSmrg    Pixmap question;
583e747e6dSmrg    Pixmap menu;
596d8e82c3Smrg    Pixmap remove;
603e747e6dSmrg} TitlebarPixmaps;
613e747e6dSmrg
62f66df612Smrgtypedef struct ScreenInfo {
63f66df612Smrg    int screen;                 /* the default screen */
64f66df612Smrg    int d_depth;                /* copy of DefaultDepth(dpy, screen) */
65f66df612Smrg    Visual *d_visual;           /* copy of DefaultVisual(dpy, screen) */
66f66df612Smrg    int Monochrome;             /* is the display monochrome ? */
67f66df612Smrg    int MyDisplayWidth;         /* my copy of DisplayWidth(dpy, screen) */
68f66df612Smrg    int MyDisplayHeight;        /* my copy of DisplayHeight(dpy, screen) */
69f66df612Smrg    int MaxWindowWidth;         /* largest window to allow */
70f66df612Smrg    int MaxWindowHeight;        /* ditto */
713e747e6dSmrg
72f66df612Smrg    TwmWindow TwmRoot;          /* the head of the twm window list */
733e747e6dSmrg
74f66df612Smrg    Window Root;                /* the root window */
75f66df612Smrg    Window SizeWindow;          /* the resize dimensions window */
76f66df612Smrg    Window InfoWindow;          /* the information window */
773e747e6dSmrg
78f66df612Smrg    name_list *Icons;           /* list of icon pixmaps */
79f66df612Smrg    TitlebarPixmaps tbpm;       /* titlebar pixmaps */
80f66df612Smrg    Pixmap UnknownPm;           /* the unknown icon pixmap */
81f66df612Smrg    Pixmap siconifyPm;          /* the icon manager iconify pixmap */
82f66df612Smrg    Pixmap pullPm;              /* pull right menu icon */
83f66df612Smrg    unsigned int pullW, pullH;  /* size of pull right menu icon */
84f66df612Smrg    Pixmap hilitePm;            /* focus highlight window background */
85f66df612Smrg    int hilite_pm_width, hilite_pm_height;      /* cache the size */
863e747e6dSmrg
87f66df612Smrg    MenuRoot *MenuList;         /* head of the menu list */
88f66df612Smrg    MenuRoot *LastMenu;         /* the last menu (mostly unused?) */
89f66df612Smrg    MenuRoot *Windows;          /* the TwmWindows menu */
903e747e6dSmrg
91f66df612Smrg    TwmWindow *Ring;            /* one of the windows in window ring */
92f66df612Smrg    TwmWindow *RingLeader;      /* current window in ring */
933e747e6dSmrg
94f66df612Smrg    MouseButton Mouse[MAX_BUTTONS + 1][NUM_CONTEXTS][MOD_SIZE];
953e747e6dSmrg    MouseButton DefaultFunction;
963e747e6dSmrg    MouseButton WindowFunction;
973e747e6dSmrg
983e747e6dSmrg    struct {
99f66df612Smrg        Colormaps *cmaps;       /* current list of colormap windows */
100f66df612Smrg        int maxCmaps;           /* maximum number of installed colormaps */
101f66df612Smrg        unsigned long first_req;        /* seq # for first XInstallColormap() req in
102f66df612Smrg                                           pass thru loading a colortable list */
103f66df612Smrg        int root_pushes;        /* current push level to install root
104f66df612Smrg                                   colormap windows */
105f66df612Smrg        TwmWindow *pushed_window;       /* saved window to install when pushes drops
106f66df612Smrg                                           to zero */
1073e747e6dSmrg    } cmapInfo;
1083e747e6dSmrg
1093e747e6dSmrg    struct {
110f66df612Smrg        StdCmap *head, *tail;   /* list of maps */
111f66df612Smrg        StdCmap *mru;           /* most recently used in list */
112f66df612Smrg        int mruindex;           /* index of mru in entry */
1133e747e6dSmrg    } StdCmapInfo;
1143e747e6dSmrg
1153e747e6dSmrg    struct {
116f66df612Smrg        int nleft, nright;      /* numbers of buttons in list */
117f66df612Smrg        TitleButton *head;      /* start of list */
118f66df612Smrg        int border;             /* button border */
119f66df612Smrg        int pad;                /* button-padding */
120f66df612Smrg        int width;              /* width of single button & border */
121f66df612Smrg        int leftx;              /* start of left buttons */
122f66df612Smrg        int titlex;             /* start of title string */
123f66df612Smrg        int rightoff;           /* offset back from right edge */
1243e747e6dSmrg    } TBInfo;
125f66df612Smrg    ColorPair BorderTileC;      /* border tile colors */
126f66df612Smrg    ColorPair TitleC;           /* titlebar colors */
127f66df612Smrg    ColorPair MenuC;            /* menu colors */
128f66df612Smrg    ColorPair MenuTitleC;       /* menu title colors */
129f66df612Smrg    ColorPair IconC;            /* icon colors */
130f66df612Smrg    ColorPair IconManagerC;     /* icon manager colors */
131f66df612Smrg    XColor PointerForeground;   /* pointer foreground color */
132f66df612Smrg    XColor PointerBackground;   /* pointer background color */
133f66df612Smrg    ColorPair DefaultC;         /* default colors */
134f66df612Smrg    Pixel BorderColor;          /* color of window borders */
135f66df612Smrg    Pixel MenuShadowColor;      /* menu shadow color */
136f66df612Smrg    Pixel MenuBorderColor;      /* menu border color */
137f66df612Smrg    Pixel IconBorderColor;      /* icon border color */
138f66df612Smrg    Pixel IconManagerHighlight; /* icon manager highlight */
1393e747e6dSmrg
140f66df612Smrg    Cursor TitleCursor;         /* title bar cursor */
141f66df612Smrg    Cursor FrameCursor;         /* frame cursor */
142f66df612Smrg    Cursor IconCursor;          /* icon cursor */
143f66df612Smrg    Cursor IconMgrCursor;       /* icon manager cursor */
144f66df612Smrg    Cursor ButtonCursor;        /* title bar button cursor */
145f66df612Smrg    Cursor MoveCursor;          /* move cursor */
146f66df612Smrg    Cursor ResizeCursor;        /* resize cursor */
147f66df612Smrg    Cursor WaitCursor;          /* wait a while cursor */
148f66df612Smrg    Cursor MenuCursor;          /* menu cursor */
149f66df612Smrg    Cursor SelectCursor;        /* dot cursor for f.move, etc. from menus */
150f66df612Smrg    Cursor DestroyCursor;       /* skull and cross bones, f.destroy */
1513e747e6dSmrg
1523e747e6dSmrg    name_list *BorderColorL;
1533e747e6dSmrg    name_list *IconBorderColorL;
1543e747e6dSmrg    name_list *BorderTileForegroundL;
1553e747e6dSmrg    name_list *BorderTileBackgroundL;
1563e747e6dSmrg    name_list *TitleForegroundL;
1573e747e6dSmrg    name_list *TitleBackgroundL;
1583e747e6dSmrg    name_list *IconForegroundL;
1593e747e6dSmrg    name_list *IconBackgroundL;
1603e747e6dSmrg    name_list *IconManagerFL;
1613e747e6dSmrg    name_list *IconManagerBL;
1623e747e6dSmrg    name_list *IconMgrs;
163f66df612Smrg    name_list *NoTitle;         /* list of window names with no title bar */
164f66df612Smrg    name_list *MakeTitle;       /* list of window names with title bar */
165f66df612Smrg    name_list *AutoRaise;       /* list of window names to auto-raise */
166f66df612Smrg    name_list *IconNames;       /* list of window names and icon names */
167f66df612Smrg    name_list *NoHighlight;     /* list of windows to not highlight */
168f66df612Smrg    name_list *NoStackModeL;    /* windows to ignore stack mode requests */
169f66df612Smrg    name_list *NoTitleHighlight;        /* list of windows to not highlight the TB */
170f66df612Smrg    name_list *DontIconify;     /* don't iconify by unmapping */
171f66df612Smrg    name_list *IconMgrNoShow;   /* don't show in the icon manager */
172f66df612Smrg    name_list *IconMgrShow;     /* show in the icon manager */
173f66df612Smrg    name_list *IconifyByUn;     /* windows to iconify by unmapping */
174f66df612Smrg    name_list *StartIconified;  /* windows to start iconic */
175f66df612Smrg    name_list *IconManagerHighlightL;   /* icon manager highlight colors */
176f66df612Smrg    name_list *SqueezeTitleL;   /* windows of which to squeeze title */
177f66df612Smrg    name_list *DontSqueezeTitleL;       /* windows of which not to squeeze */
178f66df612Smrg    name_list *WindowRingL;     /* windows in ring */
179f66df612Smrg    name_list *WarpCursorL;     /* windows to warp cursor to on deiconify */
1803e747e6dSmrg
181f66df612Smrg    GC NormalGC;                /* normal GC for everything */
182f66df612Smrg    GC MenuGC;                  /* gc for menus */
183f66df612Smrg    GC DrawGC;                  /* GC to draw lines for move and resize */
1843e747e6dSmrg
1853e747e6dSmrg    unsigned long Black;
1863e747e6dSmrg    unsigned long White;
187f66df612Smrg    unsigned long XORvalue;     /* number to use when drawing xor'ed */
188f66df612Smrg    MyFont TitleBarFont;        /* title bar font structure */
189f66df612Smrg    MyFont MenuFont;            /* menu font structure */
190f66df612Smrg    MyFont IconFont;            /* icon font structure */
191f66df612Smrg    MyFont SizeFont;            /* resize font structure */
192f66df612Smrg    MyFont IconManagerFont;     /* window list font structure */
1933e747e6dSmrg    MyFont DefaultFont;
194f66df612Smrg    IconMgr iconmgr;            /* default icon manager */
195f66df612Smrg    struct IconRegion *FirstRegion;     /* pointer to icon regions */
196f66df612Smrg    struct IconRegion *LastRegion;      /* pointer to the last icon region */
197f66df612Smrg    char *IconDirectory;        /* icon directory to search */
198f66df612Smrg    int SizeStringOffset;       /* x offset in size window for drawing */
199f66df612Smrg    int SizeStringWidth;        /* minimum width of size window */
200f66df612Smrg    int BorderWidth;            /* border width of twm windows */
201f66df612Smrg    int IconBorderWidth;        /* border width of icon windows */
202f66df612Smrg    int MenuBorderWidth;        /* border width of twm menus */
203f66df612Smrg    int UnknownWidth;           /* width of the unknown icon */
204f66df612Smrg    int UnknownHeight;          /* height of the unknown icon */
205f66df612Smrg    int TitleHeight;            /* height of the title bar window */
206f66df612Smrg    TwmWindow *Focus;           /* the twm window that has focus */
207f66df612Smrg    int EntryHeight;            /* menu entry height */
208f66df612Smrg    int FramePadding;           /* distance between decorations and border */
209f66df612Smrg    int TitlePadding;           /* distance between items in titlebar */
210f66df612Smrg    int ButtonIndent;           /* amount to shrink buttons on each side */
211f66df612Smrg    int NumAutoRaises;          /* number of autoraise windows on screen */
212f66df612Smrg    short NoDefaults;           /* do not add in default UI stuff */
213f66df612Smrg    short UsePPosition;         /* what do with PPosition, see values below */
214f66df612Smrg    short AutoRelativeResize;   /* start resize relative to position in quad */
215f66df612Smrg    short FocusRoot;            /* is the input focus on the root ? */
216f66df612Smrg    short WarpCursor;           /* warp cursor on de-iconify ? */
217f66df612Smrg    short ForceIcon;            /* force the icon to the user specified */
218f66df612Smrg    short NoGrabServer;         /* don't do server grabs */
219f66df612Smrg    short NoRaiseMove;          /* don't raise window following move */
220f66df612Smrg    short NoRaiseResize;        /* don't raise window following resize */
221f66df612Smrg    short NoRaiseDeicon;        /* don't raise window on deiconify */
222f66df612Smrg    short NoRaiseWarp;          /* don't raise window on warp */
223f66df612Smrg    short DontMoveOff;          /* don't allow windows to be moved off */
224f66df612Smrg    short DoZoom;               /* zoom in and out of icons */
225f66df612Smrg    short TitleFocus;           /* focus on window in title bar ? */
226f66df612Smrg    short NoTitlebar;           /* put title bars on windows */
227f66df612Smrg    short DecorateTransients;   /* put title bars on transients */
228f66df612Smrg    short IconifyByUnmapping;   /* simply unmap windows when iconifying */
229f66df612Smrg    short ShowIconManager;      /* display the window list */
230f66df612Smrg    short IconManagerDontShow;  /* show nothing in the icon manager */
231f66df612Smrg    short BackingStore;         /* use backing store for menus */
232f66df612Smrg    short SaveUnder;            /* use save under's for menus */
233f66df612Smrg    short RandomPlacement;      /* randomly place windows that no give hints */
234f66df612Smrg    short OpaqueMove;           /* move the window rather than outline */
235f66df612Smrg    short Highlight;            /* should we highlight the window borders */
236f66df612Smrg    short StackMode;            /* should we honor stack mode requests */
237f66df612Smrg    short TitleHighlight;       /* should we highlight the titlebar */
238f66df612Smrg    short MoveDelta;            /* number of pixels before f.move starts */
239f66df612Smrg    short ZoomCount;            /* zoom outline count */
240f66df612Smrg    short SortIconMgr;          /* sort entries in the icon manager */
241f66df612Smrg    short Shadow;               /* show the menu shadow */
242f66df612Smrg    short InterpolateMenuColors;        /* make pretty menus */
243f66df612Smrg    short NoIconManagers;       /* Don't create any icon managers */
244f66df612Smrg    short ClientBorderWidth;    /* respect client window border width */
245f66df612Smrg    short SqueezeTitle;         /* make title as small as possible */
246f66df612Smrg    short HaveFonts;            /* set if fonts have been loaded */
247f66df612Smrg    short FirstTime;            /* first time we've read .twmrc */
248f66df612Smrg    short CaseSensitive;        /* be case-sensitive when sorting names */
249f66df612Smrg    short WarpUnmapped;         /* allow warping to unmapped windows */
2503e747e6dSmrg
2513e747e6dSmrg    FuncKey FuncKeyRoot;
2523e747e6dSmrg} ScreenInfo;
2533e747e6dSmrg
2543e747e6dSmrgextern int NumScreens;
2553e747e6dSmrgextern ScreenInfo **ScreenList;
2563e747e6dSmrgextern ScreenInfo *Scr;
2573e747e6dSmrg
2583e747e6dSmrg#define PPOS_OFF 0
2593e747e6dSmrg#define PPOS_ON 1
2603e747e6dSmrg#define PPOS_NON_ZERO 2
2613e747e6dSmrg/* may eventually want an option for having the PPosition be the initial
2623e747e6dSmrg   location for the drag lines */
2633e747e6dSmrg
2646d8e82c3Smrg#endif /* SCREEN_H */
265