diff options
author | Ben Byer <bbyer@bushing.apple.com> | 2008-03-25 19:25:00 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-03-27 19:14:50 -0700 |
commit | c1d37efe9aae5f2895b3437418f7e4bb2eb3400f (patch) | |
tree | c0c33ea4ef1ab25bcf981a44a655668e141bc236 | |
parent | c4a616a741e15865ce0ff98781c6f1dca4d62887 (diff) |
xquartz: copy in new stubs from Xi/stubs.c to replace our old
Xinput stubs. Hey, it's a start.
(cherry picked from commit 566412b4aece24ae6af8c7c835986b685aa456a2)
-rw-r--r-- | hw/xquartz/darwinXinput.c | 186 |
1 files changed, 59 insertions, 127 deletions
diff --git a/hw/xquartz/darwinXinput.c b/hw/xquartz/darwinXinput.c index e62ec0ab6..50ba656f8 100644 --- a/hw/xquartz/darwinXinput.c +++ b/hw/xquartz/darwinXinput.c @@ -1,8 +1,7 @@ - /* - * X server support of the XINPUT extension for Darwin + * X server support of the XINPUT extension for xquartz * - * This is currently a copy of mi/stubs.c, but eventually this + * This is currently a copy of Xi/stubs.c, but eventually this * should include more complete XINPUT support. */ @@ -52,100 +51,17 @@ SOFTWARE. ********************************************************/ +#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif -#define NEED_EVENTS #include <X11/X.h> #include <X11/Xproto.h> #include "inputstr.h" #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" -#include "chgkbd.h" - -/*********************************************************************** - * - * Caller: ProcXChangeKeyboardDevice - * - * This procedure does the implementation-dependent portion of the work - * needed to change the keyboard device. - * - * The X keyboard device has a FocusRec. If the device that has been - * made into the new X keyboard did not have a FocusRec, - * ProcXChangeKeyboardDevice will allocate one for it. - * - * If you do not want clients to be able to focus the old X keyboard - * device, call DeleteFocusClassDeviceStruct to free the FocusRec. - * - * If you support input devices with keys that you do not want to be - * used as the X keyboard, you need to check for them here and return - * a BadDevice error. - * - * The default implementation is to do nothing (assume you do want - * clients to be able to focus the old X keyboard). The commented-out - * sample code shows what you might do if you don't want the default. - * - */ - -int ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev) { - /*********************************************************************** - DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c * - **********************************************************************/ - return BadMatch; -} - - -/*********************************************************************** - * - * Caller: ProcXChangePointerDevice - * - * This procedure does the implementation-dependent portion of the work - * needed to change the pointer device. - * - * The X pointer device does not have a FocusRec. If the device that - * has been made into the new X pointer had a FocusRec, - * ProcXChangePointerDevice will free it. - * - * If you want clients to be able to focus the old pointer device that - * has now become accessible through the input extension, you need to - * add a FocusRec to it here. - * - * The XChangePointerDevice protocol request also allows the client - * to choose which axes of the new pointer device are used to move - * the X cursor in the X- and Y- directions. If the axes are different - * than the default ones, you need to keep track of that here. - * - * If you support input devices with valuators that you do not want to be - * used as the X pointer, you need to check for them here and return a - * BadDevice error. - * - * The default implementation is to do nothing (assume you don't want - * clients to be able to focus the old X pointer). The commented-out - * sample code shows what you might do if you don't want the default. - * - */ - -int -ChangePointerDevice ( - DeviceIntPtr old_dev, - DeviceIntPtr new_dev, - unsigned char x, - unsigned char y) - { - /*********************************************************************** - InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr* - - x_axis = x; * keep track of new x-axis* - y_axis = y; * keep track of new y-axis* - if (x_axis != 0 || y_axis != 1) - axes_changed = TRUE; * remember axes have changed* - else - axes_changed = FALSE; - *************************************************************************/ - return BadMatch; - } /*********************************************************************** * @@ -161,11 +77,9 @@ ChangePointerDevice ( */ void -CloseInputDevice (d, client) - DeviceIntPtr d; - ClientPtr client; - { - } +CloseInputDevice(DeviceIntPtr d, ClientPtr client) +{ +} /*********************************************************************** * @@ -194,8 +108,8 @@ CloseInputDevice (d, client) */ void -AddOtherInputDevices () - { +AddOtherInputDevices(void) +{ /********************************************************************** for each uninitialized device, do something like: @@ -209,7 +123,7 @@ AddOtherInputDevices () dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success); ************************************************************************/ - } +} /*********************************************************************** * @@ -234,12 +148,9 @@ AddOtherInputDevices () */ void -OpenInputDevice (dev, client, status) - DeviceIntPtr dev; - ClientPtr client; - int *status; - { - } +OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status) +{ +} /**************************************************************************** * @@ -254,13 +165,10 @@ OpenInputDevice (dev, client, status) */ int -SetDeviceMode (client, dev, mode) - register ClientPtr client; - DeviceIntPtr dev; - int mode; - { +SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode) +{ return BadMatch; - } +} /**************************************************************************** * @@ -275,15 +183,11 @@ SetDeviceMode (client, dev, mode) */ int -SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators) - register ClientPtr client; - DeviceIntPtr dev; - int *valuators; - int first_valuator; - int num_valuators; - { +SetDeviceValuators(ClientPtr client, DeviceIntPtr dev, + int *valuators, int first_valuator, int num_valuators) +{ return BadMatch; - } +} /**************************************************************************** * @@ -294,16 +198,44 @@ SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators) */ int -ChangeDeviceControl (client, dev, control) - register ClientPtr client; - DeviceIntPtr dev; - xDeviceCtl *control; - { - switch (control->control) - { - case DEVICE_RESOLUTION: - return (BadMatch); - default: - return (BadMatch); - } +ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev, + xDeviceCtl * control) +{ + switch (control->control) { + case DEVICE_RESOLUTION: + return (BadMatch); + case DEVICE_ABS_CALIB: + case DEVICE_ABS_AREA: + return (BadMatch); + case DEVICE_CORE: + return (BadMatch); + default: + return (BadMatch); } +} + + +/**************************************************************************** + * + * Caller: configAddDevice (and others) + * + * Add a new device with the specified options. + * + */ +int +NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev) +{ + return BadValue; +} + +/**************************************************************************** + * + * Caller: configRemoveDevice (and others) + * + * Remove the specified device previously added. + * + */ +void +DeleteInputDeviceRequest(DeviceIntPtr dev) +{ +} |