1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Alexander Larsson <alexl@redhat.com>
24 #include "gasyncresult.h"
27 static void g_async_result_base_init (gpointer g_class);
28 static void g_async_result_class_init (gpointer g_class,
32 g_async_result_get_type (void)
34 static GType async_result_type = 0;
36 if (! async_result_type)
38 static const GTypeInfo async_result_info =
40 sizeof (GAsyncResultIface), /* class_size */
41 g_async_result_base_init, /* base_init */
42 NULL, /* base_finalize */
43 g_async_result_class_init,
44 NULL, /* class_finalize */
45 NULL, /* class_data */
52 g_type_register_static (G_TYPE_INTERFACE, I_("GAsyncResult"),
53 &async_result_info, 0);
55 g_type_interface_add_prerequisite (async_result_type, G_TYPE_OBJECT);
58 return async_result_type;
62 g_async_result_class_init (gpointer g_class,
68 g_async_result_base_init (gpointer g_class)
73 * g_async_result_get_user_data:
74 * @res: a #GAsyncResult.
76 * Returns: the user data for the given @res, or
80 g_async_result_get_user_data (GAsyncResult *res)
82 GAsyncResultIface *iface;
84 g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
86 iface = G_ASYNC_RESULT_GET_IFACE (res);
88 return (* iface->get_user_data) (res);
92 * g_async_result_get_source_object:
93 * @res: a #GAsyncResult.
95 * Returns: the source object for the @res.
98 g_async_result_get_source_object (GAsyncResult *res)
100 GAsyncResultIface *iface;
102 g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
104 iface = G_ASYNC_RESULT_GET_IFACE (res);
106 return (* iface->get_source_object) (res);