[PATCH 03/17] core: Make grl-metadata-key more introspection friendly



Provided actual functions to access name and description for a
given metadata key, as macros aren't introspection friendly.
---
 src/grl-metadata-key.c |   28 ++++++++++++++++++++++++++++
 src/grl-metadata-key.h |    4 ++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/src/grl-metadata-key.c b/src/grl-metadata-key.c
index 9051563..77431fa 100644
--- a/src/grl-metadata-key.c
+++ b/src/grl-metadata-key.c
@@ -282,3 +282,31 @@ GRL_METADATA_KEY_STUDIO =
                                                                    0,
                                                                    G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
 }
+
+/**
+ * grl_metadata_key_get_name:
+ * @key: (type GObject.ParamSpec*): key to look up
+ *
+ * Retrieves the name associated with the key
+ *
+ * Returns: The name of the key
+ */
+const gchar *
+grl_metadata_key_get_name (GrlKeyID key)
+{
+  return GRL_METADATA_KEY_GET_NAME (key);
+}
+
+/**
+ * grl_metadata_key_get_desc:
+ * @key: (type GObject.ParamSpec*): key to look up
+ *
+ * Retrieves the description associated with the key
+ *
+ * Returns: the description of the key
+ */
+const gchar *
+grl_metadata_key_get_desc (GrlKeyID key)
+{
+  return GRL_METADATA_KEY_GET_DESC (key);
+}
diff --git a/src/grl-metadata-key.h b/src/grl-metadata-key.h
index 34ec822..7e0e388 100644
--- a/src/grl-metadata-key.h
+++ b/src/grl-metadata-key.h
@@ -75,4 +75,8 @@ extern GrlKeyID GRL_METADATA_KEY_TITLE;
 extern GrlKeyID GRL_METADATA_KEY_URL;
 extern GrlKeyID GRL_METADATA_KEY_WIDTH;
 
+const gchar *grl_metadata_key_get_name (GrlKeyID key);
+
+const gchar *grl_metadata_key_get_desc (GrlKeyID key);
+
 #endif /* _GRL_METADATA_KEY_H_ */
-- 
1.7.0.4



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