Blender  V3.3
ED_undo.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #pragma once
8 
9 #include "BLI_compiler_attrs.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 struct Base;
16 struct CLG_LogRef;
17 struct Object;
18 struct UndoStack;
19 struct ViewLayer;
20 struct bContext;
21 struct wmOperator;
22 struct wmOperatorType;
23 
24 /* undo.c */
25 
29 bool ED_undo_is_state_valid(struct bContext *C);
30 void ED_undo_group_begin(struct bContext *C);
31 void ED_undo_group_end(struct bContext *C);
32 void ED_undo_push(struct bContext *C, const char *str);
33 void ED_undo_push_op(struct bContext *C, struct wmOperator *op);
34 void ED_undo_grouped_push(struct bContext *C, const char *str);
35 void ED_undo_grouped_push_op(struct bContext *C, struct wmOperator *op);
36 void ED_undo_pop_op(struct bContext *C, struct wmOperator *op);
37 void ED_undo_pop(struct bContext *C);
38 void ED_undo_redo(struct bContext *C);
39 void ED_OT_undo(struct wmOperatorType *ot);
40 void ED_OT_undo_push(struct wmOperatorType *ot);
41 void ED_OT_redo(struct wmOperatorType *ot);
42 void ED_OT_undo_redo(struct wmOperatorType *ot);
44 
48 int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op);
52 void ED_undo_operator_repeat_cb(struct bContext *C, void *arg_op, void *arg_unused);
53 void ED_undo_operator_repeat_cb_evt(struct bContext *C, void *arg_op, int arg_unused);
54 
58 bool ED_undo_is_valid(const struct bContext *C, const char *undoname);
59 
61 
62 /* Unfortunate workaround for limits mixing undo systems. */
63 
72 bool ED_undo_is_legacy_compatible_for_property(struct bContext *C, struct ID *id);
73 
78  struct Object **object_array,
79  uint object_array_len,
80  uint object_array_stride);
81 
83  uint *r_len);
84 struct Base **ED_undo_editmode_bases_from_view_layer(struct ViewLayer *view_layer, uint *r_len);
85 
93 struct UndoStack *ED_undo_stack_get(void);
94 
95 /* Helpers. */
96 
98  struct ViewLayer *view_layer,
99  struct Object *ob,
100  const char *info,
101  struct CLG_LogRef *log);
102 
103 /* undo_system_types.c */
104 
105 void ED_undosys_type_init(void);
106 void ED_undosys_type_free(void);
107 
108 /* memfile_undo.c */
109 
126 void ED_undosys_stack_memfile_id_changed_tag(struct UndoStack *ustack, struct ID *id);
127 
128 #ifdef __cplusplus
129 }
130 #endif
unsigned int uint
Definition: BLI_sys_types.h:67
bool ED_undo_is_state_valid(struct bContext *C)
Definition: ed_undo.c:65
struct MemFile * ED_undosys_stack_memfile_get_active(struct UndoStack *ustack)
Definition: memfile_undo.c:343
void ED_undosys_type_free(void)
void ED_OT_undo_history(struct wmOperatorType *ot)
Definition: ed_undo.c:779
void ED_undo_grouped_push_op(struct bContext *C, struct wmOperator *op)
Definition: ed_undo.c:410
void ED_undo_redo(struct bContext *C)
Definition: ed_undo.c:399
bool ED_undo_is_memfile_compatible(const struct bContext *C)
void ED_OT_undo(struct wmOperatorType *ot)
Definition: ed_undo.c:589
void ED_undo_object_editmode_restore_helper(struct bContext *C, struct Object **object_array, uint object_array_len, uint object_array_stride)
Definition: ed_undo.c:817
void ED_undo_object_set_active_or_warn(struct Scene *scene, struct ViewLayer *view_layer, struct Object *ob, const char *info, struct CLG_LogRef *log)
Definition: ed_undo.c:800
void ED_undo_pop(struct bContext *C)
Definition: ed_undo.c:395
bool ED_undo_is_legacy_compatible_for_property(struct bContext *C, struct ID *id)
Definition: ed_undo.c:448
struct Object ** ED_undo_editmode_objects_from_view_layer(struct ViewLayer *view_layer, uint *r_len)
Definition: ed_undo.c:888
void ED_undosys_type_init(void)
void ED_undo_operator_repeat_cb(struct bContext *C, void *arg_op, void *arg_unused)
void ED_OT_undo_redo(struct wmOperatorType *ot)
Definition: ed_undo.c:644
void ED_OT_redo(struct wmOperatorType *ot)
Definition: ed_undo.c:632
void ED_undo_grouped_push(struct bContext *C, const char *str)
Definition: ed_undo.c:382
void ED_undo_operator_repeat_cb_evt(struct bContext *C, void *arg_op, int arg_unused)
int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op)
Definition: ed_undo.c:662
void ED_undo_group_begin(struct bContext *C)
Definition: ed_undo.c:88
struct Base ** ED_undo_editmode_bases_from_view_layer(struct ViewLayer *view_layer, uint *r_len)
Definition: ed_undo.c:917
void ED_undo_push(struct bContext *C, const char *str)
Definition: ed_undo.c:100
void ED_OT_undo_push(struct wmOperatorType *ot)
Definition: ed_undo.c:601
void ED_undo_push_op(struct bContext *C, struct wmOperator *op)
Definition: ed_undo.c:404
struct UndoStack * ED_undo_stack_get(void)
Definition: ed_undo.c:473
bool ED_undo_is_valid(const struct bContext *C, const char *undoname)
void ED_undosys_stack_memfile_id_changed_tag(struct UndoStack *ustack, struct ID *id)
Definition: memfile_undo.c:352
void ED_undo_group_end(struct bContext *C)
Definition: ed_undo.c:94
void ED_undo_pop_op(struct bContext *C, struct wmOperator *op)
Definition: ed_undo.c:420
#define C
Definition: RandGen.cpp:25
Scene scene
#define str(s)
ccl_device_inline float3 log(float3 v)
Definition: math_float3.h:397
Definition: DNA_ID.h:368
wmOperatorType * ot
Definition: wm_files.c:3479