gdbusnamewatching.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Author: David Zeuthen <[email protected]>
  19. */
  20. #ifndef __G_DBUS_NAME_WATCHING_H__
  21. #define __G_DBUS_NAME_WATCHING_H__
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #include <gio/giotypes.h>
  26. G_BEGIN_DECLS
  27. /**
  28. * GBusNameAppearedCallback:
  29. * @connection: The #GDBusConnection the name is being watched on.
  30. * @name: The name being watched.
  31. * @name_owner: Unique name of the owner of the name being watched.
  32. * @user_data: User data passed to g_bus_watch_name().
  33. *
  34. * Invoked when the name being watched is known to have to have a owner.
  35. *
  36. * Since: 2.26
  37. */
  38. typedef void (*GBusNameAppearedCallback) (GDBusConnection *connection,
  39. const gchar *name,
  40. const gchar *name_owner,
  41. gpointer user_data);
  42. /**
  43. * GBusNameVanishedCallback:
  44. * @connection: The #GDBusConnection the name is being watched on, or
  45. * %NULL.
  46. * @name: The name being watched.
  47. * @user_data: User data passed to g_bus_watch_name().
  48. *
  49. * Invoked when the name being watched is known not to have to have a owner.
  50. *
  51. * This is also invoked when the #GDBusConection on which the watch was
  52. * established has been closed. In that case, @connection will be
  53. * %NULL.
  54. *
  55. * Since: 2.26
  56. */
  57. typedef void (*GBusNameVanishedCallback) (GDBusConnection *connection,
  58. const gchar *name,
  59. gpointer user_data);
  60. GLIB_AVAILABLE_IN_ALL
  61. guint g_bus_watch_name (GBusType bus_type,
  62. const gchar *name,
  63. GBusNameWatcherFlags flags,
  64. GBusNameAppearedCallback name_appeared_handler,
  65. GBusNameVanishedCallback name_vanished_handler,
  66. gpointer user_data,
  67. GDestroyNotify user_data_free_func);
  68. GLIB_AVAILABLE_IN_ALL
  69. guint g_bus_watch_name_on_connection (GDBusConnection *connection,
  70. const gchar *name,
  71. GBusNameWatcherFlags flags,
  72. GBusNameAppearedCallback name_appeared_handler,
  73. GBusNameVanishedCallback name_vanished_handler,
  74. gpointer user_data,
  75. GDestroyNotify user_data_free_func);
  76. GLIB_AVAILABLE_IN_ALL
  77. guint g_bus_watch_name_with_closures (GBusType bus_type,
  78. const gchar *name,
  79. GBusNameWatcherFlags flags,
  80. GClosure *name_appeared_closure,
  81. GClosure *name_vanished_closure);
  82. GLIB_AVAILABLE_IN_ALL
  83. guint g_bus_watch_name_on_connection_with_closures (
  84. GDBusConnection *connection,
  85. const gchar *name,
  86. GBusNameWatcherFlags flags,
  87. GClosure *name_appeared_closure,
  88. GClosure *name_vanished_closure);
  89. GLIB_AVAILABLE_IN_ALL
  90. void g_bus_unwatch_name (guint watcher_id);
  91. G_END_DECLS
  92. #endif /* __G_DBUS_NAME_WATCHING_H__ */