[Pidgin] #3241: Dbus Signals Introspection
Pidgin
trac at pidgin.im
Thu Sep 20 13:59:34 EDT 2007
#3241: Dbus Signals Introspection
-------------------------+--------------------------------------------------
Reporter: sunya | Type: enhancement
Status: new | Priority: minor
Component: libpurple | Version: 2.2.0
Keywords: dbus signal | Pending: 0
-------------------------+--------------------------------------------------
At this moment, Pidgin is emiting a lot of signals at dbus. But to use
them, there's no way to introspect them.
The present implementation only covers methods introspection.
An improvement to this situation is to add Dbus Signals Introspection.
Signals are not organized as methods, and they are almost defined as
needed.
purple_signal_emit(purple_blist_get_handle(), "buddy-signed-on", buddy);
purple_signal_emit(purple_conversations_get_handle(), "buddy-typing",
gc->account, name);
purple_signal_emit(my_protocol, "jabber-sending-text", js->gc, &data);
So I worked to detect the most frequent signals (ex "WroteImMsg"), and
generated an include file to extended the original introspected xml.
It's very similar to python method detection, but oriented to recover only
the signals.
Now there's no easy way to recover the parameters, and must be hardcoded.
<signal name='AccountAdded'>
</signal>
<signal name='AccountAliasChanged'>
</signal>
<signal name='AccountConnecting'>
</signal>
<signal name='AccountDisabled'>
</signal>
<signal name='AccountEnabled'>
</signal>
...
<signal name='WritingImMsg'>
</signal>
<signal name='WroteChatMsg'>
</signal>
<signal name='WroteImMsg'>
<arg name='account' type='i' direction='in'/>
<arg name='who' type='s' direction='in'/>
<arg name='message' type='s' direction='in'/>
<arg name='conv' type='i'/>
</signal>
The generated file dbus-signal-types.inc must be included at static
"DBusMessage *purple_dbus_introspect(DBusMessage *message)" line 492 in
dbus-server.c.
As a future improvement, must be implemented a cleaner way to recover or
define signals that support parameters too.
Thanks
Sunya
--
Ticket URL: <http://developer.pidgin.im/ticket/3241>
Pidgin <http://pidgin.im>
Pidgin
More information about the Tracker
mailing list