Re: [Rhythmbox-devel] D-BUS APi questions



On Tue, Apr 25, 2006 at 07:39:17PM -0400, Tim Moloney wrote:
> Jonathan Matthew wrote:
> >On Sat, Apr 22, 2006 at 06:04:38PM -0400, Tim Moloney wrote:
> >  
> >>I have three questions regarding the D-BUS API.
> >>
> >>There are four signals (playingChanged, playingUriChanged, 
> >>elapsedChanged, and visibilityChanged).  Except for visibility, there 
> >>are matching accessor methods (getPlaying, getPlayingUri, getElapsed).  
> >>Can a getVisibility accessor be added?  If so, then an application can 
> >>initialize itself using the accessor methods and use the signals to stay 
> >>in sync.
> >>    
> >
> >This is the sort of thing we should be using the dbus Properties
> >interface for.
> >  
> 
> I'm still new to D-BUS.  Is this something that automatically generates 
> the D-BUS interface .xml files?

The Properties interface just specifies get and set methods for
properties, like g_object_get and g_object_set in glib.  If you use the
dbus-viewer tool, you can see that each of the rhythmbox dbus objects
implement three interfaces: org.freedesktop.DBus.Introspectable,
org.freedesktop.DBus.Properties, and the rhythmbox interface for that
object.

The dbus glib bindings provide some level of automatic support for it,
so if 'visibility' was a property on the RBShell object (which it
isn't), all we'd need to do (in theory) would be to add this to
rb-shell.xml:

  <property name="visibility" type="b"/>

It currently isn't a property, but maybe it should be.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]