summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/dmx/input/dmxinputinit.h
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/dmx/input/dmxinputinit.h')
-rw-r--r--xc/programs/Xserver/hw/dmx/input/dmxinputinit.h142
1 files changed, 142 insertions, 0 deletions
diff --git a/xc/programs/Xserver/hw/dmx/input/dmxinputinit.h b/xc/programs/Xserver/hw/dmx/input/dmxinputinit.h
new file mode 100644
index 000000000..596a0267e
--- /dev/null
+++ b/xc/programs/Xserver/hw/dmx/input/dmxinputinit.h
@@ -0,0 +1,142 @@
+/* $XFree86$ */
+/*
+ * Copyright 2002 Red Hat Inc., Durham, North Carolina.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+#ifndef _DMXINPUTINIT_H_
+#define _DMXINPUTINIT_H_
+
+#include "dmx.h"
+#include "dmxinput.h"
+#include "dmxlog.h"
+
+#define DMX_LOCAL_DEFAULT_KEYBOARD "kbd"
+#define DMX_LOCAL_DEFAULT_POINTER "ps2"
+
+typedef enum {
+ DMX_FUNCTION_GRAB,
+ DMX_FUNCTION_TERMINATE,
+ DMX_FUNCTION_FINE
+} DMXFunctionType;
+
+ /* Generic -- high-level */
+typedef pointer (*dmxCreateGenPrivateProcPtr)(DMXInputInfo *);
+typedef void (*dmxDestroyGenPrivateProcPtr)(pointer);
+typedef void (*dmxInitializeProcPtr)(pointer);
+typedef void (*dmxEnableDeviceProcPtr)(pointer);
+typedef void (*dmxCollectEventsProcPtr)(pointer);
+typedef void (*dmxProcessInputProcPtr)(pointer);
+typedef int (*dmxFunctionsProcPtr)(pointer, DMXFunctionType);
+typedef void (*dmxUpdatePositionProcPtr)(pointer, int x, int y);
+
+ /* Low-level */
+typedef pointer (*dmxCreatePrivateProcPtr)(DeviceIntPtr);
+typedef void (*dmxDestroyPrivateProcPtr)(pointer);
+
+typedef void (*dmxInitProcPtr)(DevicePtr);
+typedef int (*dmxOnProcPtr)(DevicePtr);
+typedef void (*dmxOffProcPtr)(DevicePtr);
+
+typedef void (*dmxVTPreSwitchProcPtr)(pointer); /* Turn I/O Off */
+typedef void (*dmxVTPostSwitchProcPtr)(pointer); /* Turn I/O On */
+typedef void (*dmxVTSwitchReturnProcPtr)(pointer);
+typedef int (*dmxVTSwitchProcPtr)(pointer, int vt,
+ dmxVTSwitchReturnProcPtr, pointer);
+
+typedef void (*dmxEnqueueProcPtr)(xEvent *);
+typedef void (*dmxMotionProcPtr)(int x, int y, int relative);
+typedef int (*dmxCheckSpecialProcPtr)(pointer,
+ xEvent *, KeySym, unsigned short);
+typedef void (*dmxKBReadProcPtr)(pointer,
+ dmxEnqueueProcPtr,
+ dmxCheckSpecialProcPtr,
+ pointer);
+typedef void (*dmxMReadProcPtr)(pointer, dmxEnqueueProcPtr,
+ dmxMotionProcPtr);
+
+typedef pointer (*dmxGetkbmapProcPtr)(DevicePtr, KeySymsPtr, CARD8 *);
+typedef void (*dmxGetmmapProcPtr)(DevicePtr, unsigned char *, int *);
+
+typedef void (*dmxKBCtrlProcPtr)(DevicePtr, KeybdCtrl *ctrl);
+typedef void (*dmxMCtrlProcPtr)(DevicePtr, PtrCtrl *ctrl);
+
+typedef void (*dmxKBBellProcPtr)(DevicePtr, int percent,
+ int volume, int pitch, int duration);
+
+typedef enum {
+ DMX_LOCAL_HIGHLEVEL,
+ DMX_LOCAL_KEYBOARD,
+ DMX_LOCAL_MOUSE,
+ DMX_LOCAL_OTHER
+} DMXLocalInputType;
+
+typedef struct _DMXLocalInputInfo {
+ const char *name;
+ DMXLocalInputType type;
+
+ /* Low-level (e.g., keyboard/mouse drivers) */
+ dmxCreatePrivateProcPtr create_private;
+ dmxDestroyPrivateProcPtr destroy_private;
+ dmxInitProcPtr init;
+ dmxOnProcPtr on;
+ dmxOffProcPtr off;
+ dmxUpdatePositionProcPtr update_position;
+ dmxVTPreSwitchProcPtr vt_pre_switch;
+ dmxVTPostSwitchProcPtr vt_post_switch;
+ dmxVTSwitchProcPtr vt_switch;
+
+ dmxMReadProcPtr mRead;
+ dmxGetmmapProcPtr mGetmap;
+ dmxMCtrlProcPtr mCtrl;
+
+ dmxKBReadProcPtr kRead;
+ dmxGetkbmapProcPtr kGetmap;
+ dmxKBCtrlProcPtr kCtrl;
+ dmxKBBellProcPtr kBell;
+
+ /* High-level (e.g., X server proxy) */
+ dmxCreateGenPrivateProcPtr create_gen_private;
+ dmxDestroyGenPrivateProcPtr destroy_gen_private;
+ dmxInitializeProcPtr initialize;
+ dmxEnableDeviceProcPtr enable_device;
+ dmxCollectEventsProcPtr collect_events;
+ dmxProcessInputProcPtr process_input;
+ dmxFunctionsProcPtr functions;
+
+ pointer private;
+ KeybdCtrl kctrl;
+ PtrCtrl mctrl;
+} DMXLocalInputInfoRec;
+
+extern void dmxLocalInitInput(DMXInputInfo *dmxInput);
+
+#endif