Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/undo/ed_undo.c
| Show All 36 Lines | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "BKE_blender_undo.h" | #include "BKE_blender_undo.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_main.h" | |||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_undo_system.h" | #include "BKE_undo_system.h" | ||||
| #include "ED_gpencil.h" | #include "ED_gpencil.h" | ||||
| #include "ED_render.h" | #include "ED_render.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_undo.h" | #include "ED_undo.h" | ||||
| ▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | |||||
| /* name optionally, function used to check for operator redo panel */ | /* name optionally, function used to check for operator redo panel */ | ||||
| bool ED_undo_is_valid(const bContext *C, const char *undoname) | bool ED_undo_is_valid(const bContext *C, const char *undoname) | ||||
| { | { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| return BKE_undosys_stack_has_undo(wm->undo_stack, undoname); | return BKE_undosys_stack_has_undo(wm->undo_stack, undoname); | ||||
| } | } | ||||
| /** | |||||
| * Ideally we wont access the stack directly, | |||||
| * this is needed for modes which handle undo themselves (bypassing #ED_undo_push). | |||||
| * | |||||
| * Using global isn't great, this just avoids doing inline, | |||||
| * causing 'BKE_global.h' & 'BKE_main.h' includes. | |||||
| */ | |||||
| UndoStack *ED_undo_stack_get(void) | |||||
| { | |||||
| wmWindowManager *wm = G.main->wm.first; | |||||
| return wm->undo_stack; | |||||
| } | |||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Undo, Undo Push & Redo Operators | /** \name Undo, Undo Push & Redo Operators | ||||
| * \{ */ | * \{ */ | ||||
| static int ed_undo_exec(bContext *C, wmOperator *UNUSED(op)) | static int ed_undo_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 279 Lines • Show Last 20 Lines | |||||