Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/undo/ed_undo.c
| Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | static void ed_undo_step_post(bContext *C, | ||||
| WM_toolsystem_refresh_active(C); | WM_toolsystem_refresh_active(C); | ||||
| WM_toolsystem_refresh_screen_all(bmain); | WM_toolsystem_refresh_screen_all(bmain); | ||||
| if (CLOG_CHECK(&LOG, 1)) { | if (CLOG_CHECK(&LOG, 1)) { | ||||
| BKE_undosys_print(wm->undo_stack); | BKE_undosys_print(wm->undo_stack); | ||||
| } | } | ||||
| } | } | ||||
| /** Undo or redo one step from current active one. | /** | ||||
| * Undo or redo one step from current active one. | |||||
| * May undo or redo several steps at once only if the target step is a 'skipped' one. | * May undo or redo several steps at once only if the target step is a 'skipped' one. | ||||
| * The target step will be the one immediately before or after the active one. */ | * The target step will be the one immediately before or after the active one. | ||||
| */ | |||||
| static int ed_undo_step_direction(bContext *C, enum eUndoStepDir step, ReportList *reports) | static int ed_undo_step_direction(bContext *C, enum eUndoStepDir step, ReportList *reports) | ||||
| { | { | ||||
| BLI_assert(ELEM(step, STEP_UNDO, STEP_REDO)); | BLI_assert(ELEM(step, STEP_UNDO, STEP_REDO)); | ||||
| CLOG_INFO(&LOG, 1, "direction=%s", (step == STEP_UNDO) ? "STEP_UNDO" : "STEP_REDO"); | CLOG_INFO(&LOG, 1, "direction=%s", (step == STEP_UNDO) ? "STEP_UNDO" : "STEP_REDO"); | ||||
| /* TODO(campbell): undo_system: use undo system */ | /* TODO(campbell): undo_system: use undo system */ | ||||
| /* grease pencil can be can be used in plenty of spaces, so check it first */ | /* grease pencil can be can be used in plenty of spaces, so check it first */ | ||||
| Show All 16 Lines | else { | ||||
| BKE_undosys_step_redo(wm->undo_stack, C); | BKE_undosys_step_redo(wm->undo_stack, C); | ||||
| } | } | ||||
| ed_undo_step_post(C, wm, step, reports); | ed_undo_step_post(C, wm, step, reports); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| /** Undo the step matching given name. | /** | ||||
| * Undo the step matching given name. | |||||
| * May undo several steps at once. | * May undo several steps at once. | ||||
| * The target step will be the one immediately before given named one. */ | * The target step will be the one immediately before given named one. | ||||
| */ | |||||
| static int ed_undo_step_by_name(bContext *C, const char *undo_name, ReportList *reports) | static int ed_undo_step_by_name(bContext *C, const char *undo_name, ReportList *reports) | ||||
| { | { | ||||
| BLI_assert(undo_name != NULL); | BLI_assert(undo_name != NULL); | ||||
| /* FIXME: See comments in `ed_undo_step_direction`. */ | /* FIXME: See comments in `ed_undo_step_direction`. */ | ||||
| if (ED_gpencil_session_active()) { | if (ED_gpencil_session_active()) { | ||||
| BLI_assert(!"Not implemented currently."); | BLI_assert(!"Not implemented currently."); | ||||
| } | } | ||||
| Show All 27 Lines | static int ed_undo_step_by_name(bContext *C, const char *undo_name, ReportList *reports) | ||||
| BKE_undosys_step_load_data_ex(wm->undo_stack, C, undo_step_target, NULL, true); | BKE_undosys_step_load_data_ex(wm->undo_stack, C, undo_step_target, NULL, true); | ||||
| ed_undo_step_post(C, wm, undo_dir, reports); | ed_undo_step_post(C, wm, undo_dir, reports); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| /** Load the step matching given index in the stack. | /** | ||||
| * Load the step matching given index in the stack. | |||||
| * May undo or redo several steps at once. | * May undo or redo several steps at once. | ||||
| * The target step will be the one indicated by the given index. */ | * The target step will be the one indicated by the given index. | ||||
| */ | |||||
| static int ed_undo_step_by_index(bContext *C, const int undo_index, ReportList *reports) | static int ed_undo_step_by_index(bContext *C, const int undo_index, ReportList *reports) | ||||
| { | { | ||||
| BLI_assert(undo_index >= 0); | BLI_assert(undo_index >= 0); | ||||
| /* FIXME: See comments in `ed_undo_step_direction`. */ | /* FIXME: See comments in `ed_undo_step_direction`. */ | ||||
| if (ED_gpencil_session_active()) { | if (ED_gpencil_session_active()) { | ||||
| BLI_assert(!"Not implemented currently."); | BLI_assert(!"Not implemented currently."); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 654 Lines • Show Last 20 Lines | |||||