diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-04-17 15:16:25 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-04-17 15:16:25 +0000 |
commit | 4e1e443e6780e82c93717c7892275755ffd40616 (patch) | |
tree | 1ff5845de530f86a0584ec1e04eced7bb0111f24 /lib/libXfixes/src | |
parent | d8fbc2e900062cfae750af3c73dbf6c8f1245acc (diff) |
Update to libXfixes 5.0
Diffstat (limited to 'lib/libXfixes/src')
-rw-r--r-- | lib/libXfixes/src/Cursor.c | 60 | ||||
-rw-r--r-- | lib/libXfixes/src/Xfixesint.h | 2 |
2 files changed, 60 insertions, 2 deletions
diff --git a/lib/libXfixes/src/Cursor.c b/lib/libXfixes/src/Cursor.c index edd179d37..0d656f7ad 100644 --- a/lib/libXfixes/src/Cursor.c +++ b/lib/libXfixes/src/Cursor.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -274,3 +275,62 @@ XFixesShowCursor (Display *dpy, Window win) UnlockDisplay (dpy); SyncHandle (); } + +PointerBarrier +XFixesCreatePointerBarrier(Display *dpy, Window w, int x1, int y1, + int x2, int y2, int directions, + int num_devices, int *devices) +{ + XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); + xXFixesCreatePointerBarrierReq *req; + PointerBarrier barrier; + int extra = 0; + + XFixesCheckExtension (dpy, info, 0); + if (info->major_version < 5) + return 0; + + if (num_devices) + extra = (((2 * num_devices) + 3) / 4) * 4; + + LockDisplay (dpy); + GetReqExtra (XFixesCreatePointerBarrier, extra, req); + req->reqType = info->codes->major_opcode; + req->xfixesReqType = X_XFixesCreatePointerBarrier; + barrier = req->barrier = XAllocID (dpy); + req->window = w; + req->x1 = x1; + req->y1 = y1; + req->x2 = x2; + req->y2 = y2; + req->directions = directions; + if ((req->num_devices = num_devices)) { + int i; + CARD16 *devs = (CARD16 *)(req + 1); + for (i = 0; i < num_devices; i++) + devs[i] = (CARD16)(devices[i]); + } + + UnlockDisplay (dpy); + SyncHandle(); + return barrier; +} + +void +XFixesDestroyPointerBarrier(Display *dpy, PointerBarrier b) +{ + XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); + xXFixesDestroyPointerBarrierReq *req; + + XFixesSimpleCheckExtension (dpy, info); + if (info->major_version < 5) + return; + + LockDisplay (dpy); + GetReq (XFixesDestroyPointerBarrier, req); + req->reqType = info->codes->major_opcode; + req->xfixesReqType = X_XFixesDestroyPointerBarrier; + req->barrier = b; + UnlockDisplay (dpy); + SyncHandle(); +} diff --git a/lib/libXfixes/src/Xfixesint.h b/lib/libXfixes/src/Xfixesint.h index 8f0c0b14b..2ee17bcee 100644 --- a/lib/libXfixes/src/Xfixesint.h +++ b/lib/libXfixes/src/Xfixesint.h @@ -24,8 +24,6 @@ #ifndef _XFIXESINT_H_ #define _XFIXESINT_H_ -#define NEED_EVENTS -#define NEED_REPLIES #include <stdio.h> #include <X11/Xlib.h> #include <X11/Xlibint.h> |