Blender V5.0
text_ops.cc File Reference
#include <algorithm>
#include <cerrno>
#include <cstring>
#include <sstream>
#include "MEM_guardedalloc.h"
#include "DNA_camera_types.h"
#include "DNA_text_types.h"
#include "BLI_fileops.h"
#include "BLI_listbase.h"
#include "BLI_math_base.h"
#include "BLI_math_vector.h"
#include "BLI_path_utils.hh"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_string_cursor_utf8.h"
#include "BLI_string_utf8.h"
#include "BLI_time.h"
#include "BLI_vector_set.hh"
#include "BLT_translation.hh"
#include "BKE_context.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_node.hh"
#include "BKE_node_legacy_types.hh"
#include "BKE_node_runtime.hh"
#include "BKE_report.hh"
#include "BKE_text.h"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_curve.hh"
#include "ED_screen.hh"
#include "ED_text.hh"
#include "UI_interface.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "RE_engine.h"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "text_format.hh"
#include "text_intern.hh"

Go to the source code of this file.

Classes

struct  TextScroll
struct  SetSelection

Functions

Utilities
static void test_line_start (char c, bool *r_last_state)
static char text_closing_character_pair_get (const char character)
static bool text_span_is_blank (TextLine *line1, const int line1_char, TextLine *line2, const int line2_char)
static char * buf_tabs_to_spaces (const char *in_buf, const int tab_size, int *r_out_buf_len)
BLI_INLINE int space_text_pixel_x_to_column (const SpaceText *st, const int x)
static void text_select_update_primary_clipboard (const Text *text)
Operator Poll
static bool text_new_poll (bContext *)
static bool text_data_poll (bContext *C)
static bool text_edit_poll (bContext *C)
bool text_space_edit_poll (bContext *C)
static bool text_region_edit_poll (bContext *C)
Updates
void text_update_line_edited (TextLine *line)
void text_update_edited (Text *text)
New Operator
static wmOperatorStatus text_new_exec (bContext *C, wmOperator *)
void TEXT_OT_new (wmOperatorType *ot)
Open Operator
static void text_open_init (bContext *C, wmOperator *op)
static void text_open_cancel (bContext *, wmOperator *op)
static wmOperatorStatus text_open_exec (bContext *C, wmOperator *op)
static wmOperatorStatus text_open_invoke (bContext *C, wmOperator *op, const wmEvent *)
void TEXT_OT_open (wmOperatorType *ot)
Reload Operator
static wmOperatorStatus text_reload_exec (bContext *C, wmOperator *op)
static wmOperatorStatus text_reload_invoke (bContext *C, wmOperator *op, const wmEvent *)
void TEXT_OT_reload (wmOperatorType *ot)
Make Internal Operator
static wmOperatorStatus text_make_internal_exec (bContext *C, wmOperator *)
void TEXT_OT_make_internal (wmOperatorType *ot)
Save Operator
static void txt_write_file (Main *bmain, Text *text, ReportList *reports)
static wmOperatorStatus text_save_exec (bContext *C, wmOperator *op)
static wmOperatorStatus text_save_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_save (wmOperatorType *ot)
Save As Operator
static wmOperatorStatus text_save_as_exec (bContext *C, wmOperator *op)
static wmOperatorStatus text_save_as_invoke (bContext *C, wmOperator *op, const wmEvent *)
void TEXT_OT_save_as (wmOperatorType *ot)
Run Script Operator
static wmOperatorStatus text_run_script (bContext *C, ReportList *reports)
static wmOperatorStatus text_run_script_exec (bContext *C, wmOperator *op)
void TEXT_OT_run_script (wmOperatorType *ot)
Paste Operator
static wmOperatorStatus text_paste_exec (bContext *C, wmOperator *op)
void TEXT_OT_paste (wmOperatorType *ot)
Duplicate Operator
static wmOperatorStatus text_duplicate_line_exec (bContext *C, wmOperator *)
void TEXT_OT_duplicate_line (wmOperatorType *ot)
Copy Operator
static void txt_copy_clipboard (const Text *text)
static wmOperatorStatus text_copy_exec (bContext *C, wmOperator *)
void TEXT_OT_copy (wmOperatorType *ot)
Cut Operator
static wmOperatorStatus text_cut_exec (bContext *C, wmOperator *)
void TEXT_OT_cut (wmOperatorType *ot)
Indent or Autocomplete Operator
static wmOperatorStatus text_indent_or_autocomplete_exec (bContext *C, wmOperator *)
void TEXT_OT_indent_or_autocomplete (wmOperatorType *ot)
Indent Operator
static wmOperatorStatus text_indent_exec (bContext *C, wmOperator *)
void TEXT_OT_indent (wmOperatorType *ot)
Unindent Operator
static wmOperatorStatus text_unindent_exec (bContext *C, wmOperator *)
void TEXT_OT_unindent (wmOperatorType *ot)
Line Break Operator
static wmOperatorStatus text_line_break_exec (bContext *C, wmOperator *)
void TEXT_OT_line_break (wmOperatorType *ot)
Toggle-Comment Operator
static wmOperatorStatus text_comment_exec (bContext *C, wmOperator *op)
void TEXT_OT_comment_toggle (wmOperatorType *ot)
Select All Operator
static wmOperatorStatus text_select_all_exec (bContext *C, wmOperator *)
void TEXT_OT_select_all (wmOperatorType *ot)
Select Line Operator
static wmOperatorStatus text_select_line_exec (bContext *C, wmOperator *)
void TEXT_OT_select_line (wmOperatorType *ot)
Select Word Operator
static wmOperatorStatus text_select_word_exec (bContext *C, wmOperator *)
void TEXT_OT_select_word (wmOperatorType *ot)
Move Lines Operators
static wmOperatorStatus move_lines_exec (bContext *C, wmOperator *op)
void TEXT_OT_move_lines (wmOperatorType *ot)
Move Select Operator
static wmOperatorStatus text_move_select_exec (bContext *C, wmOperator *op)
void TEXT_OT_move_select (wmOperatorType *ot)
Jump Operator
static wmOperatorStatus text_jump_exec (bContext *C, wmOperator *op)
static wmOperatorStatus text_jump_invoke (bContext *C, wmOperator *op, const wmEvent *)
void TEXT_OT_jump (wmOperatorType *ot)
Toggle Overwrite Operator
static wmOperatorStatus text_toggle_overwrite_exec (bContext *C, wmOperator *)
void TEXT_OT_overwrite_toggle (wmOperatorType *ot)
Scroll Bar Operator
static bool text_region_scroll_poll (bContext *C)
static wmOperatorStatus text_scroll_bar_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_scroll_bar (wmOperatorType *ot)
Set Selection Operator
static int flatten_width (SpaceText *st, const char *str)
static int flatten_column_to_offset (SpaceText *st, const char *str, int index)
static TextLinespace_text_get_line_pos_wrapped (const SpaceText *st, const ARegion *region, int *y)
static void space_text_cursor_set_to_pos_wrapped (const SpaceText *st, const ARegion *region, int x, int y, const bool sel)
static void text_cursor_set_to_pos (SpaceText *st, const ARegion *region, int x, int y, const bool sel)
static void text_cursor_timer_ensure (bContext *C, SetSelection *ssel)
static void text_cursor_timer_remove (bContext *C, SetSelection *ssel)
static void text_cursor_set_apply (bContext *C, wmOperator *op, const wmEvent *event)
static void text_cursor_set_exit (bContext *C, wmOperator *op)
static wmOperatorStatus text_selection_set_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus text_selection_set_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void text_selection_set_cancel (bContext *C, wmOperator *op)
void TEXT_OT_selection_set (wmOperatorType *ot)
Set Cursor Operator
static wmOperatorStatus text_cursor_set_exec (bContext *C, wmOperator *op)
static wmOperatorStatus text_cursor_set_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_cursor_set (wmOperatorType *ot)
Line Number Operator
static wmOperatorStatus text_line_number_invoke (bContext *C, wmOperator *, const wmEvent *event)
void TEXT_OT_line_number (wmOperatorType *ot)
Insert Operator
static wmOperatorStatus text_insert_exec (bContext *C, wmOperator *op)
static wmOperatorStatus text_insert_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_insert (wmOperatorType *ot)
Replace Operator
static wmOperatorStatus text_replace_all (bContext *C)
static wmOperatorStatus text_replace_exec (bContext *C, wmOperator *op)
void TEXT_OT_replace (wmOperatorType *ot)
Find Set Selected
static wmOperatorStatus text_find_set_selected_exec (bContext *C, wmOperator *op)
void TEXT_OT_find_set_selected (wmOperatorType *ot)
Replace Set Selected
static wmOperatorStatus text_replace_set_selected_exec (bContext *C, wmOperator *)
void TEXT_OT_replace_set_selected (wmOperatorType *ot)
Jump to File at Point
static bool text_jump_to_file_at_point_external (bContext *C, ReportList *reports, const char *filepath, const int line_index, const int column_index)
static bool text_jump_to_file_at_point_internal (bContext *C, ReportList *reports, const char *filepath, const int line_index, const int column_index)
static wmOperatorStatus text_jump_to_file_at_point_exec (bContext *C, wmOperator *op)
void TEXT_OT_jump_to_file_at_point (wmOperatorType *ot)
To 3D Object Operator
static wmOperatorStatus text_to_3d_object_exec (bContext *C, wmOperator *op)
void TEXT_OT_to_3d_object (wmOperatorType *ot)
Shader Update
static bool text_update_shader_poll (bContext *C)
static bool text_update_shader_text_recursive (RenderEngine *engine, RenderEngineType *type, bNodeTree *ntree, Text *text, VectorSet< bNodeTree * > &done_trees)
static wmOperatorStatus text_update_shader_exec (bContext *C, wmOperator *op)
void TEXT_OT_update_shader (wmOperatorType *ot)

