globals.c 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /************************************************************
  2. Copyright 1987, 1998 The Open Group
  3. Permission to use, copy, modify, distribute, and sell this software and its
  4. documentation for any purpose is hereby granted without fee, provided that
  5. the above copyright notice appear in all copies and that both that
  6. copyright notice and this permission notice appear in supporting
  7. documentation.
  8. The above copyright notice and this permission notice shall be included in
  9. all copies or substantial portions of the Software.
  10. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  14. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  15. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  16. Except as contained in this notice, the name of The Open Group shall not be
  17. used in advertising or otherwise to promote the sale, use or other dealings
  18. in this Software without prior written authorization from The Open Group.
  19. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  20. All Rights Reserved
  21. Permission to use, copy, modify, and distribute this software and its
  22. documentation for any purpose and without fee is hereby granted,
  23. provided that the above copyright notice appear in all copies and that
  24. both that copyright notice and this permission notice appear in
  25. supporting documentation, and that the name of Digital not be
  26. used in advertising or publicity pertaining to distribution of the
  27. software without specific, written prior permission.
  28. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  29. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  30. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  31. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  32. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  33. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  34. SOFTWARE.
  35. ********************************************************/
  36. #ifdef HAVE_DIX_CONFIG_H
  37. #include <dix-config.h>
  38. #endif
  39. #include <X11/X.h>
  40. #include <X11/Xmd.h>
  41. #include "misc.h"
  42. #include "windowstr.h"
  43. #include "scrnintstr.h"
  44. #include "input.h"
  45. #include "dixfont.h"
  46. #include "site.h"
  47. #include "dixstruct.h"
  48. #include "os.h"
  49. _X_EXPORT ScreenInfo screenInfo;
  50. KeybdCtrl defaultKeyboardControl = {
  51. DEFAULT_KEYBOARD_CLICK,
  52. DEFAULT_BELL,
  53. DEFAULT_BELL_PITCH,
  54. DEFAULT_BELL_DURATION,
  55. DEFAULT_AUTOREPEAT,
  56. DEFAULT_AUTOREPEATS,
  57. DEFAULT_LEDS,
  58. 0
  59. };
  60. PtrCtrl defaultPointerControl = {
  61. DEFAULT_PTR_NUMERATOR,
  62. DEFAULT_PTR_DENOMINATOR,
  63. DEFAULT_PTR_THRESHOLD,
  64. 0
  65. };
  66. _X_EXPORT ClientPtr clients[MAXCLIENTS];
  67. _X_EXPORT XFONT_LTO_VAR ClientPtr serverClient;
  68. _X_EXPORT int currentMaxClients; /* current size of clients array */
  69. _X_EXPORT long maxBigRequestSize = MAX_BIG_REQUEST_SIZE;
  70. _X_EXPORT WindowPtr WindowTable[MAXSCREENS];
  71. _X_EXPORT unsigned long globalSerialNumber = 0;
  72. _X_EXPORT XFONT_LTO_VAR unsigned long serverGeneration = 0;
  73. /* these next four are initialized in main.c */
  74. _X_EXPORT CARD32 ScreenSaverTime;
  75. CARD32 ScreenSaverInterval;
  76. _X_EXPORT int ScreenSaverBlanking;
  77. int ScreenSaverAllowExposures;
  78. #ifdef DPMSExtension
  79. # ifndef DEFAULT_STANDBY_TIME
  80. # define DEFAULT_STANDBY_TIME DEFAULT_SCREEN_SAVER_TIME * 2
  81. # endif
  82. # ifndef DEFAULT_SUSPEND_TIME
  83. # define DEFAULT_SUSPEND_TIME DEFAULT_SCREEN_SAVER_TIME * 3
  84. # endif
  85. # ifndef DEFAULT_OFF_TIME
  86. # define DEFAULT_OFF_TIME DEFAULT_SCREEN_SAVER_TIME * 4
  87. # endif
  88. # ifndef DEFAULT_DPMS_ENABLED
  89. # define DEFAULT_DPMS_ENABLED TRUE
  90. # endif
  91. _X_EXPORT CARD16 DPMSPowerLevel = 0;
  92. _X_EXPORT Bool DPMSEnabledSwitch = FALSE; /* these denote the DPMS command */
  93. _X_EXPORT Bool DPMSDisabledSwitch = FALSE; /* lind switch states */
  94. _X_EXPORT Bool DPMSCapableFlag = FALSE;
  95. _X_EXPORT CARD32 DPMSStandbyTime;
  96. _X_EXPORT CARD32 DPMSSuspendTime;
  97. _X_EXPORT CARD32 DPMSOffTime;
  98. _X_EXPORT Bool DPMSEnabled;
  99. #endif
  100. CARD32 defaultScreenSaverTime = DEFAULT_SCREEN_SAVER_TIME;
  101. CARD32 defaultScreenSaverInterval = DEFAULT_SCREEN_SAVER_INTERVAL;
  102. int defaultScreenSaverBlanking = DEFAULT_SCREEN_SAVER_BLANKING;
  103. int defaultScreenSaverAllowExposures = DEFAULT_SCREEN_SAVER_EXPOSURES;
  104. #ifndef NOLOGOHACK
  105. int logoScreenSaver = DEFAULT_LOGO_SCREEN_SAVER;
  106. #endif
  107. #ifdef SCREENSAVER
  108. Bool screenSaverSuspended = FALSE;
  109. #endif
  110. char *defaultFontPath = COMPILEDDEFAULTFONTPATH;
  111. char *defaultTextFont = COMPILEDDEFAULTFONT;
  112. char *defaultCursorFont = COMPILEDCURSORFONT;
  113. char *defaultDisplayClass = COMPILEDDISPLAYCLASS;
  114. FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in
  115. every compilation of dix code */
  116. CursorPtr rootCursor;
  117. Bool blackRoot = FALSE;
  118. Bool whiteRoot = FALSE;
  119. ClientPtr requestingClient; /* XXX this should be obsolete now, remove? */
  120. _X_EXPORT TimeStamp currentTime;
  121. _X_EXPORT TimeStamp lastDeviceEventTime;
  122. _X_EXPORT int defaultColorVisualClass = -1;
  123. _X_EXPORT int monitorResolution = 0;
  124. _X_EXPORT char *display;
  125. CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND;
  126. DDXPointRec dixScreenOrigins[MAXSCREENS];