[gucharmap] Use attributes for deprecation



commit de2b34fe7853e6d872f5d2bd59ce3d1bccca5f80
Author: Christian Persch <chpe gnome org>
Date:   Sat Dec 10 20:48:59 2011 +0100

    Use attributes for deprecation

 gucharmap/gucharmap-charmap.c                |    3 +--
 gucharmap/gucharmap-charmap.h                |   18 ++++++++++++------
 gucharmap/gucharmap-type-builtins.c.template |    1 +
 gucharmap/gucharmap.h.in                     |   12 ++++++++++++
 4 files changed, 26 insertions(+), 8 deletions(-)
---
diff --git a/gucharmap/gucharmap-charmap.c b/gucharmap/gucharmap-charmap.c
index 6aa7a06..90d6f4d 100644
--- a/gucharmap/gucharmap-charmap.c
+++ b/gucharmap/gucharmap-charmap.c
@@ -24,8 +24,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "gucharmap-charmap.h"
-#include "gucharmap-unicode-info.h"
+#include "gucharmap.h"
 #include "gucharmap-marshal.h"
 #include "gucharmap-private.h"
 
diff --git a/gucharmap/gucharmap-charmap.h b/gucharmap/gucharmap-charmap.h
index 31f783c..1f161ea 100644
--- a/gucharmap/gucharmap-charmap.h
+++ b/gucharmap/gucharmap-charmap.h
@@ -68,12 +68,6 @@ GType                 gucharmap_charmap_get_type           (void);
 
 GtkWidget *           gucharmap_charmap_new                (void);
 
-#ifndef GUCHARMAP_DISABLE_DEPRECATED
-void           gucharmap_charmap_set_orientation (GucharmapCharmap *charmap,
-                                                  GtkOrientation orientation);
-GtkOrientation gucharmap_charmap_get_orientation (GucharmapCharmap *charmap);
-#endif
-
 void      gucharmap_charmap_set_active_character (GucharmapCharmap *charmap,
                                                   gunichar           uc);
 gunichar  gucharmap_charmap_get_active_character (GucharmapCharmap *charmap);
@@ -134,6 +128,18 @@ gboolean gucharmap_charmap_get_snap_pow2 (GucharmapCharmap *charmap);
 /* private; FIXMEchpe remove */
 GucharmapChartable *     gucharmap_charmap_get_chartable      (GucharmapCharmap  *charmap);
 
+/* Hide deprecated stuff from GI */
+
+#ifndef __GI_SCANNER__
+
+GUCHARMAP_DEPRECATED_FOR(gtk_orientable_set_orientation)
+void           gucharmap_charmap_set_orientation (GucharmapCharmap *charmap,
+                                                  GtkOrientation orientation);
+GUCHARMAP_DEPRECATED_FOR(gtk_orientable_get_orientation)
+GtkOrientation gucharmap_charmap_get_orientation (GucharmapCharmap *charmap);
+
+#endif /* !__GI_SCANNER__ */
+
 G_END_DECLS
 
 #endif  /* #ifndef GUCHARMAP_CHARMAP_H */
diff --git a/gucharmap/gucharmap-type-builtins.c.template b/gucharmap/gucharmap-type-builtins.c.template
index fbe9166..1ba59ef 100644
--- a/gucharmap/gucharmap-type-builtins.c.template
+++ b/gucharmap/gucharmap-type-builtins.c.template
@@ -1,6 +1,7 @@
 /*** BEGIN file-header ***/
 #include <config.h>
 
+#include "gucharmap.h"
 #include "gucharmap-type-builtins.h"
 
 /*** END file-header ***/
diff --git a/gucharmap/gucharmap.h.in b/gucharmap/gucharmap.h.in
index cc3755f..051df4f 100644
--- a/gucharmap/gucharmap.h.in
+++ b/gucharmap/gucharmap.h.in
@@ -22,6 +22,16 @@
 
 #define __GUCHARMAP_GUCHARMAP_H_INSIDE__
 
+#include <glib.h>
+
+#if defined(GUCHARMAP_DISABLE_DEPRECATION_WARNINGS) || !GLIB_CHECK_VERSION (2, 31, 0)
+#define GUCHARMAP_DEPRECATED
+#define GUCHARMAP_DEPRECATED_FOR(f)
+#else
+#define GUCHARMAP_DEPRECATED G_DEPRECATED
+#define GUCHARMAP_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
+#endif
+
 #define GUCHARMAP_VERSION_MAJOR (@GUCHARMAP_VERSION_MAJOR@)
 #define GUCHARMAP_VERSION_MINOR (@GUCHARMAP_VERSION_MINOR@)
 #define GUCHARMAP_VERSION_MICRO (@GUCHARMAP_VERSION_MICRO@)
@@ -46,6 +56,8 @@
 
 #include <gucharmap/gucharmap-unicode-info.h>
 
+#undef GUCHARMAP_DEPRECATED
+#undef GUCHARMAP_DEPRECATED_FOR
 #undef __GUCHARMAP_GUCHARMAP_H_INSIDE__
 
 #endif /* #ifndef GUCHARMAP_H */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]