Skip to content

Commit

Permalink
undo: make the delta always be able to perform the redo
Browse files Browse the repository at this point in the history
Rationnale: redo is the forward operation and is the easiest
  • Loading branch information
abique committed Sep 12, 2024
1 parent ed42929 commit 7a4e0b7
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions include/clap/ext/draft/undo.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ enum clap_undo_delta_properties_flags {
CLAP_UNDO_DELTA_PROPERTIES_IS_PERSISTENT = 1 << 1,
};

enum clap_undo_change_flags {
// When set, the delta can be used for undo
CLAP_UNDO_CHANGE_DELTA_CAN_UNDO = 1 << 0,

// When set, the delta can be used for redo
CLAP_UNDO_CHANGE_DELTA_CAN_REDO = 1 << 1,
};

typedef struct clap_undo_delta_properties {
// Bitmask of clap_undo_delta_properties_flags
uint64_t flags;
Expand Down Expand Up @@ -131,6 +123,8 @@ typedef struct clap_host_undo {
//
// delta: optional, it is a binary blobs used to perform the undo and redo. When not available
// the host will save the plugin state and use state->load() to perform undo and redo.
// The plugin must be able to perform a redo operation using the delta, though the undo operation
// is only possible if can_undo is true.
//
// Note: the provided delta may be used for incremental state saving and crash recovery. The
// plugin can indicate a format version id and the validity lifetime for the binary blobs.
Expand All @@ -147,7 +141,7 @@ typedef struct clap_host_undo {
const char *name,
const void *delta,
size_t delta_size,
uint32_t change_flags);
bool can_undo);

// Asks the host to perform the next undo step.
// This operation may be asynchronous and isn't available while the host is within a change.
Expand Down

0 comments on commit 7a4e0b7

Please sign in to comment.