---
name: "xcb_poly_segment"
section: "3"
platform: "linux"
package: "libxcb"
version: "1.17.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/xcb_poly_segment"
---

# xcb\_poly\_segment(3)

draw lines

## NAME

xcb\_poly\_segment - draw lines

## SYNOPSIS

**#include \<xcb/xproto.h\>**

### 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

- *conn*

  The XCB connection to X11.

- *drawable*

  A drawable (Window or Pixmap) to draw on.

- *gc*

  The graphics context to use.

  TODO: document which attributes of a gc are used

- *segments\_len*

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

- *segments*

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

## 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

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)](/xcb-requests/3.md)** for details.

## ERRORS

- *xcb\_drawable\_error\_t*

  The specified *drawable* does not exist.

- *xcb\_g\_context\_error\_t*

  The specified *gc* does not exist.

- *xcb\_match\_error\_t*

  TODO: reasons?

## SEE ALSO

[**xcb-requests**(3)](/xcb-requests/3.md)

## AUTHOR

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