From 1a62b1e8c33a1273caf37be25b1c4746448aece7 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Wed, 18 Sep 2024 12:42:16 +0200 Subject: [PATCH] Update to clap/next --- clap | 2 +- clap-helpers | 2 +- plugins/core-plugin.cc | 16 ++++++++-------- plugins/core-plugin.hh | 9 +++++---- plugins/plugs/undo-test/undo-test.hh | 10 +++++----- plugins/plugs/undo-test/undo-test.hxx | 18 +++++++++--------- vcpkg | 2 +- 7 files changed, 30 insertions(+), 29 deletions(-) diff --git a/clap b/clap index 1a8d91b..1f552b7 160000 --- a/clap +++ b/clap @@ -1 +1 @@ -Subproject commit 1a8d91b4df8311ff2a19298b76bc7cde08498f12 +Subproject commit 1f552b775479e22d9efc8c9cc8098e63902fe3cd diff --git a/clap-helpers b/clap-helpers index d1ad796..c0cd2f2 160000 --- a/clap-helpers +++ b/clap-helpers @@ -1 +1 @@ -Subproject commit d1ad796ed442ac15819d9f7a61c3a04c4c0ae251 +Subproject commit c0cd2f2e82d5ac289e9adcefa451c39db7d43a3a diff --git a/plugins/core-plugin.cc b/plugins/core-plugin.cc index 966b9f9..a73f332 100644 --- a/plugins/core-plugin.cc +++ b/plugins/core-plugin.cc @@ -294,12 +294,12 @@ namespace clap { } void CorePlugin::guiSubscribeUndo() { - if (implementsUndo() && _host.canUseUndo()) + if (_host.canUseUndo()) _host.undoSetWantsContextUpdates(true); } void CorePlugin::guiUnsubscribeUndo() { - if (implementsUndo() && _host.canUseUndo()) + if (_host.canUseUndo()) _host.undoSetWantsContextUpdates(false); } @@ -952,7 +952,7 @@ namespace clap { return true; } - void CorePlugin::undoSetCanUndo(bool can_undo) noexcept { + void CorePlugin::undoContextSetCanUndo(bool can_undo) noexcept { _canUndo = can_undo; #ifndef CLAP_PLUGINS_HEADLESS @@ -961,10 +961,10 @@ namespace clap { #endif if (!can_undo) - undoSetUndoName(nullptr); + undoContextSetUndoName(nullptr); } - void CorePlugin::undoSetCanRedo(bool can_redo) noexcept { + void CorePlugin::undoContextSetCanRedo(bool can_redo) noexcept { _canRedo = can_redo; #ifndef CLAP_PLUGINS_HEADLESS @@ -973,10 +973,10 @@ namespace clap { #endif if (!can_redo) - undoSetRedoName(nullptr); + undoContextSetRedoName(nullptr); } - void CorePlugin::undoSetUndoName(const char *name) noexcept { + void CorePlugin::undoContextSetUndoName(const char *name) noexcept { if (name && *name) _undoName = name; else @@ -988,7 +988,7 @@ namespace clap { #endif } - void CorePlugin::undoSetRedoName(const char *name) noexcept { + void CorePlugin::undoContextSetRedoName(const char *name) noexcept { if (name && *name) _redoName = name; else diff --git a/plugins/core-plugin.hh b/plugins/core-plugin.hh index f5452fc..9100e56 100644 --- a/plugins/core-plugin.hh +++ b/plugins/core-plugin.hh @@ -219,10 +219,11 @@ namespace clap { //------------------// // clap_plugin_undo // //------------------// - void undoSetCanUndo(bool can_undo) noexcept override; - void undoSetCanRedo(bool can_redo) noexcept override; - void undoSetUndoName(const char *name) noexcept override; - void undoSetRedoName(const char *name) noexcept override; + bool implementsUndoContext() const noexcept override { return true; } + void undoContextSetCanUndo(bool can_undo) noexcept override; + void undoContextSetCanRedo(bool can_redo) noexcept override; + void undoContextSetUndoName(const char *name) noexcept override; + void undoContextSetRedoName(const char *name) noexcept override; ////////////////////// // Cached Host Info // diff --git a/plugins/plugs/undo-test/undo-test.hh b/plugins/plugs/undo-test/undo-test.hh index 4bb8117..ba71fbc 100644 --- a/plugins/plugs/undo-test/undo-test.hh +++ b/plugins/plugs/undo-test/undo-test.hh @@ -20,11 +20,11 @@ namespace clap { std::vector stateSaveExtra() noexcept override; bool stateLoadExtra(const std::vector &data) noexcept override; - bool implementsUndo() const noexcept override; - void undoGetDeltaProperties(clap_undo_delta_properties_t *properties) noexcept override; - bool undoCanUseDeltaFormatVersion(clap_id format_version) noexcept override; - bool undoUndo(clap_id format_version, const void *delta, size_t delta_size) noexcept override; - bool undoRedo(clap_id format_version, const void *delta, size_t delta_size) noexcept override; + bool implementsUndoDelta() const noexcept override; + void undoDeltaGetDeltaProperties(clap_undo_delta_properties_t *properties) noexcept override; + bool undoDeltaCanUseDeltaFormatVersion(clap_id format_version) noexcept override; + bool undoDeltaUndo(clap_id format_version, const void *delta, size_t delta_size) noexcept override; + bool undoDeltaRedo(clap_id format_version, const void *delta, size_t delta_size) noexcept override; void incrementState(); void notifyGuiStateProperties(); diff --git a/plugins/plugs/undo-test/undo-test.hxx b/plugins/plugs/undo-test/undo-test.hxx index 0596336..f703161 100644 --- a/plugins/plugs/undo-test/undo-test.hxx +++ b/plugins/plugs/undo-test/undo-test.hxx @@ -55,12 +55,12 @@ namespace clap { } template - bool UndoTest::implementsUndo() const noexcept { + bool UndoTest::implementsUndoDelta() const noexcept { return true; } template - void UndoTest::undoGetDeltaProperties( + void UndoTest::undoDeltaGetDeltaProperties( clap_undo_delta_properties_t *properties) noexcept { properties->has_delta = hasDelta; properties->are_deltas_persistent = areDeltasPersistant; @@ -68,7 +68,7 @@ namespace clap { } template - bool UndoTest::undoCanUseDeltaFormatVersion( + bool UndoTest::undoDeltaCanUseDeltaFormatVersion( clap_id format_version) noexcept { if constexpr (!hasDelta) return false; @@ -77,9 +77,9 @@ namespace clap { } template - bool UndoTest::undoUndo(clap_id format_version, - const void *delta, - size_t delta_size) noexcept { + bool UndoTest::undoDeltaUndo(clap_id format_version, + const void *delta, + size_t delta_size) noexcept { if constexpr (!hasDelta) return false; @@ -106,9 +106,9 @@ namespace clap { } template - bool UndoTest::undoRedo(clap_id format_version, - const void *delta, - size_t delta_size) noexcept { + bool UndoTest::undoDeltaRedo(clap_id format_version, + const void *delta, + size_t delta_size) noexcept { if constexpr (!hasDelta) return false; diff --git a/vcpkg b/vcpkg index efb544d..dd3adcf 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit efb544d5a580c51f270998d6522c08debb1b5769 +Subproject commit dd3adcf020e69077e83e92a0a293ceca734f6288