jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: XCB Surfaces: Cairo: A Vector Graphics Library jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68: jpayne@68: jpayne@68:
jpayne@68:

XCB Surfaces

jpayne@68:

XCB Surfaces — X Window System rendering using the XCB library

jpayne@68:
jpayne@68:
jpayne@68:

Functions

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: jpayne@68: cairo_xcb_surface_create () jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: jpayne@68: cairo_xcb_surface_create_for_bitmap () jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: jpayne@68: cairo_xcb_surface_create_with_xrender_format () jpayne@68:
jpayne@68: void jpayne@68: jpayne@68: cairo_xcb_surface_set_size () jpayne@68:
jpayne@68: void jpayne@68: jpayne@68: cairo_xcb_surface_set_drawable () jpayne@68:
jpayne@68: xcb_connection_t * jpayne@68: jpayne@68: cairo_xcb_device_get_connection () jpayne@68:
jpayne@68: void jpayne@68: jpayne@68: cairo_xcb_device_debug_cap_xrender_version () jpayne@68:
jpayne@68: void jpayne@68: jpayne@68: cairo_xcb_device_debug_cap_xshm_version () jpayne@68:
jpayne@68: int jpayne@68: jpayne@68: cairo_xcb_device_debug_get_precision () jpayne@68:
jpayne@68: void jpayne@68: jpayne@68: cairo_xcb_device_debug_set_precision () jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

Types and Values

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
#defineCAIRO_HAS_XCB_SURFACE
#defineCAIRO_HAS_XCB_SHM_FUNCTIONS
jpayne@68:
jpayne@68:
jpayne@68:

Description

jpayne@68:

The XCB surface is used to render cairo graphics to X Window System jpayne@68: windows and pixmaps using the XCB library.

jpayne@68:

Note that the XCB surface automatically takes advantage of the X render jpayne@68: extension if it is available.

jpayne@68:
jpayne@68:
jpayne@68:

Functions

jpayne@68:
jpayne@68:

cairo_xcb_surface_create ()

jpayne@68:
cairo_surface_t *
jpayne@68: cairo_xcb_surface_create (xcb_connection_t *connection,
jpayne@68:                           xcb_drawable_t drawable,
jpayne@68:                           xcb_visualtype_t *visual,
jpayne@68:                           int width,
jpayne@68:                           int height);
jpayne@68:

Creates an XCB surface that draws to the given drawable. jpayne@68: The way that colors are represented in the drawable is specified jpayne@68: by the provided visual.

jpayne@68:

Note: If drawable jpayne@68: is a Window, then the function jpayne@68: cairo_xcb_surface_set_size() must be called whenever the size of the jpayne@68: window changes.

jpayne@68:

When drawable jpayne@68: is a Window containing child windows then drawing to jpayne@68: the created surface will be clipped by those child windows. When jpayne@68: the created surface is used as a source, the contents of the jpayne@68: children will be included.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

connection

an XCB connection

 

drawable

an XCB drawable

 

visual

the visual to use for drawing to drawable jpayne@68: . The depth jpayne@68: of the visual must match the depth of the drawable. jpayne@68: Currently, only TrueColor visuals are fully supported.

 

width

the current width of drawable jpayne@68:

 

height

the current height of drawable jpayne@68:

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

a pointer to the newly created surface. The caller jpayne@68: owns the surface and should call cairo_surface_destroy() when done jpayne@68: with it.

jpayne@68:

This function always returns a valid pointer, but it will return a jpayne@68: pointer to a "nil" surface if an error such as out of memory jpayne@68: occurs. You can use cairo_surface_status() to check for this.

jpayne@68:
jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_xcb_surface_create_for_bitmap ()

jpayne@68:
cairo_surface_t *
jpayne@68: cairo_xcb_surface_create_for_bitmap (xcb_connection_t *connection,
jpayne@68:                                      xcb_screen_t *screen,
jpayne@68:                                      xcb_pixmap_t bitmap,
jpayne@68:                                      int width,
jpayne@68:                                      int height);
jpayne@68:

