Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
75 lines (73 sloc) 2.53 KB
.TH xcb_alloc_color 3 2011-12-18 "XCB" "XCB Requests"
.ad l
.SH NAME
xcb_alloc_color \- Allocate a color
.SH SYNOPSIS
.hy 0
.B #include <xcb/xproto.h>
.SS Request function
.HP
xcb_alloc_color_cookie_t \fBxcb_alloc_color\fP(xcb_connection_t\ *\fIconn\fP, xcb_colormap_t\ \fIcmap\fP, uint16_t\ \fIred\fP, uint16_t\ \fIgreen\fP, uint16_t\ \fIblue\fP);
.PP
.SS Reply datastructure
.nf
.sp
typedef struct xcb_alloc_color_reply_t {
uint8_t \fIresponse_type\fP;
uint8_t \fIpad0\fP;
uint16_t \fIsequence\fP;
uint32_t \fIlength\fP;
uint16_t \fIred\fP;
uint16_t \fIgreen\fP;
uint16_t \fIblue\fP;
uint8_t \fIpad1\fP[2];
uint32_t \fIpixel\fP;
} \fBxcb_alloc_color_reply_t\fP;
.fi
.SS Reply function
.HP
xcb_alloc_color_reply_t *\fBxcb_alloc_color_reply\fP(xcb_connection_t\ *\fIconn\fP, xcb_alloc_color_cookie_t\ \fIcookie\fP, xcb_generic_error_t\ **\fIe\fP);
.br
.hy 1
.SH REQUEST ARGUMENTS
.IP \fIconn\fP 1i
The XCB connection to X11.
.IP \fIcmap\fP 1i
TODO
.IP \fIred\fP 1i
The red value of your color.
.IP \fIgreen\fP 1i
The green value of your color.
.IP \fIblue\fP 1i
The blue value of your color.
.SH REPLY FIELDS
.IP \fIresponse_type\fP 1i
The type of this reply, in this case \fIXCB_ALLOC_COLOR\fP. This field is also present in the \fIxcb_generic_reply_t\fP and can be used to tell replies apart from each other.
.IP \fIsequence\fP 1i
The sequence number of the last request processed by the X11 server.
.IP \fIlength\fP 1i
The length of the reply, in words (a word is 4 bytes).
.IP \fIred\fP 1i
TODO: NOT YET DOCUMENTED.
.IP \fIgreen\fP 1i
TODO: NOT YET DOCUMENTED.
.IP \fIblue\fP 1i
TODO: NOT YET DOCUMENTED.
.IP \fIpixel\fP 1i
TODO: NOT YET DOCUMENTED.
.SH DESCRIPTION
Allocates a read-only colormap entry corresponding to the closest RGB value
supported by the hardware. If you are using TrueColor, you can take a shortcut
and directly calculate the color pixel value to avoid the round trip. But, for
example, on 16-bit color setups (VNC), you can easily get the closest supported
RGB value to the RGB value you are specifying.
.SH RETURN VALUE
Returns an \fIxcb_alloc_color_cookie_t\fP. Errors have to be handled when calling the reply function \fIxcb_alloc_color_reply\fP.
If you want to handle errors in the event loop instead, use \fIxcb_alloc_color_unchecked\fP. See \fBxcb-requests(3)\fP for details.
.SH ERRORS
.IP \fIxcb_colormap_error_t\fP 1i
The specified colormap \fIcmap\fP does not exist.
.SH SEE ALSO
.BR xcb-requests (3)
.SH AUTHOR
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.