summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-09-26 10:12:31 +0930
committerPeter Hutterer <peter.hutterer@redhat.com>2008-09-26 10:12:31 +0930
commitf9a5371d43b2c6023745f766d0e8ceff2acdff60 (patch)
tree8dfc870114f3741658bcb1bc205ebf1a5e70f847 /src
parent822bff60ea26c0b509fd4de35099b4d94e9e99de (diff)
Adjust to new property API.
XConfigureDeviceProperty is gone. XQueryDeviceProperty is gone. XGetDeviceProperty doesn't have "pending" anymore.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/XConfDProp.c76
-rw-r--r--src/XGetDProp.c4
-rw-r--r--src/XQryDProp.c97
4 files changed, 1 insertions, 178 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 0a9fb19..df7d375 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,7 +15,6 @@ libXi_la_SOURCES = \
XChgProp.c \
XClrAcc.c \
XCloseDev.c \
- XConfDProp.c \
XDefDevCur.c \
XDelDProp.c \
XDenyDev.c \
@@ -42,7 +41,6 @@ libXi_la_SOURCES = \
XOpenDev.c \
XPermDev.c \
XQryAccRl.c \
- XQryDProp.c \
XQueryDv.c \
XQueryDvPtr.c \
XSelect.c \
diff --git a/src/XConfDProp.c b/src/XConfDProp.c
deleted file mode 100644
index 00e1a4b..0000000
--- a/src/XConfDProp.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/************************************************************
-
-Copyright 2008 Peter Hutterer
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the author shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the author.
-
-*/
-
-/***********************************************************************
- * XConfigureDeviceProperties - delete an input device's properties.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <X11/Xlibint.h>
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include <X11/extensions/XInput.h>
-#include <X11/extensions/extutil.h>
-#include "XIint.h"
-
-void
-XConfigureDeviceProperty(Display* dpy, XDevice* dev, Atom property,
- Bool pending, Bool range,
- int num_values, long* values)
-{
- xConfigureDevicePropertyReq *req;
- int len;
-
- XExtDisplayInfo *info = XInput_find_display(dpy);
-
- LockDisplay(dpy);
- if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
- return;
-
- GetReq(ConfigureDeviceProperty, req);
- req->reqType = info->codes->major_opcode;
- req->ReqType = X_ConfigureDeviceProperty;
- req->deviceid = dev->device_id;
- req->property = property;
- req->range = range;
- req->pending = pending;
-
- len = num_values;
- if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) {
- SetReqLen(req, len, len);
- len = (long)num_values << 2;
- Data32 (dpy, values, len);
- } /* else force BadLength */
-
- UnlockDisplay(dpy);
- SyncHandle();
- return;
-}
-
diff --git a/src/XGetDProp.c b/src/XGetDProp.c
index 909e9d2..5d44f91 100644
--- a/src/XGetDProp.c
+++ b/src/XGetDProp.c
@@ -42,8 +42,7 @@ in this Software without prior written authorization from the author.
int
XGetDeviceProperty(Display* dpy, XDevice* dev,
Atom property, long offset, long length, Bool delete,
- Bool pending, Atom req_type,
- Atom *actual_type, int *actual_format,
+ Atom req_type, Atom *actual_type, int *actual_format,
unsigned long *nitems, unsigned long *bytes_after,
unsigned char **prop)
{
@@ -66,7 +65,6 @@ XGetDeviceProperty(Display* dpy, XDevice* dev,
req->longOffset = offset;
req->longLength = length;
req->delete = delete;
- req->pending = pending;
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
{
diff --git a/src/XQryDProp.c b/src/XQryDProp.c
deleted file mode 100644
index 0ac7227..0000000
--- a/src/XQryDProp.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/************************************************************
-
-Copyright 2008 Peter Hutterer
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the author shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the author.
-
-*/
-
-/***********************************************************************
- * XQueryDeviceProperties - query an input device's properties.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <X11/Xlibint.h>
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include <X11/extensions/XInput.h>
-#include <X11/extensions/extutil.h>
-#include "XIint.h"
-
-XIPropertyInfo*
-XQueryDeviceProperty(Display* dpy, XDevice* dev, Atom property)
-{
- xQueryDevicePropertyReq *req;
- xQueryDevicePropertyReply rep;
- int len;
- int rbytes, nbytes;
- XIPropertyInfo *prop_info;
-
- XExtDisplayInfo *info = XInput_find_display(dpy);
-
- LockDisplay(dpy);
- if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
- return NULL;
-
- GetReq(QueryDeviceProperty, req);
- req->reqType = info->codes->major_opcode;
- req->ReqType = X_QueryDeviceProperty;
- req->deviceid = dev->device_id;
- req->property = property;
-
- if (!_XReply(dpy, (xReply*)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
- }
-
- rbytes = sizeof (XIPropertyInfo) + rep.length * sizeof (long);
- nbytes = rep.length << 2;
-
- prop_info = (XIPropertyInfo*) Xmalloc (rbytes);
- if (prop_info == NULL) {
- _XEatData (dpy, nbytes);
- UnlockDisplay (dpy);
- SyncHandle ();
- return NULL;
- }
-
- prop_info->pending = rep.pending;
- prop_info->range = rep.range;
- prop_info->immutable = rep.immutable;
- prop_info->fromClient = rep.fromClient;
- prop_info->num_values = rep.length;
- if (rep.length != 0) {
- prop_info->values = (long *) (prop_info + 1);
- _XRead32 (dpy, prop_info->values, nbytes);
- } else {
- prop_info->values = NULL;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
- return prop_info;
-}
-