Hi Andrew,
> Is it possible to write a plugin that has no update interval, and wakes up lcd4linux to redraw the widget instead?
>
Not yet. Not really.
> I'm looking into writing a d-bus plugin (the general idea is to turn lcd4linux into a d-bus service that allows clients to draw stuff on the LCD, and receive signals when buttons are pushed on the LCD keypad). Having lcd4linux poll the plugin, as appears to be the case with the default architecture, seems undesirable and a waste of CPU wakeups.
>
There is a workaround: A plugin can create its own thread where you can
do whatever you want. the main lcd4linux thread communicates with the
plugin over shared memory. So the main widget updater will poll the
shared memory with the specified update interval, and, if nothing
changed, will not redraw the widget (due to dpuble-buffering).
Take a look at the exec plugin, it works this way. Note that the reason
the exec plugin uses its own thread is different: the external command
may take much time, and this way it will not disturb the internal timing.
You are right, the design is not optimal. But this would require a quite
heavy redesign...
HTH, Michael
--
Michael Reinelt <mi...@re...>
http://home.pages.at/reinelt
GPG-Key 0xDF13BA50
ICQ #288386781
|