summaryrefslogtreecommitdiff
path: root/man/XRes.man
blob: 1ce24b911e3dc9ad2e9d3b37cbe5a5aeece5d1d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
.\"
.\" $XFree86: xc/lib/XRes/XRes.man,v 1.3 2003/12/04 19:10:30 dawes Exp $
.\"
.\" Copyright (C) 1994-2003 The XFree86 Project, Inc.  All Rights Reserved.
.\" 
.\" Permission is hereby granted, free of charge, to any person obtaining
.\" a copy of this software and associated documentation files (the
.\" "Software"), to deal in the Software without restriction, including
.\" without limitation the rights to use, copy, modify, merge, publish,
.\" distribute, sublicense, and/or sell copies of the Software, and to
.\" permit persons to whom the Software is furnished to do so, subject to
.\" the following conditions:
.\" 
.\" The above copyright notice and this permission notice shall be
.\" included in all copies or substantial portions of the Software.
.\" 
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
.\" IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES
.\" OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.\" 
.\" Except as contained in this notice, the name of the XFree86 Project
.\" shall not be used in advertising or otherwise to promote the sale, use
.\" or other dealings in this Software without prior written authorization
.\" from the XFree86 Project.
.\" 
.TH XRes 3 __vendorversion__
.SH NAME
XRes \- X-Resource extension client library
.SH SYNOPSIS
.B #include <X11/extension/XRes.h>
.PP
.nf
.ta .5i 2i
typedef struct {
	XID	resource_base;
	XID	resource_mask;
} XResClient;

typedef struct {
	Atom	resource_type;
	unsigned int	count;
} XResType;
.fi
.HP
Bool XResQueryExtension(Display *\fIdpy\fP, 
int *\fIevent_basep\fP, int *\fIerror_basep\fP\^);
.HP
Status XResQueryVersion(Display *\fIdpy\fP, int *\fImajor_versionp\fP,
int *\fIminor_versionp\fP\^);
.HP
Status XResQueryClients(Display *\fIdpy\fP, int *\fInum_clients\fP, 
XResClient **\fIclients\fP\^);
.HP
Status XResQueryClientResources(Display *\fIdpy\fP, XID \fIxid\fP, 
int *\fInum_types\fP, XResType **\fItypes\fP\^);
.HP
Status XResQueryClientPixmapBytes(Display *\fIdpy\fP, XID \fIxid\fP, 
unsigned long *\fIbytes\fP\^);
.PP
.SH DESCRIPTION
.B X-Resource
is an extension that allows a client to query the X
server about its usage of various resources. It should not be mixed
with the X resource database access functions.
.PP
.B XResQueryExtension
returns
.B True
if the 
.I XRes
extension is available on the given display.
A client must call 
.B XResQueryExtension
before calling any other XRes function in order
to negotiate a compatible protocol version; otherwise the client will
get undefined behavior (XRes may or may not work).
.PP
.B XResQueryVersion
returns
.B True
if the request succeeded; the values of the major and minor protocol
versions supported by the server are returned in 
.I major_versionp 
and 
.I minor_versionp .
.PP
.PP
.B XResQueryClients 
fills a list of clients of the given display. For each client it
returns in the 
.I XResClient
structure a mask and a base value of the resources used by these
clients. 
Returns 
.B True
on success or 
.B False
on failure. 
.PP
.B XResQueryClientResources
fills a list of 
XResType
structures, indicating for each resource type allocated by the client its
name (as an Atom) and the number of resources of this type allocated. 
Returns 
.B True
on success or 
.B False
on failure. 
.PP
.B XresQueryClientPixmapBytes
gives, for resources of type 
.I PIXMAP
the total number of bytes allocated in the X server by the given
client. 
Returns 
.B True
on success or 
.B False
on failure. 
.SH "ERRORS"
.B XResQueryClientResources
and
.B XResQueryClientPixmapBytes
will return 
.I BadValue
if passed an illegal client identifier. 
.SH "SEE ALSO"
Xlib(1), X(7)
.SH AUTHOR
Mark Vojkovich, for The XFree86 Project Inc. 
.SH STABILITY
This API is considered as experimental. The XRes library major
revision may be incremented whenever incompatible changes are done to
the API without notice. Use with care.