third_party/cairo/src/cairo-os2-surface.c
cairo_surface_t *
cairo_os2_surface_create_for_window (HWND hwnd_client_window,
                                     int width,
                                     int height)
{
    cairo_os2_surface_t *local_os2_surface;

    /* A window handle must be provided. */
    if (!hwnd_client_window) {
        return _cairo_surface_create_in_error (
                                _cairo_error (CAIRO_STATUS_NO_MEMORY));
    }

    /* Create the surface. */
    local_os2_surface = (cairo_os2_surface_t *)
        cairo_os2_surface_create (0, width, height);

    /* If successful, save the hwnd & turn off automatic repainting. */
    if (!local_os2_surface->image_surface->base.status) {
        local_os2_surface->hwnd_client_window = hwnd_client_window;
        local_os2_surface->blit_as_changes = FALSE;
    }

    return (cairo_surface_t *)local_os2_surface;
}
/**
 * cairo_os2_surface_create_for_window:
 * @hwnd_client_window: the window handle to bind the surface to
 * @width: the width of the surface
 * @height: the height of the surface
 *
 * Create a Cairo surface which is bound to a given window; the caller retains
 * ownership of the window.  This is a convenience function for use with
 * windows that will only be updated when cairo_os2_surface_refresh_window()
 * is called (usually in response to a WM_PAINT message).  It avoids the need
 * to create a persistent HPS for every window and assumes that one will be
 * supplied by the caller when a cairo function needs one.  If it isn't, an
 * HPS will be created on-the-fly and released before the function which needs
 * it returns.
 *
 * Return value: the newly created surface
 *
 * Since: 1.10
 **/
@hwnd_client_window: the window handle to bind the surface to
@width: the width of the surface
@height: the height of the surface

Create a Cairo surface which is bound to a given window; the caller retains
ownership of the window.  This is a convenience function for use with
windows that will only be updated when cairo_os2_surface_refresh_window()
is called (usually in response to a WM_PAINT message).  It avoids the need
to create a persistent HPS for every window and assumes that one will be
supplied by the caller when a cairo function needs one.  If it isn't, an
HPS will be created on-the-fly and released before the function which needs
it returns.

Return value: the newly created surface


@hwnd_client_window : the window handle to bind the surface to @width : the width of the surface @height : the height of the surface Create a Cairo surface which is bound to a given window ; the caller retains ownership of the window . This is a convenience function for use with windows that will only be updated when cairo_os2_surface_refresh_window () is called ( usually in response to a WM_PAINT message ) . It avoids the need to create a persistent HPS for every window and assumes that one will be supplied by the caller when a cairo function needs one . If it isn ' t an HPS will be created on - the - fly and released before the function which needs it returns . Return value : the newly created surface
cairo_surface_t *
cairo_os2_surface_create_for_window (HWND hwnd_client_window,
                                     int width,
                                     int height)
{
    cairo_os2_surface_t *local_os2_surface;
    if (!hwnd_client_window) {
        return _cairo_surface_create_in_error (
                                _cairo_error (CAIRO_STATUS_NO_MEMORY));
    }
    local_os2_surface = (cairo_os2_surface_t *)
        cairo_os2_surface_create (0, width, height);
    if (!local_os2_surface->image_surface->base.status) {
        local_os2_surface->hwnd_client_window = hwnd_client_window;
        local_os2_surface->blit_as_changes = FALSE;
    }
    return (cairo_surface_t *)local_os2_surface;
}
cairo_surface_t * cairo_os2_surface_create_for_window ( HWND hwnd_client_window , int width , int height ) { cairo_os2_surface_t * local_os2_surface ; if ( ! hwnd_client_window ) { return _cairo_surface_create_in_error ( _cairo_error ( CAIRO_STATUS_NO_MEMORY ) ) ; } local_os2_surface = ( cairo_os2_surface_t * ) cairo_os2_surface_create ( 0 , width , height ) ; if ( ! local_os2_surface -> image_surface -> base . status ) { local_os2_surface -> hwnd_client_window = hwnd_client_window ; local_os2_surface -> blit_as_changes = FALSE ; } return ( cairo_surface_t * ) local_os2_surface ; }
cairo_os2_surface_create_for_window:
 @hwnd_client_window: the window handle to bind the surface to
 @width: the width of the surface
 @height: the height of the surface
cairo_os2_surface_create_for_window : @hwnd_client_window : the window handle to bind the surface to @width : the width of the surface @height : the height of the surface
/* A window handle must be provided. */ /* Create the surface. */ /* If successful, save the hwnd & turn off automatic repainting. */