upload tizen2.0 source
[framework/uifw/xorg/lib/libxres.git] / man / XRes.man
1 .\"
2 .\" Copyright (C) 1994-2003 The XFree86 Project, Inc.  All Rights Reserved.
3 .\"
4 .\" Permission is hereby granted, free of charge, to any person obtaining
5 .\" a copy of this software and associated documentation files (the
6 .\" "Software"), to deal in the Software without restriction, including
7 .\" without limitation the rights to use, copy, modify, merge, publish,
8 .\" distribute, sublicense, and/or sell copies of the Software, and to
9 .\" permit persons to whom the Software is furnished to do so, subject to
10 .\" the following conditions:
11 .\"
12 .\" The above copyright notice and this permission notice shall be
13 .\" included in all copies or substantial portions of the Software.
14 .\"
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 .\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
18 .\" IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES
19 .\" OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 .\"
23 .\" Except as contained in this notice, the name of the XFree86 Project
24 .\" shall not be used in advertising or otherwise to promote the sale, use
25 .\" or other dealings in this Software without prior written authorization
26 .\" from the XFree86 Project.
27 .\"
28 .TH XRes __libmansuffix__ __vendorversion__
29 .SH NAME
30 XRes \- X-Resource extension client library
31 .SH SYNOPSIS
32 .B #include <X11/extensions/XRes.h>
33 .PP
34 .nf
35 .ta .5i 2i
36 typedef struct {
37         XID     resource_base;
38         XID     resource_mask;
39 } XResClient;
40
41 typedef struct {
42         Atom    resource_type;
43         unsigned int    count;
44 } XResType;
45 .fi
46 .HP
47 Bool XResQueryExtension(Display *\fIdpy\fP,
48 int *\fIevent_base_return\fP, int *\fIerror_base_return\fP\^);
49 .HP
50 Status XResQueryVersion(Display *\fIdpy\fP, int *\fImajor_version_return\fP,
51 int *\fIminor_version_return\fP\^);
52 .HP
53 Status XResQueryClients(Display *\fIdpy\fP, int *\fInum_clients\fP,
54 XResClient **\fIclients\fP\^);
55 .HP
56 Status XResQueryClientResources(Display *\fIdpy\fP, XID \fIxid\fP,
57 int *\fInum_types\fP, XResType **\fItypes\fP\^);
58 .HP
59 Status XResQueryClientPixmapBytes(Display *\fIdpy\fP, XID \fIxid\fP,
60 unsigned long *\fIbytes\fP\^);
61 .PP
62 .SH DESCRIPTION
63 .B X-Resource
64 is an extension that allows a client to query the X
65 server about its usage of various resources.  It should not be confused
66 with the X resource database access functions.
67 .PP
68 .B XResQueryExtension
69 returns
70 .B True
71 if the
72 .I XRes
73 extension is available on the given display.
74 A client must call
75 .B XResQueryExtension
76 before calling any other XRes function in order
77 to negotiate a compatible protocol version; otherwise the client will
78 get undefined behavior (XRes may or may not work).
79 .PP
80 .B XResQueryVersion
81 returns
82 .B True
83 if the request succeeded; the values of the major and minor protocol
84 versions supported by the server are returned in
85 .I major_version_return
86 and
87 .I minor_version_return .
88 .PP
89 .PP
90 .B XResQueryClients
91 fills a list of clients of the given display. For each client it
92 returns in the
93 .I XResClient
94 structure a mask and a base value of the resources used by these
95 clients.
96 Returns
97 .B True
98 on success or
99 .B False
100 on failure.
101 .PP
102 .B XResQueryClientResources
103 fills a list of
104 XResType
105 structures, indicating for each resource type allocated by the client its
106 name (as an Atom) and the number of resources of this type allocated.
107 Returns
108 .B True
109 on success or
110 .B False
111 on failure.
112 .PP
113 .B XResQueryClientPixmapBytes
114 gives, for resources of type
115 .I PIXMAP
116 the total number of bytes allocated in the X server by the given
117 client.
118 Returns
119 .B True
120 on success or
121 .B False
122 on failure.
123 .SH "ERRORS"
124 .B XResQueryClientResources
125 and
126 .B XResQueryClientPixmapBytes
127 will return
128 .I BadValue
129 if passed an illegal client identifier.
130 .SH "SEE ALSO"
131 X(__miscmansuffix__)
132 .SH AUTHOR
133 Mark Vojkovich, originally for The XFree86 Project Inc.
134 .SH STABILITY
135 This API is considered as experimental. The XRes library major
136 revision may be incremented whenever incompatible changes are done to
137 the API without notice. Use with care.