diff options
-rw-r--r-- | gdk-pixbuf/ChangeLog | 7 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-core.h | 6 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-io.c | 77 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf.symbols | 10 |
4 files changed, 97 insertions, 3 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 883c7414f..c4de18aae 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,10 @@ +2005-03-10 Tor Lillqvist <tml@novell.com> + + * gdk-pixbuf-core.h + * gdk-pixbuf-io.c + * gdk-pixbuf.symbols: Implement DLL ABI stablility for + gdk_pixbuf_save() and gdk_pixbuf_savev(). (#167973) + 2005-03-09 Matthias Clasen <mclasen@redhat.com> * io-gif-animation.c (gdk_pixbuf_gif_anim_frame_composite): Fix diff --git a/gdk-pixbuf/gdk-pixbuf-core.h b/gdk-pixbuf/gdk-pixbuf-core.h index 3aeb40d98..f7abfd0c7 100644 --- a/gdk-pixbuf/gdk-pixbuf-core.h +++ b/gdk-pixbuf/gdk-pixbuf-core.h @@ -156,6 +156,12 @@ void gdk_pixbuf_fill (GdkPixbuf *pixbuf, /* Saving */ +#ifdef G_OS_WIN32 +/* DLL ABI stability hack. */ +#define gdk_pixbuf_save gdk_pixbuf_save_utf8 +#define gdk_pixbuf_savev gdk_pixbuf_savev_utf8 +#endif + gboolean gdk_pixbuf_save (GdkPixbuf *pixbuf, const char *filename, const char *type, diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index 28ccaec7b..dbe455b49 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -1599,6 +1599,50 @@ gdk_pixbuf_save (GdkPixbuf *pixbuf, return result; } +#ifdef G_OS_WIN32 + +#undef gdk_pixbuf_save + +gboolean +gdk_pixbuf_save (GdkPixbuf *pixbuf, + const char *filename, + const char *type, + GError **error, + ...) +{ + char *utf8_filename; + gchar **keys = NULL; + gchar **values = NULL; + va_list args; + gboolean result; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, error); + + if (utf8_filename == NULL) + return FALSE; + + va_start (args, error); + + collect_save_options (args, &keys, &values); + + va_end (args); + + result = gdk_pixbuf_savev_utf8 (pixbuf, utf8_filename, type, + keys, values, + error); + + g_free (utf8_filename); + + g_strfreev (keys); + g_strfreev (values); + + return result; +} + +#endif + /** * gdk_pixbuf_savev: * @pixbuf: a #GdkPixbuf. @@ -1625,7 +1669,6 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf, { FILE *f = NULL; gboolean result; - g_return_val_if_fail (filename != NULL, FALSE); g_return_val_if_fail (type != NULL, FALSE); @@ -1672,6 +1715,38 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf, return TRUE; } +#ifdef G_OS_WIN32 + +#undef gdk_pixbuf_savev + +gboolean +gdk_pixbuf_savev (GdkPixbuf *pixbuf, + const char *filename, + const char *type, + char **option_keys, + char **option_values, + GError **error) +{ + char *utf8_filename; + gboolean retval; + + g_return_val_if_fail (filename != NULL, FALSE); + + utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, error); + + if (utf8_filename == NULL) + return FALSE; + + retval = gdk_pixbuf_savev_utf8 (pixbuf, utf8_filename, type, + option_keys, option_values, error); + + g_free (utf8_filename); + + return retval; +} + +#endif + /** * gdk_pixbuf_save_to_callback: * @pixbuf: a #GdkPixbuf. diff --git a/gdk-pixbuf/gdk-pixbuf.symbols b/gdk-pixbuf/gdk-pixbuf.symbols index 3210a4c7d..18cf21d22 100644 --- a/gdk-pixbuf/gdk-pixbuf.symbols +++ b/gdk-pixbuf/gdk-pixbuf.symbols @@ -82,12 +82,18 @@ gdk_pixbuf_ref gdk_pixbuf_rotate_simple gdk_pixbuf_rotation_get_type G_GNUC_CONST gdk_pixbuf_saturate_and_pixelate -gdk_pixbuf_save G_GNUC_NULL_TERMINATED +gdk_pixbuf_save PRIVATE G_GNUC_NULL_TERMINATED +#ifdef G_OS_WIN32 +gdk_pixbuf_save_utf8 +#endif gdk_pixbuf_save_to_buffer G_GNUC_NULL_TERMINATED gdk_pixbuf_save_to_bufferv gdk_pixbuf_save_to_callback G_GNUC_NULL_TERMINATED gdk_pixbuf_save_to_callbackv -gdk_pixbuf_savev +gdk_pixbuf_savev PRIVATE +#ifdef G_OS_WIN32 +gdk_pixbuf_savev_utf8 +#endif gdk_pixbuf_scale gdk_pixbuf_scale_simple gdk_pixbuf_set_option |