Mercurial > pidgin
comparison src/dbus-server.h @ 11067:2eca9ed49469
[gaim-migrate @ 13048]
Modified configure.ac so that it rejects dbus builds with the dbus
library older than 0.34
Added a simple object registration system to the dbus implementation
so that it is possible to query object properties remotely (eg. give
me property "name" of buddy with id = 5).
committer: Tailor Script <tailor@pidgin.im>
author | Piotr Zielinski <zielaj> |
---|---|
date | Thu, 07 Jul 2005 15:43:48 +0000 |
parents | df0241eb602c |
children | f54740547c95 |
comparison
equal
deleted
inserted
replaced
11066:2507d20c3d0b | 11067:2eca9ed49469 |
---|---|
25 */ | 25 */ |
26 | 26 |
27 #ifndef _GAIM_DBUS_SERVER_H_ | 27 #ifndef _GAIM_DBUS_SERVER_H_ |
28 #define _GAIM_DBUS_SERVER_H_ | 28 #define _GAIM_DBUS_SERVER_H_ |
29 | 29 |
30 | |
30 G_BEGIN_DECLS | 31 G_BEGIN_DECLS |
32 | |
33 /* These are the categories of codes used by gaim dbus implementation | |
34 for remote calls. In practice, they don't matter | |
35 */ | |
36 typedef enum { | |
37 DBUS_ERROR_NONE = 0, | |
38 DBUS_ERROR_NOT_FOUND = 1 | |
39 } DbusErrorCodes; | |
40 | |
41 /* Types of pointers that can be registered with the gaim dbus pointer | |
42 registration engine. See below */ | |
43 typedef enum { | |
44 DBUS_POINTER_GROUP, | |
45 DBUS_POINTER_CONTACT, | |
46 DBUS_POINTER_BUDDY, | |
47 DBUS_POINTER_CHAT, | |
48 DBUS_POINTER_ACCOUNT | |
49 } GaimDBusPointerType; | |
50 | |
31 | 51 |
32 /** | 52 /** |
33 * Starts the gaim DBUS server. It is responsible for handling DBUS | 53 * Starts the gaim DBUS server. It is responsible for handling DBUS |
34 * requests from other applications. | 54 * requests from other applications. |
35 * | 55 * |
36 * @return TRUE if successful, FALSE otherwise. | 56 * @return TRUE if successful, FALSE otherwise. |
37 */ | 57 */ |
38 gboolean dbus_server_init(void); | 58 gboolean dbus_server_init(void); |
39 | 59 |
60 /** | |
61 Initializes gaim dbus pointer registration engine. | |
62 | |
63 Remote dbus applications need a way of addressing objects exposed | |
64 by gaim to the outside world. In gaim itself, these objects (such | |
65 as GaimBuddy and company) are identified by pointers. The gaim | |
66 dbus pointer registration engine converts pointers to handles and | |
67 back. | |
68 | |
69 In order for an object to participate in the scheme, it must | |
70 register itself and its type with the engine. This registration | |
71 allocates an integer id which can be resolved to the pointer and | |
72 back. | |
73 | |
74 Handles are not persistent. They are reissued every time gaim is | |
75 started. This is not good; external applications that use gaim | |
76 should work even whether gaim was restarted in the middle of the | |
77 interaction. | |
78 | |
79 Pointer registration is only a temporary solution. When GaimBuddy | |
80 and similar structures have been converted into gobjects, this | |
81 registration will be done automatically by objects themselves. | |
82 | |
83 By the way, this kind of object-handle translation should be so | |
84 common that there must be a library (maybe even glib) that | |
85 implements it. I feel a bit like reinventing the wheel here. | |
86 */ | |
87 void gaim_dbus_init_ids(void); | |
88 | |
89 /** | |
90 Registers a typed pointer. | |
91 | |
92 @node The pointer to register. | |
93 @type Type of that pointer. | |
94 */ | |
95 void gaim_dbus_register_pointer(gpointer node, GaimDBusPointerType type); | |
96 | |
97 /** | |
98 Unregisters a pointer previously registered with | |
99 gaim_dbus_register_pointer. | |
100 | |
101 @node The pointer to register. | |
102 */ | |
103 void gaim_dbus_unregister_pointer(gpointer node); | |
104 | |
105 | |
40 G_END_DECLS | 106 G_END_DECLS |
41 | 107 |
42 #endif /* _GAIM_DBUS_SERVER_H_ */ | 108 #endif /* _GAIM_DBUS_SERVER_H_ */ |