C convenience lib (was Re: Is dbus_pending_call_set_notify() thread safe?)

nf2 nf2 at scheinwelt.at
Wed Aug 1 15:47:07 PDT 2007


Thiago Macieira wrote:
> nf2 wrote:
>   
>> Havoc Pennington wrote:
>>     
>>> Hi,
>>>
>>> Fan Wu wrote:
>>>       
>>>> I understand your concern of convenience API. But I think right now
>>>> there is market for easy to use, lightweight C bindings of libdbus.
>>>>         
>>> I do agree btw, but I want to see someone really take this on rather
>>> than feature-creeping libdbus in a haphazard way. I already feel bad
>>> about most of dbus-bus.h.
>>>
>>> I recently posted that "gbus" git repo, and the header file in there
>>> shows what I think are some of the most interesting convenience
>>> features to have. That sketch of an API uses GLib, but doesn't do any
>>> data marshaling / type conversion stuff and really only uses GLib for
>>> the main loop.
>>>       
>> I remember there were some problems with Qt and GLib based libraries,
>> not being able to share the same D-BUS connection (although Qt can be
>> built with GLib support). Now, if Qt uses "gbus" when built with GLib
>> main-loop support - would this problem go away?
>>     
>
> QtDBus doesn't share its D-Bus connections intentionally. It's not related 
> to the mainloop. That will not change even if the main loop changes.
>
> We also have no intention of using "gbus". It simply doesn't make sense 
> for us.
>
> However, QtDBus cannot be used inside the same process as other bindings 
> due to the thread symbols issue I've already raised. QtDBus will call 
> dbus_thread_init, which means no other binding, library or the 
> application can.
>
>   
I thought that Qt uses GLib threads when compiled with GLib support.

So if there were a tiny "gbus" library, just caring about the main-loop 
watches and threads, being used by both Qt and the bigger GLib bindings, 
things should work...

Otherwise it will be hard to design asynchronous libraries, which 
internally use D-BUS, and can be used by both desktop environments... 
(And i believe that has been one reason for having GLib main loop 
support in Qt).





More information about the dbus mailing list