Commit Graph

20 Commits

Author SHA1 Message Date
David Capello
8722c8ec16 Lock document in Tx() ctor (part of #2430)
This already fixes a lot of possible problems that can happen when a
script is running and modifying some part of a sprite that is being
backed up in a background thread.

We still need some work to being able to lock a sprite two or more
times in the same thread to write it. E.g. an app.transaction() should
lock the sprite for write access, but the script transaction function
could call a command, and that command could use a ContextWriter to
lock the sprite again. At the moment this is not possible because we
need a re-entrant RWLock implementation.
2023-12-27 11:05:15 -03:00
David Capello
aa1943e609 Minor refactor using cmds directly instead of DocApi in Layer/Background from Background/Layer 2020-06-08 14:47:11 -03:00
David Capello
271865e13d Remove unused Command::clone() member function 2019-01-07 17:03:38 -03:00
David Capello
26d510fffd Support more commands without UI
- BackgroundFromLayer
- CelOpacity
- LayerFromBackground
- RemoveLayer
2018-09-06 14:18:59 -03:00
David Capello
70629d6f89 Use Tx instead of Transaction in commands 2018-08-20 16:00:59 -03:00
David Capello
9c79ea2b77 Rename app::Document -> Doc 2018-07-07 11:54:44 -03:00
David Capello
ee5842cde3 Rename DocumentApi -> DocApi 2018-07-07 03:07:16 -03:00
David Capello
e0a60b6748 Generate the list of command IDs from en.ini file 2017-12-01 15:10:21 -03:00
David Capello
ccee49c02b Move command friendly names to the strings file
Related to #124
2017-11-30 23:41:45 -03:00
David Capello
6ce73a831a Don't allow draw/modify reference layers 2016-10-17 13:49:28 -03:00
David Capello
5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello
460d4b47c9 Add missing "override" modifier on some member functions
These ones were detected by clang-700.0.72
2015-09-30 16:34:43 -03:00
David Capello
2c6067f7e4 Update license of app/ module to GPLv2 2015-02-12 12:16:25 -03:00
David Capello
e55865843e Replace undo impl: replace undoers with cmds
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
2015-01-18 22:05:33 -03:00
David Capello
cc889f2b2f Minor refactor to doc::Layer flags 2014-11-16 23:03:30 -03:00
David Capello
63995c6f0a Merge "raster" namespace into "doc" library 2014-10-20 22:21:31 -03:00
David Capello
6824570c4b Remove base/override.h (use override keyword directly) 2014-08-14 23:07:47 -03:00
David Capello
44d3e228fd Add missing OVERRIDE modifier to Command::clone() overrides
It fixes some invalid clone() overrides without const modifier.
2014-03-29 17:08:40 -03:00
David Capello
cde54f3682 Change BSD license to MIT in sublibraries and fix headers 2013-08-08 21:01:20 -03:00
David Capello
c88f9b172b Refactor: Move app files to src/app subdirectory inside app namespace
- 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
2013-08-05 21:20:19 -03:00