[PATCH] libXfixes v5: Pointer barriers

Adam Jackson ajax at redhat.com
Wed Feb 9 15:08:53 PST 2011


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 configure.ac                    |    2 +-
 include/X11/extensions/Xfixes.h |   14 +++++++++++
 src/Cursor.c                    |   48 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 63 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index cf9a8d4..fc8c1e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,7 @@ AC_PREREQ([2.60])
 # that 'revision' number appears in Xfixes.h and has to be manually
 # synchronized.
 #
-AC_INIT(libXfixes, [4.0.5],
+AC_INIT(libXfixes, [5.0],
 	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXfixes])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
diff --git a/include/X11/extensions/Xfixes.h b/include/X11/extensions/Xfixes.h
index 0c00310..65d66a1 100644
--- a/include/X11/extensions/Xfixes.h
+++ b/include/X11/extensions/Xfixes.h
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2010 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"),
@@ -249,6 +250,19 @@ XFixesShowCursor (Display *dpy, Window win);
 
 #endif /* XFIXES_MAJOR >= 4 */
 
+#if XFIXES_MAJOR >= 5
+
+typedef XID PointerBarrier;
+
+PointerBarrier
+XFixesCreatePointerBarrier(Display *dpy, Window w, CARD16 x1, CARD16 y1,
+			   CARD16 x2, CARD16 y2, CARD32 directions);
+
+void
+XFixesDestroyPointerBarrier(Display *dpy, PointerBarrier b);
+
+#endif /* XFIXES_MAJOR >= 5 */
+
 _XFUNCPROTOEND
 
 #endif /* _XFIXES_H_ */
diff --git a/src/Cursor.c b/src/Cursor.c
index edd179d..94d0e6f 100644
--- a/src/Cursor.c
+++ b/src/Cursor.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2010 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,50 @@ XFixesShowCursor (Display *dpy, Window win)
     UnlockDisplay (dpy);
     SyncHandle ();
 }
+
+PointerBarrier
+XFixesCreatePointerBarrier(Display *dpy, Window w, CARD16 x1, CARD16 y1,
+			   CARD16 x2, CARD16 y2, CARD32 directions)
+{
+    XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy);
+    xXFixesCreatePointerBarrierReq *req;
+    PointerBarrier barrier;
+
+    XFixesCheckExtension (dpy, info, 0);
+    if (info->major_version < 5)
+	return 0;
+
+    LockDisplay (dpy);
+    GetReq (XFixesCreatePointerBarrier, 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;
+    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();
+}
-- 
1.7.3.5



More information about the xorg-devel mailing list