bug-hurd
[Top][All Lists]
Advanced

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

Re: Screensavers for the console


From: Marcus Brinkmann
Subject: Re: Screensavers for the console
Date: Sun, 11 May 2003 01:22:33 +0200
User-agent: Mutt/1.5.3i

On Sun, May 11, 2003 at 12:48:04AM +0200, M. Gerards wrote:
> Ok, that is why I designed the screensaver interfaces this way, to make it
> possible to display graphics when available. I just proposed adding graphics
> support to the vga driver because it seems like a nice thing to me (Low res.
> modes are easy to support and usable on all cards AFAIK). What I proposed is 
> not
> something like a framebuffer, a framebuffer will support more fancy graphics.

Let me be frank about this.  I have no idea what a desirable framebuffer
interface looks like, and I am not confident that the one you proposed is
such a one.  And despite what you write above, what you propose is a
framebuffer.  That it is not generic and/or performant makes it a bad
framebuffer interface, but a framebuffer interface it is.

>  /* Switch the display on or off. Set ONOFF to 0 to switch it on and 1
>    to switch it on. This function should only be implemented if supported
>    by hardware.  */
> error_t display_onoff (int onoff);

You shall not define policy.  If the display is switched off or if a cartoon
is displayed is exactly what the screensaver driver is supposed to decide.

The interface should be restricted to events.  I think you only need one
interface for screensaver drivers (but for clarity it could be split into
three functions):

error_t screensaver_event (event_type event);

where event is one of SLEEP/POWER-OFF/WAKEUP (for example).  The program
gets an option
--screensave-sleep=[time1]/--screensave-power-off=[time2]/--screensave-wakeup-at=[event]
[event] being "keypress", "output", or whatever (multiple allowed).

Then the generic code installs a timer for time1 which stops regular updates
and calls the screensaver_event(SLEEP), and a timer for time2 which stops
regular updates and calls the screensaver_event(POWER-OFF).  The various
places where input and output are handled check the current screensaving
mode and if it is yes, and if the corresponding wakeup-at option is given,
they call a console_Wakeup function which signals the screensaver_event
(WAKEUP), enables regular output, refreshes the screen and reinstalls the
timers.  This is approximately what I think would be a light-weight and
generic screensaver interface (and, in fact, I have now given most
details of an implementation, too).

If you want graphics, first write a couple of vga screensavers that ship
with the vga driver (one driver file can install several drivers, the
ncurses driver for example also installs a kbd, display and bell driver.

Likewise, a vga driver could install screensaver driver(s) (which one can be
a driver specific option).

When we have a second display driver that supports graphics beside vga,
_and_ you have rewritten the screensavers to support both display types in
graphic mode, _then_ you can worry about using the same stand-alone
screensaver driver for both display drivers.  And my proposal for that is
that the display drivers and such screensaver drivers negotiate with each
other over their own private protocol, which is not represented in the
generic interface.  This is certainly possible, and doesn't burden the
generic interface with something that is at this stage ultimatively a
cross-driver interaction (with no relevance to the generic part of the
console).

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus@gnu.org
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]