summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2022-12-29 11:02:46 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2022-12-29 11:02:46 (GMT)
commit41db261acccf3494aa93b71a181cde9e8605a841 (patch)
tree07a00f88920a8e601268d415131630052ef85988 /src/plugins
parentc27f884ec1d18d9cff0d19d6ba8de1dd54d991c4 (diff)
Refactor Makefiles to exclude GTK on demand.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Makefile.am11
-rw-r--r--src/plugins/pglist.h4
-rw-r--r--src/plugins/plugin-int.h6
-rw-r--r--src/plugins/plugin.c12
-rw-r--r--src/plugins/plugin.h8
5 files changed, 29 insertions, 12 deletions
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index b4ac1d5..6cb8d34 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -11,18 +11,9 @@ libplugins_la_SOURCES = \
plugin.h plugin.c \
self.h
-libplugins_la_CFLAGS = $(AM_CFLAGS)
-
-libplugins_la_LDFLAGS =
+libplugins_la_CFLAGS = $(TOOLKIT_CFLAGS) $(LIBXML_CFLAGS)
devdir = $(includedir)/chrysalide/$(subdir:src/%=core/%)
dev_HEADERS = $(libplugins_la_SOURCES:%c=)
-
-
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
-
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-
-SUBDIRS =
diff --git a/src/plugins/pglist.h b/src/plugins/pglist.h
index e0aec3f..9cc6aee 100644
--- a/src/plugins/pglist.h
+++ b/src/plugins/pglist.h
@@ -27,7 +27,9 @@
#include <stdbool.h>
-#include <gtk/gtk.h>
+#ifdef HAVE_GTK_SUPPORT
+# include <gtk/gtk.h>
+#endif
#include "plugin-def.h"
diff --git a/src/plugins/plugin-int.h b/src/plugins/plugin-int.h
index 88e0fbb..db1cbb0 100644
--- a/src/plugins/plugin-int.h
+++ b/src/plugins/plugin-int.h
@@ -57,6 +57,8 @@ typedef void (* pg_handle_content_fc) (const GPluginModule *, PluginAction, GBin
/* Procède à une opération liée à un contenu chargé. */
typedef void (* pg_handle_loaded_fc) (const GPluginModule *, PluginAction, GLoadedContent *, wgroup_id_t, GtkStatusStack *);
+#ifdef HAVE_GTK_SUPPORT
+
/* Complète une liste de resources pour thème. */
typedef void (* pg_include_theme_fc) (const GPluginModule *, PluginAction, gboolean, char ***, size_t *);
@@ -66,6 +68,8 @@ typedef void (* pg_notify_panel_fc) (const GPluginModule *, PluginAction, GPanel
/* Rend compte d'un affichage ou d'un retrait de panneau. */
typedef void (* pg_notify_docking_fc) (const GPluginModule *, PluginAction, GPanelItem *, bool);
+#endif
+
/* Assure l'interprétation d'un format en différé. */
typedef bool (* pg_handle_format_analysis_fc) (const GPluginModule *, PluginAction, GKnownFormat *, wgroup_id_t, GtkStatusStack *);
@@ -115,9 +119,11 @@ struct _GPluginModuleClass
pg_get_modname_fc get_modname; /* Fourniture du nom brut */
+#ifdef HAVE_GTK_SUPPORT
pg_include_theme_fc include_theme; /* Extension d'un thème */
pg_notify_panel_fc notify_panel; /* Création de panneau */
pg_notify_docking_fc notify_docking; /* Affichage ou retrait */
+#endif
pg_handle_content_fc handle_content; /* Explorations ou résolutions */
pg_handle_loaded_fc handle_loaded; /* Traitement de contenu chargé*/
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index e563817..1ef90fb 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -669,8 +669,10 @@ static void g_plugin_module_init_gclass(GPluginModuleClass *class, GModule *modu
switch (action)
{
case PGA_GUI_THEME:
+#ifdef HAVE_GTK_SUPPORT
load_plugin_symbol(module, "chrysalide_plugin_include_theme",
&class->include_theme);
+#endif
break;
default:
@@ -686,13 +688,17 @@ static void g_plugin_module_init_gclass(GPluginModuleClass *class, GModule *modu
switch (action)
{
case PGA_PANEL_CREATION:
+#ifdef HAVE_GTK_SUPPORT
load_plugin_symbol(module, "chrysalide_plugin_on_panel_creation",
&class->notify_panel);
+#endif
break;
case PGA_PANEL_DOCKING:
+#ifdef HAVE_GTK_SUPPORT
load_plugin_symbol(module, "chrysalide_plugin_on_panel_docking",
&class->notify_docking);
+#endif
break;
default:
@@ -1423,6 +1429,9 @@ gpointer g_plugin_module_build_type_instance(GPluginModule *plugin, PluginAction
}
+#ifdef HAVE_GTK_SUPPORT
+
+
/******************************************************************************
* *
* Paramètres : plugin = greffon à manipuler. *
@@ -1501,6 +1510,9 @@ void g_plugin_module_notify_panel_docking(const GPluginModule *plugin, PluginAct
}
+#endif
+
+
/******************************************************************************
* *
* Paramètres : plugin = greffon à manipuler. *
diff --git a/src/plugins/plugin.h b/src/plugins/plugin.h
index ff456b3..aac5f0d 100644
--- a/src/plugins/plugin.h
+++ b/src/plugins/plugin.h
@@ -36,8 +36,10 @@
#include "../format/known.h"
#include "../format/preload.h"
#include "../glibext/configuration.h"
-#include "../gtkext/gtkstatusstack.h"
+#include "../glibext/notifier.h"
+#ifdef HAVE_GTK_SUPPORT
#include "../gui/panel.h"
+#endif
@@ -119,6 +121,8 @@ void g_plugin_module_notify_plugins_loaded(GPluginModule *, PluginAction, void *
/* Crée une instance à partir d'un type dynamique externe. */
gpointer g_plugin_module_build_type_instance(GPluginModule *, PluginAction, GType);
+#ifdef HAVE_GTK_SUPPORT
+
/* Complète une liste de resources pour thème. */
void g_plugin_module_include_theme(const GPluginModule *, PluginAction, gboolean, char ***, size_t *);
@@ -128,6 +132,8 @@ void g_plugin_module_notify_panel_creation(const GPluginModule *, PluginAction,
/* Rend compte d'un affichage ou d'un retrait de panneau. */
void g_plugin_module_notify_panel_docking(const GPluginModule *, PluginAction, GPanelItem *, bool);
+#endif
+
/* Procède à une opération liée à un contenu binaire. */
void g_plugin_module_handle_binary_content(const GPluginModule *, PluginAction, GBinContent *, wgroup_id_t, GtkStatusStack *);