[gtranslator/gtk3] Port alternate lang plugin to libpeas.



commit 8e7de848d93598b668ef9de20588f41b177dedce
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Nov 6 11:58:57 2010 +0100

    Port alternate lang plugin to libpeas.

 plugins/alternate-language/Makefile.am             |    7 +-
 .../gtr-alternate-language-panel.c                 |   15 +-
 .../gtr-alternate-language-panel.h                 |   31 +--
 .../gtr-alternate-language-plugin.c                |  215 +++++++++++++-------
 .../gtr-alternate-language-plugin.h                |   49 ++---
 ...in => gtr-alternate-language.plugin.desktop.in} |    6 +-
 6 files changed, 184 insertions(+), 139 deletions(-)
---
diff --git a/plugins/alternate-language/Makefile.am b/plugins/alternate-language/Makefile.am
index be890a7..4f97f38 100644
--- a/plugins/alternate-language/Makefile.am
+++ b/plugins/alternate-language/Makefile.am
@@ -4,7 +4,6 @@ plugindir = $(libdir)/gtranslator/plugins
 INCLUDES = \
 	-I$(top_srcdir) 				\
 	-I$(top_srcdir)/src				\
-	-I$(top_srcdir)/src/plugin-system		\
 	-I$(top_srcdir)/src/dialogs			\
 	$(GTRANSLATOR_CFLAGS) 				\
 	$(WARN_CFLAGS)					\
@@ -27,11 +26,11 @@ libalternatelang_la_LDFLAGS = \
 
 # Plugin Info
 
-plugin_in_files = gtr-alternate-language.gtranslator-plugin.desktop.in
+plugin_in_files = gtr-alternate-language.plugin.desktop.in
 
-%.gtranslator.plugin: %.gtranslator-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
+%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
 
-plugin_DATA = $(plugin_in_files:.gtranslator-plugin.desktop.in=.gtranslator.plugin)
+plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin)
 
 EXTRA_DIST = $(plugin_in_files)
 
diff --git a/plugins/alternate-language/gtr-alternate-language-panel.c b/plugins/alternate-language/gtr-alternate-language-panel.c
index 602a4ae..30ab5d3 100644
--- a/plugins/alternate-language/gtr-alternate-language-panel.c
+++ b/plugins/alternate-language/gtr-alternate-language-panel.c
@@ -22,7 +22,6 @@
 #include "gtr-alternate-language-panel.h"
 #include "gtr-file-dialogs.h"
 #include "gtr-msg.h"
-#include "gtr-plugin.h"
 #include "gtr-po.h"
 #include "gtr-tab.h"
 #include "gtr-view.h"
@@ -43,8 +42,7 @@
                                                       GTR_TYPE_ALTERNATE_LANG_PANEL, \
                                                       GtrAlternateLangPanelPrivate))
 
-GTR_PLUGIN_DEFINE_TYPE (GtrAlternateLangPanel,
-                        gtr_alternate_lang_panel, GTK_TYPE_VBOX)
+G_DEFINE_DYNAMIC_TYPE (GtrAlternateLangPanel, gtr_alternate_lang_panel, GTK_TYPE_VBOX)
 
 struct _GtrAlternateLangPanelPrivate
 {
@@ -413,6 +411,11 @@ gtr_alternate_lang_panel_class_init (GtrAlternateLangPanelClass * klass)
   object_class->dispose = gtr_alternate_lang_panel_dispose;
 }
 
+static void
+gtr_alternate_lang_panel_class_finalize (GtrAlternateLangPanelClass *klass)
+{
+}
+
 /***************************** Public funcs ***********************************/
 
 GtkWidget *
@@ -425,3 +428,9 @@ gtr_alternate_lang_panel_new (GtkWidget * tab)
 
   return GTK_WIDGET (panel);
 }
+
+void
+_gtr_alternate_lang_panel_register_type (GTypeModule *type_module)
+{
+  gtr_alternate_lang_panel_register_type (type_module);
+}
diff --git a/plugins/alternate-language/gtr-alternate-language-panel.h b/plugins/alternate-language/gtr-alternate-language-panel.h
index f185c86..561c101 100644
--- a/plugins/alternate-language/gtr-alternate-language-panel.h
+++ b/plugins/alternate-language/gtr-alternate-language-panel.h
@@ -23,22 +23,17 @@
 #include <gtk/gtk.h>
 
 G_BEGIN_DECLS
