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 <glib-object.h>
00028 #include <dbus/dbus-protocol.h>
00029 #include <dbus/dbus-shared.h>
00030
00031 G_BEGIN_DECLS
00032
00033 #define DBUS_INSIDE_DBUS_GLIB_H 1
00034
00035
00039 typedef struct DBusGConnection DBusGConnection;
00043 typedef struct DBusGMessage DBusGMessage;
00047 typedef struct DBusGPendingCall DBusGPendingCall;
00048
00049 void dbus_g_connection_flush (DBusGConnection *connection);
00050
00051 GQuark dbus_g_error_quark (void);
00052 #define DBUS_GERROR dbus_g_error_quark ()
00053
00054 typedef enum
00055 {
00056 #include <dbus/dbus-glib-error-enum.h>
00057 } DBusGError;
00058
00059 void dbus_g_thread_init (void);
00060 DBusGConnection* dbus_g_bus_get (DBusBusType type,
00061 GError **error);
00062
00063 typedef struct DBusGObjectInfo DBusGObjectInfo;
00064 typedef struct DBusGMethodInfo DBusGMethodInfo;
00065
00066 typedef DBusHandlerResult (* DBusGMethodMarshaller) (DBusGConnection *connection,
00067 DBusGMessage *message,
00068 void *user_data);
00069
00075 struct DBusGMethodInfo
00076 {
00077 GCallback function;
00078 DBusGMethodMarshaller marshaller;
00079 int data_offset;
00080 };
00081
00086 struct DBusGObjectInfo
00087 {
00088 int format_version;
00091 const DBusGMethodInfo *infos;
00092 const unsigned char *data;
00093 };
00094
00095 void dbus_g_object_class_install_info (GObjectClass *object_class,
00096 const DBusGObjectInfo *info);
00097 void dbus_g_connection_register_g_object (DBusGConnection *connection,
00098 const char *at_path,
00099 GObject *object);
00100
00101
00102 typedef struct DBusGProxy DBusGProxy;
00103 typedef struct DBusGProxyClass DBusGProxyClass;
00104
00105 #define DBUS_TYPE_G_PROXY (dbus_g_proxy_get_type ())
00106 #define DBUS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DBUS_TYPE_G_PROXY, DBusGProxy))
00107 #define DBUS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_TYPE_G_PROXY, DBusGProxyClass))
00108 #define DBUS_IS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DBUS_TYPE_G_PROXY))
00109 #define DBUS_IS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_TYPE_G_PROXY))
00110 #define DBUS_G_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUS_TYPE_G_PROXY, DBusGProxyClass))
00111
00112
00113 GType dbus_g_proxy_get_type (void) G_GNUC_CONST;
00114 DBusGProxy* dbus_g_proxy_new_for_service (DBusGConnection *connection,
00115 const char *service_name,
00116 const char *path_name,
00117 const char *interface_name);
00118 DBusGProxy* dbus_g_proxy_new_for_service_owner (DBusGConnection *connection,
00119 const char *service_name,
00120 const char *path_name,
00121 const char *interface_name,
00122 GError **error);
00123 DBusGProxy* dbus_g_proxy_new_for_peer (DBusGConnection *connection,
00124 const char *path_name,
00125 const char *interface_name);
00126 void dbus_g_proxy_connect_signal (DBusGProxy *proxy,
00127 const char *signal_name,
00128 GCallback handler,
00129 void *data,
00130 GClosureNotify free_data_func);
00131 void dbus_g_proxy_disconnect_signal (DBusGProxy *proxy,
00132 const char *signal_name,
00133 GCallback handler,
00134 void *data);
00135 DBusGPendingCall* dbus_g_proxy_begin_call (DBusGProxy *proxy,
00136 const char *method,
00137 int first_arg_type,
00138 ...);
00139 gboolean dbus_g_proxy_end_call (DBusGProxy *proxy,
00140 DBusGPendingCall *pending,
00141 GError **error,
00142 int first_arg_type,
00143 ...);
00144 void dbus_g_proxy_call_no_reply (DBusGProxy *proxy,
00145 const char *method,
00146 int first_arg_type,
00147 ...);
00148
00149
00150 #undef DBUS_INSIDE_DBUS_GLIB_H
00151
00152 G_END_DECLS
00153
00154 #endif
00155
00156
00157