summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Nemerson <evan@coeus-group.com>2012-06-10 18:17:58 -0700
committerEvan Nemerson <evan@coeus-group.com>2012-06-12 19:57:57 -0700
commit3b8adaa7e780b85695306292dfb23107d219bb34 (patch)
tree72952972ffe9f8d5ee2f5dcf87b7ba9dff3e63ff
parenta4a7c412f46d9cd11bb5884840a592fb2df0db0c (diff)
downloadlibrsvg-3b8adaa7e780b85695306292dfb23107d219bb34.tar.gz
Deprecate including headers other than rsvg.h
-rw-r--r--Makefile.am7
-rw-r--r--librsvg-features.c2
-rw-r--r--librsvg-features.h.in4
-rw-r--r--rsvg-cairo.h4
-rw-r--r--rsvg-convert.c1
-rw-r--r--rsvg-gobject.c2
-rw-r--r--rsvg.h8
-rw-r--r--test-display.c1
-rw-r--r--tools/rsvg-tools-main.c1
9 files changed, 22 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am
index 1adb278b..2f7ae36e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -84,6 +84,7 @@ librsvg_@RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = \
$(AM_CPPFLAGS)
librsvg_@RSVG_API_MAJOR_VERSION@_la_CFLAGS = \
+ -DRSVG_COMPILATION \
$(LIBRSVG_CFLAGS) \
$(AM_CFLAGS)
@@ -183,7 +184,7 @@ librsvg-enum-types.h: s-enum-types-h
s-enum-types-h: $(headers) Makefile
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \
- --fhead "#ifndef __LIBRSVG_ENUM_TYPES_H__\n#define __LIBRSVG_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
+ --fhead "#if !defined (__RSVG_RSVG_H_INSIDE__) && !defined (RSVG_COMPILATION)\n#warning \"Including <librsvg/librsvg-enum-types.h> directly is deprecated.\"\n#endif\n\n#ifndef __LIBRSVG_ENUM_TYPES_H__\n#define __LIBRSVG_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--fprod "/* enumerations from \"@filename@\" */\n" \
--vhead "GType @enum_name@_get_type (void);\n#define RSVG_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
--ftail "G_END_DECLS\n\n#endif /* __LIBRSVG_ENUM_TYPES_H__ */" \
@@ -197,7 +198,7 @@ librsvg-enum-types.c: s-enum-types-c librsvg-enum-types.h
s-enum-types-c: $(headers) Makefile
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \
- --fhead "#include \"librsvg-enum-types.h\"\n#include \"rsvg.h\"" \
+ --fhead "#include \"rsvg.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
@@ -235,7 +236,7 @@ Rsvg_@RSVG_API_VERSION_U@_gir_PACKAGES = \
pango \
libxml-2.0 \
$(NULL)
-Rsvg_@RSVG_API_VERSION_U@_gir_CFLAGS = -I$(top_builddir)
+Rsvg_@RSVG_API_VERSION_U@_gir_CFLAGS = -I$(top_builddir) -DRSVG_COMPILATION
Rsvg_@RSVG_API_VERSION_U@_gir_LIBS = librsvg-@RSVG_API_MAJOR_VERSION@.la
girdir = $(datadir)/gir-1.0
diff --git a/librsvg-features.c b/librsvg-features.c
index 621d4f09..367ccbdb 100644
--- a/librsvg-features.c
+++ b/librsvg-features.c
@@ -1,4 +1,4 @@
-#include "librsvg-features.h"
+#include "rsvg.h"
/* General initialization hooks */
const unsigned int librsvg_major_version = LIBRSVG_MAJOR_VERSION,
diff --git a/librsvg-features.h.in b/librsvg-features.h.in
index c0d3332a..53ea0ac1 100644
--- a/librsvg-features.h.in
+++ b/librsvg-features.h.in
@@ -1,3 +1,7 @@
+#if !defined (__RSVG_RSVG_H_INSIDE__) && !defined (RSVG_COMPILATION)
+#warning "Including <librsvg/librsvg-features.h> directly is deprecated."
+#endif
+
#ifndef LIBRSVG_FEATURES_H
#define LIBRSVG_FEATURES_H 1
diff --git a/rsvg-cairo.h b/rsvg-cairo.h
index 45f4d62c..d9ebfb2b 100644
--- a/rsvg-cairo.h
+++ b/rsvg-cairo.h
@@ -23,6 +23,10 @@
Author: Carl Worth <cworth@cworth.org>
*/
+#if !defined (__RSVG_RSVG_H_INSIDE__) && !defined (RSVG_COMPILATION)
+#warning "Including <librsvg/rsvg-cairo.h> directly is deprecated."
+#endif
+
#ifndef RSVG_CAIRO_H
#define RSVG_CAIRO_H
diff --git a/rsvg-convert.c b/rsvg-convert.c
index f26fd875..0f43cb78 100644
--- a/rsvg-convert.c
+++ b/rsvg-convert.c
@@ -37,7 +37,6 @@
#include "rsvg-css.h"
#include "rsvg.h"
-#include "rsvg-cairo.h"
#include "rsvg-private.h"
#include "rsvg-size-callback.h"
diff --git a/rsvg-gobject.c b/rsvg-gobject.c
index 3f052215..48ad928c 100644
--- a/rsvg-gobject.c
+++ b/rsvg-gobject.c
@@ -39,7 +39,7 @@
#include "rsvg-private.h"
#include "rsvg-defs.h"
-#include "librsvg-enum-types.h"
+#include "rsvg.h"
enum {
PROP_0,
diff --git a/rsvg.h b/rsvg.h
index 8c993113..c8968db1 100644
--- a/rsvg.h
+++ b/rsvg.h
@@ -26,6 +26,8 @@
#ifndef RSVG_H
#define RSVG_H
+#define __RSVG_RSVG_H_INSIDE__
+
#include <glib-object.h>
#include <gio/gio.h>
@@ -238,4 +240,10 @@ const char *rsvg_handle_get_metadata (RsvgHandle * handle);
G_END_DECLS
+#include "librsvg-enum-types.h"
+#include "librsvg-features.h"
+#include "rsvg-cairo.h"
+
+#undef __RSVG_RSVG_H_INSIDE__
+
#endif /* RSVG_H */
diff --git a/test-display.c b/test-display.c
index 42fad379..78d06ef9 100644
--- a/test-display.c
+++ b/test-display.c
@@ -19,7 +19,6 @@
#include "config.h"
#include "rsvg.h"
-#include "rsvg-cairo.h"
#include "rsvg-private.h"
#include "rsvg-size-callback.h"
diff --git a/tools/rsvg-tools-main.c b/tools/rsvg-tools-main.c
index 132db3a3..4f864b52 100644
--- a/tools/rsvg-tools-main.c
+++ b/tools/rsvg-tools-main.c
@@ -30,7 +30,6 @@
#include <stdlib.h>
#include "rsvg.h"
-#include "rsvg-cairo.h"
#include "rsvg-private.h"
#include "rsvg-tools-main.h"