Skip to content

Commit b8c9e93

Browse files
committed
undo: doc
1 parent 68f1eda commit b8c9e93

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

include/clap/ext/draft/undo.h

+9-7
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ typedef struct clap_undo_delta_properties {
6363
uint32_t format_version;
6464
} clap_undo_delta_properties_t;
6565

66-
// Use CLAP_EXT_UNDO_DELTA
67-
// This is an optional interface, using deltas is an optimization versus making state snapshot.
66+
// Use CLAP_EXT_UNDO_DELTA.
67+
// This is an optional interface, using deltas is an optimization versus making a state snapshot.
6868
typedef struct clap_plugin_undo_delta {
6969
// Asks the plugin the delta properties.
7070
// [main-thread]
@@ -96,12 +96,11 @@ typedef struct clap_plugin_undo_delta {
9696
size_t delta_size);
9797
} clap_plugin_undo_delta_t;
9898

99-
// Use CLAP_EXT_UNDO_CONTEXT
99+
// Use CLAP_EXT_UNDO_CONTEXT.
100100
// This is an optional interface, that the plugin can implement in order to know about
101101
// the current undo context.
102102
typedef struct clap_plugin_undo_context {
103-
// Indicate if it is currently possible to perform a redo or undo operation.
104-
// if can_* is false then it invalidates the corresponding name.
103+
// Indicate if it is currently possible to perform an undo or redo operation.
105104
// [main-thread & plugin-subscribed-to-undo-context]
106105
void(CLAP_ABI *set_can_undo)(const clap_plugin_t *plugin, bool can_undo);
107106
void(CLAP_ABI *set_can_redo)(const clap_plugin_t *plugin, bool can_redo);
@@ -113,7 +112,7 @@ typedef struct clap_plugin_undo_context {
113112
void(CLAP_ABI *set_redo_name)(const clap_plugin_t *plugin, const char *name);
114113
} clap_plugin_undo_context_t;
115114

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

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

0 commit comments

Comments
 (0)