Convert Whitespace Operator

enum  { TO_SPACES , TO_TABS }
static const EnumPropertyItem whitespace_type_items []
static wmOperatorStatus text_convert_whitespace_exec (bContext *C, wmOperator *op)
void TEXT_OT_convert_whitespace (wmOperatorType *ot)

Scroll Operator

enum  eScrollZone { SCROLLHANDLE_INVALID_OUTSIDE = -1 , SCROLLHANDLE_BAR , SCROLLHANDLE_MIN_OUTSIDE , SCROLLHANDLE_MAX_OUTSIDE }
static void space_text_screen_clamp (SpaceText *st, const ARegion *region)
static void space_text_screen_skip (SpaceText *st, ARegion *region, int lines)
static void text_scroll_state_init (TextScroll *tsc, SpaceText *st, ARegion *region)
static bool text_scroll_poll (bContext *C)
static wmOperatorStatus text_scroll_exec (bContext *C, wmOperator *op)
static void text_scroll_apply (bContext *C, wmOperator *op, const wmEvent *event)
static void scroll_exit (bContext *C, wmOperator *op)
static wmOperatorStatus text_scroll_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void text_scroll_cancel (bContext *C, wmOperator *op)
static wmOperatorStatus text_scroll_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_scroll (wmOperatorType *ot)

