[totem] Move plugin class struct and type function definitions to totem-plugin.h
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] Move plugin class struct and type function definitions to totem-plugin.h
- Date: Sun, 5 Sep 2010 01:28:47 +0000 (UTC)
commit a9e89c02e5c1fc10c23b25643c27af3b12ab6051
Author: Philip Withnall <philip tecnocode co uk>
Date: Sun Sep 5 01:38:06 2010 +0100
Move plugin class struct and type function definitions to totem-plugin.h
They should all be very standard, so we same some clutter by putting them
in the _TOTEM_PLUGIN_REGISTER macro.
src/plugins/bemused/totem-bemused.c | 7 -------
.../brasero-disc-recorder/totem-disc-recorder.c | 7 -------
src/plugins/chapters/totem-chapters.c | 6 ------
src/plugins/galago/totem-galago.c | 6 ------
src/plugins/gromit/totem-gromit.c | 7 -------
src/plugins/lirc/totem-lirc.c | 7 -------
.../media-player-keys/totem-media-player-keys.c | 7 -------
src/plugins/mythtv/totem-mythtv.c | 8 --------
src/plugins/ontop/totem-ontop.c | 7 -------
src/plugins/properties/totem-movie-properties.c | 7 -------
src/plugins/publish/totem-publish.c | 7 -------
src/plugins/screensaver/totem-screensaver.c | 8 --------
src/plugins/screenshot/totem-screenshot-plugin.h | 6 ------
src/plugins/sidebar-test/totem-sidebar-test.c | 8 --------
src/plugins/skipto/totem-skipto-plugin.c | 6 ------
src/plugins/thumbnail/totem-thumbnail.c | 7 -------
src/plugins/totem-plugin.h | 4 ++++
src/plugins/tracker/totem-tracker.c | 8 --------
src/plugins/youtube/totem-youtube.c | 6 ------
19 files changed, 4 insertions(+), 125 deletions(-)
---
diff --git a/src/plugins/bemused/totem-bemused.c b/src/plugins/bemused/totem-bemused.c
index 17f7e2e..7c720e6 100644
--- a/src/plugins/bemused/totem-bemused.c
+++ b/src/plugins/bemused/totem-bemused.c
@@ -68,13 +68,6 @@ typedef struct
sdp_session_t *sdp_session;
} TotemBemusedPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemBemusedPluginClass;
-
-GType totem_bemused_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_BEMUSED_PLUGIN, TotemBemusedPlugin, totem_bemused_plugin)
/* Bluetooth functions */
diff --git a/src/plugins/brasero-disc-recorder/totem-disc-recorder.c b/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
index a5afea2..03dbc6f 100644
--- a/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
+++ b/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
@@ -61,13 +61,6 @@ typedef struct
gboolean enabled;
} TotemDiscRecorderPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemDiscRecorderPluginClass;
-
-GType totem_disc_recorder_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_DISC_RECORDER_PLUGIN, TotemDiscRecorderPlugin, totem_disc_recorder_plugin)
static void totem_disc_recorder_plugin_burn (GtkAction *action,
diff --git a/src/plugins/chapters/totem-chapters.c b/src/plugins/chapters/totem-chapters.c
index 6c9245d..882f4ee 100644
--- a/src/plugins/chapters/totem-chapters.c
+++ b/src/plugins/chapters/totem-chapters.c
@@ -91,10 +91,6 @@ typedef struct {
TotemChaptersPluginPrivate *priv;
} TotemChaptersPlugin;
-typedef struct {
- PeasExtensionBaseClass parent_class;
-} TotemChaptersPluginClass;
-
enum {
CHAPTERS_PIXBUF_COLUMN = 0,
CHAPTERS_TITLE_COLUMN,
@@ -104,8 +100,6 @@ enum {
CHAPTERS_N_COLUMNS
};
-G_MODULE_EXPORT GType register_totem_plugin (GTypeModule *module);
-GType totem_chapters_plugin_get_type (void) G_GNUC_CONST;
static void totem_file_opened_async_cb (TotemObject *totem, const gchar *uri, TotemChaptersPlugin *plugin);
static void totem_file_opened_result_cb (gpointer data, gpointer user_data);
static void totem_file_closed_cb (TotemObject *totem, TotemChaptersPlugin *plugin);
diff --git a/src/plugins/galago/totem-galago.c b/src/plugins/galago/totem-galago.c
index 14eb134..3b74b8d 100644
--- a/src/plugins/galago/totem-galago.c
+++ b/src/plugins/galago/totem-galago.c
@@ -56,12 +56,6 @@ typedef struct {
GalagoPerson *me; /* Me! */
} TotemGalagoPlugin;
-typedef struct {
- PeasExtensionBaseClass parent_class;
-} TotemGalagoPluginClass;
-
-GType totem_galago_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER (TOTEM_TYPE_GALAGO_PLUGIN, TotemGalagoPlugin, totem_galago_plugin);
static void
diff --git a/src/plugins/gromit/totem-gromit.c b/src/plugins/gromit/totem-gromit.c
index c8f5cf6..4fd851e 100644
--- a/src/plugins/gromit/totem-gromit.c
+++ b/src/plugins/gromit/totem-gromit.c
@@ -65,11 +65,6 @@ typedef struct
gulong handler_id;
} TotemGromitPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemGromitPluginClass;
-
#define INTERVAL 10 /* seconds */
static const char *start_cmd[] = { NULL, "-a", "-k", "none", NULL };
@@ -94,8 +89,6 @@ static const char *visibility_cmd[] = { NULL, "-v", NULL };
\"Core Pointer\"[Button3] = \"Eraser\"; \n\
\n"
-GType totem_gromit_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_GROMIT_PLUGIN, TotemGromitPlugin, totem_gromit_plugin)
static void
diff --git a/src/plugins/lirc/totem-lirc.c b/src/plugins/lirc/totem-lirc.c
index 08d6dde..fb47fd2 100644
--- a/src/plugins/lirc/totem-lirc.c
+++ b/src/plugins/lirc/totem-lirc.c
@@ -61,11 +61,6 @@ typedef struct
TotemObject *totem;
} TotemLircPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemLircPluginClass;
-
/* strings that we recognize as commands from lirc */
#define TOTEM_IR_COMMAND_PLAY "play"
#define TOTEM_IR_COMMAND_PAUSE "pause"
@@ -96,8 +91,6 @@ typedef struct
#define TOTEM_IR_SETTING_TOGGLE_REPEAT "setting_repeat"
#define TOTEM_IR_SETTING_TOGGLE_SHUFFLE "setting_shuffle"
-GType totem_lirc_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_LIRC_PLUGIN, TotemLircPlugin, totem_lirc_plugin)
static void
diff --git a/src/plugins/media-player-keys/totem-media-player-keys.c b/src/plugins/media-player-keys/totem-media-player-keys.c
index a38aa61..02b41ae 100644
--- a/src/plugins/media-player-keys/totem-media-player-keys.c
+++ b/src/plugins/media-player-keys/totem-media-player-keys.c
@@ -57,13 +57,6 @@ typedef struct
guint handler_id;
} TotemMediaPlayerKeysPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemMediaPlayerKeysPluginClass;
-
-GType totem_media_player_keys_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_MEDIA_PLAYER_KEYS_PLUGIN,
TotemMediaPlayerKeysPlugin,
totem_media_player_keys_plugin);
diff --git a/src/plugins/mythtv/totem-mythtv.c b/src/plugins/mythtv/totem-mythtv.c
index 56ed174..14d059a 100644
--- a/src/plugins/mythtv/totem-mythtv.c
+++ b/src/plugins/mythtv/totem-mythtv.c
@@ -81,14 +81,6 @@ typedef struct
GtkWidget *sidebar_livetv;
} TotemMythtvPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemMythtvPluginClass;
-
-
-GType totem_mythtv_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_MYTHTV_PLUGIN, TotemMythtvPlugin, totem_mythtv_plugin)
#define MAX_THUMB_SIZE 500 * 1024 * 1024
diff --git a/src/plugins/ontop/totem-ontop.c b/src/plugins/ontop/totem-ontop.c
index 2d4929d..cb3f972 100644
--- a/src/plugins/ontop/totem-ontop.c
+++ b/src/plugins/ontop/totem-ontop.c
@@ -60,13 +60,6 @@ typedef struct
TotemOntopPluginPrivate *priv;
} TotemOntopPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemOntopPluginClass;
-
-GType totem_ontop_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_ONTOP_PLUGIN, TotemOntopPlugin, totem_ontop_plugin)
static void
diff --git a/src/plugins/properties/totem-movie-properties.c b/src/plugins/properties/totem-movie-properties.c
index 334b390..b0015e0 100644
--- a/src/plugins/properties/totem-movie-properties.c
+++ b/src/plugins/properties/totem-movie-properties.c
@@ -55,13 +55,6 @@ typedef struct
guint handler_id_stream_length;
} TotemMoviePropertiesPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemMoviePropertiesPluginClass;
-
-GType totem_movie_properties_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_MOVIE_PROPERTIES_PLUGIN,
TotemMoviePropertiesPlugin,
totem_movie_properties_plugin)
diff --git a/src/plugins/publish/totem-publish.c b/src/plugins/publish/totem-publish.c
index 47d1fcf..8068ec7 100644
--- a/src/plugins/publish/totem-publish.c
+++ b/src/plugins/publish/totem-publish.c
@@ -88,13 +88,6 @@ typedef struct
gulong item_removed_id;
} TotemPublishPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemPublishPluginClass;
-
-GType totem_publish_plugin_get_type (void) G_GNUC_CONST;
-
void totem_publish_plugin_service_name_entry_changed_cb (GtkEntry *entry,
TotemPublishPlugin *self);
void totem_publish_plugin_encryption_button_toggled_cb (GtkToggleButton *button,
diff --git a/src/plugins/screensaver/totem-screensaver.c b/src/plugins/screensaver/totem-screensaver.c
index 50c75f8..0342ce3 100644
--- a/src/plugins/screensaver/totem-screensaver.c
+++ b/src/plugins/screensaver/totem-screensaver.c
@@ -59,14 +59,6 @@ typedef struct
guint handler_id_metadata;
} TotemScreensaverPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemScreensaverPluginClass;
-
-
-GType totem_screensaver_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_SCREENSAVER_PLUGIN,
TotemScreensaverPlugin,
totem_screensaver_plugin)
diff --git a/src/plugins/screenshot/totem-screenshot-plugin.h b/src/plugins/screenshot/totem-screenshot-plugin.h
index 4f0c48e..d125b1e 100644
--- a/src/plugins/screenshot/totem-screenshot-plugin.h
+++ b/src/plugins/screenshot/totem-screenshot-plugin.h
@@ -50,12 +50,6 @@ typedef struct {
TotemScreenshotPluginPrivate *priv;
} TotemScreenshotPlugin;
-typedef struct {
- PeasExtensionBaseClass parent_class;
-} TotemScreenshotPluginClass;
-
-GType totem_screenshot_plugin_get_type (void) G_GNUC_CONST;
-
gchar *totem_screenshot_plugin_setup_file_chooser (const char *filename_format, const char *movie_name) G_GNUC_WARN_UNUSED_RESULT;
void totem_screenshot_plugin_update_file_chooser (const char *filename);
diff --git a/src/plugins/sidebar-test/totem-sidebar-test.c b/src/plugins/sidebar-test/totem-sidebar-test.c
index 90bc9a9..ba9dad1 100644
--- a/src/plugins/sidebar-test/totem-sidebar-test.c
+++ b/src/plugins/sidebar-test/totem-sidebar-test.c
@@ -48,14 +48,6 @@ typedef struct
PeasExtensionBase parent;
} TotemSidebarTestPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemSidebarTestPluginClass;
-
-
-GType totem_sidebar_test_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_SIDEBAR_TEST_PLUGIN, TotemSidebarTestPlugin, totem_sidebar_test_plugin)
static void
diff --git a/src/plugins/skipto/totem-skipto-plugin.c b/src/plugins/skipto/totem-skipto-plugin.c
index d66b7e6..c17c3d3 100644
--- a/src/plugins/skipto/totem-skipto-plugin.c
+++ b/src/plugins/skipto/totem-skipto-plugin.c
@@ -61,12 +61,6 @@ typedef struct {
TotemSkiptoPluginPrivate *priv;
} TotemSkiptoPlugin;
-typedef struct {
- PeasExtensionBaseClass parent_class;
-} TotemSkiptoPluginClass;
-
-GType totem_skipto_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_SKIPTO_PLUGIN, TotemSkiptoPlugin, totem_skipto_plugin)
static void
diff --git a/src/plugins/thumbnail/totem-thumbnail.c b/src/plugins/thumbnail/totem-thumbnail.c
index afbe58a..a0aa0ab 100644
--- a/src/plugins/thumbnail/totem-thumbnail.c
+++ b/src/plugins/thumbnail/totem-thumbnail.c
@@ -60,13 +60,6 @@ typedef struct
TotemThumbnailPluginPrivate *priv;
} TotemThumbnailPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemThumbnailPluginClass;
-
-GType totem_thumbnail_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_THUMBNAIL_PLUGIN, TotemThumbnailPlugin, totem_thumbnail_plugin)
static void
diff --git a/src/plugins/totem-plugin.h b/src/plugins/totem-plugin.h
index 6734eb8..c8c2079 100644
--- a/src/plugins/totem-plugin.h
+++ b/src/plugins/totem-plugin.h
@@ -49,6 +49,10 @@ G_BEGIN_DECLS
* deactivate functions.
**/
#define _TOTEM_PLUGIN_REGISTER(TYPE_NAME, TypeName, type_name, TYPE_CODE, REGISTER_CODE) \
+ typedef struct { \
+ PeasExtensionBaseClass parent_class; \
+ } TypeName##Class; \
+ GType type_name##_get_type (void) G_GNUC_CONST; \
static void impl_activate (PeasActivatable *plugin); \
static void impl_deactivate (PeasActivatable *plugin); \
G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module); \
diff --git a/src/plugins/tracker/totem-tracker.c b/src/plugins/tracker/totem-tracker.c
index 8c9b1a7..9ca4dbe 100644
--- a/src/plugins/tracker/totem-tracker.c
+++ b/src/plugins/tracker/totem-tracker.c
@@ -51,14 +51,6 @@ typedef struct
PeasExtensionBase parent;
} TotemTrackerPlugin;
-typedef struct
-{
- PeasExtensionBaseClass parent_class;
-} TotemTrackerPluginClass;
-
-G_MODULE_EXPORT GType register_totem_plugin (GTypeModule *module);
-GType totem_tracker_plugin_get_type (void) G_GNUC_CONST;
-
TOTEM_PLUGIN_REGISTER (TOTEM_TYPE_TRACKER_PLUGIN, TotemTrackerPlugin, totem_tracker_plugin);
static void
diff --git a/src/plugins/youtube/totem-youtube.c b/src/plugins/youtube/totem-youtube.c
index 325cc34..bdb368f 100644
--- a/src/plugins/youtube/totem-youtube.c
+++ b/src/plugins/youtube/totem-youtube.c
@@ -88,12 +88,6 @@ typedef struct {
GtkWidget *cancel_button;
} TotemYouTubePlugin;
-typedef struct {
- PeasExtensionBaseClass parent_class;
-} TotemYouTubePluginClass;
-
-GType totem_youtube_plugin_get_type (void) G_GNUC_CONST;
-
/* GtkBuilder callbacks */
void notebook_switch_page_cb (GtkNotebook *notebook, gpointer *page, guint page_num, TotemYouTubePlugin *self);
void search_button_clicked_cb (GtkButton *button, TotemYouTubePlugin *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]