Blender V5.3
ED_undo.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_sys_types.hh"
12#include "BLI_vector.hh"
13
14#include <optional>
15
16struct CLG_LogRef;
17namespace blender {
18
19struct Base;
20struct ID;
21struct Main;
22struct MemFile;
23struct PointerRNA;
24struct PropertyRNA;
25struct Object;
26struct Scene;
27struct UndoStack;
28struct ViewLayer;
29struct bContext;
30struct wmOperator;
31struct wmOperatorType;
32struct wmWindowManager;
33enum class UndoEncodeHints : int;
34
35/* ed_undo.cc */
36
43void ED_undo_push(bContext *C, const char *str, UndoEncodeHints hints = UndoEncodeHints(0));
46 const char *str,
57
67void ED_undo_operator_repeat_cb(bContext *C, void *arg_op, void *arg_unused);
68void ED_undo_operator_repeat_cb_evt(bContext *C, void *arg_op, int arg_unused);
69
73bool ED_undo_is_valid(const bContext *C, const char *undoname);
78
80
81/* Unfortunate workaround for limits mixing undo systems. */
82
94std::optional<UndoEncodeHints> ED_undo_is_legacy_compatible_for_property(bContext *C,
95 ID *id,
96 const PointerRNA &ptr,
97 const PropertyRNA &prop);
98
114 const Scene *scene_ref,
115 Scene **scene_p,
116 ViewLayer **view_layer_p);
117
122 ViewLayer *view_layer,
123 Object **object_array,
124 uint object_array_len,
125 uint object_array_stride);
126
128 const Scene *scene,
129 ViewLayer *view_layer);
131 const Scene *scene,
132 ViewLayer *view_layer);
133
142
143/* Helpers. */
144
146 Scene *scene,
147 ViewLayer *view_layer,
148 Object *ob,
149 const char *info,
150 CLG_LogRef *log);
151
152/* `undo_system_types.cc` */
153
156
157/* `memfile_undo.cc` */
158
160
187
188} // namespace blender
#define C
Definition RandGen.cpp:29
#define str(s)
#define log
BMesh Iterators.
void ED_OT_undo_push(wmOperatorType *ot)
Definition ed_undo.cc:818
bool ED_undo_has_redo_step(const bContext *C)
Definition ed_undo.cc:581
bool ED_undo_operator_repeat(bContext *C, wmOperator *op)
Definition ed_undo.cc:879
void ED_undo_grouped_push(bContext *C, const char *str, UndoEncodeHints hints=UndoEncodeHints(0))
Definition ed_undo.cc:357
bool ED_undo_is_memfile_compatible(const bContext *C)
Definition ed_undo.cc:588
unsigned int uint
Definition BKE_text.h:55
void ED_OT_undo_redo(wmOperatorType *ot)
Definition ed_undo.cc:861
UndoStack * ED_undo_stack_get()
Definition ed_undo.cc:690
bool ED_undo_is_state_valid(bContext *C)
Definition ed_undo.cc:68
void ED_undo_object_set_active_or_warn(const Main &bmain, Scene *scene, ViewLayer *view_layer, Object *ob, const char *info, CLG_LogRef *log)
Definition ed_undo.cc:1024
void ED_undosys_type_free()
void ED_OT_undo(wmOperatorType *ot)
Definition ed_undo.cc:806
void ED_OT_redo(wmOperatorType *ot)
Definition ed_undo.cc:849
Vector< Object * > ED_undo_editmode_objects_from_view_layer(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
Definition ed_undo.cc:1109
void ED_undo_push_op(bContext *C, wmOperator *op)
Definition ed_undo.cc:553
std::optional< UndoEncodeHints > ED_undo_is_legacy_compatible_for_property(bContext *C, ID *id, const PointerRNA &ptr, const PropertyRNA &prop)
Definition ed_undo.cc:607
void ED_undo_operator_repeat_cb(bContext *C, void *arg_op, void *arg_unused)
Definition ed_undo.cc:956
void ED_undo_operator_repeat_cb_evt(bContext *C, void *arg_op, int arg_unused)
Definition ed_undo.cc:961
void ED_undo_grouped_push_op(bContext *C, wmOperator *op)
Definition ed_undo.cc:561
void ED_undo_redo(bContext *C)
Definition ed_undo.cc:380
void ED_undo_pop_op(bContext *C, wmOperator *op)
Definition ed_undo.cc:568
void ED_undo_pop(bContext *C)
Definition ed_undo.cc:376
void ED_undo_push(bContext *C, const char *str, UndoEncodeHints hints=UndoEncodeHints(0))
Definition ed_undo.cc:103
Vector< Base * > ED_undo_editmode_bases_from_view_layer(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
Definition ed_undo.cc:1139
void ED_OT_undo_history(wmOperatorType *ot)
Definition ed_undo.cc:1002
size_t ED_undosys_total_memory_calc(UndoStack *ustack)
Definition ed_undo.cc:1171
void ED_undo_group_begin(bContext *C)
Definition ed_undo.cc:91
void ED_undosys_type_init()
void ED_undo_object_editmode_restore_helper(Scene *scene, ViewLayer *view_layer, Object **object_array, uint object_array_len, uint object_array_stride)
Definition ed_undo.cc:1064
bool ED_undosys_autosave_compatible(UndoStack *ustack)
void ED_undo_group_end(bContext *C)
Definition ed_undo.cc:97
bool ED_undo_is_valid(const bContext *C, const char *undoname)
Definition ed_undo.cc:574
void ED_undosys_stack_memfile_id_changed_tag(UndoStack *ustack, ID *id)
void ED_undo_object_editmode_validate_scene_from_windows(wmWindowManager *wm, const Scene *scene_ref, Scene **scene_p, ViewLayer **view_layer_p)
Definition ed_undo.cc:1047