[gtk+/wip/baedert/gtkimageview: 45/118] GtkImageView: Propagate errors from async API



commit 4ff1714224aad75e3c06fb4d6e063f25307d3a23
Author: Timm Bäder <mail baedert org>
Date:   Fri Jan 22 18:09:48 2016 +0100

    GtkImageView: Propagate errors from async API

 gtk/gtkimageview.c |   20 ++++++++-------
 gtk/gtkimageview.h |   66 ++++++++++++++++++++++++++--------------------------
 2 files changed, 44 insertions(+), 42 deletions(-)
---
diff --git a/gtk/gtkimageview.c b/gtk/gtkimageview.c
index c2150cf..eb965e3 100644
--- a/gtk/gtkimageview.c
+++ b/gtk/gtkimageview.c
@@ -1997,9 +1997,9 @@ gtk_image_view_load_image_contents (GTask        *task,
 }
 
 static void
-gtk_image_view_load_from_input_stream (GTask *task,
-                                       gpointer source_object,
-                                       gpointer task_data,
+gtk_image_view_load_from_input_stream (GTask        *task,
+                                       gpointer      source_object,
+                                       gpointer      task_data,
                                        GCancellable *cancellable)
 {
   GtkImageView *image_view = source_object;
@@ -2043,13 +2043,14 @@ gtk_image_view_load_from_file_async (GtkImageView        *image_view,
 
   g_object_unref (task);
 }
-void
+gboolean
 gtk_image_view_load_from_file_finish   (GtkImageView  *image_view,
                                         GAsyncResult  *result,
                                         GError       **error)
 {
-  g_return_if_fail (g_task_is_valid (result, image_view));
-  g_task_propagate_pointer (G_TASK (result), error);
+  g_return_val_if_fail (g_task_is_valid (result, image_view), FALSE);
+
+  return g_task_propagate_boolean (G_TASK (result), error);
 }
 
 
@@ -2079,13 +2080,14 @@ gtk_image_view_load_from_stream_async (GtkImageView        *image_view,
 
   g_object_unref (task);
 }
-void
+gboolean
 gtk_image_view_load_from_stream_finish (GtkImageView  *image_view,
                                         GAsyncResult  *result,
                                         GError       **error)
 {
-  g_return_if_fail (g_task_is_valid (result, image_view));
-  g_task_propagate_pointer (G_TASK (result), error);
+  g_return_val_if_fail (g_task_is_valid (result, image_view), FALSE);
+
+  return g_task_propagate_boolean (G_TASK (result), error);
 }
 
 /*
diff --git a/gtk/gtkimageview.h b/gtk/gtkimageview.h
index 8052589..2082ffa 100644
--- a/gtk/gtkimageview.h
+++ b/gtk/gtkimageview.h
@@ -36,22 +36,22 @@ struct _GtkImageViewClass
 };
 
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 GType         gtk_image_view_get_type (void) G_GNUC_CONST;
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 GtkWidget *   gtk_image_view_new      (void);
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 void gtk_image_view_set_pixbuf (GtkImageView    *image_view,
                                 const GdkPixbuf *pixbuf,
                                 int              scale_factor);
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 void gtk_image_view_set_surface (GtkImageView    *image_view,
                                  cairo_surface_t *surface);
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 void gtk_image_view_set_animation (GtkImageView       *image_view,
                                    GdkPixbufAnimation *animation,
                                    int                 scale_factor);
@@ -59,18 +59,18 @@ void gtk_image_view_set_animation (GtkImageView       *image_view,
 
 /* Loading {{{ */
 
-GDK_AVAILABLE_IN_3_18
-void gtk_image_view_load_from_file_async    (GtkImageView        *image_view,
-                                             GFile               *file,
-                                             int                  scale_factor,
-                                             GCancellable        *cancellable,
-                                             GAsyncReadyCallback  callback,
-                                             gpointer             user_data);
-GDK_AVAILABLE_IN_3_18
-void  gtk_image_view_load_from_file_finish   (GtkImageView  *image_view,
-                                              GAsyncResult  *result,
-                                              GError       **error);
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
+void gtk_image_view_load_from_file_async (GtkImageView        *image_view,
+                                          GFile               *file,
+                                          int                  scale_factor,
+                                          GCancellable        *cancellable,
+                                          GAsyncReadyCallback  callback,
+                                          gpointer             user_data);
+GDK_AVAILABLE_IN_3_20
+gboolean gtk_image_view_load_from_file_finish (GtkImageView  *image_view,
+                                               GAsyncResult  *result,
+                                               GError       **error);
+GDK_AVAILABLE_IN_3_20
 void gtk_image_view_load_from_stream_async (GtkImageView        *image_view,
                                             GInputStream        *input_stream,
                                             int                  scale_factor,
@@ -78,64 +78,64 @@ void gtk_image_view_load_from_stream_async (GtkImageView        *image_view,
                                             GAsyncReadyCallback  callback,
                                             gpointer             user_data);
 
-GDK_AVAILABLE_IN_3_18
-void gtk_image_view_load_from_stream_finish (GtkImageView  *image_view,
-                                             GAsyncResult  *result,
-                                             GError       **error);
+GDK_AVAILABLE_IN_3_20
+gboolean gtk_image_view_load_from_stream_finish (GtkImageView  *image_view,
+                                                 GAsyncResult  *result,
+                                                 GError       **error);
 
 /* }}} */
 
 /* Setters/Getters {{{ */
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 void   gtk_image_view_set_scale (GtkImageView *image_view,
                                  double        scale);
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 double gtk_image_view_get_scale (GtkImageView *image_view);
 
 
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 void  gtk_image_view_set_angle (GtkImageView *image_view,
                                 double        angle);
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 double gtk_image_view_get_angle (GtkImageView *image_view);
 
 
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 void gtk_image_view_set_snap_angle (GtkImageView *image_view,
                                     gboolean      snap_angle);
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 gboolean gtk_image_view_get_snap_angle (GtkImageView *image_view);
 
 
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 void gtk_image_view_set_fit_allocation (GtkImageView *image_view,
                                         gboolean      fit_allocation);
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 gboolean gtk_image_view_get_fit_allocation (GtkImageView *image_view);
 
 
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 void gtk_image_view_set_rotate_gesture_enabled (GtkImageView *image_view,
                                                 gboolean      rotate_gesture_enabled);
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 gboolean gtk_image_view_get_rotate_gesture_enabled (GtkImageView *image_view);
 
 
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 void gtk_image_view_set_zoom_gesture_enabled (GtkImageView *image_view,
                                               gboolean      zoom_gesture_enabled);
 
-GDK_AVAILABLE_IN_3_18
+GDK_AVAILABLE_IN_3_20
 gboolean gtk_image_view_get_zoom_gesture_enabled (GtkImageView *image_view);
 
 /* }}} */


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