diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-08 14:21:17 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-08 15:15:00 +1000 |
commit | 239cd6a673be2821915301c1b3c3bae063e9dd94 (patch) | |
tree | 31ab60420613f931cb98e7799567e327d89be472 /src | |
parent | 5d973706f4f706b7576bb6feac4beb7273438b78 (diff) |
Update to new inputproto defines.
Diffstat (limited to 'src')
-rw-r--r-- | src/hierarchy.c | 16 | ||||
-rw-r--r-- | src/list.c | 20 | ||||
-rw-r--r-- | src/test_xi2.c | 32 | ||||
-rw-r--r-- | src/xinput.c | 2 |
4 files changed, 35 insertions, 35 deletions
diff --git a/src/hierarchy.c b/src/hierarchy.c index ed5e930..9f0cc8f 100644 --- a/src/hierarchy.c +++ b/src/hierarchy.c @@ -48,7 +48,7 @@ create_master(Display* dpy, int argc, char** argv, char* name, char *desc) return EXIT_FAILURE; } - c.type = CH_CreateMasterDevice; + c.type = XICreateMasterDevice; c.name = argv[0]; c.sendCore = (argc >= 2) ? atoi(argv[1]) : 1; c.enable = (argc >= 3) ? atoi(argv[2]) : 1; @@ -81,20 +81,20 @@ remove_master(Display* dpy, int argc, char** argv, char *name, char *desc) return EXIT_FAILURE; } - r.type = CH_RemoveMasterDevice; + r.type = XIRemoveMasterDevice; r.device = info->deviceid; if (argc >= 2) { if (!strcmp(argv[1], "Floating")) - r.returnMode = Floating; + r.returnMode = XIFloating; else if (!strcmp(argv[1], "AttachToMaster")) - r.returnMode = AttachToMaster; + r.returnMode = XIAttachToMaster; else Error(BadValue, "Invalid returnMode.\n"); } else - r.returnMode = Floating; + r.returnMode = XIFloating; - if (r.returnMode == AttachToMaster) + if (r.returnMode == XIAttachToMaster) { r.returnPointer = atoi(argv[2]); r.returnKeyboard = atoi(argv[3]); @@ -133,7 +133,7 @@ change_attachment(Display* dpy, int argc, char** argv, char *name, char* desc) return EXIT_FAILURE; } - c.type = CH_AttachSlave; + c.type = XIAttachSlave; c.device = sd_info->deviceid; c.newMaster = md_info->deviceid; @@ -164,7 +164,7 @@ float_device(Display* dpy, int argc, char** argv, char* name, char* desc) return EXIT_FAILURE; } - c.type = CH_DetachSlave; + c.type = XIDetachSlave; c.device = info->deviceid; ret = XIChangeDeviceHierarchy(dpy, (XIAnyHierarchyChangeInfo*)&c, 1); @@ -193,19 +193,19 @@ print_info_xi2(Display* display, XIDeviceInfo *dev, Bool shortformat) printf("%-40s\tid=%d\t[", dev->name, dev->deviceid); switch(dev->use) { - case MasterPointer: + case XIMasterPointer: printf("master pointer (%d)]\n", dev->attachment); break; - case MasterKeyboard: + case XIMasterKeyboard: printf("master keyboard (%d)]\n", dev->attachment); break; - case SlavePointer: + case XISlavePointer: printf("slave pointer (%d)]\n", dev->attachment); break; - case SlaveKeyboard: + case XISlaveKeyboard: printf("slave keyboard (%d)]\n", dev->attachment); break; - case FloatingSlave: + case XIFloatingSlave: printf("floating slave]\n"); break; } @@ -242,15 +242,15 @@ list_xi2(Display *display, return EXIT_FAILURE; } - info = XIQueryDevice(display, AllDevices, &ndevices); + info = XIQueryDevice(display, XIAllDevices, &ndevices); dev = info; for(i = 0; i < ndevices; i++) { dev = &info[i]; - if (dev->use == MasterPointer || dev->use == MasterKeyboard) + if (dev->use == XIMasterPointer || dev->use == XIMasterKeyboard) { - if (dev->use == MasterPointer) + if (dev->use == XIMasterPointer) printf("⎡ "); else printf("⎣ "); @@ -260,10 +260,10 @@ list_xi2(Display *display, { XIDeviceInfo* sd = &info[j]; - if ((sd->use == SlavePointer || sd->use == SlaveKeyboard) && + if ((sd->use == XISlavePointer || sd->use == XISlaveKeyboard) && (sd->attachment == dev->deviceid)) { - printf("%s ↳ ", dev->use == MasterPointer ? "⎜" : " "); + printf("%s ↳ ", dev->use == XIMasterPointer ? "⎜" : " "); print_info_xi2(display, sd, shortformat); } } diff --git a/src/test_xi2.c b/src/test_xi2.c index b9ac1cc..ba5bee6 100644 --- a/src/test_xi2.c +++ b/src/test_xi2.c @@ -84,7 +84,7 @@ static void print_deviceevent(XIDeviceEvent* event) static void print_devicechangedevent(Display *dpy, XIDeviceChangedEvent *event) { printf(" device: %d (%d)\n", event->deviceid, event->sourceid); - printf(" reason: %s\n", (event->reason == SlaveSwitch) ? "SlaveSwitch" : + printf(" reason: %s\n", (event->reason == XISlaveSwitch) ? "SlaveSwitch" : "DeviceChanged"); print_classes_xi2(dpy, event->classes, event->num_classes); } @@ -93,24 +93,24 @@ static void print_hierarchychangedevent(XIDeviceHierarchyEvent *event) { int i; printf(" Changes happened: %s %s %s %s %s %s %s\n", - (event->flags & HF_MasterAdded) ? "[new master]" : "", - (event->flags & HF_MasterRemoved) ? "[master removed]" : "", - (event->flags & HF_SlaveAdded) ? "[new slave]" : "", - (event->flags & HF_SlaveRemoved) ? "[slave removed]" : "", - (event->flags & HF_SlaveAttached) ? "[slave attached]" : "", - (event->flags & HF_DeviceEnabled) ? "[device enabled]" : "", - (event->flags & HF_DeviceDisabled) ? "[device disabled]" : ""); + (event->flags & XIMasterAdded) ? "[new master]" : "", + (event->flags & XIMasterRemoved) ? "[master removed]" : "", + (event->flags & XISlaveAdded) ? "[new slave]" : "", + (event->flags & XISlaveRemoved) ? "[slave removed]" : "", + (event->flags & XISlaveAttached) ? "[slave attached]" : "", + (event->flags & XIDeviceEnabled) ? "[device enabled]" : "", + (event->flags & XIDeviceDisabled) ? "[device disabled]" : ""); for (i = 0; i < event->num_devices; i++) { char *use; switch(event->info[i].use) { - case MasterPointer: use = "master pointer"; - case MasterKeyboard: use = "master keyboard"; break; - case SlavePointer: use = "slave pointer"; - case SlaveKeyboard: use = "slave keyboard"; break; - case FloatingSlave: use = "floating slave"; break; + case XIMasterPointer: use = "master pointer"; + case XIMasterKeyboard: use = "master keyboard"; break; + case XISlavePointer: use = "slave pointer"; + case XISlaveKeyboard: use = "slave keyboard"; break; + case XIFloatingSlave: use = "floating slave"; break; break; } @@ -208,7 +208,7 @@ test_sync_grab(Display *display, Window win) XIDeviceEventMask mask; /* Select for motion events */ - mask.deviceid = AllDevices; + mask.deviceid = XIAllDevices; mask.mask_len = 2; mask.mask = calloc(2, sizeof(char)); SetBit(mask.mask, XI_ButtonPress); @@ -261,7 +261,7 @@ test_xi2(Display *display, XSync(display, False); /* Select for motion events */ - mask.deviceid = AllDevices; + mask.deviceid = XIAllDevices; mask.mask_len = 2; mask.mask = calloc(mask.mask_len, sizeof(char)); SetBit(mask.mask, XI_ButtonPress); @@ -297,7 +297,7 @@ test_xi2(Display *display, XIUngrabKeysym(display, 3, 0x71, win, nmods - 2, &modifiers[2]); } - mask.deviceid = AllMasterDevices; + mask.deviceid = XIAllMasterDevices; memset(mask.mask, 0, 2); SetBit(mask.mask, XI_RawEvent); XISelectEvent(display, DefaultRootWindow(display), &mask, 1); diff --git a/src/xinput.c b/src/xinput.c index cff33d5..007fe2c 100644 --- a/src/xinput.c +++ b/src/xinput.c @@ -222,7 +222,7 @@ xi2_find_device_info(Display *display, char *name) id = atoi(name); } - info = XIQueryDevice(display, AllDevices, &ndevices); + info = XIQueryDevice(display, XIAllDevices, &ndevices); for(i = 0; i < ndevices; i++) { if ((is_id && info[i].deviceid == id) || |