Commit Graph

49 Commits

Author SHA1 Message Date
Christian Kaiser c57554646b Escape characters in the console that we can't show properly (fix #5324) 2025-08-26 11:21:08 -03:00
David Capello 2bc4f0582d Fix crash (and show error message) when default font is nullptr (fix #5208)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
Probably an edge-case for users that are creating new themes.
2025-06-10 22:02:12 -03:00
David Capello 09538f9a1a clang-format all files 2024-12-16 14:52:19 -03:00
David Capello e0a677545e Show errors in UI when we cannot recover a specific file (related to #4291)
Internal:
Visible in: https://igarastudio.zendesk.com/agent/tickets/5772
With files from: https://igarastudio.zendesk.com/agent/tickets/5773
2024-02-02 12:49:55 -03:00
David Capello be11e3b324 Recreate console window to print log messages if it was closed by the user
Regression introduced cc7da16691 when
the Console was converted to a non-modal window. If a script prints
something, the console is displayed, then the user can close the
console, and if the script tried to print something else the console
window wasn't displayed again until some other command was
executed (any command that called the Console::Console() constructor
which would create the ConsoleWindow again).

With this fix the console window is recreated/displayed again on the
screen.

This bug was well-known (but I think never reported yet) and probably
the possible source of the #3787 issue.
2023-04-05 18:26:15 -03:00
Joshua Ogunyinka ed26fdd806 Add missing language strings in other uncategorized sections 2022-10-12 14:57:23 -03:00
David Capello 8d2863a58b Merge branch 'main' into beta 2022-05-05 09:57:29 -03:00
David Capello cc7da16691 Run Console in background so commands can continue running and logging to the console if needed (fix #3227) 2022-04-28 21:58:15 -03:00
David Capello c42c5e1453 Backport new laf API to main branch of aseprite
Some features from the beta branch of aseprite & laf were backported
to the main branch of aseprite.

Related commits:
- New memory handling (db4504e816)
- New get event with timeout (e6ec13cc31)
- Convert os::NativeCursor to an enum (06a5b4f3ae)
- Adapt code to the new os::Display -> os::Window refactor (5d31314cdb)
- Save/load main window layout correctly and limit to current workarea (d6acb9e20f)
- Redraw window immediately on "live resizing" (d0b39ebade)
2021-07-05 17:51:29 -03:00
David Capello b015b16da5 Merge branch 'main' into beta 2021-03-19 19:27:29 -03:00
David Capello bcd69495ce Fix several issues locating windows with multiple UI windows
We've refactored the code to support locating windows (and popups
windows + hot regions) correctly in both modes: with one ui::Display
and with multiple ui::Displays.

For this we've added a new ui::fit_bounds() function that works in
both modes.
2021-03-19 18:57:56 -03:00
Gaspar Capello 1193bf18fc Fix lua error crash (fix #2635)
Prevents crashes from uncaught exceptions generated from Lua errors
when running aseprite from the console with -script param.
2021-03-09 16:40:24 -03:00
David Capello 35bb3af6e2 Replace all base::Bind() with lambda functions 2021-03-05 20:09:42 -03:00
David Capello c3d52f0bbe Add ui::Display to support multiple windows in the future
This ui::Display is related to one native os::Window, so the dirty
region/invalid region is now part of a ui::Display instead of a
ui::Manager.

* Replaced ui::display_w/h() functions with ui::Display::size()
  and ui::get_desktop_size()
* The ui::Manager contains the main ui::Display, and in the future an
  ui::Window will have its own ui::Display
2021-02-18 12:34:42 -03:00
David Capello 5d31314cdb Adapt code to the new os::Display -> os::Window refactor 2021-02-02 15:59:28 -03:00
David Capello a3072fba41 Revert change in Console::showException() from d0b39ebade 2021-01-15 11:33:40 -03:00
David Capello d0b39ebade Redraw window immediately on "live resizing" 2021-01-12 21:39:12 -03:00
David Capello 91628daa9d Merge branch 'master' into beta 2020-12-22 15:48:15 -03:00
David Capello 81d9e8afec Fix bug with Console when the UI Screen Scaling is changed 2020-12-11 15:52:14 -03:00
David Capello 515dace441 Merge branch 'beta' into tilemap-editor 2020-07-13 17:32:42 -03:00
David Capello 8a3f32b47f Replace all base::Bind() with lambda functions 2020-07-03 21:51:46 -03:00
David Capello 9073b4aec6 Show correct active tile on status bar when we are in a tilemap 2020-02-17 09:06:01 -03:00
David Capello 93fe19d353 Use cancelable async tasks to load/delete backup sessions 2019-05-30 23:17:13 -03:00
David Capello e905fa0266 Add Ctrl+C (Command+C) to copy text in the Console 2018-12-15 10:10:30 -03:00
David Capello 02de8bf839 Simplify app::Console code 2018-12-14 18:08:12 -03:00
David Capello 23059c6309 Clear console text even when we close it with ESC key 2018-11-26 16:02:50 -03:00
David Capello a340b481d7 Run Console in foreground so Enter key can close the window (instead of sending keys to the MainWindow) 2018-11-21 13:10:47 -03:00
David Capello 7029e05dc4 lua: Avoid crashes executing transactions without an active sprite
This is true even for background Dialogs with buttons that will
try to create a transaction for a nil app.activeSprite.

With this change we introduced a new way to handle the app::Console window,
it'll be alive almost the entire execution of the program (so if we
close it, it's hidden, but then will appear in the same location if
it's open again, and the text is cleared).
2018-11-20 19:42:53 -03:00
David Capello 6b1c884eb5 Add code to check integrity of backups 2018-07-04 12:35:15 -03:00
David Capello b4ea90a266 Add Console::hasText() so tests can check if there are errors in the console
This is useful in case that we want to test (e.g.) save/load document
operations that print errors in the console. So checking the console
output (this hasText flag) we can determine if the operation was
completely successful or failed.
2017-05-24 14:55:13 -03:00
David Capello 0742dfad17 Fix some errors showing '&' char for the mnemonic text 2017-03-08 19:15:34 -03:00
David Capello 461d311dff Fix several buffer overflows using base::string_printf() 2016-11-22 11:54:15 -03:00
David Capello 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello 4ef9626689 Fix crash when resizing a sprite and there is not enough memory
This patch fixes crashes in background jobs that generate any kind of
exception.
2016-07-22 20:46:29 -03:00
David Capello e944ce0052 Move Bind, Connection, Signal, Slot, etc. to base namespace 2015-12-04 15:17:42 -03:00
David Capello 1aaeacc460 Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.

Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-04 14:39:04 -03:00
David Capello 0517cd1b98 Remove _ji_ prefix in some ui-lib functions 2015-06-23 14:14:06 -03:00
David Capello f01b816fb5 Remove JI_ prefix from ui/base.h constants 2015-06-23 14:00:00 -03:00
David Capello a8577a4273 Rename Context::isUiAvailable to Context::isUIAvailable 2015-05-18 17:04:31 -03:00
David Capello 66c5f76146 Avoid crashes when some EditorState in Editor::onProcessMessage() cannot lock the document 2015-04-15 09:58:41 -03:00
David Capello d9259afc04 Fix app::Console() to handle a non UI context correctly 2015-04-06 11:58:42 -03:00
David Capello 2c6067f7e4 Update license of app/ module to GPLv2 2015-02-12 12:16:25 -03:00
David Capello bde2ddbe83 Remove ji_screen and ji_clock global variables
- Replace JI_SCREEN_W/H with ui::display_w/h()
- Remove GfxMode class
- Move drawing code of ColorCurveEditor widget to onPaint()
- Rename ji_clock -> ui::clock()
2014-08-31 14:17:49 -03:00
David Capello 3c4bbbe30c Replace jwidget_set_min/max_size() with Width::setMin/MaxSize() 2014-04-21 22:15:29 -03:00
David Capello b33357ed46 Remove base::string (std::string is good enough for utf8 strings) 2014-04-20 19:53:27 -03:00
David Capello ad0b28bd63 Change Window() ctor to avoid ambiguity (DesktopWindow, WithoutTitleBar, or WithTitleBar)
In this way we know at the moment of the creation of the window if it
will need the close button.

Issue #280.
https://github.com/aseprite/aseprite/pull/6
2013-11-23 17:47:57 -03:00
David Capello 5b252c30f5 Add support for Unicode file names on Windows
- Fixed issue #46: open .png files with Unicode chars
- Fixed issue #150: ability to uncompress program in folders w/Unicode chars
- Added base::utf8_iterator
- Added base::FileHandle
- Added base::get_app_path()
- Modified ui::KeyMessage::ascii() -> unicodeChar()
- Removed JI_NOTEXT flag
- Added app::XmlDocumentRef class and app::open_xml() function
- Added support for Unicode text exchange with Win32 clipboard
2013-10-14 19:58:11 -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