[librsvg: 10/15] Documentation for rsvg_handle_render_layer()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 10/15] Documentation for rsvg_handle_render_layer()
- Date: Tue, 30 Jul 2019 17:33:06 +0000 (UTC)
commit 16d8b4769e5e7bb5b5fc8b9b4decf19ad1a06f88
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Jul 29 13:23:19 2019 -0500
Documentation for rsvg_handle_render_layer()
librsvg/rsvg-handle.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
---
diff --git a/librsvg/rsvg-handle.c b/librsvg/rsvg-handle.c
index 42be2e67..0439bf59 100644
--- a/librsvg/rsvg-handle.c
+++ b/librsvg/rsvg-handle.c
@@ -1291,6 +1291,40 @@ rsvg_handle_get_geometry_for_layer (RsvgHandle *handle,
error);
}
+/**
+ * rsvg_handle_render_layer:
+ * @handle: An #RsvgHandle
+ * @cr: A Cairo context
+ * @id: (nullable): An element's id within the SVG, starting with "##" (a single
+ * hash character), for example, "##layer1". This notation corresponds to a
+ * URL's fragment ID. Alternatively, pass %NULL to render the whole SVG document tree.
+ * @viewport: Viewport size at which the whole SVG would be fitted.
+ * @error: (allow-none): a location to store a #GError, or %NULL
+ *
+ * Renders a single SVG element in the same place as for a whole SVG document.
+ *
+ * This is equivalent to rsvg_handle_render_document(), but it renders only a
+ * single element and its children, as if they composed an individual layer in
+ * the SVG. The element is rendered with the same transformation matrix as it
+ * has within the whole SVG document. Applications can use this to re-render a
+ * single element and repaint it on top of a previously-rendered document, for
+ * example.
+ *
+ * Element IDs should look like an URL fragment identifier; for example, pass
+ * "##foo" (hash <literal>foo</literal>) to get the geometry of the element that
+ * has an <literal>id="foo"</literal> attribute.
+ *
+ * You can pass #NULL for the @id if you want to render all
+ * the elements in the SVG, i.e. to render everything from the
+ * root element.
+ *
+ * API ordering: This function must be called on a fully-loaded @handle. See
+ * the section <link href="#API-ordering">API ordering</link> for details.
+ *
+ * Panics: this function will panic if the @handle is not fully-loaded.
+ *
+ * Since: 2.46
+ */
gboolean
rsvg_handle_render_layer (RsvgHandle *handle,
cairo_t *cr,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]