http://mail.gnome.org/archives/gtk-devel-list/2007-October/msg00089.html
[platform/upstream/glib.git] / gio / gloadableicon.c
index 85e8e6d..bcddde3 100644 (file)
 #include "gloadableicon.h"
 #include "glibintl.h"
 
+#include "gioalias.h"
+
 /**
  * SECTION:gloadableicon
  * @short_description: Loadable Icons
  * @see_also: #GIcon, #GThemedIcon
  * 
- * Implements #GIcon and adds the ability to load icons.
- *
+ * Extends the #GIcon interface and adds the ability to load icons.
  **/
 
 static void          g_loadable_icon_real_load_async  (GLoadableIcon        *icon,
@@ -96,7 +97,7 @@ g_loadable_icon_base_init (gpointer g_class)
  * g_loadable_icon_load:
  * @icon: a #GLoadableIcon.
  * @size: an integer.
- * @type: 
+ * @type:  a location to store the type of the loaded icon, %NULL to ignore.
  * @cancellable: optional #GCancellable object, %NULL to ignore. 
  * @error: a #GError location to store the error occuring, or %NULL to 
  * ignore.
@@ -107,11 +108,11 @@ g_loadable_icon_base_init (gpointer g_class)
  * Returns: a #GInputStream to read the icon from.
  **/
 GInputStream *
-g_loadable_icon_load (GLoadableIcon        *icon,
-                     int                   size,
-                     char                **type,
-                     GCancellable         *cancellable,
-                     GError              **error)
+g_loadable_icon_load (GLoadableIcon  *icon,
+                     int             size,
+                     char          **type,
+                     GCancellable   *cancellable,
+                     GError        **error)
 {
   GLoadableIconIface *iface;
 
@@ -120,7 +121,6 @@ g_loadable_icon_load (GLoadableIcon        *icon,
   iface = G_LOADABLE_ICON_GET_IFACE (icon);
 
   return (* iface->load) (icon, size, type, cancellable, error);
-  
 }
 
 /**
@@ -134,14 +134,13 @@ g_loadable_icon_load (GLoadableIcon        *icon,
  * Loads an icon asynchronously. To finish this function, see 
  * g_loadable_icon_load_finish(). For the synchronous, blocking 
  * version of this function, see g_loadable_icon_load().
- * 
  **/
 void
-g_loadable_icon_load_async (GLoadableIcon        *icon,
-                           int                   size,
-                           GCancellable         *cancellable,
-                           GAsyncReadyCallback   callback,
-                           gpointer              user_data)
+g_loadable_icon_load_async (GLoadableIcon       *icon,
+                            int                  size,
+                            GCancellable        *cancellable,
+                            GAsyncReadyCallback  callback,
+                            gpointer             user_data)
 {
   GLoadableIconIface *iface;
   
@@ -150,14 +149,13 @@ g_loadable_icon_load_async (GLoadableIcon        *icon,
   iface = G_LOADABLE_ICON_GET_IFACE (icon);
 
   (* iface->load_async) (icon, size, cancellable, callback, user_data);
-  
 }
 
 /**
  * g_loadable_icon_load_finish:
  * @icon: a #GLoadableIcon.
  * @res: a #GAsyncResult.
- * @type:
+ * @type: a location to store the type of the loaded icon, %NULL to ignore.
  * @error: a #GError location to store the error occuring, or %NULL to 
  * ignore.
  * 
@@ -166,10 +164,10 @@ g_loadable_icon_load_async (GLoadableIcon        *icon,
  * Returns: a #GInputStream to read the icon from.
  **/
 GInputStream *
-g_loadable_icon_load_finish (GLoadableIcon        *icon,
-                            GAsyncResult         *res,
-                            char                **type,
-                            GError              **error)
+g_loadable_icon_load_finish (GLoadableIcon  *icon,
+                            GAsyncResult   *res,
+                            char          **type,
+                            GError        **error)
 {
   GLoadableIconIface *iface;
   
@@ -186,7 +184,6 @@ g_loadable_icon_load_finish (GLoadableIcon        *icon,
   iface = G_LOADABLE_ICON_GET_IFACE (icon);
 
   return (* iface->load_finish) (icon, res, type, error);
-  
 }
 
 /********************************************
@@ -210,8 +207,8 @@ load_data_free (LoadData *data)
 
 static void
 load_async_thread (GSimpleAsyncResult *res,
-                  GObject *object,
-                  GCancellable *cancellable)
+                  GObject            *object,
+                  GCancellable       *cancellable)
 {
   GLoadableIconIface *iface;
   GInputStream *stream;
@@ -239,11 +236,11 @@ load_async_thread (GSimpleAsyncResult *res,
 
 
 static void
-g_loadable_icon_real_load_async (GLoadableIcon        *icon,
-                                int                   size,
-                                GCancellable         *cancellable,
-                                GAsyncReadyCallback   callback,
-                                gpointer              user_data)
+g_loadable_icon_real_load_async (GLoadableIcon       *icon,
+                                int                  size,
+                                GCancellable        *cancellable,
+                                GAsyncReadyCallback  callback,
+                                gpointer             user_data)
 {
   GSimpleAsyncResult *res;
   LoadData *data;
@@ -264,7 +261,7 @@ g_loadable_icon_real_load_finish (GLoadableIcon        *icon,
   GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
   LoadData *data;
 
-  g_assert (g_simple_async_result_get_source_tag (simple) == g_loadable_icon_real_load_async);
+  g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_loadable_icon_real_load_async);
 
   data = g_simple_async_result_get_op_res_gpointer (simple);
 
@@ -276,3 +273,6 @@ g_loadable_icon_real_load_finish (GLoadableIcon        *icon,
 
   return g_object_ref (data->stream);
 }
+
+#define __G_LOADABLE_ICON_C__
+#include "gioaliasdef.c"