[gdk-pixbuf] loaders: Make the names of prepared_func and updated_func consistent



commit 3a445ad9b0b1f8e89e384cba2b7b618dd3a0f6dc
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Sep 11 09:56:31 2019 -0500

    loaders: Make the names of prepared_func and updated_func consistent
    
    They were prepare_func/prepared_func, and update_func/updated_func in
    various places.
    
    Since their corresponding type names are GdkPixbufModulePreparedFunc
    and GdkPixbufModuleUpdatedFunc, make all the fields be called
    prepared_func and updated_func to make them easier to grep.

 gdk-pixbuf/gdk-pixbuf-io.h |  4 +--
 gdk-pixbuf/io-gif.c        | 38 ++++++++++++++--------------
 gdk-pixbuf/io-png.c        | 62 +++++++++++++++++++++++-----------------------
 gdk-pixbuf/io-qtif.c       | 28 ++++++++++-----------
 gdk-pixbuf/io-tiff.c       | 20 +++++++--------
 gdk-pixbuf/io-xbm.c        | 20 +++++++--------
 gdk-pixbuf/io-xpm.c        | 30 +++++++++++-----------
 7 files changed, 101 insertions(+), 101 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf-io.h b/gdk-pixbuf/gdk-pixbuf-io.h
index 66074bc69..89b0830e1 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.h
+++ b/gdk-pixbuf/gdk-pixbuf-io.h
@@ -250,8 +250,8 @@ struct _GdkPixbufModule {
         /* Incremental loading */
 
         gpointer (* begin_load)     (GdkPixbufModuleSizeFunc size_func,
-                                     GdkPixbufModulePreparedFunc prepare_func,
-                                     GdkPixbufModuleUpdatedFunc update_func,
+                                     GdkPixbufModulePreparedFunc prepared_func,
+                                     GdkPixbufModuleUpdatedFunc updated_func,
                                      gpointer user_data,
                                      GError **error);
         gboolean (* stop_load)      (gpointer context,
diff --git a/gdk-pixbuf/io-gif.c b/gdk-pixbuf/io-gif.c
index 8ba67b9cb..38ec03d7b 100644
--- a/gdk-pixbuf/io-gif.c
+++ b/gdk-pixbuf/io-gif.c
@@ -134,8 +134,8 @@ struct _GifContext
 
        /* progressive read, only. */
        GdkPixbufModuleSizeFunc size_func;
-       GdkPixbufModulePreparedFunc prepare_func;
-       GdkPixbufModuleUpdatedFunc update_func;
+       GdkPixbufModulePreparedFunc prepared_func;
+       GdkPixbufModuleUpdatedFunc updated_func;
        gpointer user_data;
         guchar *buf;
        gsize ptr;
@@ -505,9 +505,9 @@ gif_get_lzw (GifContext *context)
                if (context->animation->frames->next == NULL) {
                        GdkPixbuf *pixbuf = gdk_pixbuf_animation_get_static_image (GDK_PIXBUF_ANIMATION 
(context->animation));
                        if (pixbuf != NULL)
-                               (* context->prepare_func) (pixbuf,
-                                                           GDK_PIXBUF_ANIMATION (context->animation),
-                                                           context->user_data);
+                               (* context->prepared_func) (pixbuf,
+                                                            GDK_PIXBUF_ANIMATION (context->animation),
+                                                            context->user_data);
                }
         }
 
@@ -521,9 +521,9 @@ gif_get_lzw (GifContext *context)
                if ((retval != 0 || empty_block) && context->animation->frames->next == NULL) {
                        GdkPixbuf *pixbuf = gdk_pixbuf_animation_get_static_image (GDK_PIXBUF_ANIMATION 
(context->animation));
                        if (pixbuf)
-                               (* context->update_func) (pixbuf,
-                                                          0, 0, context->frame->width, 
context->frame->height,
-                                                          context->user_data);
+                               (* context->updated_func) (pixbuf,
+                                                           0, 0, context->frame->width, 
context->frame->height,
+                                                           context->user_data);
                }
 
                if (retval != 0)
@@ -832,15 +832,15 @@ gif_main_loop (GifContext *context)
 
 static GifContext *
 new_context (GdkPixbufModuleSizeFunc size_func,
-             GdkPixbufModulePreparedFunc prepare_func,
-             GdkPixbufModuleUpdatedFunc update_func,
+             GdkPixbufModulePreparedFunc prepared_func,
+             GdkPixbufModuleUpdatedFunc updated_func,
              gpointer user_data)
 {
        GifContext *context;
 
         g_assert (size_func != NULL);
-        g_assert (prepare_func != NULL);
-        g_assert (update_func != NULL);
+        g_assert (prepared_func != NULL);
+        g_assert (updated_func != NULL);
 
        context = g_try_malloc (sizeof (GifContext));
         if (context == NULL)
@@ -853,8 +853,8 @@ new_context (GdkPixbufModuleSizeFunc size_func,
        context->file = NULL;
        context->state = GIF_START;
        context->size_func = size_func;
-       context->prepare_func = prepare_func;
-       context->update_func = update_func;
+       context->prepared_func = prepared_func;
+       context->updated_func = updated_func;
        context->user_data = user_data;
        context->buf = NULL;
        context->amount_needed = 13;
@@ -951,21 +951,21 @@ out:
 
 static gpointer
 gdk_pixbuf__gif_image_begin_load (GdkPixbufModuleSizeFunc size_func,
-                                  GdkPixbufModulePreparedFunc prepare_func,
-                                 GdkPixbufModuleUpdatedFunc update_func,
+                                  GdkPixbufModulePreparedFunc prepared_func,
+                                 GdkPixbufModuleUpdatedFunc updated_func,
                                  gpointer user_data,
                                   GError **error)
 {
        GifContext *context;
 
         g_assert (size_func != NULL);
-        g_assert (prepare_func != NULL);
-        g_assert (update_func != NULL);
+        g_assert (prepared_func != NULL);
+        g_assert (updated_func != NULL);
 
 #ifdef IO_GIFDEBUG
        count = 0;
 #endif
-       context = new_context (size_func, prepare_func, update_func, user_data);
+       context = new_context (size_func, prepared_func, updated_func, user_data);
 
         if (context == NULL) {
                 g_set_error_literal (error,
diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c
index 4e99536bf..3778f3469 100644
--- a/gdk-pixbuf/io-png.c
+++ b/gdk-pixbuf/io-png.c
@@ -413,8 +413,8 @@ struct _LoadContext {
         png_infop   png_info_ptr;
 
         GdkPixbufModuleSizeFunc size_func;
-        GdkPixbufModulePreparedFunc prepare_func;
-        GdkPixbufModuleUpdatedFunc update_func;
+        GdkPixbufModulePreparedFunc prepared_func;
+        GdkPixbufModuleUpdatedFunc updated_func;
         gpointer notify_user_data;
 
         GdkPixbuf* pixbuf;
@@ -442,24 +442,24 @@ struct _LoadContext {
 
 static gpointer
 gdk_pixbuf__png_image_begin_load (GdkPixbufModuleSizeFunc size_func,
-                                  GdkPixbufModulePreparedFunc prepare_func,
-                                 GdkPixbufModuleUpdatedFunc update_func,
+                                  GdkPixbufModulePreparedFunc prepared_func,
+                                 GdkPixbufModuleUpdatedFunc updated_func,
                                  gpointer user_data,
                                   GError **error)
 {
         LoadContext* lc;
         
         g_assert (size_func != NULL);
-        g_assert (prepare_func != NULL);
-        g_assert (update_func != NULL);
+        g_assert (prepared_func != NULL);
+        g_assert (updated_func != NULL);
 
         lc = g_new0(LoadContext, 1);
         
         lc->fatal_error_occurred = FALSE;
 
         lc->size_func = size_func;
-        lc->prepare_func = prepare_func;
-        lc->update_func = update_func;
+        lc->prepared_func = prepared_func;
+        lc->updated_func = updated_func;
         lc->notify_user_data = user_data;
 
         lc->first_row_seen_in_chunk = -1;
@@ -610,38 +610,38 @@ gdk_pixbuf__png_image_load_increment(gpointer context,
                         
                         if (pass_diff == 0) {
                                 /* start and end row were in the same pass */
-                                (lc->update_func)(lc->pixbuf, 0,
-                                                  lc->first_row_seen_in_chunk,
-                                                  width,
-                                                  (lc->last_row_seen_in_chunk -
-                                                   lc->first_row_seen_in_chunk) + 1,
-                                                 lc->notify_user_data);
+                                (lc->updated_func)(lc->pixbuf, 0,
+                                                   lc->first_row_seen_in_chunk,
+                                                   width,
+                                                   (lc->last_row_seen_in_chunk -
+                                                    lc->first_row_seen_in_chunk) + 1,
+                                                   lc->notify_user_data);
                         } else if (pass_diff == 1) {
                                 /* We have from the first row seen to
                                    the end of the image (max row
                                    seen), then from the top of the
                                    image to the last row seen */
                                 /* first row to end */
-                                (lc->update_func)(lc->pixbuf, 0,
-                                                  lc->first_row_seen_in_chunk,
-                                                  width,
-                                                  (lc->max_row_seen_in_chunk -
-                                                   lc->first_row_seen_in_chunk) + 1,
-                                                 lc->notify_user_data);
+                                (lc->updated_func)(lc->pixbuf, 0,
+                                                   lc->first_row_seen_in_chunk,
+                                                   width,
+                                                   (lc->max_row_seen_in_chunk -
+                                                    lc->first_row_seen_in_chunk) + 1,
+                                                   lc->notify_user_data);
                                 /* top to last row */
-                                (lc->update_func)(lc->pixbuf,
-                                                  0, 0, 
-                                                  width,
-                                                  lc->last_row_seen_in_chunk + 1,
-                                                 lc->notify_user_data);
+                                (lc->updated_func)(lc->pixbuf,
+                                                   0, 0, 
+                                                   width,
+                                                   lc->last_row_seen_in_chunk + 1,
+                                                   lc->notify_user_data);
                         } else {
                                 /* We made at least one entire pass, so update the
                                    whole image */
-                                (lc->update_func)(lc->pixbuf,
-                                                  0, 0, 
-                                                  width,
-                                                  lc->max_row_seen_in_chunk + 1,
-                                                 lc->notify_user_data);
+                                (lc->updated_func)(lc->pixbuf,
+                                                   0, 0, 
+                                                   width,
+                                                   lc->max_row_seen_in_chunk + 1,
+                                                   lc->notify_user_data);
                         }
                 }
 
@@ -761,7 +761,7 @@ png_info_callback   (png_structp png_read_ptr,
 
         /* Notify the client that we are ready to go */
 
-        (* lc->prepare_func) (lc->pixbuf, NULL, lc->notify_user_data);
+        (* lc->prepared_func) (lc->pixbuf, NULL, lc->notify_user_data);
 
         return;
 }
diff --git a/gdk-pixbuf/io-qtif.c b/gdk-pixbuf/io-qtif.c
index aaa483611..98246f8b9 100644
--- a/gdk-pixbuf/io-qtif.c
+++ b/gdk-pixbuf/io-qtif.c
@@ -76,8 +76,8 @@ typedef struct {
     guchar          header_buffer[sizeof(QtHeader)];
 
     GdkPixbufModuleSizeFunc     size_func;
-    GdkPixbufModulePreparedFunc prepare_func;
-    GdkPixbufModuleUpdatedFunc  update_func;
+    GdkPixbufModulePreparedFunc prepared_func;
+    GdkPixbufModuleUpdatedFunc  updated_func;
     gint            cb_prepare_count;
     gint            cb_update_count;
 } QTIFContext;
@@ -87,8 +87,8 @@ typedef struct {
  */
 static GdkPixbuf *gdk_pixbuf__qtif_image_load (FILE *f, GError **error);
 static gpointer gdk_pixbuf__qtif_image_begin_load (GdkPixbufModuleSizeFunc size_func,
-                                                   GdkPixbufModulePreparedFunc prepare_func,
-                                                   GdkPixbufModuleUpdatedFunc update_func,
+                                                   GdkPixbufModulePreparedFunc prepared_func,
+                                                   GdkPixbufModuleUpdatedFunc updated_func,
                                                    gpointer user_data,
                                                    GError **error);
 static gboolean gdk_pixbuf__qtif_image_stop_load (gpointer context, GError **error);
@@ -249,16 +249,16 @@ clean_up:
 
 /* Incremental load begin. */
 static gpointer gdk_pixbuf__qtif_image_begin_load (GdkPixbufModuleSizeFunc size_func,
-                                                   GdkPixbufModulePreparedFunc prepare_func,
-                                                   GdkPixbufModuleUpdatedFunc update_func,
+                                                   GdkPixbufModulePreparedFunc prepared_func,
+                                                   GdkPixbufModuleUpdatedFunc updated_func,
                                                    gpointer user_data,
                                                    GError **error)
 {
     QTIFContext *context;
 
     g_assert (size_func != NULL);
-    g_assert (prepare_func != NULL);
-    g_assert (update_func != NULL);
+    g_assert (prepared_func != NULL);
+    g_assert (updated_func != NULL);
 
     /* Create context struct. */
     context = g_new0(QTIFContext, 1);
@@ -277,8 +277,8 @@ static gpointer gdk_pixbuf__qtif_image_begin_load (GdkPixbufModuleSizeFunc size_
     context->run_length = 0u;
     context->atom_count = QTIF_ATOM_COUNT_MAX;
     context->size_func = size_func;
-    context->prepare_func = prepare_func;
-    context->update_func = update_func;
+    context->prepared_func = prepared_func;
+    context->updated_func = updated_func;
 
     return context;
 }
@@ -381,7 +381,7 @@ static gboolean gdk_pixbuf__qtif_image_free_loader (QTIFContext *context, GError
         /* Callback functions should be called for at least once. */
         if(context->cb_prepare_count == 0)
         {
-            (context->prepare_func)(pixbuf, NULL, context->user_data);
+            (context->prepared_func)(pixbuf, NULL, context->user_data);
         }
 
         if(context->cb_update_count == 0)
@@ -391,7 +391,7 @@ static gboolean gdk_pixbuf__qtif_image_free_loader (QTIFContext *context, GError
 
             width = gdk_pixbuf_get_width(pixbuf);
             height = gdk_pixbuf_get_height(pixbuf);
-            (context->update_func)(pixbuf, 0, 0, width, height, context->user_data);
+            (context->updated_func)(pixbuf, 0, 0, width, height, context->user_data);
         }
 
         /* Free GdkPixbuf (callback function should ref it). */
@@ -545,7 +545,7 @@ static void gdk_pixbuf__qtif_cb_area_prepared(GdkPixbufLoader *loader, gpointer
 {
     QTIFContext *context = (QTIFContext *)user_data;
     GdkPixbuf *pixbuf = gdk_pixbuf_loader_get_pixbuf(context->loader);
-    (context->prepare_func)(pixbuf, NULL, context->user_data);
+    (context->prepared_func)(pixbuf, NULL, context->user_data);
     context->cb_update_count++;
 }
 
@@ -558,7 +558,7 @@ static void gdk_pixbuf__qtif_cb_area_updated(GdkPixbufLoader *loader,
 {
     QTIFContext *context = (QTIFContext *)user_data;
     GdkPixbuf *pixbuf = gdk_pixbuf_loader_get_pixbuf(context->loader);
-    (context->update_func)(pixbuf, x, y, width, height, context->user_data);
+    (context->updated_func)(pixbuf, x, y, width, height, context->user_data);
 }
 
 
diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c
index 79c23d4cc..5345c9b83 100644
--- a/gdk-pixbuf/io-tiff.c
+++ b/gdk-pixbuf/io-tiff.c
@@ -58,8 +58,8 @@ typedef struct _TiffContext TiffContext;
 struct _TiffContext
 {
        GdkPixbufModuleSizeFunc size_func;
-       GdkPixbufModulePreparedFunc prepare_func;
-       GdkPixbufModuleUpdatedFunc update_func;
+       GdkPixbufModulePreparedFunc prepared_func;
+       GdkPixbufModuleUpdatedFunc updated_func;
        gpointer user_data;
         
         guchar *buffer;
@@ -277,7 +277,7 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
         }
 
        if (context)
-               (* context->prepare_func) (pixbuf, NULL, context->user_data);
+               (* context->prepared_func) (pixbuf, NULL, context->user_data);
 
        if (!TIFFReadRGBAImageOriented (tiff, width, height, (uint32 *)pixels, ORIENTATION_TOPLEFT, 1)) {
                g_set_error_literal (error,
@@ -317,7 +317,7 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
 #endif
 
        if (context)
-               (* context->update_func) (pixbuf, 0, 0, width, height, context->user_data);
+               (* context->updated_func) (pixbuf, 0, 0, width, height, context->user_data);
 
         return pixbuf;
 }
@@ -391,21 +391,21 @@ gdk_pixbuf__tiff_image_load (FILE *f, GError **error)
 
 static gpointer
 gdk_pixbuf__tiff_image_begin_load (GdkPixbufModuleSizeFunc size_func,
-                                   GdkPixbufModulePreparedFunc prepare_func,
-                                  GdkPixbufModuleUpdatedFunc update_func,
+                                   GdkPixbufModulePreparedFunc prepared_func,
+                                  GdkPixbufModuleUpdatedFunc updated_func,
                                   gpointer user_data,
                                    GError **error)
 {
        TiffContext *context;
         
         g_assert (size_func != NULL);
-        g_assert (prepare_func != NULL);
-        g_assert (update_func != NULL);
+        g_assert (prepared_func != NULL);
+        g_assert (updated_func != NULL);
 
        context = g_new0 (TiffContext, 1);
        context->size_func = size_func;
-       context->prepare_func = prepare_func;
-       context->update_func = update_func;
+       context->prepared_func = prepared_func;
+       context->updated_func = updated_func;
        context->user_data = user_data;
         context->buffer = NULL;
         context->allocated = 0;
diff --git a/gdk-pixbuf/io-xbm.c b/gdk-pixbuf/io-xbm.c
index 20fbfadc9..83de5c6da 100644
--- a/gdk-pixbuf/io-xbm.c
+++ b/gdk-pixbuf/io-xbm.c
@@ -46,8 +46,8 @@
 typedef struct _XBMData XBMData;
 struct _XBMData
 {
-       GdkPixbufModulePreparedFunc prepare_func;
-       GdkPixbufModuleUpdatedFunc update_func;
+       GdkPixbufModulePreparedFunc prepared_func;
+       GdkPixbufModuleUpdatedFunc updated_func;
        gpointer user_data;
 
        gchar *tempname;
@@ -343,7 +343,7 @@ gdk_pixbuf__xbm_image_load_real (FILE     *f,
        row_stride = gdk_pixbuf_get_rowstride (pixbuf);
 
        if (context)
-               (* context->prepare_func) (pixbuf, NULL, context->user_data);
+               (* context->prepared_func) (pixbuf, NULL, context->user_data);
 
 
        /* Initialize PIXBUF */
@@ -371,7 +371,7 @@ gdk_pixbuf__xbm_image_load_real (FILE     *f,
        g_free (data);
 
        if (context) {
-               (* context->update_func) (pixbuf, 0, 0, w, h, context->user_data);
+               (* context->updated_func) (pixbuf, 0, 0, w, h, context->user_data);
        }
 
        return pixbuf;
@@ -397,8 +397,8 @@ gdk_pixbuf__xbm_image_load (FILE    *f,
 
 static gpointer
 gdk_pixbuf__xbm_image_begin_load (GdkPixbufModuleSizeFunc       size_func,
-                                  GdkPixbufModulePreparedFunc   prepare_func,
-                                 GdkPixbufModuleUpdatedFunc    update_func,
+                                  GdkPixbufModulePreparedFunc   prepared_func,
+                                 GdkPixbufModuleUpdatedFunc    updated_func,
                                  gpointer                      user_data,
                                  GError                      **error)
 {
@@ -406,12 +406,12 @@ gdk_pixbuf__xbm_image_begin_load (GdkPixbufModuleSizeFunc       size_func,
        gint fd;
 
        g_assert (size_func != NULL);
-       g_assert (prepare_func != NULL);
-       g_assert (update_func != NULL);
+       g_assert (prepared_func != NULL);
+       g_assert (updated_func != NULL);
 
        context = g_new (XBMData, 1);
-       context->prepare_func = prepare_func;
-       context->update_func = update_func;
+       context->prepared_func = prepared_func;
+       context->updated_func = updated_func;
        context->user_data = user_data;
        context->all_okay = TRUE;
        fd = g_file_open_tmp ("gdkpixbuf-xbm-tmp.XXXXXX",
diff --git a/gdk-pixbuf/io-xpm.c b/gdk-pixbuf/io-xpm.c
index 2b8cf7445..0756a43d8 100644
--- a/gdk-pixbuf/io-xpm.c
+++ b/gdk-pixbuf/io-xpm.c
@@ -698,8 +698,8 @@ gdk_pixbuf__xpm_image_load_xpm_data (const gchar **data)
 typedef struct _XPMContext XPMContext;
 struct _XPMContext
 {
-       GdkPixbufModulePreparedFunc prepare_func;
-       GdkPixbufModuleUpdatedFunc update_func;
+       GdkPixbufModulePreparedFunc prepared_func;
+       GdkPixbufModuleUpdatedFunc updated_func;
        gpointer user_data;
 
        gchar *tempname;
@@ -715,8 +715,8 @@ struct _XPMContext
  */
 static gpointer
 gdk_pixbuf__xpm_image_begin_load (GdkPixbufModuleSizeFunc size_func,
-                                  GdkPixbufModulePreparedFunc prepare_func,
-                                  GdkPixbufModuleUpdatedFunc update_func,
+                                  GdkPixbufModulePreparedFunc prepared_func,
+                                  GdkPixbufModuleUpdatedFunc updated_func,
                                   gpointer user_data,
                                   GError **error)
 {
@@ -724,12 +724,12 @@ gdk_pixbuf__xpm_image_begin_load (GdkPixbufModuleSizeFunc size_func,
        gint fd;
 
        g_assert (size_func != NULL);
-       g_assert (prepare_func != NULL);
-       g_assert (update_func != NULL);
+       g_assert (prepared_func != NULL);
+       g_assert (updated_func != NULL);
 
        context = g_new (XPMContext, 1);
-       context->prepare_func = prepare_func;
-       context->update_func = update_func;
+       context->prepared_func = prepared_func;
+       context->updated_func = updated_func;
        context->user_data = user_data;
        context->all_okay = TRUE;
        fd = g_file_open_tmp ("gdkpixbuf-xpm-tmp.XXXXXX", &context->tempname,
@@ -765,14 +765,14 @@ gdk_pixbuf__xpm_image_stop_load (gpointer data,
                pixbuf = gdk_pixbuf__xpm_image_load (context->file, error);
 
                if (pixbuf != NULL) {
-                      (* context->prepare_func) (pixbuf,
-                                                 NULL,
+                      (* context->prepared_func) (pixbuf,
+                                                  NULL,
+                                                  context->user_data);
+                      (* context->updated_func) (pixbuf,
+                                                 0, 0,
+                                                 gdk_pixbuf_get_width (pixbuf),
+                                                 gdk_pixbuf_get_height (pixbuf),
                                                  context->user_data);
-                      (* context->update_func) (pixbuf,
-                                                0, 0,
-                                                gdk_pixbuf_get_width (pixbuf),
-                                                gdk_pixbuf_get_height (pixbuf),
-                                                context->user_data);
                        g_object_unref (pixbuf);
 
                        retval = TRUE;


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