xcb\_create\_gc(3) XCB Requests xcb\_create\_gc(3)

# [NAME](#NAME)

xcb\_create\_gc - Creates a graphics context

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;xcb/xproto.h&gt;**

## [Request function](#Request_function)

xcb\_void\_cookie\_t **xcb\_create\_gc**(xcb\_connection\_t \**conn*, xcb\_gcontext\_t *cid*, xcb\_drawable\_t *drawable*, uint32\_t *value\_mask*, const void \**value\_list*);

# [REQUEST ARGUMENTS](#REQUEST_ARGUMENTS)

[*conn*](#conn)

The XCB connection to X11.

[*cid*](#cid)

The ID with which you will refer to the graphics context, created by *xcb\_generate\_id*.

[*drawable*](#drawable)

Drawable to get the root/depth from.

[*value\_mask*](#value_mask)

TODO: NOT YET DOCUMENTED.

[*value\_list*](#value_list)

TODO: NOT YET DOCUMENTED.

# [DESCRIPTION](#DESCRIPTION)

Creates a graphics context. The graphics context can be used with any drawable that has the same root and depth as the specified drawable.

# [RETURN VALUE](#RETURN_VALUE)

Returns an *xcb\_void\_cookie\_t*. Errors (if any) have to be handled in the event loop.

If you want to handle errors directly with *xcb\_request\_check* instead, use *xcb\_create\_gc\_checked*. See [**xcb-requests(3)**](/man/os/libxcb/xcb-requests.3) for details.

# [ERRORS](#ERRORS)

[*xcb\_alloc\_error\_t*](#xcb_alloc_error_t)

The X server could not allocate the requested resources (no memory?).

[*xcb\_drawable\_error\_t*](#xcb_drawable_error_t)

The specified *drawable* (Window or Pixmap) does not exist.

[*xcb\_font\_error\_t*](#xcb_font_error_t)

TODO: reasons?

[*xcb\_match\_error\_t*](#xcb_match_error_t)

TODO: reasons?

[*xcb\_pixmap\_error\_t*](#xcb_pixmap_error_t)

TODO: reasons?

[*xcb\_value\_error\_t*](#xcb_value_error_t)

TODO: reasons?

# [SEE ALSO](#SEE_ALSO)

[**xcb-requests**(3)](/man/os/libxcb/xcb-requests.3), [**xcb\_generate\_id**(3)](/man/os/libxcb/xcb_generate_id.3)

# [AUTHOR](#AUTHOR)

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.

libxcb 1.17.0 X Version 11

---

Document: xcb_create_gc(3) from libxcb 1.17.0-r19 (Chainguard OS)
Source: https://gitlab.freedesktop.org/xorg/lib/libxcb.git
