Commit Graph

55 Commits

Author SHA1 Message Date
Christian Kaiser 260d9fbd52 Improved logic, comments, unused include cleanup 2025-07-30 20:41:47 -03:00
Christian Kaiser 424ce6899a [WIP] Command refresh 2025-07-29 20:09:10 -03:00
Martín Capello ba5adcaa7d Change uuidsForLayers by useLayerUuids 2025-04-22 12:42:12 -03:00
Martín Capello 7454ec2d06 Rename m_useUuidsForLayers by m_uuidsForLayers 2025-02-24 15:14:14 -03:00
Martín Capello 86ad09291f Add UUIDs to layers 2025-02-24 10:10:28 -03:00
David Capello 09538f9a1a clang-format all files 2024-12-16 14:52:19 -03:00
David Capello 68d5262c48 Merge branch 'main' into beta 2024-08-09 21:06:57 -03:00
David Capello 32a099dcb6 Fix crashes with ill-formed fmt format strings (fix #2274)
There is a third-party translation (and can happen with our own
translations) that a fmt format string is ill-formed in the .ini file
of the translation (this could happen even if the en.ini file was
manually modified/broken by hand).

This patch includes a refactor of the Strings class so we can:

1) Static check at compile-time about the number of required arguments
   to format a string (no need to call fmt::format() directly with
   arbitrary number of args)
2) If a string is not valid for the fmt library, the runtime exception
   is caught and the default (English) string is returned.
2024-06-20 20:49:10 -03:00
David Capello 56357e68ce Merge branch 'main' into beta 2024-03-11 18:03:17 -03:00
David Capello 7905acf38a Handle some extra CannotWriteDocException cases when ContextWriter is used (#4367)
One fix that this patch includes for #4367 (crash by unhandled
CannotWriteDocException exception) is when we drag-and-drop a tag
border to resize its limits. This is a fix for that case but we don't
know if this include all cases of #4367 crashes (so we cannot close
the issue).

Anyway we have added some try { } catch in cases where it's better to
avoid propagating the exception, e.g. in
MovingSelectionState::onLeaveState() to avoid throwing exceptions in
Editor::backToPreviousState() which might be problematic in several
cases. (Maybe related to #2829?)
2024-03-11 17:15:13 -03:00
David Capello 571b4ec9f2 Update to new laf API (os::System::instance()/make()) 2024-03-05 18:50:24 -03:00
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
Martín Capello 4926f4c1fc Show, duplicate and delete tilesets in Sprite Properties dialog (fix #3875) 2023-07-18 18:50:57 -03:00
David Capello 39d1fb56d4 Remove ui::Event& args from ui::Button::Click signal
This is to simplify code and to match ui::MenuItem::Click and
ui::Button::Click signals (so then we can write some generic code
using Button::Click or MenuItem::Click).
2023-01-12 11:00:16 -03:00
David Capello 616f74ae2d Minor changes when accessing "properties_grid" widget 2022-10-13 09:40:54 -03:00
Joshua Ogunyinka a4bc897f76 Add missing language strings for preview editor/new brush/inks/mask by color 2022-10-12 14:36:31 -03:00
Joshua Ogunyinka 974c13dd33 Add missing language strings in sprite properties & import sprite sheet 2022-10-12 13:38:22 -03:00
David Capello 52779d4b09 Fix memory leak in UserDataView simplifying its ctor
Each "new gen::UserData" wasn't being freed.
2022-05-19 18:56:21 -03:00
Gaspar Capello 116201d8a1 Add custom data to Sprite Properties Window (fix #1306) 2020-12-16 12:40:05 -03:00
David Capello db4504e816 Refactor laf-os memory handling 2020-07-07 19:06:48 -03:00
David Capello 8a3f32b47f Replace all base::Bind() with lambda functions 2020-07-03 21:51:46 -03:00
David Capello 42d5f10437 Fix access to memory out of scope on Sprite Properties when assigning/converting color profiles
Some buttons where calling the updateButtons() lambda that were
defined inside a sub-scope of SpritePropertiesCommand::onExecute()
(which is where the window is displayed
ui::Window::openWindowInForeground()), the lambda was already
out-of-scope when it was used by other lambdas.
2019-04-01 14:11:42 -03:00
David Capello 271865e13d Remove unused Command::clone() member function 2019-01-07 17:03:38 -03:00
David Capello 36edf3f842 Fix tooltip in SpriteProperties dialog 2018-12-13 15:25:31 -03:00
David Capello a4d8fc52bf Manage color profiles (fix #1576) 2018-10-19 15:30:30 -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 0ced31a447 Hide "Index" tab in FG/BG color popups
The "Index" tab doesn't make sense in the foreground/background color
selector because we already have the color bar at the left of the screen
to click on a palette entry.
2017-06-22 18:55:56 -03:00
David Capello 1671411465 Add simple color selection for tag/user data colors 2017-04-04 20:02:29 -03:00
David Capello a104afc670 Merge branch 'master' into beta 2016-09-12 17:53:01 -03:00
David Capello 20b726f73b Merge branch 'master' into beta 2016-08-31 19:53:52 -03:00
David Capello 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello a9c18db7a4 Add pixel ratio field in Sprite properties 2016-05-24 12:25:11 -03:00
David Capello 06be4f7fa6 Rename ui::Window::getKiller() -> closer() 2015-12-04 14:54:15 -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 e15b9aca21 Remove some #includes directives 2015-09-22 17:32:42 -03:00
David Capello e7e9f1d482 Change name of generated files from "generated_file.h" to "file.xml.h" 2015-09-22 16:33:49 -03:00
David Capello e98e2fe3e1 Use the generated widget from sprite_properties.xml in SpritePropertiesCommand 2015-06-22 11:20:10 -03:00
David Capello b23194dfae Fix several warnings in MSVC, clang, and gcc 2015-03-05 15:19:00 -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 06d18f1e8a Replace doc::FrameNumber with doc::frame_t 2014-12-28 20:39:11 -03:00
David Capello 63995c6f0a Merge "raster" namespace into "doc" library 2014-10-20 22:21:31 -03:00
David Capello 5d3d96d2d9 Minor changes: remove unnecessary dependencies with allegro.h 2014-09-21 11:59:39 -03:00
David Capello 6824570c4b Remove base/override.h (use override keyword directly) 2014-08-14 23:07:47 -03:00
David Capello 91b0c2d071 Refactor: Remove "get" part for member functions that act like a simple getter
Additional change:
- Added Cel::image() to get the related image of the cel directly
2014-07-30 01:28:15 -03:00
David Capello 81ffb0c5bd Refactor: Create doc::Context and move some logic from app::Document to doc::Document
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()
2014-07-29 00:53:24 -03:00