mirror of https://github.com/aseprite/aseprite.git
Merge branch 'main' into beta
This commit is contained in:
commit
f27fb00acf
|
@ -81,13 +81,18 @@ else()
|
||||||
set(REQUIRE_CURL OFF)
|
set(REQUIRE_CURL OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Select libcurl's TLS backend according to target platform
|
# SSL/TLS support
|
||||||
if(REQUIRE_CURL AND ENABLE_DRM)
|
if(REQUIRE_CURL AND NOT USE_SHARED_CURL)
|
||||||
if(APPLE)
|
# Disable OpenSSL (use native libraries only)
|
||||||
option(CMAKE_USE_SECTRANSP "enable Apple OS native SSL/TLS" ON)
|
set(CMAKE_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
|
||||||
endif()
|
set(CMAKE_USE_LIBSSH2 OFF CACHE BOOL "Use libSSH2")
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(CMAKE_USE_SCHANNEL "enable Windows native SSL/TLS" ON)
|
set(CMAKE_USE_SCHANNEL ON CACHE BOOL "enable Windows native SSL/TLS")
|
||||||
|
elseif(APPLE)
|
||||||
|
set(CMAKE_USE_SECTRANSP ON CACHE BOOL "enable Apple OS native SSL/TLS")
|
||||||
|
else()
|
||||||
|
# TODO Linux?
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
2
laf
2
laf
|
@ -1 +1 @@
|
||||||
Subproject commit d73dd6d5f2668574a46d8cb1393785021a306c69
|
Subproject commit 580fb8063057a33ebd171be4f66f78c4ce384e52
|
|
@ -28,14 +28,6 @@ else()
|
||||||
add_definitions(-Wno-sign-compare)
|
add_definitions(-Wno-sign-compare)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_NEWS)
|
|
||||||
add_definitions(-DENABLE_NEWS)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_UPDATER)
|
|
||||||
add_definitions(-DENABLE_UPDATER)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# Needed to include icons in win32 .rc file
|
# Needed to include icons in win32 .rc file
|
||||||
include_directories(..)
|
include_directories(..)
|
||||||
|
@ -48,45 +40,6 @@ if(REQUIRE_CURL AND NOT USE_SHARED_CURL AND CURL_STATICLIB)
|
||||||
add_definitions(-DCURL_STATICLIB)
|
add_definitions(-DCURL_STATICLIB)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# Special versions (full/trial, devmode, UI/CLI, etc.)
|
|
||||||
|
|
||||||
if(NOT ENABLE_TRIAL_MODE)
|
|
||||||
add_definitions(-DENABLE_SAVE)
|
|
||||||
else()
|
|
||||||
add_definitions(-DENABLE_TRIAL_MODE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_DRM)
|
|
||||||
add_definitions(-DENABLE_DRM)
|
|
||||||
add_definitions(-DENABLE_SAVE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_DEVMODE)
|
|
||||||
add_definitions(-DENABLE_DEVMODE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_UI)
|
|
||||||
add_definitions(-DENABLE_UI)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_UI AND (NOT ENABLE_TRIAL_MODE OR ENABLE_DRM))
|
|
||||||
set(ENABLE_DATA_RECOVERY on)
|
|
||||||
add_definitions(-DENABLE_DATA_RECOVERY)
|
|
||||||
else()
|
|
||||||
set(ENABLE_DATA_RECOVERY off)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_SCRIPTING)
|
|
||||||
# Needed for "app" and "main"
|
|
||||||
add_definitions(-DENABLE_SCRIPTING)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_WEBSOCKET)
|
|
||||||
# Needed for "app" and "main"
|
|
||||||
add_definitions(-DENABLE_WEBSOCKET)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Aseprite Libraries (in preferred order to be built)
|
# Aseprite Libraries (in preferred order to be built)
|
||||||
|
|
||||||
|
|
|
@ -87,14 +87,6 @@ add_custom_command(
|
||||||
DEPENDS ${GEN_DEP} ${widget_files} ${string_files} "${SOURCE_DATA_DIR}/gui.xml")
|
DEPENDS ${GEN_DEP} ${widget_files} ${string_files} "${SOURCE_DATA_DIR}/gui.xml")
|
||||||
list(APPEND generated_files ${output_fn})
|
list(APPEND generated_files ${output_fn})
|
||||||
|
|
||||||
if(ENABLE_WEBP)
|
|
||||||
add_definitions(-DENABLE_WEBP)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_PSD)
|
|
||||||
add_definitions(-DENABLE_PSD)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# libarchive definitions
|
# libarchive definitions
|
||||||
add_definitions(-DLIBARCHIVE_STATIC)
|
add_definitions(-DLIBARCHIVE_STATIC)
|
||||||
|
|
||||||
|
@ -113,7 +105,21 @@ else()
|
||||||
target_sources(app-lib PRIVATE font_path_unix.cpp)
|
target_sources(app-lib PRIVATE font_path_unix.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Trial-version vs Full version (enable save command)
|
||||||
|
if(ENABLE_TRIAL_MODE)
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_TRIAL_MODE)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_SAVE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Data recovery
|
||||||
|
if(ENABLE_UI AND (NOT ENABLE_TRIAL_MODE OR ENABLE_DRM))
|
||||||
|
set(ENABLE_DATA_RECOVERY on)
|
||||||
|
else()
|
||||||
|
set(ENABLE_DATA_RECOVERY off)
|
||||||
|
endif()
|
||||||
if(ENABLE_DATA_RECOVERY)
|
if(ENABLE_DATA_RECOVERY)
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_DATA_RECOVERY)
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
crash/backup_observer.cpp
|
crash/backup_observer.cpp
|
||||||
crash/data_recovery.cpp
|
crash/data_recovery.cpp
|
||||||
|
@ -123,6 +129,7 @@ if(ENABLE_DATA_RECOVERY)
|
||||||
ui/data_recovery_view.cpp)
|
ui/data_recovery_view.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# File formats
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
file/ase_format.cpp
|
file/ase_format.cpp
|
||||||
file/bmp_format.cpp
|
file/bmp_format.cpp
|
||||||
|
@ -137,15 +144,32 @@ target_sources(app-lib PRIVATE
|
||||||
file/svg_format.cpp
|
file/svg_format.cpp
|
||||||
file/tga_format.cpp)
|
file/tga_format.cpp)
|
||||||
if(ENABLE_WEBP)
|
if(ENABLE_WEBP)
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_WEBP)
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
file/webp_format.cpp)
|
file/webp_format.cpp)
|
||||||
endif()
|
endif()
|
||||||
if(ENABLE_PSD)
|
if(ENABLE_PSD)
|
||||||
|
target_link_libraries(app-lib psd)
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_PSD)
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
file/psd_format.cpp)
|
file/psd_format.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Extras
|
||||||
|
if(ENABLE_DEVMODE)
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_DEVMODE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Enable "Check for updates" info
|
||||||
|
if(ENABLE_UPDATER)
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_UPDATER)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Scripting
|
||||||
if(ENABLE_SCRIPTING)
|
if(ENABLE_SCRIPTING)
|
||||||
|
target_link_libraries(app-lib lua lauxlib lualib)
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_SCRIPTING)
|
||||||
|
|
||||||
if(ENABLE_UI)
|
if(ENABLE_UI)
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
commands/cmd_developer_console.cpp
|
commands/cmd_developer_console.cpp
|
||||||
|
@ -153,10 +177,14 @@ if(ENABLE_SCRIPTING)
|
||||||
commands/debugger.cpp
|
commands/debugger.cpp
|
||||||
ui/devconsole_view.cpp)
|
ui/devconsole_view.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_WEBSOCKET)
|
if(ENABLE_WEBSOCKET)
|
||||||
|
target_link_libraries(app-lib ixwebsocket)
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_WEBSOCKET)
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
script/websocket_class.cpp)
|
script/websocket_class.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
commands/cmd_run_script.cpp
|
commands/cmd_run_script.cpp
|
||||||
script/app_command_object.cpp
|
script/app_command_object.cpp
|
||||||
|
@ -220,7 +248,9 @@ if(ENABLE_SCRIPTING)
|
||||||
shell.cpp)
|
shell.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# UI-only files
|
||||||
if(ENABLE_UI)
|
if(ENABLE_UI)
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_UI)
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
app_brushes.cpp
|
app_brushes.cpp
|
||||||
app_menus.cpp
|
app_menus.cpp
|
||||||
|
@ -431,23 +461,23 @@ if(ENABLE_UI)
|
||||||
ui_context.cpp
|
ui_context.cpp
|
||||||
widget_loader.cpp)
|
widget_loader.cpp)
|
||||||
if(ENABLE_NEWS)
|
if(ENABLE_NEWS)
|
||||||
|
target_compile_definitions(app-lib PUBLIC -DENABLE_NEWS)
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
res/http_loader.cpp
|
res/http_loader.cpp
|
||||||
ui/news_listbox.cpp)
|
ui/news_listbox.cpp)
|
||||||
endif()
|
endif()
|
||||||
if(ENABLE_DRM)
|
if(ENABLE_DRM)
|
||||||
|
target_link_libraries(app-lib drm-lib)
|
||||||
|
target_compile_definitions(app-lib PUBLIC
|
||||||
|
-DENABLE_DRM
|
||||||
|
-DENABLE_SAVE)
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
ui/enter_license.cpp
|
ui/enter_license.cpp
|
||||||
ui/aseprite_update.cpp)
|
ui/aseprite_update.cpp)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_SENTRY)
|
# Main app sources
|
||||||
target_sources(app-lib PRIVATE sentry_wrapper.cpp)
|
|
||||||
else()
|
|
||||||
target_sources(app-lib PRIVATE send_crash.cpp)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_sources(app-lib PRIVATE
|
target_sources(app-lib PRIVATE
|
||||||
active_site_handler.cpp
|
active_site_handler.cpp
|
||||||
app.cpp
|
app.cpp
|
||||||
|
@ -735,14 +765,6 @@ target_link_libraries(app-lib
|
||||||
tinyexpr
|
tinyexpr
|
||||||
qoi)
|
qoi)
|
||||||
|
|
||||||
if(ENABLE_PSD)
|
|
||||||
target_link_libraries(app-lib psd)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_DRM)
|
|
||||||
target_link_libraries(app-lib drm-lib)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Directory where generated files by "gen" utility will stay.
|
# Directory where generated files by "gen" utility will stay.
|
||||||
target_include_directories(app-lib PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(app-lib PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
@ -750,14 +772,7 @@ if(REQUIRE_CURL)
|
||||||
target_link_libraries(app-lib net-lib)
|
target_link_libraries(app-lib net-lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_SCRIPTING)
|
# Enable loading Steam API
|
||||||
target_link_libraries(app-lib lua lauxlib lualib)
|
|
||||||
|
|
||||||
if(ENABLE_WEBSOCKET)
|
|
||||||
target_link_libraries(app-lib ixwebsocket)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_STEAM)
|
if(ENABLE_STEAM)
|
||||||
# We need the ENABLE_STEAM flag in main module too so AppOptions are
|
# We need the ENABLE_STEAM flag in main module too so AppOptions are
|
||||||
# equal in both modules, app-lib and main (that's why this flag is
|
# equal in both modules, app-lib and main (that's why this flag is
|
||||||
|
@ -766,6 +781,7 @@ if(ENABLE_STEAM)
|
||||||
target_link_libraries(app-lib steam-lib)
|
target_link_libraries(app-lib steam-lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Report crashes using Sentry
|
||||||
if(ENABLE_SENTRY)
|
if(ENABLE_SENTRY)
|
||||||
target_compile_definitions(app-lib PUBLIC
|
target_compile_definitions(app-lib PUBLIC
|
||||||
-DENABLE_SENTRY
|
-DENABLE_SENTRY
|
||||||
|
@ -774,4 +790,7 @@ if(ENABLE_SENTRY)
|
||||||
-DSENTRY_ENV="${SENTRY_ENV}")
|
-DSENTRY_ENV="${SENTRY_ENV}")
|
||||||
add_subdirectory(${SENTRY_DIR} sentry)
|
add_subdirectory(${SENTRY_DIR} sentry)
|
||||||
target_link_libraries(app-lib sentry)
|
target_link_libraries(app-lib sentry)
|
||||||
|
target_sources(app-lib PRIVATE sentry_wrapper.cpp)
|
||||||
|
else()
|
||||||
|
target_sources(app-lib PRIVATE send_crash.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -396,19 +396,20 @@ int App::initialize(const AppOptions& options)
|
||||||
m_mainWindow->openWindow();
|
m_mainWindow->openWindow();
|
||||||
|
|
||||||
#if LAF_LINUX // TODO check why this is required and we cannot call
|
#if LAF_LINUX // TODO check why this is required and we cannot call
|
||||||
// updateAllDisplaysWithNewScale() on Linux/X11
|
// updateAllDisplays() on Linux/X11
|
||||||
// Redraw the whole screen.
|
// Redraw the whole screen.
|
||||||
manager->invalidate();
|
manager->invalidate();
|
||||||
#else
|
#else
|
||||||
// To know the initial manager size we call to
|
// To know the initial manager size we call to
|
||||||
// Manager::updateAllDisplaysWithNewScale(...) so we receive a
|
// Manager::updateAllDisplays(...) so we receive a
|
||||||
// Manager::onNewDisplayConfiguration() (which will update the
|
// Manager::onNewDisplayConfiguration() (which will update the
|
||||||
// bounds of the manager for first time). This is required so if
|
// bounds of the manager for first time). This is required so if
|
||||||
// the OpenFileCommand (called when we're processing the CLI with
|
// the OpenFileCommand (called when we're processing the CLI with
|
||||||
// OpenBatchOfFiles) shows a dialog to open a sequence of files,
|
// OpenBatchOfFiles) shows a dialog to open a sequence of files,
|
||||||
// the dialog is centered correctly to the manager bounds.
|
// the dialog is centered correctly to the manager bounds.
|
||||||
const int scale = Preferences::instance().general.screenScale();
|
const int scale = Preferences::instance().general.screenScale();
|
||||||
manager->updateAllDisplaysWithNewScale(scale);
|
const bool gpu = Preferences::instance().general.gpuAcceleration();
|
||||||
|
manager->updateAllDisplays(scale, gpu);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif // ENABLE_UI
|
#endif // ENABLE_UI
|
||||||
|
|
|
@ -868,13 +868,13 @@ public:
|
||||||
ui::set_mouse_cursor_scale(m_pref.cursor.cursorScale());
|
ui::set_mouse_cursor_scale(m_pref.cursor.cursorScale());
|
||||||
|
|
||||||
bool reset_screen = false;
|
bool reset_screen = false;
|
||||||
int newScreenScale = base::convert_to<int>(screenScale()->getValue());
|
const int newScreenScale = base::convert_to<int>(screenScale()->getValue());
|
||||||
if (newScreenScale != m_pref.general.screenScale()) {
|
if (newScreenScale != m_pref.general.screenScale()) {
|
||||||
m_pref.general.screenScale(newScreenScale);
|
m_pref.general.screenScale(newScreenScale);
|
||||||
reset_screen = true;
|
reset_screen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int newUIScale = base::convert_to<int>(uiScale()->getValue());
|
const int newUIScale = base::convert_to<int>(uiScale()->getValue());
|
||||||
if (newUIScale != m_pref.general.uiScale()) {
|
if (newUIScale != m_pref.general.uiScale()) {
|
||||||
m_pref.general.uiScale(newUIScale);
|
m_pref.general.uiScale(newUIScale);
|
||||||
ui::set_theme(ui::get_theme(),
|
ui::set_theme(ui::get_theme(),
|
||||||
|
@ -882,7 +882,7 @@ public:
|
||||||
reset_screen = true;
|
reset_screen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool newGpuAccel = gpuAcceleration()->isSelected();
|
const bool newGpuAccel = gpuAcceleration()->isSelected();
|
||||||
if (newGpuAccel != m_pref.general.gpuAcceleration()) {
|
if (newGpuAccel != m_pref.general.gpuAcceleration()) {
|
||||||
m_pref.general.gpuAcceleration(newGpuAccel);
|
m_pref.general.gpuAcceleration(newGpuAccel);
|
||||||
reset_screen = true;
|
reset_screen = true;
|
||||||
|
@ -1018,8 +1018,8 @@ private:
|
||||||
|
|
||||||
void updateScreenScaling() {
|
void updateScreenScaling() {
|
||||||
ui::Manager* manager = ui::Manager::getDefault();
|
ui::Manager* manager = ui::Manager::getDefault();
|
||||||
m_system->setGpuAcceleration(m_pref.general.gpuAcceleration());
|
manager->updateAllDisplays(m_pref.general.screenScale(),
|
||||||
manager->updateAllDisplaysWithNewScale(m_pref.general.screenScale());
|
m_pref.general.gpuAcceleration());
|
||||||
}
|
}
|
||||||
|
|
||||||
void onApply() {
|
void onApply() {
|
||||||
|
|
|
@ -128,8 +128,6 @@ static bool create_main_window(bool gpuAccel,
|
||||||
int scale = Preferences::instance().general.screenScale();
|
int scale = Preferences::instance().general.screenScale();
|
||||||
|
|
||||||
const os::SystemRef system = os::System::instance();
|
const os::SystemRef system = os::System::instance();
|
||||||
system->setGpuAcceleration(gpuAccel);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!spec.frame().isEmpty() ||
|
if (!spec.frame().isEmpty() ||
|
||||||
!spec.contentRect().isEmpty()) {
|
!spec.contentRect().isEmpty()) {
|
||||||
|
@ -165,6 +163,8 @@ static bool create_main_window(bool gpuAccel,
|
||||||
if (scale == 0)
|
if (scale == 0)
|
||||||
Preferences::instance().general.screenScale(main_window->scale());
|
Preferences::instance().general.screenScale(main_window->scale());
|
||||||
|
|
||||||
|
main_window->setGpuAcceleration(gpuAccel);
|
||||||
|
|
||||||
if (main_window->isMinimized())
|
if (main_window->isMinimized())
|
||||||
main_window->maximize();
|
main_window->maximize();
|
||||||
}
|
}
|
||||||
|
@ -658,7 +658,7 @@ bool CustomizedGuiManager::onProcessDevModeKeyDown(KeyMessage* msg)
|
||||||
ui::set_theme(ui::get_theme(), uiScale);
|
ui::set_theme(ui::get_theme(), uiScale);
|
||||||
}
|
}
|
||||||
if (screenScale != window->scale()) {
|
if (screenScale != window->scale()) {
|
||||||
updateAllDisplaysWithNewScale(screenScale);
|
updateAllDisplays(screenScale, window->gpuAcceleration());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const std::exception& ex) {
|
catch (const std::exception& ex) {
|
||||||
|
|
|
@ -77,7 +77,8 @@ public:
|
||||||
ui::set_theme(ui::get_theme(), newUIScale);
|
ui::set_theme(ui::get_theme(), newUIScale);
|
||||||
|
|
||||||
Manager::getDefault()
|
Manager::getDefault()
|
||||||
->updateAllDisplaysWithNewScale(newScreenScale);
|
->updateAllDisplays(newScreenScale,
|
||||||
|
pref.general.gpuAcceleration());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Aseprite Document IO Library
|
# Aseprite Document IO Library
|
||||||
# Copyright (c) 2022-2023 Igara Studio S.A.
|
# Copyright (c) 2022-2024 Igara Studio S.A.
|
||||||
# Copyright (c) 2016-2018 David Capello
|
# Copyright (c) 2016-2018 David Capello
|
||||||
|
|
||||||
add_library(dio-lib
|
add_library(dio-lib
|
||||||
|
@ -10,6 +10,10 @@ add_library(dio-lib
|
||||||
detect_format.cpp
|
detect_format.cpp
|
||||||
stdio.cpp)
|
stdio.cpp)
|
||||||
|
|
||||||
|
if(ENABLE_DEVMODE)
|
||||||
|
target_compile_definitions(dio-lib PUBLIC -DENABLE_DEVMODE)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(dio-lib
|
target_link_libraries(dio-lib
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
fmt
|
fmt
|
||||||
|
|
|
@ -311,10 +311,11 @@ void Manager::flipAllDisplays()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::updateAllDisplaysWithNewScale(int scale)
|
void Manager::updateAllDisplays(int scale, bool gpu)
|
||||||
{
|
{
|
||||||
os::Window* nativeWindow = m_display.nativeWindow();
|
os::Window* nativeWindow = m_display.nativeWindow();
|
||||||
nativeWindow->setScale(scale);
|
nativeWindow->setScale(scale);
|
||||||
|
nativeWindow->setGpuAcceleration(gpu);
|
||||||
|
|
||||||
if (get_multiple_displays()) {
|
if (get_multiple_displays()) {
|
||||||
for (auto child : children()) {
|
for (auto child : children()) {
|
||||||
|
@ -322,6 +323,7 @@ void Manager::updateAllDisplaysWithNewScale(int scale)
|
||||||
if (window->ownDisplay()) {
|
if (window->ownDisplay()) {
|
||||||
Display* display = static_cast<Window*>(child)->display();
|
Display* display = static_cast<Window*>(child)->display();
|
||||||
display->nativeWindow()->setScale(scale);
|
display->nativeWindow()->setScale(scale);
|
||||||
|
display->nativeWindow()->setGpuAcceleration(gpu);
|
||||||
onNewDisplayConfiguration(display);
|
onNewDisplayConfiguration(display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1390,6 +1392,7 @@ void Manager::_openWindow(Window* window, bool center)
|
||||||
if (get_multiple_displays()
|
if (get_multiple_displays()
|
||||||
&& window->shouldCreateNativeWindow()) {
|
&& window->shouldCreateNativeWindow()) {
|
||||||
const int scale = parentDisplay->nativeWindow()->scale();
|
const int scale = parentDisplay->nativeWindow()->scale();
|
||||||
|
const int gpu = parentDisplay->nativeWindow()->gpuAcceleration();
|
||||||
|
|
||||||
os::WindowSpec spec;
|
os::WindowSpec spec;
|
||||||
gfx::Rect frame;
|
gfx::Rect frame;
|
||||||
|
@ -1437,6 +1440,9 @@ void Manager::_openWindow(Window* window, bool center)
|
||||||
// Set native title bar text
|
// Set native title bar text
|
||||||
newNativeWindow->setTitle(window->text());
|
newNativeWindow->setTitle(window->text());
|
||||||
|
|
||||||
|
// Same GPU acceleration flag that the parent display
|
||||||
|
newNativeWindow->setGpuAcceleration(gpu);
|
||||||
|
|
||||||
// Activate only non-floating windows
|
// Activate only non-floating windows
|
||||||
if (!spec.floating())
|
if (!spec.floating())
|
||||||
newNativeWindow->activate();
|
newNativeWindow->activate();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Aseprite UI Library
|
// Aseprite UI Library
|
||||||
// Copyright (C) 2018-2023 Igara Studio S.A.
|
// Copyright (C) 2018-2024 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2017 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
|
@ -46,7 +46,9 @@ namespace ui {
|
||||||
// Refreshes all real displays with the UI content.
|
// Refreshes all real displays with the UI content.
|
||||||
void flipAllDisplays();
|
void flipAllDisplays();
|
||||||
|
|
||||||
void updateAllDisplaysWithNewScale(int scale);
|
// Updates the scale and GPU acceleration flag of all native
|
||||||
|
// windows.
|
||||||
|
void updateAllDisplays(int scale, bool gpu);
|
||||||
|
|
||||||
// Adds the given "msg" message to the queue of messages to be
|
// Adds the given "msg" message to the queue of messages to be
|
||||||
// dispached. "msg" cannot be used after this function, it'll be
|
// dispached. "msg" cannot be used after this function, it'll be
|
||||||
|
|
|
@ -58,17 +58,6 @@ if(REQUIRE_CURL AND NOT USE_SHARED_CURL)
|
||||||
set(BUILD_RELEASE_DEBUG_DIRS ON BOOL)
|
set(BUILD_RELEASE_DEBUG_DIRS ON BOOL)
|
||||||
set(BUILD_CURL_EXE OFF CACHE BOOL "Set to ON to build curl executable.")
|
set(BUILD_CURL_EXE OFF CACHE BOOL "Set to ON to build curl executable.")
|
||||||
|
|
||||||
# SSL/TLS support (use native libraries only)
|
|
||||||
set(CMAKE_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
|
|
||||||
set(CMAKE_USE_LIBSSH2 OFF CACHE BOOL "Use libSSH2")
|
|
||||||
if(WIN32)
|
|
||||||
set(CMAKE_USE_SCHANNEL ON CACHE BOOL "enable Windows native SSL/TLS")
|
|
||||||
elseif(APPLE)
|
|
||||||
set(CMAKE_USE_SECTRANSP ON CACHE BOOL "enable Apple OS native SSL/TLS")
|
|
||||||
else()
|
|
||||||
# TODO Linux?
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory(curl)
|
add_subdirectory(curl)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue