|
Blender V4.3
|
#include <cstdio>#include <cstring>#include "CLG_log.h"#include "BLI_listbase.h"#include "BLI_string.h"#include "BLI_sys_types.h"#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "DNA_listBase.h"#include "DNA_windowmanager_types.h"#include "BKE_context.hh"#include "BKE_global.hh"#include "BKE_lib_id.hh"#include "BKE_lib_override.hh"#include "BKE_main.hh"#include "BKE_undo_system.hh"#include "RNA_access.hh"#include "MEM_guardedalloc.h"#include "BKE_blender_undo.hh"Go to the source code of this file.
Macros | |
| #define | undo_stack _wm_undo_stack_disallow /* pass in as a variable always. */ |
| #define | WITH_GLOBAL_UNDO_KEEP_ONE |
| #define | WITH_GLOBAL_UNDO_ENSURE_UPDATED |
| #define | WITH_GLOBAL_UNDO_CORRECT_ORDER |
Functions | |
Internal Callback Wrappers | |
UndoRefID is simply a way to avoid in-lining name copy and lookups, since it's easy to forget a single case when done inline (crashing in some cases). | |
| static void | undosys_id_ref_store (void *, UndoRefID *id_ref) |
| static void | undosys_id_ref_resolve (void *user_data, UndoRefID *id_ref) |
| static bool | undosys_step_encode (bContext *C, Main *bmain, UndoStack *ustack, UndoStep *us) |
| static void | undosys_step_decode (bContext *C, Main *bmain, UndoStack *ustack, UndoStep *us, const eUndoStepDir dir, bool is_final) |
| static void | undosys_step_free_and_unlink (UndoStack *ustack, UndoStep *us) |
Undo Stack | |
| static void | undosys_stack_validate (UndoStack *ustack, bool expect_non_empty) |
| UndoStack * | BKE_undosys_stack_create () |
| void | BKE_undosys_stack_destroy (UndoStack *ustack) |
| void | BKE_undosys_stack_clear (UndoStack *ustack) |
| void | BKE_undosys_stack_clear_active (UndoStack *ustack) |
| static void | undosys_stack_clear_all_last (UndoStack *ustack, UndoStep *us) |
| static void | undosys_stack_clear_all_first (UndoStack *ustack, UndoStep *us, UndoStep *us_exclude) |
| static bool | undosys_stack_push_main (UndoStack *ustack, const char *name, Main *bmain) |
| void | BKE_undosys_stack_init_from_main (UndoStack *ustack, Main *bmain) |
| void | BKE_undosys_stack_init_from_context (UndoStack *ustack, bContext *C) |
| bool | BKE_undosys_stack_has_undo (const UndoStack *ustack, const char *name) |
| UndoStep * | BKE_undosys_stack_active_with_type (UndoStack *ustack, const UndoType *ut) |
| UndoStep * | BKE_undosys_stack_init_or_active_with_type (UndoStack *ustack, const UndoType *ut) |
| void | BKE_undosys_stack_limit_steps_and_memory (UndoStack *ustack, int steps, size_t memory_limit) |
Undo Step | |
| UndoStep * | BKE_undosys_step_push_init_with_type (UndoStack *ustack, bContext *C, const char *name, const UndoType *ut) |
| UndoStep * | BKE_undosys_step_push_init (UndoStack *ustack, bContext *C, const char *name) |
| eUndoPushReturn | BKE_undosys_step_push_with_type (UndoStack *ustack, bContext *C, const char *name, const UndoType *ut) |
| eUndoPushReturn | BKE_undosys_step_push (UndoStack *ustack, bContext *C, const char *name) |
| UndoStep * | BKE_undosys_step_same_type_next (UndoStep *us) |
| UndoStep * | BKE_undosys_step_same_type_prev (UndoStep *us) |
| UndoStep * | BKE_undosys_step_find_by_name_with_type (UndoStack *ustack, const char *name, const UndoType *ut) |
| UndoStep * | BKE_undosys_step_find_by_name (UndoStack *ustack, const char *name) |
| UndoStep * | BKE_undosys_step_find_by_type (UndoStack *ustack, const UndoType *ut) |
| eUndoStepDir | BKE_undosys_step_calc_direction (const UndoStack *ustack, const UndoStep *us_target, const UndoStep *us_reference) |
| static UndoStep * | undosys_step_iter_first (UndoStep *us_reference, const eUndoStepDir undo_dir) |
| bool | BKE_undosys_step_load_data_ex (UndoStack *ustack, bContext *C, UndoStep *us_target, UndoStep *us_reference, const bool use_skip) |
| bool | BKE_undosys_step_load_data (UndoStack *ustack, bContext *C, UndoStep *us_target) |
| void | BKE_undosys_step_load_from_index (UndoStack *ustack, bContext *C, const int index) |
| bool | BKE_undosys_step_undo_with_data_ex (UndoStack *ustack, bContext *C, UndoStep *us_target, bool use_skip) |
| bool | BKE_undosys_step_undo_with_data (UndoStack *ustack, bContext *C, UndoStep *us_target) |
| bool | BKE_undosys_step_undo (UndoStack *ustack, bContext *C) |
| bool | BKE_undosys_step_redo_with_data_ex (UndoStack *ustack, bContext *C, UndoStep *us_target, bool use_skip) |
| bool | BKE_undosys_step_redo_with_data (UndoStack *ustack, bContext *C, UndoStep *us_target) |
| bool | BKE_undosys_step_redo (UndoStack *ustack, bContext *C) |
| UndoType * | BKE_undosys_type_append (void(*undosys_fn)(UndoType *)) |
| void | BKE_undosys_type_free_all () |
Undo Stack Grouping | |
This enables skip while group-level is set. In general it's not allowed that UndoStack.step_active have 'skip' enabled. This rule is relaxed for grouping, however it's important each call to BKE_undosys_stack_group_begin has a matching BKE_undosys_stack_group_end.
| |
| void | BKE_undosys_stack_group_begin (UndoStack *ustack) |
| void | BKE_undosys_stack_group_end (UndoStack *ustack) |
ID Reference Utilities | |
Unfortunately we need this for a handful of places. | |
| static void | UNUSED_FUNCTION (BKE_undosys_foreach_ID_ref(UndoStack *ustack, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data)) |
Debug Helpers | |
| void | BKE_undosys_print (UndoStack *ustack) |
Variables | |
| static CLG_LogRef | LOG = {"bke.undosys"} |
Internal Nested Undo Checks | |
Make sure we're not running undo operations from 'step_encode', 'step_decode' callbacks. bugs caused by this situation aren't that hard to spot but aren't always so obvious. Best we have a check which shows the problem immediately. | |
| #define | WITH_NESTED_UNDO_CHECK |
| #define | UNDO_NESTED_ASSERT(state) BLI_assert(g_undo_callback_running == state) |
| #define | UNDO_NESTED_CHECK_BEGIN |
| #define | UNDO_NESTED_CHECK_END |
| static bool | g_undo_callback_running = false |
Undo Types | |
| const UndoType * | BKE_UNDOSYS_TYPE_IMAGE = nullptr |
| const UndoType * | BKE_UNDOSYS_TYPE_MEMFILE = nullptr |
| const UndoType * | BKE_UNDOSYS_TYPE_PAINTCURVE = nullptr |
| const UndoType * | BKE_UNDOSYS_TYPE_PARTICLE = nullptr |
| const UndoType * | BKE_UNDOSYS_TYPE_SCULPT = nullptr |
| const UndoType * | BKE_UNDOSYS_TYPE_TEXT = nullptr |
| static ListBase | g_undo_types = {nullptr, nullptr} |
| void | bke_undo_system_linker_workaround () |
| static const UndoType * | BKE_undosys_type_from_context (bContext *C) |
Used by ED_undo.hh, internal implementation.
Definition in file undo_system.cc.
| #define UNDO_NESTED_ASSERT | ( | state | ) | BLI_assert(g_undo_callback_running == state) |
Definition at line 104 of file undo_system.cc.
Referenced by BKE_undosys_stack_clear(), BKE_undosys_stack_init_from_main(), BKE_undosys_stack_init_or_active_with_type(), BKE_undosys_stack_limit_steps_and_memory(), BKE_undosys_step_load_data_ex(), BKE_undosys_step_push(), BKE_undosys_step_push_init(), BKE_undosys_step_push_init_with_type(), BKE_undosys_step_push_with_type(), and undosys_stack_push_main().
| #define UNDO_NESTED_CHECK_BEGIN |
Definition at line 105 of file undo_system.cc.
Referenced by undosys_step_decode(), undosys_step_encode(), and undosys_step_free_and_unlink().
| #define UNDO_NESTED_CHECK_END |
Definition at line 111 of file undo_system.cc.
Referenced by undosys_step_decode(), undosys_step_encode(), and undosys_step_free_and_unlink().
| #define undo_stack _wm_undo_stack_disallow /* pass in as a variable always. */ |
Definition at line 40 of file undo_system.cc.
Referenced by ed_redo_poll(), and ed_undo_poll().
| #define WITH_GLOBAL_UNDO_CORRECT_ORDER |
Make sure we don't apply edits on top of a newer memfile state, see: #56163.
Definition at line 52 of file undo_system.cc.
| #define WITH_GLOBAL_UNDO_ENSURE_UPDATED |
Make sure all ID's created at the point we add an undo step that uses ID's.
Definition at line 46 of file undo_system.cc.
| #define WITH_GLOBAL_UNDO_KEEP_ONE |
Odd requirement of Blender that we always keep a memfile undo in the stack.
Definition at line 43 of file undo_system.cc.
| #define WITH_NESTED_UNDO_CHECK |
Definition at line 100 of file undo_system.cc.
| void bke_undo_system_linker_workaround | ( | ) |
Definition at line 73 of file undo_system.cc.
References BKE_memfile_undo_free(), and BLI_assert_unreachable.
| 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().
Definition at line 79 of file undo_system.cc.
References g_undo_types, and LISTBASE_FOREACH.
Referenced by BKE_undosys_stack_init_from_context(), BKE_undosys_step_push(), and BKE_undosys_step_push_init().
|
static |
Definition at line 149 of file undo_system.cc.
References BKE_libblock_find_name_and_library_filepath(), GS, UndoRefID::library_filepath_abs, UndoRefID::name, and UndoRefID::ptr.
Referenced by undosys_step_decode().
|
static |
Definition at line 133 of file undo_system.cc.
References BLI_assert, Library_Runtime::filepath_abs, ID::lib, UndoRefID::library_filepath_abs, ID::name, UndoRefID::name, UndoRefID::ptr, Library::runtime, and STRNCPY.
Referenced by undosys_step_encode().
|
static |
Definition at line 329 of file undo_system.cc.
References BLI_assert, ListBase::first, UndoStep::next, UndoStep::prev, UndoStack::step_active, UndoStack::steps, undosys_stack_validate(), and undosys_step_free_and_unlink().
Referenced by BKE_undosys_stack_limit_steps_and_memory().
Definition at line 315 of file undo_system.cc.
References BLI_assert, ListBase::last, UndoStack::step_active, UndoStack::steps, undosys_stack_validate(), and undosys_step_free_and_unlink().
Referenced by BKE_undosys_step_push_init_with_type().
Definition at line 350 of file undo_system.cc.
References BKE_undosys_step_push_with_type(), BKE_UNDOSYS_TYPE_MEMFILE, BLI_assert, CLOG_INFO, CTX_create(), CTX_data_main_set(), CTX_free(), LOG, ret, UndoStack::step_init, UNDO_NESTED_ASSERT, and UNDO_PUSH_RET_SUCCESS.
Referenced by BKE_undosys_stack_init_from_main(), and BKE_undosys_step_push_with_type().
|
static |
Definition at line 255 of file undo_system.cc.
References BLI_assert, BLI_findindex(), BLI_listbase_is_empty(), UndoStack::step_active, and UndoStack::steps.
Referenced by BKE_undosys_stack_clear_active(), BKE_undosys_step_load_data_ex(), BKE_undosys_step_push_init_with_type(), BKE_undosys_step_push_with_type(), undosys_stack_clear_all_first(), and undosys_stack_clear_all_last().
|
static |
Definition at line 186 of file undo_system.cc.
References BKE_UNDOSYS_TYPE_MEMFILE, CLOG_INFO, G_MAIN, LOG, UndoStep::name, UndoType::name, UndoStep::prev, UndoStack::step_active_memfile, UndoType::step_decode, UndoType::step_foreach_ID_ref, UndoStep::type, UNDO_NESTED_CHECK_BEGIN, UNDO_NESTED_CHECK_END, undosys_id_ref_resolve(), and undosys_step_decode().
Referenced by BKE_undosys_step_load_data_ex(), and undosys_step_decode().
|
static |
Definition at line 161 of file undo_system.cc.
References BKE_UNDOSYS_TYPE_MEMFILE, CLOG_INFO, LOG, UndoStep::name, UndoType::name, UndoStack::step_active_memfile, UndoType::step_encode, UndoType::step_foreach_ID_ref, UndoStep::type, UNDO_NESTED_CHECK_BEGIN, UNDO_NESTED_CHECK_END, and undosys_id_ref_store().
Referenced by BKE_undosys_step_push_with_type().
Definition at line 231 of file undo_system.cc.
References BLI_remlink(), CLOG_INFO, LOG, MEM_freeN(), UndoStep::name, UndoType::name, UndoStack::step_active_memfile, UndoType::step_free, UndoStack::steps, UndoStep::type, UNDO_NESTED_CHECK_BEGIN, and UNDO_NESTED_CHECK_END.
Referenced by BKE_undosys_stack_clear(), BKE_undosys_stack_clear_active(), BKE_undosys_step_push_init_with_type(), BKE_undosys_step_push_with_type(), undosys_stack_clear_all_first(), and undosys_stack_clear_all_last().
|
static |
When reading undo steps for undo/redo, some extra checks are needed when so the correct undo step is decoded.
Definition at line 736 of file undo_system.cc.
References UndoType::flags, UndoStep::next, UndoStep::prev, UndoStep::type, and UNDOTYPE_FLAG_DECODE_ACTIVE_STEP.
Referenced by BKE_undosys_step_load_data_ex().
|
static |
Definition at line 976 of file undo_system.cc.
References LISTBASE_FOREACH, UndoType::step_foreach_ID_ref, and UndoStack::steps.
| const UndoType* BKE_UNDOSYS_TYPE_IMAGE = nullptr |
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().
| const UndoType* BKE_UNDOSYS_TYPE_MEMFILE = nullptr |
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().
| const UndoType* BKE_UNDOSYS_TYPE_PAINTCURVE = nullptr |
Definition at line 63 of file undo_system.cc.
Referenced by ED_paintcurve_undo_push_begin(), and ED_undosys_type_init().
| const UndoType* BKE_UNDOSYS_TYPE_PARTICLE = nullptr |
Definition at line 64 of file undo_system.cc.
Referenced by ED_undosys_type_init().
| const UndoType* BKE_UNDOSYS_TYPE_SCULPT = nullptr |
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().
| const UndoType* BKE_UNDOSYS_TYPE_TEXT = nullptr |
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().
|
static |
Definition at line 103 of file undo_system.cc.
|
static |
Definition at line 68 of file undo_system.cc.
Referenced by BKE_undosys_type_append(), BKE_undosys_type_free_all(), and BKE_undosys_type_from_context().
|
static |
We only need this locally.
Definition at line 55 of file undo_system.cc.
Referenced by BKE_undosys_stack_clear(), BKE_undosys_stack_init_or_active_with_type(), BKE_undosys_stack_limit_steps_and_memory(), BKE_undosys_step_load_data_ex(), BKE_undosys_step_push_init_with_type(), BKE_undosys_step_push_with_type(), undosys_stack_push_main(), undosys_step_decode(), undosys_step_encode(), and undosys_step_free_and_unlink().