XCB Backend

XCB Backend —

Synopsis




cairo_surface_t* cairo_xcb_surface_create   (XCBConnection *c,
                                             XCBDRAWABLE drawable,
                                             XCBVISUALTYPE *visual,
                                             int width,
                                             int height);
cairo_surface_t* cairo_xcb_surface_create_for_bitmap
                                            (XCBConnection *c,
                                             XCBPIXMAP bitmap,
                                             int width,
                                             int height);
void        cairo_xcb_surface_set_size      (cairo_surface_t *surface,
                                             int width,
                                             int height);

Description

Details

cairo_xcb_surface_create ()

cairo_surface_t* cairo_xcb_surface_create   (XCBConnection *c,
                                             XCBDRAWABLE drawable,
                                             XCBVISUALTYPE *visual,
                                             int width,
                                             int height);

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

NOTE: If drawable is a window, then the function cairo_xcb_surface_set_size must be called whenever the size of the window changes.

c : an XCB connection
drawable : an XCB drawable
visual : the visual to use for drawing to drawable. The depth of the visual must match the depth of the drawable. Currently, only TrueColor visuals are fully supported.
width : the current width of drawable.
height : the current height of drawable.
Returns : the newly created surface

cairo_xcb_surface_create_for_bitmap ()

cairo_surface_t* cairo_xcb_surface_create_for_bitmap
                                            (XCBConnection *c,
                                             XCBPIXMAP bitmap,
                                             int width,
                                             int height);

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

c : an XCB connection
bitmap : an XCB Pixmap (a depth-1 pixmap)
width : the current width of bitmap
height : the current height of bitmap
Returns : the newly created surface

cairo_xcb_surface_set_size ()

void        cairo_xcb_surface_set_size      (cairo_surface_t *surface,
                                             int width,
                                             int height);

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

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

surface : a cairo_surface_t for the XCB backend
width : the new width of the surface
height : the new height of the surface