Commit 256d6277 authored by Christian Persch's avatar Christian Persch

Add function to check whether the SVG document contains an element by ID.

	* doc/rsvg-sections.txt:
	* librsvg.def:
	* rsvg-base.c:
	* rsvg.h: Add function to check whether the SVG document contains an
	element by ID. Bug #567070.

svn path=/trunk/; revision=1196
parent 97eb5605
2009-01-09 Christian Persch <chpe@gnome.org>
* doc/rsvg-sections.txt:
* librsvg.def:
* rsvg-base.c:
* rsvg.h: Add function to check whether the SVG document contains an
element by ID. Bug #567070.
2009-01-06 Christian Persch <chpe@gnome.org>
* configure.in:
......
......@@ -26,6 +26,7 @@ rsvg_handle_get_desc
rsvg_handle_get_dimensions
rsvg_handle_get_dimensions_sub
rsvg_handle_get_position_sub
rsvg_handle_has_sub
</SECTION>
<SECTION>
......
......@@ -20,6 +20,7 @@ rsvg_handle_get_position_sub
rsvg_handle_get_title
rsvg_handle_get_desc
rsvg_handle_get_metadata
rsvg_handle_has_sub
rsvg_handle_new_from_data
rsvg_handle_new_from_file
rsvg_handle_set_size_callback
......
......@@ -1473,6 +1473,30 @@ bail:
return ret;
}
/**
* rsvg_handle_has_sub:
* @handle: a #RsvgHandle
* @id: an element's id within the SVG
*
* Checks whether the element @id exists in the SVG document.
*
* Returns: %TRUE if @id exists in the SVG document
*
* Since: 2.22
*/
gboolean
rsvg_handle_has_sub (RsvgHandle * handle,
const char *id)
{
RsvgNode *sself;
g_return_val_if_fail (handle, FALSE);
if (G_UNLIKELY (!id || !id[0]))
return FALSE;
return rsvg_defs_lookup (handle->priv->defs, id) != NULL;
}
/**
* rsvg_set_default_dpi
......
......@@ -130,6 +130,8 @@ void rsvg_handle_get_dimensions (RsvgHandle * handle, RsvgDimensionData * dimens
gboolean rsvg_handle_get_dimensions_sub (RsvgHandle * handle, RsvgDimensionData * dimension_data, const char *id);
gboolean rsvg_handle_get_position_sub (RsvgHandle * handle, RsvgPositionData * position_data, const char *id);
gboolean rsvg_handle_has_sub (RsvgHandle * handle, const char *id);
/* Accessibility API */
G_CONST_RETURN char *rsvg_handle_get_title (RsvgHandle * handle);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment