giobjectinfo.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
  2. * GObject introspection: Object
  3. *
  4. * Copyright (C) 2005 Matthias Clasen
  5. * Copyright (C) 2008,2009 Red Hat, Inc.
  6. *
  7. * SPDX-License-Identifier: LGPL-2.1-or-later
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2 of the License, or (at your option) any later version.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the
  21. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  22. * Boston, MA 02111-1307, USA.
  23. */
  24. #pragma once
  25. #if !defined (__GIREPOSITORY_H_INSIDE__) && !defined (GI_COMPILATION)
  26. #error "Only <girepository.h> can be included directly."
  27. #endif
  28. #include <girepository/gitypes.h>
  29. G_BEGIN_DECLS
  30. /**
  31. * GIObjectInfoRefFunction: (skip)
  32. * @object: object instance pointer
  33. *
  34. * Increases the reference count of an object instance.
  35. *
  36. * Returns: (transfer full): the object instance
  37. * Since: 2.80
  38. */
  39. typedef void * (*GIObjectInfoRefFunction) (void *object);
  40. /**
  41. * GIObjectInfoUnrefFunction: (skip)
  42. * @object: (transfer full): object instance pointer
  43. *
  44. * Decreases the reference count of an object instance.
  45. *
  46. * Since: 2.80
  47. */
  48. typedef void (*GIObjectInfoUnrefFunction) (void *object);
  49. /**
  50. * GIObjectInfoSetValueFunction: (skip)
  51. * @value: a [type@GObject.Value]
  52. * @object: object instance pointer
  53. *
  54. * Update @value and attach the object instance pointer @object to it.
  55. *
  56. * Since: 2.80
  57. */
  58. typedef void (*GIObjectInfoSetValueFunction) (GValue *value, void *object);
  59. /**
  60. * GIObjectInfoGetValueFunction: (skip)
  61. * @value: a [type@GObject.Value]
  62. *
  63. * Extract an object instance out of @value.
  64. *
  65. * Returns: (transfer full): the object instance
  66. * Since: 2.80
  67. */
  68. typedef void * (*GIObjectInfoGetValueFunction) (const GValue *value);
  69. #define GI_TYPE_OBJECT_INFO (gi_object_info_get_type ())
  70. /**
  71. * GI_OBJECT_INFO:
  72. * @info: Info object which is subject to casting.
  73. *
  74. * Casts a [type@GIRepository.ObjectInfo] or derived pointer into a
  75. * `(GIObjectInfo*)` pointer.
  76. *
  77. * Depending on the current debugging level, this function may invoke
  78. * certain runtime checks to identify invalid casts.
  79. *
  80. * Since: 2.80
  81. */
  82. #define GI_OBJECT_INFO(info) (G_TYPE_CHECK_INSTANCE_CAST ((info), GI_TYPE_OBJECT_INFO, GIObjectInfo))
  83. /**
  84. * GI_IS_OBJECT_INFO:
  85. * @info: an info structure
  86. *
  87. * Checks if @info is a [class@GIRepository.ObjectInfo] (or a derived type).
  88. *
  89. * Since: 2.80
  90. */
  91. #define GI_IS_OBJECT_INFO(info) (G_TYPE_CHECK_INSTANCE_TYPE ((info), GI_TYPE_OBJECT_INFO))
  92. GI_AVAILABLE_IN_ALL
  93. const char * gi_object_info_get_type_name (GIObjectInfo *info);
  94. GI_AVAILABLE_IN_ALL
  95. const char * gi_object_info_get_type_init_function_name (GIObjectInfo *info);
  96. GI_AVAILABLE_IN_ALL
  97. gboolean gi_object_info_get_abstract (GIObjectInfo *info);
  98. GI_AVAILABLE_IN_ALL
  99. gboolean gi_object_info_get_final (GIObjectInfo *info);
  100. GI_AVAILABLE_IN_ALL
  101. gboolean gi_object_info_get_fundamental (GIObjectInfo *info);
  102. GI_AVAILABLE_IN_ALL
  103. GIObjectInfo * gi_object_info_get_parent (GIObjectInfo *info);
  104. GI_AVAILABLE_IN_ALL
  105. unsigned int gi_object_info_get_n_interfaces (GIObjectInfo *info);
  106. GI_AVAILABLE_IN_ALL
  107. GIInterfaceInfo * gi_object_info_get_interface (GIObjectInfo *info,
  108. unsigned int n);
  109. GI_AVAILABLE_IN_ALL
  110. unsigned int gi_object_info_get_n_fields (GIObjectInfo *info);
  111. GI_AVAILABLE_IN_ALL
  112. GIFieldInfo * gi_object_info_get_field (GIObjectInfo *info,
  113. unsigned int n);
  114. GI_AVAILABLE_IN_ALL
  115. unsigned int gi_object_info_get_n_properties (GIObjectInfo *info);
  116. GI_AVAILABLE_IN_ALL
  117. GIPropertyInfo * gi_object_info_get_property (GIObjectInfo *info,
  118. unsigned int n);
  119. GI_AVAILABLE_IN_ALL
  120. unsigned int gi_object_info_get_n_methods (GIObjectInfo *info);
  121. GI_AVAILABLE_IN_ALL
  122. GIFunctionInfo * gi_object_info_get_method (GIObjectInfo *info,
  123. unsigned int n);
  124. GI_AVAILABLE_IN_ALL
  125. GIFunctionInfo * gi_object_info_find_method (GIObjectInfo *info,
  126. const char *name);
  127. GI_AVAILABLE_IN_ALL
  128. GIFunctionInfo * gi_object_info_find_method_using_interfaces (GIObjectInfo *info,
  129. const char *name,
  130. GIBaseInfo **declarer);
  131. GI_AVAILABLE_IN_ALL
  132. unsigned int gi_object_info_get_n_signals (GIObjectInfo *info);
  133. GI_AVAILABLE_IN_ALL
  134. GISignalInfo * gi_object_info_get_signal (GIObjectInfo *info,
  135. unsigned int n);
  136. GI_AVAILABLE_IN_ALL
  137. GISignalInfo * gi_object_info_find_signal (GIObjectInfo *info,
  138. const char *name);
  139. GI_AVAILABLE_IN_ALL
  140. unsigned int gi_object_info_get_n_vfuncs (GIObjectInfo *info);
  141. GI_AVAILABLE_IN_ALL
  142. GIVFuncInfo * gi_object_info_get_vfunc (GIObjectInfo *info,
  143. unsigned int n);
  144. GI_AVAILABLE_IN_ALL
  145. GIVFuncInfo * gi_object_info_find_vfunc (GIObjectInfo *info,
  146. const char *name);
  147. GI_AVAILABLE_IN_ALL
  148. GIVFuncInfo * gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *info,
  149. const char *name,
  150. GIBaseInfo **declarer);
  151. GI_AVAILABLE_IN_ALL
  152. unsigned int gi_object_info_get_n_constants (GIObjectInfo *info);
  153. GI_AVAILABLE_IN_ALL
  154. GIConstantInfo * gi_object_info_get_constant (GIObjectInfo *info,
  155. unsigned int n);
  156. GI_AVAILABLE_IN_ALL
  157. GIStructInfo * gi_object_info_get_class_struct (GIObjectInfo *info);
  158. GI_AVAILABLE_IN_ALL
  159. const char * gi_object_info_get_ref_function_name (GIObjectInfo *info);
  160. GI_AVAILABLE_IN_ALL
  161. GIObjectInfoRefFunction gi_object_info_get_ref_function_pointer (GIObjectInfo *info);
  162. GI_AVAILABLE_IN_ALL
  163. const char * gi_object_info_get_unref_function_name (GIObjectInfo *info);
  164. GI_AVAILABLE_IN_ALL
  165. GIObjectInfoUnrefFunction gi_object_info_get_unref_function_pointer (GIObjectInfo *info);
  166. GI_AVAILABLE_IN_ALL
  167. const char * gi_object_info_get_set_value_function_name (GIObjectInfo *info);
  168. GI_AVAILABLE_IN_ALL
  169. GIObjectInfoSetValueFunction gi_object_info_get_set_value_function_pointer (GIObjectInfo *info);
  170. GI_AVAILABLE_IN_ALL
  171. const char * gi_object_info_get_get_value_function_name (GIObjectInfo *info);
  172. GI_AVAILABLE_IN_ALL
  173. GIObjectInfoGetValueFunction gi_object_info_get_get_value_function_pointer (GIObjectInfo *info);
  174. G_END_DECLS