-/*
- * Type checking and casting macros
- */
+
 #define GTR_TYPE_ALTERNATE_LANG_PANEL		(gtr_alternate_lang_panel_get_type ())
 #define GTR_ALTERNATE_LANG_PANEL(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), GTR_TYPE_ALTERNATE_LANG_PANEL, GtrAlternateLangPanel))
 #define GTR_ALTERNATE_LANG_PANEL_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), GTR_TYPE_ALTERNATE_LANG_PANEL, GtrAlternateLangPanelClass))
 #define GTR_IS_ALTERNATE_LANG_PANEL(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), GTR_TYPE_ALTERNATE_LANG_PANEL))
 #define GTR_IS_ALTERNATE_LANG_PANEL_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), GTR_TYPE_ALTERNATE_LANG_PANEL))
 #define GTR_ALTERNATE_LANG_PANEL_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), GTR_TYPE_ALTERNATE_LANG_PANEL, GtrAlternateLangPanelClass))
-/* Private structure type */
-typedef struct _GtrAlternateLangPanelPrivate GtrAlternateLangPanelPrivate;
 
-/*
- * Main object structure
- */
-typedef struct _GtrAlternateLangPanel GtrAlternateLangPanel;
+typedef struct _GtrAlternateLangPanel        GtrAlternateLangPanel;
+typedef struct _GtrAlternateLangPanelPrivate GtrAlternateLangPanelPrivate;
+typedef struct _GtrAlternateLangPanelClass   GtrAlternateLangPanelClass;
 
 struct _GtrAlternateLangPanel
 {
@@ -48,24 +43,16 @@ struct _GtrAlternateLangPanel
   GtrAlternateLangPanelPrivate *priv;
 };
 
-/*
- * Class definition
- */
-typedef struct _GtrAlternateLangPanelClass GtrAlternateLangPanelClass;
-
 struct _GtrAlternateLangPanelClass
 {
   GtkVBoxClass parent_class;
 };
 
-/*
- * Public methods
- */
-GType
-gtr_alternate_lang_panel_get_type (void)
-  G_GNUC_CONST;
-     GType gtr_alternate_lang_panel_register_type (GTypeModule * module);
-     GtkWidget *gtr_alternate_lang_panel_new (GtkWidget * tab);
+GType gtr_alternate_lang_panel_get_type (void) G_GNUC_CONST;
+
+GtkWidget *gtr_alternate_lang_panel_new (GtkWidget *tab);
+
+void _gtr_alternate_lang_panel_register_type (GTypeModule *type_module);
 
 G_END_DECLS
 #endif /* __ALTERNATE_LANG_PANEL_H__ */
diff --git a/plugins/alternate-language/gtr-alternate-language-plugin.c b/plugins/alternate-language/gtr-alternate-language-plugin.c
index 924269b..b3ec458 100644
--- a/plugins/alternate-language/gtr-alternate-language-plugin.c
+++ b/plugins/alternate-language/gtr-alternate-language-plugin.c
@@ -24,22 +24,38 @@
 #include "gtr-alternate-language-panel.h"
 #include "gtr-notebook.h"
 #include "gtr-window.h"
+#include "gtr-window-activatable.h"
 
-#include <glib/gi18n-lib.h>
+#include <glib/gi18n.h>
 
-#define WINDOW_DATA_KEY	"GtrAlternateLangPluginWindowData"
 #define TAB_DATA_KEY    "GtrAlternateLangPluginTabData"
 #define MENU_PATH "/MainMenu/ViewMenu/ViewOps_2"
 
