screen.h revision ffd25bca
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 * 303e747e6dSmrg * 11-3-88 Dave Payne, Apple Computer File created 313e747e6dSmrg * 323e747e6dSmrg ***********************************************************************/ 333e747e6dSmrg 343e747e6dSmrg#ifndef _SCREEN_ 353e747e6dSmrg#define _SCREEN_ 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 { 453e747e6dSmrg struct _StdCmap *next; /* next link in chain */ 463e747e6dSmrg Atom atom; /* property from which this came */ 473e747e6dSmrg int nmaps; /* number of maps below */ 483e747e6dSmrg 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; 593e747e6dSmrg Pixmap delete; 603e747e6dSmrg} TitlebarPixmaps; 613e747e6dSmrg 623e747e6dSmrgtypedef struct ScreenInfo 633e747e6dSmrg{ 643e747e6dSmrg int screen; /* the default screen */ 653e747e6dSmrg int d_depth; /* copy of DefaultDepth(dpy, screen) */ 663e747e6dSmrg Visual *d_visual; /* copy of DefaultVisual(dpy, screen) */ 673e747e6dSmrg int Monochrome; /* is the display monochrome ? */ 683e747e6dSmrg int MyDisplayWidth; /* my copy of DisplayWidth(dpy, screen) */ 693e747e6dSmrg int MyDisplayHeight; /* my copy of DisplayHeight(dpy, screen) */ 703e747e6dSmrg int MaxWindowWidth; /* largest window to allow */ 713e747e6dSmrg int MaxWindowHeight; /* ditto */ 723e747e6dSmrg 733e747e6dSmrg TwmWindow TwmRoot; /* the head of the twm window list */ 743e747e6dSmrg 753e747e6dSmrg Window Root; /* the root window */ 763e747e6dSmrg Window SizeWindow; /* the resize dimensions window */ 773e747e6dSmrg Window InfoWindow; /* the information window */ 783e747e6dSmrg 793e747e6dSmrg name_list *Icons; /* list of icon pixmaps */ 803e747e6dSmrg TitlebarPixmaps tbpm; /* titlebar pixmaps */ 813e747e6dSmrg Pixmap UnknownPm; /* the unknown icon pixmap */ 823e747e6dSmrg Pixmap siconifyPm; /* the icon manager iconify pixmap */ 833e747e6dSmrg Pixmap pullPm; /* pull right menu icon */ 843e747e6dSmrg unsigned int pullW, pullH; /* size of pull right menu icon */ 853e747e6dSmrg Pixmap hilitePm; /* focus highlight window background */ 863e747e6dSmrg int hilite_pm_width, hilite_pm_height; /* cache the size */ 873e747e6dSmrg 883e747e6dSmrg MenuRoot *MenuList; /* head of the menu list */ 893e747e6dSmrg MenuRoot *LastMenu; /* the last menu (mostly unused?) */ 903e747e6dSmrg MenuRoot *Windows; /* the TwmWindows menu */ 913e747e6dSmrg 923e747e6dSmrg TwmWindow *Ring; /* one of the windows in window ring */ 933e747e6dSmrg TwmWindow *RingLeader; /* current winodw in ring */ 943e747e6dSmrg 953e747e6dSmrg MouseButton Mouse[MAX_BUTTONS+1][NUM_CONTEXTS][MOD_SIZE]; 963e747e6dSmrg MouseButton DefaultFunction; 973e747e6dSmrg MouseButton WindowFunction; 983e747e6dSmrg 993e747e6dSmrg struct { 1003e747e6dSmrg Colormaps *cmaps; /* current list of colormap windows */ 1013e747e6dSmrg int maxCmaps; /* maximum number of installed colormaps */ 1023e747e6dSmrg unsigned long first_req; /* seq # for first XInstallColormap() req in 1033e747e6dSmrg pass thru loading a colortable list */ 1043e747e6dSmrg int root_pushes; /* current push level to install root 1053e747e6dSmrg colormap windows */ 1063e747e6dSmrg TwmWindow *pushed_window; /* saved window to install when pushes drops 1073e747e6dSmrg to zero */ 1083e747e6dSmrg } cmapInfo; 1093e747e6dSmrg 1103e747e6dSmrg struct { 1113e747e6dSmrg StdCmap *head, *tail; /* list of maps */ 1123e747e6dSmrg StdCmap *mru; /* most recently used in list */ 1133e747e6dSmrg int mruindex; /* index of mru in entry */ 1143e747e6dSmrg } StdCmapInfo; 1153e747e6dSmrg 1163e747e6dSmrg struct { 1173e747e6dSmrg int nleft, nright; /* numbers of buttons in list */ 1183e747e6dSmrg TitleButton *head; /* start of list */ 1193e747e6dSmrg int border; /* button border */ 1203e747e6dSmrg int pad; /* button-padding */ 1213e747e6dSmrg int width; /* width of single button & border */ 1223e747e6dSmrg int leftx; /* start of left buttons */ 1233e747e6dSmrg int titlex; /* start of title string */ 1243e747e6dSmrg int rightoff; /* offset back from right edge */ 1253e747e6dSmrg } TBInfo; 1263e747e6dSmrg ColorPair BorderTileC; /* border tile colors */ 1273e747e6dSmrg ColorPair TitleC; /* titlebar colors */ 1283e747e6dSmrg ColorPair MenuC; /* menu colors */ 1293e747e6dSmrg ColorPair MenuTitleC; /* menu title colors */ 1303e747e6dSmrg ColorPair IconC; /* icon colors */ 1313e747e6dSmrg ColorPair IconManagerC; /* icon manager colors */ 1323e747e6dSmrg XColor PointerForeground; /* pointer foreground color */ 1333e747e6dSmrg XColor PointerBackground; /* pointer background color */ 1343e747e6dSmrg ColorPair DefaultC; /* default colors */ 1353e747e6dSmrg Pixel BorderColor; /* color of window borders */ 1363e747e6dSmrg Pixel MenuShadowColor; /* menu shadow color */ 1373e747e6dSmrg Pixel MenuBorderColor; /* menu border color */ 1383e747e6dSmrg Pixel IconBorderColor; /* icon border color */ 1393e747e6dSmrg Pixel IconManagerHighlight; /* icon manager highlight */ 1403e747e6dSmrg 1413e747e6dSmrg Cursor TitleCursor; /* title bar cursor */ 1423e747e6dSmrg Cursor FrameCursor; /* frame cursor */ 1433e747e6dSmrg Cursor IconCursor; /* icon cursor */ 1443e747e6dSmrg Cursor IconMgrCursor; /* icon manager cursor */ 1453e747e6dSmrg Cursor ButtonCursor; /* title bar button cursor */ 1463e747e6dSmrg Cursor MoveCursor; /* move cursor */ 1473e747e6dSmrg Cursor ResizeCursor; /* resize cursor */ 1483e747e6dSmrg Cursor WaitCursor; /* wait a while cursor */ 1493e747e6dSmrg Cursor MenuCursor; /* menu cursor */ 1503e747e6dSmrg Cursor SelectCursor; /* dot cursor for f.move, etc. from menus */ 1513e747e6dSmrg Cursor DestroyCursor; /* skull and cross bones, f.destroy */ 1523e747e6dSmrg 1533e747e6dSmrg name_list *BorderColorL; 1543e747e6dSmrg name_list *IconBorderColorL; 1553e747e6dSmrg name_list *BorderTileForegroundL; 1563e747e6dSmrg name_list *BorderTileBackgroundL; 1573e747e6dSmrg name_list *TitleForegroundL; 1583e747e6dSmrg name_list *TitleBackgroundL; 1593e747e6dSmrg name_list *IconForegroundL; 1603e747e6dSmrg name_list *IconBackgroundL; 1613e747e6dSmrg name_list *IconManagerFL; 1623e747e6dSmrg name_list *IconManagerBL; 1633e747e6dSmrg name_list *IconMgrs; 1643e747e6dSmrg name_list *NoTitle; /* list of window names with no title bar */ 1653e747e6dSmrg name_list *MakeTitle; /* list of window names with title bar */ 1663e747e6dSmrg name_list *AutoRaise; /* list of window names to auto-raise */ 1673e747e6dSmrg name_list *IconNames; /* list of window names and icon names */ 1683e747e6dSmrg name_list *NoHighlight; /* list of windows to not highlight */ 1693e747e6dSmrg name_list *NoStackModeL; /* windows to ignore stack mode requests */ 1703e747e6dSmrg name_list *NoTitleHighlight;/* list of windows to not highlight the TB*/ 1713e747e6dSmrg name_list *DontIconify; /* don't iconify by unmapping */ 1723e747e6dSmrg name_list *IconMgrNoShow; /* don't show in the icon manager */ 1733e747e6dSmrg name_list *IconMgrShow; /* show in the icon manager */ 1743e747e6dSmrg name_list *IconifyByUn; /* windows to iconify by unmapping */ 1753e747e6dSmrg name_list *StartIconified; /* windows to start iconic */ 1763e747e6dSmrg name_list *IconManagerHighlightL; /* icon manager highlight colors */ 1773e747e6dSmrg name_list *SqueezeTitleL; /* windows of which to squeeze title */ 1783e747e6dSmrg name_list *DontSqueezeTitleL; /* windows of which not to squeeze */ 1793e747e6dSmrg name_list *WindowRingL; /* windows in ring */ 1803e747e6dSmrg name_list *WarpCursorL; /* windows to warp cursor to on deiconify */ 1813e747e6dSmrg 1823e747e6dSmrg GC NormalGC; /* normal GC for everything */ 1833e747e6dSmrg GC MenuGC; /* gc for menus */ 1843e747e6dSmrg GC DrawGC; /* GC to draw lines for move and resize */ 1853e747e6dSmrg 1863e747e6dSmrg unsigned long Black; 1873e747e6dSmrg unsigned long White; 1883e747e6dSmrg unsigned long XORvalue; /* number to use when drawing xor'ed */ 1893e747e6dSmrg MyFont TitleBarFont; /* title bar font structure */ 1903e747e6dSmrg MyFont MenuFont; /* menu font structure */ 1913e747e6dSmrg MyFont IconFont; /* icon font structure */ 1923e747e6dSmrg MyFont SizeFont; /* resize font structure */ 1933e747e6dSmrg MyFont IconManagerFont; /* window list font structure */ 1943e747e6dSmrg MyFont DefaultFont; 1953e747e6dSmrg IconMgr iconmgr; /* default icon manager */ 1963e747e6dSmrg struct IconRegion *FirstRegion; /* pointer to icon regions */ 1973e747e6dSmrg struct IconRegion *LastRegion; /* pointer to the last icon region */ 1983e747e6dSmrg char *IconDirectory; /* icon directory to search */ 1993e747e6dSmrg int SizeStringOffset; /* x offset in size window for drawing */ 2003e747e6dSmrg int SizeStringWidth; /* minimum width of size window */ 2013e747e6dSmrg int BorderWidth; /* border width of twm windows */ 2023e747e6dSmrg int IconBorderWidth; /* border width of icon windows */ 2033e747e6dSmrg int MenuBorderWidth; /* border width of twm menus */ 2043e747e6dSmrg int UnknownWidth; /* width of the unknown icon */ 2053e747e6dSmrg int UnknownHeight; /* height of the unknown icon */ 2063e747e6dSmrg int TitleHeight; /* height of the title bar window */ 2073e747e6dSmrg TwmWindow *Focus; /* the twm window that has focus */ 2083e747e6dSmrg int EntryHeight; /* menu entry height */ 2093e747e6dSmrg int FramePadding; /* distance between decorations and border */ 2103e747e6dSmrg int TitlePadding; /* distance between items in titlebar */ 2113e747e6dSmrg int ButtonIndent; /* amount to shrink buttons on each side */ 2123e747e6dSmrg int NumAutoRaises; /* number of autoraise windows on screen */ 2133e747e6dSmrg short NoDefaults; /* do not add in default UI stuff */ 2143e747e6dSmrg short UsePPosition; /* what do with PPosition, see values below */ 2153e747e6dSmrg short AutoRelativeResize; /* start resize relative to position in quad */ 2163e747e6dSmrg short FocusRoot; /* is the input focus on the root ? */ 2173e747e6dSmrg short WarpCursor; /* warp cursor on de-iconify ? */ 2183e747e6dSmrg short ForceIcon; /* force the icon to the user specified */ 2193e747e6dSmrg short NoGrabServer; /* don't do server grabs */ 2203e747e6dSmrg short NoRaiseMove; /* don't raise window following move */ 2213e747e6dSmrg short NoRaiseResize; /* don't raise window following resize */ 2223e747e6dSmrg short NoRaiseDeicon; /* don't raise window on deiconify */ 2233e747e6dSmrg short NoRaiseWarp; /* don't raise window on warp */ 2243e747e6dSmrg short DontMoveOff; /* don't allow windows to be moved off */ 2253e747e6dSmrg short DoZoom; /* zoom in and out of icons */ 2263e747e6dSmrg short TitleFocus; /* focus on window in title bar ? */ 2273e747e6dSmrg short NoTitlebar; /* put title bars on windows */ 2283e747e6dSmrg short DecorateTransients; /* put title bars on transients */ 2293e747e6dSmrg short IconifyByUnmapping; /* simply unmap windows when iconifying */ 2303e747e6dSmrg short ShowIconManager; /* display the window list */ 2313e747e6dSmrg short IconManagerDontShow; /* show nothing in the icon manager */ 2323e747e6dSmrg short BackingStore; /* use backing store for menus */ 2333e747e6dSmrg short SaveUnder; /* use save under's for menus */ 2343e747e6dSmrg short RandomPlacement; /* randomly place windows that no give hints */ 2353e747e6dSmrg short OpaqueMove; /* move the window rather than outline */ 2363e747e6dSmrg short Highlight; /* should we highlight the window borders */ 2373e747e6dSmrg short StackMode; /* should we honor stack mode requests */ 2383e747e6dSmrg short TitleHighlight; /* should we highlight the titlebar */ 2393e747e6dSmrg short MoveDelta; /* number of pixels before f.move starts */ 2403e747e6dSmrg short ZoomCount; /* zoom outline count */ 2413e747e6dSmrg short SortIconMgr; /* sort entries in the icon manager */ 2423e747e6dSmrg short Shadow; /* show the menu shadow */ 2433e747e6dSmrg short InterpolateMenuColors;/* make pretty menus */ 2443e747e6dSmrg short NoIconManagers; /* Don't create any icon managers */ 2453e747e6dSmrg short ClientBorderWidth; /* respect client window border width */ 2463e747e6dSmrg short SqueezeTitle; /* make title as small as possible */ 2473e747e6dSmrg short HaveFonts; /* set if fonts have been loaded */ 2483e747e6dSmrg short FirstTime; /* first time we've read .twmrc */ 2493e747e6dSmrg short CaseSensitive; /* be case-sensitive when sorting names */ 2503e747e6dSmrg short WarpUnmapped; /* allow warping to unmapped windows */ 2513e747e6dSmrg 2523e747e6dSmrg FuncKey FuncKeyRoot; 2533e747e6dSmrg} ScreenInfo; 2543e747e6dSmrg 2553e747e6dSmrgextern int MultiScreen; 2563e747e6dSmrgextern int NumScreens; 2573e747e6dSmrgextern ScreenInfo **ScreenList; 2583e747e6dSmrgextern ScreenInfo *Scr; 2593e747e6dSmrgextern int FirstScreen; 2603e747e6dSmrg 2613e747e6dSmrg#define PPOS_OFF 0 2623e747e6dSmrg#define PPOS_ON 1 2633e747e6dSmrg#define PPOS_NON_ZERO 2 2643e747e6dSmrg/* may eventually want an option for having the PPosition be the initial 2653e747e6dSmrg location for the drag lines */ 2663e747e6dSmrg 2673e747e6dSmrg#endif /* _SCREEN_ */ 268