Find Operator

enum  { TEXT_FIND = 0 , TEXT_REPLACE = 1 }
static wmOperatorStatus text_find_and_replace (bContext *C, wmOperator *op, short mode)
static wmOperatorStatus text_find_exec (bContext *C, wmOperator *op)
void TEXT_OT_find (wmOperatorType *ot)

Resolve Conflict Operator

enum  { RESOLVE_IGNORE , RESOLVE_RELOAD , RESOLVE_SAVE , RESOLVE_MAKE_INTERNAL }
static const EnumPropertyItem resolution_items []
static bool text_resolve_conflict_poll (bContext *C)
static wmOperatorStatus text_resolve_conflict_exec (bContext *C, wmOperator *op)
static wmOperatorStatus text_resolve_conflict_invoke (bContext *C, wmOperator *op, const wmEvent *)
void TEXT_OT_resolve_conflict (wmOperatorType *ot)

Move Operator

static const EnumPropertyItem move_type_items []
static int space_text_get_cursor_rel (const SpaceText *st, const ARegion *region, TextLine *linein, int rell, int relc)
static int cursor_skip_find_line (const SpaceText *st, const ARegion *region, int lines, TextLine **linep, int *charp, int *rell, int *relc)
static void txt_wrap_move_bol (SpaceText *st, ARegion *region, const bool sel)
static void txt_wrap_move_eol (SpaceText *st, ARegion *region, const bool sel)
static void txt_wrap_move_up (SpaceText *st, ARegion *region, const bool sel)
static void txt_wrap_move_down (SpaceText *st, ARegion *region, const bool sel)
static void space_text_cursor_skip (const SpaceText *st, const ARegion *region, Text *text, int lines, const bool sel)
static wmOperatorStatus text_move_cursor (bContext *C, int type, bool select)
static wmOperatorStatus text_move_exec (bContext *C, wmOperator *op)
void TEXT_OT_move (wmOperatorType *ot)

Delete Operator

