diff options
author | Bastien Montagne <bastien@blender.org> | 2021-01-06 20:06:11 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-01-06 20:07:09 +0300 |
commit | 3028de9527a0a7e2772fd87fcf1abbf823698371 (patch) | |
tree | ee0498f7c5109dfde30246675009984392f2ec33 /source/blender/blenkernel/BKE_undo_system.h | |
parent | 5cdf279ef46fa8672d086d1f57025e31f477accc (diff) |
UndoType: Refactor: replace `use_context` boolean by a bitflag.
We will soon need more options here, sinmpler and cleaner to use a
bitflag then.
Diffstat (limited to 'source/blender/blenkernel/BKE_undo_system.h')
-rw-r--r-- | source/blender/blenkernel/BKE_undo_system.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_undo_system.h b/source/blender/blenkernel/BKE_undo_system.h index 9af4c07a4dc..0603ef85cc1 100644 --- a/source/blender/blenkernel/BKE_undo_system.h +++ b/source/blender/blenkernel/BKE_undo_system.h @@ -140,11 +140,8 @@ typedef struct UndoType { UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data); - /** - * This undo type `encode` callback needs a valid context, it will fail otherwise. - * \note Callback is still supposed to properly deal with a NULL context pointer. - */ - bool use_context_for_encode; + /** Information for the generic undo system to refine handling of this specific undo type. */ + uint flags; /** * The size of the undo struct 'inherited' from #UndoStep for that specific type. Used for @@ -152,6 +149,15 @@ typedef struct UndoType { size_t step_size; } UndoType; +/** #UndoType.flag bitflags. */ +typedef enum UndoTypeFlags { + /** + * This undo type `encode` callback needs a valid context, it will fail otherwise. + * \note Callback is still supposed to properly deal with a NULL context pointer. + */ + UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE = 1 << 0, +} UndoTypeFlags; + /* Expose since we need to perform operations on specific undo types (rarely). */ extern const UndoType *BKE_UNDOSYS_TYPE_IMAGE; extern const UndoType *BKE_UNDOSYS_TYPE_MEMFILE; |