-#define GTR_MESSAGE_TABLE_GET_PRIVATE(object) \
-				(G_TYPE_INSTANCE_GET_PRIVATE ((object),	\
-				GTR_TYPE_MESSAGE_TABLE,		\
-				GtrAlternateLangPluginPrivate))
+struct _GtrAlternateLangPluginPrivate
+{
+  GtrWindow *window;
 
-GTR_PLUGIN_REGISTER_TYPE_WITH_CODE (GtrAlternateLangPlugin,
-                                    gtr_alternate_lang_plugin,
-                                    gtr_alternate_lang_panel_register_type
-                                    (module);)
+  GtkActionGroup *action_group;
+  guint ui_id;
+};
+
+enum
+{
+  PROP_0,
+  PROP_WINDOW
+};
+
+static void gtr_window_activatable_iface_init (GtrWindowActivatableInterface *iface);
+
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (GtrAlternateLangPlugin,
+                                gtr_alternate_lang_plugin,
+                                PEAS_TYPE_EXTENSION_BASE,
+                                0,
+                                G_IMPLEMENT_INTERFACE_DYNAMIC (GTR_TYPE_WINDOW_ACTIVATABLE,
+                                                               gtr_window_activatable_iface_init) \
+                                                                                                  \
+                                _gtr_alternate_lang_panel_register_type (type_module);            \
+)
 
 static void
 on_alternate_lang_activated (GtkAction *action,
@@ -60,43 +76,85 @@ static const GtkActionEntry action_entries[] = {
    G_CALLBACK (on_alternate_lang_activated)},
 };
 
-typedef struct
+static void
+gtr_alternate_lang_plugin_init (GtrAlternateLangPlugin *plugin)
 {
-  GtkActionGroup *action_group;
-  guint ui_id;
-} WindowData;
+  plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin,
+                                              GTR_TYPE_ALTERNATE_LANG_PLUGIN,
+                                              GtrAlternateLangPluginPrivate);
+}
 
 static void
-free_window_data (WindowData * data)
+gtr_alternate_lang_plugin_dispose (GObject *object)
 {
-  g_return_if_fail (data != NULL);
+  GtrAlternateLangPluginPrivate *priv = GTR_ALTERNATE_LANG_PLUGIN (object)->priv;
 
-  g_slice_free (WindowData, data);
+  if (priv->window != NULL)
+    {
+      g_object_unref (priv->window);
+      priv->window = NULL;
+    }
+
+  if (priv->action_group != NULL)
+    {
+      g_object_unref (priv->action_group);
+      priv->action_group = NULL;
+    }
+
+  G_OBJECT_CLASS (gtr_alternate_lang_plugin_parent_class)->dispose (object);
 }
 
 static void
-update_ui_real (GtrWindow * window, WindowData * data)
+gtr_alternate_lang_plugin_set_property (GObject      *object,
+                                        guint         prop_id,
+                                        const GValue *value,
+                                        GParamSpec   *pspec)
 {
-  GtrTab *tab;
-  GtkAction *action;
+  GtrAlternateLangPluginPrivate *priv = GTR_ALTERNATE_LANG_PLUGIN (object)->priv;
 
-  tab = gtr_window_get_active_tab (window);
+  switch (prop_id)
+    {
+      case PROP_WINDOW:
+        priv->window = GTR_WINDOW (g_value_dup_object (value));
+        break;
 
-  action = gtk_action_group_get_action (data->action_group, "AlternateLang");
-  gtk_action_set_sensitive (action, (tab != NULL));
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+        break;
+    }
 }
 
 static void
-gtr_alternate_lang_plugin_init (GtrAlternateLangPlugin * message_table)
+gtr_alternate_lang_plugin_get_property (GObject    *object,
+                                        guint       prop_id,
+                                        GValue     *value,
+                                        GParamSpec *pspec)
 {
+  GtrAlternateLangPluginPrivate *priv = GTR_ALTERNATE_LANG_PLUGIN (object)->priv;
+
+  switch (prop_id)
+    {
+      case PROP_WINDOW:
+        g_value_set_object (value, priv->window);
+        break;
+
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+        break;
+    }
 }
 
 static void
-gtr_alternate_lang_plugin_finalize (GObject * object)
+update_ui (GtrAlternateLangPlugin *plugin)
 {
-  G_OBJECT_CLASS (gtr_alternate_lang_plugin_parent_class)->finalize (object);
-}
+  GtrTab *tab;
+  GtkAction *action;
 
