1 /************************************************************ 2 3 Copyright (c) 1987 X Consortium 4 5 Permission is hereby granted, free of charge, to any person obtaining a copy 6 of this software and associated documentation files (the "Software"), to deal 7 in the Software without restriction, including without limitation the rights 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 copies of the Software, and to permit persons to whom the Software is 10 furnished to do so, subject to the following conditions: 11 12 The above copyright notice and this permission notice shall be included in 13 all copies or substantial portions of the Software. 14 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 22 Except as contained in this notice, the name of the X Consortium shall not be 23 used in advertising or otherwise to promote the sale, use or other dealings 24 in this Software without prior written authorization from the X Consortium. 25 26 27 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. 28 29 All Rights Reserved 30 31 Permission to use, copy, modify, and distribute this software and its 32 documentation for any purpose and without fee is hereby granted, 33 provided that the above copyright notice appear in all copies and that 34 both that copyright notice and this permission notice appear in 35 supporting documentation, and that the name of Digital not be 36 used in advertising or publicity pertaining to distribution of the 37 software without specific, written prior permission. 38 39 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 40 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 41 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 42 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 43 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 44 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 45 SOFTWARE. 46 47 ********************************************************/ 48 49 /* $XConsortium: globals.c,v 1.53 94/04/17 20:26:37 rws Exp $ */ 50 51 52 53 54 55 /* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.2.2.1 1997/06/01 12:33:21 dawes Exp $ */ 56 57 #include "X.h" 58 #include "Xmd.h" 59 #include "misc.h" 60 #include "windowstr.h" 61 #include "scrnintstr.h" 62 #include "input.h" 63 #include "dixfont.h" 64 #include "site.h" 65 #include "dixstruct.h" 66 #include "os.h" 67 68 ScreenInfo screenInfo; 69 KeybdCtrl defaultKeyboardControl = { 70 DEFAULT_KEYBOARD_CLICK, 71 DEFAULT_BELL, 72 DEFAULT_BELL_PITCH, 73 DEFAULT_BELL_DURATION, 74 DEFAULT_AUTOREPEAT, 75 DEFAULT_AUTOREPEATS, 76 DEFAULT_LEDS, 77 0}; 78 79 PtrCtrl defaultPointerControl = { 80 DEFAULT_PTR_NUMERATOR, 81 DEFAULT_PTR_DENOMINATOR, 82 DEFAULT_PTR_THRESHOLD, 83 0}; 84 85 ClientPtr *clients; 86 ClientPtr serverClient; 87 int currentMaxClients; /* current size of clients array */ 88 89 WindowPtr *WindowTable; 90 91 unsigned long globalSerialNumber = 0; 92 unsigned long serverGeneration = 0; 93 94 /* these next four are initialized in main.c */ 95 CARD32 ScreenSaverTime; 96 CARD32 ScreenSaverInterval; 97 int ScreenSaverBlanking; 98 int ScreenSaverAllowExposures; 99 100 #ifdef DPMSExtension 101 #define DEFAULT_STANDBY_TIME DEFAULT_SCREEN_SAVER_TIME * 2 102 #define DEFAULT_SUSPEND_TIME DEFAULT_SCREEN_SAVER_TIME * 3 103 #define DEFAULT_OFF_TIME DEFAULT_SCREEN_SAVER_TIME * 4 104 CARD32 defaultDPMSStandbyTime = DEFAULT_STANDBY_TIME; 105 CARD32 defaultDPMSSuspendTime = DEFAULT_SUSPEND_TIME; 106 CARD32 defaultDPMSOffTime = DEFAULT_OFF_TIME; 107 CARD16 DPMSPowerLevel = 0; 108 Bool defaultDPMSEnabled = FALSE; 109 Bool DPMSEnabledSwitch = FALSE; /* these denote the DPMS command line */ 110 Bool DPMSDisabledSwitch = FALSE; /* switch states */ 111 Bool DPMSCapableFlag = FALSE; 112 CARD32 DPMSStandbyTime; 113 CARD32 DPMSSuspendTime; 114 CARD32 DPMSOffTime; 115 Bool DPMSEnabled; 116 #endif 117 118 CARD32 defaultScreenSaverTime = DEFAULT_SCREEN_SAVER_TIME; 119 CARD32 defaultScreenSaverInterval = DEFAULT_SCREEN_SAVER_INTERVAL; 120 int defaultScreenSaverBlanking = DEFAULT_SCREEN_SAVER_BLANKING; 121 int defaultScreenSaverAllowExposures = DEFAULT_SCREEN_SAVER_EXPOSURES; 122 #ifndef NOLOGOHACK 123 int logoScreenSaver = DEFAULT_LOGO_SCREEN_SAVER; 124 #endif 125 126 char *defaultFontPath = COMPILEDDEFAULTFONTPATH; 127 char *defaultTextFont = COMPILEDDEFAULTFONT; 128 char *defaultCursorFont = COMPILEDCURSORFONT; 129 char *rgbPath = RGB_DB; 130 char *defaultDisplayClass = COMPILEDDISPLAYCLASS; 131 FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in 132 every compilation of dix code */ 133 CursorPtr rootCursor; 134 ClientPtr requestingClient; /* XXX this should be obsolete now, remove? */ 135 136 TimeStamp currentTime; 137 TimeStamp lastDeviceEventTime; 138 139 Bool permitOldBugs = FALSE; /* turn off some error checking, to permit certain 140 * old broken clients (like R2/R3 xterms) to work 141 */ 142 143 int defaultColorVisualClass = -1; 144 int monitorResolution = 0; 145 146 char *display; 147 148 CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND; 149 int argcGlobal; 150 char **argvGlobal; 151