third_party/cairo/src/cairo-xcb-surface.c
void
cairo_xcb_surface_set_size (cairo_surface_t *abstract_surface,
			    int              width,
			    int              height)
{
    cairo_xcb_surface_t *surface;

    if (unlikely (abstract_surface->status))
	return;
    if (unlikely (abstract_surface->finished)) {
	_cairo_surface_set_error (abstract_surface,
				  _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
	return;
    }


    if ( !_cairo_surface_is_xcb(abstract_surface)) {
	_cairo_surface_set_error (abstract_surface,
				  _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
	return;
    }

    if (width > XLIB_COORD_MAX || height > XLIB_COORD_MAX || width <= 0 || height <= 0) {
	_cairo_surface_set_error (abstract_surface,
				  _cairo_error (CAIRO_STATUS_INVALID_SIZE));
	return;
    }

    surface = (cairo_xcb_surface_t *) abstract_surface;

    _drawable_changed(surface);
    surface->width  = width;
    surface->height = height;
}
/**
 * cairo_xcb_surface_set_size:
 * @surface: a #cairo_surface_t for the XCB backend
 * @width: the new width of the surface
 * @height: the new height of the surface
 *
 * 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.
 *
 * Since: 1.12
 **/
@surface: a #cairo_surface_t for the XCB backend
@width: the new width of the surface
@height: the new height of the surface

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.


@surface : a #cairo_surface_t for the XCB backend @width : the new width of the surface @height : the new height of the surface 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 .
void
cairo_xcb_surface_set_size (cairo_surface_t *abstract_surface,
			    int              width,
			    int              height)
{
    cairo_xcb_surface_t *surface;
    if (unlikely (abstract_surface->status))
	return;
    if (unlikely (abstract_surface->finished)) {
	_cairo_surface_set_error (abstract_surface,
				  _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
	return;
    }
    if ( !_cairo_surface_is_xcb(abstract_surface)) {
	_cairo_surface_set_error (abstract_surface,
				  _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
	return;
    }
    if (width > XLIB_COORD_MAX || height > XLIB_COORD_MAX || width <= 0 || height <= 0) {
	_cairo_surface_set_error (abstract_surface,
				  _cairo_error (CAIRO_STATUS_INVALID_SIZE));
	return;
    }
    surface = (cairo_xcb_surface_t *) abstract_surface;
    _drawable_changed(surface);
    surface->width  = width;
    surface->height = height;
}
void cairo_xcb_surface_set_size ( cairo_surface_t * abstract_surface , int width , int height ) { cairo_xcb_surface_t * surface ; if ( unlikely ( abstract_surface -> status ) ) return ; if ( unlikely ( abstract_surface -> finished ) ) { _cairo_surface_set_error ( abstract_surface , _cairo_error ( CAIRO_STATUS_SURFACE_FINISHED ) ) ; return ; } if ( ! _cairo_surface_is_xcb ( abstract_surface ) ) { _cairo_surface_set_error ( abstract_surface , _cairo_error ( CAIRO_STATUS_SURFACE_TYPE_MISMATCH ) ) ; return ; } if ( width > XLIB_COORD_MAX || height > XLIB_COORD_MAX || width <= 0 || height <= 0 ) { _cairo_surface_set_error ( abstract_surface , _cairo_error ( CAIRO_STATUS_INVALID_SIZE ) ) ; return ; } surface = ( cairo_xcb_surface_t * ) abstract_surface ; _drawable_changed ( surface ) ; surface -> width = width ; surface -> height = height ; }
cairo_xcb_surface_set_size:
 @surface: a #cairo_surface_t for the XCB backend
 @width: the new width of the surface
 @height: the new height of the surface
cairo_xcb_surface_set_size : @surface : a #cairo_surface_t for the XCB backend @width : the new width of the surface @height : the new height of the surface