VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.1.0/dmxinput.h@ 77938

Last change on this file since 77938 was 51223, checked in by vboxsync, 11 years ago

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • Property svn:eol-style set to native
File size: 6.7 KB
Line 
1/* $XFree86$ */
2/*
3 * Copyright 2001,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 * David H. Dawes <[email protected]>
32 * Kevin E. Martin <[email protected]>
33 * Rickard E. (Rik) Faith <[email protected]>
34 *
35 */
36
37/** \file
38 * This file provides access to:
39 * - global variables available to all hw/dmx routines, and
40 * - enumerations and typedefs needed by input routines in hw/dmx (and
41 * hw/dmx/input).
42 *
43 * The goal is that no files in hw/dmx should include header files from
44 * hw/dmx/input -- the interface defined here should be the only
45 * interface exported to the hw/dmx layer. \see input/dmxinputinit.c.
46 */
47
48#ifndef DMXINPUT_H
49#define DMXINPUT_H
50
51/** Maximum number of file descriptors for SIGIO handling */
52#define DMX_MAX_SIGIO_FDS 4
53
54struct _DMXInputInfo;
55
56/** Reason why window layout was updated. */
57typedef enum {
58 DMX_UPDATE_REALIZE, /**< Window realized */
59 DMX_UPDATE_UNREALIZE, /**< Window unrealized */
60 DMX_UPDATE_RESTACK, /**< Stacking order changed */
61 DMX_UPDATE_COPY, /**< Window copied */
62 DMX_UPDATE_RESIZE, /**< Window resized */
63 DMX_UPDATE_REPARENT /**< Window reparented */
64} DMXUpdateType;
65
66typedef void (*ProcessInputEventsProc)(struct _DMXInputInfo *);
67typedef void (*UpdateWindowInfoProc)(struct _DMXInputInfo *,
68 DMXUpdateType, WindowPtr);
69
70/** An opaque structure that is only exposed in the dmx/input layer. */
71typedef struct _DMXLocalInputInfo *DMXLocalInputInfoPtr;
72
73/** State of the SIGIO engine */
74typedef enum {
75 DMX_NOSIGIO = 0, /**< Device does not use SIGIO at all. */
76 DMX_USESIGIO, /**< Device can use SIGIO, but is not
77 * (e.g., because the VT is switch
78 * away). */
79 DMX_ACTIVESIGIO /**< Device is currently using SIGIO. */
80} dmxSigioState;
81
82/** DMXInputInfo is typedef'd in #dmx.h so that all routines can have
83 * access to the global pointers. However, the elements are only
84 * available to input-related routines. */
85struct _DMXInputInfo {
86 const char *name; /**< Name of input display or device
87 * (from command line or config
88 * file) */
89 Bool freename; /**< If true, free name on destroy */
90 Bool detached; /**< If true, input screen is detached */
91 int inputIdx; /**< Index into #dmxInputs global */
92 int scrnIdx; /**< Index into #dmxScreens global */
93 Bool core; /**< If True, initialize these
94 * devices as devices that send core
95 * events */
96 Bool console; /**< True if console and backend
97 * input share the same backend
98 * display */
99
100 Bool windows; /**< True if window outlines are
101 * draw in console */
102
103 ProcessInputEventsProc processInputEvents;
104 UpdateWindowInfoProc updateWindowInfo;
105
106 /* Local input information */
107 dmxSigioState sigioState; /**< Current stat */
108 int sigioFdCount; /**< Number of fds in use */
109 int sigioFd[DMX_MAX_SIGIO_FDS]; /**< List of fds */
110 Bool sigioAdded[DMX_MAX_SIGIO_FDS]; /**< Active fds */
111
112
113 /** True if a VT switch is pending, but has not yet happened. */
114 int vt_switch_pending;
115
116 /** True if a VT switch has happened. */
117 int vt_switched;
118
119 /** Number of devices handled in this _DMXInputInfo structure. */
120 int numDevs;
121
122 /** List of actual input devices. Each _DMXInputInfo structure can
123 * refer to more than one device. For example, the keyboard and the
124 * pointer of a backend display; or all of the XInput extension
125 * devices on a backend display. */
126 DMXLocalInputInfoPtr *devs;
127
128 char *keycodes; /**< XKB keycodes from command line */
129 char *symbols; /**< XKB symbols from command line */
130 char *geometry; /**< XKB geometry from command line */
131};
132
133extern int dmxNumInputs; /**< Number of #dmxInputs */
134extern DMXInputInfo *dmxInputs; /**< List of inputs */
135
136extern void dmxInputInit(DMXInputInfo *dmxInput);
137extern void dmxInputReInit(DMXInputInfo *dmxInput);
138extern void dmxInputLateReInit(DMXInputInfo *dmxInput);
139extern void dmxInputFree(DMXInputInfo *dmxInput);
140extern void dmxInputLogDevices(void);
141extern void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow);
142
143/* These functions are defined in input/dmxeq.c */
144extern Bool dmxeqInitialized(void);
145extern void dmxeqEnqueue(xEvent *e);
146extern void dmxeqSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
147
148/* This type is used in input/dmxevents.c. Also, these functions are
149 * defined in input/dmxevents.c */
150typedef enum {
151 DMX_NO_BLOCK = 0,
152 DMX_BLOCK = 1
153} DMXBlockType;
154
155extern void dmxGetGlobalPosition(int *x, int *y);
156extern DMXScreenInfo *dmxFindFirstScreen(int x, int y);
157extern void dmxCoreMotion(int x, int y, int delta,
158 DMXBlockType block);
159
160/* Support for dynamic addition of inputs. This functions is defined in
161 * config/dmxconfig.c */
162extern DMXInputInfo *dmxConfigAddInput(const char *name, int core);
163#endif /* DMXINPUT_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette