summaryrefslogtreecommitdiff
path: root/src/XGetVers.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-04-26 17:07:39 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-04-27 16:31:52 +0930
commitc142891001e53b3c9d1d4a0cfcb0ff555c2f0070 (patch)
tree788b0ac42f52fbab4c896c71a6c928a4b1785c9f /src/XGetVers.c
parent94284e40f5fc9bf30cc2cc5915f6adb22de7bffe (diff)
Deprecate XGetExtensionVersion(), replace with XQueryInputVersion().
We need XI to be able to do some sort of versioning support.
Diffstat (limited to 'src/XGetVers.c')
-rw-r--r--src/XGetVers.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/XGetVers.c b/src/XGetVers.c
index d3c765a..863e290 100644
--- a/src/XGetVers.c
+++ b/src/XGetVers.c
@@ -60,14 +60,36 @@ SOFTWARE.
#include <X11/extensions/extutil.h>
#include "XIint.h"
-XExtensionVersion *
+/* DEPRECATED
+ *
+ * Pre-MPX versions will use this call. Major/minor is undefined in the
+ * request.
+ */
+_X_DEPRECATED XExtensionVersion *
XGetExtensionVersion(register Display * dpy, _Xconst char *name)
{
XExtensionVersion *ext;
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay(dpy);
- ext = _XiGetExtensionVersion(dpy, name, info);
+ ext = _XiGetExtensionVersion(dpy, name, 0, 0, info);
+ if (ext != (XExtensionVersion *) NoSuchExtension) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ }
+ return (ext);
+}
+
+/* Query X Input extension version. To be used post-MPX.
+ */
+XExtensionVersion *
+XQueryInputVersion(Display *dpy, int major, int minor)
+{
+ XExtensionVersion *ext;
+ XExtDisplayInfo *info = XInput_find_display(dpy);
+
+ LockDisplay(dpy);
+ ext = _XiGetExtensionVersion(dpy, NULL, major, minor, info);
if (ext != (XExtensionVersion *) NoSuchExtension) {
UnlockDisplay(dpy);
SyncHandle();
@@ -76,7 +98,8 @@ XGetExtensionVersion(register Display * dpy, _Xconst char *name)
}
XExtensionVersion *
-_XiGetExtensionVersion(register Display * dpy, _Xconst char *name, XExtDisplayInfo *info)
+_XiGetExtensionVersion(register Display * dpy, _Xconst char *name,
+ int major, int minor, XExtDisplayInfo *info)
{
xGetExtensionVersionReq *req;
xGetExtensionVersionReply rep;
@@ -90,6 +113,8 @@ _XiGetExtensionVersion(register Display * dpy, _Xconst char *name, XExtDisplayIn
req->ReqType = X_GetExtensionVersion;
req->nbytes = name ? strlen(name) : 0;
req->length += (unsigned)(req->nbytes + 3) >> 2;
+ req->majorVersion = major;
+ req->minorVersion = minor;
_XSend(dpy, name, (long)req->nbytes);
if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {