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 const DBusGMethodInfo *infos;
00084 const unsigned char *data;
00085 void *dbus_internal_padding1;
00086 void *dbus_internal_padding2;
00087 };
00088
00089 void dbus_g_object_class_install_info (GObjectClass *object_class,
00090 const DBusGObjectInfo *info);
00091 void dbus_connection_register_g_object (DBusConnection *connection,
00092 const char *at_path,
00093 GObject *object);
00094
00095
00096 typedef struct DBusGProxy DBusGProxy;
00097 typedef struct DBusGProxyClass DBusGProxyClass;
00098
00099 typedef void (* DBusGProxySignalHandler) (DBusGProxy *proxy,
00100 DBusMessage *signal,
00101 void *user_data);
00102
00103 #define DBUS_TYPE_GPROXY (dbus_gproxy_get_type ())
00104 #define DBUS_GPROXY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DBUS_TYPE_GPROXY, DBusGProxy))
00105 #define DBUS_GPROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_TYPE_GPROXY, DBusGProxyClass))
00106 #define DBUS_IS_GPROXY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DBUS_TYPE_GPROXY))
00107 #define DBUS_IS_GPROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_TYPE_GPROXY))
00108 #define DBUS_GPROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUS_TYPE_GPROXY, DBusGProxyClass))
00109
00110
00111 GType dbus_gproxy_get_type (void) G_GNUC_CONST;
00112 DBusGProxy* dbus_gproxy_new_for_service (DBusConnection *connection,
00113 const char *service_name,
00114 const char *path_name,
00115 const char *interface_name);
00116 DBusGProxy* dbus_gproxy_new_for_service_owner (DBusConnection *connection,
00117 const char *service_name,
00118 const char *path_name,
00119 const char *interface_name,
00120 GError **error);
00121 DBusGProxy* dbus_gproxy_new_for_peer (DBusConnection *connection,
00122 const char *path_name,
00123 const char *interface_name);
00124 void dbus_gproxy_connect_signal (DBusGProxy *proxy,
00125 const char *signal_name,
00126 DBusGProxySignalHandler handler,
00127 void *data,
00128 GClosureNotify free_data_func);
00129 void dbus_gproxy_disconnect_signal (DBusGProxy *proxy,
00130 const char *signal_name,
00131 DBusGProxySignalHandler handler,
00132 void *data);
00133 DBusPendingCall* dbus_gproxy_begin_call (DBusGProxy *proxy,
00134 const char *method,
00135 int first_arg_type,
00136 ...);
00137 gboolean dbus_gproxy_end_call (DBusGProxy *proxy,
00138 DBusPendingCall *pending,
00139 GError **error,
00140 int first_arg_type,
00141 ...);
00142 void dbus_gproxy_call_no_reply (DBusGProxy *proxy,
00143 const char *method,
00144 int first_arg_type,
00145 ...);
00146 void dbus_gproxy_send (DBusGProxy *proxy,
00147 DBusMessage *message,
00148 dbus_uint32_t *client_serial);
00149
00150
00151 #undef DBUS_INSIDE_DBUS_GLIB_H
00152
00153 G_END_DECLS
00154
00155 #endif
00156
00157
00158