[libchamplain] Add champlain_memphis_map_source_remove_rule



commit ea06ebf18d0771067f798b7b262a402cc08af5e5
Author: Simon Wenner <simon wenner ch>
Date:   Sat Aug 8 21:58:22 2009 +0200

    Add champlain_memphis_map_source_remove_rule

 champlain/champlain-memphis-map-source.c |   26 +++++++++++++++++++++++++-
 champlain/champlain-memphis-map-source.h |    4 ++++
 docs/reference/libchamplain-sections.txt |    1 +
 3 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/champlain/champlain-memphis-map-source.c b/champlain/champlain-memphis-map-source.c
index d225dbf..7377616 100644
--- a/champlain/champlain-memphis-map-source.c
+++ b/champlain/champlain-memphis-map-source.c
@@ -54,7 +54,6 @@
 #include <glib/gstdio.h>
 #include <clutter-cairo.h>
 #include <gdk/gdk.h>
-#include <memphis/memphis.h>
 
 /* Tuning parameters */
 #define MAX_THREADS 4
@@ -799,3 +798,28 @@ champlain_memphis_map_source_get_rule_ids (ChamplainMemphisMapSource *self)
 
   return list;
 }
+
+/**
+ * champlain_memphis_map_source_remove_rule:
+ * @map_source: a #ChamplainMemphisMapSource
+ * @id: an id string
+ *
+ * Removes the rule with the given id.
+ *
+ * Since: 0.6
+ */
+void champlain_memphis_map_source_remove_rule (
+    ChamplainMemphisMapSource *self,
+    const gchar *id)
+{
+  g_return_if_fail (CHAMPLAIN_IS_MEMPHIS_MAP_SOURCE (self));
+
+  ChamplainMemphisMapSourcePrivate *priv = GET_PRIVATE (self);
+
+  g_static_rw_lock_writer_lock (&MemphisLock);
+  memphis_rule_set_remove_rule (priv->rules, id);
+  g_static_rw_lock_writer_unlock (&MemphisLock);
+
+  if (!priv->persistent_cache)
+    champlain_memphis_map_source_delete_session_cache (self);
+}
diff --git a/champlain/champlain-memphis-map-source.h b/champlain/champlain-memphis-map-source.h
index 0071b22..5068cb6 100644
--- a/champlain/champlain-memphis-map-source.h
+++ b/champlain/champlain-memphis-map-source.h
@@ -97,6 +97,10 @@ MemphisRule * champlain_memphis_map_source_get_rule (
     ChamplainMemphisMapSource *map_source,
     const gchar *id);
 
+void champlain_memphis_map_source_remove_rule (
+    ChamplainMemphisMapSource *map_source,
+    const gchar *id);
+
 G_END_DECLS
 
 #endif /* _CHAMPLAIN_MEMPHIS_MAP_SOURCE */
diff --git a/docs/reference/libchamplain-sections.txt b/docs/reference/libchamplain-sections.txt
index 815fef4..8ec4578 100644
--- a/docs/reference/libchamplain-sections.txt
+++ b/docs/reference/libchamplain-sections.txt
@@ -481,6 +481,7 @@ champlain_memphis_map_source_get_session_id
 champlain_memphis_map_source_set_background_color
 champlain_memphis_map_source_set_map_data_source
 champlain_memphis_map_source_set_rule
+champlain_memphis_map_source_remove_rule
 champlain_memphis_map_source_set_session_id
 champlain_memphis_map_source_delete_session_cache
 <SUBSECTION Standard>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]