~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to hw/dmx/input/dmxdummy.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

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