+  tab = gtr_window_get_active_tab (plugin->priv->window);
+
+  action = gtk_action_group_get_action (plugin->priv->action_group, "AlternateLang");
+  gtk_action_set_sensitive (action, (tab != NULL));
+}
 
 static void
 create_alternate_lang_plugin_panel (GtkNotebook * notebook,
@@ -121,66 +179,61 @@ create_alternate_lang_plugin_panel (GtkNotebook * notebook,
 }
 
 static void
-impl_activate (GtrPlugin * plugin, GtrWindow * window)
+gtr_alternate_lang_plugin_activate (GtrWindowActivatable *activatable)
 {
+  GtrAlternateLangPluginPrivate *priv = GTR_ALTERNATE_LANG_PLUGIN (activatable)->priv;
   GtrNotebook *notebook;
-  GList *tabs = NULL;
   GtkUIManager *manager;
-  WindowData *data;
-
-  data = g_slice_new (WindowData);
+  GList *tabs = NULL;
 
-  manager = gtr_window_get_ui_manager (window);
+  manager = gtr_window_get_ui_manager (priv->window);
 
-  data->action_group = gtk_action_group_new ("GtrAlternateLangPluginActions");
-  gtk_action_group_set_translation_domain (data->action_group,
+  priv->action_group = gtk_action_group_new ("GtrAlternateLangPluginActions");
+  gtk_action_group_set_translation_domain (priv->action_group,
                                            GETTEXT_PACKAGE);
-  gtk_action_group_add_actions (data->action_group, action_entries,
-                                G_N_ELEMENTS (action_entries), window);
-
-  gtk_ui_manager_insert_action_group (manager, data->action_group, -1);
+  gtk_action_group_add_actions (priv->action_group, action_entries,
+                                G_N_ELEMENTS (action_entries), priv->window);
 
-  data->ui_id = gtk_ui_manager_new_merge_id (manager);
+  gtk_ui_manager_insert_action_group (manager, priv->action_group, -1);
 
-  g_object_set_data_full (G_OBJECT (window),
-                          WINDOW_DATA_KEY,
-                          data, (GDestroyNotify) free_window_data);
+  priv->ui_id = gtk_ui_manager_new_merge_id (manager);
 
   gtk_ui_manager_add_ui (manager,
-                         data->ui_id,
+                         priv->ui_id,
                          MENU_PATH,
                          "AlternateLang",
                          "AlternateLang", GTK_UI_MANAGER_MENUITEM, FALSE);
 
-  notebook = gtr_window_get_notebook (window);
+  notebook = gtr_window_get_notebook (priv->window);
 
   g_signal_connect (GTK_NOTEBOOK (notebook),
                     "page-added",
-                    G_CALLBACK (create_alternate_lang_plugin_panel), window);
+                    G_CALLBACK (create_alternate_lang_plugin_panel),
+                    priv->window);
 
-  tabs = gtr_window_get_all_tabs (window);
+  tabs = gtr_window_get_all_tabs (priv->window);
 
   if (tabs == NULL)
     return;
   do
     {
       create_alternate_lang_plugin_panel (GTK_NOTEBOOK (notebook),
-                                          tabs->data, 0, window);
+                                          tabs->data, 0, priv->window);
     }
   while ((tabs = g_list_next (tabs)));
 }
 
 static void
-impl_deactivate (GtrPlugin * plugin, GtrWindow * window)
+gtr_alternate_lang_plugin_deactivate (GtrWindowActivatable *activatable)
 {
+  GtrAlternateLangPluginPrivate *priv = GTR_ALTERNATE_LANG_PLUGIN (activatable)->priv;
   GtrNotebook *notebook;
   GtkWidget *alternatelang;
   GList *tabs;
   GtkUIManager *manager;
-  WindowData *data;
 
-  tabs = gtr_window_get_all_tabs (window);
-  notebook = gtr_window_get_notebook (window);
+  tabs = gtr_window_get_all_tabs (priv->window);
+  notebook = gtr_window_get_notebook (priv->window);
 
   if (tabs != NULL)
     {
@@ -192,49 +245,61 @@ impl_deactivate (GtrPlugin * plugin, GtrWindow * window)
                                                     (tabs->data),
                                                     alternatelang);
 
-          g_object_set_data (G_OBJECT (tabs->data), WINDOW_DATA_KEY, NULL);
+          g_object_set_data (G_OBJECT (tabs->data), TAB_DATA_KEY, NULL);
         }
       while ((tabs = g_list_next (tabs)));
     }
 
   g_signal_handlers_disconnect_by_func (notebook,
                                         create_alternate_lang_plugin_panel,
-                                        window);
+                                        priv->window);
 
   /* Remove menuitem */
