Updated Finnish translation
[rhythmbox.git] / plugins / sample / rb-sample-plugin.c
blob78779755a546012995697c2aef1db898c0ccc3d2
1 /*
2 * rb-sample-plugin.h
3 *
4 * Copyright (C) 2002-2005 - Paolo Maggi
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
25 #include <string.h> /* For strlen */
26 #include <glib/gi18n-lib.h>
27 #include <gmodule.h>
28 #include <gtk/gtk.h>
29 #include <glib.h>
30 #include <glib-object.h>
32 #include "rb-plugin.h"
33 #include "rb-debug.h"
34 #include "rb-shell.h"
35 #include "rb-dialog.h"
38 #define RB_TYPE_SAMPLE_PLUGIN (rb_sample_plugin_get_type ())
39 #define RB_SAMPLE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_SAMPLE_PLUGIN, RBSamplePlugin))
40 #define RB_SAMPLE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_SAMPLE_PLUGIN, RBSamplePluginClass))
41 #define RB_IS_SAMPLE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_SAMPLE_PLUGIN))
42 #define RB_IS_SAMPLE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_SAMPLE_PLUGIN))
43 #define RB_SAMPLE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_SAMPLE_PLUGIN, RBSamplePluginClass))
45 typedef struct
47 gpointer dummy;
48 } RBSamplePluginPrivate;
50 typedef struct
52 RBPlugin parent;
53 RBSamplePluginPrivate *priv;
54 } RBSamplePlugin;
56 typedef struct
58 RBPluginClass parent_class;
59 } RBSamplePluginClass;
62 G_MODULE_EXPORT GType register_rb_plugin (GTypeModule *module);
63 GType rb_sample_plugin_get_type (void) G_GNUC_CONST;
67 static void rb_sample_plugin_init (RBSamplePlugin *plugin);
68 static void rb_sample_plugin_finalize (GObject *object);
69 static void impl_activate (RBPlugin *plugin, RBShell *shell);
70 static void impl_deactivate (RBPlugin *plugin, RBShell *shell);
72 RB_PLUGIN_REGISTER(RBSamplePlugin, rb_sample_plugin)
73 #define RB_SAMPLE_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), RB_TYPE_SAMPLE_PLUGIN, RBSamplePluginPrivate))
76 static void
77 rb_sample_plugin_class_init (RBSamplePluginClass *klass)
79 GObjectClass *object_class = G_OBJECT_CLASS (klass);
80 RBPluginClass *plugin_class = RB_PLUGIN_CLASS (klass);
82 object_class->finalize = rb_sample_plugin_finalize;
84 plugin_class->activate = impl_activate;
85 plugin_class->deactivate = impl_deactivate;
87 g_type_class_add_private (object_class, sizeof (RBSamplePluginPrivate));
90 static void
91 rb_sample_plugin_init (RBSamplePlugin *plugin)
93 plugin->priv = RB_SAMPLE_PLUGIN_GET_PRIVATE (plugin);
95 rb_debug ("RBSamplePlugin initialising");
98 static void
99 rb_sample_plugin_finalize (GObject *object)
102 RBSamplePlugin *plugin = RB_SAMPLE_PLUGIN (object);
104 rb_debug ("RBSamplePlugin finalising");
106 G_OBJECT_CLASS (rb_sample_plugin_parent_class)->finalize (object);
111 static void
112 impl_activate (RBPlugin *plugin,
113 RBShell *shell)
115 rb_error_dialog (NULL, _("Sample Plugin"), "Sample plugin activated, with shell %p", shell);
118 static void
119 impl_deactivate (RBPlugin *plugin,
120 RBShell *shell)
122 rb_error_dialog (NULL, _("Sample Plugin"), "Sample plugin deactivated");