grim/gplate

7dc2dc131276
Parents 5b47554de2c7
Children c7a1bd6c023e
A ton of documentation updates
--- a/doc/gplate/gplate-sections.txt Sun Feb 10 02:11:03 2008 -0600
+++ b/doc/gplate/gplate-sections.txt Sun Feb 10 02:17:56 2008 -0600
@@ -226,6 +226,7 @@
gplate_library_add_bound_function
gplate_library_lookup_function
gplate_library_lookup_function_for_tag
+gplate_library_lookup_tag
gplate_library_tags_foreach
</SECTION>
--- a/doc/gplate/tmpl/gplate-errors.sgml Sun Feb 10 02:11:03 2008 -0600
+++ b/doc/gplate/tmpl/gplate-errors.sgml Sun Feb 10 02:17:56 2008 -0600
@@ -42,6 +42,8 @@
@GPLATE_ERROR_LIBRARY_FUNCTION_BOUND: Used when a #GPlateFunction is already bound to a #GPlateTag.
@GPLATE_ERROR_LIBRARY_FUNCTION_NOT_BOUND: Used when a #GPlateFunction is not bound to a #GPlateTag.
@GPLATE_ERROR_LIBRARY_FUNCTION_NOT_BOUND_TO_TAG: Used when a #GPlateFunction is not bound to a specific #GPlateTag.
+@GPLATE_ERROR_LIBRARY_TAG_EXISTS: Used when a tag has already been registered in the library.
+@GPLATE_ERROR_LIBRARY_TAG_NOT_FOUND: Used when a lookup fails for a tag.
@GPLATE_ERROR_UNKNOWN: Undefined error.
<!-- ##### FUNCTION gplate_errors_get_quark ##### -->
--- a/doc/gplate/tmpl/gplate-library.sgml Sun Feb 10 02:11:03 2008 -0600
+++ b/doc/gplate/tmpl/gplate-library.sgml Sun Feb 10 02:17:56 2008 -0600
@@ -1,14 +1,17 @@
<!-- ##### SECTION Title ##### -->
-Function Library
+Function and Tag Library
<!-- ##### SECTION Short_Description ##### -->
-The library of functions
+The library of functions and tags.
<!-- ##### SECTION Long_Description ##### -->
<para>
-The library is a set of API ment to manage all functions. All
+The library is a set of API ment to manage all functions and tags. All
#GPlateFunction children should be registered in library, and if deemed
necessary bound to a specific tag.
+
+All #GPlateTag's should be registered in the library as well. If a tag
+is not registered in the library, #GPlateTemplate will not use them.
</para>
<!-- ##### SECTION See_Also ##### -->
@@ -19,6 +22,17 @@
<!-- ##### SECTION Stability_Level ##### -->
+<!-- ##### USER_FUNCTION GPlateLibraryTagsForeachFunc ##### -->
+<para>
+A callback function for use with #gplate_library_tags_foreach.
+</para>
+
+@tag: The #GType of the tag.
+@prefix: The prefix of the tag.
+@suffix: The suffix of the tag.
+@data: User data.
+
+
<!-- ##### FUNCTION gplate_library_add_function ##### -->
<para>
@@ -40,6 +54,26 @@
@Returns:
+<!-- ##### FUNCTION gplate_library_add_tag ##### -->
+<para>
+
+</para>
+
+@tag:
+@error:
+@Returns:
+
+
+<!-- ##### FUNCTION gplate_library_remove_tag ##### -->
+<para>
+
+</para>
+
+@tag:
+@error:
+@Returns:
+
+
<!-- ##### FUNCTION gplate_library_bind_function ##### -->
<para>
@@ -96,3 +130,24 @@
@Returns:
+<!-- ##### FUNCTION gplate_library_lookup_tag ##### -->
+<para>
+
+</para>
+
+@tag:
+@prefix:
+@suffix:
+@error:
+@Returns:
+
+
+<!-- ##### FUNCTION gplate_library_tags_foreach ##### -->
+<para>
+
+</para>
+
+@func:
+@data:
+
+
--- a/doc/gplate/tmpl/gplate-template.sgml Sun Feb 10 02:11:03 2008 -0600
+++ b/doc/gplate/tmpl/gplate-template.sgml Sun Feb 10 02:17:56 2008 -0600
@@ -32,17 +32,6 @@
@Returns:
-<!-- ##### FUNCTION gplate_template_add_tag ##### -->
-<para>
-
-</para>
-
-@tplate:
-@tag:
-@error:
-@Returns:
-
-
<!-- ##### FUNCTION gplate_template_tokenize ##### -->
<para>
--- a/doc/gplate/tmpl/gplate-unused.sgml Sun Feb 10 02:11:03 2008 -0600
+++ b/doc/gplate/tmpl/gplate-unused.sgml Sun Feb 10 02:17:56 2008 -0600
@@ -93,6 +93,16 @@
@Returns:
+<!-- ##### FUNCTION gplate_template_add_tag ##### -->
+<para>
+
+</para>
+
+@tplate:
+@tag:
+@error:
+@Returns:
+
<!-- ##### FUNCTION gplate_template_get_gtype ##### -->
<para>
--- a/gplate/gplate-library.c Sun Feb 10 02:11:03 2008 -0600
+++ b/gplate/gplate-library.c Sun Feb 10 02:17:56 2008 -0600
@@ -257,6 +257,15 @@
return TRUE;
}
+/**
+ * gplate_library_remove_tag:
+ * @tag: The #GType of the tag to remove from the library.
+ * @error: The return address for any errors.
+ *
+ * Unregisters @tag from the library.
+ *
+ * Return Value: TRUE on success, FALSE on failure with @error set.
+ */
gboolean
gplate_library_remove_tag(GType tag, GError **error) {
gpointer data;
@@ -549,6 +558,13 @@
fhd->func(data->tag, data->prefix, data->suffix, fhd->data);
}
+/**
+ * gplate_library_tags_foreach:
+ * @func: The callback function.
+ * @data: User data to pass to the callback function.
+ *
+ * Calls @func with each tag registered in the library.
+ */
void
gplate_library_tags_foreach(GPlateLibraryTagsForeachFunc func, gpointer data) {
GPlateLibraryTagsForeachData d = { 0, };