diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-31 18:02:02 +1030 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-31 18:02:02 +1030 |
commit | f938c524f74fa8828a954bed51d0f3c4c7eb0fad (patch) | |
tree | d462dd884a68ab0114c25b75790566d23b8a6e9b /src | |
parent | e5c529813b04327babc20e51ca56006210cb0c37 (diff) |
Purge device-based window access code.
Requires inputproto 1.9.99.6.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rw-r--r-- | src/XAllowDv.c | 84 | ||||
-rw-r--r-- | src/XChAccRl.c | 62 | ||||
-rw-r--r-- | src/XClrAcc.c | 63 | ||||
-rw-r--r-- | src/XDenyDev.c | 69 | ||||
-rw-r--r-- | src/XPermDev.c | 69 | ||||
-rw-r--r-- | src/XQryAccRl.c | 99 |
7 files changed, 0 insertions, 452 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index df7d375..0d6071c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,8 +3,6 @@ lib_LTLIBRARIES = libXi.la libXi_la_SOURCES = \ - XAllowDv.c \ - XChAccRl.c \ XChDevHier.c \ XChDProp.c \ XChgDCtl.c \ @@ -13,11 +11,9 @@ libXi_la_SOURCES = \ XChgKMap.c \ XChgPnt.c \ XChgProp.c \ - XClrAcc.c \ XCloseDev.c \ XDefDevCur.c \ XDelDProp.c \ - XDenyDev.c \ XDevBell.c \ XExtGrabDev.c \ XExtToWire.c \ @@ -39,8 +35,6 @@ libXi_la_SOURCES = \ XListDev.c \ XListDProp.c \ XOpenDev.c \ - XPermDev.c \ - XQryAccRl.c \ XQueryDv.c \ XQueryDvPtr.c \ XSelect.c \ diff --git a/src/XAllowDv.c b/src/XAllowDv.c deleted file mode 100644 index d19443d..0000000 --- a/src/XAllowDv.c +++ /dev/null @@ -1,84 +0,0 @@ -/************************************************************ - -Copyright 1989, 1998 The Open Group - -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. - -Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Hewlett-Packard not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/*********************************************************************** - * - * XAllowDeviceEvents - Thaw a frozen extension 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 -XAllowDeviceEvents( - register Display *dpy, - XDevice *dev, - int event_mode, - Time time) -{ - xAllowDeviceEventsReq *req; - XExtDisplayInfo *info = XInput_find_display(dpy); - - LockDisplay(dpy); - if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) - return (NoSuchExtension); - - GetReq(AllowDeviceEvents, req); - req->reqType = info->codes->major_opcode; - req->ReqType = X_AllowDeviceEvents; - req->deviceid = dev->device_id; - req->mode = event_mode; - req->time = time; - - UnlockDisplay(dpy); - SyncHandle(); - return (Success); -} diff --git a/src/XChAccRl.c b/src/XChAccRl.c deleted file mode 100644 index bd57e3f..0000000 --- a/src/XChAccRl.c +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************ - -Copyright 2007 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. - -*/ - -/*********************************************************************** - * - * XChangeAccessRule - Change default rule for a window. - * - */ - -#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" - -Status -XChangeAccessRule(Display* dpy, Window win, int rule) -{ - xChangeWindowAccessReq* req; - XExtDisplayInfo *info = XInput_find_display(dpy); - - LockDisplay(dpy); - if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) - return (NoSuchExtension); - - GetReq(ChangeWindowAccess, req); - req->reqType = info->codes->major_opcode; - req->ReqType = X_ChangeWindowAccess; - req->win = win; - req->clear = WindowAccessClearNone; - req->defaultRule = rule; - req->ndeny = 0; - req->npermit = 0; - - UnlockDisplay(dpy); - SyncHandle(); - return Success; -} diff --git a/src/XClrAcc.c b/src/XClrAcc.c deleted file mode 100644 index a0f028f..0000000 --- a/src/XClrAcc.c +++ /dev/null @@ -1,63 +0,0 @@ -/************************************************************ - -Copyright 2007 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. - -*/ - -/*********************************************************************** - * - * XWindowClearAccess - Clear the access restrictions of a window. - * - */ - -#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" - -Status -XWindowClearAccess(Display* dpy, Window win, int what) -{ - xChangeWindowAccessReq* req; - - XExtDisplayInfo *info = XInput_find_display(dpy); - - LockDisplay(dpy); - if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) - return (NoSuchExtension); - - GetReq(ChangeWindowAccess, req); - req->reqType = info->codes->major_opcode; - req->ReqType = X_ChangeWindowAccess; - req->win = win; - req->clear = what; - req->defaultRule = WindowAccessKeepRule; - req->ndeny = 0; - req->npermit = 0; - - UnlockDisplay(dpy); - SyncHandle(); - return Success; -} diff --git a/src/XDenyDev.c b/src/XDenyDev.c deleted file mode 100644 index 686ef12..0000000 --- a/src/XDenyDev.c +++ /dev/null @@ -1,69 +0,0 @@ -/************************************************************ - -Copyright 2007 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. - -*/ - -/*********************************************************************** - * - * XDenyDevices - Change list of devices denied to access a window. - * - */ - -#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" - -Status -XDenyDevices(Display* dpy, Window win, XID* devices, int count) -{ - xChangeWindowAccessReq* req; - - XExtDisplayInfo *info = XInput_find_display(dpy); - - LockDisplay(dpy); - if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) - return (NoSuchExtension); - - GetReq(ChangeWindowAccess, req); - req->reqType = info->codes->major_opcode; - req->ReqType = X_ChangeWindowAccess; - req->win = win; - /* If list is empty, clear all devices */ - if (!count) - req->clear = WindowAccessClearDeny; - else - req->clear = WindowAccessClearNone; - req->defaultRule = WindowAccessKeepRule; - req->ndeny = count; - req->length += (count * sizeof(XID) + 3) >> 2; - req->npermit = 0; - Data(dpy, (char*)devices, count * sizeof(XID)); - - UnlockDisplay(dpy); - SyncHandle(); - return Success; -} diff --git a/src/XPermDev.c b/src/XPermDev.c deleted file mode 100644 index 1e5cd1e..0000000 --- a/src/XPermDev.c +++ /dev/null @@ -1,69 +0,0 @@ -/************************************************************ - -Copyright 2007 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. - -*/ - -/*********************************************************************** - * - * XPermitDevices - Change list of devices allowed to access a window. - * - */ - -#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" - -Status -XPermitDevices(Display* dpy, Window win, XID* devices, int count) -{ - xChangeWindowAccessReq* req; - - XExtDisplayInfo *info = XInput_find_display(dpy); - - LockDisplay(dpy); - if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) - return (NoSuchExtension); - - GetReq(ChangeWindowAccess, req); - req->reqType = info->codes->major_opcode; - req->ReqType = X_ChangeWindowAccess; - req->win = win; - /* If list is empty, clear all devices */ - if (! count) - req->clear = WindowAccessClearPerm; - else - req->clear = WindowAccessClearNone; - req->defaultRule = WindowAccessKeepRule; - req->npermit = count; - req->length += (count * sizeof(XID) + 3) >> 2; - req->ndeny = 0; - Data(dpy, (char*)devices, count * sizeof(XID)); - - UnlockDisplay(dpy); - SyncHandle(); - return Success; -} diff --git a/src/XQryAccRl.c b/src/XQryAccRl.c deleted file mode 100644 index 20dddc7..0000000 --- a/src/XQryAccRl.c +++ /dev/null @@ -1,99 +0,0 @@ -/************************************************************ - -Copyright 2007 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. - -*/ - -/*********************************************************************** - * - * XQueryAccess - Query access restrictions on given window. - * - */ - -#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" - -Status -XQueryWindowAccess(Display* dpy, - Window win, - int* rule, - XID** permdevs, - int* nperm, - XID** denydevs, - int* ndeny) -{ - xQueryWindowAccessReq* req; - xQueryWindowAccessReply rep; - - XExtDisplayInfo *info = XInput_find_display(dpy); - - LockDisplay(dpy); - if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) - return (NoSuchExtension); - - GetReq(QueryWindowAccess, req); - req->reqType = info->codes->major_opcode; - req->ReqType = X_QueryWindowAccess; - req->win = win; - - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return BadImplementation; - } - - *rule = rep.defaultRule; - *nperm = rep.npermit; - *ndeny = rep.ndeny; - *permdevs = (XID *)Xmalloc(*nperm * sizeof(XID)); - if (!*permdevs) - { - _XEatData(dpy, (unsigned long)rep.length << 2); - UnlockDisplay(dpy); - SyncHandle(); - return BadImplementation; - } - - *denydevs = (XID*)Xmalloc(*ndeny * sizeof(XID)); - if (!*denydevs) - { - _XEatData(dpy, (unsigned long)rep.length << 2); - UnlockDisplay(dpy); - SyncHandle(); - return BadImplementation; - } - _XRead(dpy, (char*)*permdevs, *nperm * sizeof(XID)); - _XRead(dpy, (char*)*denydevs, *ndeny * sizeof(XID)); - - /* discard padding */ - _XEatData(dpy, (rep.length << 2) - (*ndeny * sizeof(XID)) - (*nperm * sizeof(XID))); - - UnlockDisplay(dpy); - SyncHandle(); - return Success; - -} |