docinfo-plugin: Port to libpeas

Adapted from:
9ca3dda491
This commit is contained in:
JosephMcc 2016-12-26 13:13:01 -08:00
parent 7220312ac6
commit fdc2da63a9
2 changed files with 460 additions and 422 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* /*
* xed-docinfo-plugin.h * xed-docinfo-plugin.h
* *
* Copyright (C) 2002-2005 Paolo Maggi * Copyright (C) 2002-2005 Paolo Maggi
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -25,50 +25,54 @@
#include <glib.h> #include <glib.h>
#include <glib-object.h> #include <glib-object.h>
#include <xed/xed-plugin.h> #include <libpeas/peas-extension-base.h>
#include <libpeas/peas-object-module.h>
G_BEGIN_DECLS G_BEGIN_DECLS
/* /*
* Type checking and casting macros * Type checking and casting macros
*/ */
#define XED_TYPE_DOCINFO_PLUGIN (xed_docinfo_plugin_get_type ()) #define XED_TYPE_DOCINFO_PLUGIN (xed_docinfo_plugin_get_type ())
#define XED_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPlugin)) #define XED_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPlugin))
#define XED_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPluginClass)) #define XED_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPluginClass))
#define XED_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_DOCINFO_PLUGIN)) #define XED_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_DOCINFO_PLUGIN))
#define XED_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_DOCINFO_PLUGIN)) #define XED_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_DOCINFO_PLUGIN))
#define XED_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPluginClass)) #define XED_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPluginClass))
/* Private structure type */ /* Private structure type */
typedef struct _XedDocInfoPluginPrivate XedDocInfoPluginPrivate; typedef struct _XedDocInfoPluginPrivate XedDocInfoPluginPrivate;
/* /*
* Main object structure * Main object structure
*/ */
typedef struct _XedDocInfoPlugin XedDocInfoPlugin; typedef struct _XedDocInfoPlugin XedDocInfoPlugin;
struct _XedDocInfoPlugin struct _XedDocInfoPlugin
{ {
XedPlugin parent_instance; PeasExtensionBase parent_instance;
/*< private >*/
XedDocInfoPluginPrivate *priv;
}; };
/* /*
* Class definition * Class definition
*/ */
typedef struct _XedDocInfoPluginClass XedDocInfoPluginClass; typedef struct _XedDocInfoPluginClass XedDocInfoPluginClass;
struct _XedDocInfoPluginClass struct _XedDocInfoPluginClass
{ {
XedPluginClass parent_class; PeasExtensionBaseClass parent_class;
}; };
/* /*
* Public methods * Public methods
*/ */
GType xed_docinfo_plugin_get_type (void) G_GNUC_CONST; GType xed_docinfo_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */ /* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module); G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
G_END_DECLS G_END_DECLS