[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gEDA-dev: DBUS in external hid?
On Sat, 2006-10-07 at 23:50 -0400, DJ Delorie wrote:
> > For those who need it it's mostly transparent, for those who don't
> > need it easy to avoid.
>
> The problem with a dbus hid is that it needs to be able to respond to
> events even when the GUI isn't expecting them. That usually means the
> GUI needs to somehow poll for those events as part of its event loop.
> Thus, the gui needs to know at least *something* about the way the
> protocol works.
>
> Although, we could add something like Xt's api for listening on
> sockets - you register a file descriptor and a callback with Xt, and
> when there's data to be read on the file descriptor, the callback is
> called. We could probably hook that into all the guis somehow.
I think most X toolkits have some sort of mechanism which will do this,
and if you're using the raw DBUS API, then it ought to be possible to
pass a FD watch into your GUI's mainloop. It would be similar to the
register timer HID call, only with a FD. Not sure how generic it would
have to be, e.g. passing flags to set the different options you can pass
to the various GUI mainloops to in turn pass onto select.
> Of course, whether that's useful or not now depends on dbus being able
> to work with that kind of callback.
That is how the glib bindings are written internally.
I did wounder if it was sinful (or useful) to strip the glib bindings
down, incorporate a generic version of that into PCB, without relying on
glib signals, and without expecting there to be a mainloop... just
instead using callback function registration etc..
A bigger project than we intended to tackle at first whack, and I don't
see why dbus couldn't be a compile-in option for a GTK version of PCB.
Without any intention of offending the Lesstif users / developers, I
think the target audience of the tighter suite integration we were
looking at corresponds to those who I'd suggest used the GTK HID. I
would eventually like it to work across all GUIs, or without a GUI even.
Peter
_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev