1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-glib.h GLib integration
4 * Copyright (C) 2002, 2003 CodeFactory AB
5 * Copyright (C) 2003, 2004 Red Hat, Inc.
7 * Licensed under the Academic Free License version 2.1
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program 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
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include <glib-object.h>
28 #include <dbus/dbus-protocol.h>
29 #include <dbus/dbus-shared.h>
33 #define DBUS_INSIDE_DBUS_GLIB_H 1
37 * Convert to DBusConnection with dbus_g_connection_get_connection()
39 typedef struct DBusGConnection DBusGConnection;
41 * Convert to DBusMessage with dbus_g_message_get_message()
43 typedef struct DBusGMessage DBusGMessage;
45 * Deliberately not possible to convert to DBusPendingCall
47 typedef struct DBusGPendingCall DBusGPendingCall;
49 void dbus_g_connection_flush (DBusGConnection *connection);
51 GQuark dbus_g_error_quark (void);
52 #define DBUS_GERROR dbus_g_error_quark ()
56 #include <dbus/dbus-glib-error-enum.h>
59 void dbus_g_thread_init (void);
60 DBusGConnection* dbus_g_bus_get (DBusBusType type,
63 typedef struct DBusGObjectInfo DBusGObjectInfo;
64 typedef struct DBusGMethodInfo DBusGMethodInfo;
66 typedef DBusHandlerResult (* DBusGMethodMarshaller) (DBusGConnection *connection,
67 DBusGMessage *message,
71 * Object typically generated by dbus-glib-tool that
72 * stores a mapping from introspection data to a
73 * function pointer for a C method to be invoked.
75 struct DBusGMethodInfo
77 GCallback function; /**< C method to invoke */
78 DBusGMethodMarshaller marshaller; /**< Marshaller to go DBusGMessage to C method */
79 int data_offset; /**< Offset into the introspection data */
83 * Introspection data for a GObject, normally autogenerated by
84 * a tool such as dbus-glib-tool.
86 struct DBusGObjectInfo
88 int format_version; /**< Allows us to change the rest of this struct
89 * by adding DBusGObjectInfo2, DBusGObjectInfo3, etc.
91 const DBusGMethodInfo *infos; /**< Array of method pointers */
92 const unsigned char *data; /**< Introspection data */
95 void dbus_g_object_class_install_info (GObjectClass *object_class,
96 const DBusGObjectInfo *info);
97 void dbus_g_connection_register_g_object (DBusGConnection *connection,
102 typedef struct DBusGProxy DBusGProxy;
103 typedef struct DBusGProxyClass DBusGProxyClass;
105 #define DBUS_TYPE_G_PROXY (dbus_g_proxy_get_type ())
106 #define DBUS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DBUS_TYPE_G_PROXY, DBusGProxy))
107 #define DBUS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_TYPE_G_PROXY, DBusGProxyClass))
108 #define DBUS_IS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DBUS_TYPE_G_PROXY))
109 #define DBUS_IS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_TYPE_G_PROXY))
110 #define DBUS_G_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUS_TYPE_G_PROXY, DBusGProxyClass))
113 GType dbus_g_proxy_get_type (void) G_GNUC_CONST;
114 DBusGProxy* dbus_g_proxy_new_for_name (DBusGConnection *connection,
117 const char *interface);
118 DBusGProxy* dbus_g_proxy_new_for_name_owner (DBusGConnection *connection,
121 const char *interface,
123 DBusGProxy* dbus_g_proxy_new_for_peer (DBusGConnection *connection,
124 const char *path_name,
125 const char *interface_name);
126 void dbus_g_proxy_connect_signal (DBusGProxy *proxy,
127 const char *signal_name,
130 GClosureNotify free_data_func);
131 void dbus_g_proxy_disconnect_signal (DBusGProxy *proxy,
132 const char *signal_name,
135 DBusGPendingCall* dbus_g_proxy_begin_call (DBusGProxy *proxy,
139 gboolean dbus_g_proxy_end_call (DBusGProxy *proxy,
140 DBusGPendingCall *pending,
144 void dbus_g_proxy_call_no_reply (DBusGProxy *proxy,
150 #undef DBUS_INSIDE_DBUS_GLIB_H
154 #endif /* DBUS_GLIB_H */