1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
3*4882a593Smuzhiyun *Copyright (C) Colin Harrison 2005-2008
4*4882a593Smuzhiyun *
5*4882a593Smuzhiyun *Permission is hereby granted, free of charge, to any person obtaining
6*4882a593Smuzhiyun * a copy of this software and associated documentation files (the
7*4882a593Smuzhiyun *"Software"), to deal in the Software without restriction, including
8*4882a593Smuzhiyun *without limitation the rights to use, copy, modify, merge, publish,
9*4882a593Smuzhiyun *distribute, sublicense, and/or sell copies of the Software, and to
10*4882a593Smuzhiyun *permit persons to whom the Software is furnished to do so, subject to
11*4882a593Smuzhiyun *the following conditions:
12*4882a593Smuzhiyun *
13*4882a593Smuzhiyun *The above copyright notice and this permission notice shall be
14*4882a593Smuzhiyun *included in all copies or substantial portions of the Software.
15*4882a593Smuzhiyun *
16*4882a593Smuzhiyun *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17*4882a593Smuzhiyun *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18*4882a593Smuzhiyun *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19*4882a593Smuzhiyun *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
20*4882a593Smuzhiyun *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21*4882a593Smuzhiyun *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22*4882a593Smuzhiyun *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23*4882a593Smuzhiyun *
24*4882a593Smuzhiyun *Except as contained in this notice, the name of Harold L Hunt II
25*4882a593Smuzhiyun *shall not be used in advertising or otherwise to promote the sale, use
26*4882a593Smuzhiyun *or other dealings in this Software without prior written authorization
27*4882a593Smuzhiyun *from Harold L Hunt II.
28*4882a593Smuzhiyun *
29*4882a593Smuzhiyun * Authors: Harold L Hunt II
30*4882a593Smuzhiyun * Colin Harrison
31*4882a593Smuzhiyun */
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun #ifdef HAVE_XWIN_CONFIG_H
34*4882a593Smuzhiyun #include <xwin-config.h>
35*4882a593Smuzhiyun #endif
36*4882a593Smuzhiyun #include "win.h"
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun /*
39*4882a593Smuzhiyun * General global variables
40*4882a593Smuzhiyun */
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun int g_iNumScreens = 0;
43*4882a593Smuzhiyun winScreenInfo *g_ScreenInfo = 0;
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun #ifdef HAS_DEVWINDOWS
46*4882a593Smuzhiyun int g_fdMessageQueue = WIN_FD_INVALID;
47*4882a593Smuzhiyun #endif
48*4882a593Smuzhiyun DevPrivateKeyRec g_iScreenPrivateKeyRec;
49*4882a593Smuzhiyun DevPrivateKeyRec g_iCmapPrivateKeyRec;
50*4882a593Smuzhiyun DevPrivateKeyRec g_iGCPrivateKeyRec;
51*4882a593Smuzhiyun DevPrivateKeyRec g_iPixmapPrivateKeyRec;
52*4882a593Smuzhiyun DevPrivateKeyRec g_iWindowPrivateKeyRec;
53*4882a593Smuzhiyun unsigned long g_ulServerGeneration = 0;
54*4882a593Smuzhiyun DWORD g_dwEnginesSupported = 0;
55*4882a593Smuzhiyun HINSTANCE g_hInstance = 0;
56*4882a593Smuzhiyun HWND g_hDlgDepthChange = NULL;
57*4882a593Smuzhiyun HWND g_hDlgExit = NULL;
58*4882a593Smuzhiyun HWND g_hDlgAbout = NULL;
59*4882a593Smuzhiyun const char *g_pszQueryHost = NULL;
60*4882a593Smuzhiyun Bool g_fXdmcpEnabled = FALSE;
61*4882a593Smuzhiyun Bool g_fAuthEnabled = FALSE;
62*4882a593Smuzhiyun HICON g_hIconX = NULL;
63*4882a593Smuzhiyun HICON g_hSmallIconX = NULL;
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun #ifndef RELOCATE_PROJECTROOT
66*4882a593Smuzhiyun const char *g_pszLogFile = DEFAULT_LOGDIR "/XWin.%s.log";
67*4882a593Smuzhiyun #else
68*4882a593Smuzhiyun const char *g_pszLogFile = "XWin.log";
69*4882a593Smuzhiyun Bool g_fLogFileChanged = FALSE;
70*4882a593Smuzhiyun #endif
71*4882a593Smuzhiyun int g_iLogVerbose = 2;
72*4882a593Smuzhiyun Bool g_fLogInited = FALSE;
73*4882a593Smuzhiyun char *g_pszCommandLine = NULL;
74*4882a593Smuzhiyun Bool g_fSilentFatalError = FALSE;
75*4882a593Smuzhiyun DWORD g_dwCurrentThreadID = 0;
76*4882a593Smuzhiyun Bool g_fKeyboardHookLL = FALSE;
77*4882a593Smuzhiyun Bool g_fNoHelpMessageBox = FALSE;
78*4882a593Smuzhiyun Bool g_fSoftwareCursor = FALSE;
79*4882a593Smuzhiyun Bool g_fNativeGl = TRUE;
80*4882a593Smuzhiyun Bool g_fHostInTitle = TRUE;
81*4882a593Smuzhiyun pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER;
82*4882a593Smuzhiyun
83*4882a593Smuzhiyun /*
84*4882a593Smuzhiyun * Wrapped DIX functions
85*4882a593Smuzhiyun */
86*4882a593Smuzhiyun winDispatchProcPtr winProcEstablishConnectionOrig = NULL;
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun /*
89*4882a593Smuzhiyun * Clipboard variables
90*4882a593Smuzhiyun */
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun Bool g_fUnicodeClipboard = TRUE;
93*4882a593Smuzhiyun Bool g_fClipboard = TRUE;
94*4882a593Smuzhiyun Bool g_fClipboardStarted = FALSE;
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun /*
97*4882a593Smuzhiyun * Re-initialize global variables that are invalidated
98*4882a593Smuzhiyun * by a server reset.
99*4882a593Smuzhiyun */
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun void
winInitializeGlobals(void)102*4882a593Smuzhiyun winInitializeGlobals(void)
103*4882a593Smuzhiyun {
104*4882a593Smuzhiyun g_dwCurrentThreadID = GetCurrentThreadId();
105*4882a593Smuzhiyun }
106