The objective of these changes is to create a more testable doc/logic API.
Included changes:
- Added doc::Context, doc::Documents (the old app::Documents),
and doc::Sprites (and observers for each)
- Added raster::Sprite::createBasicSprite()
- Added doc::ColorMode (equal to raster::PixelFormat)
- Added some methods to doc::Document: context(), sprites(), sprite()
(to replace app::Document::getSprite()), width/height(), colorMode(),
name(), and close()
- Moved app::DocumentObserver/Event to doc::DocumentObserver/Event
- Replaced app::ContextObserver with doc::DocumentsObserver and a couple
of signals.
- Renamed app::Context::getActiveDocument() with
doc::Context::activeDocument()
- Renamed app::Context::getActiveLocation() with
app::Context::activeLocation()
- Removed app::ContextObserverList
- Removed app::DocumentId (now we can use doc::ObjectId)
- Removed app::Context::getSettings()
This is a work-in-progress, dropRange() must be reimplemented. Now that
the Timeline uses LayerIndex, we could change Timeline::Range to
DocumentRange and create unit tests for the logic side.
- Add red/blue onion skin type
- Add app::calculate_next_frame() function to calculate the next frame
depending of the timeline configuration (loop range, animation direction)
- Add app::finder() to simplify the access to widgets loaded from xml files
- If we use a RGB color in a background layer (indexed image),
and the first palette entry (transparent color) matches that RGB color,
we can use that entry, because this is the background (the transparent
color isn't transparent at all in the background layer).
- If we use the same RGB color in a transparent color, we've to avoid the
transparent color, because the user want to paint with that specific
solid color.
- Palette::findBestfit() receives a mask_index now, so we can find what
color best matches a specific RGB avoiding that specific mask color,
or we can use -1 to use any color (e.g. for background layers).
- Added app::ColorTarget() to simplify and fix color_utils::color_for_layer
and app_get_color_to_clear_layer(), so now we can use the new findBestfit
to return the transparent color for background layers (if a RGB color
matches the transparent color RGB values).
- Removed fixup_color_for_layer/background() functions in color_utils
- Fix NewImageFromMask() to use the mask color to clear the image
- Improve the Editor pen preview (cursor.cpp) to draw the bounds of the
pen when it will paint with the transparent color.
This field is disabled, and the program isn't ready to support less than
256 colors in Indexed mode, so it's better if we remove this field to avoid
confusion.