Skip to content

Commit 27517a5

Browse files
committed
Simplify the delta properties
1 parent ce92aa2 commit 27517a5

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

include/clap/ext/draft/undo.h

+12-19
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,22 @@ enum clap_undo_context_flags {
4949
CLAP_UNDO_IS_WITHIN_CHANGE = 1 << 0,
5050
};
5151

52-
enum clap_undo_delta_lifetime {
53-
// No delta will be provided.
54-
CLAP_UNDO_DELTA_LIFETIME_VOID = 0,
55-
56-
// The delta is valid for the duration of the plugin instance.
57-
CLAP_UNDO_DELTA_LIFETIME_INSTANCE = 1,
58-
59-
// The delta is valid beyond the plugin instance, as long as the plugin is compatible with the
60-
// current format version.
61-
CLAP_UNDO_DELTA_LIFETIME_PERSISTANT = 2,
62-
63-
// The plugin guarentees that the delta will be forward compatible with all future version of
64-
// this plugin.
65-
CLAP_UNDO_DELTA_LIFETIME_FOREVER = 3,
52+
enum clap_undo_delta_properties_flags {
53+
// If not set, then all clap_undo_delta_properties's attributes becomes irrelevant.
54+
// If set, then the plugin will provide deltas in host->change_made().
55+
CLAP_UNDO_DELTA_PROPERTIES_HAS_DELTA = 1 << 0,
56+
57+
// If set, then the delta will be re-usable in the future as long as the plugin is
58+
// compatible with the given format_version.
59+
CLAP_UNDO_DELTA_PROPERTIES_IS_PERSISTANT = 1 << 0,
6660
};
6761

6862
typedef struct clap_undo_delta_properties {
69-
// This represent the delta format version that the plugin is using.
70-
// Set to CLAP_INVALID_ID if irrelevant.
71-
clap_id format_version;
63+
// Bitmask of clap_undo_delta_properties_flags
64+
uint64_t flags;
7265

73-
// see clap_undo_delta_lifetime
74-
uint32_t lifetime;
66+
// This represent the delta format version that the plugin is using.
67+
uint32_t format_version;
7568
} clap_undo_delta_properties_t;
7669

7770
typedef struct clap_plugin_undo {

0 commit comments

Comments
 (0)