cursor: Move pointer barrier code over to XI

In order to send events to specific windows associated with the barrier,
we need to move the code that handles barriers to somewhere where it's
easier to construct and send events. Rather than duplicating XSync with
its XSyncSelectAlarm, re-use the existing XI infrastructure.

For now, just move a bunch of code over, rename some things, and initialize
the new structures, but still consider it a separate codebase. Pointer barrier
requests are still handled by XFixes, so this is a weird intermediate state.
It's unknown whether we'll add explicit requests to pointer barriers inside
XI.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Jasper St. Pierre 2012-11-01 14:14:13 -04:00 committed by Peter Hutterer
commit 482e0cb352
6 changed files with 606 additions and 444 deletions

View file

@ -30,7 +30,6 @@
#include "resource.h"
extern _X_EXPORT RESTYPE RegionResType;
extern _X_EXPORT RESTYPE PointerBarrierType;
extern _X_EXPORT int XFixesErrorBase;
#define VERIFY_REGION(pRegion, rid, client, mode) \
@ -52,20 +51,6 @@ extern _X_EXPORT int XFixesErrorBase;
extern _X_EXPORT RegionPtr
XFixesRegionCopy(RegionPtr pRegion);
struct PointerBarrier {
CARD16 x1, x2, y1, y2;
CARD32 directions;
};
extern int
barrier_get_direction(int, int, int, int);
extern BOOL
barrier_is_blocking(const struct PointerBarrier *, int, int, int, int,
double *);
extern BOOL barrier_is_blocking_direction(const struct PointerBarrier *, int);
extern void
barrier_clamp_to_barrier(struct PointerBarrier *barrier, int dir, int *x,
int *y);
#include "xibarriers.h"
#endif /* _XFIXES_H_ */