[gdk-pixbuf] animation: Remove load_animation vfuncs from GDIP and ANI loaders



commit 735fc79582a27efb53ea34ae78cc1e4afdbab547
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jan 30 02:44:40 2013 +0100

    animation: Remove load_animation vfuncs from GDIP and ANI loaders
    
    They just did what load_animation does by default now.

 gdk-pixbuf/io-ani.c        |   45 ------------------------------------
 gdk-pixbuf/io-gdip-utils.c |   54 --------------------------------------------
 2 files changed, 0 insertions(+), 99 deletions(-)
---
diff --git a/gdk-pixbuf/io-ani.c b/gdk-pixbuf/io-ani.c
index c8a3ee8..6e72948 100644
--- a/gdk-pixbuf/io-ani.c
+++ b/gdk-pixbuf/io-ani.c
@@ -627,50 +627,6 @@ gdk_pixbuf__ani_image_stop_load (gpointer data,
         return TRUE;
 }
 
-static void
-prepared_notify (GdkPixbuf *pixbuf, 
-		 GdkPixbufAnimation *anim, 
-		 gpointer user_data)
-{
-	if (anim != NULL)
-		g_object_ref (anim);
-	*((GdkPixbufAnimation **)user_data) = anim;
-}
-
-static GdkPixbufAnimation *
-gdk_pixbuf__ani_image_load_animation (FILE *f, GError **error)
-{
-	guchar buffer[4096];
-	size_t length;
-	GdkPixbufAnimation *anim = NULL;
-	gpointer context;
-
-	context = gdk_pixbuf__ani_image_begin_load (NULL, prepared_notify, 
-						    NULL, &anim, error);
-	
-	if (!context)
-                return NULL;
-	
-	while (!feof (f) && !ferror (f)) {
-		length = fread (buffer, 1, sizeof (buffer), f);
-		if (length > 0)
-			if (!gdk_pixbuf__ani_image_load_increment (context, buffer, length, error)) {
-				gdk_pixbuf__ani_image_stop_load (context, NULL);
-				if (anim != NULL)
-					g_object_unref (anim);
-				return NULL;
-			}
-	}
-
-	if (!gdk_pixbuf__ani_image_stop_load (context, error)) {
-		if (anim != NULL)
-			g_object_unref (anim);
-		return NULL;
-	}
-	
-	return anim;
-}
-
 #ifndef INCLUDE_ani
 #define MODULE_ENTRY(function) G_MODULE_EXPORT void function
 #else
@@ -679,7 +635,6 @@ gdk_pixbuf__ani_image_load_animation (FILE *f, GError **error)
 
 MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module)
 {
-        module->load_animation = gdk_pixbuf__ani_image_load_animation;
         module->begin_load = gdk_pixbuf__ani_image_begin_load;
         module->stop_load = gdk_pixbuf__ani_image_stop_load;
         module->load_increment = gdk_pixbuf__ani_image_load_increment;
diff --git a/gdk-pixbuf/io-gdip-utils.c b/gdk-pixbuf/io-gdip-utils.c
index a8dcf53..86c95d7 100644
--- a/gdk-pixbuf/io-gdip-utils.c
+++ b/gdk-pixbuf/io-gdip-utils.c
@@ -819,56 +819,6 @@ gdk_pixbuf__gdip_image_stop_vector_load (gpointer data, GError **error)
   return stop_load (bitmap, context, error);
 }
 
-static void 
-gdip_animation_prepare (GdkPixbuf *pixbuf,
-                        GdkPixbufAnimation *animation,
-                        gpointer user_data)
-{
-  GdkPixbufAnimation **anim;
-
-  anim = (GdkPixbufAnimation **)user_data;
-
-  /* save a reference to the animation */
-  g_object_ref (animation);
-  *anim = animation;
-}
-
-static GdkPixbufAnimation *
-gdk_pixbuf__gdip_image_load_animation (FILE *file,
-                                       GError **error)
-{
-  GdkPixbufAnimation *animation = NULL;
-
-  gpointer context;
-  char buffer[LOAD_BUFFER_SIZE];
-  size_t length;
-
-  context = gdk_pixbuf__gdip_image_begin_load (NULL, gdip_animation_prepare, NULL, &animation, error);
-
-  while (!feof (file) && !ferror (file)) {
-    length = fread (buffer, 1, sizeof (buffer), file);
-    if (length > 0) {
-      if (!gdk_pixbuf__gdip_image_load_increment (context, buffer, length, error)) {
-        gdk_pixbuf__gdip_image_stop_load (context, NULL);
-
-        if (animation)
-          g_object_unref (animation);
-
-        return NULL;
-      }
-    }
-  }
-
-  if (!gdk_pixbuf__gdip_image_stop_load(context, error)) {
-    if (animation)
-      g_object_unref (animation);
-    
-    return NULL;
-  }
-
-  return animation;
-}
-
 gboolean
 gdip_save_to_file_callback (const gchar *buf,
                             gsize        count,
@@ -899,10 +849,6 @@ gdip_fill_vtable (GdkPixbufModule *module)
     module->begin_load     = gdk_pixbuf__gdip_image_begin_load;
     module->stop_load      = gdk_pixbuf__gdip_image_stop_load;
     module->load_increment = gdk_pixbuf__gdip_image_load_increment;
-    
-    /* this is the only way to get gtk_image_new_from_file() to load animations. it regrettably
-       does not use the GdkPixbufLoader interface. */
-    module->load_animation = gdk_pixbuf__gdip_image_load_animation;
   }
 }
 



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