|
Blender V4.3
|
#include <cerrno>#include <cstring>#include "MEM_guardedalloc.h"#include "DNA_text_types.h"#include "BLI_array_store.h"#include "BLI_array_utils.h"#include "BKE_context.hh"#include "BKE_main.hh"#include "BKE_text.h"#include "BKE_undo_system.hh"#include "WM_api.hh"#include "WM_types.hh"#include "ED_screen.hh"#include "ED_text.hh"#include "ED_undo.hh"#include "text_intern.hh"Go to the source code of this file.
Classes | |
| struct | TextState |
| struct | TextUndoStep |
Functions | |
Utilities | |
| UndoStep * | ED_text_undo_push_init (bContext *C) |
Implements ED Undo System | ||
| #define | ARRAY_CHUNK_SIZE 128 | |
| struct { | ||
| BArrayStore * buffer_store | ||
| int users | ||
| } | g_text_buffers = {nullptr} | |
| static void | text_state_encode (TextState *state, Text *text, BArrayStore *buffer_store) | |
| static void | text_state_decode (TextState *state, Text *text) | |
| static size_t | text_undosys_step_encode_to_state (TextState *state, Text *text) | |
| static bool | text_undosys_poll (bContext *) | |
| static void | text_undosys_step_encode_init (bContext *C, UndoStep *us_p) | |
| static bool | text_undosys_step_encode (bContext *C, Main *, UndoStep *us_p) | |
| static void | text_undosys_step_decode (bContext *C, Main *, UndoStep *us_p, const eUndoStepDir dir, bool is_final) | |
| static void | text_undosys_step_free (UndoStep *us_p) | |
| static void | text_undosys_foreach_ID_ref (UndoStep *us_p, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data) | |
| void | ED_text_undosys_type (UndoType *ut) | |
| #define ARRAY_CHUNK_SIZE 128 |
Definition at line 37 of file text_undo.cc.
Referenced by text_undosys_step_encode_to_state().
Use operator system to finish the undo step.
Definition at line 249 of file text_undo.cc.
References BKE_undosys_step_push_init_with_type(), BKE_UNDOSYS_TYPE_TEXT, CTX_data_main(), ED_undo_stack_get(), ListBase::first, wmWindowManager::op_undo_depth, and Main::wm.
Referenced by move_lines_exec(), text_autocomplete_invoke(), text_autocomplete_modal(), text_comment_exec(), text_cut_exec(), text_delete_exec(), text_duplicate_line_exec(), text_find_and_replace(), text_indent_exec(), text_insert_exec(), text_line_break_exec(), text_paste_exec(), text_replace_all(), and text_unindent_exec().
| void ED_text_undosys_type | ( | UndoType * | ut | ) |
Export for ED_undo_sys.
Definition at line 227 of file text_undo.cc.
References UndoType::flags, UndoType::name, UndoType::poll, UndoType::step_decode, UndoType::step_encode, UndoType::step_encode_init, UndoType::step_foreach_ID_ref, UndoType::step_free, UndoType::step_size, text_undosys_foreach_ID_ref(), text_undosys_poll(), text_undosys_step_decode(), text_undosys_step_encode(), text_undosys_step_encode_init(), text_undosys_step_free(), UNDOTYPE_FLAG_DECODE_ACTIVE_STEP, and UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE.
Referenced by ED_undosys_type_init().
Definition at line 72 of file text_undo.cc.
References BLI_array_store_state_data_get_alloc(), MEM_freeN(), state, txt_from_buf_for_undo(), and txt_move_to().
Referenced by text_undosys_step_decode().
|
static |
Definition at line 49 of file text_undo.cc.
References BLI_array_store_state_add(), buffer_store, MEM_freeN(), state, txt_get_span(), txt_has_sel(), and txt_to_buf_for_undo().
Referenced by text_undosys_step_encode_to_state().
|
static |
Definition at line 219 of file text_undo.cc.
References TextUndoStep::text_ref.
Referenced by ED_text_undosys_type().
|
static |
Definition at line 126 of file text_undo.cc.
References BKE_UNDOSYS_TYPE_TEXT, ED_undo_stack_get(), UndoStack::step_init, and UndoStep::type.
Referenced by ED_text_undosys_type().
|
static |
Definition at line 174 of file text_undo.cc.
References BLI_assert, TextState::buf_array_state, CTX_wm_space_text(), NA_EDITED, NC_TEXT, space_text_drawcache_tag_update(), space_text_update_cursor_moved(), state, TextUndoStep::states, STEP_INVALID, STEP_UNDO, SpaceText::text, TextUndoStep::text_ref, text_state_decode(), and WM_event_add_notifier().
Referenced by ED_text_undosys_type().
Definition at line 159 of file text_undo.cc.
References BLI_assert, CTX_data_edit_text(), UndoStep::data_size, UndoStep::is_applied, TextUndoStep::states, TextUndoStep::step, TextUndoStep::text_ref, text_undosys_step_encode_to_state(), and UNUSED_VARS_NDEBUG.
Referenced by ED_text_undosys_type().
Definition at line 133 of file text_undo.cc.
References ARRAY_SIZE, BKE_UNDOSYS_TYPE_TEXT, BLI_array_is_zeroed, BLI_assert, CTX_data_edit_text(), UndoStep::data_size, ED_undo_stack_get(), TextUndoStep::states, TextUndoStep::step, UndoStack::step_active, STREQ, TextUndoStep::text_ref, text_undosys_step_encode_to_state(), and UndoStep::type.
Referenced by ED_text_undosys_type().
Definition at line 111 of file text_undo.cc.
References ARRAY_CHUNK_SIZE, BLI_array_is_zeroed, BLI_array_store_calc_size_compacted_get(), BLI_array_store_create(), BLI_assert, g_text_buffers, state, and text_state_encode().
Referenced by text_undosys_step_encode(), and text_undosys_step_encode_init().
|
static |
Definition at line 202 of file text_undo.cc.
References ARRAY_SIZE, BLI_array_store_destroy(), BLI_array_store_state_remove(), g_text_buffers, state, and TextUndoStep::states.
Referenced by ED_text_undosys_type().
| BArrayStore* buffer_store |
Definition at line 107 of file text_undo.cc.
Referenced by text_state_encode().
| struct { ... } g_text_buffers |
Referenced by text_undosys_step_encode_to_state(), and text_undosys_step_free().
| int users |
Definition at line 108 of file text_undo.cc.