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