static const EnumPropertyItem delete_type_items []
static bool text_unlink_poll (bContext *C)
static wmOperatorStatus text_unlink_exec (bContext *C, wmOperator *)
static wmOperatorStatus text_unlink_invoke (bContext *C, wmOperator *op, const wmEvent *)
void TEXT_OT_unlink (wmOperatorType *ot)
static wmOperatorStatus text_delete_exec (bContext *C, wmOperator *op)
void TEXT_OT_delete (wmOperatorType *ot)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TO_SPACES 
TO_TABS 

Definition at line 1415 of file text_ops.cc.

◆ anonymous enum

anonymous enum
Enumerator
RESOLVE_IGNORE 
RESOLVE_RELOAD 
RESOLVE_SAVE 
RESOLVE_MAKE_INTERNAL 

Definition at line 4180 of file text_ops.cc.

◆ anonymous enum

anonymous enum
Enumerator
TEXT_FIND 
TEXT_REPLACE 

Definition at line 3755 of file text_ops.cc.

◆ eScrollZone

Enum for TextScroll::zone (scroll-bar handles).

Enumerator
SCROLLHANDLE_INVALID_OUTSIDE 
SCROLLHANDLE_BAR 
SCROLLHANDLE_MIN_OUTSIDE 
SCROLLHANDLE_MAX_OUTSIDE 

Definition at line 2659 of file text_ops.cc.

Function Documentation

◆ buf_tabs_to_spaces()

char * buf_tabs_to_spaces ( const char * in_buf,
const int tab_size,
int * r_out_buf_len )
static

This function converts the indentation tabs from a buffer to spaces.

Parameters
in_bufA pointer to a cstring.
tab_sizeThe size, in spaces, of the tab character.
r_out_buf_lenThe #strlen of the returned buffer.

Definition at line 167 of file text_ops.cc.

References MEM_malloc_arrayN(), and test_line_start().

Referenced by text_paste_exec().

◆ cursor_skip_find_line()

int cursor_skip_find_line ( const SpaceText * st,
const ARegion * region,
int lines,
TextLine ** linep,
int * charp,
int * rell,
int * relc )
static

◆ flatten_column_to_offset()

int flatten_column_to_offset ( SpaceText * st,
const char * str,
int index )
static

◆ flatten_width()

int flatten_width ( SpaceText * st,
const char * str )
static

◆ move_lines_exec()

◆ scroll_exit()

◆ space_text_cursor_set_to_pos_wrapped()

void space_text_cursor_set_to_pos_wrapped ( const SpaceText * st,
const ARegion * region,
int x,
int y,
const bool sel )
static

◆ space_text_cursor_skip()

void space_text_cursor_skip ( const SpaceText * st,
const ARegion * region,
Text * text,
int lines,
const bool sel )
static

Moves the cursor vertically by the specified number of lines. If the destination line is shorter than the current cursor position, the cursor will be positioned at the end of this line.

This is to replace screen_skip for PageUp/Down operations.

Definition at line 2198 of file text_ops.cc.

References Text::curc, Text::curl, cursor_skip_find_line(), linep, Text::selc, Text::sell, space_text_get_cursor_rel(), txt_pop_sel(), and SpaceText::wordwrap.

Referenced by text_move_cursor().

◆ space_text_get_cursor_rel()

int space_text_get_cursor_rel ( const SpaceText * st,
const ARegion * region,
TextLine * linein,
int rell,
int relc )
static

Get cursor position in line by relative wrapped line and column positions.

Definition at line 1751 of file text_ops.cc.

References BLI_str_utf8_char_width_safe(), BLI_str_utf8_size_safe(), ELEM, i, TextLine::len, TextLine::line, max, space_text_wrap_width(), and SpaceText::tabnumber.

Referenced by space_text_cursor_skip(), txt_wrap_move_down(), and txt_wrap_move_up().

◆ space_text_get_line_pos_wrapped()

TextLine * space_text_get_line_pos_wrapped ( const SpaceText * st,
const ARegion * region,
int * y )
static

◆ space_text_pixel_x_to_column()

BLI_INLINE int space_text_pixel_x_to_column ( const SpaceText * st,
const int x )

Definition at line 221 of file text_ops.cc.

References BLI_INLINE, SpaceText::runtime, and x.

Referenced by text_cursor_set_to_pos().

◆ space_text_screen_clamp()

void space_text_screen_clamp ( SpaceText * st,
const ARegion * region )
static

◆ space_text_screen_skip()

void space_text_screen_skip ( SpaceText * st,
ARegion * region,
int lines )
static

Definition at line 2652 of file text_ops.cc.

References space_text_screen_clamp(), and SpaceText::top.

