48 #define ARRAY_CHUNK_SIZE 128
77 state->cursor_line_select =
state->cursor_line;
78 state->cursor_column_select =
state->cursor_column;
91 const bool has_select = ((
state->cursor_line !=
state->cursor_line_select) ||
92 (
state->cursor_column !=
state->cursor_column_select));
151 bool write_init =
true;
222 if (
state->buf_array_state) {
struct SpaceText * CTX_wm_space_text(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct Text * CTX_data_edit_text(const bContext *C)
void txt_from_buf_for_undo(struct Text *text, const char *buf, size_t buf_len) ATTR_NONNULL(1
bool txt_has_sel(const struct Text *text)
int txt_get_span(struct TextLine *from, struct TextLine *to)
void txt_move_to(struct Text *text, unsigned int line, unsigned int ch, bool sel)
char * txt_to_buf_for_undo(struct Text *text, size_t *r_buf_len) ATTR_NONNULL(1
@ UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE
@ UNDOTYPE_FLAG_DECODE_ACTIVE_STEP
UndoStep * BKE_undosys_step_push_init_with_type(UndoStack *ustack, struct bContext *C, const char *name, const UndoType *ut)
const UndoType * BKE_UNDOSYS_TYPE_TEXT
void(* UndoTypeForEachIDRefFn)(void *user_data, struct UndoRefID *id_ref)
Efficient in-memory storage of multiple similar arrays.
void * BLI_array_store_state_data_get_alloc(BArrayState *state, size_t *r_data_len)
void BLI_array_store_state_remove(BArrayStore *bs, BArrayState *state)
BArrayStore * BLI_array_store_create(unsigned int stride, unsigned int chunk_count)
BArrayState * BLI_array_store_state_add(BArrayStore *bs, const void *data, size_t data_len, const BArrayState *state_reference)
void BLI_array_store_destroy(BArrayStore *bs)
size_t BLI_array_store_calc_size_compacted_get(const BArrayStore *bs)
Generic array manipulation API.
#define BLI_array_is_zeroed(arr, arr_len)
#define UNUSED_VARS_NDEBUG(...)
struct UndoStack * ED_undo_stack_get(void)
Read Guarded memory(de)allocation.
Platform independent time functions.
void(* MEM_freeN)(void *vmemh)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
BArrayState * buf_array_state
struct UndoStep * step_active
struct UndoStep * step_init
const struct UndoType * type
void(* step_decode)(struct bContext *C, struct Main *bmain, UndoStep *us, eUndoStepDir dir, bool is_final)
bool(* step_encode)(struct bContext *C, struct Main *bmain, UndoStep *us)
void(* step_encode_init)(struct bContext *C, UndoStep *us)
void(* step_foreach_ID_ref)(UndoStep *us, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data)
void(* step_free)(UndoStep *us)
bool(* poll)(struct bContext *C)
void text_update_cursor_moved(struct bContext *C)
void text_drawcache_tag_update(struct SpaceText *st, int full)
static void text_undosys_foreach_ID_ref(UndoStep *us_p, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data)
static void text_state_encode(TextState *state, Text *text, BArrayStore *buffer_store)
static bool text_undosys_step_encode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p)
void ED_text_undosys_type(UndoType *ut)
static struct @558 g_text_buffers
static bool text_undosys_poll(bContext *UNUSED(C))
static size_t text_undosys_step_encode_to_state(TextState *state, Text *text)
static void text_undosys_step_encode_init(struct bContext *C, UndoStep *us_p)
static void text_undosys_step_free(UndoStep *us_p)
struct TextUndoStep TextUndoStep
static void text_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, const eUndoStepDir dir, bool is_final)
UndoStep * ED_text_undo_push_init(bContext *C)
BArrayStore * buffer_store
static void text_state_decode(TextState *state, Text *text)
struct TextState TextState
void WM_event_add_notifier(const bContext *C, uint type, void *reference)