Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_undo_system.h
| Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | typedef struct UndoType { | ||||
| bool (*poll)(struct bContext *C); | bool (*poll)(struct bContext *C); | ||||
| /** | /** | ||||
| * None of these callbacks manage list add/removal. | * None of these callbacks manage list add/removal. | ||||
| * | * | ||||
| * Note that 'step_encode_init' is optional, | * Note that 'step_encode_init' is optional, | ||||
| * some undo types need to perform operations before undo push finishes. | * some undo types need to perform operations before undo push finishes. | ||||
| */ | */ | ||||
| void (*step_encode_init)(struct bContext *C, UndoStep *us); | void (*step_encode_init)(const struct bContext *C, UndoStep *us); | ||||
| bool (*step_encode)(struct bContext *C, struct Main *bmain, UndoStep *us); | bool (*step_encode)(struct bContext *C, struct Main *bmain, UndoStep *us); | ||||
| void (*step_decode)( | void (*step_decode)( | ||||
| struct bContext *C, struct Main *bmain, UndoStep *us, int dir, bool is_final); | struct bContext *C, struct Main *bmain, UndoStep *us, int dir, bool is_final); | ||||
| /** | /** | ||||
| * \note When freeing all steps, | * \note When freeing all steps, | ||||
| * free from the last since #BKE_UNDOSYS_TYPE_MEMFILE | * free from the last since #BKE_UNDOSYS_TYPE_MEMFILE | ||||
| Show All 33 Lines | |||||
| #define BKE_undosys_stack_limit_steps_and_memory_defaults(ustack) \ | #define BKE_undosys_stack_limit_steps_and_memory_defaults(ustack) \ | ||||
| BKE_undosys_stack_limit_steps_and_memory(ustack, U.undosteps, (size_t)U.undomemory * 1024 * 1024) | BKE_undosys_stack_limit_steps_and_memory(ustack, U.undosteps, (size_t)U.undomemory * 1024 * 1024) | ||||
| void BKE_undosys_stack_group_begin(UndoStack *ustack); | void BKE_undosys_stack_group_begin(UndoStack *ustack); | ||||
| void BKE_undosys_stack_group_end(UndoStack *ustack); | void BKE_undosys_stack_group_end(UndoStack *ustack); | ||||
| /* Only some UndoType's require init. */ | /* Only some UndoType's require init. */ | ||||
| UndoStep *BKE_undosys_step_push_init_with_type(UndoStack *ustack, | UndoStep *BKE_undosys_step_push_init_with_type(UndoStack *ustack, | ||||
| struct bContext *C, | const struct bContext *C, | ||||
| const char *name, | const char *name, | ||||
| const UndoType *ut); | const UndoType *ut); | ||||
| UndoStep *BKE_undosys_step_push_init(UndoStack *ustack, struct bContext *C, const char *name); | UndoStep *BKE_undosys_step_push_init(UndoStack *ustack, struct bContext *C, const char *name); | ||||
| bool BKE_undosys_step_push_with_type(UndoStack *ustack, | bool BKE_undosys_step_push_with_type(UndoStack *ustack, | ||||
| struct bContext *C, | struct bContext *C, | ||||
| const char *name, | const char *name, | ||||
| const UndoType *ut); | const UndoType *ut); | ||||
| ▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines | |||||