This change does away with separate attributes foreground and background,
opting for an array of color "aspects", where the aspect can vary
over an enum which can either be FOREGROUND or BACKGROUND. This will allow
writing a single set of color-editing code which can work either on the
foreground or background color of a cell.
Now palettes are allocated and deallocated in fteapot as well as teapot;
both executables have some color rendering, with fteapot using the cell
foreground and background (there's just no way to set them at the moment).
teapot is so far only using color in the header.
Implements #39.
Now in fteapot you can select any one of the buttons in a modal dialog
with the cursor keys and hit enter and it will be selected.
Fixes#17.
In addition, I clarified that the block attribute options will either set
every cell to bold (say), or unset every cell, or you can cancel to not
actually go through with the block operation.
These changes required adding a custom FLTK dialog, tpt_choose.{h,cxx}.
Along the way, I reflowed fteapot.fl to make it more readable for further
coding.
Finally, there is a small amount of additional prep for color support
that (unfortunately) got mixed in with these changes.
The new function is X(SRC,REF), which briefly for a cell in the neighborhood
of REF returns the corresponding cell in the neighborhood in SRC. For
further details, see the updated documention.
In developing and documenting this function, I refined some of the
existing error messages (e.g. showing the coordinates when there is an
attempt to obtain a cell with a negative coordinate) and improved the
error propagation to increase the chance that the innermost error will
percolate to the top level.
So far, this jst consists of initializing color in curses mode, and making
the display start and end part of intializing and freeing a sheet (so that
it can control allocating the palette, for example, where the data structure
used depends on what kind of display it is.
Next up will be to allocate and destroy the color palette, and set up the
default colors for cells to use (0 for foreground,
TEAPOT_WHITE for background.) The outline beyond that is to allow setting of
the cell colors, then actually display those colors, and finally edit the
palette.