Commit fa8c06aa authored by Christian Persch's avatar Christian Persch

Switch to attribute-based deprecations

Instead of hiding the definitions when RSVG_DISABLE_DEPRECATED is defined,
use G_DEPRECATED[_FOR] via a wrapper RSVG_DEPRECATED[_FOR].

To disable the deprecation warnings, define RSVG_DISABLE_DEPRECATION_WARNINGS.
parent 5e351aa7
......@@ -84,6 +84,7 @@ librsvg_@RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = \
-I$(top_builddir) \
-DG_LOG_DOMAIN=\"librsvg\" \
-DLIBRSVG_DATADIR="\"$(datadir)\"" \
-DRSVG_DISABLE_DEPRECATION_WARNINGS \
$(AM_CPPFLAGS)
librsvg_@RSVG_API_MAJOR_VERSION@_la_CFLAGS = \
......
......@@ -33,6 +33,14 @@
G_BEGIN_DECLS
#if defined(RSVG_DISABLE_DEPRECATION_WARNINGS) || !GLIB_CHECK_VERSION (2, 31, 0)
#define RSVG_DEPRECATED
#define RSVG_DEPRECATED_FOR(f)
#else
#define RSVG_DEPRECATED G_DEPRECATED
#define RSVG_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
#endif
#define RSVG_TYPE_HANDLE (rsvg_handle_get_type ())
#define RSVG_HANDLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RSVG_TYPE_HANDLE, RsvgHandle))
#define RSVG_HANDLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RSVG_TYPE_HANDLE, RsvgHandleClass))
......@@ -173,8 +181,9 @@ const char *rsvg_handle_get_metadata (RsvgHandle * handle);
RsvgHandle *rsvg_handle_new_from_data (const guint8 * data, gsize data_len, GError ** error);
RsvgHandle *rsvg_handle_new_from_file (const gchar * file_name, GError ** error);
#ifndef RSVG_DISABLE_DEPRECATED
/* BEGIN deprecated APIs. Do not use! */
RSVG_DEPRECATED_FOR(g_object_unref)
void rsvg_handle_free (RsvgHandle * handle);
/**
......@@ -190,26 +199,33 @@ void rsvg_handle_free (RsvgHandle * handle);
*
* Deprecated: Set up a cairo matrix and use rsvg_handle_render_cairo() instead.
*/
typedef void (*RsvgSizeFunc) (gint * width, gint * height, gpointer user_data);
typedef RSVG_DEPRECATED void (*RsvgSizeFunc) (gint * width, gint * height, gpointer user_data);
RSVG_DEPRECATED
void rsvg_handle_set_size_callback (RsvgHandle * handle,
RsvgSizeFunc size_func,
gpointer user_data, GDestroyNotify user_data_destroy);
/* GdkPixbuf convenience API */
RSVG_DEPRECATED
GdkPixbuf *rsvg_pixbuf_from_file (const gchar * file_name, GError ** error);
RSVG_DEPRECATED
GdkPixbuf *rsvg_pixbuf_from_file_at_zoom (const gchar * file_name,
double x_zoom, double y_zoom, GError ** error);
RSVG_DEPRECATED
GdkPixbuf *rsvg_pixbuf_from_file_at_size (const gchar * file_name, gint width, gint height,
GError ** error);
RSVG_DEPRECATED
GdkPixbuf *rsvg_pixbuf_from_file_at_max_size (const gchar * file_name,
gint max_width, gint max_height, GError ** error);
RSVG_DEPRECATED
GdkPixbuf *rsvg_pixbuf_from_file_at_zoom_with_max (const gchar * file_name,
double x_zoom,
double y_zoom,
gint max_width, gint max_height, GError ** error);
#endif /* RSVG_DISABLE_DEPRECATED */
/* END deprecated APIs. */
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment