diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-01-08 12:32:27 +1030 |
---|---|---|
committer | Peter Hutterer <whot@hyena.localdomain> | 2007-01-08 12:32:27 +1030 |
commit | ebc24f1fad85281a1e9e795ec261eea111f40304 (patch) | |
tree | ee022e09eeed915efd133e8be8078a104a17af44 | |
parent | 448def03e88d3460ce97a49df0816dedd609c1e3 (diff) |
Adding XDefineDeviceCursor and XUndefDeviceCursor calls
Fix casting typo in XWarpDevicePointer and XQueryDevicePointer
Reverting useless whitespace commit in XExtInt.c
-rw-r--r-- | Changelog | 11 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/XDefDevCur.c | 63 | ||||
-rw-r--r-- | src/XExtInt.c | 32 | ||||
-rw-r--r-- | src/XQueryDvPtr.c | 2 | ||||
-rw-r--r-- | src/XUndefDevCur.c | 47 | ||||
-rw-r--r-- | src/XWarpDvPtr.c | 2 |
7 files changed, 141 insertions, 18 deletions
@@ -1,5 +1,16 @@ MPX Changelog +== 07.01.07 == +Adding XDefineDeviceCursor and XUndefDeviceCursor calls +Fix casting typo in XWarpDevicePointer and XQueryDevicePointer +Reverting useless whitespace commit in XExtInt.c + +Files: + XDefDevCur.c + XQueryDvPtr.c + XWarpDvPtr.c + XExtInt.c + == 20.12.06 == Adding XWarpDevicePointer and XQueryDevicePointer calls. diff --git a/src/Makefile.am b/src/Makefile.am index f4db3d5..09f71a2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,6 +5,7 @@ lib_LTLIBRARIES = libXi.la libXi_la_SOURCES = \ XAllowDv.c \ XChgDCtl.c \ + XDefDevCur.c \ XChgFCtl.c \ XChgKbd.c \ XChgKMap.c \ @@ -37,6 +38,7 @@ libXi_la_SOURCES = \ XSetMode.c \ XSndExEv.c \ XStFocus.c \ + XUndefDevCur.c \ XUngrDev.c \ XUngrDvB.c \ XUngrDvK.c \ diff --git a/src/XDefDevCur.c b/src/XDefDevCur.c new file mode 100644 index 0000000..2a43946 --- /dev/null +++ b/src/XDefDevCur.c @@ -0,0 +1,63 @@ +/************************************************************ + +Copyright 2006 Peter Hutterer <peter@cs.unisa.edu.au> + +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 +OPEN GROUP 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 Open Group 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 Open Group. + +*/ + +/*********************************************************************** + * + * XDefineDeviceCursor - Change the cursor of an extension input device. + * + */ +#include <X11/extensions/XI.h> +#include <X11/extensions/XIproto.h> +#include <X11/Xlibint.h> +#include <X11/extensions/XInput.h> +#include <X11/extensions/extutil.h> +#include "XIint.h" + + +int XDefineDeviceCursor(dpy, dev, w, cursor) + register Display *dpy; + XDevice* dev; + Window w; + Cursor cursor; +{ + register xChangeDeviceCursorReq *req; + + XExtDisplayInfo *info = XInput_find_display(dpy); + LockDisplay(dpy); + + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(ChangeDeviceCursor, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_ChangeDeviceCursor; + req->deviceid = dev->device_id; + req->win = w; + req->cursor = cursor; + UnlockDisplay(dpy); + SyncHandle(); + return Success; +} diff --git a/src/XExtInt.c b/src/XExtInt.c index 10f728d..3d00e06 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -106,23 +106,23 @@ XEXT_GENERATE_FIND_DISPLAY(XInput_find_display, xinput_info, xinput_extension_name, &xinput_extension_hooks, IEVENTS, NULL) - static XEXT_GENERATE_ERROR_STRING(XInputError, xinput_extension_name, - IERRORS, XInputErrorList) +static XEXT_GENERATE_ERROR_STRING(XInputError, xinput_extension_name, + IERRORS, XInputErrorList) /******************************************************************* - * - * Input extension versions. - * - */ - static XExtensionVersion versions[] = { {XI_Absent, 0, 0}, - {XI_Present, XI_Initial_Release_Major, XI_Initial_Release_Minor}, - {XI_Present, XI_Add_XDeviceBell_Major, XI_Add_XDeviceBell_Minor}, - {XI_Present, XI_Add_XSetDeviceValuators_Major, - XI_Add_XSetDeviceValuators_Minor}, - {XI_Present, XI_Add_XChangeDeviceControl_Major, - XI_Add_XChangeDeviceControl_Minor}, - {XI_Present, XI_Add_DevicePresenceNotify_Major, - XI_Add_DevicePresenceNotify_Minor} - }; +* +* Input extension versions. +* +*/ +static XExtensionVersion versions[] = { {XI_Absent, 0, 0}, +{XI_Present, XI_Initial_Release_Major, XI_Initial_Release_Minor}, +{XI_Present, XI_Add_XDeviceBell_Major, XI_Add_XDeviceBell_Minor}, +{XI_Present, XI_Add_XSetDeviceValuators_Major, + XI_Add_XSetDeviceValuators_Minor}, +{XI_Present, XI_Add_XChangeDeviceControl_Major, + XI_Add_XChangeDeviceControl_Minor}, +{XI_Present, XI_Add_DevicePresenceNotify_Major, + XI_Add_DevicePresenceNotify_Minor} +}; /*********************************************************************** * diff --git a/src/XQueryDvPtr.c b/src/XQueryDvPtr.c index a67c113..fe8b239 100644 --- a/src/XQueryDvPtr.c +++ b/src/XQueryDvPtr.c @@ -58,7 +58,7 @@ XQueryDevicePointer(dpy, dev, w, root, child, root_x, root_y, win_x, win_y, LockDisplay(dpy); if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) - return ((XDeviceState *) NoSuchExtension); + return (NoSuchExtension); GetReq(QueryDevicePointer, req); req->reqType = info->codes->major_opcode; diff --git a/src/XUndefDevCur.c b/src/XUndefDevCur.c new file mode 100644 index 0000000..58a83a0 --- /dev/null +++ b/src/XUndefDevCur.c @@ -0,0 +1,47 @@ +/************************************************************ + +Copyright 2006 Peter Hutterer <peter@cs.unisa.edu.au> + +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 +OPEN GROUP 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 Open Group 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 Open Group. + +*/ + +/*********************************************************************** + * + * XDefineDeviceCursor - Change the cursor of an extension input device. + * + */ +#include <X11/extensions/XI.h> +#include <X11/extensions/XIproto.h> +#include <X11/Xlibint.h> +#include <X11/extensions/XInput.h> +#include <X11/extensions/extutil.h> +#include "XIint.h" + + +int XUndefDeviceCursor(dpy, dev, w) + register Display *dpy; + XDevice* dev; + Window w; +{ + return XDefineDeviceCursor(dpy, dev, w, None); +} + diff --git a/src/XWarpDvPtr.c b/src/XWarpDvPtr.c index 6bf8d34..f85f218 100644 --- a/src/XWarpDvPtr.c +++ b/src/XWarpDvPtr.c @@ -53,7 +53,7 @@ XWarpDevicePointer(dpy, dev, src_win, dst_win, src_x, src_y, src_width, LockDisplay(dpy); if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) - return ((XDeviceState *) NoSuchExtension); + return (NoSuchExtension); GetReq(WarpDevicePointer, req); req->reqType = info->codes->major_opcode; |