It took me a while to understand how the gradient code was
preventing banding, so this commit just adds some comments
explaing how it works, and moves some constants to preprocessor
defines for clarity
Right now we have this hack tower of function pointers
cutting through layers of code to get the password
from the splash plugin to the client. I'd like to cut
most of that out by just having one answer object that
the bottom layer and the the top layer know directly,
without the middle layers having to get too involved.
Previously we've just hard coded the location to the fedora
logo. Now it's a configure time flag. We also have a configure
time flag for a background color that goes with the logo, but
none of the splash plugins make use of it yet.
The x and y values of the flush area are bogus just after
a flush when the flush area has a width of 0. We need to
special case that situation to perform the union/intersection
operations without looking at x and y.
This is a first step toward making the window provide
an draw handler interface, so we can hide the details
of pause/unpause, resetting raw mode, and graphics mode,
etc from the individual plugins.
Previously we were setting up the exit handler at the top
of the show vtable function. This meant having to remove
the exit handler if the show fails. It's much easier to
not set up the handler until after we know we're going to
succeed.
There was a sort useless layer of indirection between the
window object and splash plugins. It ended up with
functions like:
void
on_backspace (ply_splash_plugin_t *plugin)
{
plugin->interface->on_backspace (plugin);
}
Since the individual plugins are aware of the window object
anyway, they can register their own on_backspace et al handlers
without going through the ply_splash_plugin_t layer.
Right now we do it in the cheesiest way possible, by
calling the backspace function over and over again on
behalf of the user. It might make more sense to export
another window callback specifically for erase line. It
probably doesn't make sense to do that until we fix the
TODO item:
- have plugins hook into line editing through window
directly, instead of via vtable functions
though.