librsvg r1196 - in trunk: . doc
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: librsvg r1196 - in trunk: . doc
- Date: Thu, 8 Jan 2009 23:45:45 +0000 (UTC)
Author: chpe
Date: Thu Jan 8 23:45:45 2009
New Revision: 1196
URL: http://svn.gnome.org/viewvc/librsvg?rev=1196&view=rev
Log:
* 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.
Modified:
trunk/ChangeLog
trunk/doc/rsvg-sections.txt
trunk/librsvg.def
trunk/rsvg-base.c
trunk/rsvg.h
Modified: trunk/doc/rsvg-sections.txt
==============================================================================
--- trunk/doc/rsvg-sections.txt (original)
+++ trunk/doc/rsvg-sections.txt Thu Jan 8 23:45:45 2009
@@ -26,6 +26,7 @@
rsvg_handle_get_dimensions
rsvg_handle_get_dimensions_sub
rsvg_handle_get_position_sub
+rsvg_handle_has_sub
</SECTION>
<SECTION>
Modified: trunk/librsvg.def
==============================================================================
--- trunk/librsvg.def (original)
+++ trunk/librsvg.def Thu Jan 8 23:45:45 2009
@@ -20,6 +20,7 @@
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
Modified: trunk/rsvg-base.c
==============================================================================
--- trunk/rsvg-base.c (original)
+++ trunk/rsvg-base.c Thu Jan 8 23:45:45 2009
@@ -1473,6 +1473,30 @@
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
Modified: trunk/rsvg.h
==============================================================================
--- trunk/rsvg.h (original)
+++ trunk/rsvg.h Thu Jan 8 23:45:45 2009
@@ -130,6 +130,8 @@
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]