girepository.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
  2. * GObject introspection: Repository
  3. *
  4. * Copyright (C) 2005 Matthias Clasen
  5. * Copyright (C) 2008,2009 Red Hat, Inc.
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20. * Boston, MA 02111-1307, USA.
  21. */
  22. #ifndef __G_IREPOSITORY_H__
  23. #define __G_IREPOSITORY_H__
  24. #include <glib-object.h>
  25. #include <gmodule.h>
  26. #define __GIREPOSITORY_H_INSIDE__
  27. #include <giarginfo.h>
  28. #include <gibaseinfo.h>
  29. #include <gicallableinfo.h>
  30. #include <giconstantinfo.h>
  31. #include <gienuminfo.h>
  32. #include <gifieldinfo.h>
  33. #include <gifunctioninfo.h>
  34. #include <giinterfaceinfo.h>
  35. #include <giobjectinfo.h>
  36. #include <gipropertyinfo.h>
  37. #include <giregisteredtypeinfo.h>
  38. #include <gisignalinfo.h>
  39. #include <gistructinfo.h>
  40. #include <gitypeinfo.h>
  41. #include <gitypelib.h>
  42. #include <gitypes.h>
  43. #include <giunioninfo.h>
  44. #include <giversionmacros.h>
  45. #include <givfuncinfo.h>
  46. G_BEGIN_DECLS
  47. #define G_TYPE_IREPOSITORY (g_irepository_get_type ())
  48. #define G_IREPOSITORY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_IREPOSITORY, GIRepository))
  49. #define G_IREPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_IREPOSITORY, GIRepositoryClass))
  50. #define G_IS_IREPOSITORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_IREPOSITORY))
  51. #define G_IS_IREPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_IREPOSITORY))
  52. #define G_IREPOSITORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_IREPOSITORY, GIRepositoryClass))
  53. /**
  54. * GIRepository:
  55. *
  56. * The GIRepository structure contains private data and should only be
  57. * accessed using the provided API.
  58. */
  59. typedef struct _GIRepository GIRepository;
  60. typedef struct _GIRepositoryClass GIRepositoryClass;
  61. typedef struct _GIRepositoryPrivate GIRepositoryPrivate;
  62. struct _GIRepository
  63. {
  64. /*< private >*/
  65. GObject parent;
  66. GIRepositoryPrivate *priv;
  67. };
  68. struct _GIRepositoryClass
  69. {
  70. /*< private >*/
  71. GObjectClass parent;
  72. };
  73. /**
  74. * GIRepositoryLoadFlags:
  75. * @G_IREPOSITORY_LOAD_FLAG_LAZY: Lazily load the typelib.
  76. *
  77. * Flags that control how a typelib is loaded.
  78. */
  79. typedef enum
  80. {
  81. G_IREPOSITORY_LOAD_FLAG_LAZY = 1 << 0
  82. } GIRepositoryLoadFlags;
  83. /* Repository */
  84. GI_AVAILABLE_IN_ALL
  85. GType g_irepository_get_type (void) G_GNUC_CONST;
  86. GI_AVAILABLE_IN_ALL
  87. GIRepository *g_irepository_get_default (void);
  88. GI_AVAILABLE_IN_ALL
  89. void g_irepository_prepend_search_path (const char *directory);
  90. GI_AVAILABLE_IN_1_36
  91. void g_irepository_prepend_library_path (const char *directory);
  92. GI_AVAILABLE_IN_ALL
  93. GSList * g_irepository_get_search_path (void);
  94. GI_AVAILABLE_IN_ALL
  95. const char * g_irepository_load_typelib (GIRepository *repository,
  96. GITypelib *typelib,
  97. GIRepositoryLoadFlags flags,
  98. GError **error);
  99. GI_AVAILABLE_IN_ALL
  100. gboolean g_irepository_is_registered (GIRepository *repository,
  101. const gchar *namespace_,
  102. const gchar *version);
  103. GI_AVAILABLE_IN_ALL
  104. GIBaseInfo * g_irepository_find_by_name (GIRepository *repository,
  105. const gchar *namespace_,
  106. const gchar *name);
  107. GI_AVAILABLE_IN_ALL
  108. GList * g_irepository_enumerate_versions (GIRepository *repository,
  109. const gchar *namespace_);
  110. GI_AVAILABLE_IN_ALL
  111. GITypelib * g_irepository_require (GIRepository *repository,
  112. const gchar *namespace_,
  113. const gchar *version,
  114. GIRepositoryLoadFlags flags,
  115. GError **error);
  116. GI_AVAILABLE_IN_ALL
  117. GITypelib * g_irepository_require_private (GIRepository *repository,
  118. const gchar *typelib_dir,
  119. const gchar *namespace_,
  120. const gchar *version,
  121. GIRepositoryLoadFlags flags,
  122. GError **error);
  123. GI_AVAILABLE_IN_1_44
  124. gchar ** g_irepository_get_immediate_dependencies (GIRepository *repository,
  125. const gchar *namespace_);
  126. GI_AVAILABLE_IN_ALL
  127. gchar ** g_irepository_get_dependencies (GIRepository *repository,
  128. const gchar *namespace_);
  129. GI_AVAILABLE_IN_ALL
  130. gchar ** g_irepository_get_loaded_namespaces (GIRepository *repository);
  131. GI_AVAILABLE_IN_ALL
  132. GIBaseInfo * g_irepository_find_by_gtype (GIRepository *repository,
  133. GType gtype);
  134. GI_AVAILABLE_IN_ALL
  135. gint g_irepository_get_n_infos (GIRepository *repository,
  136. const gchar *namespace_);
  137. GI_AVAILABLE_IN_ALL
  138. GIBaseInfo * g_irepository_get_info (GIRepository *repository,
  139. const gchar *namespace_,
  140. gint index);
  141. GI_AVAILABLE_IN_ALL
  142. GIEnumInfo * g_irepository_find_by_error_domain (GIRepository *repository,
  143. GQuark domain);
  144. GI_AVAILABLE_IN_ALL
  145. const gchar * g_irepository_get_typelib_path (GIRepository *repository,
  146. const gchar *namespace_);
  147. GI_AVAILABLE_IN_ALL
  148. const gchar * g_irepository_get_shared_library (GIRepository *repository,
  149. const gchar *namespace_);
  150. GI_AVAILABLE_IN_ALL
  151. const gchar * g_irepository_get_c_prefix (GIRepository *repository,
  152. const gchar *namespace_);
  153. GI_AVAILABLE_IN_ALL
  154. const gchar * g_irepository_get_version (GIRepository *repository,
  155. const gchar *namespace_);
  156. GI_AVAILABLE_IN_ALL
  157. GOptionGroup * g_irepository_get_option_group (void);
  158. GI_AVAILABLE_IN_ALL
  159. gboolean g_irepository_dump (const char *arg, GError **error);
  160. /**
  161. * GIRepositoryError:
  162. * @G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND: the typelib could not be found.
  163. * @G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH: the namespace does not match the
  164. * requested namespace.
  165. * @G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT: the version of the
  166. * typelib does not match the requested version.
  167. * @G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND: the library used by the typelib
  168. * could not be found.
  169. *
  170. * An error code used with #G_IREPOSITORY_ERROR in a #GError returned
  171. * from a #GIRepository routine.
  172. */
  173. typedef enum
  174. {
  175. G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND,
  176. G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH,
  177. G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT,
  178. G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND
  179. } GIRepositoryError;
  180. /**
  181. * G_IREPOSITORY_ERROR:
  182. *
  183. * Error domain for #GIRepository. Errors in this domain will be from the
  184. * #GIRepositoryError enumeration. See #GError for more information on
  185. * error domains.
  186. */
  187. #define G_IREPOSITORY_ERROR (g_irepository_error_quark ())
  188. GI_AVAILABLE_IN_ALL
  189. GQuark g_irepository_error_quark (void);
  190. /* Global utility functions */
  191. GI_AVAILABLE_IN_ALL
  192. void gi_cclosure_marshal_generic (GClosure *closure,
  193. GValue *return_gvalue,
  194. guint n_param_values,
  195. const GValue *param_values,
  196. gpointer invocation_hint,
  197. gpointer marshal_data);
  198. G_END_DECLS
  199. #endif /* __G_IREPOSITORY_H__ */