Added a new Events object with :on() and :off() methods to start or
stop listening to a specific event respectively. This also allows to
add several callbacks for the same event.
Replaced the temporal Site.onChange & Sprite.onChange implementations.
Related to several issues (enable more possibilities for): #138, #1403, #1949, #2965, #2980
With this change we fix some tests when !ENABLE_UI and we start using
less Preferences::instance() (maybe in the future we could exclusively
access the preferences from the new Context::preferences() function).
* Added the gfx::ColorSpace field in doc::ImageSpec
* Removed some methods like Sprites::add(width, height, etc.)
* Prefer methods with ImageSpec as argument (which now includes the color space)
From now on we can share the transaction in the app::Context instead
of having the transaction in a SpriteWrap. This is useful to run
macros/scripts in a near future calling commands (and all commands
could share the same transaction).
Some changes with this:
* Added app::Context::setTransaction/transaction() methods.
* Added Tx class to create a new Transaction or use the currenet
app::Context transaction.
* Added App.transaction() scripting method.
New cmake flag -DENABLE_UI=OFF can be used to turn off the GUI
and compile a CLI-only version of Aseprite.
Requested here too:
https://community.aseprite.org/t/1351
Now ContextFlags enable some flags if it detects that the current editor
is in MovingPixelsState. In this way commands "think" that they are able
to lock the document for write access (finally they will be able, because
MovingPixelsState::onBeforeCommandExecution() unlocks the document
just before the command is executed).
Fix#275, fix#690, fix#750
Changes:
* Move FreehandAlgorithm/InkType/RotationAlgorithm/SelectionMode to
app::tools namespace
* Removed ISettings, IToolSettings, IBrushSettings, ISelectionSettings,
and IColorSwatchesStore (and implementations from UISettingsImpl)
* Added app::tools::PreferenceGlue to do some adjustments that
UIToolSettingsImpl was doing
* Remove signals from App related to brush size/angle changes, and current
tool change (there events can be observed directly from Preferences)
* Remove ColorBar::FgColor/BgColor, these options can be observed from
Preferences::colorBar.fg/bgColor
This is a first step to include the current selected range of layers
and frames inside the doc::Site structure. So in the future we'll not need
to know about the Timeline in commands that handle those ranges.
This is to avoid leaving commands with old params (a problem with
keyboard shortcuts). To make sure, we've changed arguments from Params*
to Params&, so we always have params to load.
Also, in this change we introduce a new way to give parameters to executed
commands from menu items using AppMenuItem::setContextParams(). Before
showing a popup, we can call setContextParams() to give extra params to
the command (e.g. the specific FrameTag to remove or change properties).
In this way "contextparams" attribute for <item> in gui.xml is not
available anymore.
Undoers were little objects to swap/revert an action. They didn't
execute the action itself, they just revert its previous state. Now
undoers were replaced with cmds: A cmd is an object that
executes/undoes/redoes just one action.
Changes:
* Remove old undo library and app/objects_container_impl.cpp
(now we use the doc::ObjectId directly to store undo info)
* Remove all Undoers from app/undoers/
* Replace DocumentApi impl with little Cmds in app/cmd/, these
cmds handle execute/undo/redo of each action at the logic layer
* Remove doc::Dirty object
* Remove doc::Settings: all undo configuration is in the app side
* Move undo options from app:ISettings to app::Preferences
* Rename UndoTransaction to Transaction
* Create a CmdSequence to store a sequence of Cmds (as now the new
undo library doesn't support open/close groups)
* Add doc::get<T>(ObjectId) function to get any kind of object
from the doc library by its ID
* Add Cel::document() and Sprite::document() members
* Add Sprite::cels(frame_t) to get all cels in the given frame
* Add Layer::displaceFrames() member function
* Move the "allow non-linear history" flag from undo2::UndoHistory
to app::DocumentUndo
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()
Implemented SelectionSettings class
Transparent Color button for moving pixels moved from status bar to
context bar. Current Transparent Color stored by new SelectionSettings
class, retrievable from ISettings.
Also implemented Observer classes for existing Settings interfaces for
future use.
StatusBarObserver interface and supporting code removed from StatusBar.
- Add HAVE_CONFIG_H wrapper to #include "config.h"
- Removed widgets namespace (it's in app now)
- Move some functions from src/file/file.h to src/base/cfile.h
- Move Vector2d to base library
- Rename MenuItem2 to AppMenuItem