Creates an XCB surface that draws to the given bitmap. jpayne@68: This will be drawn to as a CAIRO_FORMAT_A1 object.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

connection

an XCB connection

 

screen

the XCB screen associated with bitmap jpayne@68:

 

bitmap

an XCB drawable (a Pixmap with depth 1)

 

width

the current width of bitmap jpayne@68:

 

height

the current height of bitmap jpayne@68:

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

a pointer to the newly created surface. The caller jpayne@68: owns the surface and should call cairo_surface_destroy() when done jpayne@68: with it.

jpayne@68:

This function always returns a valid pointer, but it will return a jpayne@68: pointer to a "nil" surface if an error such as out of memory jpayne@68: occurs. You can use cairo_surface_status() to check for this.

jpayne@68:
jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_xcb_surface_create_with_xrender_format ()

jpayne@68:
cairo_surface_t *
jpayne@68: cairo_xcb_surface_create_with_xrender_format
jpayne@68:                                (xcb_connection_t *connection,
jpayne@68:                                 xcb_screen_t *screen,
jpayne@68:                                 xcb_drawable_t drawable,
jpayne@68:                                 xcb_render_pictforminfo_t *format,
jpayne@68:                                 int width,
jpayne@68:                                 int height);
jpayne@68:

Creates an XCB surface that draws to the given drawable. jpayne@68: The way that colors are represented in the drawable is specified jpayne@68: by the provided picture format.

jpayne@68:

Note: If drawable jpayne@68: is a Window, then the function jpayne@68: cairo_xcb_surface_set_size() must be called whenever the size of the jpayne@68: window changes.

jpayne@68:

When drawable jpayne@68: is a Window containing child windows then drawing to jpayne@68: the created surface will be clipped by those child windows. When jpayne@68: the created surface is used as a source, the contents of the jpayne@68: children will be included.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

connection

an XCB connection

 

drawable

an XCB drawable

 

screen

the XCB screen associated with drawable jpayne@68:

 

format

the picture format to use for drawing to drawable jpayne@68: . The jpayne@68: depth of format jpayne@68: mush match the depth of the drawable.

 

width

the current width of drawable jpayne@68:

 

height

the current height of drawable jpayne@68:

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

a pointer to the newly created surface. The caller jpayne@68: owns the surface and should call cairo_surface_destroy() when done jpayne@68: with it.

jpayne@68:

This function always returns a valid pointer, but it will return a jpayne@68: pointer to a "nil" surface if an error such as out of memory jpayne@68: occurs. You can use cairo_surface_status() to check for this.

jpayne@68:
jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_xcb_surface_set_size ()

jpayne@68:
void
jpayne@68: cairo_xcb_surface_set_size (cairo_surface_t *surface,
jpayne@68:                             int width,
jpayne@68:                             int height);
jpayne@68:

Informs cairo of the new size of the XCB drawable underlying the jpayne@68: surface. For a surface created for a window (rather than a pixmap), jpayne@68: this function must be called each time the size of the window jpayne@68: changes. (For a subwindow, you are normally resizing the window jpayne@68: yourself, but for a toplevel window, it is necessary to listen for jpayne@68: ConfigureNotify events.)

jpayne@68:

A pixmap can never change size, so it is never necessary to call jpayne@68: this function on a surface created for a pixmap.

jpayne@68:

If cairo_surface_flush() wasn't called, some pending operations jpayne@68: might be discarded.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

surface

a cairo_surface_t for the XCB backend

 

width

the new width of the surface

 

height

the new height of the surface

 
jpayne@68:
jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_xcb_surface_set_drawable ()

