Blender V5.3
blender::UndoType Struct Reference

#include <BKE_undo_system.hh>

Public Attributes

UndoType * next
UndoType * prev
const char * identifier
bool(*) poll (bContext *C)
void(*) step_encode_init (bContext *C, UndoStep *us)
bool(*) step_encode (bContext *C, Main *bmain, UndoStep *us)
void(*) step_decode (bContext *C, Main *bmain, UndoStep *us, eUndoStepDir dir, bool is_final)
void(*) step_free (UndoStep *us)
void(*) step_foreach_ID_ref (UndoStep *us, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data)
uint flags
size_t step_size

Detailed Description

Definition at line 138 of file BKE_undo_system.hh.

Member Data Documentation

◆ flags

◆ identifier

◆ next

UndoType* blender::UndoType::next

Definition at line 139 of file BKE_undo_system.hh.

◆ poll

bool(*) blender::UndoType::poll(bContext *C)

◆ prev

UndoType * blender::UndoType::prev

Definition at line 139 of file BKE_undo_system.hh.

◆ step_decode

◆ step_encode

◆ step_encode_init

void(*) blender::UndoType::step_encode_init(bContext *C, UndoStep *us)

None of these callbacks manage list add/removal.

Note that 'step_encode_init' is optional, some undo types need to perform operations before undo push finishes.

Definition at line 160 of file BKE_undo_system.hh.

Referenced by blender::BKE_undosys_step_push_init_with_type(), blender::ED_image_undosys_type(), blender::ED_paintcurve_undosys_type(), blender::ED_text_undosys_type(), and blender::ed::sculpt_paint::undo::register_type().

◆ step_foreach_ID_ref

void(*) blender::UndoType::step_foreach_ID_ref(UndoStep *us, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data)

This callback ensures data-block (ID) references are valid before use.

Some undo systems need to reference data-blocks, however these pointers are not stable and may have changed when restoring the undo-step (when the data-block creation was undone, then redone, for example)

To support this use case, this callback supports a generic method of ensuring data-block pointers are valid before use.

See also
UndoRefID for implementation details.

Definition at line 188 of file BKE_undo_system.hh.

Referenced by blender::BKE_undosys_step_push_with_type(), blender::ED_armature_undosys_type(), blender::ED_curve_undosys_type(), blender::ED_font_undosys_type(), blender::ED_image_undosys_type(), blender::ED_lattice_undosys_type(), blender::ED_mball_undosys_type(), blender::ED_mesh_undosys_type(), blender::ED_paintcurve_undosys_type(), blender::ED_particle_undosys_type(), blender::ED_text_undosys_type(), blender::ED_undosys_type_grease_pencil(), blender::undosys_step_decode(), blender::undosys_step_encode(), blender::ed::curves::undosys_type_register(), blender::ed::pointcloud::undosys_type_register(), and blender::UNUSED_FUNCTION().

◆ step_free

◆ step_size


The documentation for this struct was generated from the following file: