XAllowDv.c revision c43cc173
1/* $Xorg: XAllowDv.c,v 1.4 2001/02/09 02:03:50 xorgcvs Exp $ */ 2 3/************************************************************ 4 5Copyright 1989, 1998 The Open Group 6 7Permission to use, copy, modify, distribute, and sell this software and its 8documentation for any purpose is hereby granted without fee, provided that 9the above copyright notice appear in all copies and that both that 10copyright notice and this permission notice appear in supporting 11documentation. 12 13The above copyright notice and this permission notice shall be included in 14all copies or substantial portions of the Software. 15 16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 20AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 23Except as contained in this notice, the name of The Open Group shall not be 24used in advertising or otherwise to promote the sale, use or other dealings 25in this Software without prior written authorization from The Open Group. 26 27Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. 28 29 All Rights Reserved 30 31Permission to use, copy, modify, and distribute this software and its 32documentation for any purpose and without fee is hereby granted, 33provided that the above copyright notice appear in all copies and that 34both that copyright notice and this permission notice appear in 35supporting documentation, and that the name of Hewlett-Packard not be 36used in advertising or publicity pertaining to distribution of the 37software without specific, written prior permission. 38 39HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 40ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 41HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 42ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 43WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 44ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 45SOFTWARE. 46 47********************************************************/ 48/* $XFree86: xc/lib/Xi/XAllowDv.c,v 3.3 2001/12/14 19:55:03 dawes Exp $ */ 49 50/*********************************************************************** 51 * 52 * XAllowDeviceEvents - Thaw a frozen extension device. 53 * 54 */ 55 56#include <X11/extensions/XI.h> 57#include <X11/extensions/XIproto.h> 58#include <X11/Xlibint.h> 59#include <X11/extensions/XInput.h> 60#include <X11/extensions/extutil.h> 61#include "XIint.h" 62 63int 64XAllowDeviceEvents(dpy, dev, event_mode, time) 65 register Display *dpy; 66 XDevice *dev; 67 int event_mode; 68 Time time; 69{ 70 xAllowDeviceEventsReq *req; 71 XExtDisplayInfo *info = XInput_find_display(dpy); 72 73 LockDisplay(dpy); 74 if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) 75 return (NoSuchExtension); 76 77 GetReq(AllowDeviceEvents, req); 78 req->reqType = info->codes->major_opcode; 79 req->ReqType = X_AllowDeviceEvents; 80 req->deviceid = dev->device_id; 81 req->mode = event_mode; 82 req->time = time; 83 84 UnlockDisplay(dpy); 85 SyncHandle(); 86 return (Success); 87} 88