summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-08-05 09:32:50 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-08-05 09:33:15 +1000
commit26b83ad4a29dc180b336a19d9e97589814e93e37 (patch)
tree656b0008daf5a7c4d57081be557aa0cbbc4f8ba5
parent6a500fdd4d717947b86f6d6844ebf9a8603eb8e2 (diff)
dix: require PointerProc and KeyboardProc to be passed into AllocDevicePair.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--Xi/xichangehierarchy.c8
-rw-r--r--dix/devices.c21
-rw-r--r--include/input.h2
3 files changed, 23 insertions, 8 deletions
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index 9f52b6dbe..48d25c3aa 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -54,6 +54,10 @@
#include "xichangehierarchy.h"
+extern DeviceProc CorePointerProc;
+extern DeviceProc CoreKeyboardProc;
+
+
/**
* Send the current state of the device hierarchy to all clients.
*/
@@ -176,7 +180,9 @@ ProcXIChangeHierarchy(ClientPtr client)
strncpy(name, (char*)&c[1], c->name_len);
- rc = AllocDevicePair(client, name, &ptr, &keybd, TRUE);
+ rc = AllocDevicePair(client, name, &ptr, &keybd,
+ CorePointerProc, CoreKeyboardProc,
+ TRUE);
if (rc != Success)
{
xfree(name);
diff --git a/dix/devices.c b/dix/devices.c
index 53b7e2ccd..e58e940b7 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -98,6 +98,9 @@ DevPrivateKey UnusedClassesPrivateKey = &UnusedClassesPrivateKeyIndex;
static int XTstDevicePrivateKeyIndex;
DevPrivateKey XTstDevicePrivateKey = &XTstDevicePrivateKeyIndex;
+
+int CorePointerProc(DeviceIntPtr, int);
+int CoreKeyboardProc(DeviceIntPtr, int);
/**
* vxtstpointer
* is the virtual pointer for XTest. It is the first slave
@@ -531,7 +534,7 @@ CoreKeyboardCtl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
/**
* Device control function for the Virtual Core Keyboard.
*/
-static int
+int
CoreKeyboardProc(DeviceIntPtr pDev, int what)
{
@@ -560,7 +563,7 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
/**
* Device control function for the Virtual Core Pointer.
*/
-static int
+int
CorePointerProc(DeviceIntPtr pDev, int what)
{
#define NBUTTONS 7
@@ -627,6 +630,7 @@ InitCoreDevices(void)
{
if (AllocDevicePair(serverClient, "Virtual core",
&inputInfo.pointer, &inputInfo.keyboard,
+ CorePointerProc, CoreKeyboardProc,
TRUE) != Success)
FatalError("Failed to allocate core devices");
@@ -2491,15 +2495,18 @@ GetMaster(DeviceIntPtr dev, int which)
*/
int
AllocDevicePair (ClientPtr client, char* name,
- DeviceIntPtr* ptr, DeviceIntPtr* keybd,
- Bool master)
+ DeviceIntPtr* ptr,
+ DeviceIntPtr* keybd,
+ DeviceProc ptr_proc,
+ DeviceProc keybd_proc,
+ Bool master)
{
DeviceIntPtr pointer;
DeviceIntPtr keyboard;
ClassesPtr classes;
*ptr = *keybd = NULL;
- pointer = AddInputDevice(client, CorePointerProc, TRUE);
+ pointer = AddInputDevice(client, ptr_proc, TRUE);
if (!pointer)
return BadAlloc;
@@ -2519,7 +2526,7 @@ AllocDevicePair (ClientPtr client, char* name,
pointer->last.slave = NULL;
pointer->type = (master) ? MASTER_POINTER : SLAVE;
- keyboard = AddInputDevice(client, CoreKeyboardProc, TRUE);
+ keyboard = AddInputDevice(client, keybd_proc, TRUE);
if (!keyboard)
{
RemoveDevice(pointer, FALSE);
@@ -2587,7 +2594,7 @@ int AllocXtstDevice (ClientPtr client, char* name,
strncpy( xtstname, name, len);
strncat( xtstname, " Xtst", 5 );
- retval = AllocDevicePair( client, xtstname, ptr, keybd, FALSE);
+ retval = AllocDevicePair( client, xtstname, ptr, keybd, CorePointerProc, CoreKeyboardProc, FALSE);
if ( retval == Success ){
dixSetPrivate(&((*ptr)->devPrivates), XTstDevicePrivateKey, (void *)master_ptr->id);
dixSetPrivate(&((*keybd)->devPrivates), XTstDevicePrivateKey, (void *)master_keybd->id);
diff --git a/include/input.h b/include/input.h
index e962696cb..d003472eb 100644
--- a/include/input.h
+++ b/include/input.h
@@ -482,6 +482,8 @@ extern int AllocDevicePair(ClientPtr client,
char* name,
DeviceIntPtr* ptr,
DeviceIntPtr* keybd,
+ DeviceProc ptr_proc,
+ DeviceProc keybd_proc,
Bool master);
extern void DeepCopyDeviceClasses(DeviceIntPtr from,
DeviceIntPtr to,