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)
This commit is contained in:
parent
c4a616a741
commit
c1d37efe9a
|
@ -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.
|
* should include more complete XINPUT support.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -52,100 +51,17 @@ SOFTWARE.
|
||||||
|
|
||||||
********************************************************/
|
********************************************************/
|
||||||
|
|
||||||
|
#define NEED_EVENTS
|
||||||
#ifdef HAVE_DIX_CONFIG_H
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NEED_EVENTS
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.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
|
void
|
||||||
CloseInputDevice (d, client)
|
CloseInputDevice(DeviceIntPtr d, ClientPtr client)
|
||||||
DeviceIntPtr d;
|
{
|
||||||
ClientPtr client;
|
}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
|
@ -194,8 +108,8 @@ CloseInputDevice (d, client)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
AddOtherInputDevices ()
|
AddOtherInputDevices(void)
|
||||||
{
|
{
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
for each uninitialized device, do something like:
|
for each uninitialized device, do something like:
|
||||||
|
|
||||||
|
@ -209,7 +123,7 @@ AddOtherInputDevices ()
|
||||||
dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
|
dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
|
@ -234,12 +148,9 @@ AddOtherInputDevices ()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
OpenInputDevice (dev, client, status)
|
OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
|
||||||
DeviceIntPtr dev;
|
{
|
||||||
ClientPtr client;
|
}
|
||||||
int *status;
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
|
@ -254,13 +165,10 @@ OpenInputDevice (dev, client, status)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
SetDeviceMode (client, dev, mode)
|
SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
|
||||||
register ClientPtr client;
|
{
|
||||||
DeviceIntPtr dev;
|
|
||||||
int mode;
|
|
||||||
{
|
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
|
@ -275,15 +183,11 @@ SetDeviceMode (client, dev, mode)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators)
|
SetDeviceValuators(ClientPtr client, DeviceIntPtr dev,
|
||||||
register ClientPtr client;
|
int *valuators, int first_valuator, int num_valuators)
|
||||||
DeviceIntPtr dev;
|
{
|
||||||
int *valuators;
|
|
||||||
int first_valuator;
|
|
||||||
int num_valuators;
|
|
||||||
{
|
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
|
@ -294,16 +198,44 @@ SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
ChangeDeviceControl (client, dev, control)
|
ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
|
||||||
register ClientPtr client;
|
xDeviceCtl * control)
|
||||||
DeviceIntPtr dev;
|
{
|
||||||
xDeviceCtl *control;
|
switch (control->control) {
|
||||||
{
|
|
||||||
switch (control->control)
|
|
||||||
{
|
|
||||||
case DEVICE_RESOLUTION:
|
case DEVICE_RESOLUTION:
|
||||||
return (BadMatch);
|
return (BadMatch);
|
||||||
|
case DEVICE_ABS_CALIB:
|
||||||
|
case DEVICE_ABS_AREA:
|
||||||
|
return (BadMatch);
|
||||||
|
case DEVICE_CORE:
|
||||||
|
return (BadMatch);
|
||||||
default:
|
default:
|
||||||
return (BadMatch);
|
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)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue