comparison src/dbus-server.h @ 11146:1c5398ccbeb0

[gaim-migrate @ 13217] Gaim-DBUS signal export works with DBUS >= 0.35 Various gaim API functions available through DBUS committer: Tailor Script <tailor@pidgin.im>
author Piotr Zielinski <zielaj>
date Fri, 22 Jul 2005 19:47:29 +0000
parents 0754ce8f1122
children ebb02ea3c789
comparison
equal deleted inserted replaced
11145:dbc518c453f2 11146:1c5398ccbeb0
41 } DbusErrorCodes; 41 } DbusErrorCodes;
42 42
43 /* Types of pointers that can be registered with the gaim dbus pointer 43 /* Types of pointers that can be registered with the gaim dbus pointer
44 registration engine. See below */ 44 registration engine. See below */
45 typedef enum { 45 typedef enum {
46 DBUS_POINTER_GROUP, 46 DBUS_POINTER_NONE = 0,
47 DBUS_POINTER_CONTACT, 47 #include "dbus-auto-enum-types.h"
48 DBUS_POINTER_BUDDY, 48 DBUS_POINTER_LASTTYPE
49 DBUS_POINTER_CHAT,
50 DBUS_POINTER_ACCOUNT
51 } GaimDBusPointerType; 49 } GaimDBusPointerType;
52 50
53 typedef struct _GaimObject GaimObject; 51 typedef struct _GaimObject GaimObject;
54 52
55 /** The main GaimObject */ 53 /** The main GaimObject */
108 106
109 @param node The pointer to register. 107 @param node The pointer to register.
110 */ 108 */
111 void gaim_dbus_unregister_pointer(gpointer node); 109 void gaim_dbus_unregister_pointer(gpointer node);
112 110
113 /**
114 Registers a gaim signal with a #GaimObject.
115 111
116 @param object The #GaimObject (usually #gaim_dbus_object)
117 @param name Name of the signal
118 @param marshaller Marshaller for the signal.
119 @param num_values The number of parameters.
120 @param values Array of pointers to #GaimValue objects representing
121 the types of the parameters.
122 @result The dbus id of the registered signal.
123
124 This function is intended to be used in signal.h, where it
125 automatically registers all gaim signals with dbus. For your own
126 dbus signals, use #gaim_dbus_register.
127
128 The name of the signal, usually in the form "aaa-bbb-ccc", is
129 converted into DBus standard, "AaaBbbCcc", because "aaa-bbb-ccc"
130 doesn't work with DBus GObject binding version 0.34 (cvs version is ok).
131
132 The #marshaller can be set to gaim_dbus_invalid_marshaller because
133 DBus signals are never passed to any local handler.
134 */
135 int gaim_dbus_signal_register_gaim(GaimObject *object, const char *name,
136 GSignalCMarshaller marshaller,
137 int num_values, GaimValue **values);
138 112
139 /** 113 /**
140 Emits a dbus signal. 114 Emits a dbus signal.
141 115
142 @param object The #GaimObject (usually #gaim_dbus_object) 116 @param object The #GaimObject (usually #gaim_dbus_object)
148 122
149 This function is intended to be used in signal.h, where it 123 This function is intended to be used in signal.h, where it
150 automatically emits all gaim signals to dbus. For your own dbus 124 automatically emits all gaim signals to dbus. For your own dbus
151 signals, use #gaim_dbus_emit. 125 signals, use #gaim_dbus_emit.
152 */ 126 */
153 void gaim_dbus_signal_emit_gaim(GaimObject *object, int dbus_id, 127 void gaim_dbus_signal_emit_gaim(GaimObject *object, char *name,
154 int num_values, GaimValue **values, va_list vargs); 128 int num_values, GaimValue **values,
129 va_list vargs);
155 130
156 /**
157 A marshaller that emits an "assertion failed" message if called.
158
159 This marshaller is intended to use with signal that will never need to be marshalled.
160 */
161 void gaim_dbus_invalid_marshaller(GClosure *closure,
162 GValue *return_value,
163 guint n_param_values,
164 const GValue *param_values,
165 gpointer invocation_hint,
166 gpointer marshal_data);
167
168 /**
169 Registers a gaim signal with a #GaimObject.
170
171 @param object The #GaimObject (usually #gaim_dbus_object)
172 @param name Name of the signal
173 @param marshaller Marshaller for the signal.
174 @param num_values The number of parameters.
175 @param ... List of GType of the parameter types.
176
177 @result The dbus id of the registered signal.
178 */
179 int gaim_dbus_signal_register(GaimObject *object, const char *name,
180 GSignalCMarshaller marshaller,
181 int num_values, ...);
182
183 /**
184 Emits a dbus signal.
185
186 @param object The #GaimObject (usually #gaim_dbus_object)
187 @param dbus_id Id of the signal.
188 @param ... Actual parameters.
189 */
190 void gaim_dbus_signal_emit(GaimObject *object, int dbus_id, ...);
191
192 /**
193 Emits a dbus signal.
194
195 @param object The #GaimObject (usually #gaim_dbus_object)
196 @param dbus_id Id of the signal.
197 @param args A va_list containing the actual parameters.
198 */
199 void gaim_dbus_signal_emit_valist(GaimObject *object, int dbus_id, va_list args);
200 131
201 132
202 G_END_DECLS 133 G_END_DECLS
203 134
204 #endif /* _GAIM_DBUS_SERVER_H_ */ 135 #endif /* _GAIM_DBUS_SERVER_H_ */