Skip to content

Commit

Permalink
undo: doc
Browse files Browse the repository at this point in the history
  • Loading branch information
abique committed Sep 18, 2024
1 parent 68f1eda commit b8c9e93
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions include/clap/ext/draft/undo.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ typedef struct clap_undo_delta_properties {
uint32_t format_version;
} clap_undo_delta_properties_t;

// Use CLAP_EXT_UNDO_DELTA
// This is an optional interface, using deltas is an optimization versus making state snapshot.
// Use CLAP_EXT_UNDO_DELTA.
// This is an optional interface, using deltas is an optimization versus making a state snapshot.
typedef struct clap_plugin_undo_delta {
// Asks the plugin the delta properties.
// [main-thread]
Expand Down Expand Up @@ -96,12 +96,11 @@ typedef struct clap_plugin_undo_delta {
size_t delta_size);
} clap_plugin_undo_delta_t;

// Use CLAP_EXT_UNDO_CONTEXT
// Use CLAP_EXT_UNDO_CONTEXT.
// This is an optional interface, that the plugin can implement in order to know about
// the current undo context.
typedef struct clap_plugin_undo_context {
// Indicate if it is currently possible to perform a redo or undo operation.
// if can_* is false then it invalidates the corresponding name.
// Indicate if it is currently possible to perform an undo or redo operation.
// [main-thread & plugin-subscribed-to-undo-context]
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);
Expand All @@ -113,7 +112,7 @@ typedef struct clap_plugin_undo_context {
void(CLAP_ABI *set_redo_name)(const clap_plugin_t *plugin, const char *name);
} clap_plugin_undo_context_t;

// Use CLAP_EXT_UNDO
// Use CLAP_EXT_UNDO.
typedef struct clap_host_undo {
// Begins a long running change.
// The plugin must not call this twice: there must be either a call to cancel_change() or
Expand Down Expand Up @@ -165,7 +164,10 @@ typedef struct clap_host_undo {
bool delta_can_undo);

// Asks the host to perform the next undo or redo step.
// This operation may be asynchronous and isn't available while the host is within a change.
//
// Note: this maybe a complex and asynchronous operation, which may complete after
// this function returns.
//
// [main-thread]
void(CLAP_ABI *undo)(const clap_host_t *host);
void(CLAP_ABI *redo)(const clap_host_t *host);
Expand Down

0 comments on commit b8c9e93

Please sign in to comment.