Blender V4.3
interface_undo.cc File Reference
#include <cstring>
#include "BLI_listbase.h"
#include "DNA_listBase.h"
#include "MEM_guardedalloc.h"
#include "interface_intern.hh"

Go to the source code of this file.

Classes

struct  uiUndoStack_Text_State
 
struct  uiUndoStack_Text
 

Functions

Text Field Undo Stack
static const char * ui_textedit_undo_impl (uiUndoStack_Text *stack, int *r_cursor_index)
 
static const char * ui_textedit_redo_impl (uiUndoStack_Text *stack, int *r_cursor_index)
 
const char * ui_textedit_undo (uiUndoStack_Text *stack, int direction, int *r_cursor_index)
 
void ui_textedit_undo_push (uiUndoStack_Text *stack, const char *text, int cursor_index)
 
uiUndoStack_Textui_textedit_undo_stack_create ()
 
void ui_textedit_undo_stack_destroy (uiUndoStack_Text *stack)
 

Detailed Description

Undo stack to use for UI widgets that manage their own editing state.

Definition in file interface_undo.cc.

Function Documentation

◆ ui_textedit_redo_impl()

static const char * ui_textedit_redo_impl ( uiUndoStack_Text * stack,
int * r_cursor_index )
static

◆ ui_textedit_undo()

const char * ui_textedit_undo ( uiUndoStack_Text * stack,
int direction,
int * r_cursor_index )

Definition at line 70 of file interface_undo.cc.

References BLI_assert, ELEM, ui_textedit_redo_impl(), and ui_textedit_undo_impl().

Referenced by ui_do_but_textedit().

◆ ui_textedit_undo_impl()

static const char * ui_textedit_undo_impl ( uiUndoStack_Text * stack,
int * r_cursor_index )
static

◆ ui_textedit_undo_push()

void ui_textedit_undo_push ( uiUndoStack_Text * stack,
const char * text,
int cursor_index )

Push the information in the arguments to a new state in the undo stack.

Note
Currently the total length of the undo stack is not limited.

Definition at line 79 of file interface_undo.cc.

References BLI_addtail(), BLI_remlink(), uiUndoStack_Text::current, uiUndoStack_Text_State::cursor_index, MEM_freeN(), MEM_mallocN, uiUndoStack_Text_State::next, state, uiUndoStack_Text::states, and uiUndoStack_Text_State::text.

Referenced by ui_do_but_textedit(), and ui_textedit_begin().

◆ ui_textedit_undo_stack_create()

uiUndoStack_Text * ui_textedit_undo_stack_create ( )

Start the undo stack.

Note
The current state should be pushed immediately after calling this.

Definition at line 99 of file interface_undo.cc.

References BLI_listbase_clear(), uiUndoStack_Text::current, and uiUndoStack_Text::states.

Referenced by ui_textedit_begin().

◆ ui_textedit_undo_stack_destroy()

void ui_textedit_undo_stack_destroy ( uiUndoStack_Text * stack)

Definition at line 108 of file interface_undo.cc.

References BLI_freelistN(), MEM_freeN(), and uiUndoStack_Text::states.

Referenced by ui_textedit_end().