|
Blender V4.3
|
#include "BLI_path_utils.hh"#include "BLI_utildefines.h"#include "DNA_ID.h"#include "DNA_listBase.h"Go to the source code of this file.
Classes | |
| struct | UndoRefID |
| struct | UndoStack |
| struct | UndoStep |
| struct | UndoType |
Macros | |
| #define | UNDO_REF_ID_TYPE(ptr_ty) |
| #define | BKE_UNDOSYS_TYPE_IS_MEMFILE_SKIP(ty) ELEM(ty, BKE_UNDOSYS_TYPE_IMAGE) |
| #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) |
Typedefs | |
| using | UndoTypeForEachIDRefFn = void (*)(void *user_data, UndoRefID *id_ref) |
Enumerations | |
| enum | eUndoStepDir { STEP_REDO = 1 , STEP_UNDO = -1 , STEP_INVALID = 0 } |
| enum | eUndoPushReturn { UNDO_PUSH_RET_FAILURE = 0 , UNDO_PUSH_RET_SUCCESS = (1 << 0) , UNDO_PUSH_RET_OVERRIDE_CHANGED = (1 << 1) } |
| enum | eUndoTypeFlags { UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE = 1 << 0 , UNDOTYPE_FLAG_DECODE_ACTIVE_STEP = 1 << 1 } |
Variables | |
Public Undo Types | |
Expose since we need to perform operations on specific undo types (rarely). | |
| const UndoType * | BKE_UNDOSYS_TYPE_IMAGE |
| const UndoType * | BKE_UNDOSYS_TYPE_MEMFILE |
| const UndoType * | BKE_UNDOSYS_TYPE_PAINTCURVE |
| const UndoType * | BKE_UNDOSYS_TYPE_PARTICLE |
| const UndoType * | BKE_UNDOSYS_TYPE_SCULPT |
| const UndoType * | BKE_UNDOSYS_TYPE_TEXT |
| #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) |
Definition at line 198 of file BKE_undo_system.hh.
Referenced by ED_image_undo_push_end(), and ED_paintcurve_undo_push_end().
| #define BKE_UNDOSYS_TYPE_IS_MEMFILE_SKIP | ( | ty | ) | ELEM(ty, BKE_UNDOSYS_TYPE_IMAGE) |
Definition at line 180 of file BKE_undo_system.hh.
Referenced by memfile_undosys_step_decode().
| #define UNDO_REF_ID_TYPE | ( | ptr_ty | ) |
Definition at line 34 of file BKE_undo_system.hh.
| using UndoTypeForEachIDRefFn = void (*)(void *user_data, UndoRefID *id_ref) |
Definition at line 103 of file BKE_undo_system.hh.
| enum eUndoPushReturn |
| Enumerator | |
|---|---|
| UNDO_PUSH_RET_FAILURE | |
| UNDO_PUSH_RET_SUCCESS | |
| UNDO_PUSH_RET_OVERRIDE_CHANGED | |
Definition at line 96 of file BKE_undo_system.hh.
| enum eUndoStepDir |
| Enumerator | |
|---|---|
| STEP_REDO | |
| STEP_UNDO | |
| STEP_INVALID | |
Definition at line 90 of file BKE_undo_system.hh.
| enum eUndoTypeFlags |
#UndoType.flag bitflags.
Definition at line 150 of file BKE_undo_system.hh.
| void BKE_undosys_print | ( | UndoStack * | ustack | ) |
Definition at line 994 of file undo_system.cc.
References BLI_listbase_count(), LISTBASE_FOREACH, printf, UndoStack::step_active, UndoStack::step_active_memfile, and UndoStack::steps.
Referenced by ED_undo_push(), and ed_undo_step_post().
Definition at line 388 of file undo_system.cc.
References UndoStep::prev, UndoStack::step_active, and UndoStep::type.
Referenced by BKE_undosys_stack_init_or_active_with_type().
| void BKE_undosys_stack_clear | ( | UndoStack * | ustack | ) |
Definition at line 281 of file undo_system.cc.
References BLI_listbase_clear(), BLI_listbase_count(), CLOG_INFO, ListBase::last, LOG, UndoStack::step_active, UndoStack::step_init, UndoStack::steps, UNDO_NESTED_ASSERT, and undosys_step_free_and_unlink().
Referenced by BKE_undosys_stack_destroy(), and wm_file_read_post().
| void BKE_undosys_stack_clear_active | ( | UndoStack * | ustack | ) |
Definition at line 297 of file undo_system.cc.
References ListBase::last, UndoStep::prev, UndoStack::step_active, UndoStack::steps, undosys_stack_validate(), and undosys_step_free_and_unlink().
Referenced by ED_undo_grouped_push().
| UndoStack * BKE_undosys_stack_create | ( | ) |
Definition at line 269 of file undo_system.cc.
Referenced by ed_undo_push_exec(), and wm_file_read_post().
| void BKE_undosys_stack_destroy | ( | UndoStack * | ustack | ) |
Definition at line 275 of file undo_system.cc.
References BKE_undosys_stack_clear(), and MEM_freeN().
Referenced by ED_editors_exit(), and wm_close_and_free().
| void BKE_undosys_stack_group_begin | ( | UndoStack * | ustack | ) |
Definition at line 950 of file undo_system.cc.
References BLI_assert, and UndoStack::group_level.
Referenced by ED_undo_group_begin().
| void BKE_undosys_stack_group_end | ( | UndoStack * | ustack | ) |
Definition at line 956 of file undo_system.cc.
References BLI_assert, UndoStack::group_level, LIKELY, UndoStep::skip, and UndoStack::step_active.
Referenced by ED_undo_group_end().
| bool BKE_undosys_stack_has_undo | ( | const UndoStack * | ustack, |
| const char * | name ) |
Definition at line 377 of file undo_system.cc.
References BLI_listbase_is_empty(), BLI_rfindstring(), offsetof, UndoStep::prev, and UndoStack::steps.
Referenced by ED_undo_is_valid().
Definition at line 369 of file undo_system.cc.
References BKE_undosys_step_push_with_type(), BKE_undosys_type_from_context(), BKE_UNDOSYS_TYPE_MEMFILE, ELEM, and IFACE_.
Referenced by wm_file_read_post().
Definition at line 363 of file undo_system.cc.
References IFACE_, UNDO_NESTED_ASSERT, and undosys_stack_push_main().
Referenced by wm_file_read_post().
Definition at line 397 of file undo_system.cc.
References BKE_undosys_stack_active_with_type(), CLOG_INFO, LOG, UndoType::name, UndoStack::step_init, UndoStep::type, and UNDO_NESTED_ASSERT.
Referenced by ED_image_paint_tile_map_get(), and blender::ed::sculpt_paint::undo::get_active_step().
| void BKE_undosys_stack_limit_steps_and_memory | ( | UndoStack * | ustack, |
| int | steps, | ||
| size_t | memory_limit ) |
| steps | Limit the number of undo steps. |
| memory_limit | Limit the amount of memory used by the undo stack. |
Definition at line 407 of file undo_system.cc.
References BKE_UNDOSYS_TYPE_MEMFILE, CLOG_INFO, UndoStep::data_size, ListBase::last, LOG, memory_limit, UndoStep::prev, UndoStep::skip, steps, UndoStack::steps, UndoStep::type, UNDO_NESTED_ASSERT, and undosys_stack_clear_all_first().
Referenced by ED_undo_push().
| eUndoStepDir BKE_undosys_step_calc_direction | ( | const UndoStack * | ustack, |
| const UndoStep * | us_target, | ||
| const UndoStep * | us_reference ) |
Return direction of the undo/redo from us_reference (or ustack->step_active if NULL), and us_target.
us_reference and us_target are the same, we consider this is an undo.Definition at line 691 of file undo_system.cc.
References BLI_assert, BLI_assert_msg, ELEM, UndoStep::next, UndoStep::prev, UndoStack::step_active, STEP_INVALID, STEP_REDO, and STEP_UNDO.
Referenced by BKE_undosys_step_load_data_ex(), BKE_undosys_step_redo_with_data_ex(), BKE_undosys_step_undo_with_data_ex(), and ed_undo_step_by_name().
Definition at line 676 of file undo_system.cc.
References BLI_rfindstring(), offsetof, and UndoStack::steps.
Referenced by ed_undo_step_by_name().
| UndoStep * BKE_undosys_step_find_by_name_with_type | ( | UndoStack * | ustack, |
| const char * | name, | ||
| const UndoType * | ut ) |
Definition at line 662 of file undo_system.cc.
References LISTBASE_FOREACH_BACKWARD, UndoStack::steps, and STREQ.
Definition at line 681 of file undo_system.cc.
References LISTBASE_FOREACH_BACKWARD, and UndoStack::steps.
Referenced by memfile_undosys_step_encode().
Undo/Redo until the given us_target step becomes the active (currently loaded) one.
Definition at line 840 of file undo_system.cc.
References BKE_undosys_step_load_data_ex().
Referenced by BKE_undosys_step_load_from_index().
| bool BKE_undosys_step_load_data_ex | ( | UndoStack * | ustack, |
| bContext * | C, | ||
| UndoStep * | us_target, | ||
| UndoStep * | us_reference, | ||
| bool | use_skip ) |
Undo/Redo until the given us_target step becomes the active (currently loaded) one.
us_target is a 'skipped' one and use_skip is true, us_target will become the active step.use_skip is true, the final target will always be beyond the given one (if the given one has to be skipped).| us_reference | If NULL, will be set to current active step in the undo stack. Otherwise, it is assumed to match the current state, and will be used as basis for the undo/redo process (i.e. all steps in-between us_reference and us_target will be processed). |
Definition at line 750 of file undo_system.cc.
References BKE_undosys_step_calc_direction(), BLI_assert, BLI_assert_msg, CLOG_ERROR, CLOG_INFO, G_MAIN, LOG, UndoStep::name, UndoType::name, UndoStep::next, UndoStep::prev, UndoStep::skip, UndoStack::step_active, STEP_INVALID, CLG_LogRef::type, UndoStep::type, UNDO_NESTED_ASSERT, undosys_stack_validate(), undosys_step_decode(), and undosys_step_iter_first().
Referenced by BKE_undosys_step_load_data(), BKE_undosys_step_redo_with_data_ex(), BKE_undosys_step_undo_with_data_ex(), and ed_undo_step_by_name().
Undo/Redo until the step matching given index in the undo stack becomes the active (currently loaded) one.
Definition at line 846 of file undo_system.cc.
References BKE_undosys_step_load_data(), BLI_assert, BLI_findlink(), UndoStep::skip, UndoStack::step_active, and UndoStack::steps.
Referenced by ed_undo_step_by_index().
| eUndoPushReturn BKE_undosys_step_push | ( | UndoStack * | ustack, |
| bContext * | C, | ||
| const char * | name ) |
Definition at line 625 of file undo_system.cc.
References BKE_undosys_step_push_with_type(), BKE_undosys_type_from_context(), UndoStack::step_init, UndoStep::type, UNDO_NESTED_ASSERT, and UNDO_PUSH_RET_FAILURE.
Referenced by ED_image_undo_push_end(), ED_paintcurve_undo_push_end(), and ED_undo_push().
Definition at line 507 of file undo_system.cc.
References BKE_undosys_step_push_init_with_type(), BKE_undosys_type_from_context(), BLI_assert, UndoStack::step_init, and UNDO_NESTED_ASSERT.
| UndoStep * BKE_undosys_step_push_init_with_type | ( | UndoStack * | ustack, |
| bContext * | C, | ||
| const char * | name, | ||
| const UndoType * | ut ) |
Only some UndoType's require init.
Definition at line 473 of file undo_system.cc.
References BLI_assert, CLOG_INFO, LOG, MEM_callocN, UndoStep::name, UndoType::name, UndoStep::next, UndoStack::step_active, UndoType::step_encode_init, UndoStack::step_init, UndoType::step_size, STRNCPY, UndoStep::type, UNDO_NESTED_ASSERT, undosys_stack_clear_all_last(), undosys_stack_validate(), and undosys_step_free_and_unlink().
Referenced by BKE_undosys_step_push_init(), ED_paintcurve_undo_push_begin(), ED_text_undo_push_init(), image_undo_push_begin(), and blender::ed::sculpt_paint::undo::push_begin_ex().
| eUndoPushReturn BKE_undosys_step_push_with_type | ( | UndoStack * | ustack, |
| bContext * | C, | ||
| const char * | name, | ||
| const UndoType * | ut ) |
| C | Can be NULL from some callers if their encoding function doesn't need it |
Definition at line 519 of file undo_system.cc.
References BKE_lib_override_library_main_operations_create(), BLI_addtail(), BLI_assert, BLI_findindex(), CLOG_INFO, UndoType::flags, G_MAIN, UndoStack::group_level, ListBase::last, LOG, MEM_callocN, MEM_freeN(), UndoStep::name, UndoType::name, RNA_OVERRIDE_MATCH_RESULT_CREATED, RNA_OVERRIDE_MATCH_RESULT_INIT, UndoStep::skip, UndoStack::step_active, UndoStack::step_active_memfile, UndoType::step_foreach_ID_ref, UndoStack::step_init, UndoType::step_size, UndoStack::steps, STREQ, STRNCPY, UndoStep::type, UNDO_NESTED_ASSERT, UNDO_PUSH_RET_FAILURE, UNDO_PUSH_RET_OVERRIDE_CHANGED, UNDO_PUSH_RET_SUCCESS, undosys_stack_push_main(), undosys_stack_validate(), undosys_step_encode(), undosys_step_free_and_unlink(), UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE, UndoStep::use_memfile_step, and UndoStep::use_old_bmain_data.
Referenced by BKE_undosys_stack_init_from_context(), BKE_undosys_step_push(), and undosys_stack_push_main().
Redo one step from current active one.
Definition at line 903 of file undo_system.cc.
References BKE_undosys_step_redo_with_data(), UndoStep::next, and UndoStack::step_active.
Referenced by ed_undo_step_direction().
Redo until us_target step becomes the active (currently loaded) one.
Definition at line 898 of file undo_system.cc.
References BKE_undosys_step_redo_with_data_ex().
Referenced by BKE_undosys_step_redo().
| bool BKE_undosys_step_redo_with_data_ex | ( | UndoStack * | ustack, |
| bContext * | C, | ||
| UndoStep * | us_target, | ||
| bool | use_skip ) |
Redo until us_target step becomes the active (currently loaded) one.
us_target is a 'skipped' one and use_skip is true, us_target will become the active step.use_skip is true, the final target will always be after the given one (if the given one has to be skipped). Definition at line 884 of file undo_system.cc.
References BKE_undosys_step_calc_direction(), BKE_undosys_step_load_data_ex(), BLI_assert, UndoStep::prev, and UndoStack::step_active.
Referenced by BKE_undosys_step_redo_with_data().
Useful when we want to diff against previous undo data but can't be sure the types match.
Definition at line 636 of file undo_system.cc.
References UndoStep::next, and UndoStep::type.
Referenced by memfile_undosys_step_free().
Useful when we want to diff against previous undo data but can't be sure the types match.
Definition at line 649 of file undo_system.cc.
References UndoStep::prev, and UndoStep::type.
Undo one step from current active (currently loaded) one.
Definition at line 876 of file undo_system.cc.
References BKE_undosys_step_undo_with_data(), UndoStep::prev, and UndoStack::step_active.
Referenced by ed_undo_step_direction().
Undo until us_target step becomes the active (currently loaded) one.
Definition at line 871 of file undo_system.cc.
References BKE_undosys_step_undo_with_data_ex().
Referenced by BKE_undosys_step_undo().
| bool BKE_undosys_step_undo_with_data_ex | ( | UndoStack * | ustack, |
| bContext * | C, | ||
| UndoStep * | us_target, | ||
| bool | use_skip ) |
Undo until us_target step becomes the active (currently loaded) one.
us_target is a 'skipped' one and use_skip is true, us_target will become the active step.use_skip is true, the final target will always be before the given one (if the given one has to be skipped). Definition at line 856 of file undo_system.cc.
References BKE_undosys_step_calc_direction(), BKE_undosys_step_load_data_ex(), BLI_assert, and UndoStack::step_active.
Referenced by BKE_undosys_step_undo_with_data().
Similar to WM_operatortype_append
Definition at line 911 of file undo_system.cc.
References BLI_addtail(), and g_undo_types.
Referenced by ED_undosys_type_init().
| void BKE_undosys_type_free_all | ( | ) |
Definition at line 922 of file undo_system.cc.
References BLI_pophead(), g_undo_types, and MEM_freeN().
Referenced by ED_undosys_type_free().
| UNDO_REF_ID_TYPE | ( | GreasePencil | ) |
| UNDO_REF_ID_TYPE | ( | Image | ) |
| UNDO_REF_ID_TYPE | ( | Mesh | ) |
| UNDO_REF_ID_TYPE | ( | Object | ) |
| UNDO_REF_ID_TYPE | ( | PaintCurve | ) |
| UNDO_REF_ID_TYPE | ( | Scene | ) |
| UNDO_REF_ID_TYPE | ( | Text | ) |
|
extern |
Definition at line 61 of file undo_system.cc.
Referenced by ED_image_paint_tile_map_get(), ED_image_undo_push_begin_with_image(), ED_undosys_type_init(), image_undo_push_begin(), and image_undosys_step_encode().
|
extern |
Definition at line 62 of file undo_system.cc.
Referenced by BKE_undosys_stack_init_from_context(), BKE_undosys_stack_limit_steps_and_memory(), ED_undosys_stack_memfile_get_if_active(), ED_undosys_stack_memfile_id_changed_tag(), ED_undosys_type_init(), memfile_undosys_step_encode(), undosys_stack_push_main(), undosys_step_decode(), and undosys_step_encode().
|
extern |
Definition at line 63 of file undo_system.cc.
Referenced by ED_paintcurve_undo_push_begin(), and ED_undosys_type_init().
|
extern |
Definition at line 64 of file undo_system.cc.
Referenced by ED_undosys_type_init().
|
extern |
Definition at line 65 of file undo_system.cc.
Referenced by ED_undosys_type_init(), blender::ed::sculpt_paint::undo::get_active_step(), blender::ed::sculpt_paint::undo::push_begin_ex(), and blender::ed::sculpt_paint::undo::step_decode_undo().
|
extern |
Definition at line 66 of file undo_system.cc.
Referenced by ED_text_undo_push_init(), ED_undosys_type_init(), text_undosys_poll(), and text_undosys_step_encode_init().