You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

287 regels
11 KiB

  1. /* GDBus - GLib D-Bus Library
  2. *
  3. * Copyright (C) 2008-2010 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: David Zeuthen <davidz@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_DBUS_INTROSPECTION_H__
  26. #define __G_DBUS_INTROSPECTION_H__
  27. #include <gio/giotypes.h>
  28. G_BEGIN_DECLS
  29. /**
  30. * GDBusAnnotationInfo:
  31. * @ref_count: The reference count or -1 if statically allocated.
  32. * @key: The name of the annotation, e.g. "org.freedesktop.DBus.Deprecated".
  33. * @value: The value of the annotation.
  34. * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
  35. *
  36. * Information about an annotation.
  37. *
  38. * Since: 2.26
  39. */
  40. struct _GDBusAnnotationInfo
  41. {
  42. volatile gint ref_count;
  43. gchar *key;
  44. gchar *value;
  45. GDBusAnnotationInfo **annotations;
  46. };
  47. /**
  48. * GDBusArgInfo:
  49. * @ref_count: The reference count or -1 if statically allocated.
  50. * @name: Name of the argument, e.g. @unix_user_id.
  51. * @signature: D-Bus signature of the argument (a single complete type).
  52. * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
  53. *
  54. * Information about an argument for a method or a signal.
  55. *
  56. * Since: 2.26
  57. */
  58. struct _GDBusArgInfo
  59. {
  60. volatile gint ref_count;
  61. gchar *name;
  62. gchar *signature;
  63. GDBusAnnotationInfo **annotations;
  64. };
  65. /**
  66. * GDBusMethodInfo:
  67. * @ref_count: The reference count or -1 if statically allocated.
  68. * @name: The name of the D-Bus method, e.g. @RequestName.
  69. * @in_args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no in arguments.
  70. * @out_args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no out arguments.
  71. * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
  72. *
  73. * Information about a method on an D-Bus interface.
  74. *
  75. * Since: 2.26
  76. */
  77. struct _GDBusMethodInfo
  78. {
  79. volatile gint ref_count;
  80. gchar *name;
  81. GDBusArgInfo **in_args;
  82. GDBusArgInfo **out_args;
  83. GDBusAnnotationInfo **annotations;
  84. };
  85. /**
  86. * GDBusSignalInfo:
  87. * @ref_count: The reference count or -1 if statically allocated.
  88. * @name: The name of the D-Bus signal, e.g. "NameOwnerChanged".
  89. * @args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no arguments.
  90. * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
  91. *
  92. * Information about a signal on a D-Bus interface.
  93. *
  94. * Since: 2.26
  95. */
  96. struct _GDBusSignalInfo
  97. {
  98. volatile gint ref_count;
  99. gchar *name;
  100. GDBusArgInfo **args;
  101. GDBusAnnotationInfo **annotations;
  102. };
  103. /**
  104. * GDBusPropertyInfo:
  105. * @ref_count: The reference count or -1 if statically allocated.
  106. * @name: The name of the D-Bus property, e.g. "SupportedFilesystems".
  107. * @signature: The D-Bus signature of the property (a single complete type).
  108. * @flags: Access control flags for the property.
  109. * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
  110. *
  111. * Information about a D-Bus property on a D-Bus interface.
  112. *
  113. * Since: 2.26
  114. */
  115. struct _GDBusPropertyInfo
  116. {
  117. volatile gint ref_count;
  118. gchar *name;
  119. gchar *signature;
  120. GDBusPropertyInfoFlags flags;
  121. GDBusAnnotationInfo **annotations;
  122. };
  123. /**
  124. * GDBusInterfaceInfo:
  125. * @ref_count: The reference count or -1 if statically allocated.
  126. * @name: The name of the D-Bus interface, e.g. "org.freedesktop.DBus.Properties".
  127. * @methods: A pointer to a %NULL-terminated array of pointers to #GDBusMethodInfo structures or %NULL if there are no methods.
  128. * @signals: A pointer to a %NULL-terminated array of pointers to #GDBusSignalInfo structures or %NULL if there are no signals.
  129. * @properties: A pointer to a %NULL-terminated array of pointers to #GDBusPropertyInfo structures or %NULL if there are no properties.
  130. * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
  131. *
  132. * Information about a D-Bus interface.
  133. *
  134. * Since: 2.26
  135. */
  136. struct _GDBusInterfaceInfo
  137. {
  138. volatile gint ref_count;
  139. gchar *name;
  140. GDBusMethodInfo **methods;
  141. GDBusSignalInfo **signals;
  142. GDBusPropertyInfo **properties;
  143. GDBusAnnotationInfo **annotations;
  144. };
  145. /**
  146. * GDBusNodeInfo:
  147. * @ref_count: The reference count or -1 if statically allocated.
  148. * @path: The path of the node or %NULL if omitted. Note that this may be a relative path. See the D-Bus specification for more details.
  149. * @interfaces: A pointer to a %NULL-terminated array of pointers to #GDBusInterfaceInfo structures or %NULL if there are no interfaces.
  150. * @nodes: A pointer to a %NULL-terminated array of pointers to #GDBusNodeInfo structures or %NULL if there are no nodes.
  151. * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
  152. *
  153. * Information about nodes in a remote object hierarchy.
  154. *
  155. * Since: 2.26
  156. */
  157. struct _GDBusNodeInfo
  158. {
  159. volatile gint ref_count;
  160. gchar *path;
  161. GDBusInterfaceInfo **interfaces;
  162. GDBusNodeInfo **nodes;
  163. GDBusAnnotationInfo **annotations;
  164. };
  165. const gchar *g_dbus_annotation_info_lookup (GDBusAnnotationInfo **annotations,
  166. const gchar *name);
  167. GDBusMethodInfo *g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info,
  168. const gchar *name);
  169. GDBusSignalInfo *g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info,
  170. const gchar *name);
  171. GDBusPropertyInfo *g_dbus_interface_info_lookup_property (GDBusInterfaceInfo *info,
  172. const gchar *name);
  173. void g_dbus_interface_info_generate_xml (GDBusInterfaceInfo *info,
  174. guint indent,
  175. GString *string_builder);
  176. GDBusNodeInfo *g_dbus_node_info_new_for_xml (const gchar *xml_data,
  177. GError **error);
  178. GDBusInterfaceInfo *g_dbus_node_info_lookup_interface (GDBusNodeInfo *info,
  179. const gchar *name);
  180. void g_dbus_node_info_generate_xml (GDBusNodeInfo *info,
  181. guint indent,
  182. GString *string_builder);
  183. GDBusNodeInfo *g_dbus_node_info_ref (GDBusNodeInfo *info);
  184. GDBusInterfaceInfo *g_dbus_interface_info_ref (GDBusInterfaceInfo *info);
  185. GDBusMethodInfo *g_dbus_method_info_ref (GDBusMethodInfo *info);
  186. GDBusSignalInfo *g_dbus_signal_info_ref (GDBusSignalInfo *info);
  187. GDBusPropertyInfo *g_dbus_property_info_ref (GDBusPropertyInfo *info);
  188. GDBusArgInfo *g_dbus_arg_info_ref (GDBusArgInfo *info);
  189. GDBusAnnotationInfo *g_dbus_annotation_info_ref (GDBusAnnotationInfo *info);
  190. void g_dbus_node_info_unref (GDBusNodeInfo *info);
  191. void g_dbus_interface_info_unref (GDBusInterfaceInfo *info);
  192. void g_dbus_method_info_unref (GDBusMethodInfo *info);
  193. void g_dbus_signal_info_unref (GDBusSignalInfo *info);
  194. void g_dbus_property_info_unref (GDBusPropertyInfo *info);
  195. void g_dbus_arg_info_unref (GDBusArgInfo *info);
  196. void g_dbus_annotation_info_unref (GDBusAnnotationInfo *info);
  197. /**
  198. * G_TYPE_DBUS_NODE_INFO:
  199. *
  200. * The #GType for a boxed type holding a #GDBusNodeInfo.
  201. *
  202. * Since: 2.26
  203. */
  204. #define G_TYPE_DBUS_NODE_INFO (g_dbus_node_info_get_type ())
  205. /**
  206. * G_TYPE_DBUS_INTERFACE_INFO:
  207. *
  208. * The #GType for a boxed type holding a #GDBusInterfaceInfo.
  209. *
  210. * Since: 2.26
  211. */
  212. #define G_TYPE_DBUS_INTERFACE_INFO (g_dbus_interface_info_get_type ())
  213. /**
  214. * G_TYPE_DBUS_METHOD_INFO:
  215. *
  216. * The #GType for a boxed type holding a #GDBusMethodInfo.
  217. *
  218. * Since: 2.26
  219. */
  220. #define G_TYPE_DBUS_METHOD_INFO (g_dbus_method_info_get_type ())
  221. /**
  222. * G_TYPE_DBUS_SIGNAL_INFO:
  223. *
  224. * The #GType for a boxed type holding a #GDBusSignalInfo.
  225. *
  226. * Since: 2.26
  227. */
  228. #define G_TYPE_DBUS_SIGNAL_INFO (g_dbus_signal_info_get_type ())
  229. /**
  230. * G_TYPE_DBUS_PROPERTY_INFO:
  231. *
  232. * The #GType for a boxed type holding a #GDBusPropertyInfo.
  233. *
  234. * Since: 2.26
  235. */
  236. #define G_TYPE_DBUS_PROPERTY_INFO (g_dbus_property_info_get_type ())
  237. /**
  238. * G_TYPE_DBUS_ARG_INFO:
  239. *
  240. * The #GType for a boxed type holding a #GDBusArgInfo.
  241. *
  242. * Since: 2.26
  243. */
  244. #define G_TYPE_DBUS_ARG_INFO (g_dbus_arg_info_get_type ())
  245. /**
  246. * G_TYPE_DBUS_ANNOTATION_INFO:
  247. *
  248. * The #GType for a boxed type holding a #GDBusAnnotationInfo.
  249. *
  250. * Since: 2.26
  251. */
  252. #define G_TYPE_DBUS_ANNOTATION_INFO (g_dbus_annotation_info_get_type ())
  253. GType g_dbus_node_info_get_type (void) G_GNUC_CONST;
  254. GType g_dbus_interface_info_get_type (void) G_GNUC_CONST;
  255. GType g_dbus_method_info_get_type (void) G_GNUC_CONST;
  256. GType g_dbus_signal_info_get_type (void) G_GNUC_CONST;
  257. GType g_dbus_property_info_get_type (void) G_GNUC_CONST;
  258. GType g_dbus_arg_info_get_type (void) G_GNUC_CONST;
  259. GType g_dbus_annotation_info_get_type (void) G_GNUC_CONST;
  260. G_END_DECLS
  261. #endif /* __G_DBUS_INTROSPECTION_H__ */