Referenced by text_scroll_exec(), and text_scroll_modal().

◆ test_line_start()

void test_line_start ( char c,
bool * r_last_state )
static

Tests if the given character represents a start of a new line or the indentation part of a line.

Parameters
cThe current character.
r_last_stateA pointer to a flag representing the last state. The flag may be modified.

Definition at line 81 of file text_ops.cc.

References ELEM.

Referenced by buf_tabs_to_spaces().

◆ text_closing_character_pair_get()

char text_closing_character_pair_get ( const char character)
static

This function receives a character and returns its closing pair if it exists.

Parameters
characterCharacter to find the closing pair.
Returns
The closing pair of the character if it exists.

Definition at line 96 of file text_ops.cc.

Referenced by text_delete_exec(), and text_insert_invoke().

◆ text_comment_exec()

◆ text_convert_whitespace_exec()

◆ text_copy_exec()

wmOperatorStatus text_copy_exec ( bContext * C,
wmOperator *  )
static

Definition at line 1094 of file text_ops.cc.

References C, CTX_data_edit_text(), OPERATOR_FINISHED, and txt_copy_clipboard().

Referenced by TEXT_OT_copy().

◆ text_cursor_set_apply()

◆ text_cursor_set_exec()

◆ text_cursor_set_exit()

◆ text_cursor_set_invoke()

wmOperatorStatus text_cursor_set_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

◆ text_cursor_set_to_pos()

◆ text_cursor_timer_ensure()

void text_cursor_timer_ensure ( bContext * C,
SetSelection * ssel )
static

◆ text_cursor_timer_remove()

void text_cursor_timer_remove ( bContext * C,
SetSelection * ssel )
static

◆ text_cut_exec()

◆ text_data_poll()

bool text_data_poll ( bContext * C)
static

Definition at line 254 of file text_ops.cc.

References C, and CTX_data_edit_text().

Referenced by TEXT_OT_run_script(), and TEXT_OT_to_3d_object().

◆ text_delete_exec()

◆ text_duplicate_line_exec()

◆ text_edit_poll()

◆ text_find_and_replace()

◆ text_find_exec()

wmOperatorStatus text_find_exec ( bContext * C,
wmOperator * op )
static

Definition at line 3831 of file text_ops.cc.

References C, TEXT_FIND, and text_find_and_replace().

Referenced by TEXT_OT_find().

◆ text_find_set_selected_exec()

◆ text_indent_exec()

◆ text_indent_or_autocomplete_exec()

◆ text_insert_exec()

◆ text_insert_invoke()

◆ text_jump_exec()

◆ text_jump_invoke()

wmOperatorStatus text_jump_invoke ( bContext * C,
wmOperator * op,
const wmEvent *  )
static

Definition at line 2449 of file text_ops.cc.

References C, IFACE_, and WM_operator_props_dialog_popup().

Referenced by TEXT_OT_jump().

◆ text_jump_to_file_at_point_exec()

◆ text_jump_to_file_at_point_external()

bool text_jump_to_file_at_point_external ( bContext * C,
ReportList * reports,
const char * filepath,
const int line_index,
const int column_index )
static

◆ text_jump_to_file_at_point_internal()

bool text_jump_to_file_at_point_internal ( bContext * C,
ReportList * reports,
const char * filepath,
const int line_index,
const int column_index )
static

◆ text_line_break_exec()

◆ text_line_number_invoke()

◆ text_make_internal_exec()

◆ text_move_cursor()

◆ text_move_exec()

wmOperatorStatus text_move_exec ( bContext * C,
wmOperator * op )
static

Definition at line 2364 of file text_ops.cc.

References C, wmOperator::ptr, RNA_enum_get(), and text_move_cursor().

Referenced by TEXT_OT_move().

◆ text_move_select_exec()

wmOperatorStatus text_move_select_exec ( bContext * C,
wmOperator * op )
static

Definition at line 2392 of file text_ops.cc.

References C, wmOperator::ptr, RNA_enum_get(), and text_move_cursor().

Referenced by TEXT_OT_move_select().

◆ text_new_exec()

◆ text_new_poll()

bool text_new_poll ( bContext * )
static

Definition at line 249 of file text_ops.cc.

Referenced by TEXT_OT_new(), and TEXT_OT_open().

◆ text_open_cancel()

void text_open_cancel ( bContext * ,
wmOperator * op )
static

Definition at line 408 of file text_ops.cc.

References wmOperator::customdata.

Referenced by TEXT_OT_open().

