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