diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-08 14:27:01 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-13 13:24:08 +1000 |
commit | 218752bdc5d9323d1e6202e762573a925cf8a4eb (patch) | |
tree | 7613d317f6306fdc03ff32c94b2657b1e3987d0a /Xi | |
parent | cd56bd7b3ee34a4b10eb3a57a6e94cac7512167a (diff) |
input: replace GRABTYPE_* with the InputLevel enums
They achieve the same thing, re-use the more generic InputLevel so we can
convert to/fro easier.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 26 | ||||
-rw-r--r-- | Xi/grabdev.c | 2 | ||||
-rw-r--r-- | Xi/grabdevb.c | 4 | ||||
-rw-r--r-- | Xi/grabdevk.c | 4 | ||||
-rw-r--r-- | Xi/ungrdev.c | 2 | ||||
-rw-r--r-- | Xi/ungrdevb.c | 2 | ||||
-rw-r--r-- | Xi/ungrdevk.c | 2 | ||||
-rw-r--r-- | Xi/xigrabdev.c | 4 | ||||
-rw-r--r-- | Xi/xipassivegrab.c | 8 |
9 files changed, 27 insertions, 27 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 405a8b1a0..45a289add 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1389,9 +1389,9 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, int CheckGrabValues(ClientPtr client, GrabParameters* param) { - if (param->grabtype != GRABTYPE_CORE && - param->grabtype != GRABTYPE_XI && - param->grabtype != GRABTYPE_XI2) + if (param->grabtype != CORE && + param->grabtype != XI && + param->grabtype != XI2) { ErrorF("[Xi] grabtype is invalid. This is a bug.\n"); return BadImplementation; @@ -1408,7 +1408,7 @@ CheckGrabValues(ClientPtr client, GrabParameters* param) return BadValue; } - if (param->grabtype != GRABTYPE_XI2 && (param->modifiers != AnyModifier) && + if (param->grabtype != XI2 && (param->modifiers != AnyModifier) && (param->modifiers & ~AllModifiersMask)) { client->errorValue = param->modifiers; return BadValue; @@ -1423,7 +1423,7 @@ CheckGrabValues(ClientPtr client, GrabParameters* param) int GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, - int button, GrabParameters *param, GrabType grabtype, + int button, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask) { WindowPtr pWin, confineTo; @@ -1463,9 +1463,9 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, if (rc != Success) return rc; - if (grabtype == GRABTYPE_XI) + if (grabtype == XI) type = DeviceButtonPress; - else if (grabtype == GRABTYPE_XI2) + else if (grabtype == XI2) type = XI_ButtonPress; grab = CreateGrab(client->index, dev, modifier_device, pWin, grabtype, @@ -1476,12 +1476,12 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, } /** - * Grab the given key. If grabtype is GRABTYPE_XI, the key is a keycode. If - * grabtype is GRABTYPE_XI2, the key is a keysym. + * Grab the given key. If grabtype is XI, the key is a keycode. If + * grabtype is XI2, the key is a keysym. */ int GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, - int key, GrabParameters *param, GrabType grabtype, GrabMask *mask) + int key, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask) { WindowPtr pWin; GrabPtr grab; @@ -1494,7 +1494,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, return rc; if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL) return BadMatch; - if (grabtype == GRABTYPE_XI) + if (grabtype == XI) { if ((key > k->xkbInfo->desc->max_key_code || key < k->xkbInfo->desc->min_key_code) @@ -1503,7 +1503,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, return BadValue; } type = DeviceKeyPress; - } else if (grabtype == GRABTYPE_XI2) + } else if (grabtype == XI2) type = XI_KeyPress; rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); @@ -1558,7 +1558,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type, if (rc != Success) return rc; - grab = CreateGrab(client->index, dev, dev, pWin, GRABTYPE_XI2, + grab = CreateGrab(client->index, dev, dev, pWin, XI2, mask, param, (type == XIGrabtypeEnter) ? XI_Enter : XI_FocusIn, 0, NULL, cursor); diff --git a/Xi/grabdev.c b/Xi/grabdev.c index 4572c33fc..8fd114e60 100644 --- a/Xi/grabdev.c +++ b/Xi/grabdev.c @@ -130,7 +130,7 @@ ProcXGrabDevice(ClientPtr client) rc = GrabDevice(client, dev, stuff->other_devices_mode, stuff->this_device_mode, stuff->grabWindow, stuff->ownerEvents, stuff->time, - &mask, GRABTYPE_XI, None, None, + &mask, XI, None, None, &rep.status); if (rc != Success) diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c index 2897d410b..dda0da8bb 100644 --- a/Xi/grabdevb.c +++ b/Xi/grabdevb.c @@ -137,7 +137,7 @@ ProcXGrabDeviceButton(ClientPtr client) return ret; memset(¶m, 0, sizeof(param)); - param.grabtype = GRABTYPE_XI; + param.grabtype = XI; param.ownerEvents = stuff->ownerEvents; param.this_device_mode = stuff->this_device_mode; param.other_devices_mode = stuff->other_devices_mode; @@ -146,7 +146,7 @@ ProcXGrabDeviceButton(ClientPtr client) mask.xi = tmp[stuff->grabbed_device].mask; ret = GrabButton(client, dev, mdev, stuff->button, ¶m, - GRABTYPE_XI, &mask); + XI, &mask); return ret; } diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c index cedd90d9c..61ab43a20 100644 --- a/Xi/grabdevk.c +++ b/Xi/grabdevk.c @@ -135,7 +135,7 @@ ProcXGrabDeviceKey(ClientPtr client) memset(¶m, 0, sizeof(param)); - param.grabtype = GRABTYPE_XI; + param.grabtype = XI; param.ownerEvents = stuff->ownerEvents; param.this_device_mode = stuff->this_device_mode; param.other_devices_mode = stuff->other_devices_mode; @@ -143,7 +143,7 @@ ProcXGrabDeviceKey(ClientPtr client) param.modifiers = stuff->modifiers; mask.xi = tmp[stuff->grabbed_device].mask; - ret = GrabKey(client, dev, mdev, stuff->key, ¶m, GRABTYPE_XI, &mask); + ret = GrabKey(client, dev, mdev, stuff->key, ¶m, XI, &mask); return ret; } diff --git a/Xi/ungrdev.c b/Xi/ungrdev.c index bc66cfc4b..58c1f57ef 100644 --- a/Xi/ungrdev.c +++ b/Xi/ungrdev.c @@ -102,7 +102,7 @@ ProcXUngrabDevice(ClientPtr client) time = ClientTimeToServerTime(stuff->time); if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, dev->deviceGrab.grabTime) != EARLIER) && - (grab) && SameClient(grab, client) && grab->grabtype == GRABTYPE_XI) + (grab) && SameClient(grab, client) && grab->grabtype == XI) (*dev->deviceGrab.DeactivateGrab) (dev); return Success; } diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c index 628024870..0ba395cf3 100644 --- a/Xi/ungrdevb.c +++ b/Xi/ungrdevb.c @@ -134,7 +134,7 @@ ProcXUngrabDeviceButton(ClientPtr client) temporaryGrab->device = dev; temporaryGrab->window = pWin; temporaryGrab->type = DeviceButtonPress; - temporaryGrab->grabtype = GRABTYPE_XI; + temporaryGrab->grabtype = XI; temporaryGrab->modifierDevice = mdev; temporaryGrab->modifiersDetail.exact = stuff->modifiers; temporaryGrab->modifiersDetail.pMask = NULL; diff --git a/Xi/ungrdevk.c b/Xi/ungrdevk.c index b0d83cbbc..8785989b0 100644 --- a/Xi/ungrdevk.c +++ b/Xi/ungrdevk.c @@ -141,7 +141,7 @@ ProcXUngrabDeviceKey(ClientPtr client) temporaryGrab->device = dev; temporaryGrab->window = pWin; temporaryGrab->type = DeviceKeyPress; - temporaryGrab->grabtype = GRABTYPE_XI; + temporaryGrab->grabtype = XI; temporaryGrab->modifierDevice = mdev; temporaryGrab->modifiersDetail.exact = stuff->modifiers; temporaryGrab->modifiersDetail.pMask = NULL; diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c index 1cfbf243b..2b3055004 100644 --- a/Xi/xigrabdev.c +++ b/Xi/xigrabdev.c @@ -96,7 +96,7 @@ ProcXIGrabDevice(ClientPtr client) stuff->owner_events, stuff->time, &mask, - GRABTYPE_XI2, + XI2, stuff->cursor, None /* confineTo */, &status); @@ -148,7 +148,7 @@ ProcXIUngrabDevice(ClientPtr client) time = ClientTimeToServerTime(stuff->time); if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, dev->deviceGrab.grabTime) != EARLIER) && - (grab) && SameClient(grab, client) && grab->grabtype == GRABTYPE_XI2) + (grab) && SameClient(grab, client) && grab->grabtype == XI2) (*dev->deviceGrab.DeactivateGrab) (dev); return Success; diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index 4860757fc..713a1654e 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -139,7 +139,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) rep.num_modifiers = 0; memset(¶m, 0, sizeof(param)); - param.grabtype = GRABTYPE_XI2; + param.grabtype = XI2; param.ownerEvents = stuff->owner_events; param.this_device_mode = stuff->grab_mode; param.other_devices_mode = stuff->paired_device_mode; @@ -183,11 +183,11 @@ ProcXIPassiveGrabDevice(ClientPtr client) { case XIGrabtypeButton: status = GrabButton(client, dev, mod_dev, stuff->detail, - ¶m, GRABTYPE_XI2, &mask); + ¶m, XI2, &mask); break; case XIGrabtypeKeycode: status = GrabKey(client, dev, mod_dev, stuff->detail, - ¶m, GRABTYPE_XI2, &mask); + ¶m, XI2, &mask); break; case XIGrabtypeEnter: case XIGrabtypeFocusIn: @@ -313,7 +313,7 @@ ProcXIPassiveUngrabDevice(ClientPtr client) case XIGrabtypeEnter: tempGrab->type = XI_Enter; break; case XIGrabtypeFocusIn: tempGrab->type = XI_FocusIn; break; } - tempGrab->grabtype = GRABTYPE_XI2; + tempGrab->grabtype = XI2; tempGrab->modifierDevice = mod_dev; tempGrab->modifiersDetail.pMask = NULL; tempGrab->detail.exact = stuff->detail; |