summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2018-09-30 17:22:28 +0000
committerEduard Braun <eduard.braun2@gmx.de>2018-10-01 22:50:12 +0000
commit1c1b7045b28d87b47b060bfb8e8ad9df34712785 (patch)
tree311f26c1ebb06c86785401ecf855cfed55792d34 /src
parentEnd fix bug bug:#1769679 #18; Crash when opening file with live path effect (diff)
downloadinkscape-1c1b7045b28d87b47b060bfb8e8ad9df34712785.tar.gz
inkscape-1c1b7045b28d87b47b060bfb8e8ad9df34712785.zip
Move GTKMM_CHECK_VERSION from config.h to it's own header
Avoids having to recompile most of the Inkscape codebase whenever gtkmm is updated.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/include/CMakeLists.txt5
-rw-r--r--src/include/gtkmm_version.h41
-rw-r--r--src/live_effects/lpe-perspective_path.cpp2
-rw-r--r--src/live_effects/parameter/message.cpp4
-rw-r--r--src/ui/dialog/document-properties.cpp14
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp2
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp2
-rw-r--r--src/ui/dialog/layers.cpp2
-rw-r--r--src/ui/dialog/new-from-template.cpp2
-rw-r--r--src/ui/dialog/objects.cpp2
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp35
-rw-r--r--src/ui/dialog/symbols.cpp35
-rw-r--r--src/ui/dialog/symbols.h5
-rw-r--r--src/ui/dialog/tags.cpp21
-rw-r--r--src/ui/monitor.cpp2
-rw-r--r--src/ui/tools/tool-base.cpp2
-rw-r--r--src/ui/widget/preferences-widget.cpp2
-rw-r--r--src/ui/widget/selected-style.cpp2
-rw-r--r--src/widgets/sp-attribute-widget.cpp2
-rw-r--r--src/widgets/toolbox.cpp2
21 files changed, 128 insertions, 57 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4f754586c..ac888bf2d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -260,6 +260,7 @@ add_subdirectory(debug)
add_subdirectory(display)
add_subdirectory(extension)
add_subdirectory(helper)
+add_subdirectory(include)
add_subdirectory(io)
add_subdirectory(live_effects)
add_subdirectory(object)
diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt
new file mode 100644
index 000000000..7a089b86c
--- /dev/null
+++ b/src/include/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(include_SRC
+ gtkmm_version.h
+)
+
+add_inkscape_source("${io_SRC}")
diff --git a/src/include/gtkmm_version.h b/src/include/gtkmm_version.h
new file mode 100644
index 000000000..a0078dfae
--- /dev/null
+++ b/src/include/gtkmm_version.h
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/** @file
+ * macro for checking gtkmm version
+ *//*
+ * Authors:
+ * Patrick Storz <eduard.braun2@gmx.de>
+ *
+ * Copyright (C) 2018 Authors
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+
+#ifndef SEEN_GTKMM_VERSION
+#define SEEN_GTKMM_VERSION
+
+#include <gtkmmconfig.h>
+
+#if !defined(GTKMM_MAJOR_VERSION) || !defined(GTKMM_MINOR_VERSION) || !defined(GTKMM_MICRO_VERSION)
+ #error "Missing defines for gtkmm version (GTKMM_MAJOR_VERSION / GTKMM_MINOR_VERSION / GTKMM_MICRO_VERSION)"
+#endif
+
+/**
+ * Check GtkMM version
+ *
+ * This is adapted from the upstream Gtk+ macro for use with GtkMM
+ *
+ * @major: major version (e.g. 1 for version 1.2.5)
+ * @minor: minor version (e.g. 2 for version 1.2.5)
+ * @micro: micro version (e.g. 5 for version 1.2.5)
+ *
+ * Returns %TRUE if the version of the GTK+ header files
+ * is the same as or newer than the passed-in version.
+ *
+ * Returns: %TRUE if GTK+ headers are new enough
+ */
+#define GTKMM_CHECK_VERSION(major,minor,micro) \
+ (GTKMM_MAJOR_VERSION > (major) || \
+ (GTKMM_MAJOR_VERSION == (major) && GTKMM_MINOR_VERSION > (minor)) || \
+ (GTKMM_MAJOR_VERSION == (major) && GTKMM_MINOR_VERSION == (minor) && \
+ GTKMM_MICRO_VERSION >= (micro)))
+
+#endif // SEEN_GTKMM_VERSION
diff --git a/src/live_effects/lpe-perspective_path.cpp b/src/live_effects/lpe-perspective_path.cpp
index 8699731f1..e2ab2f3b8 100644
--- a/src/live_effects/lpe-perspective_path.cpp
+++ b/src/live_effects/lpe-perspective_path.cpp
@@ -20,6 +20,8 @@
#include "knotholder.h"
#include <util/units.h>
+#include "include/gtkmm_version.h"
+
#include "object/persp3d.h"
#include "object/sp-defs.h"
diff --git a/src/live_effects/parameter/message.cpp b/src/live_effects/parameter/message.cpp
index afb5f339f..37fe7d145 100644
--- a/src/live_effects/parameter/message.cpp
+++ b/src/live_effects/parameter/message.cpp
@@ -4,10 +4,12 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <glibmm/i18n.h>
#include <gtkmm.h>
+
+#include "include/gtkmm_version.h"
#include "live_effects/parameter/message.h"
#include "live_effects/effect.h"
-#include <glibmm/i18n.h>
namespace Inkscape {
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 39993bc09..342fdbfa6 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -22,26 +22,24 @@
# include <config.h>
#endif
-#include "display/canvas-grid.h"
-#include "document-properties.h"
+#include "style.h"
#include "rdf.h"
#include "verbs.h"
-#include "helper/action.h"
+#include "display/canvas-grid.h"
+#include "document-properties.h"
+#include "helper/action.h"
+#include "helper/icon-loader.h"
+#include "include/gtkmm_version.h"
#include "io/sys.h"
-
#include "object/sp-root.h"
#include "object/sp-script.h"
-#include "style.h"
-
-#include "helper/icon-loader.h"
#include "ui/dialog/filedialog.h"
#include "ui/icon-names.h"
#include "ui/shape-editor.h"
#include "ui/tools-switch.h"
#include "ui/widget/entity-entry.h"
#include "ui/widget/notebook-page.h"
-
#include "xml/node-event-vector.h"
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 80bda9138..28325ab9e 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -51,6 +51,8 @@
#include "selection-chemistry.h"
#include "verbs.h"
+#include "include/gtkmm_version.h"
+
#include "object/filters/blend.h"
#include "object/filters/colormatrix.h"
#include "object/filters/componenttransfer.h"
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index bc300651b..84550dbf4 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -47,6 +47,8 @@
#include "extension/internal/gdkpixbuf-input.h"
+#include "include/gtkmm_version.h"
+
#include "io/resource.h"
#include "io/sys.h"
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp
index a749c322c..cb4dcb0bc 100644
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
@@ -32,6 +32,8 @@
#include "helper/action.h"
#include "helper/icon-loader.h"
+#include "include/gtkmm_version.h"
+
#include "object/sp-root.h"
#include "svg/css-ostringstream.h"
diff --git a/src/ui/dialog/new-from-template.cpp b/src/ui/dialog/new-from-template.cpp
index 7e0c5b526..f5fb62864 100644
--- a/src/ui/dialog/new-from-template.cpp
+++ b/src/ui/dialog/new-from-template.cpp
@@ -15,6 +15,8 @@
#include "new-from-template.h"
#include "file.h"
+#include "include/gtkmm_version.h"
+
namespace Inkscape {
namespace UI {
diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp
index 2bf3c0dec..2991e1cda 100644
--- a/src/ui/dialog/objects.cpp
+++ b/src/ui/dialog/objects.cpp
@@ -35,6 +35,8 @@
#include "helper/action.h"
#include "helper/icon-loader.h"
+#include "include/gtkmm_version.h"
+
#include "object/filters/blend.h"
#include "object/filters/gaussian-blur.h"
#include "object/sp-clippath.h"
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index 5c3732ff2..599a1f287 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -15,31 +15,32 @@
#include "config.h"
#endif
-#include "svg-fonts-dialog.h"
-#include "document-private.h"
-#include "document-undo.h"
-#include <gtkmm/notebook.h>
+#include <message-stack.h>
+#include <sstream>
+
#include <gtkmm/scale.h>
+#include <gtkmm/notebook.h>
#include <gtkmm/imagemenuitem.h>
-#include <message-stack.h>
-#include "selection.h"
-#include "svg/svg.h"
-#include "xml/repr.h"
-#include "desktop.h"
+#include <glibmm/stringutils.h>
+#include <glibmm/i18n.h>
-#include <sstream>
-#include "display/nr-svgfonts.h"
+#include "desktop.h"
+#include "document-private.h"
+#include "document-undo.h"
+#include "selection.h"
+#include "svg-fonts-dialog.h"
#include "verbs.h"
+#include "display/nr-svgfonts.h"
+#include "include/gtkmm_version.h"
+#include "object/sp-defs.h"
#include "object/sp-font-face.h"
-#include "object/sp-glyph.h"
-#include "object/sp-missing-glyph.h"
#include "object/sp-font.h"
#include "object/sp-glyph-kerning.h"
-#include "object/sp-defs.h"
-
-#include <glibmm/i18n.h>
-#include <glibmm/stringutils.h>
+#include "object/sp-glyph.h"
+#include "object/sp-missing-glyph.h"
+#include "svg/svg.h"
+#include "xml/repr.h"
SvgFontDrawingArea::SvgFontDrawingArea():
_x(0),
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp
index 6c26ece9b..ffeeb2ec9 100644
--- a/src/ui/dialog/symbols.cpp
+++ b/src/ui/dialog/symbols.cpp
@@ -19,33 +19,33 @@
#include <fstream>
#include <regex>
+#include <glibmm/i18n.h>
+#include <glibmm/markup.h>
#include <glibmm/regex.h>
#include <glibmm/stringutils.h>
-#include <glibmm/markup.h>
+#include "desktop.h"
+#include "document.h"
+#include "inkscape.h"
#include "path-prefix.h"
-#include "io/sys.h"
-#include "io/resource.h"
+#include "selection.h"
+#include "symbols.h"
+#include "verbs.h"
#include "display/cairo-utils.h"
+#include "helper/action.h"
#include "helper/icon-loader.h"
+#include "include/gtkmm_version.h"
+#include "io/resource.h"
+#include "io/sys.h"
+#include "object/sp-defs.h"
+#include "object/sp-root.h"
+#include "object/sp-symbol.h"
+#include "object/sp-use.h"
#include "ui/cache/svg_preview_cache.h"
#include "ui/clipboard.h"
#include "ui/icon-names.h"
-#include "symbols.h"
-
-#include "selection.h"
-#include "desktop.h"
-
-#include "document.h"
-#include "inkscape.h"
-
-#include "object/sp-root.h"
-#include "object/sp-use.h"
-#include "object/sp-defs.h"
-#include "object/sp-symbol.h"
-
#ifdef WITH_LIBVISIO
#include <libvisio/libvisio.h>
@@ -66,9 +66,6 @@
#endif
#endif
-#include "verbs.h"
-#include "helper/action.h"
-#include <glibmm/i18n.h>
namespace Inkscape {
namespace UI {
diff --git a/src/ui/dialog/symbols.h b/src/ui/dialog/symbols.h
index b42309ef6..e6970c801 100644
--- a/src/ui/dialog/symbols.h
+++ b/src/ui/dialog/symbols.h
@@ -13,12 +13,15 @@
#ifndef INKSCAPE_UI_DIALOG_SYMBOLS_H
#define INKSCAPE_UI_DIALOG_SYMBOLS_H
+
+#include <vector>
+
#include <gtkmm.h>
#include "display/drawing.h"
+#include "include/gtkmm_version.h"
#include "ui/dialog/desktop-tracker.h"
#include "ui/widget/panel.h"
-#include <vector>
class SPObject;
class SPSymbol;
diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp
index bf191fd3e..bbba6a202 100644
--- a/src/ui/dialog/tags.cpp
+++ b/src/ui/dialog/tags.cpp
@@ -22,26 +22,25 @@
#include "desktop.h"
#include "document-undo.h"
#include "document.h"
-#include "helper/action.h"
-#include "helper/icon-loader.h"
+#include "filter-chemistry.h"
#include "inkscape.h"
#include "layer-fns.h"
#include "layer-manager.h"
+#include "verbs.h"
+#include "helper/action.h"
#include "helper/icon-loader.h"
+#include "helper/icon-loader.h"
+#include "include/gtkmm_version.h"
+#include "object/sp-defs.h"
+#include "object/sp-item.h"
+#include "object/sp-object-group.h"
#include "svg/css-ostringstream.h"
-#include "ui/tools/tool-base.h" //"event-context.h"
+#include "ui/tools/tool-base.h"
+#include "ui/widget/color-notebook.h"
#include "ui/widget/iconrenderer.h"
#include "ui/widget/layertypeicon.h"
-#include "verbs.h"
#include "xml/node-observer.h"
-//#include "dialogs/dialog-events.h"
-#include "ui/widget/color-notebook.h"
-#include "filter-chemistry.h"
-
-#include "object/sp-item.h"
-#include "object/sp-defs.h"
-#include "object/sp-object-group.h"
//#define DUMP_LAYERS 1
diff --git a/src/ui/monitor.cpp b/src/ui/monitor.cpp
index 19a304bb0..b78681070 100644
--- a/src/ui/monitor.cpp
+++ b/src/ui/monitor.cpp
@@ -30,6 +30,8 @@
#include <gdkmm/rectangle.h>
#include <gdkmm/window.h>
+#include "include/gtkmm_version.h"
+
#if GTKMM_CHECK_VERSION(3,22,0)
# include <gdkmm/monitor.h>
#else
diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp
index f9ab36853..172668618 100644
--- a/src/ui/tools/tool-base.cpp
+++ b/src/ui/tools/tool-base.cpp
@@ -43,6 +43,8 @@
#include "display/sp-canvas-group.h"
#include "display/canvas-rotate.h"
+#include "include/gtkmm_version.h"
+
#include "object/sp-guide.h"
#include "ui/contextmenu.h"
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index 4f7960474..bf5630857 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -32,6 +32,8 @@
#include "selection-chemistry.h"
#include "verbs.h"
+#include "include/gtkmm_version.h"
+
#include "io/sys.h"
#include "helper/icon-loader.h"
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index 2f0a9a9ea..b3efe9c61 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -27,6 +27,8 @@
#include "display/sp-canvas.h"
+#include "include/gtkmm_version.h"
+
#include "object/sp-linear-gradient.h"
#include "object/sp-mesh-gradient.h"
#include "object/sp-namedview.h"
diff --git a/src/widgets/sp-attribute-widget.cpp b/src/widgets/sp-attribute-widget.cpp
index f77404019..cb78f5a58 100644
--- a/src/widgets/sp-attribute-widget.cpp
+++ b/src/widgets/sp-attribute-widget.cpp
@@ -27,6 +27,8 @@
#include "document-undo.h"
#include "verbs.h"
+#include "include/gtkmm_version.h"
+
#include "object/sp-object.h"
#include "xml/repr.h"
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 07ff69dc9..8c6b7612e 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -48,6 +48,8 @@
#include "helper/action.h"
+#include "include/gtkmm_version.h"
+
#include "io/resource.h"
#include "object/sp-namedview.h"