summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-05-09 18:23:40 +0000
committerMatthias Clasen <mclasen@redhat.com>2023-05-09 18:23:40 +0000
commit91ca6d0851d98dc230fbcfd2b3c604b67a90107f (patch)
tree1072551fff0d18b1e5e19df5d967367f1b4788f2
parent526ddfa8666cf31e26763f2bcd0c83b066714134 (diff)
parentcdeeb3275aeddd431d066a38f44012c3d3cbb6d8 (diff)
downloadgtk+-91ca6d0851d98dc230fbcfd2b3c604b67a90107f.tar.gz
Merge branch 'wip/ebassi/gen-version-macros' into 'main'
Generate version and deprecation macros at build time See merge request GNOME/gtk!5945
-rwxr-xr-xbuild-aux/meson/gen-visibility-macros.py201
-rw-r--r--demos/gtk-demo/bluroverlay.h4
-rw-r--r--demos/gtk-demo/gskshaderpaintable.h7
-rw-r--r--demos/gtk-demo/meson.build3
-rw-r--r--gdk/gdk.c2
-rw-r--r--gdk/gdk.h2
-rw-r--r--gdk/gdkapplaunchcontext.h1
-rw-r--r--gdk/gdkcairo.c5
-rw-r--r--gdk/gdkcairo.h5
-rw-r--r--gdk/gdkcairocontext.h3
-rw-r--r--gdk/gdkclipboard.h3
-rw-r--r--gdk/gdkcontentdeserializer.h2
-rw-r--r--gdk/gdkcontentformats.h2
-rw-r--r--gdk/gdkcontentprovider.h2
-rw-r--r--gdk/gdkcontentproviderimpl.h1
-rw-r--r--gdk/gdkcontentserializer.h2
-rw-r--r--gdk/gdkcursor.h1
-rw-r--r--gdk/gdkdevice.h2
-rw-r--r--gdk/gdkdevicepad.h1
-rw-r--r--gdk/gdkdevicetool.h3
-rw-r--r--gdk/gdkdisplay.c17
-rw-r--r--gdk/gdkdisplay.h1
-rw-r--r--gdk/gdkdrag.h3
-rw-r--r--gdk/gdkdragsurfacesize.h1
-rw-r--r--gdk/gdkdrawcontext.h1
-rw-r--r--gdk/gdkdrop.h2
-rw-r--r--gdk/gdkenums.h1
-rw-r--r--gdk/gdkevents.h4
-rw-r--r--gdk/gdkframetimings.h3
-rw-r--r--gdk/gdkglcontext.h4
-rw-r--r--gdk/gdkgltexture.h1
-rw-r--r--gdk/gdkgltexturebuilder.h2
-rw-r--r--gdk/gdkkeys.h1
-rw-r--r--gdk/gdkmemorytexture.h2
-rw-r--r--gdk/gdkmonitor.c1
-rw-r--r--gdk/gdkmonitor.h2
-rw-r--r--gdk/gdkpaintable.h1
-rw-r--r--gdk/gdkpango.h3
-rw-r--r--gdk/gdkpipeiostreamprivate.h5
-rw-r--r--gdk/gdkpixbuf.h6
-rw-r--r--gdk/gdkpopuplayout.c1
-rw-r--r--gdk/gdkpopuplayout.h2
-rw-r--r--gdk/gdkprofiler.c2
-rw-r--r--gdk/gdkrectangle.h1
-rw-r--r--gdk/gdkrgba.h1
-rw-r--r--gdk/gdksnapshot.h1
-rw-r--r--gdk/gdksurface.h1
-rw-r--r--gdk/gdktexture.h2
-rw-r--r--gdk/gdktexturedownloader.h3
-rw-r--r--gdk/gdktoplevellayout.h3
-rw-r--r--gdk/gdktoplevelsize.h1
-rw-r--r--gdk/gdktypes.h2
-rw-r--r--gdk/gdkversionmacros.h.in324
-rw-r--r--gdk/gdkvulkancontext.h1
-rw-r--r--gdk/meson.build14
-rw-r--r--gdk/version/gdkversionmacros.h.in146
-rw-r--r--gdk/version/meson.build21
-rw-r--r--gtk/css/gtkcss.h2
-rw-r--r--gtk/css/gtkcssenums.h2
-rw-r--r--gtk/css/gtkcssenumtypes.h.template2
-rw-r--r--gtk/css/gtkcsserror.h2
-rw-r--r--gtk/css/gtkcsssection.h2
-rw-r--r--gtk/css/meson.build2
-rw-r--r--gtk/meson.build1
-rw-r--r--meson.build21
-rw-r--r--testsuite/a11y/meson.build3
-rw-r--r--testsuite/css/meson.build4
-rw-r--r--testsuite/gdk/meson.build2
-rw-r--r--testsuite/gsk/meson.build2
-rw-r--r--testsuite/gtk/meson.build5
-rw-r--r--testsuite/reftests/meson.build3
71 files changed, 430 insertions, 462 deletions
diff --git a/build-aux/meson/gen-visibility-macros.py b/build-aux/meson/gen-visibility-macros.py
new file mode 100755
index 0000000000..2f50c804a8
--- /dev/null
+++ b/build-aux/meson/gen-visibility-macros.py
@@ -0,0 +1,201 @@
+#!/usr/bin/env python3
+#
+# SPDX-FileCopyrightText: 2022 Collabora Inc.
+# 2023 Emmanuele Bassi
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# Original author: Xavier Claessens <xclaesse@gmail.com>
+
+import argparse
+import textwrap
+from pathlib import Path
+
+
+# Disable line length warnings as wrapping the C code templates would be hard
+# flake8: noqa: E501
+
+
+def gen_versions_macros(args, current_major_version, current_minor_version, current_micro_version):
+ with args.out_path.open("w", encoding="utf-8") as ofile, args.in_path.open(
+ "r", encoding="utf-8"
+ ) as ifile:
+ for line in ifile.readlines():
+ if "@GDK_VERSIONS@" in line:
+ ofile.write(
+ textwrap.dedent(
+ f"""\
+ /**
+ * GDK_MAJOR_VERSION:
+ *
+ * The major version component of the library's version, e.g. "1" for "1.2.3".
+ */
+ #define GDK_MAJOR_VERSION ({current_major_version})
+
+ /**
+ * GDK_MINOR_VERSION:
+ *
+ * The minor version component of the library's version, e.g. "2" for "1.2.3".
+ */
+ #define GDK_MINOR_VERSION ({current_minor_version})
+
+ /**
+ * GDK_MICRO_VERSION:
+ *
+ * The micro version component of the library's version, e.g. "3" for "1.2.3".
+ */
+ #define GDK_MICRO_VERSION ({current_micro_version})
+ """
+ )
+ )
+ for minor in range(0, current_minor_version + 2, 2):
+ ofile.write(
+ textwrap.dedent(
+ f"""\
+ /**
+ * GDK_VERSION_{current_major_version}_{minor}:
+ *
+ * A macro that evaluates to the {current_major_version}.{minor} version of GTK, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: {current_major_version}.{minor}
+ */
+ #define GDK_VERSION_{current_major_version}_{minor} (G_ENCODE_VERSION ({current_major_version}, {minor}))
+ """
+ )
+ )
+ else:
+ ofile.write(line)
+
+
+def gen_visibility_macros(args, current_major_version, current_minor_version, current_micro_version):
+ """
+ Generates a set of macros for each minor stable version of GTK
+
+ - GDK_DEPRECATED
+ - GDK_DEPRECATED_IN_…
+ - GDK_DEPRECATED_MACRO_IN_…
+ - GDK_DEPRECATED_ENUMERATOR_IN_…
+ - GDK_DEPRECATED_TYPE_IN_…
+
+ - GDK_AVAILABLE_IN_ALL
+ - GDK_AVAILABLE_IN_…
+ - GDK_AVAILABLE_STATIC_INLINE_IN_…
+ - GDK_AVAILABLE_MACRO_IN_…
+ - GDK_AVAILABLE_ENUMERATOR_IN_…
+ - GDK_AVAILABLE_TYPE_IN_…
+
+ - GDK_UNAVAILABLE(maj,min)
+ - GDK_UNAVAILABLE_STATIC_INLINE(maj,min)
+ """
+
+ ns = args.namespace
+ with args.out_path.open("w", encoding="utf-8") as f:
+ f.write(
+ textwrap.dedent(
+ f"""\
+ #pragma once
+
+ #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined({ns}_STATIC_COMPILATION)
+ # define _{ns}_EXPORT __declspec(dllexport)
+ # define _{ns}_IMPORT __declspec(dllimport)
+ #elif __GNUC__ >= 4
+ # define _{ns}_EXPORT __attribute__((visibility("default")))
+ # define _{ns}_IMPORT
+ #else
+ # define _{ns}_EXPORT
+ # define _{ns}_IMPORT
+ #endif
+ #ifdef GTK_COMPILATION
+ # define _{ns}_API _{ns}_EXPORT
+ #else
+ # define _{ns}_API _{ns}_IMPORT
+ #endif
+
+ #define _{ns}_EXTERN _{ns}_API extern
+
+ #define {ns}_VAR _{ns}_EXTERN
+ #define {ns}_AVAILABLE_IN_ALL _{ns}_EXTERN
+
+ #ifdef GDK_DISABLE_DEPRECATION_WARNINGS
+ #define {ns}_DEPRECATED _{ns}_EXTERN
+ #define {ns}_DEPRECATED_FOR(f) _{ns}_EXTERN
+ #define {ns}_UNAVAILABLE(maj,min) _{ns}_EXTERN
+ #define {ns}_UNAVAILABLE_STATIC_INLINE(maj,min)
+ #else
+ #define {ns}_DEPRECATED G_DEPRECATED _{ns}_EXTERN
+ #define {ns}_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _{ns}_EXTERN
+ #define {ns}_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _{ns}_EXTERN
+ #define {ns}_UNAVAILABLE_STATIC_INLINE(maj,min) G_UNAVAILABLE(maj,min)
+ #endif
+ """
+ )
+ )
+ for minor in range(0, current_minor_version + 2, 2):
+ f.write(
+ textwrap.dedent(
+ f"""
+ #if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_{minor}
+ #define {ns}_DEPRECATED_IN_{current_major_version}_{minor} {ns}_DEPRECATED
+ #define {ns}_DEPRECATED_IN_{current_major_version}_{minor}_FOR(f) {ns}_DEPRECATED_FOR (f)
+ #define {ns}_DEPRECATED_MACRO_IN_{current_major_version}_{minor} GDK_DEPRECATED_MACRO
+ #define {ns}_DEPRECATED_MACRO_IN_{current_major_version}_{minor}_FOR(f) GDK_DEPRECATED_MACRO_FOR (f)
+ #define {ns}_DEPRECATED_ENUMERATOR_IN_{current_major_version}_{minor} GDK_DEPRECATED_ENUMERATOR
+ #define {ns}_DEPRECATED_ENUMERATOR_IN_{current_major_version}_{minor}_FOR(f) GDK_DEPRECATED_ENUMERATOR_FOR (f)
+ #define {ns}_DEPRECATED_TYPE_IN_{current_major_version}_{minor} GDK_DEPRECATED_TYPE
+ #define {ns}_DEPRECATED_TYPE_IN_{current_major_version}_{minor}_FOR(f) GDK_DEPRECATED_TYPE_FOR (f)
+ #else
+ #define {ns}_DEPRECATED_IN_{current_major_version}_{minor} _{ns}_EXTERN
+ #define {ns}_DEPRECATED_IN_{current_major_version}_{minor}_FOR(f) _{ns}_EXTERN
+ #define {ns}_DEPRECATED_MACRO_IN_{current_major_version}_{minor}
+ #define {ns}_DEPRECATED_MACRO_IN_{current_major_version}_{minor}_FOR(f)
+ #define {ns}_DEPRECATED_ENUMERATOR_IN_{current_major_version}_{minor}
+ #define {ns}_DEPRECATED_ENUMERATOR_IN_{current_major_version}_{minor}_FOR(f)
+ #define {ns}_DEPRECATED_TYPE_IN_{current_major_version}_{minor}
+ #define {ns}_DEPRECATED_TYPE_IN_{current_major_version}_{minor}_FOR(f)
+ #endif
+
+ #if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_{current_major_version}_{minor}
+ #define {ns}_AVAILABLE_IN_{current_major_version}_{minor} {ns}_UNAVAILABLE ({current_major_version}, {minor})
+ #define {ns}_AVAILABLE_STATIC_INLINE_IN_{current_major_version}_{minor} GDK_UNAVAILABLE_STATIC_INLINE ({current_major_version}, {minor})
+ #define {ns}_AVAILABLE_MACRO_IN_{current_major_version}_{minor} GDK_UNAVAILABLE_MACRO ({current_major_version}, {minor})
+ #define {ns}_AVAILABLE_ENUMERATOR_IN_{current_major_version}_{minor} GDK_UNAVAILABLE_ENUMERATOR ({current_major_version}, {minor})
+ #define {ns}_AVAILABLE_TYPE_IN_{current_major_version}_{minor} GDK_UNAVAILABLE_TYPE ({current_major_version}, {minor})
+ #else
+ #define {ns}_AVAILABLE_IN_{current_major_version}_{minor} _{ns}_EXTERN
+ #define {ns}_AVAILABLE_STATIC_INLINE_IN_{current_major_version}_{minor}
+ #define {ns}_AVAILABLE_MACRO_IN_{current_major_version}_{minor}
+ #define {ns}_AVAILABLE_ENUMERATOR_IN_{current_major_version}_{minor}
+ #define {ns}_AVAILABLE_TYPE_IN_{current_major_version}_{minor}
+ #endif
+ """
+ )
+ )
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("gtk_version", help="Current GLib version")
+ subparsers = parser.add_subparsers()
+
+ versions_parser = subparsers.add_parser(
+ "versions-macros", help="Generate versions macros"
+ )
+ versions_parser.add_argument("in_path", help="input file", type=Path)
+ versions_parser.add_argument("out_path", help="output file", type=Path)
+ versions_parser.set_defaults(func=gen_versions_macros)
+
+ visibility_parser = subparsers.add_parser(
+ "visibility-macros", help="Generate visibility macros"
+ )
+ visibility_parser.add_argument("namespace", help="Macro namespace")
+ visibility_parser.add_argument("out_path", help="output file", type=Path)
+ visibility_parser.set_defaults(func=gen_visibility_macros)
+
+ args = parser.parse_args()
+ version = [int(i) for i in args.gtk_version.split(".")]
+ args.func(args, version[0], version[1], version[2])
+
+
+if __name__ == "__main__":
+ main()
diff --git a/demos/gtk-demo/bluroverlay.h b/demos/gtk-demo/bluroverlay.h
index 57aa1fb757..0bae08401b 100644
--- a/demos/gtk-demo/bluroverlay.h
+++ b/demos/gtk-demo/bluroverlay.h
@@ -51,15 +51,11 @@ struct _BlurOverlayClass
GtkAllocation *allocation);
};
-GDK_AVAILABLE_IN_ALL
GType blur_overlay_get_type (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_ALL
GtkWidget *blur_overlay_new (void);
-GDK_AVAILABLE_IN_ALL
void blur_overlay_add_overlay (BlurOverlay *overlay,
GtkWidget *widget,
double blur);
-GDK_AVAILABLE_IN_ALL
void blur_overlay_set_child (BlurOverlay *overlay,
GtkWidget *widget);
diff --git a/demos/gtk-demo/gskshaderpaintable.h b/demos/gtk-demo/gskshaderpaintable.h
index 9b8f7db83f..98fd2bcaa7 100644
--- a/demos/gtk-demo/gskshaderpaintable.h
+++ b/demos/gtk-demo/gskshaderpaintable.h
@@ -27,24 +27,17 @@ G_BEGIN_DECLS
#define GSK_TYPE_SHADER_PAINTABLE (gsk_shader_paintable_get_type ())
-GDK_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (GskShaderPaintable, gsk_shader_paintable, GSK, SHADER_PAINTABLE, GObject)
-GDK_AVAILABLE_IN_ALL
GdkPaintable * gsk_shader_paintable_new (GskGLShader *shader,
GBytes *data);
-GDK_AVAILABLE_IN_ALL
GskGLShader * gsk_shader_paintable_get_shader (GskShaderPaintable *self);
-GDK_AVAILABLE_IN_ALL
void gsk_shader_paintable_set_shader (GskShaderPaintable *self,
GskGLShader *shader);
-GDK_AVAILABLE_IN_ALL
GBytes * gsk_shader_paintable_get_args (GskShaderPaintable *self);
-GDK_AVAILABLE_IN_ALL
void gsk_shader_paintable_set_args (GskShaderPaintable *self,
GBytes *data);
-GDK_AVAILABLE_IN_ALL
void gsk_shader_paintable_update_time (GskShaderPaintable *self,
int time_idx,
gint64 frame_time);
diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build
index 976c3ec997..b1a4b52514 100644
--- a/demos/gtk-demo/meson.build
+++ b/demos/gtk-demo/meson.build
@@ -235,8 +235,7 @@ endif
demo_cflags = []
foreach flag: common_cflags
if flag not in ['-Werror=missing-prototypes', '-Wmissing-prototypes',
- '-Werror=missing-declarations', '-Wmissing-declarations',
- '-fvisibility=hidden']
+ '-Werror=missing-declarations', '-Wmissing-declarations']
demo_cflags += flag
endif
endforeach
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 1c54545523..65c9da23bb 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -24,7 +24,7 @@
#include "config.h"
-#include "gdkversionmacros.h"
+#include "version/gdkversionmacros.h"
#include "gdkresources.h"
diff --git a/gdk/gdk.h b/gdk/gdk.h
index 4201b72a86..64b4882672 100644
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -75,7 +75,7 @@
#include <gdk/gdktoplevellayout.h>
#include <gdk/gdktoplevelsize.h>
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
+#include <gdk/version/gdkversionmacros.h>
#include <gdk/gdkvulkancontext.h>
#undef __GDK_H_INSIDE__
diff --git a/gdk/gdkapplaunchcontext.h b/gdk/gdkapplaunchcontext.h
index 364a2a941c..989fc654d5 100644
--- a/gdk/gdkapplaunchcontext.h
+++ b/gdk/gdkapplaunchcontext.h
@@ -24,7 +24,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c
index d69b9bc602..fec75fb8b5 100644
--- a/gdk/gdkcairo.c
+++ b/gdk/gdkcairo.c
@@ -1,5 +1,5 @@
/* GDK - The GIMP Drawing Kit
- * Copyright (C) 2005 Red Hat, Inc.
+ * Copyright (C) 2005 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -19,6 +19,9 @@
#include "gdkcairoprivate.h"
+#include "gdkrgba.h"
+#include "gdktexture.h"
+
#include <math.h>
/**
diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h
index 24af5939d8..10591ab8fa 100644
--- a/gdk/gdkcairo.h
+++ b/gdk/gdkcairo.h
@@ -1,5 +1,5 @@
/* GDK - The GIMP Drawing Kit
- * Copyright (C) 2005 Red Hat, Inc.
+ * Copyright (C) 2005 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,8 +21,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
-#include <gdk/gdkrgba.h>
+#include <gdk/gdktypes.h>
#include <gdk/gdkpixbuf.h>
#include <pango/pangocairo.h>
diff --git a/gdk/gdkcairocontext.h b/gdk/gdkcairocontext.h
index a230b2e663..2f58eb8e2b 100644
--- a/gdk/gdkcairocontext.h
+++ b/gdk/gdkcairocontext.h
@@ -24,11 +24,8 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
-#include <cairo.h>
-
G_BEGIN_DECLS
#define GDK_TYPE_CAIRO_CONTEXT (gdk_cairo_context_get_type ())
diff --git a/gdk/gdkclipboard.h b/gdk/gdkclipboard.h
index f10c95c32b..5814ef09d8 100644
--- a/gdk/gdkclipboard.h
+++ b/gdk/gdkclipboard.h
@@ -22,10 +22,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
-#include <gio/gio.h>
-
G_BEGIN_DECLS
diff --git a/gdk/gdkcontentdeserializer.h b/gdk/gdkcontentdeserializer.h
index be10880434..cace164fef 100644
--- a/gdk/gdkcontentdeserializer.h
+++ b/gdk/gdkcontentdeserializer.h
@@ -21,8 +21,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkcontentformats.h b/gdk/gdkcontentformats.h
index ff9b116db7..ddb85b3ec5 100644
--- a/gdk/gdkcontentformats.h
+++ b/gdk/gdkcontentformats.h
@@ -21,8 +21,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkcontentprovider.h b/gdk/gdkcontentprovider.h
index 9293a17aea..f9a62ef5d3 100644
--- a/gdk/gdkcontentprovider.h
+++ b/gdk/gdkcontentprovider.h
@@ -22,10 +22,8 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
-
G_BEGIN_DECLS
#define GDK_TYPE_CONTENT_PROVIDER (gdk_content_provider_get_type ())
diff --git a/gdk/gdkcontentproviderimpl.h b/gdk/gdkcontentproviderimpl.h
index 94c3ffb6fb..8c7c802292 100644
--- a/gdk/gdkcontentproviderimpl.h
+++ b/gdk/gdkcontentproviderimpl.h
@@ -22,7 +22,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkcontentserializer.h b/gdk/gdkcontentserializer.h
index 1322d17a51..7bf8854f33 100644
--- a/gdk/gdkcontentserializer.h
+++ b/gdk/gdkcontentserializer.h
@@ -21,8 +21,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkcursor.h b/gdk/gdkcursor.h
index f8eb2d7d9a..64240db7e2 100644
--- a/gdk/gdkcursor.h
+++ b/gdk/gdkcursor.h
@@ -28,7 +28,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 28d0c04c8b..21d8703986 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -21,12 +21,10 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkdevicetool.h>
#include <gdk/gdkenums.h>
-
G_BEGIN_DECLS
#define GDK_TYPE_DEVICE (gdk_device_get_type ())
diff --git a/gdk/gdkdevicepad.h b/gdk/gdkdevicepad.h
index aa6d56871c..1e95313fbd 100644
--- a/gdk/gdkdevicepad.h
+++ b/gdk/gdkdevicepad.h
@@ -23,7 +23,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkdevicetool.h b/gdk/gdkdevicetool.h
index 0accd67816..5a60ff15fa 100644
--- a/gdk/gdkdevicetool.h
+++ b/gdk/gdkdevicetool.h
@@ -21,10 +21,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkenums.h>
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
-
G_BEGIN_DECLS
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 1bdf40c711..ddfbb908d5 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -1,7 +1,7 @@
/* GDK - The GIMP Drawing Kit
* gdkdisplay.c
- *
- * Copyright 2001 Sun Microsystems Inc.
+ *
+ * Copyright 2001 Sun Microsystems Inc.
*
* Erwann Chenede <erwann.chenede@sun.com>
*
@@ -31,10 +31,11 @@
#include "gdkclipboardprivate.h"
#include "gdkdeviceprivate.h"
#include "gdkdisplaymanagerprivate.h"
-#include "gdkframeclockidleprivate.h"
#include "gdkeventsprivate.h"
+#include "gdkframeclockidleprivate.h"
#include "gdkglcontextprivate.h"
#include "gdkmonitorprivate.h"
+#include "gdkrectangle.h"
#ifdef HAVE_EGL
#include <epoxy/egl.h>
@@ -175,7 +176,7 @@ gdk_display_default_rate_egl_config (GdkDisplay *display,
return distance;
}
-
+
static GdkSeat *
gdk_display_real_get_default_seat (GdkDisplay *display)
{
@@ -418,10 +419,10 @@ gdk_display_close (GdkDisplay *display)
if (!display->closed)
{
display->closed = TRUE;
-
+
g_signal_emit (display, signals[CLOSED], 0, FALSE);
g_object_run_dispose (G_OBJECT (display));
-
+
g_object_unref (display);
}
}
@@ -808,7 +809,7 @@ _gdk_display_end_device_grab (GdkDisplay *display,
grab->implicit_ungrab = implicit;
return l->next == NULL;
}
-
+
return FALSE;
}
@@ -1268,7 +1269,7 @@ gdk_display_init_gl (GdkDisplay *self)
* Note that even if this function succeeds, creating a `GdkGLContext`
* may still fail.
*
- * This function is idempotent. Calling it multiple times will just
+ * This function is idempotent. Calling it multiple times will just
* return the same value or error.
*
* You never need to call this function, GDK will call it automatically
diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h
index 54b514f8cf..eb559b17b2 100644
--- a/gdk/gdkdisplay.h
+++ b/gdk/gdkdisplay.h
@@ -25,7 +25,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkevents.h>
#include <gdk/gdkseat.h>
diff --git a/gdk/gdkdrag.h b/gdk/gdkdrag.h
index bb4dd3ceb7..2c1cfbde20 100644
--- a/gdk/gdkdrag.h
+++ b/gdk/gdkdrag.h
@@ -28,10 +28,9 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
+#include <gdk/gdktypes.h>
#include <gdk/gdkdevice.h>
-#include <gdk/gdkenums.h>
#include <gdk/gdkevents.h>
-#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkdragsurfacesize.h b/gdk/gdkdragsurfacesize.h
index 28d23128be..433a136a31 100644
--- a/gdk/gdkdragsurfacesize.h
+++ b/gdk/gdkdragsurfacesize.h
@@ -23,7 +23,6 @@
#endif
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkdrawcontext.h b/gdk/gdkdrawcontext.h
index e414ede92c..dd3e347b8e 100644
--- a/gdk/gdkdrawcontext.h
+++ b/gdk/gdkdrawcontext.h
@@ -24,7 +24,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkdrop.h b/gdk/gdkdrop.h
index 8f4236007c..842c2ba65b 100644
--- a/gdk/gdkdrop.h
+++ b/gdk/gdkdrop.h
@@ -24,9 +24,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkenums.h>
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkenums.h b/gdk/gdkenums.h
index 9fc4a640b1..b0407a2757 100644
--- a/gdk/gdkenums.h
+++ b/gdk/gdkenums.h
@@ -345,4 +345,3 @@ typedef enum {
} GdkMemoryFormat;
G_END_DECLS
-
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index 7b75a3f3d6..fa5884f44d 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -28,12 +28,10 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
+#include <gdk/gdktypes.h>
#include <gdk/gdkdevice.h>
#include <gdk/gdkdevicetool.h>
#include <gdk/gdkdrag.h>
-#include <gdk/gdkenums.h>
-#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkframetimings.h b/gdk/gdkframetimings.h
index c3cfe184a5..24bae8da29 100644
--- a/gdk/gdkframetimings.h
+++ b/gdk/gdkframetimings.h
@@ -21,8 +21,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <glib-object.h>
-#include <gdk/gdkversionmacros.h>
+#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkglcontext.h b/gdk/gdkglcontext.h
index 0f5abe8544..cceed86ca8 100644
--- a/gdk/gdkglcontext.h
+++ b/gdk/gdkglcontext.h
@@ -1,7 +1,7 @@
/* GDK - The GIMP Drawing Kit
*
* gdkglcontext.h: GL context abstraction
- *
+ *
* Copyright © 2014 Emmanuele Bassi
*
* This library is free software; you can redistribute it and/or
@@ -24,9 +24,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkenums.h>
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkgltexture.h b/gdk/gdkgltexture.h
index 6f1cebdf47..68fa03fe4a 100644
--- a/gdk/gdkgltexture.h
+++ b/gdk/gdkgltexture.h
@@ -22,6 +22,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
+#include <gdk/gdktypes.h>
#include <gdk/gdkglcontext.h>
#include <gdk/gdktexture.h>
diff --git a/gdk/gdkgltexturebuilder.h b/gdk/gdkgltexturebuilder.h
index 042bcc96cb..8bf105064b 100644
--- a/gdk/gdkgltexturebuilder.h
+++ b/gdk/gdkgltexturebuilder.h
@@ -23,9 +23,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkenums.h>
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkkeys.h b/gdk/gdkkeys.h
index dd82c938dd..bc88400ead 100644
--- a/gdk/gdkkeys.h
+++ b/gdk/gdkkeys.h
@@ -28,7 +28,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkmemorytexture.h b/gdk/gdkmemorytexture.h
index 1f56b93578..21ecc6a96b 100644
--- a/gdk/gdkmemorytexture.h
+++ b/gdk/gdkmemorytexture.h
@@ -23,7 +23,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkenums.h>
+#include <gdk/gdktypes.h>
#include <gdk/gdktexture.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkmonitor.c b/gdk/gdkmonitor.c
index 96d7fe4416..b99408696e 100644
--- a/gdk/gdkmonitor.c
+++ b/gdk/gdkmonitor.c
@@ -24,6 +24,7 @@
#include "gdkmonitorprivate.h"
#include "gdkdisplay.h"
#include "gdkenumtypes.h"
+#include "gdkrectangle.h"
/**
* GdkMonitor:
diff --git a/gdk/gdkmonitor.h b/gdk/gdkmonitor.h
index ed199cba08..1cdb4f9a3e 100644
--- a/gdk/gdkmonitor.h
+++ b/gdk/gdkmonitor.h
@@ -25,8 +25,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
-#include <gdk/gdkrectangle.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkpaintable.h b/gdk/gdkpaintable.h
index c5c3afc325..7b1d34f37f 100644
--- a/gdk/gdkpaintable.h
+++ b/gdk/gdkpaintable.h
@@ -24,7 +24,6 @@
#endif
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkpango.h b/gdk/gdkpango.h
index 806597df2a..acdfbf6505 100644
--- a/gdk/gdkpango.h
+++ b/gdk/gdkpango.h
@@ -1,5 +1,5 @@
/* GDK - The GIMP Drawing Kit
- * Copyright (C) 2000 Red Hat, Inc.
+ * Copyright (C) 2000 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,7 +22,6 @@
#endif
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkpipeiostreamprivate.h b/gdk/gdkpipeiostreamprivate.h
index e88154e038..495de6d28b 100644
--- a/gdk/gdkpipeiostreamprivate.h
+++ b/gdk/gdkpipeiostreamprivate.h
@@ -18,14 +18,11 @@
#pragma once
-#include <gdk/gdkversionmacros.h>
-#include <gio/gio.h>
+#include <gdk/gdktypes.h>
G_BEGIN_DECLS
-
GIOStream * gdk_pipe_io_stream_new (void);
-
G_END_DECLS
diff --git a/gdk/gdkpixbuf.h b/gdk/gdkpixbuf.h
index b05a279935..8ddd1d1da6 100644
--- a/gdk/gdkpixbuf.h
+++ b/gdk/gdkpixbuf.h
@@ -28,12 +28,8 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <cairo.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
-#include <gdk/gdktexture.h>
-
+#include <gdk-pixbuf/gdk-pixbuf.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkpopuplayout.c b/gdk/gdkpopuplayout.c
index c58c455e7e..5b6c30d339 100644
--- a/gdk/gdkpopuplayout.c
+++ b/gdk/gdkpopuplayout.c
@@ -20,6 +20,7 @@
#include "gdkpopuplayout.h"
+#include "gdkrectangle.h"
#include "gdksurface.h"
/**
diff --git a/gdk/gdkpopuplayout.h b/gdk/gdkpopuplayout.h
index 34a58c5850..437be0a699 100644
--- a/gdk/gdkpopuplayout.h
+++ b/gdk/gdkpopuplayout.h
@@ -22,9 +22,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkenums.h>
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkprofiler.c b/gdk/gdkprofiler.c
index b51cd7eb37..9e456efeae 100644
--- a/gdk/gdkprofiler.c
+++ b/gdk/gdkprofiler.c
@@ -29,7 +29,7 @@
#include <unistd.h>
#endif
-#include "gdkversionmacros.h"
+#include "version/gdkversionmacros.h"
#include "gdkframeclockprivate.h"
diff --git a/gdk/gdkrectangle.h b/gdk/gdkrectangle.h
index e3325aee23..2d045c6d08 100644
--- a/gdk/gdkrectangle.h
+++ b/gdk/gdkrectangle.h
@@ -29,7 +29,6 @@
#endif
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkrgba.h b/gdk/gdkrgba.h
index b8aca3dab9..36b6b285a8 100644
--- a/gdk/gdkrgba.h
+++ b/gdk/gdkrgba.h
@@ -29,7 +29,6 @@
#endif
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdksnapshot.h b/gdk/gdksnapshot.h
index 31e0755bf4..c48b25e8e5 100644
--- a/gdk/gdksnapshot.h
+++ b/gdk/gdksnapshot.h
@@ -24,7 +24,6 @@
#endif
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h
index 5e215b52d5..50c1efe779 100644
--- a/gdk/gdksurface.h
+++ b/gdk/gdksurface.h
@@ -28,7 +28,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkevents.h>
#include <gdk/gdkframeclock.h>
diff --git a/gdk/gdktexture.h b/gdk/gdktexture.h
index c79904420e..c359e56179 100644
--- a/gdk/gdktexture.h
+++ b/gdk/gdktexture.h
@@ -22,8 +22,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
-#include <gdk/gdkenums.h>
#include <gdk/gdktypes.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
diff --git a/gdk/gdktexturedownloader.h b/gdk/gdktexturedownloader.h
index 31d97ef17b..e8c7df9a8b 100644
--- a/gdk/gdktexturedownloader.h
+++ b/gdk/gdktexturedownloader.h
@@ -21,9 +21,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-
-#include <gdk/gdkversionmacros.h>
-#include <gdk/gdkenums.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
diff --git a/gdk/gdktoplevellayout.h b/gdk/gdktoplevellayout.h
index aa2e1046d7..3c9d0a84d9 100644
--- a/gdk/gdktoplevellayout.h
+++ b/gdk/gdktoplevellayout.h
@@ -22,9 +22,8 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkmonitor.h>
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
+#include <gdk/gdkmonitor.h>
G_BEGIN_DECLS
diff --git a/gdk/gdktoplevelsize.h b/gdk/gdktoplevelsize.h
index 536b1a34eb..06357ae9ca 100644
--- a/gdk/gdktoplevelsize.h
+++ b/gdk/gdktoplevelsize.h
@@ -23,7 +23,6 @@
#endif
#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index 69136f7ab0..489ca9cbcc 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -42,6 +42,8 @@
* (or GTK). One such setting is what windowing API backend is in use.
*/
#include <gdk/gdkconfig.h>
+#include <gdk/gdkenums.h>
+#include <gdk/version/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gdk/gdkversionmacros.h.in b/gdk/gdkversionmacros.h.in
deleted file mode 100644
index e8dd30eeb9..0000000000
--- a/gdk/gdkversionmacros.h.in
+++ /dev/null
@@ -1,324 +0,0 @@
-/* gdkversionmacros.h - version boundaries checks
- * Copyright (C) 2012 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.▸ See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#if !defined (__GDK_H_INSIDE__) && !defined (__GTK_CSS_H_INSIDE__) && !defined (GTK_COMPILATION) && !defined (GTK_CSS_COMPILATION)
-#error "Only <gdk/gdk.h> can be included directly."
-#endif
-
-#ifndef __GDK_VERSION_MACROS_H__
-#define __GDK_VERSION_MACROS_H__
-
-#include <glib.h>
-
-/**
- * GDK_MAJOR_VERSION:
- *
- * The major version component of the library's version, e.g. "1" for "1.2.3".
- */
-#define GDK_MAJOR_VERSION (@GTK_MAJOR_VERSION@)
-
-/**
- * GDK_MINOR_VERSION:
- *
- * The minor version component of the library's version, e.g. "2" for "1.2.3".
- */
-#define GDK_MINOR_VERSION (@GTK_MINOR_VERSION@)
-
-/**
- * GDK_MICRO_VERSION:
- *
- * The micro version component of the library's version, e.g. "3" for "1.2.3".
- */
-#define GDK_MICRO_VERSION (@GTK_MICRO_VERSION@)
-
-#ifndef _GDK_EXTERN
-#define _GDK_EXTERN extern
-#endif
-
-/**
- * GDK_DISABLE_DEPRECATION_WARNINGS:
- *
- * A macro that should be defined before including the `gdk.h` header.
- *
- * If this symbol is defined, no compiler warnings will be produced for
- * uses of deprecated GDK and GTK APIs.
- */
-
-#ifdef GDK_DISABLE_DEPRECATION_WARNINGS
-#define GDK_DEPRECATED _GDK_EXTERN
-#define GDK_DEPRECATED_FOR(f) _GDK_EXTERN
-#define GDK_UNAVAILABLE(maj,min) _GDK_EXTERN
-#else
-#define GDK_DEPRECATED G_DEPRECATED _GDK_EXTERN
-#define GDK_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _GDK_EXTERN
-#define GDK_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _GDK_EXTERN
-#endif
-
-/* XXX: Every new stable minor release bump should add a macro here */
-
-/**
- * GDK_VERSION_4_0:
- *
- * A macro that evaluates to the 4.0 version of GDK, in a format
- * that can be used by the C pre-processor.
- */
-#define GDK_VERSION_4_0 (G_ENCODE_VERSION (4, 0))
-
-/**
- * GDK_VERSION_4_2:
- *
- * A macro that evaluates to the 4.2 version of GDK, in a format
- * that can be used by the C pre-processor.
- *
- * Since: 4.2
- */
-#define GDK_VERSION_4_2 (G_ENCODE_VERSION (4, 2))
-
-/**
- * GDK_VERSION_4_4:
- *
- * A macro that evaluates to the 4.4 version of GDK, in a format
- * that can be used by the C pre-processor.
- *
- * Since: 4.4
- */
-#define GDK_VERSION_4_4 (G_ENCODE_VERSION (4, 4))
-
-/**
- * GDK_VERSION_4_6:
- *
- * A macro that evaluates to the 4.6 version of GDK, in a format
- * that can be used by the C pre-processor.
- *
- * Since: 4.6
- */
-#define GDK_VERSION_4_6 (G_ENCODE_VERSION (4, 6))
-
-/**
- * GDK_VERSION_4_8:
- *
- * A macro that evaluates to the 4.8 version of GDK, in a format
- * that can be used by the C pre-processor.
- *
- * Since: 4.8
- */
-#define GDK_VERSION_4_8 (G_ENCODE_VERSION (4, 8))
-
-/**
- * GDK_VERSION_4_10:
- *
- * A macro that evaluates to the 4.10 version of GDK, in a format
- * that can be used by the C pre-processor.
- *
- * Since: 4.10
- */
-#define GDK_VERSION_4_10 (G_ENCODE_VERSION (4, 10))
-
-/**
- * GDK_VERSION_4_12:
- *
- * A macro that evaluates to the 4.12 version of GDK, in a format
- * that can be used by the C pre-processor.
- *
- * Since: 4.12
- */
-#define GDK_VERSION_4_12 (G_ENCODE_VERSION (4, 12))
-
-
-/* evaluates to the current stable version; for development cycles,
- * this means the next stable target, with a hard backstop to the
- * beginning of the stable series
- */
-#if GDK_MAJOR_VERSION >= 4 && (GDK_MINOR_VERSION % 2)
-# define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION + 1))
-#elif G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION) > GDK_VERSION_4_0
-# define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION))
-#else
-# define GDK_VERSION_CUR_STABLE GDK_VERSION_4_0
-#endif
-
-/* evaluates to the previous stable version, with a hard backstop
- * to the beginning of the stable series
- */
-#if GDK_MAJOR_VERSION >= 4 && (GDK_MINOR_VERSION % 2)
-# define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 1))
-#elif GDK_MAJOR_VERSION >= 4 && GDK_MINOR_VERSION > 2
-# define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 2))
-#else
-# define GDK_VERSION_PREV_STABLE GDK_VERSION_4_0
-#endif
-
-/**
- * GDK_VERSION_MIN_REQUIRED:
- *
- * A macro that should be defined by the user prior to including
- * the `gdk.h` header.
- *
- * The definition should be one of the predefined GDK version
- * macros: %GDK_VERSION_4_0, %GDK_VERSION_4_2,...
- *
- * This macro defines the lower bound for the GDK API to use.
- *
- * If a function has been deprecated in a newer version of GDK,
- * it is possible to use this symbol to avoid the compiler warnings
- * without disabling warning for every deprecated function.
- */
-#ifndef GDK_VERSION_MIN_REQUIRED
-# define GDK_VERSION_MIN_REQUIRED (GDK_VERSION_CUR_STABLE)
-#endif
-
-/**
- * GDK_VERSION_MAX_ALLOWED:
- *
- * A macro that should be defined by the user prior to including
- * the `gdk.h` header.
- *
- * The definition should be one of the predefined GDK version
- * macros: %GDK_VERSION_4_0, %GDK_VERSION_4_2,...
- *
- * This macro defines the upper bound for the GDK API to use.
- *
- * If a function has been introduced in a newer version of GDK,
- * it is possible to use this symbol to get compiler warnings when
- * trying to use that function.
- */
-#ifndef GDK_VERSION_MAX_ALLOWED
-# if GDK_VERSION_MIN_REQUIRED > GDK_VERSION_PREV_STABLE
-# define GDK_VERSION_MAX_ALLOWED GDK_VERSION_MIN_REQUIRED
-# else
-# define GDK_VERSION_MAX_ALLOWED GDK_VERSION_CUR_STABLE
-# endif
-#endif
-
-/* sanity checks */
-#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_MIN_REQUIRED
-# error "GDK_VERSION_MAX_ALLOWED must be >= GDK_VERSION_MIN_REQUIRED"
-#endif
-#if GDK_VERSION_MIN_REQUIRED < GDK_VERSION_4_0
-# error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_4_0"
-#endif
-
-#define GDK_AVAILABLE_IN_ALL _GDK_EXTERN
-
-/* XXX: Every new stable minor release should add a set of macros here */
-
-/* This is not really necessary for 4.0, since there can't be an
- * earlier version, and there are no deprecated symbols. We just
- * include it for completeness, and because it's easier to copy
- * this stanza every time a new development cycle starts.
- */
-#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_0
-# define GDK_AVAILABLE_IN_4_0 GDK_UNAVAILABLE(4, 0)
-#else
-# define GDK_AVAILABLE_IN_4_0 _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_0
-# define GDK_DEPRECATED_IN_4_0 GDK_DEPRECATED
-# define GDK_DEPRECATED_IN_4_0_FOR(f) GDK_DEPRECATED_FOR(f)
-#else
-# define GDK_DEPRECATED_IN_4_0 _GDK_EXTERN
-# define GDK_DEPRECATED_IN_4_0_FOR(f) _GDK_EXTERN
-#endif
-
-
-#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_2
-# define GDK_AVAILABLE_IN_4_2 GDK_UNAVAILABLE(4, 2)
-#else
-# define GDK_AVAILABLE_IN_4_2 _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_2
-# define GDK_DEPRECATED_IN_4_2 GDK_DEPRECATED
-# define GDK_DEPRECATED_IN_4_2_FOR(f) GDK_DEPRECATED_FOR(f)
-#else
-# define GDK_DEPRECATED_IN_4_2 _GDK_EXTERN
-# define GDK_DEPRECATED_IN_4_2_FOR(f) _GDK_EXTERN
-#endif
-
-
-#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_4
-# define GDK_AVAILABLE_IN_4_4 GDK_UNAVAILABLE(4, 4)
-#else
-# define GDK_AVAILABLE_IN_4_4 _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_4
-# define GDK_DEPRECATED_IN_4_4 GDK_DEPRECATED
-# define GDK_DEPRECATED_IN_4_4_FOR(f) GDK_DEPRECATED_FOR(f)
-#else
-# define GDK_DEPRECATED_IN_4_4 _GDK_EXTERN
-# define GDK_DEPRECATED_IN_4_4_FOR(f) _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_6
-# define GDK_AVAILABLE_IN_4_6 GDK_UNAVAILABLE(4, 6)
-#else
-# define GDK_AVAILABLE_IN_4_6 _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_6
-# define GDK_DEPRECATED_IN_4_6 GDK_DEPRECATED
-# define GDK_DEPRECATED_IN_4_6_FOR(f) GDK_DEPRECATED_FOR(f)
-#else
-# define GDK_DEPRECATED_IN_4_6 _GDK_EXTERN
-# define GDK_DEPRECATED_IN_4_6_FOR(f) _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_8
-# define GDK_AVAILABLE_IN_4_8 GDK_UNAVAILABLE(4, 8)
-#else
-# define GDK_AVAILABLE_IN_4_8 _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_8
-# define GDK_DEPRECATED_IN_4_8 GDK_DEPRECATED
-# define GDK_DEPRECATED_IN_4_8_FOR(f) GDK_DEPRECATED_FOR(f)
-#else
-# define GDK_DEPRECATED_IN_4_8 _GDK_EXTERN
-# define GDK_DEPRECATED_IN_4_8_FOR(f) _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_10
-# define GDK_AVAILABLE_IN_4_10 GDK_UNAVAILABLE(4, 10)
-#else
-# define GDK_AVAILABLE_IN_4_10 _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_10
-# define GDK_DEPRECATED_IN_4_10 GDK_DEPRECATED
-# define GDK_DEPRECATED_IN_4_10_FOR(f) GDK_DEPRECATED_FOR(f)
-#else
-# define GDK_DEPRECATED_IN_4_10 _GDK_EXTERN
-# define GDK_DEPRECATED_IN_4_10_FOR(f) _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_12
-# define GDK_AVAILABLE_IN_4_12 GDK_UNAVAILABLE(4, 12)
-#else
-# define GDK_AVAILABLE_IN_4_12 _GDK_EXTERN
-#endif
-
-#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_12
-# define GDK_DEPRECATED_IN_4_12 GDK_DEPRECATED
-# define GDK_DEPRECATED_IN_4_12_FOR(f) GDK_DEPRECATED_FOR(f)
-#else
-# define GDK_DEPRECATED_IN_4_12 _GDK_EXTERN
-# define GDK_DEPRECATED_IN_4_12_FOR(f) _GDK_EXTERN
-#endif
-
-#endif /* __GDK_VERSION_MACROS_H__ */
diff --git a/gdk/gdkvulkancontext.h b/gdk/gdkvulkancontext.h
index d6531a414a..55a347861b 100644
--- a/gdk/gdkvulkancontext.h
+++ b/gdk/gdkvulkancontext.h
@@ -24,7 +24,6 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
-#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
#ifdef GDK_RENDERING_VULKAN
diff --git a/gdk/meson.build b/gdk/meson.build
index c83af4873d..77d0fbd293 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -146,7 +146,7 @@ gdk_enums = gnome.mkenums_simple('gdkenumtypes',
sources: gdk_public_headers,
decorator: 'GDK_AVAILABLE_IN_ALL',
body_prefix: '#include "config.h"',
- header_prefix: '#include "gdkversionmacros.h"',
+ header_prefix: '#include "version/gdkversionmacros.h"\n',
install_dir: gtk_includedir / 'gtk-4.0/gdk',
install_header: true,
)
@@ -183,13 +183,6 @@ gdkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version)
gdkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version)
gdkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version)
-gdkversionmacros = configure_file(
- input: 'gdkversionmacros.h.in',
- output: 'gdkversionmacros.h',
- configuration: gdkversion_cdata,
- install_dir: gtk_includedir / 'gtk-4.0/gdk',
-)
-
gdkinc = include_directories('.')
gdkx11_inc = include_directories('x11')
gdkwayland_inc = include_directories('wayland')
@@ -197,7 +190,7 @@ gdkwayland_inc = include_directories('wayland')
wlinc = include_directories('.')
win32rcinc = include_directories('win32/rc')
-gdk_gen_headers = [gdkenum_h, gdkmarshal_h, gdkconfig, gdkversionmacros]
+gdk_gen_headers = [gdkenum_h, gdkmarshal_h, gdkconfig, gdkversionmacros_h, gdk_visibility_h]
gdk_deps = [
libm,
@@ -231,7 +224,8 @@ gdk_sources += [
gdk_enums,
gdk_marshalers,
gdkresources,
- gdkversionmacros,
+ gdkversionmacros_h,
+ gdk_visibility_h,
gdk_private_h_sources,
gdk_public_headers
]
diff --git a/gdk/version/gdkversionmacros.h.in b/gdk/version/gdkversionmacros.h.in
new file mode 100644
index 0000000000..37c9219071
--- /dev/null
+++ b/gdk/version/gdkversionmacros.h.in
@@ -0,0 +1,146 @@
+/* gdkversionmacros.h - version boundaries checks
+ * Copyright (C) 2012 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.▸ See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#if !defined (__GDK_H_INSIDE__) && !defined (__GTK_CSS_H_INSIDE__) && !defined (GTK_COMPILATION) && !defined (GTK_CSS_COMPILATION)
+#error "Only <gdk/gdk.h> can be included directly."
+#endif
+
+#pragma once
+
+#include <glib.h>
+
+/* These macros are used to mark deprecated symbols in GLib headers,
+ * and thus have to be exposed in installed headers. But please
+ * do *not* use them in other projects. Instead define your own wrappers
+ * around it.
+ */
+
+#if !defined(GDK_DISABLE_DEPRECATION_WARNINGS) && \
+ (G_GNUC_CHECK_VERSION(4, 6) || \
+ __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))
+#define _GDK_GNUC_DO_PRAGMA(x) _Pragma(G_STRINGIFY (x))
+#define GDK_DEPRECATED_MACRO _GDK_GNUC_DO_PRAGMA(GCC warning "Deprecated pre-processor symbol")
+#define GDK_DEPRECATED_MACRO_FOR(f) \
+ _GDK_GNUC_DO_PRAGMA(GCC warning G_STRINGIFY (Deprecated pre-processor symbol: replace with #f))
+#define GDK_UNAVAILABLE_MACRO(maj,min) \
+ _GDK_GNUC_DO_PRAGMA(GCC warning G_STRINGIFY (Not available before maj.min))
+#else
+#define GDK_DEPRECATED_MACRO
+#define GDK_DEPRECATED_MACRO_FOR(f)
+#define GDK_UNAVAILABLE_MACRO(maj,min)
+#endif
+
+#if !defined(GDK_DISABLE_DEPRECATION_WARNINGS) && \
+ (G_GNUC_CHECK_VERSION(6, 1) || \
+ (defined (__clang_major__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0))))
+#define GDK_DEPRECATED_ENUMERATOR G_DEPRECATED
+#define GDK_DEPRECATED_ENUMERATOR_FOR(f) G_DEPRECATED_FOR(f)
+#define GDK_UNAVAILABLE_ENUMERATOR(maj,min) G_UNAVAILABLE(maj,min)
+#else
+#define GDK_DEPRECATED_ENUMERATOR
+#define GDK_DEPRECATED_ENUMERATOR_FOR(f)
+#define GDK_UNAVAILABLE_ENUMERATOR(maj,min)
+#endif
+
+#if !defined(GDK_DISABLE_DEPRECATION_WARNINGS) && \
+ (G_GNUC_CHECK_VERSION(3, 1) || \
+ (defined (__clang_major__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0))))
+#define GDK_DEPRECATED_TYPE G_DEPRECATED
+#define GDK_DEPRECATED_TYPE_FOR(f) G_DEPRECATED_FOR(f)
+#define GDK_UNAVAILABLE_TYPE(maj,min) G_UNAVAILABLE(maj,min)
+#else
+#define GDK_DEPRECATED_TYPE
+#define GDK_DEPRECATED_TYPE_FOR(f)
+#define GDK_UNAVAILABLE_TYPE(maj,min)
+#endif
+
+@GDK_VERSIONS@
+
+/* evaluates to the current stable version; for development cycles,
+ * this means the next stable target, with a hard backstop to the
+ * beginning of the stable series
+ */
+#if GDK_MAJOR_VERSION >= 4 && (GDK_MINOR_VERSION % 2)
+# define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION + 1))
+#elif G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION) > GDK_VERSION_4_0
+# define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION))
+#else
+# define GDK_VERSION_CUR_STABLE GDK_VERSION_4_0
+#endif
+
+/* evaluates to the previous stable version, with a hard backstop
+ * to the beginning of the stable series
+ */
+#if GDK_MAJOR_VERSION >= 4 && (GDK_MINOR_VERSION % 2)
+# define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 1))
+#elif GDK_MAJOR_VERSION >= 4 && GDK_MINOR_VERSION > 2
+# define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 2))
+#else
+# define GDK_VERSION_PREV_STABLE GDK_VERSION_4_0
+#endif
+
+/**
+ * GDK_VERSION_MIN_REQUIRED:
+ *
+ * A macro that should be defined by the user prior to including
+ * the `gdk.h` header.
+ *
+ * The definition should be one of the predefined GDK version
+ * macros: %GDK_VERSION_4_0, %GDK_VERSION_4_2,...
+ *
+ * This macro defines the lower bound for the GDK API to use.
+ *
+ * If a function has been deprecated in a newer version of GDK,
+ * it is possible to use this symbol to avoid the compiler warnings
+ * without disabling warning for every deprecated function.
+ */
+#ifndef GDK_VERSION_MIN_REQUIRED
+# define GDK_VERSION_MIN_REQUIRED (GDK_VERSION_CUR_STABLE)
+#endif
+
+/**
+ * GDK_VERSION_MAX_ALLOWED:
+ *
+ * A macro that should be defined by the user prior to including
+ * the `gdk.h` header.
+ *
+ * The definition should be one of the predefined GDK version
+ * macros: %GDK_VERSION_4_0, %GDK_VERSION_4_2,...
+ *
+ * This macro defines the upper bound for the GDK API to use.
+ *
+ * If a function has been introduced in a newer version of GDK,
+ * it is possible to use this symbol to get compiler warnings when
+ * trying to use that function.
+ */
+#ifndef GDK_VERSION_MAX_ALLOWED
+# if GDK_VERSION_MIN_REQUIRED > GDK_VERSION_PREV_STABLE
+# define GDK_VERSION_MAX_ALLOWED GDK_VERSION_MIN_REQUIRED
+# else
+# define GDK_VERSION_MAX_ALLOWED GDK_VERSION_CUR_STABLE
+# endif
+#endif
+
+/* sanity checks */
+#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_MIN_REQUIRED
+# error "GDK_VERSION_MAX_ALLOWED must be >= GDK_VERSION_MIN_REQUIRED"
+#endif
+#if GDK_VERSION_MIN_REQUIRED < GDK_VERSION_4_0
+# error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_4_0"
+#endif
+
+#include <gdk/version/gdk-visibility.h>
diff --git a/gdk/version/meson.build b/gdk/version/meson.build
new file mode 100644
index 0000000000..19fac1a326
--- /dev/null
+++ b/gdk/version/meson.build
@@ -0,0 +1,21 @@
+
+
+gdkversionmacros_h = custom_target(
+ input: 'gdkversionmacros.h.in',
+ output: 'gdkversionmacros.h',
+ command: [gen_visibility_macros, meson.project_version(), 'versions-macros', '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: gtk_includedir / 'gtk-4.0/gdk/version',
+ # FIXME: Not needed with Meson >= 0.64.0
+ install_tag: 'devel',
+)
+
+gdk_visibility_h = custom_target(
+ output: 'gdk-visibility.h',
+ command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GDK', '@OUTPUT@'],
+ install: true,
+ install_dir: gtk_includedir / 'gtk-4.0/gdk/version',
+ # FIXME: Not needed with Meson >= 0.64.0
+ install_tag: 'devel',
+)
+
diff --git a/gtk/css/gtkcss.h b/gtk/css/gtkcss.h
index 6c4082e097..04c16a901d 100644
--- a/gtk/css/gtkcss.h
+++ b/gtk/css/gtkcss.h
@@ -27,7 +27,7 @@
#define __GTK_CSS_H_INSIDE__
#include <glib.h>
-#include <gdk/gdkversionmacros.h>
+#include <gdk/version/gdkversionmacros.h>
#include <gtk/css/gtkcssenums.h>
#include <gtk/css/gtkcssenumtypes.h>
diff --git a/gtk/css/gtkcssenums.h b/gtk/css/gtkcssenums.h
index f9584c5498..396a422a0d 100644
--- a/gtk/css/gtkcssenums.h
+++ b/gtk/css/gtkcssenums.h
@@ -29,7 +29,7 @@
#endif
#include <glib.h>
-#include <gdk/gdkversionmacros.h>
+#include <gdk/version/gdkversionmacros.h>
/**
* GtkCssParserError:
diff --git a/gtk/css/gtkcssenumtypes.h.template b/gtk/css/gtkcssenumtypes.h.template
index 53471b92c0..90b83748cc 100644
--- a/gtk/css/gtkcssenumtypes.h.template
+++ b/gtk/css/gtkcssenumtypes.h.template
@@ -7,7 +7,7 @@
#endif
#include <glib-object.h>
-#include <gdk/gdkversionmacros.h>
+#include <gdk/version/gdkversionmacros.h>
G_BEGIN_DECLS
/*** END file-header ***/
diff --git a/gtk/css/gtkcsserror.h b/gtk/css/gtkcsserror.h
index b77a3f4002..f2160f19c7 100644
--- a/gtk/css/gtkcsserror.h
+++ b/gtk/css/gtkcsserror.h
@@ -21,7 +21,7 @@
#pragma once
#include <glib.h>
-#include <gdk/gdkversionmacros.h>
+#include <gdk/version/gdkversionmacros.h>
G_BEGIN_DECLS
diff --git a/gtk/css/gtkcsssection.h b/gtk/css/gtkcsssection.h
index 782d44f5f3..163c032902 100644
--- a/gtk/css/gtkcsssection.h
+++ b/gtk/css/gtkcsssection.h
@@ -22,7 +22,7 @@
#endif
#include <gio/gio.h>
-#include <gdk/gdkversionmacros.h>
+#include <gdk/version/gdkversionmacros.h>
#include <gtk/css/gtkcsslocation.h>
G_BEGIN_DECLS
diff --git a/gtk/css/meson.build b/gtk/css/meson.build
index bf083f693e..9a5f6020b9 100644
--- a/gtk/css/meson.build
+++ b/gtk/css/meson.build
@@ -41,6 +41,8 @@ libgtk_css = static_library('gtk_css',
gtk_css_public_sources,
gtk_css_private_sources,
gtk_css_enums,
+ gdkversionmacros_h,
+ gdk_visibility_h,
],
dependencies: gtk_css_deps,
include_directories: [ confinc, ],
diff --git a/gtk/meson.build b/gtk/meson.build
index ec214f0d74..bf04d21095 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -1179,6 +1179,7 @@ libgtk = shared_library('gtk-4',
soversion: gtk_soversion,
version: gtk_library_version,
darwin_versions: darwin_versions,
+ gnu_symbol_visibility: 'hidden',
install: true,
)
diff --git a/meson.build b/meson.build
index d8829671ee..694befd883 100644
--- a/meson.build
+++ b/meson.build
@@ -344,13 +344,6 @@ common_cflags = cc.get_supported_arguments(test_cflags)
if get_option('default_library') != 'static'
if os_win32
cdata.set('DLL_EXPORT', true)
- cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern')
- if cc.get_id() != 'msvc'
- common_cflags += ['-fvisibility=hidden']
- endif
- else
- cdata.set('_GDK_EXTERN', '__attribute__((visibility("default"))) extern')
- common_cflags += ['-fvisibility=hidden']
endif
endif
@@ -735,6 +728,11 @@ int main () {
endif
endif
+if os_unix
+ cpdb_dep = dependency('cpdb-frontend', version : '>=2.0', required: get_option('print-cpdb'))
+ cups_dep = dependency('cups', version : '>=2.0', required: get_option('print-cups'))
+endif
+
# Introspection
gir = find_program('g-ir-scanner', required : get_option('introspection'))
@@ -747,14 +745,13 @@ build_gir = gir.found() and (get_option('introspection').enabled() or
project_build_root = meson.current_build_dir()
+gen_visibility_macros = find_program('build-aux/meson/gen-visibility-macros.py')
+
+subdir('gdk/version')
subdir('gtk/css')
subdir('gdk')
subdir('gsk')
subdir('gtk')
-if os_unix
- cpdb_dep = dependency('cpdb-frontend', version : '>=2.0', required: get_option('print-cpdb'))
- cups_dep = dependency('cups', version : '>=2.0', required: get_option('print-cups'))
-endif
subdir('modules')
if get_option('demos')
subdir('demos')
@@ -870,7 +867,7 @@ else
endif
if not meson.is_subproject()
- meson.add_dist_script('build-aux/meson/dist-data.py')
+ meson.add_dist_script('build-aux/meson/dist-data.py')
endif
if host_machine.system() != 'windows'
diff --git a/testsuite/a11y/meson.build b/testsuite/a11y/meson.build
index c43465efb2..733f623217 100644
--- a/testsuite/a11y/meson.build
+++ b/testsuite/a11y/meson.build
@@ -38,8 +38,7 @@ test_cargs = []
foreach flag: common_cflags
if flag not in ['-Werror=missing-prototypes', '-Wmissing-prototypes',
- '-Werror=missing-declarations', '-Wmissing-declarations',
- '-fvisibility=hidden']
+ '-Werror=missing-declarations', '-Wmissing-declarations']
test_cargs += flag
endif
endforeach
diff --git a/testsuite/css/meson.build b/testsuite/css/meson.build
index 24084d6b05..cf4f2f785d 100644
--- a/testsuite/css/meson.build
+++ b/testsuite/css/meson.build
@@ -28,7 +28,7 @@ test('api', test_api,
test_data = executable('data',
sources: ['data.c'],
- c_args: common_cflags,
+ c_args: common_cflags + ['-DGTK_COMPILATION'],
include_directories: [confinc, ],
dependencies: libgtk_static_dep,
)
@@ -42,7 +42,7 @@ test('data', test_data,
transition = executable('transition',
sources: ['transition.c'],
- c_args: common_cflags,
+ c_args: common_cflags + ['-DGTK_COMPILATION'],
dependencies: libgtk_static_dep,
)
diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build
index 05f0351393..13ed1ff31c 100644
--- a/testsuite/gdk/meson.build
+++ b/testsuite/gdk/meson.build
@@ -57,7 +57,7 @@ internal_tests = [
foreach t : internal_tests
test_exe = executable(t, '@0@.c'.format(t),
- c_args: common_cflags,
+ c_args: common_cflags + ['-DGTK_COMPILATION'],
dependencies: libgtk_static_dep,
install: false,
)
diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build
index a7bacb0020..7ef11174ae 100644
--- a/testsuite/gsk/meson.build
+++ b/testsuite/gsk/meson.build
@@ -397,7 +397,7 @@ foreach t : internal_tests
test_exe = executable(test_name,
sources: test_srcs,
dependencies : libgtk_static_dep,
- c_args : test_cargs + test_extra_cargs + common_cflags,
+ c_args : test_cargs + test_extra_cargs + common_cflags + ['-DGTK_COMPILATION'],
link_args : test_extra_ldflags,
)
diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build
index a3f2be7172..7f28f213ec 100644
--- a/testsuite/gtk/meson.build
+++ b/testsuite/gtk/meson.build
@@ -149,8 +149,7 @@ endif
foreach flag: common_cflags
if flag not in ['-Werror=missing-prototypes', '-Wmissing-prototypes',
- '-Werror=missing-declarations', '-Wmissing-declarations',
- '-fvisibility=hidden']
+ '-Werror=missing-declarations', '-Wmissing-declarations']
test_cargs += flag
endif
endforeach
@@ -193,7 +192,7 @@ foreach t : internal_tests
test_exe = executable(test_name,
sources: test_srcs,
- c_args: test_cargs + test_extra_cargs,
+ c_args: test_cargs + test_extra_cargs + ['-DGTK_COMPILATION'],
link_args: test_extra_ldflags,
dependencies: libgtk_static_dep,
)
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 1cc8a4302c..793ba19eb7 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -3,8 +3,7 @@
reftest_cflags = []
foreach flag: common_cflags
if flag not in ['-Werror=missing-prototypes', '-Wmissing-prototypes',
- '-Werror=missing-declarations', '-Wmissing-declarations',
- '-fvisibility=hidden']
+ '-Werror=missing-declarations', '-Wmissing-declarations']
reftest_cflags += flag
endif
endforeach