Skip to content

Commit

Permalink
Update to clap/next
Browse files Browse the repository at this point in the history
  • Loading branch information
abique committed Sep 18, 2024
1 parent d68b6ce commit 1a62b1e
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion clap
2 changes: 1 addition & 1 deletion clap-helpers
16 changes: 8 additions & 8 deletions plugins/core-plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions plugins/core-plugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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 //
Expand Down
10 changes: 5 additions & 5 deletions plugins/plugs/undo-test/undo-test.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ namespace clap {
std::vector<uint8_t> stateSaveExtra() noexcept override;
bool stateLoadExtra(const std::vector<uint8_t> &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();
Expand Down
18 changes: 9 additions & 9 deletions plugins/plugs/undo-test/undo-test.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ namespace clap {
}

template <bool hasDelta, bool areDeltasPersistant>
bool UndoTest<hasDelta, areDeltasPersistant>::implementsUndo() const noexcept {
bool UndoTest<hasDelta, areDeltasPersistant>::implementsUndoDelta() const noexcept {
return true;
}

template <bool hasDelta, bool areDeltasPersistant>
void UndoTest<hasDelta, areDeltasPersistant>::undoGetDeltaProperties(
void UndoTest<hasDelta, areDeltasPersistant>::undoDeltaGetDeltaProperties(
clap_undo_delta_properties_t *properties) noexcept {
properties->has_delta = hasDelta;
properties->are_deltas_persistent = areDeltasPersistant;
properties->format_version = hasDelta ? UNDO_FORMAT_VERSION : CLAP_INVALID_ID;
}

template <bool hasDelta, bool areDeltasPersistant>
bool UndoTest<hasDelta, areDeltasPersistant>::undoCanUseDeltaFormatVersion(
bool UndoTest<hasDelta, areDeltasPersistant>::undoDeltaCanUseDeltaFormatVersion(
clap_id format_version) noexcept {
if constexpr (!hasDelta)
return false;
Expand All @@ -77,9 +77,9 @@ namespace clap {
}

template <bool hasDelta, bool areDeltasPersistant>
bool UndoTest<hasDelta, areDeltasPersistant>::undoUndo(clap_id format_version,
const void *delta,
size_t delta_size) noexcept {
bool UndoTest<hasDelta, areDeltasPersistant>::undoDeltaUndo(clap_id format_version,
const void *delta,
size_t delta_size) noexcept {
if constexpr (!hasDelta)
return false;

Expand All @@ -106,9 +106,9 @@ namespace clap {
}

template <bool hasDelta, bool areDeltasPersistant>
bool UndoTest<hasDelta, areDeltasPersistant>::undoRedo(clap_id format_version,
const void *delta,
size_t delta_size) noexcept {
bool UndoTest<hasDelta, areDeltasPersistant>::undoDeltaRedo(clap_id format_version,
const void *delta,
size_t delta_size) noexcept {
if constexpr (!hasDelta)
return false;

Expand Down
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 84 files
+1 −1 ports/aws-c-io/portfile.cmake
+1 −1 ports/aws-c-io/vcpkg.json
+1 −1 ports/aws-c-mqtt/portfile.cmake
+1 −1 ports/aws-c-mqtt/vcpkg.json
+1 −1 ports/boinc/portfile.cmake
+1 −1 ports/boinc/vcpkg.json
+1 −1 ports/capstone/portfile.cmake
+1 −2 ports/capstone/vcpkg.json
+1 −1 ports/cargs/portfile.cmake
+1 −1 ports/cargs/vcpkg.json
+1 −1 ports/catch2/portfile.cmake
+1 −1 ports/catch2/vcpkg.json
+1 −1 ports/cpp-peglib/portfile.cmake
+1 −1 ports/cpp-peglib/vcpkg.json
+1 −1 ports/crashpad/crashpadConfig.cmake.in
+1 −1 ports/crashpad/fix-lib-name-conflict-1.patch
+4 −4 ports/crashpad/fix-lib-name-conflict.patch
+1 −1 ports/crashpad/vcpkg.json
+2 −2 ports/debug-assert/portfile.cmake
+1 −2 ports/debug-assert/vcpkg.json
+2 −2 ports/dtl/portfile.cmake
+1 −1 ports/dtl/vcpkg.json
+0 −22 ports/fakeit/fix-include_dir.patch
+2 −2 ports/fakeit/portfile.cmake
+4 −8 ports/fakeit/usage
+1 −1 ports/fakeit/vcpkg.json
+1 −1 ports/fbthrift/portfile.cmake
+1 −1 ports/fbthrift/vcpkg.json
+1 −1 ports/fizz/portfile.cmake
+1 −1 ports/fizz/vcpkg.json
+1 −1 ports/folly/portfile.cmake
+1 −1 ports/folly/vcpkg.json
+1 −1 ports/glaze/portfile.cmake
+1 −1 ports/glaze/vcpkg.json
+1 −1 ports/jigson/portfile.cmake
+1 −1 ports/jigson/vcpkg.json
+2 −2 ports/lest/portfile.cmake
+1 −2 ports/lest/vcpkg.json
+2 −2 ports/libdivide/portfile.cmake
+1 −2 ports/libdivide/vcpkg.json
+1 −1 ports/libenvpp/portfile.cmake
+1 −1 ports/libenvpp/vcpkg.json
+1 −1 ports/mvfst/portfile.cmake
+1 −1 ports/mvfst/vcpkg.json
+8 −2 ports/projectm-eval/portfile.cmake
+5 −0 ports/projectm-eval/usage
+1 −0 ports/projectm-eval/vcpkg.json
+1 −1 ports/proxygen/portfile.cmake
+1 −1 ports/proxygen/vcpkg.json
+1 −1 ports/qtbase/vcpkg.json
+2 −2 ports/qtbase/windeployqt.debug.bat
+1 −0 ports/qttools/vcpkg.json
+2 −2 ports/qttools/windeployqt.debug.bat
+1 −1 ports/rocksdb/portfile.cmake
+1 −1 ports/rocksdb/vcpkg.json
+1 −1 ports/wangle/portfile.cmake
+1 −1 ports/wangle/vcpkg.json
+5 −0 versions/a-/aws-c-io.json
+5 −0 versions/a-/aws-c-mqtt.json
+5 −0 versions/b-/boinc.json
+30 −30 versions/baseline.json
+5 −0 versions/c-/capstone.json
+5 −0 versions/c-/cargs.json
+5 −0 versions/c-/catch2.json
+5 −0 versions/c-/cpp-peglib.json
+5 −0 versions/c-/crashpad.json
+5 −0 versions/d-/debug-assert.json
+5 −0 versions/d-/dtl.json
+5 −0 versions/f-/fakeit.json
+5 −0 versions/f-/fbthrift.json
+5 −0 versions/f-/fizz.json
+5 −0 versions/f-/folly.json
+5 −0 versions/g-/glaze.json
+5 −0 versions/j-/jigson.json
+5 −0 versions/l-/lest.json
+5 −0 versions/l-/libdivide.json
+5 −0 versions/l-/libenvpp.json
+5 −0 versions/m-/mvfst.json
+5 −0 versions/p-/projectm-eval.json
+5 −0 versions/p-/proxygen.json
+5 −0 versions/q-/qtbase.json
+5 −0 versions/q-/qttools.json
+5 −0 versions/r-/rocksdb.json
+5 −0 versions/w-/wangle.json

0 comments on commit 1a62b1e

Please sign in to comment.