![]() |
![]() |
![]() |
Cairo: A Vector Graphics Library | ![]() |
---|---|---|---|---|
Top | Description |
#define CAIRO_HAS_XCB_SURFACE cairo_surface_t * cairo_xcb_surface_create (xcb_connection_t *connection
,xcb_drawable_t drawable
,xcb_visualtype_t *visual
,int width
,int height
); cairo_surface_t * cairo_xcb_surface_create_for_bitmap (xcb_connection_t *connection
,xcb_screen_t *screen
,xcb_pixmap_t bitmap
,int width
,int height
); cairo_surface_t * cairo_xcb_surface_create_with_xrender_format (xcb_connection_t *connection
,xcb_screen_t *screen
,xcb_drawable_t drawable
,xcb_render_pictforminfo_t *format
,int width
,int height
); void cairo_xcb_surface_set_size (cairo_surface_t *surface
,int width
,int height
); void cairo_xcb_surface_set_drawable (cairo_surface_t *surface
,xcb_drawable_t drawable
,int width
,int height
);
The XCB surface is used to render cairo graphics to X Window System windows and pixmaps using the XCB library.
Note that the XCB surface automatically takes advantage of the X render extension if it is available.
The XCB surface is used to render cairo graphics to X Window System windows and pixmaps using the XCB library.
Note that the XCB surface automatically takes advantage of the X render extension if it is available.
#define CAIRO_HAS_XCB_SURFACE 1
Defined if the xcb surface backend is available. This macro can be used to conditionally compile backend-specific code.
cairo_surface_t * cairo_xcb_surface_create (xcb_connection_t *connection
,xcb_drawable_t drawable
,xcb_visualtype_t *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.
When drawable
is a Window containing child windows then drawing to
the created surface will be clipped by those child windows. When
the created surface is used as a source, the contents of the
children will be included.
|
an XCB connection |
|
an XCB drawable |
|
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. |
|
the current width of drawable
|
|
the current height of drawable
|
Returns : |
a pointer to the newly created surface. The caller
owns the surface and should call cairo_surface_destroy() when done
with it.
This function always returns a valid pointer, but it will return a
pointer to a "nil" surface if an error such as out of memory
occurs. You can use cairo_surface_status() to check for this. |
cairo_surface_t * cairo_xcb_surface_create_for_bitmap (xcb_connection_t *connection
,xcb_screen_t *screen
,xcb_pixmap_t 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.
|
an XCB connection |
|
the XCB screen associated with bitmap
|
|
an XCB drawable (a Pixmap with depth 1) |
|
the current width of bitmap
|
|
the current height of bitmap
|
Returns : |
a pointer to the newly created surface. The caller
owns the surface and should call cairo_surface_destroy() when done
with it.
This function always returns a valid pointer, but it will return a
pointer to a "nil" surface if an error such as out of memory
occurs. You can use cairo_surface_status() to check for this. |
cairo_surface_t * cairo_xcb_surface_create_with_xrender_format (xcb_connection_t *connection
,xcb_screen_t *screen
,xcb_drawable_t drawable
,xcb_render_pictforminfo_t *format
,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 picture format.
Note: If drawable
is a Window, then the function
cairo_xcb_surface_set_size()
must be called whenever the size of the
window changes.
When drawable
is a Window containing child windows then drawing to
the created surface will be clipped by those child windows. When
the created surface is used as a source, the contents of the
children will be included.
|
an XCB connection |
|
the XCB screen associated with drawable
|
|
an XCB drawable |
|
the picture format to use for drawing to drawable . The
depth of format mush match the depth of the drawable. |
|
the current width of drawable
|
|
the current height of drawable
|
Returns : |
a pointer to the newly created surface. The caller
owns the surface and should call cairo_surface_destroy() when done
with it.
This function always returns a valid pointer, but it will return a
pointer to a "nil" surface if an error such as out of memory
occurs. You can use cairo_surface_status() to check for this. |
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.
If cairo_surface_flush()
wasn't called, some pending operations
might be discarded.
|
a cairo_surface_t for the XCB backend |
|
the new width of the surface |
|
the new height of the surface |
void cairo_xcb_surface_set_drawable (cairo_surface_t *surface
,xcb_drawable_t drawable
,int width
,int height
);
Informs cairo of the new drawable and size of the XCB drawable underlying the surface.
If cairo_surface_flush()
wasn't called, some pending operations
might be discarded.
|
a cairo_surface_t for the XCB backend |
|
the new drawable of the surface |
|
the new width of the surface |
|
the new height of the surface |