Beispiel #1
0
int
SProcXGrabDevice(ClientPtr client)
{
    REQUEST(xGrabDeviceReq);
    swaps(&stuff->length);
    REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
    swapl(&stuff->grabWindow);
    swapl(&stuff->time);
    swaps(&stuff->event_count);

    if (stuff->length !=
        bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
        return BadLength;

    SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);

    return (ProcXGrabDevice(client));
}
Beispiel #2
0
int
ProcIDispatch(register ClientPtr client)
{
    REQUEST(xReq);
    if (stuff->data == X_GetExtensionVersion)
        return (ProcXGetExtensionVersion(client));
    if (stuff->data == X_ListInputDevices)
        return (ProcXListInputDevices(client));
    else if (stuff->data == X_OpenDevice)
        return (ProcXOpenDevice(client));
    else if (stuff->data == X_CloseDevice)
        return (ProcXCloseDevice(client));
    else if (stuff->data == X_SetDeviceMode)
        return (ProcXSetDeviceMode(client));
    else if (stuff->data == X_SelectExtensionEvent)
        return (ProcXSelectExtensionEvent(client));
    else if (stuff->data == X_GetSelectedExtensionEvents)
        return (ProcXGetSelectedExtensionEvents(client));
    else if (stuff->data == X_ChangeDeviceDontPropagateList)
        return (ProcXChangeDeviceDontPropagateList(client));
    else if (stuff->data == X_GetDeviceDontPropagateList)
        return (ProcXGetDeviceDontPropagateList(client));
    else if (stuff->data == X_GetDeviceMotionEvents)
        return (ProcXGetDeviceMotionEvents(client));
    else if (stuff->data == X_ChangeKeyboardDevice)
        return (ProcXChangeKeyboardDevice(client));
    else if (stuff->data == X_ChangePointerDevice)
        return (ProcXChangePointerDevice(client));
    else if (stuff->data == X_GrabDevice)
        return (ProcXGrabDevice(client));
    else if (stuff->data == X_UngrabDevice)
        return (ProcXUngrabDevice(client));
    else if (stuff->data == X_GrabDeviceKey)
        return (ProcXGrabDeviceKey(client));
    else if (stuff->data == X_UngrabDeviceKey)
        return (ProcXUngrabDeviceKey(client));
    else if (stuff->data == X_GrabDeviceButton)
        return (ProcXGrabDeviceButton(client));
    else if (stuff->data == X_UngrabDeviceButton)
        return (ProcXUngrabDeviceButton(client));
    else if (stuff->data == X_AllowDeviceEvents)
        return (ProcXAllowDeviceEvents(client));
    else if (stuff->data == X_GetDeviceFocus)
        return (ProcXGetDeviceFocus(client));
    else if (stuff->data == X_SetDeviceFocus)
        return (ProcXSetDeviceFocus(client));
    else if (stuff->data == X_GetFeedbackControl)
        return (ProcXGetFeedbackControl(client));
    else if (stuff->data == X_ChangeFeedbackControl)
        return (ProcXChangeFeedbackControl(client));
    else if (stuff->data == X_GetDeviceKeyMapping)
        return (ProcXGetDeviceKeyMapping(client));
    else if (stuff->data == X_ChangeDeviceKeyMapping)
        return (ProcXChangeDeviceKeyMapping(client));
    else if (stuff->data == X_GetDeviceModifierMapping)
        return (ProcXGetDeviceModifierMapping(client));
    else if (stuff->data == X_SetDeviceModifierMapping)
        return (ProcXSetDeviceModifierMapping(client));
    else if (stuff->data == X_GetDeviceButtonMapping)
        return (ProcXGetDeviceButtonMapping(client));
    else if (stuff->data == X_SetDeviceButtonMapping)
        return (ProcXSetDeviceButtonMapping(client));
    else if (stuff->data == X_QueryDeviceState)
        return (ProcXQueryDeviceState(client));
    else if (stuff->data == X_SendExtensionEvent)
        return (ProcXSendExtensionEvent(client));
    else if (stuff->data == X_DeviceBell)
        return (ProcXDeviceBell(client));
    else if (stuff->data == X_SetDeviceValuators)
        return (ProcXSetDeviceValuators(client));
    else if (stuff->data == X_GetDeviceControl)
        return (ProcXGetDeviceControl(client));
    else if (stuff->data == X_ChangeDeviceControl)
        return (ProcXChangeDeviceControl(client));
    else {
        SendErrorToClient(client, IReqCode, stuff->data, 0, BadRequest);
    }
    return (BadRequest);
}