1XIQUERYVERSION(libmansuffix)
2============================
3
4NAME
5----
6
7   XIQueryVersion - announce and query the support XI2 version.
8
9SYNOPSIS
10--------
11
12   #include <X11/extensions/XInput2.h>
13
14   Status XIQueryVersion( Display *display,
15                          int *major_version_inout,
16                          int *minor_version_inout);
17   
18   display
19          Specifies the connection to the X server.
20
21   major_version_inout
22          Specifies the client's supported XI2 version, and
23          returns the server's supported version.
24
25   minor_version_inout
26          Specifies the client's supported XI2 version, and
27          returns the server's supported version.
28
29DESCRIPTION
30-----------
31
32   XIQueryVersion announces the client's supported XI2 version to
33   the server and returns server's supported X Input version. Clients 
34   are required to use XIQueryVersion instead of XGetExtensionVersion 
35   if they use XI2 calls. The server may treat a client differently 
36   depending on the supported version announced by the client.
37   The major_version_inout must be 2 or greater, otherwise a BadValue 
38   error occurs.
39
40   If the server does not support XI2, XIQueryVersion returns BadRequest 
41   to the client. Otherwise, XIQueryVersion returns Success. In both 
42   cases major_version_inout and minor_version_inout are set to the 
43   server's supported version.
44
45   If the client has previously called XIQueryVersion, then the result
46   depends on the previously requested version and the currently
47   requested version.
48
49   If either the previous or current requested versions is less than
50   2.2, or if the requested major version numbers do not match, then
51   consecutive calls to XIQueryVersion by the same client always
52   return the first returned major.minor version. If the client
53   requests a version lower than the first returned major.minor
54   version in a subsequent call, a BadValue error occurs.
55
56   If all of the requested versions are 2.2 or greater, then
57   consecutive calls to XIQueryVersion by the same client with the
58   same major version will return the requested version, but the server
59   will operate according to the highest requested version number or
60   the highest supported version, whichever is lower.
61
62   XIQueryVersion can generate a BadValue error.
63
64EXAMPLES
65--------
66
67        int rc;
68        int major = 2;
69        int minor = 0;
70
71        rc = XIQueryVersion(dpy, &major, &minor);
72        if (rc == Success)
73            printf("XI2 supported. (%d.%d)\n", major, minor);
74        else if (rc == BadRequest)
75            printf("No XI2 support. (%d.%d only)\n", major, minor);
76        else
77            printf("Internal error\n");
78
79DIAGNOSTICS
80-----------
81
82   BadValue
83          A value is outside of the permitted range.
84
85