◆ text_open_exec()

◆ text_open_init()

void text_open_init ( bContext * C,
wmOperator * op )
static

◆ text_open_invoke()

◆ TEXT_OT_comment_toggle()

void TEXT_OT_comment_toggle ( wmOperatorType * ot)

◆ TEXT_OT_convert_whitespace()

void TEXT_OT_convert_whitespace ( wmOperatorType * ot)

◆ TEXT_OT_copy()

void TEXT_OT_copy ( wmOperatorType * ot)

Definition at line 1103 of file text_ops.cc.

References ot, text_copy_exec(), and text_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_cursor_set()

void TEXT_OT_cursor_set ( wmOperatorType * ot)

◆ TEXT_OT_cut()

void TEXT_OT_cut ( wmOperatorType * ot)

Definition at line 1144 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_cut_exec(), and text_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_delete()

◆ TEXT_OT_duplicate_line()

void TEXT_OT_duplicate_line ( wmOperatorType * ot)

Definition at line 1057 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_duplicate_line_exec(), and text_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_find()

void TEXT_OT_find ( wmOperatorType * ot)

Definition at line 3836 of file text_ops.cc.

References ot, text_find_exec(), and text_space_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_find_set_selected()

void TEXT_OT_find_set_selected ( wmOperatorType * ot)

Definition at line 3948 of file text_ops.cc.

References ot, text_find_set_selected_exec(), and text_space_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_indent()

void TEXT_OT_indent ( wmOperatorType * ot)

Definition at line 1227 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_edit_poll(), and text_indent_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_indent_or_autocomplete()

void TEXT_OT_indent_or_autocomplete ( wmOperatorType * ot)

Definition at line 1181 of file text_ops.cc.

References ot, text_edit_poll(), and text_indent_or_autocomplete_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_insert()

◆ TEXT_OT_jump()

◆ TEXT_OT_jump_to_file_at_point()

◆ TEXT_OT_line_break()

void TEXT_OT_line_break ( wmOperatorType * ot)

Definition at line 1325 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_edit_poll(), and text_line_break_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_line_number()

void TEXT_OT_line_number ( wmOperatorType * ot)

Definition at line 3541 of file text_ops.cc.

References ot, text_line_number_invoke(), and text_region_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_make_internal()

void TEXT_OT_make_internal ( wmOperatorType * ot)

Definition at line 679 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_edit_poll(), and text_make_internal_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_move()

void TEXT_OT_move ( wmOperatorType * ot)

Definition at line 2371 of file text_ops.cc.

References LINE_BEGIN, move_type_items, ot, RNA_def_enum(), text_edit_poll(), and text_move_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_move_lines()

void TEXT_OT_move_lines ( wmOperatorType * ot)

◆ TEXT_OT_move_select()

void TEXT_OT_move_select ( wmOperatorType * ot)

◆ TEXT_OT_new()

void TEXT_OT_new ( wmOperatorType * ot)

Definition at line 379 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_new_exec(), and text_new_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_open()

◆ TEXT_OT_overwrite_toggle()

void TEXT_OT_overwrite_toggle ( wmOperatorType * ot)

Definition at line 2618 of file text_ops.cc.

References ot, text_space_edit_poll(), and text_toggle_overwrite_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_paste()

void TEXT_OT_paste ( wmOperatorType * ot)

◆ TEXT_OT_reload()

void TEXT_OT_reload ( wmOperatorType * ot)

Definition at line 581 of file text_ops.cc.

References ot, text_edit_poll(), text_reload_exec(), and text_reload_invoke().

Referenced by text_operatortypes().

◆ TEXT_OT_replace()

◆ TEXT_OT_replace_set_selected()

void TEXT_OT_replace_set_selected ( wmOperatorType * ot)

Definition at line 3979 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_replace_set_selected_exec(), and text_space_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_resolve_conflict()

◆ TEXT_OT_run_script()

void TEXT_OT_run_script ( wmOperatorType * ot)

Definition at line 944 of file text_ops.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, text_data_poll(), and text_run_script_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_save()

void TEXT_OT_save ( wmOperatorType * ot)

Definition at line 784 of file text_ops.cc.

References ot, text_edit_poll(), text_save_exec(), and text_save_invoke().

Referenced by text_operatortypes().

◆ TEXT_OT_save_as()

◆ TEXT_OT_scroll()

◆ TEXT_OT_scroll_bar()

◆ TEXT_OT_select_all()

void TEXT_OT_select_all ( wmOperatorType * ot)

