3 Copyright 1993, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included
12 in all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the name of The Open Group shall
23 not be used in advertising or otherwise to promote the sale, use or
24 other dealings in this Software without prior written authorization
29 #ifdef HAVE_XWIN_CONFIG_H
30 #include <xwin-config.h>
33 #include "dixstruct.h"
37 * Local function prototypes
41 int winProcEstablishConnection(ClientPtr
/* client */ );
42 int winProcSetSelectionOwner(ClientPtr
/* client */ );
46 * Local global declarations
49 DeviceIntPtr g_pwinPointer
;
50 DeviceIntPtr g_pwinKeyboard
;
52 /* Called from dix/devices.c */
54 * All of our keys generate up and down transition notifications,
55 * so all of our keys can be used as modifiers.
57 * An example of a modifier is mapping the A key to the Control key.
58 * A has to be a legal modifier. I think.
62 LegalModifier(unsigned int uiKey
, DeviceIntPtr pDevice
)
67 /* Called from dix/dispatch.c */
69 * Run through the Windows message queue(s) one more time.
70 * Tell mi to dequeue the events that we have sent it.
73 ProcessInputEvents(void)
76 ErrorF("ProcessInputEvents\n");
79 mieqProcessInputEvents();
82 ErrorF("ProcessInputEvents - returning\n");
87 DDXRingBell(int volume
, int pitch
, int duration
)
89 /* winKeybdBell is used instead */
93 /* See Porting Layer Definition - p. 17 */
95 InitInput(int argc
, char *argv
[])
98 winDebug("InitInput\n");
101 #ifdef XWIN_CLIPBOARD
103 * Wrap some functions at every generation of the server.
105 if (InitialVector
[2] != winProcEstablishConnection
) {
106 winProcEstablishConnectionOrig
= InitialVector
[2];
107 InitialVector
[2] = winProcEstablishConnection
;
111 g_pwinPointer
= AddInputDevice(serverClient
, winMouseProc
, TRUE
);
112 g_pwinKeyboard
= AddInputDevice(serverClient
, winKeybdProc
, TRUE
);
113 g_pwinPointer
->name
= strdup("Windows mouse");
114 g_pwinKeyboard
->name
= strdup("Windows keyboard");
118 /* Initialize the mode key states */
119 winInitializeModeKeyStates();
121 #ifdef HAS_DEVWINDOWS
122 /* Only open the windows message queue device once */
123 if (g_fdMessageQueue
== WIN_FD_INVALID
) {
124 /* Open a file descriptor for the Windows message queue */
125 g_fdMessageQueue
= open(WIN_MSG_QUEUE_FNAME
, O_RDONLY
);
127 if (g_fdMessageQueue
== -1) {
128 FatalError("InitInput - Failed opening %s\n", WIN_MSG_QUEUE_FNAME
);
131 /* Add the message queue as a device to wait for in WaitForSomething */
132 AddEnabledDevice(g_fdMessageQueue
);
137 winDebug("InitInput - returning\n");