summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/helpers.h
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 /plugins/pychrysalide/helpers.h
parentc27f884ec1d18d9cff0d19d6ba8de1dd54d991c4 (diff)
Refactor Makefiles to exclude GTK on demand.
Diffstat (limited to 'plugins/pychrysalide/helpers.h')
-rw-r--r--plugins/pychrysalide/helpers.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/plugins/pychrysalide/helpers.h b/plugins/pychrysalide/helpers.h
index 52a9370..6b2bddf 100644
--- a/plugins/pychrysalide/helpers.h
+++ b/plugins/pychrysalide/helpers.h
@@ -29,7 +29,9 @@
#include <assert.h>
#include <glib-object.h>
#include <stdbool.h>
-#include <gdk/gdk.h>
+#ifdef HAVE_GTK_SUPPORT
+# include <gdk/gdk.h>
+#endif
@@ -236,12 +238,36 @@ int convert_to_gtype(PyObject *, void *);
/* Tente de convertir en instance GObject. */
int convert_to_gobject(PyObject *, void *);
+#ifdef HAVE_GTK_SUPPORT
+
/* Tente de convertir en instance de composant GTK. */
int convert_to_gtk_widget(PyObject *, void *);
/* Tente de convertir en instance de conteneur GTK. */
int convert_to_gtk_container(PyObject *, void *);
+#endif
+
+
+#if !defined(HAVE_GTK_SUPPORT) && !defined(HOMEMADE_RGBA)
+
+# define HOMEMADE_RGBA
+
+/**
+ * Copie depuis /usr/include/gtk-3.0/gdk/gdkrgba.h
+ */
+typedef struct _GdkRGBA
+{
+ gdouble red;
+ gdouble green;
+ gdouble blue;
+ gdouble alpha;
+
+} GdkRGBA;
+
+#endif
+
+
/* Construit un objet Python pour une couleur RGBA. */
PyObject *create_gdk_rgba(const GdkRGBA *);