00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef DBUS_GLIB_H
00025 #define DBUS_GLIB_H
00026
00027 #include <dbus/dbus.h>
00028 #include <glib-object.h>
00029
00030 G_BEGIN_DECLS
00031
00032 #define DBUS_INSIDE_DBUS_GLIB_H 1
00033
00034 GQuark dbus_g_error_quark (void);
00035 #define DBUS_GERROR dbus_g_error_quark ()
00036
00037 #define DBUS_TYPE_CONNECTION (dbus_connection_get_g_type ())
00038 #define DBUS_TYPE_MESSAGE (dbus_message_get_g_type ())
00039 GType dbus_connection_get_g_type (void) G_GNUC_CONST;
00040 GType dbus_message_get_g_type (void) G_GNUC_CONST;
00041
00042 typedef enum
00043 {
00044
00045
00046
00047
00048 DBUS_GERROR_FAILED
00049 } DBusGError;
00050
00051 void dbus_set_g_error (GError **gerror,
00052 DBusError *derror);
00053
00054 void dbus_g_thread_init (void);
00055 void dbus_connection_setup_with_g_main (DBusConnection *connection,
00056 GMainContext *context);
00057 void dbus_server_setup_with_g_main (DBusServer *server,
00058 GMainContext *context);
00059 DBusConnection* dbus_bus_get_with_g_main (DBusBusType type,
00060 GError **error);
00061
00062 typedef struct DBusGObjectInfo DBusGObjectInfo;
00063 typedef struct DBusGMethodInfo DBusGMethodInfo;
00064
00070 struct DBusGMethodInfo
00071 {
00072 GCallback function;
00073 DBusHandleMessageFunction marshaller;
00074 int data_offset;
00075 };
00076
00081 struct DBusGObjectInfo
00082 {
00083 int format_version;
00086 const DBusGMethodInfo *infos;
00087 const unsigned char *data;
00088 };
00089
00090 void dbus_g_object_class_install_info (GObjectClass *object_class,
00091 const DBusGObjectInfo *info);
00092 void dbus_connection_register_g_object (DBusConnection *connection,
00093 const char *at_path,
00094 GObject *object);
00095
00096
00097 typedef struct DBusGProxy DBusGProxy;
00098 typedef struct DBusGProxyClass DBusGProxyClass;
00099
00100 typedef void (* DBusGProxySignalHandler) (DBusGProxy *proxy,
00101 DBusMessage *signal,
00102 void *user_data);
00103
00104 #define DBUS_TYPE_GPROXY (dbus_gproxy_get_type ())
00105 #define DBUS_GPROXY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DBUS_TYPE_GPROXY, DBusGProxy))
00106 #define DBUS_GPROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_TYPE_GPROXY, DBusGProxyClass))
00107 #define DBUS_IS_GPROXY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DBUS_TYPE_GPROXY))
00108 #define DBUS_IS_GPROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_TYPE_GPROXY))
00109 #define DBUS_GPROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUS_TYPE_GPROXY, DBusGProxyClass))
00110
00111
00112 GType dbus_gproxy_get_type (void) G_GNUC_CONST;
00113 DBusGProxy* dbus_gproxy_new_for_service (DBusConnection *connection,
00114 const char *service_name,
00115 const char *path_name,
00116 const char *interface_name);
00117 DBusGProxy* dbus_gproxy_new_for_service_owner (DBusConnection *connection,
00118 const char *service_name,
00119 const char *path_name,
00120 const char *interface_name,
00121 GError **error);
00122 DBusGProxy* dbus_gproxy_new_for_peer (DBusConnection *connection,
00123 const char *path_name,
00124 const char *interface_name);
00125 void dbus_gproxy_connect_signal (DBusGProxy *proxy,
00126 const char *signal_name,
00127 DBusGProxySignalHandler handler,
00128 void *data,
00129 GClosureNotify free_data_func);
00130 void dbus_gproxy_disconnect_signal (DBusGProxy *proxy,
00131 const char *signal_name,
00132 DBusGProxySignalHandler handler,
00133 void *data);
00134 DBusPendingCall* dbus_gproxy_begin_call (DBusGProxy *proxy,
00135 const char *method,
00136 int first_arg_type,
00137 ...);
00138 gboolean dbus_gproxy_end_call (DBusGProxy *proxy,
00139 DBusPendingCall *pending,
00140 GError **error,
00141 int first_arg_type,
00142 ...);
00143 void dbus_gproxy_call_no_reply (DBusGProxy *proxy,
00144 const char *method,
00145 int first_arg_type,
00146 ...);
00147 void dbus_gproxy_send (DBusGProxy *proxy,
00148 DBusMessage *message,
00149 dbus_uint32_t *client_serial);
00150
00151
00152 #undef DBUS_INSIDE_DBUS_GLIB_H
00153
00154 G_END_DECLS
00155
00156 #endif
00157
00158
00159