1
/* $Xorg: XSetDVal.c,v 1.4 2001/02/09 02:03:51 xorgcvs Exp $ */
3
/************************************************************
5
Copyright 1989, 1998 The Open Group
7
Permission to use, copy, modify, distribute, and sell this software and its
8
documentation for any purpose is hereby granted without fee, provided that
9
the above copyright notice appear in all copies and that both that
10
copyright notice and this permission notice appear in supporting
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
Except as contained in this notice, the name of The Open Group shall not be
24
used in advertising or otherwise to promote the sale, use or other dealings
25
in this Software without prior written authorization from The Open Group.
27
Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
31
Permission to use, copy, modify, and distribute this software and its
32
documentation for any purpose and without fee is hereby granted,
33
provided that the above copyright notice appear in all copies and that
34
both that copyright notice and this permission notice appear in
35
supporting documentation, and that the name of Hewlett-Packard not be
36
used in advertising or publicity pertaining to distribution of the
37
software without specific, written prior permission.
39
HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
40
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
41
HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
42
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47
********************************************************/
48
/* $XFree86: xc/lib/Xi/XSetDVal.c,v 3.4 2002/10/16 00:37:29 dawes Exp $ */
50
/***********************************************************************
52
* XSetDeviceValuators - Set the value of valuators on an extension input
57
#include <X11/extensions/XI.h>
58
#include <X11/extensions/XIproto.h>
59
#include <X11/Xlibint.h>
60
#include <X11/extensions/XInput.h>
61
#include <X11/extensions/extutil.h>
65
XSetDeviceValuators (dpy, dev, valuators, first_valuator, num_valuators)
66
register Display *dpy;
72
xSetDeviceValuatorsReq *req;
73
xSetDeviceValuatorsReply rep;
74
XExtDisplayInfo *info = XInput_find_display (dpy);
77
if (_XiCheckExtInit(dpy, XInput_Add_XSetDeviceValuators) == -1)
78
return (NoSuchExtension);
80
GetReq(SetDeviceValuators,req);
81
req->reqType = info->codes->major_opcode;
82
req->ReqType = X_SetDeviceValuators;
83
req->deviceid = dev->device_id;
84
req->first_valuator = first_valuator;
85
req->num_valuators = num_valuators;
86
req->length += num_valuators;
88
/* note: Data is a macro that uses its arguments multiple
89
times, so "nvalues" is changed in a separate assignment
93
Data (dpy, (char *) valuators, num_valuators);
95
(void) _XReply (dpy, (xReply *) &rep, 0, xTrue);