summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/glibext
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/glibext
parentc27f884ec1d18d9cff0d19d6ba8de1dd54d991c4 (diff)
Refactor Makefiles to exclude GTK on demand.
Diffstat (limited to 'plugins/pychrysalide/glibext')
-rw-r--r--plugins/pychrysalide/glibext/Makefile.am39
-rw-r--r--plugins/pychrysalide/glibext/buffercache.c12
-rw-r--r--plugins/pychrysalide/glibext/constants.c10
-rw-r--r--plugins/pychrysalide/glibext/constants.h4
4 files changed, 45 insertions, 20 deletions
diff --git a/plugins/pychrysalide/glibext/Makefile.am b/plugins/pychrysalide/glibext/Makefile.am
index 5a9a539..ac41a86 100644
--- a/plugins/pychrysalide/glibext/Makefile.am
+++ b/plugins/pychrysalide/glibext/Makefile.am
@@ -1,30 +1,31 @@
noinst_LTLIBRARIES = libpychrysaglibext.la
-libpychrysaglibext_la_SOURCES = \
- constants.h constants.c \
- binarycursor.h binarycursor.c \
- binportion.h binportion.c \
- buffercache.h buffercache.c \
- bufferline.h bufferline.c \
- bufferview.h bufferview.c \
- configuration.h configuration.c \
- linecursor.h linecursor.c \
- linegen.h linegen.c \
- loadedpanel.h loadedpanel.c \
- module.h module.c \
- named.h named.c \
+libpychrysaglibext_la_SOURCES = \
+ constants.h constants.c \
+ binarycursor.h binarycursor.c \
+ binportion.h binportion.c \
+ buffercache.h buffercache.c \
+ bufferline.h bufferline.c \
+ configuration.h configuration.c \
+ linecursor.h linecursor.c \
+ linegen.h linegen.c \
+ module.h module.c \
singleton.h singleton.c
-libpychrysaglibext_la_LDFLAGS =
+if BUILD_GTK_SUPPORT
+libpychrysaglibext_la_SOURCES += \
+ bufferview.h bufferview.c \
+ loadedpanel.h loadedpanel.c \
+ named.h named.c
-devdir = $(includedir)/chrysalide/$(subdir)
+endif
-dev_HEADERS = $(libpychrysaglibext_la_SOURCES:%c=)
+libpychrysaglibext_la_CFLAGS = $(TOOLKIT_CFLAGS) $(LIBXML_CFLAGS) $(LIBPYTHON_INTERPRETER_CFLAGS) $(LIBPYGOBJECT_CFLAGS) \
+ -I$(top_srcdir)/src -DNO_IMPORT_PYGOBJECT
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBPYTHON_INTERPRETER_CFLAGS) $(LIBPYGOBJECT_CFLAGS) \
- -I$(top_srcdir)/src -DNO_IMPORT_PYGOBJECT
+devdir = $(includedir)/chrysalide/$(subdir)
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
+dev_HEADERS = $(libpychrysaglibext_la_SOURCES:%c=)
diff --git a/plugins/pychrysalide/glibext/buffercache.c b/plugins/pychrysalide/glibext/buffercache.c
index 0cf3342..6ed516a 100644
--- a/plugins/pychrysalide/glibext/buffercache.c
+++ b/plugins/pychrysalide/glibext/buffercache.c
@@ -88,9 +88,13 @@ static PyObject *py_buffer_cache_get_line_flags(PyObject *, PyObject *);
/* Retire une propriété particulière attachée à une ligne. */
static PyObject *py_buffer_cache_remove_line_flag(PyObject *, PyObject *);
+#ifdef HAVE_GTK_SUPPORT
+
/* Retrouve une ligne au sein d'un tampon avec un indice. */
static PyObject *py_buffer_cache_find_line_by_index(PyObject *, PyObject *);
+#endif
+
/* Avance autant que possible vers une ligne idéale. */
static PyObject *py_buffer_cache_look_for_flag(PyObject *, PyObject *);
@@ -825,6 +829,9 @@ static PyObject *py_buffer_cache_remove_line_flag(PyObject *self, PyObject *args
}
+#ifdef HAVE_GTK_SUPPORT
+
+
/******************************************************************************
* *
* Paramètres : self = classe représentant un tampon de code. *
@@ -883,6 +890,9 @@ static PyObject *py_buffer_cache_find_line_by_index(PyObject *self, PyObject *ar
}
+#endif
+
+
/******************************************************************************
* *
* Paramètres : self = classe représentant un tampon de code. *
@@ -1157,7 +1167,9 @@ PyTypeObject *get_python_buffer_cache_type(void)
BUFFER_CACHE_ADD_LINE_FLAG_METHOD,
BUFFER_CACHE_GET_LINE_FLAGS_METHOD,
BUFFER_CACHE_REMOVE_LINE_FLAG_METHOD,
+#ifdef HAVE_GTK_SUPPORT
BUFFER_CACHE_FIND_LINE_BY_INDEX_METHOD,
+#endif
BUFFER_CACHE_LOOK_FOR_FLAG_METHOD,
{ NULL }
};
diff --git a/plugins/pychrysalide/glibext/constants.c b/plugins/pychrysalide/glibext/constants.c
index 373d1bf..dc8d657 100644
--- a/plugins/pychrysalide/glibext/constants.c
+++ b/plugins/pychrysalide/glibext/constants.c
@@ -30,7 +30,9 @@
#include <glibext/configuration.h>
#include <glibext/linesegment.h>
#include <glibext/gbinportion.h>
-#include <glibext/gloadedpanel.h>
+#ifdef HAVE_GTK_SUPPORT
+# include <glibext/gloadedpanel.h>
+#endif
#include "../helpers.h"
@@ -471,6 +473,9 @@ int convert_to_rendering_tag_type(PyObject *arg, void *dst)
}
+#ifdef HAVE_GTK_SUPPORT
+
+
/******************************************************************************
* *
* Paramètres : type = type dont le dictionnaire est à compléter. *
@@ -566,3 +571,6 @@ int convert_to_scroll_position_tweak(PyObject *arg, void *dst)
return result;
}
+
+
+#endif
diff --git a/plugins/pychrysalide/glibext/constants.h b/plugins/pychrysalide/glibext/constants.h
index 342b7ad..0e2b442 100644
--- a/plugins/pychrysalide/glibext/constants.h
+++ b/plugins/pychrysalide/glibext/constants.h
@@ -55,12 +55,16 @@ bool define_line_segment_constants(PyTypeObject *);
/* Tente de convertir en constante RenderingTagType. */
int convert_to_rendering_tag_type(PyObject *, void *);
+#ifdef HAVE_GTK_SUPPORT
+
/* Définit les constantes relatives aux panneaux de chargement. */
bool define_loaded_panel_constants(PyTypeObject *);
/* Tente de convertir en constante ScrollPositionTweak. */
int convert_to_scroll_position_tweak(PyObject *, void *);
+#endif
+
#endif /* _PLUGINS_PYCHRYSALIDE_GLIBEXT_CONSTANTS_H */