Emits the current page for backends that support multiple pages, but doesn't clear it, so that the contents of the current page will be retained for the next page. Use cairo.surface.Surface.showPage if you want to get an empty page after the emission.
Create a new surface that is a rectangle within the target surface. All operations drawn to this surface are then clipped and translated onto the target surface. Nothing drawn via this sub-surface outside of its bounds is drawn onto the target surface, making this a useful method for passing constrained child surfaces to library routines that draw directly onto the parent surface, i.e. with no further backend allocations, double buffering or copies.
Create a new surface that exists solely to watch another is doing. In the process it will log operations and times, which are fast, which are slow, which are frequent, etc.
Create a new surface that is as compatible as possible with an existing surface. For example the new surface will have the same device scale, fallback resolution and font options as other. Generally, the new surface will also use the same backend as other, unless that is not possible for some reason. The type of the returned surface may be examined with cairo.surface.Surface.getSurfaceType.
Create a new image surface that is as compatible as possible for uploading to and the use in conjunction with an existing surface. However, this surface can still be used like any normal image surface. Unlike cairo.surface.Surface.createSimilar the new image surface won't inherit the device scale from other.
This function finishes the surface and drops all references to external resources. For example, for the Xlib backend it means that cairo will no longer access the drawable, which can be freed. After calling cairo.surface.Surface.finish the only valid operations on a surface are checking status, getting and setting user, referencing and destroying, and flushing and finishing it. Further drawing to the surface will not affect the surface but will instead trigger a cairo.types.Status.SurfaceFinished error.
Do any pending drawing for the surface and also restore any temporary modifications cairo has made to the surface's state. This function must be called before switching from drawing on the surface with cairo to drawing on it directly with native APIs, or accessing its memory outside of Cairo. If the surface doesn't support direct access, then this function does nothing.
This function returns the content type of surface which indicates whether the surface contains color and/or alpha information. See #cairo_content_t.
This function returns the device for a surface. See #cairo_device_t.
This function returns the previous device offset set by cairo.surface.Surface.setDeviceOffset.
This function returns the previous device scale set by cairo.surface.Surface.setDeviceScale.
This function returns the previous fallback resolution set by cairo.surface.Surface.setFallbackResolution, or default fallback resolution if never set.
Retrieves the default font rendering options for the surface. This allows display surfaces to report the correct subpixel order for rendering on them, print surfaces to disable hinting of metrics and so forth. The result can then be used with cairo.global.scaledFontCreate.
Return mime data previously attached to surface using the specified mime type. If no data has been attached with the given mime type, data is set null.
This function returns the type of the backend used to create a surface. See #cairo_surface_type_t for available types.
Return user data previously attached to surface using the specified key. If no user data has been attached with the given key this function returns null.
Returns whether the surface supports sophisticated cairo.context.Context.showTextGlyphs operations. That is, whether it actually uses the provided text and cluster data to a cairo.context.Context.showTextGlyphs call.
Returns an image surface that is the most efficient mechanism for modifying the backing store of the target surface. The region retrieved may be limited to the extents or null for the whole surface
Tells cairo that drawing has been done to surface using means other than cairo, and that cairo should reread any cached areas. Note that you must call cairo.surface.Surface.flush before doing such drawing.
Like cairo.surface.Surface.markDirty, but drawing has been done only to the specified rectangle, so that cairo can retain cached contents for other parts of the surface.
Returns the total observation time.
Prints the observer log using the given callback.
Sets an offset that is added to the device coordinates determined by the CTM when drawing to surface. One use case for this function is when we want to create a #cairo_surface_t that redirects drawing for a portion of an onscreen surface to an offscreen surface in a way that is completely invisible to the user of the cairo API. Setting a transformation via cairo.context.Context.translate isn't sufficient to do this, since functions like cairo.context.Context.deviceToUser will expose the hidden offset.
Sets a scale that is multiplied to the device coordinates determined by the CTM when drawing to surface. One common use for this is to render to very high resolution display devices at a scale factor, so that code that assumes 1 pixel will be a certain size will still work. Setting a transformation via cairo.context.Context.scale isn't sufficient to do this, since functions like cairo.context.Context.deviceToUser will expose the hidden scale.
Set the horizontal and vertical resolution for image fallbacks.
Attach an image in the format mime_type to surface. To remove the data from a surface, call this function with same mime type and null for data.
Emits and clears the current page for backends that support multiple pages. Use cairo.surface.Surface.copyPage if you don't want to clear the page.
Checks whether an error has previously occurred for this surface.
Return whether surface supports mime_type.
Unmaps the image surface as returned from #cairo.surface.Surface.mapToImage.
Writes the contents of surface to a new file filename as a PNG image.
Writes the image surface to the write function.
Pointer to the C boxed value
Get the GType of this boxed type.
Boxed GType property.
Convenience method to return this cast to a type. For use in D with statements.
Make a copy of the wrapped C boxed data.
Copy a C boxed value using g_boxed_copy.
Free a C boxed value using g_boxed_free.
A #cairo_surface_t represents an image, either as the destination of a drawing operation or as source when drawing onto another surface. To draw to a #cairo_surface_t, create a cairo context with the surface as the target, using cairo.global.create.
There are different subtypes of #cairo_surface_t for different drawing backends; for example, cairo.global.imageSurfaceCreate creates a bitmap image in memory. The type of a surface can be queried with cairo.surface.Surface.getSurfaceType.
The initial contents of a surface after creation depend upon the manner of its creation. If cairo creates the surface and backing storage for the user, it will be initially cleared; for example, cairo.global.imageSurfaceCreate and cairo.surface.Surface.createSimilar. Alternatively, if the user passes in a reference to some backing storage and asks cairo to wrap that in a #cairo_surface_t, then the contents are not modified; for example, cairo.global.imageSurfaceCreateForData and cairo_xlib_surface_create().
Memory management of #cairo_surface_t is done with cairo.surface.Surface.reference and cairo.surface.Surface.destroy.