[PATCH 11/16] core: Replaced grl-media-plugin defines with functions



---
 src/grl-media-plugin.c |   94 ++++++++++++++++++++++++++++++++++++++++++++++-
 src/grl-media-plugin.h |   78 +++++-----------------------------------
 2 files changed, 101 insertions(+), 71 deletions(-)

diff --git a/src/grl-media-plugin.c b/src/grl-media-plugin.c
index b3ba78b..6430a98 100644
--- a/src/grl-media-plugin.c
+++ b/src/grl-media-plugin.c
@@ -83,12 +83,102 @@ grl_media_plugin_set_plugin_info (GrlMediaPlugin *plugin,
 }
 
 /**
+ * grl_media_plugin_get_name:
+ * @plugin: a plugin
+ *
+ * Get the name of the plugin
+ *
+ * Returns: the name of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_name (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                    GRL_MEDIA_PLUGIN_NAME);
+}
+
+/**
+ * grl_media_plugin_get_description:
+ * @plugin: a plugin
+ *
+ * Get the description of the plugin
+ *
+ * Returns: the description of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_description (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                    GRL_MEDIA_PLUGIN_DESCRIPTION);
+}
+
+/**
+ * grl_media_plugin_get_version:
+ * @plugin: a plugin
+ *
+ * Get the version of the plugin
+ *
+ * Returns: the version of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_version (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                   GRL_MEDIA_PLUGIN_VERSION);
+}
+
+/**
+ * grl_media_plugin_get_license:
+ * @plugin: a plugin
+ *
+ * Get the license of the plugin
+ *
+ * Returns: the license of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_license (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                    GRL_MEDIA_PLUGIN_LICENSE);
+}
+
+/**
+ * grl_media_plugin_get_author:
+ * @plugin: a plugin
+ *
+ * Get the author of the plugin
+ *
+ * Returns: the author of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_author (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                    GRL_MEDIA_PLUGIN_AUTHOR);
+}
+
+/**
+ * grl_media_plugin_get_site:
+ * @plugin: a plugin
+ *
+ * Get the site of the plugin
+ *
+ * Returns: the site of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_site (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                    GRL_MEDIA_PLUGIN_SITE);
+}
+
+/**
  * grl_media_plugin_get_id:
  * @plugin: a plugin
  *
  * Get the id of the plugin
  *
- * Returns: (transfer none): the id of the @plugin
+ * Returns: the id of the @plugin
  */
 const gchar *
 grl_media_plugin_get_id (GrlMediaPlugin *plugin)
@@ -104,7 +194,7 @@ grl_media_plugin_get_id (GrlMediaPlugin *plugin)
  *
  * Get the filename containing the plugin
  *
- * Returns: (transfer none): the filename containing @plugin
+ * Returns: the filename containing @plugin
  */
 const gchar *
 grl_media_plugin_get_filename (GrlMediaPlugin *plugin)
diff --git a/src/grl-media-plugin.h b/src/grl-media-plugin.h
index a60eb8c..8947500 100644
--- a/src/grl-media-plugin.h
+++ b/src/grl-media-plugin.h
@@ -94,83 +94,23 @@ struct _GrlMediaPluginClass {
 
 };
 
-/**
- * grl_media_plugin_get_name:
- * @plugin: a plugin
- *
- * Get the name of the plugin
- *
- * Returns: (transfer none): the name of the @plugin
- */
-#define grl_media_plugin_get_name(plugin)		\
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin),	\
-			    GRL_MEDIA_PLUGIN_NAME)
+/* Function prototypes */
 
-/**
- * grl_media_plugin_get_description:
- * @plugin: a plugin
- *
- * Get the description of the plugin
- *
- * Returns: (transfer none): the description of the @plugin
- */
-#define grl_media_plugin_get_description(plugin)      \
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin), \
-			    GRL_MEDIA_PLUGIN_DESCRIPTION)
+G_BEGIN_DECLS
 
-/**
- * grl_media_plugin_get_version:
- * @plugin: a plugin
- *
- * Get the version of the plugin
- *
- * Returns: (transfer none): the version of the @plugin
- */
-#define grl_media_plugin_get_version(plugin)	      \
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin), \
-			    GRL_MEDIA_PLUGIN_VERSION)
+GType grl_media_plugin_get_type (void);
 
-/**
- * grl_media_plugin_get_license:
- * @plugin: a plugin
- *
- * Get the license of the plugin
- *
- * Returns: (transfer none): the license of the @plugin
- */
-#define grl_media_plugin_get_license(plugin)	      \
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin), \
-			    GRL_MEDIA_PLUGIN_LICENSE)
+const gchar *grl_media_plugin_get_name (GrlMediaPlugin *plugin);
 
-/**
- * grl_media_plugin_get_author:
- * @plugin: a plugin
- *
- * Get the author of the plugin
- *
- * Returns: (transfer none): the author of the @plugin
- */
-#define grl_media_plugin_get_author(plugin)	      \
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin), \
-			    GRL_MEDIA_PLUGIN_AUTHOR)
+const gchar *grl_media_plugin_get_description (GrlMediaPlugin *plugin);
 
-/**
- * grl_media_plugin_get_site:
- * @plugin: a plugin
- *
- * Get the site of the plugin
- *
- * Returns: (transfer none): the site of the @plugin
- */
-#define grl_media_plugin_get_site(plugin)	      \
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin), \
-			    GRL_MEDIA_PLUGIN_SITE)
+const gchar *grl_media_plugin_get_version (GrlMediaPlugin *plugin);
 
-/* Function prototypes */
+const gchar *grl_media_plugin_get_license (GrlMediaPlugin *plugin);
 
-G_BEGIN_DECLS
+const gchar *grl_media_plugin_get_author (GrlMediaPlugin *plugin);
 
-GType grl_media_plugin_get_type (void);
+const gchar *grl_media_plugin_get_site (GrlMediaPlugin *plugin);
 
 const gchar *grl_media_plugin_get_id (GrlMediaPlugin *plugin);
 
-- 
1.7.0.4



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