xref: /OK3568_Linux_fs/external/xserver/hw/dmx/input/dmxdummy.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright 2002 Red Hat Inc., Durham, North Carolina.
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * All Rights Reserved.
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining
7*4882a593Smuzhiyun  * a copy of this software and associated documentation files (the
8*4882a593Smuzhiyun  * "Software"), to deal in the Software without restriction, including
9*4882a593Smuzhiyun  * without limitation on the rights to use, copy, modify, merge,
10*4882a593Smuzhiyun  * publish, distribute, sublicense, and/or sell copies of the Software,
11*4882a593Smuzhiyun  * and to permit persons to whom the Software is furnished to do so,
12*4882a593Smuzhiyun  * subject to the following conditions:
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  * The above copyright notice and this permission notice (including the
15*4882a593Smuzhiyun  * next paragraph) shall be included in all copies or substantial
16*4882a593Smuzhiyun  * portions of the Software.
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19*4882a593Smuzhiyun  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20*4882a593Smuzhiyun  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21*4882a593Smuzhiyun  * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22*4882a593Smuzhiyun  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23*4882a593Smuzhiyun  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24*4882a593Smuzhiyun  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25*4882a593Smuzhiyun  * SOFTWARE.
26*4882a593Smuzhiyun  */
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun /*
29*4882a593Smuzhiyun  * Authors:
30*4882a593Smuzhiyun  *   Rickard E. (Rik) Faith <faith@redhat.com>
31*4882a593Smuzhiyun  *
32*4882a593Smuzhiyun  */
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun /** \file
35*4882a593Smuzhiyun  * Provide mouse and keyboard that are sufficient for starting the X
36*4882a593Smuzhiyun  * server, but that don't actually provide any events.  This is useful
37*4882a593Smuzhiyun  * for testing. */
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun #ifdef HAVE_DMX_CONFIG_H
40*4882a593Smuzhiyun #include <dmx-config.h>
41*4882a593Smuzhiyun #endif
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun #include "dmx.h"
44*4882a593Smuzhiyun #include "dmxinputinit.h"
45*4882a593Smuzhiyun #include "dmxdummy.h"
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun /** Return information about the dummy keyboard device specified in \a pDev
48*4882a593Smuzhiyun  * into the structure pointed to by \a info.  The keyboard is set up to
49*4882a593Smuzhiyun  * have 1 valid key code that is \a NoSymbol */
50*4882a593Smuzhiyun void
dmxDummyKbdGetInfo(DevicePtr pDev,DMXLocalInitInfoPtr info)51*4882a593Smuzhiyun dmxDummyKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
52*4882a593Smuzhiyun {
53*4882a593Smuzhiyun     static KeySym keyboard_mapping = NoSymbol;
54*4882a593Smuzhiyun 
55*4882a593Smuzhiyun     info->keyboard = 1;
56*4882a593Smuzhiyun     info->keyClass = 1;
57*4882a593Smuzhiyun     info->keySyms.minKeyCode = 8;
58*4882a593Smuzhiyun     info->keySyms.maxKeyCode = 8;
59*4882a593Smuzhiyun     info->keySyms.mapWidth = 1;
60*4882a593Smuzhiyun     info->keySyms.map = &keyboard_mapping;
61*4882a593Smuzhiyun     info->freemap = 0;
62*4882a593Smuzhiyun     info->focusClass = 1;
63*4882a593Smuzhiyun     info->kbdFeedbackClass = 1;
64*4882a593Smuzhiyun     info->force = 1;
65*4882a593Smuzhiyun }
66*4882a593Smuzhiyun 
67*4882a593Smuzhiyun /** Return information about the dummy mouse device specified in \a pDev
68*4882a593Smuzhiyun  * into the structure pointed to by \a info.  They mouse has 3 buttons
69*4882a593Smuzhiyun  * and two axes. */
70*4882a593Smuzhiyun void
dmxDummyMouGetInfo(DevicePtr pDev,DMXLocalInitInfoPtr info)71*4882a593Smuzhiyun dmxDummyMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
72*4882a593Smuzhiyun {
73*4882a593Smuzhiyun     info->buttonClass = 1;
74*4882a593Smuzhiyun     info->numButtons = 3;
75*4882a593Smuzhiyun     info->map[0] = 1;
76*4882a593Smuzhiyun     info->map[1] = 2;
77*4882a593Smuzhiyun     info->map[2] = 3;
78*4882a593Smuzhiyun     info->valuatorClass = 1;
79*4882a593Smuzhiyun     info->numRelAxes = 2;
80*4882a593Smuzhiyun     info->minval[0] = 0;
81*4882a593Smuzhiyun     info->minval[1] = 0;
82*4882a593Smuzhiyun     info->maxval[0] = 0;
83*4882a593Smuzhiyun     info->maxval[1] = 0;
84*4882a593Smuzhiyun     info->res[0] = 1;
85*4882a593Smuzhiyun     info->minres[0] = 0;
86*4882a593Smuzhiyun     info->maxres[0] = 1;
87*4882a593Smuzhiyun     info->ptrFeedbackClass = 1;
88*4882a593Smuzhiyun }
89