Definition at line 1599 of file text_ops.cc.

References ot, text_edit_poll(), and text_select_all_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_select_line()

void TEXT_OT_select_line ( wmOperatorType * ot)

Definition at line 1631 of file text_ops.cc.

References ot, text_edit_poll(), and text_select_line_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_select_word()

void TEXT_OT_select_word ( wmOperatorType * ot)

Definition at line 1664 of file text_ops.cc.

References ot, text_edit_poll(), and text_select_word_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_selection_set()

void TEXT_OT_selection_set ( wmOperatorType * ot)

◆ TEXT_OT_to_3d_object()

void TEXT_OT_to_3d_object ( wmOperatorType * ot)

◆ TEXT_OT_unindent()

void TEXT_OT_unindent ( wmOperatorType * ot)

Definition at line 1268 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_edit_poll(), and text_unindent_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_unlink()

void TEXT_OT_unlink ( wmOperatorType * ot)

Definition at line 643 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_unlink_exec(), text_unlink_invoke(), and text_unlink_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_update_shader()

void TEXT_OT_update_shader ( wmOperatorType * ot)

◆ text_paste_exec()

◆ text_region_edit_poll()

◆ text_region_scroll_poll()

bool text_region_scroll_poll ( bContext * C)
static

◆ text_reload_exec()

◆ text_reload_invoke()

wmOperatorStatus text_reload_invoke ( bContext * C,
wmOperator * op,
const wmEvent *  )
static

Definition at line 570 of file text_ops.cc.

References ALERT_ICON_NONE, C, IFACE_, and WM_operator_confirm_ex().

Referenced by TEXT_OT_reload().

◆ text_replace_all()

◆ text_replace_exec()

wmOperatorStatus text_replace_exec ( bContext * C,
wmOperator * op )
static

◆ text_replace_set_selected_exec()

wmOperatorStatus text_replace_set_selected_exec ( bContext * C,
wmOperator *  )
static

◆ text_resolve_conflict_exec()

◆ text_resolve_conflict_invoke()

◆ text_resolve_conflict_poll()

bool text_resolve_conflict_poll ( bContext * C)
static

◆ text_run_script()

◆ text_run_script_exec()

wmOperatorStatus text_run_script_exec ( bContext * C,
wmOperator * op )
static

◆ text_save_as_exec()

◆ text_save_as_invoke()

◆ text_save_exec()

◆ text_save_invoke()

wmOperatorStatus text_save_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

◆ text_scroll_apply()

◆ text_scroll_bar_invoke()

◆ text_scroll_cancel()

void text_scroll_cancel ( bContext * C,
wmOperator * op )
static

Definition at line 2866 of file text_ops.cc.

References C, and scroll_exit().

Referenced by TEXT_OT_scroll(), and TEXT_OT_scroll_bar().

◆ text_scroll_exec()

◆ text_scroll_invoke()

◆ text_scroll_modal()

◆ text_scroll_poll()

bool text_scroll_poll ( bContext * C)
static

Definition at line 2698 of file text_ops.cc.

References C, and CTX_data_edit_text().

Referenced by TEXT_OT_scroll().

◆ text_scroll_state_init()

◆ text_select_all_exec()

◆ text_select_line_exec()

◆ text_select_update_primary_clipboard()

◆ text_select_word_exec()

◆ text_selection_set_cancel()

void text_selection_set_cancel ( bContext * C,
wmOperator * op )
static

Definition at line 3417 of file text_ops.cc.

References C, and text_cursor_set_exit().

Referenced by TEXT_OT_selection_set().

◆ text_selection_set_invoke()

◆ text_selection_set_modal()

wmOperatorStatus text_selection_set_modal ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

◆ text_space_edit_poll()

◆ text_span_is_blank()

bool text_span_is_blank ( TextLine * line1,
const int line1_char,
TextLine * line2,
const int line2_char )
static

This function receives a range and returns true if the range is blank.

Parameters
line1The first TextLine argument.
line1_charThe character number of line1.
line2The second TextLine argument.
line2_charThe character number of line2.
Returns
True if the span is blank.

Definition at line 123 of file text_ops.cc.

References ELEM, i, TextLine::next, and txt_get_span().

Referenced by text_insert_invoke().

◆ text_to_3d_object_exec()

wmOperatorStatus text_to_3d_object_exec ( bContext * C,
wmOperator * op )
static

◆ text_toggle_overwrite_exec()

wmOperatorStatus text_toggle_overwrite_exec ( bContext * C,
wmOperator *  )
static

