XIQueryVersion.txt revision f1ee322d
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 Consecutive calls to XIQueryVersion by the same client always return the 46 first returned major.minor version. If the client requests a version 47 lower than the first returned major.minor version in a subsequent call, a 48 BadValue error occurs. 49 50 XIQueryVersion can generate a BadValue error. 51 52EXAMPLES 53-------- 54 55 int rc; 56 int major = 2; 57 int minor = 0; 58 59 rc = XIQueryVersion(dpy, &major, &minor); 60 if (rc == Success) 61 printf("XI2 supported. (%d.%d)\n", major, minor); 62 else if (rc == BadRequest) 63 printf("No XI2 support. (%d.%d only)\n", major, minor); 64 else 65 printf("Internal error\n"); 66 67DIAGNOSTICS 68----------- 69 70 BadValue 71 A value is outside of the permitted range. 72 73