-  manager = gtr_window_get_ui_manager (window);
+  manager = gtr_window_get_ui_manager (priv->window);
 
-  data =
-    (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
-  g_return_if_fail (data != NULL);
-
-  gtk_ui_manager_remove_ui (manager, data->ui_id);
-  gtk_ui_manager_remove_action_group (manager, data->action_group);
+  gtk_ui_manager_remove_ui (manager, priv->ui_id);
+  gtk_ui_manager_remove_action_group (manager, priv->action_group);
+}
 
-  g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, NULL);
+static void
+gtr_alternate_lang_plugin_update_state (GtrWindowActivatable *activatable)
+{
+  update_ui (GTR_ALTERNATE_LANG_PLUGIN (activatable));
 }
 
 static void
-impl_update_ui (GtrPlugin * plugin, GtrWindow * window)
+gtr_alternate_lang_plugin_class_init (GtrAlternateLangPluginClass * klass)
 {
-  WindowData *data;
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->dispose = gtr_alternate_lang_plugin_dispose;
+  object_class->set_property = gtr_alternate_lang_plugin_set_property;
+  object_class->get_property = gtr_alternate_lang_plugin_get_property;
 
-  data =
-    (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
-  g_return_if_fail (data != NULL);
+  g_object_class_override_property (object_class, PROP_WINDOW, "window");
 
-  update_ui_real (window, data);
+  g_type_class_add_private (klass, sizeof (GtrAlternateLangPluginPrivate));
 }
 
 static void
-  gtr_alternate_lang_plugin_class_init (GtrAlternateLangPluginClass * klass)
+gtr_alternate_lang_plugin_class_finalize (GtrAlternateLangPluginClass *klass)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  GtrPluginClass *plugin_class = GTR_PLUGIN_CLASS (klass);
+}
+
+static void
+gtr_window_activatable_iface_init (GtrWindowActivatableInterface *iface)
+{
+  iface->activate = gtr_alternate_lang_plugin_activate;
+  iface->deactivate = gtr_alternate_lang_plugin_deactivate;
+  iface->update_state = gtr_alternate_lang_plugin_update_state;
+}
 
-  object_class->finalize = gtr_alternate_lang_plugin_finalize;
+G_MODULE_EXPORT void
+peas_register_types (PeasObjectModule *module)
+{
+  gtr_alternate_lang_plugin_register_type (G_TYPE_MODULE (module));
 
-  plugin_class->activate = impl_activate;
-  plugin_class->deactivate = impl_deactivate;
-  plugin_class->update_ui = impl_update_ui;
+  peas_object_module_register_extension_type (module,
+                                              GTR_TYPE_WINDOW_ACTIVATABLE,
+                                              GTR_TYPE_ALTERNATE_LANG_PLUGIN);
 }
diff --git a/plugins/alternate-language/gtr-alternate-language-plugin.h b/plugins/alternate-language/gtr-alternate-language-plugin.h
index 6da6310..446a8fb 100644
--- a/plugins/alternate-language/gtr-alternate-language-plugin.h
+++ b/plugins/alternate-language/gtr-alternate-language-plugin.h
@@ -13,8 +13,6 @@
  * 
  *     You should have received a copy of the GNU General Public License
  *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- *     Based on Gedit alternate_lang plugin
  */
 
 #ifndef __GTR_ALTERNATE_LANG_PLUGIN_H__
@@ -22,51 +20,38 @@
 
 #include <glib.h>
 #include <glib-object.h>
-
-#include "gtr-plugin.h"
+#include <libpeas/peas-extension-base.h>
+#include <libpeas/peas-object-module.h>
 
 G_BEGIN_DECLS
