Skip to content

Commit

Permalink
undo: simplify the interface
Browse files Browse the repository at this point in the history
  • Loading branch information
abique committed Sep 13, 2024
1 parent 7cde675 commit 3b099f0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions include/clap/ext/draft/undo.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ extern "C" {
/// and maybe an easier experience for the user because there's a single undo context versus one
/// for the host and one for each plugin instance.

enum clap_undo_context_flags {
// While the host is within a change, it is impossible to perform undo or redo.
CLAP_UNDO_IS_WITHIN_CHANGE = 1 << 0,
};

enum clap_undo_delta_properties_flags {
// If not set, then all clap_undo_delta_properties's attributes become irrelevant.
// If set, then the plugin will provide deltas in host->change_made().
Expand Down Expand Up @@ -102,6 +97,17 @@ typedef struct clap_plugin_undo {
uint64_t flags,
const char *undo_name,
const char *redo_name);

// if can_* is false then it invalidates the corresponding name.
// [main-thread]
void (CLAP_ABI *set_can_undo)(const clap_plugin_t *plugin, bool can_undo);
void (CLAP_ABI *set_can_redo)(const clap_plugin_t *plugin, bool can_redo);

// name: null terminated string if an redo/undo step exists, null otherwise.
// [main-thread]
void (CLAP_ABI *set_undo_name)(const clap_plugin_t *plugin, const char *name);
void (CLAP_ABI *set_redo_name)(const clap_plugin_t *plugin, const char *name);

} clap_plugin_undo_t;

typedef struct clap_host_undo {
Expand Down

0 comments on commit 3b099f0

Please sign in to comment.