SDL_dbus.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2014 Sam Lantinga <[email protected]>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #include "../../SDL_internal.h"
  19. #ifndef _SDL_dbus_h
  20. #define _SDL_dbus_h
  21. #ifdef HAVE_DBUS_DBUS_H
  22. #define SDL_USE_LIBDBUS 1
  23. #include "SDL_stdinc.h"
  24. #include <dbus/dbus.h>
  25. typedef struct SDL_DBusContext {
  26. DBusConnection *session_conn;
  27. DBusConnection *(*bus_get_private)(DBusBusType, DBusError *);
  28. dbus_bool_t (*bus_register)(DBusConnection *, DBusError *);
  29. void (*bus_add_match)(DBusConnection *, const char *, DBusError *);
  30. DBusConnection * (*connection_open_private)(const char *, DBusError *);
  31. void (*connection_set_exit_on_disconnect)(DBusConnection *, dbus_bool_t);
  32. dbus_bool_t (*connection_get_is_connected)(DBusConnection *);
  33. dbus_bool_t (*connection_add_filter)(DBusConnection *, DBusHandleMessageFunction,
  34. void *, DBusFreeFunction);
  35. dbus_bool_t (*connection_send)(DBusConnection *, DBusMessage *, dbus_uint32_t *);
  36. DBusMessage *(*connection_send_with_reply_and_block)(DBusConnection *, DBusMessage *, int, DBusError *);
  37. void (*connection_close)(DBusConnection *);
  38. void (*connection_unref)(DBusConnection *);
  39. void (*connection_flush)(DBusConnection *);
  40. dbus_bool_t (*connection_read_write)(DBusConnection *, int);
  41. DBusDispatchStatus (*connection_dispatch)(DBusConnection *);
  42. dbus_bool_t (*message_is_signal)(DBusMessage *, const char *, const char *);
  43. DBusMessage *(*message_new_method_call)(const char *, const char *, const char *, const char *);
  44. dbus_bool_t (*message_append_args)(DBusMessage *, int, ...);
  45. dbus_bool_t (*message_get_args)(DBusMessage *, DBusError *, int, ...);
  46. dbus_bool_t (*message_iter_init)(DBusMessage *, DBusMessageIter *);
  47. dbus_bool_t (*message_iter_next)(DBusMessageIter *);
  48. void (*message_iter_get_basic)(DBusMessageIter *, void *);
  49. int (*message_iter_get_arg_type)(DBusMessageIter *);
  50. void (*message_iter_recurse)(DBusMessageIter *, DBusMessageIter *);
  51. void (*message_unref)(DBusMessage *);
  52. void (*error_init)(DBusError *);
  53. dbus_bool_t (*error_is_set)(const DBusError *);
  54. void (*error_free)(DBusError *);
  55. char *(*get_local_machine_id)(void);
  56. void (*free)(void *);
  57. } SDL_DBusContext;
  58. extern void SDL_DBus_Init(void);
  59. extern void SDL_DBus_Quit(void);
  60. extern SDL_DBusContext * SDL_DBus_GetContext(void);
  61. extern void SDL_DBus_ScreensaverTickle(void);
  62. extern SDL_bool SDL_DBus_ScreensaverInhibit(SDL_bool inhibit);
  63. #endif /* HAVE_DBUS_DBUS_H */
  64. #endif /* _SDL_dbus_h */
  65. /* vi: set ts=4 sw=4 expandtab: */