-/*
- * Type checking and casting macros
- */
-#define GTR_TYPE_ALTERNATE_LANG_PLUGIN		(gtr_alternate_lang_get_type ())
-#define GTR_ALTERNATE_LANG_PLUGIN(o)			(G_TYPE_CHECK_INSTANCE_CAST ((o), GTR_TYPE_MESSAGEALTERNATE_LANG_PLUGIN, GtrAlternateLangPlugin))
-#define GTR_ALTERNATE_LANG_PLUGIN_CLASS(k)		(G_TYPE_CHECK_CLASS_CAST((k), GTR_TYPE_ALTERNATE_LANG_PLUGIN, GtrAlternateLangPluginClass))
+
+#define GTR_TYPE_ALTERNATE_LANG_PLUGIN		(gtr_alternate_lang_plugin_get_type ())
+#define GTR_ALTERNATE_LANG_PLUGIN(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), GTR_TYPE_ALTERNATE_LANG_PLUGIN, GtrAlternateLangPlugin))
+#define GTR_ALTERNATE_LANG_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), GTR_TYPE_ALTERNATE_LANG_PLUGIN, GtrAlternateLangPluginClass))
 #define GTR_IS_ALTERNATE_LANG_PLUGIN(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), GTR_TYPE_ALTERNATE_LANG_PLUGIN))
-#define GTR_IS_ALTERNATE_LANG_PLUGIN_CLASS(k)		(G_TYPE_CHECK_CLASS_TYPE ((k), GTR_TYPE_ALTERNATE_LANG_PLUGIN))
+#define GTR_IS_ALTERNATE_LANG_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), GTR_TYPE_ALTERNATE_LANG_PLUGIN))
 #define GTR_ALTERNATE_LANG_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), GTR_TYPE_ALTERNATE_LANG_PLUGIN_PLUGIN, GtrAlternateLangPluginClass))
-/* Private structure type */
-typedef struct _GtrAlternateLangPluginPrivate GtrAlternateLangPluginPrivate;
 
-/*
- * Main object structure
- */
-typedef struct _GtrAlternateLangPlugin GtrAlternateLangPlugin;
+typedef struct _GtrAlternateLangPlugin        GtrAlternateLangPlugin;
+typedef struct _GtrAlternateLangPluginPrivate GtrAlternateLangPluginPrivate;
+typedef struct _GtrAlternateLangPluginClass   GtrAlternateLangPluginClass;
 
 struct _GtrAlternateLangPlugin
 {
-  GtrPlugin parent_instance;
-};
+  PeasExtensionBase parent_instance;
 
-/*
- * Class definition
- */
-typedef struct _GtrAlternateLangPluginClass GtrAlternateLangPluginClass;
+  /*< private >*/
+  GtrAlternateLangPluginPrivate *priv;
+};
 
 struct _GtrAlternateLangPluginClass
 {
-  GtrPluginClass parent_class;
+  PeasExtensionBaseClass parent_class;
 };
 
-/*
- * Public methods
- */
-GType
-gtr_alternate_lang_plugin_get_type (void)
-  G_GNUC_CONST;
+GType gtr_alternate_lang_plugin_get_type (void) G_GNUC_CONST;
 
-/* All the plugins must implement this function */
-     G_MODULE_EXPORT GType register_gtr_plugin (GTypeModule * module);
+G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
 
 G_END_DECLS
 #endif /* __GTR_ALTERNATE_LANG_PLUGIN_H__ */
diff --git a/plugins/alternate-language/gtr-alternate-language.gtranslator-plugin.desktop.in b/plugins/alternate-language/gtr-alternate-language.plugin.desktop.in
similarity index 56%
rename from plugins/alternate-language/gtr-alternate-language.gtranslator-plugin.desktop.in
rename to plugins/alternate-language/gtr-alternate-language.plugin.desktop.in
index 7b279ee..07425fa 100644
--- a/plugins/alternate-language/gtr-alternate-language.gtranslator-plugin.desktop.in
+++ b/plugins/alternate-language/gtr-alternate-language.plugin.desktop.in
@@ -1,8 +1,8 @@
-[Gtranslator Plugin]
+[Plugin]
 Module=alternatelang
 IAge=2
 _Name=Alternate Language
 _Description=Load an alternate language.
-Authors=Ignacio Casal Quinteiro  <nacho resa gmail com>
+Authors=Ignacio Casal Quinteiro <icq gnome org>
 Copyright=Copyright @ 2008 Ignacio Casal Quinteiro
-Website=http://gtranslator.sf.net
+Website=http://projects.gnome.org/gtranslator/



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