◆ text_unindent_exec()

◆ text_unlink_exec()

◆ text_unlink_invoke()

wmOperatorStatus text_unlink_invoke ( bContext * C,
wmOperator * op,
const wmEvent *  )
static

Definition at line 632 of file text_ops.cc.

References ALERT_ICON_NONE, C, IFACE_, and WM_operator_confirm_ex().

Referenced by TEXT_OT_unlink().

◆ text_unlink_poll()

bool text_unlink_poll ( bContext * C)
static

Definition at line 600 of file text_ops.cc.

References C, and CTX_data_edit_text().

Referenced by TEXT_OT_unlink().

◆ text_update_edited()

◆ text_update_line_edited()

◆ text_update_shader_exec()

◆ text_update_shader_poll()

bool text_update_shader_poll ( bContext * C)
static

◆ text_update_shader_text_recursive()

◆ txt_copy_clipboard()

void txt_copy_clipboard ( const Text * text)
static

Definition at line 1078 of file text_ops.cc.

References MEM_freeN(), txt_has_sel(), txt_sel_to_buf(), and WM_clipboard_text_set().

Referenced by text_copy_exec(), and text_cut_exec().

◆ txt_wrap_move_bol()

◆ txt_wrap_move_down()

◆ txt_wrap_move_eol()

◆ txt_wrap_move_up()

◆ txt_write_file()

Variable Documentation

◆ delete_type_items

const EnumPropertyItem delete_type_items[]
static
Initial value:
= {
{DEL_NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
{DEL_PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
{DEL_NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
{DEL_PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ DEL_PREV_WORD
@ DEL_PREV_CHAR
@ DEL_NEXT_WORD
@ DEL_NEXT_CHAR

Definition at line 2478 of file text_ops.cc.

◆ move_type_items

const EnumPropertyItem move_type_items[]
static
Initial value:
= {
{LINE_BEGIN, "LINE_BEGIN", 0, "Line Begin", ""},
{LINE_END, "LINE_END", 0, "Line End", ""},
{FILE_TOP, "FILE_TOP", 0, "File Top", ""},
{FILE_BOTTOM, "FILE_BOTTOM", 0, "File Bottom", ""},
{PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
{NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
{PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""},
{NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
{PREV_LINE, "PREVIOUS_LINE", 0, "Previous Line", ""},
{NEXT_LINE, "NEXT_LINE", 0, "Next Line", ""},
{PREV_PAGE, "PREVIOUS_PAGE", 0, "Previous Page", ""},
{NEXT_PAGE, "NEXT_PAGE", 0, "Next Page", ""},
{0, nullptr, 0, nullptr, nullptr},
}
#define NEXT_CHAR(fmt)
@ NEXT_LINE
@ LINE_BEGIN
@ PREV_WORD
@ PREV_LINE
@ PREV_CHAR
@ LINE_END
@ PREV_PAGE
@ NEXT_PAGE
@ NEXT_WORD
@ FILE_TOP
@ FILE_BOTTOM

Definition at line 1732 of file text_ops.cc.

◆ resolution_items

const EnumPropertyItem resolution_items[]
static
Initial value:
= {
{RESOLVE_IGNORE, "IGNORE", 0, "Ignore", ""},
{RESOLVE_RELOAD, "RELOAD", 0, "Reload", ""},
{RESOLVE_SAVE, "SAVE", 0, "Save", ""},
{RESOLVE_MAKE_INTERNAL, "MAKE_INTERNAL", 0, "Make Internal", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ RESOLVE_SAVE
Definition text_ops.cc:4180
@ RESOLVE_MAKE_INTERNAL
Definition text_ops.cc:4180
@ RESOLVE_RELOAD
Definition text_ops.cc:4180
@ RESOLVE_IGNORE
Definition text_ops.cc:4180

Definition at line 4181 of file text_ops.cc.

Referenced by TEXT_OT_resolve_conflict().

◆ whitespace_type_items

const EnumPropertyItem whitespace_type_items[]
static
Initial value:
= {
{TO_SPACES, "SPACES", 0, "To Spaces", nullptr},
{TO_TABS, "TABS", 0, "To Tabs", nullptr},
{0, nullptr, 0, nullptr, nullptr},
}
@ TO_SPACES
Definition text_ops.cc:1415
@ TO_TABS
Definition text_ops.cc:1415

Definition at line 1416 of file text_ops.cc.

Referenced by TEXT_OT_convert_whitespace().