121e67964Smrg/************************************************************ 221e67964Smrg 321e67964SmrgCopyright 2008 Peter Hutterer 421e67964Smrg 521e67964SmrgPermission to use, copy, modify, distribute, and sell this software and its 621e67964Smrgdocumentation for any purpose is hereby granted without fee, provided that 721e67964Smrgthe above copyright notice appear in all copies and that both that 821e67964Smrgcopyright notice and this permission notice appear in supporting 921e67964Smrgdocumentation. 1021e67964Smrg 1121e67964SmrgThe above copyright notice and this permission notice shall be included in 1221e67964Smrgall copies or substantial portions of the Software. 1321e67964Smrg 1421e67964SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1521e67964SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1621e67964SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1721e67964SmrgAUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 1821e67964SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 1921e67964SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 2021e67964Smrg 2121e67964SmrgExcept as contained in this notice, the name of the author shall not be 2221e67964Smrgused in advertising or otherwise to promote the sale, use or other dealings 2321e67964Smrgin this Software without prior written authorization from the author. 2421e67964Smrg 2521e67964Smrg*/ 2621e67964Smrg 2721e67964Smrg/*********************************************************************** 2821e67964Smrg * XDeleteDeviceProperties - delete an input device's properties. 2921e67964Smrg * 3021e67964Smrg */ 3121e67964Smrg 3221e67964Smrg#ifdef HAVE_CONFIG_H 3321e67964Smrg#include <config.h> 3421e67964Smrg#endif 3521e67964Smrg 3621e67964Smrg#include <X11/Xlibint.h> 3721e67964Smrg#include <X11/extensions/XI.h> 3821e67964Smrg#include <X11/extensions/XIproto.h> 3921e67964Smrg#include <X11/extensions/XInput.h> 4021e67964Smrg#include <X11/extensions/extutil.h> 4121e67964Smrg#include "XIint.h" 4221e67964Smrg 4321e67964Smrgvoid 4421e67964SmrgXDeleteDeviceProperty(Display* dpy, XDevice* dev, Atom property) 4521e67964Smrg{ 4621e67964Smrg xDeleteDevicePropertyReq *req; 4721e67964Smrg 4821e67964Smrg XExtDisplayInfo *info = XInput_find_display(dpy); 4921e67964Smrg 5021e67964Smrg LockDisplay(dpy); 5121e67964Smrg if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) 5221e67964Smrg return; 5321e67964Smrg 5421e67964Smrg GetReq(DeleteDeviceProperty, req); 5521e67964Smrg req->reqType = info->codes->major_opcode; 5621e67964Smrg req->ReqType = X_DeleteDeviceProperty; 5721e67964Smrg req->deviceid = dev->device_id; 5821e67964Smrg req->property = property; 5921e67964Smrg 6021e67964Smrg UnlockDisplay(dpy); 6121e67964Smrg SyncHandle(); 6221e67964Smrg return; 6321e67964Smrg} 6421e67964Smrg 65