Blender  V2.93
ED_undo.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include "BLI_compiler_attrs.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 struct Base;
30 struct CLG_LogRef;
31 struct Object;
32 struct UndoStack;
33 struct ViewLayer;
34 struct bContext;
35 struct wmOperator;
36 struct wmOperatorType;
37 
38 /* undo.c */
39 bool ED_undo_is_state_valid(struct bContext *C);
40 void ED_undo_group_begin(struct bContext *C);
41 void ED_undo_group_end(struct bContext *C);
42 void ED_undo_push(struct bContext *C, const char *str);
43 void ED_undo_push_op(struct bContext *C, struct wmOperator *op);
44 void ED_undo_grouped_push(struct bContext *C, const char *str);
45 void ED_undo_grouped_push_op(struct bContext *C, struct wmOperator *op);
46 void ED_undo_pop_op(struct bContext *C, struct wmOperator *op);
47 void ED_undo_pop(struct bContext *C);
48 void ED_undo_redo(struct bContext *C);
49 void ED_OT_undo(struct wmOperatorType *ot);
50 void ED_OT_undo_push(struct wmOperatorType *ot);
51 void ED_OT_redo(struct wmOperatorType *ot);
52 void ED_OT_undo_redo(struct wmOperatorType *ot);
54 
55 int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op);
56 /* convenience since UI callbacks use this mostly*/
57 void ED_undo_operator_repeat_cb(struct bContext *C, void *arg_op, void *arg_unused);
58 void ED_undo_operator_repeat_cb_evt(struct bContext *C, void *arg_op, int arg_unused);
59 
60 bool ED_undo_is_valid(const struct bContext *C, const char *undoname);
61 
63 
64 /* Unfortunate workaround for limits mixing undo systems. */
65 bool ED_undo_is_legacy_compatible_for_property(struct bContext *C, struct ID *id);
66 
68  struct Object **object_array,
69  uint object_array_len,
70  uint object_array_stride);
71 
73  uint *r_len);
74 struct Base **ED_undo_editmode_bases_from_view_layer(struct ViewLayer *view_layer, uint *r_len);
75 
76 struct UndoStack *ED_undo_stack_get(void);
77 
78 /* helpers */
80  struct ViewLayer *view_layer,
81  struct Object *ob,
82  const char *info,
83  struct CLG_LogRef *log);
84 
85 /* undo_system_types.c */
86 void ED_undosys_type_init(void);
87 void ED_undosys_type_free(void);
88 
89 /* memfile_undo.c */
91 void ED_undosys_stack_memfile_id_changed_tag(struct UndoStack *ustack, struct ID *id);
92 
93 #ifdef __cplusplus
94 }
95 #endif
unsigned int uint
Definition: BLI_sys_types.h:83
bool ED_undo_is_state_valid(struct bContext *C)
Definition: ed_undo.c:82
struct MemFile * ED_undosys_stack_memfile_get_active(struct UndoStack *ustack)
Definition: memfile_undo.c:304
void ED_undosys_type_free(void)
void ED_OT_undo_history(struct wmOperatorType *ot)
Definition: ed_undo.c:856
void ED_undo_grouped_push_op(struct bContext *C, struct wmOperator *op)
Definition: ed_undo.c:422
void ED_undo_redo(struct bContext *C)
Definition: ed_undo.c:411
bool ED_undo_is_memfile_compatible(const struct bContext *C)
void ED_OT_undo(struct wmOperatorType *ot)
Definition: ed_undo.c:604
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:897
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:877
void ED_undo_pop(struct bContext *C)
Definition: ed_undo.c:407
bool ED_undo_is_legacy_compatible_for_property(struct bContext *C, struct ID *id)
Definition: ed_undo.c:469
struct Object ** ED_undo_editmode_objects_from_view_layer(struct ViewLayer *view_layer, uint *r_len)
Definition: ed_undo.c:968
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:659
void ED_OT_redo(struct wmOperatorType *ot)
Definition: ed_undo.c:647
void ED_undo_grouped_push(struct bContext *C, const char *str)
Definition: ed_undo.c:394
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:678
void ED_undo_group_begin(struct bContext *C)
Definition: ed_undo.c:105
struct Base ** ED_undo_editmode_bases_from_view_layer(struct ViewLayer *view_layer, uint *r_len)
Definition: ed_undo.c:997
void ED_undo_push(struct bContext *C, const char *str)
Definition: ed_undo.c:117
void ED_OT_undo_push(struct wmOperatorType *ot)
Definition: ed_undo.c:616
void ED_undo_push_op(struct bContext *C, struct wmOperator *op)
Definition: ed_undo.c:416
struct UndoStack * ED_undo_stack_get(void)
Definition: ed_undo.c:501
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:328
void ED_undo_group_end(struct bContext *C)
Definition: ed_undo.c:111
void ED_undo_pop_op(struct bContext *C, struct wmOperator *op)
Definition: ed_undo.c:432
#define C
Definition: RandGen.cpp:39
Scene scene
#define str(s)
INLINE Rall1d< T, V, S > log(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:303
Definition: DNA_ID.h:273
wmOperatorType * ot
Definition: wm_files.c:3156