diff options
author | Juan A. Suarez Romero <jasuarez@igalia.com> | 2010-03-04 21:32:41 +0100 |
---|---|---|
committer | Juan A. Suarez Romero <jasuarez@igalia.com> | 2010-03-04 23:30:49 +0100 |
commit | 539fe8717f2d08bafbeb69da66a63ca0693c58ac (patch) | |
tree | b14dc1493fc05065ecdcbf60f5cb553ef9c401a1 | |
parent | 9a80b3fb002bd13e00b1d04328318a85dc73e4fa (diff) | |
download | grilo-539fe8717f2d08bafbeb69da66a63ca0693c58ac.tar.gz |
Rename GrlDataConfig to GrlConfig
-rw-r--r-- | src/data/Makefile.am | 4 | ||||
-rw-r--r-- | src/data/grl-config.c (renamed from src/data/grl-data-config.c) | 46 | ||||
-rw-r--r-- | src/data/grl-config.h | 107 | ||||
-rw-r--r-- | src/data/grl-data-config.h | 107 | ||||
-rw-r--r-- | src/grilo.h | 2 | ||||
-rw-r--r-- | src/grl-plugin-registry.c | 6 | ||||
-rw-r--r-- | src/grl-plugin-registry.h | 6 | ||||
-rw-r--r-- | tools/grilo-test-ui/main.c | 10 |
8 files changed, 144 insertions, 144 deletions
diff --git a/src/data/Makefile.am b/src/data/Makefile.am index ae7e765..46b7fe2 100644 --- a/src/data/Makefile.am +++ b/src/data/Makefile.am @@ -21,7 +21,7 @@ libdata_la_SOURCES = \ grl-data-video.c \ grl-data-image.c \ grl-data-box.c \ - grl-data-config.c + grl-config.c libdataincdir = $(includedir)/@GRL_NAME@ @@ -32,7 +32,7 @@ libdatainc_HEADERS = \ grl-data-audio.h \ grl-data-video.h \ grl-data-image.h \ - grl-data-config.h + grl-config.h MAINTAINERCLEANFILES = \ *.in \ diff --git a/src/data/grl-data-config.c b/src/data/grl-config.c index 4df68f6..368dcba 100644 --- a/src/data/grl-data-config.c +++ b/src/data/grl-config.c @@ -29,71 +29,71 @@ * */ -#include "grl-data-config.h" +#include "grl-config.h" #undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "grl-data-config" +#define G_LOG_DOMAIN "grl-config" -static void grl_data_config_dispose (GObject *object); -static void grl_data_config_finalize (GObject *object); +static void grl_config_dispose (GObject *object); +static void grl_config_finalize (GObject *object); -G_DEFINE_TYPE (GrlDataConfig, grl_data_config, GRL_TYPE_DATA); +G_DEFINE_TYPE (GrlConfig, grl_config, GRL_TYPE_DATA); static void -grl_data_config_class_init (GrlDataConfigClass *klass) +grl_config_class_init (GrlConfigClass *klass) { GObjectClass *gobject_class = (GObjectClass *)klass; - gobject_class->dispose = grl_data_config_dispose; - gobject_class->finalize = grl_data_config_finalize; + gobject_class->dispose = grl_config_dispose; + gobject_class->finalize = grl_config_finalize; } static void -grl_data_config_init (GrlDataConfig *self) +grl_config_init (GrlConfig *self) { } static void -grl_data_config_dispose (GObject *object) +grl_config_dispose (GObject *object) { - G_OBJECT_CLASS (grl_data_config_parent_class)->dispose (object); + G_OBJECT_CLASS (grl_config_parent_class)->dispose (object); } static void -grl_data_config_finalize (GObject *object) +grl_config_finalize (GObject *object) { - g_debug ("grl_data_config_finalize"); + g_debug ("grl_config_finalize"); g_signal_handlers_destroy (object); - G_OBJECT_CLASS (grl_data_config_parent_class)->finalize (object); + G_OBJECT_CLASS (grl_config_parent_class)->finalize (object); } /** - * grl_data_config_new: + * grl_config_new: * * Creates a new data config object. * * Returns: a newly-allocated data config. **/ -GrlDataConfig * -grl_data_config_new (void) +GrlConfig * +grl_config_new (void) { - return g_object_new (GRL_TYPE_DATA_CONFIG, + return g_object_new (GRL_TYPE_CONFIG, NULL); } /** - * grl_data_config_new_for_plugin: + * grl_config_new_for_plugin: * @plugin: plugin id for this configuration * * Creates a new data config object that will be associated with a plugin. * * Returns: a newly-allocated data config. **/ -GrlDataConfig * -grl_data_config_new_for_plugin (const gchar *plugin) +GrlConfig * +grl_config_new_for_plugin (const gchar *plugin) { - GrlDataConfig *config = grl_data_config_new (); - grl_data_config_set_plugin (config, plugin); + GrlConfig *config = grl_config_new (); + grl_config_set_plugin (config, plugin); return config; } diff --git a/src/data/grl-config.h b/src/data/grl-config.h new file mode 100644 index 0000000..af2d39a --- /dev/null +++ b/src/data/grl-config.h @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2010 Igalia S.L. + * + * Contact: Iago Toral Quiroga <itoral@igalia.com> + * + * Authors: Juan A. Suarez Romero <jasuarez@igalia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + +#ifndef _GRL_CONFIG_H_ +#define _GRL_CONFIG_H_ + +#include <grl-data.h> + + +G_BEGIN_DECLS + +#define GRL_TYPE_CONFIG \ + (grl_config_get_type()) + +#define GRL_CONFIG(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + GRL_TYPE_CONFIG, \ + GrlConfig)) + +#define GRL_CONFIG_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + GRL_TYPE_CONFIG, \ + GrlConfigClass)) + +#define GRL_IS_CONFIG(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + GRL_TYPE_CONFIG)) + +#define GRL_IS_CONFIG_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + GRL_TYPE_CONFIG)) + +#define GRL_CONFIG_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + GRL_TYPE_CONFIG, \ + GrlConfigClass)) + +typedef struct _GrlConfig GrlConfig; +typedef struct _GrlConfigClass GrlConfigClass; + +struct _GrlConfigClass +{ + GrlDataClass parent_class; +}; + +struct _GrlConfig +{ + GrlData parent; +}; + +#define grl_config_set_plugin(data, plugin) \ + grl_data_set_string(GRL_DATA((data)), \ + GRL_CONFIG_KEY_PLUGIN, \ + (plugin)) \ + +#define grl_config_set_api_key(data, key) \ + grl_data_set_string(GRL_DATA((data)), \ + GRL_CONFIG_KEY_APIKEY, \ + (key)) + +#define grl_config_set_api_token(data, token) \ + grl_data_set_string(GRL_DATA((data)), \ + GRL_CONFIG_KEY_APITOKEN, \ + (token)) + +#define grl_config_set_api_secret(data, secret) \ + grl_data_set_string(GRL_DATA((data)), \ + GRL_CONFIG_KEY_APISECRET, \ + (secret)) + +#define grl_config_get_plugin(data) \ + grl_data_get_string(GRL_DATA((data)), GRL_CONFIG_KEY_PLUGIN) +#define grl_config_get_api_key(data) \ + grl_data_get_string(GRL_DATA((data)), GRL_CONFIG_KEY_APIKEY) +#define grl_config_get_api_token(data) \ + grl_data_get_string(GRL_DATA((data)), GRL_CONFIG_KEY_APITOKEN) +#define grl_config_get_api_secret(data) \ + grl_data_get_string(GRL_DATA((data)), GRL_CONFIG_KEY_APISECRET) + +GType grl_config_get_type (void) G_GNUC_CONST; +GrlConfig *grl_config_new (void); +GrlConfig *grl_config_new_for_plugin (const gchar *plugin); + +G_END_DECLS + +#endif /* _GRL_CONFIG_H_ */ diff --git a/src/data/grl-data-config.h b/src/data/grl-data-config.h deleted file mode 100644 index 82731de..0000000 --- a/src/data/grl-data-config.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2010 Igalia S.L. - * - * Contact: Iago Toral Quiroga <itoral@igalia.com> - * - * Authors: Juan A. Suarez Romero <jasuarez@igalia.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - * - */ - -#ifndef _GRL_DATA_CONFIG_H_ -#define _GRL_DATA_CONFIG_H_ - -#include <grl-data.h> - - -G_BEGIN_DECLS - -#define GRL_TYPE_DATA_CONFIG \ - (grl_data_config_get_type()) - -#define GRL_DATA_CONFIG(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - GRL_TYPE_DATA_CONFIG, \ - GrlDataConfig)) - -#define GRL_DATA_CONFIG_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - GRL_TYPE_DATA_CONFIG, \ - GrlDataConfigClass)) - -#define GRL_IS_DATA_CONFIG(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - GRL_TYPE_DATA_CONFIG)) - -#define GRL_IS_DATA_CONFIG_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - GRL_TYPE_DATA_CONFIG)) - -#define GRL_DATA_CONFIG_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - GRL_TYPE_DATA_CONFIG, \ - GrlDataConfigClass)) - -typedef struct _GrlDataConfig GrlDataConfig; -typedef struct _GrlDataConfigClass GrlDataConfigClass; - -struct _GrlDataConfigClass -{ - GrlDataClass parent_class; -}; - -struct _GrlDataConfig -{ - GrlData parent; -}; - -#define grl_data_config_set_plugin(data, plugin) \ - grl_data_set_string(GRL_DATA((data)), \ - GRL_CONFIG_KEY_PLUGIN, \ - (plugin)) \ - -#define grl_data_config_set_api_key(data, key) \ - grl_data_set_string(GRL_DATA((data)), \ - GRL_CONFIG_KEY_APIKEY, \ - (key)) - -#define grl_data_config_set_api_token(data, token) \ - grl_data_set_string(GRL_DATA((data)), \ - GRL_CONFIG_KEY_APITOKEN, \ - (token)) - -#define grl_data_config_set_api_secret(data, secret) \ - grl_data_set_string(GRL_DATA((data)), \ - GRL_CONFIG_KEY_APISECRET, \ - (secret)) - -#define grl_data_config_get_plugin(data) \ - grl_data_get_string(GRL_DATA((data)), GRL_CONFIG_KEY_PLUGIN) -#define grl_data_config_get_api_key(data) \ - grl_data_get_string(GRL_DATA((data)), GRL_CONFIG_KEY_APIKEY) -#define grl_data_config_get_api_token(data) \ - grl_data_get_string(GRL_DATA((data)), GRL_CONFIG_KEY_APITOKEN) -#define grl_data_config_get_api_secret(data) \ - grl_data_get_string(GRL_DATA((data)), GRL_CONFIG_KEY_APISECRET) - -GType grl_data_config_get_type (void) G_GNUC_CONST; -GrlDataConfig *grl_data_config_new (void); -GrlDataConfig *grl_data_config_new_for_plugin (const gchar *plugin); - -G_END_DECLS - -#endif /* _GRL_DATA_CONFIG_H_ */ diff --git a/src/grilo.h b/src/grilo.h index e9f3e7a..55d4058 100644 --- a/src/grilo.h +++ b/src/grilo.h @@ -42,6 +42,6 @@ #include <grl-data-video.h> #include <grl-data-image.h> #include <grl-data-box.h> -#include <grl-data-config.h> +#include <grl-config.h> #endif /* _GRL_MEDIA_STORE_H_ */ diff --git a/src/grl-plugin-registry.c b/src/grl-plugin-registry.c index f57300e..a90a5ad 100644 --- a/src/grl-plugin-registry.c +++ b/src/grl-plugin-registry.c @@ -366,7 +366,7 @@ grl_plugin_registry_load (GrlPluginRegistry *registry, const gchar *path) { GModule *module; GrlPluginDescriptor *plugin; - GrlDataConfig *plugin_config; + GrlConfig *plugin_config; module = g_module_open (path, G_MODULE_BIND_LAZY); if (!module) { @@ -625,7 +625,7 @@ grl_plugin_registry_lookup_metadata_key (GrlPluginRegistry *registry, */ void grl_plugin_registry_set_config (GrlPluginRegistry *registry, - GrlDataConfig *config) + GrlConfig *config) { const gchar *plugin_id; @@ -633,7 +633,7 @@ grl_plugin_registry_set_config (GrlPluginRegistry *registry, return; } - plugin_id = grl_data_config_get_plugin (config); + plugin_id = grl_config_get_plugin (config); if (plugin_id) { g_hash_table_insert (registry->priv->configs, (gpointer) plugin_id, config); } diff --git a/src/grl-plugin-registry.h b/src/grl-plugin-registry.h index ad5d0fa..d0f77a2 100644 --- a/src/grl-plugin-registry.h +++ b/src/grl-plugin-registry.h @@ -29,7 +29,7 @@ #include <grl-media-source.h> #include <grl-metadata-key.h> -#include <grl-data-config.h> +#include <grl-config.h> #define GRL_PLUGIN_PATH_VAR "GRL_PLUGIN_PATH" #define GRL_PLUGIN_RANKS_VAR "GRL_PLUGIN_RANKS" @@ -145,7 +145,7 @@ typedef struct _GrlPluginDescriptor GrlPluginDescriptor; */ struct _GrlPluginDescriptor { GrlPluginInfo info; - gboolean (*plugin_init) (GrlPluginRegistry *, const GrlPluginInfo *, const GrlDataConfig *); + gboolean (*plugin_init) (GrlPluginRegistry *, const GrlPluginInfo *, const GrlConfig *); void (*plugin_deinit) (void); }; @@ -240,7 +240,7 @@ const GrlMetadataKey *grl_plugin_registry_lookup_metadata_key (GrlPluginRegistry GrlKeyID key_id); void grl_plugin_registry_set_config (GrlPluginRegistry *registry, - GrlDataConfig *config); + GrlConfig *config); G_END_DECLS diff --git a/tools/grilo-test-ui/main.c b/tools/grilo-test-ui/main.c index f7ce41e..9d75454 100644 --- a/tools/grilo-test-ui/main.c +++ b/tools/grilo-test-ui/main.c @@ -1131,13 +1131,13 @@ search_combo_setup (void) static void set_flickr_config (void) { - GrlDataConfig *config; + GrlConfig *config; GrlPluginRegistry *registry; - config = grl_data_config_new_for_plugin ("grl-flickr"); - grl_data_config_set_api_key (config, FLICKR_KEY); - grl_data_config_set_api_token (config, FLICKR_TOKEN); - grl_data_config_set_api_secret (config, FLICKR_SECRET); + config = grl_config_new_for_plugin ("grl-flickr"); + grl_config_set_api_key (config, FLICKR_KEY); + grl_config_set_api_token (config, FLICKR_TOKEN); + grl_config_set_api_secret (config, FLICKR_SECRET); registry = grl_plugin_registry_get_instance (); grl_plugin_registry_set_config (registry, config); |