[gedit] plugins-engine: use G_DECLARE_* macros
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] plugins-engine: use G_DECLARE_* macros
- Date: Sun, 31 May 2015 14:17:19 +0000 (UTC)
commit 6145612572faaaf9f1c260f1767a0b6f0b4fd66b
Author: Paolo Borelli <pborelli gnome org>
Date: Sun May 24 15:24:58 2015 +0200
plugins-engine: use G_DECLARE_* macros
This requires libpeas 1.14.1
configure.ac | 2 +-
gedit/gedit-plugins-engine.c | 20 ++++++++------------
gedit/gedit-plugins-engine.h | 28 +++-------------------------
3 files changed, 12 insertions(+), 38 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7d2600c..cd2f0cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@ AC_SUBST(GEDIT_API_VERSION)
GLIB_REQUIRED=2.40.0
GTK_REQUIRED=3.16
GTKSOURCEVIEW_REQUIRED=3.17.2
-LIBPEAS_REQUIRED=1.7.0
+LIBPEAS_REQUIRED=1.14.1
LIBXML_REQUIRED=2.5.0
ENCHANT_REQUIRED=1.2.0
ISO_CODES_REQUIRED=0.35
diff --git a/gedit/gedit-plugins-engine.c b/gedit/gedit-plugins-engine.c
index 725cb3b..d3e9dbb 100644
--- a/gedit/gedit-plugins-engine.c
+++ b/gedit/gedit-plugins-engine.c
@@ -26,24 +26,22 @@
#include "gedit-plugins-engine.h"
#include <string.h>
-
#include <glib/gi18n.h>
#include <girepository.h>
-
#include "gedit-debug.h"
-#include "gedit-app.h"
#include "gedit-dirs.h"
#include "gedit-settings.h"
-#include "gedit-utils.h"
-struct _GeditPluginsEnginePrivate
+struct _GeditPluginsEngine
{
+ PeasEngine parent_instance;
+
GSettings *plugin_settings;
};
-G_DEFINE_TYPE_WITH_PRIVATE (GeditPluginsEngine, gedit_plugins_engine, PEAS_TYPE_ENGINE)
+G_DEFINE_TYPE (GeditPluginsEngine, gedit_plugins_engine, PEAS_TYPE_ENGINE)
-GeditPluginsEngine *default_engine = NULL;
+static GeditPluginsEngine *default_engine = NULL;
static void
gedit_plugins_engine_init (GeditPluginsEngine *engine)
@@ -53,11 +51,9 @@ gedit_plugins_engine_init (GeditPluginsEngine *engine)
gedit_debug (DEBUG_PLUGINS);
- engine->priv = gedit_plugins_engine_get_instance_private (engine);
-
peas_engine_enable_loader (PEAS_ENGINE (engine), "python3");
- engine->priv->plugin_settings = g_settings_new ("org.gnome.gedit.plugins");
+ engine->plugin_settings = g_settings_new ("org.gnome.gedit.plugins");
/* Require gedit's typelib. */
typelib_dir = g_build_filename (gedit_dirs_get_gedit_lib_dir (),
@@ -99,7 +95,7 @@ gedit_plugins_engine_init (GeditPluginsEngine *engine)
gedit_dirs_get_gedit_plugins_dir (),
gedit_dirs_get_gedit_plugins_data_dir ());
- g_settings_bind (engine->priv->plugin_settings,
+ g_settings_bind (engine->plugin_settings,
GEDIT_SETTINGS_ACTIVE_PLUGINS,
engine,
"loaded-plugins",
@@ -111,7 +107,7 @@ gedit_plugins_engine_dispose (GObject *object)
{
GeditPluginsEngine *engine = GEDIT_PLUGINS_ENGINE (object);
- g_clear_object (&engine->priv->plugin_settings);
+ g_clear_object (&engine->plugin_settings);
G_OBJECT_CLASS (gedit_plugins_engine_parent_class)->dispose (object);
}
diff --git a/gedit/gedit-plugins-engine.h b/gedit/gedit-plugins-engine.h
index 5afda5e..5c18fc3 100644
--- a/gedit/gedit-plugins-engine.h
+++ b/gedit/gedit-plugins-engine.h
@@ -23,34 +23,12 @@
#define __GEDIT_PLUGINS_ENGINE_H__
#include <glib.h>
-#include <libpeas/peas-engine.h>
+#include <libpeas/peas.h>
G_BEGIN_DECLS
-#define GEDIT_TYPE_PLUGINS_ENGINE (gedit_plugins_engine_get_type ())
-#define GEDIT_PLUGINS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PLUGINS_ENGINE,
GeditPluginsEngine))
-#define GEDIT_PLUGINS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_PLUGINS_ENGINE,
GeditPluginsEngineClass))
-#define GEDIT_IS_PLUGINS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_PLUGINS_ENGINE))
-#define GEDIT_IS_PLUGINS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PLUGINS_ENGINE))
-#define GEDIT_PLUGINS_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_PLUGINS_ENGINE,
GeditPluginsEngineClass))
-
-typedef struct _GeditPluginsEngine GeditPluginsEngine;
-typedef struct _GeditPluginsEnginePrivate GeditPluginsEnginePrivate;
-
-struct _GeditPluginsEngine
-{
- PeasEngine parent;
- GeditPluginsEnginePrivate *priv;
-};
-
-typedef struct _GeditPluginsEngineClass GeditPluginsEngineClass;
-
-struct _GeditPluginsEngineClass
-{
- PeasEngineClass parent_class;
-};
-
-GType gedit_plugins_engine_get_type (void) G_GNUC_CONST;
+#define GEDIT_TYPE_PLUGINS_ENGINE (gedit_plugins_engine_get_type ())
+G_DECLARE_FINAL_TYPE(GeditPluginsEngine, gedit_plugins_engine, GEDIT, PLUGINS_ENGINE, PeasEngine)
GeditPluginsEngine *gedit_plugins_engine_get_default (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]