jpayne@68:
void
jpayne@68: cairo_xcb_surface_set_drawable (cairo_surface_t *surface,
jpayne@68:                                 xcb_drawable_t drawable,
jpayne@68:                                 int width,
jpayne@68:                                 int height);
jpayne@68:

Informs cairo of the new drawable and size of the XCB drawable underlying the jpayne@68: surface.

jpayne@68:

If cairo_surface_flush() wasn't called, some pending operations jpayne@68: might be discarded.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

surface

a cairo_surface_t for the XCB backend

 

drawable

the new drawable of the surface

 

width

the new width of the surface

 

height

the new height of the surface

 
jpayne@68:
jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_xcb_device_get_connection ()

jpayne@68:
xcb_connection_t *
jpayne@68: cairo_xcb_device_get_connection (cairo_device_t *device);
jpayne@68:

Get the connection for the XCB device.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

device

a cairo_device_t for the XCB backend

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

the xcb_connection_t for the connection

jpayne@68:
jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_xcb_device_debug_cap_xrender_version ()

jpayne@68:
void
jpayne@68: cairo_xcb_device_debug_cap_xrender_version
jpayne@68:                                (cairo_device_t *device,
jpayne@68:                                 int major_version,
jpayne@68:                                 int minor_version);
jpayne@68:

Restricts all future XCB surfaces for this devices to the specified version jpayne@68: of the RENDER extension. This function exists solely for debugging purpose. jpayne@68: It let's you find out how cairo would behave with an older version of jpayne@68: the RENDER extension.

jpayne@68:

Use the special values -1 and -1 for disabling the RENDER extension.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

device

a cairo_device_t for the XCB backend

 

major_version

major version to restrict to

 

minor_version

minor version to restrict to

 
jpayne@68:
jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_xcb_device_debug_cap_xshm_version ()

jpayne@68:
void
jpayne@68: cairo_xcb_device_debug_cap_xshm_version
jpayne@68:                                (cairo_device_t *device,
jpayne@68:                                 int major_version,
jpayne@68:                                 int minor_version);
jpayne@68:

Restricts all future XCB surfaces for this devices to the specified version jpayne@68: of the SHM extension. This function exists solely for debugging purpose. jpayne@68: It let's you find out how cairo would behave with an older version of jpayne@68: the SHM extension.

jpayne@68:

Use the special values -1 and -1 for disabling the SHM extension.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

device

a cairo_device_t for the XCB backend

 

major_version

major version to restrict to

 

minor_version

minor version to restrict to

 
jpayne@68:
jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_xcb_device_debug_get_precision ()

jpayne@68:
int
jpayne@68: cairo_xcb_device_debug_get_precision (cairo_device_t *device);
jpayne@68:

Get the Xrender precision mode.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

device

a cairo_device_t for the XCB backend

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

the render precision mode

jpayne@68:
jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_xcb_device_debug_set_precision ()

jpayne@68:
void
jpayne@68: cairo_xcb_device_debug_set_precision (cairo_device_t *device,
jpayne@68:                                       int precision);
jpayne@68:

Render supports two modes of precision when rendering trapezoids. Set jpayne@68: the precision to the desired mode.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

device

a cairo_device_t for the XCB backend

 

precision

the precision to use

 
jpayne@68:
jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

Types and Values

jpayne@68:
jpayne@68:

CAIRO_HAS_XCB_SURFACE

jpayne@68:
#define CAIRO_HAS_XCB_SURFACE 1
jpayne@68: 
jpayne@68:

Defined if the xcb surface backend is available. jpayne@68: This macro can be used to conditionally compile backend-specific code.

jpayne@68:

Since: 1.12

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

CAIRO_HAS_XCB_SHM_FUNCTIONS

jpayne@68:
#define CAIRO_HAS_XCB_SHM_FUNCTIONS 1
jpayne@68: 
jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

See Also

jpayne@68:

cairo_surface_t

jpayne@68:
jpayne@68:
jpayne@68: jpayne@68: jpayne@68: