Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

gasyncinitable.h 4.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2009 Red Hat, Inc.
  4. *
  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.
  9. *
  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.
  14. *
  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.
  19. *
  20. * Author: Alexander Larsson <alexl@redhat.com>
  21. */
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #ifndef __G_ASYNC_INITABLE_H__
  26. #define __G_ASYNC_INITABLE_H__
  27. #include <gio/giotypes.h>
  28. #include <gio/ginitable.h>
  29. G_BEGIN_DECLS
  30. #define G_TYPE_ASYNC_INITABLE (g_async_initable_get_type ())
  31. #define G_ASYNC_INITABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_ASYNC_INITABLE, GAsyncInitable))
  32. #define G_IS_ASYNC_INITABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_ASYNC_INITABLE))
  33. #define G_ASYNC_INITABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_ASYNC_INITABLE, GAsyncInitableIface))
  34. #define G_TYPE_IS_ASYNC_INITABLE(type) (g_type_is_a ((type), G_TYPE_ASYNC_INITABLE))
  35. /**
  36. * GAsyncInitable:
  37. *
  38. * Interface for asynchronously initializable objects.
  39. *
  40. * Since: 2.22
  41. **/
  42. typedef struct _GAsyncInitableIface GAsyncInitableIface;
  43. /**
  44. * GAsyncInitableIface:
  45. * @g_iface: The parent interface.
  46. * @init_async: Starts initialization of the object.
  47. * @init_finish: Finishes initialization of the object.
  48. *
  49. * Provides an interface for asynchronous initializing object such that
  50. * initialization may fail.
  51. *
  52. * Since: 2.22
  53. **/
  54. struct _GAsyncInitableIface
  55. {
  56. GTypeInterface g_iface;
  57. /* Virtual Table */
  58. void (* init_async) (GAsyncInitable *initable,
  59. int io_priority,
  60. GCancellable *cancellable,
  61. GAsyncReadyCallback callback,
  62. gpointer user_data);
  63. gboolean (* init_finish) (GAsyncInitable *initable,
  64. GAsyncResult *res,
  65. GError **error);
  66. };
  67. GType g_async_initable_get_type (void) G_GNUC_CONST;
  68. void g_async_initable_init_async (GAsyncInitable *initable,
  69. int io_priority,
  70. GCancellable *cancellable,
  71. GAsyncReadyCallback callback,
  72. gpointer user_data);
  73. gboolean g_async_initable_init_finish (GAsyncInitable *initable,
  74. GAsyncResult *res,
  75. GError **error);
  76. void g_async_initable_new_async (GType object_type,
  77. int io_priority,
  78. GCancellable *cancellable,
  79. GAsyncReadyCallback callback,
  80. gpointer user_data,
  81. const gchar *first_property_name,
  82. ...);
  83. void g_async_initable_newv_async (GType object_type,
  84. guint n_parameters,
  85. GParameter *parameters,
  86. int io_priority,
  87. GCancellable *cancellable,
  88. GAsyncReadyCallback callback,
  89. gpointer user_data);
  90. void g_async_initable_new_valist_async (GType object_type,
  91. const gchar *first_property_name,
  92. va_list var_args,
  93. int io_priority,
  94. GCancellable *cancellable,
  95. GAsyncReadyCallback callback,
  96. gpointer user_data);
  97. GObject *g_async_initable_new_finish (GAsyncInitable *initable,
  98. GAsyncResult *res,
  99. GError **error);
  100. G_END_DECLS
  101. #endif /* __G_ASYNC_INITABLE_H__ */