| 1 |
'\" t |
| 2 |
.\" Title: xiqueryversion |
| 3 |
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] |
| 4 |
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> |
| 5 |
.\" Date: 09/05/2024 |
| 6 |
.\" Manual: \ \& |
| 7 |
.\" Source: \ \& |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "XIQUERYVERSION" "libmansuffix" "09/05/2024" "\ \&" "\ \&" |
| 11 |
.\" ----------------------------------------------------------------- |
| 12 |
.\" * Define some portability stuff |
| 13 |
.\" ----------------------------------------------------------------- |
| 14 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 |
.\" http://bugs.debian.org/507673 |
| 16 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 17 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 |
.ie \n(.g .ds Aq \(aq |
| 19 |
.el .ds Aq ' |
| 20 |
.\" ----------------------------------------------------------------- |
| 21 |
.\" * set default formatting |
| 22 |
.\" ----------------------------------------------------------------- |
| 23 |
.\" disable hyphenation |
| 24 |
.nh |
| 25 |
.\" disable justification (adjust text to left margin only) |
| 26 |
.ad l |
| 27 |
.\" ----------------------------------------------------------------- |
| 28 |
.\" * MAIN CONTENT STARTS HERE * |
| 29 |
.\" ----------------------------------------------------------------- |
| 30 |
.SH "NAME" |
| 31 |
XIQueryVersion \- announce and query the support XI2 version\&. |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
.nf |
| 35 |
#include <X11/extensions/XInput2\&.h> |
| 36 |
.fi |
| 37 |
.sp |
| 38 |
.nf |
| 39 |
Status XIQueryVersion( Display *display, |
| 40 |
int *major_version_inout, |
| 41 |
int *minor_version_inout); |
| 42 |
.fi |
| 43 |
.sp |
| 44 |
.nf |
| 45 |
display |
| 46 |
Specifies the connection to the X server\&. |
| 47 |
.fi |
| 48 |
.sp |
| 49 |
.nf |
| 50 |
major_version_inout |
| 51 |
Specifies the client\*(Aqs supported XI2 version, and |
| 52 |
returns the server\*(Aqs supported version\&. |
| 53 |
.fi |
| 54 |
.sp |
| 55 |
.nf |
| 56 |
minor_version_inout |
| 57 |
Specifies the client\*(Aqs supported XI2 version, and |
| 58 |
returns the server\*(Aqs supported version\&. |
| 59 |
.fi |
| 60 |
.SH "DESCRIPTION" |
| 61 |
.sp |
| 62 |
.if n \{\ |
| 63 |
.RS 4 |
| 64 |
.\} |
| 65 |
.nf |
| 66 |
XIQueryVersion announces the client\*(Aqs supported XI2 version to |
| 67 |
the server and returns server\*(Aqs supported X Input version\&. Clients |
| 68 |
are required to use XIQueryVersion instead of XGetExtensionVersion |
| 69 |
if they use XI2 calls\&. The server may treat a client differently |
| 70 |
depending on the supported version announced by the client\&. |
| 71 |
The major_version_inout must be 2 or greater, otherwise a BadValue |
| 72 |
error occurs\&. |
| 73 |
.fi |
| 74 |
.if n \{\ |
| 75 |
.RE |
| 76 |
.\} |
| 77 |
.sp |
| 78 |
.if n \{\ |
| 79 |
.RS 4 |
| 80 |
.\} |
| 81 |
.nf |
| 82 |
If the server does not support XI2, XIQueryVersion returns BadRequest |
| 83 |
to the client\&. Otherwise, XIQueryVersion returns Success\&. In both |
| 84 |
cases major_version_inout and minor_version_inout are set to the |
| 85 |
server\*(Aqs supported version\&. |
| 86 |
.fi |
| 87 |
.if n \{\ |
| 88 |
.RE |
| 89 |
.\} |
| 90 |
.sp |
| 91 |
.if n \{\ |
| 92 |
.RS 4 |
| 93 |
.\} |
| 94 |
.nf |
| 95 |
If the client has previously called XIQueryVersion, then the result |
| 96 |
depends on the previously requested version and the currently |
| 97 |
requested version\&. |
| 98 |
.fi |
| 99 |
.if n \{\ |
| 100 |
.RE |
| 101 |
.\} |
| 102 |
.sp |
| 103 |
.if n \{\ |
| 104 |
.RS 4 |
| 105 |
.\} |
| 106 |
.nf |
| 107 |
If either the previous or current requested versions is less than |
| 108 |
2\&.2, or if the requested major version numbers do not match, then |
| 109 |
consecutive calls to XIQueryVersion by the same client always |
| 110 |
return the first returned major\&.minor version\&. If the client |
| 111 |
requests a version lower than the first returned major\&.minor |
| 112 |
version in a subsequent call, a BadValue error occurs\&. |
| 113 |
.fi |
| 114 |
.if n \{\ |
| 115 |
.RE |
| 116 |
.\} |
| 117 |
.sp |
| 118 |
.if n \{\ |
| 119 |
.RS 4 |
| 120 |
.\} |
| 121 |
.nf |
| 122 |
If all of the requested versions are 2\&.2 or greater, then |
| 123 |
consecutive calls to XIQueryVersion by the same client with the |
| 124 |
same major version will return the requested version, but the server |
| 125 |
will operate according to the highest requested version number or |
| 126 |
the highest supported version, whichever is lower\&. |
| 127 |
.fi |
| 128 |
.if n \{\ |
| 129 |
.RE |
| 130 |
.\} |
| 131 |
.sp |
| 132 |
.if n \{\ |
| 133 |
.RS 4 |
| 134 |
.\} |
| 135 |
.nf |
| 136 |
XIQueryVersion can generate a BadValue error\&. |
| 137 |
.fi |
| 138 |
.if n \{\ |
| 139 |
.RE |
| 140 |
.\} |
| 141 |
.SH "EXAMPLES" |
| 142 |
.sp |
| 143 |
.if n \{\ |
| 144 |
.RS 4 |
| 145 |
.\} |
| 146 |
.nf |
| 147 |
int rc; |
| 148 |
int major = 2; |
| 149 |
int minor = 0; |
| 150 |
.fi |
| 151 |
.if n \{\ |
| 152 |
.RE |
| 153 |
.\} |
| 154 |
.sp |
| 155 |
.if n \{\ |
| 156 |
.RS 4 |
| 157 |
.\} |
| 158 |
.nf |
| 159 |
rc = XIQueryVersion(dpy, &major, &minor); |
| 160 |
if (rc == Success) |
| 161 |
printf("XI2 supported\&. (%d\&.%d)\en", major, minor); |
| 162 |
else if (rc == BadRequest) |
| 163 |
printf("No XI2 support\&. (%d\&.%d only)\en", major, minor); |
| 164 |
else |
| 165 |
printf("Internal error\en"); |
| 166 |
.fi |
| 167 |
.if n \{\ |
| 168 |
.RE |
| 169 |
.\} |
| 170 |
.SH "DIAGNOSTICS" |
| 171 |
.sp |
| 172 |
.if n \{\ |
| 173 |
.RS 4 |
| 174 |
.\} |
| 175 |
.nf |
| 176 |
BadValue |
| 177 |
A value is outside of the permitted range\&. |
| 178 |
.fi |
| 179 |
.if n \{\ |
| 180 |
.RE |
| 181 |
.\} |