summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-05-07 14:13:40 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-05-07 14:13:40 +0930
commitf8215ada9c1f3e8f001c77362005168492e35cf4 (patch)
tree730c6c6c8b73baa3300d6c8bed468b73d17bdc3d
parentd76c4412c9fab7dae6b0283feb847174fb19d1fe (diff)
Add XiSelectEvent call.
Should have been part of 44ccc08bb19d9d55fb9ff6bfb0592d5d79b9b712.
-rw-r--r--src/XiSelEv.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/XiSelEv.c b/src/XiSelEv.c
new file mode 100644
index 0000000..e94e807
--- /dev/null
+++ b/src/XiSelEv.c
@@ -0,0 +1,62 @@
+/************************************************************
+
+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
+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.
+
+*/
+
+/***********************************************************************
+ *
+ * XiSelectEvent - Select an event using the GE extension.
+ *
+ */
+
+
+#include <X11/Xlibint.h>
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include <X11/extensions/extutil.h>
+#include <X11/extensions/ge.h>
+#include <X11/extensions/geproto.h>
+#include "XIint.h"
+
+int
+XiSelectEvent(Display* dpy, Window win, Mask mask)
+{
+ xXiSelectEventReq* req;
+
+ XExtDisplayInfo *info = XInput_find_display(dpy);
+
+ LockDisplay(dpy);
+ if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
+ return (NoSuchExtension);
+
+ GetReq(XiSelectEvent, req);
+ req->reqType = info->codes->major_opcode;
+ req->ReqType = X_XiSelectEvent;
+ req->window = win;
+ req->mask = mask;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return Success;
+}