xcb\_poly\_segment(3) XCB Requests xcb\_poly\_segment(3)

# [NAME](#NAME)

xcb\_poly\_segment - draw lines

# [SYNOPSIS](#SYNOPSIS)

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

## [Request function](#Request_function)

xcb\_void\_cookie\_t **xcb\_poly\_segment**(xcb\_connection\_t \**conn*, xcb\_drawable\_t *drawable*, xcb\_gcontext\_t *gc*, uint32\_t *segments\_len*, const xcb\_segment\_t \**segments*);

# [REQUEST ARGUMENTS](#REQUEST_ARGUMENTS)

[*conn*](#conn)

The XCB connection to X11.

[*drawable*](#drawable)

A drawable (Window or Pixmap) to draw on.

[*gc*](#gc)

The graphics context to use.

TODO: document which attributes of a gc are used

[*segments\_len*](#segments_len)

The number of *xcb\_segment\_t* structures in *segments*.

[*segments*](#segments)

An array of *xcb\_segment\_t* structures.

# [DESCRIPTION](#DESCRIPTION)

Draws multiple, unconnected lines. For each segment, a line is drawn between (x1, y1) and (x2, y2). The lines are drawn in the order listed in the array of *xcb\_segment\_t* structures and does not perform joining at coincident endpoints. For any given line, a pixel is not drawn more than once. If lines intersect, the intersecting pixels are drawn multiple times.

TODO: include the xcb\_segment\_t data structure

TODO: an example

# [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\_poly\_segment\_checked*. See [**xcb-requests(3)**](/man/os/libxcb/xcb-requests.3) for details.

# [ERRORS](#ERRORS)

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

The specified *drawable* does not exist.

[*xcb\_g\_context\_error\_t*](#xcb_g_context_error_t)

The specified *gc* does not exist.

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

TODO: reasons?

# [SEE ALSO](#SEE_ALSO)

[**xcb-requests**(3)](/man/os/libxcb/xcb-requests.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_poly_segment(3) from libxcb 1.17.0-r17 (Chainguard OS)
Source: https://gitlab.freedesktop.org/xorg/lib/libxcb.git
