Blender  V3.3
text.c File Reference
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <wctype.h>
#include "MEM_guardedalloc.h"
#include "BLI_fileops.h"
#include "BLI_listbase.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_string_cursor_utf8.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_constraint_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_text_types.h"
#include "DNA_userdef_types.h"
#include "BKE_bpath.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_text.h"
#include "BLO_read_write.h"

Go to the source code of this file.

Functions

Prototypes
static void txt_pop_first (Text *text)
 
static void txt_pop_last (Text *text)
 
static void txt_delete_line (Text *text, TextLine *line)
 
static void txt_delete_sel (Text *text)
 
static void txt_make_dirty (Text *text)
 
Text Add, Free, Validation
void BKE_text_free_lines (Text *text)
 
TextBKE_text_add (Main *bmain, const char *name)
 
int txt_extended_ascii_as_utf8 (char **str)
 
static void cleanup_textline (TextLine *tl)
 
static void text_from_buf (Text *text, const unsigned char *buffer, const int len)
 
bool BKE_text_reload (Text *text)
 
TextBKE_text_load_ex (Main *bmain, const char *filepath, const char *relbase, const bool is_internal)
 
TextBKE_text_load (Main *bmain, const char *filepath, const char *relbase)
 
void BKE_text_clear (Text *text)
 
void BKE_text_write (Text *text, const char *str, int str_len)
 
int BKE_text_file_modified_check (Text *text)
 
void BKE_text_file_modified_ignore (Text *text)
 
Editing Utility Functions
static void make_new_line (TextLine *line, char *newline)
 
static TextLinetxt_new_linen (const char *str, int str_len)
 
static TextLinetxt_new_line (const char *str)
 
void txt_clean_text (Text *text)
 
int txt_get_span (TextLine *from, TextLine *to)
 
Cursor Utility Functions
static void txt_curs_cur (Text *text, TextLine ***linep, int **charp)
 
static void txt_curs_sel (Text *text, TextLine ***linep, int **charp)
 
bool txt_cursor_is_line_start (const Text *text)
 
bool txt_cursor_is_line_end (const Text *text)
 
Cursor Movement Functions
Note
If the user moves the cursor the space containing that cursor should be popped See txt_pop_first, txt_pop_last Other space-types retain their own top location.
void txt_move_up (Text *text, const bool sel)
 
void txt_move_down (Text *text, const bool sel)
 
int txt_calc_tab_left (TextLine *tl, int ch)
 
int txt_calc_tab_right (TextLine *tl, int ch)
 
void txt_move_left (Text *text, const bool sel)
 
void txt_move_right (Text *text, const bool sel)
 
void txt_jump_left (Text *text, const bool sel, const bool use_init_step)
 
void txt_jump_right (Text *text, const bool sel, const bool use_init_step)
 
void txt_move_bol (Text *text, const bool sel)
 
void txt_move_eol (Text *text, const bool sel)
 
void txt_move_bof (Text *text, const bool sel)
 
void txt_move_eof (Text *text, const bool sel)
 
void txt_move_toline (Text *text, unsigned int line, const bool sel)
 
void txt_move_to (Text *text, unsigned int line, unsigned int ch, const bool sel)
 
Text Selection Functions
static void txt_curs_swap (Text *text)
 
void txt_pop_sel (Text *text)
 
void txt_order_cursors (Text *text, const bool reverse)
 
bool txt_has_sel (const Text *text)
 
void txt_sel_all (Text *text)
 
void txt_sel_clear (Text *text)
 
void txt_sel_line (Text *text)
 
void txt_sel_set (Text *text, int startl, int startc, int endl, int endc)
 
Buffer Conversion for Undo/Redo

Buffer conversion functions that rely on the buffer already being validated.

The only requirement for these functions is that they're reverse-able, the undo logic doesn't inspect their content.

Currently buffers:

  • Always ends with a new-line.
  • Are not null terminated.
char * txt_to_buf_for_undo (Text *text, size_t *r_buf_len)
 
void txt_from_buf_for_undo (Text *text, const char *buf, size_t buf_len)
 
Cut and Paste Functions
char * txt_to_buf (Text *text, size_t *r_buf_strlen)
 
char * txt_sel_to_buf (Text *text, size_t *r_buf_strlen)
 
void txt_insert_buf (Text *text, const char *in_buffer, int in_buffer_len)
 
Find String in Text
int txt_find_string (Text *text, const char *findstr, int wrap, int match_case)
 
Character Queries
int text_check_bracket (const char ch)
 
bool text_check_delim (const char ch)
 
bool text_check_digit (const char ch)
 
bool text_check_identifier (const char ch)
 
bool text_check_identifier_nodigit (const char ch)
 
int text_check_identifier_unicode (const unsigned int ch)
 
int text_check_identifier_nodigit_unicode (const unsigned int ch)
 
bool text_check_whitespace (const char ch)
 
int text_find_identifier_start (const char *str, int i)
 

Text Data-Block

IDTypeInfo IDType_ID_TXT
 
static void text_init_data (ID *id)
 
static void text_copy_data (Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
 
static void text_free_data (ID *id)
 
static void text_foreach_path (ID *id, BPathForeachPathData *bpath_data)
 
static void text_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static void text_blend_read_data (BlendDataReader *reader, ID *id)
 

Line Editing Functions

static char tab_to_spaces [] = " "
 
void txt_split_curline (Text *text)
 
static void txt_combine_lines (Text *text, TextLine *linea, TextLine *lineb)
 
void txt_duplicate_line (Text *text)
 
void txt_delete_char (Text *text)
 
void txt_delete_word (Text *text)
 
void txt_backspace_char (Text *text)
 
void txt_backspace_word (Text *text)
 
static void txt_convert_tab_to_spaces (Text *text)
 
static bool txt_add_char_intern (Text *text, unsigned int add, bool replace_tabs)
 
bool txt_add_char (Text *text, unsigned int add)
 
bool txt_add_raw_char (Text *text, unsigned int add)
 
void txt_delete_selected (Text *text)
 
bool txt_replace_char (Text *text, unsigned int add)
 
static void txt_select_prefix (Text *text, const char *add, bool skip_blank_lines)
 
static bool txt_select_unprefix (Text *text, const char *remove, const bool require_all)
 
void txt_comment (Text *text)
 
bool txt_uncomment (Text *text)
 
void txt_indent (Text *text)
 
bool txt_unindent (Text *text)
 
void txt_move_lines (struct Text *text, const int direction)
 
int txt_setcurr_tab_spaces (Text *text, int space)
 

Function Documentation

◆ BKE_text_add()

Text* BKE_text_add ( Main bmain,
const char *  name 
)

Definition at line 282 of file text.c.

References BKE_id_new(), Text::id, id_fake_user_set(), ID_TXT, and id_us_min().

Referenced by text_new_exec().

◆ BKE_text_clear()

void BKE_text_clear ( Text text)

Definition at line 516 of file text.c.

References txt_delete_sel(), txt_make_dirty(), and txt_sel_all().

◆ BKE_text_file_modified_check()

int BKE_text_file_modified_check ( struct Text text)
Returns
codes:
  • 0 if filepath on disk is the same or Text is in memory only.
  • 1 if filepath has been modified on disk since last local edit.
  • 2 if filepath on disk has been deleted.
  • -1 is returned if an error occurs.

Definition at line 530 of file text.c.

References BLI_exists(), BLI_path_abs(), BLI_stat(), BLI_strncpy(), FILE_MAX, Text::filepath, Text::id, ID_BLEND_PATH_FROM_GLOBAL, Text::mtime, result, and usdtokens::st().

Referenced by text_resolve_conflict_invoke().

◆ BKE_text_file_modified_ignore()

void BKE_text_file_modified_ignore ( Text text)

◆ BKE_text_free_lines()

void BKE_text_free_lines ( struct Text text)
Note
caller must handle compiled member.

Definition at line 266 of file text.c.

References BLI_listbase_clear(), Text::curl, ListBase::first, Text::lines, MEM_freeN, NULL, and Text::sell.

Referenced by BKE_text_reload(), and text_free_data().

◆ BKE_text_load()

Text* BKE_text_load ( Main bmain,
const char *  filepath,
const char *  relbase 
)

Definition at line 511 of file text.c.

References BKE_text_load_ex().

◆ BKE_text_load_ex()

Text* BKE_text_load_ex ( Main bmain,
const char *  filepath,
const char *  relbase,
const bool  is_internal 
)

◆ BKE_text_reload()

bool BKE_text_reload ( Text text)

◆ BKE_text_write()

void BKE_text_write ( Text text,
const char *  str,
int  str_len 
)

Definition at line 523 of file text.c.

References str, txt_insert_buf(), txt_make_dirty(), and txt_move_eof().

◆ cleanup_textline()

static void cleanup_textline ( TextLine tl)
static

Removes any control characters from a text-line and fixes invalid UTF8 sequences.

Definition at line 339 of file text.c.

References TextLine::len, TextLine::line, and txt_extended_ascii_as_utf8().

Referenced by text_from_buf().

◆ make_new_line()

static void make_new_line ( TextLine line,
char *  newline 
)
static

◆ text_blend_read_data()

static void text_blend_read_data ( BlendDataReader reader,
ID id 
)
static

◆ text_blend_write()

static void text_blend_write ( BlendWriter writer,
ID id,
const void id_address 
)
static

◆ text_check_bracket()

int text_check_bracket ( char  ch)

Utility functions, could be moved somewhere more generic but are python/text related.

Definition at line 2276 of file text.c.

References Freestyle::a.

◆ text_check_delim()

bool text_check_delim ( const char  ch)

◆ text_check_digit()

bool text_check_digit ( const char  ch)

◆ text_check_identifier()

bool text_check_identifier ( const char  ch)

◆ text_check_identifier_nodigit()

bool text_check_identifier_nodigit ( const char  ch)

Definition at line 2343 of file text.c.

Referenced by text_check_identifier_nodigit_unicode().

◆ text_check_identifier_nodigit_unicode()

int text_check_identifier_nodigit_unicode ( const unsigned int  ch)

Definition at line 2369 of file text.c.

◆ text_check_identifier_unicode()

int text_check_identifier_unicode ( const unsigned int  ch)

Definition at line 2364 of file text.c.

◆ text_check_whitespace()

bool text_check_whitespace ( const char  ch)

Definition at line 2375 of file text.c.

References ELEM.

Referenced by text_autocomplete_modal(), txtfmt_osl_find_preprocessor(), and txtfmt_py_find_decorator().

◆ text_copy_data()

static void text_copy_data ( Main UNUSEDbmain,
ID id_dst,
const ID id_src,
const int   UNUSEDflag 
)
static

Only copy internal data of Text ID from source to already allocated/initialized destination. You probably never want to use that directly, use BKE_id_copy or BKE_id_copy_ex for typical needs.

WARNING! This function will not handle ID user count!

Parameters
flagCopying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).

Definition at line 109 of file text.c.

References BLI_addtail(), BLI_listbase_clear(), BLI_strdup(), Text::compiled, Text::curc, Text::curl, Text::filepath, ListBase::first, Text::flags, TextLine::format, TextLine::len, TextLine::line, Text::lines, LISTBASE_FOREACH, MEM_mallocN, NULL, Text::selc, Text::sell, and TXT_ISDIRTY.

◆ text_find_identifier_start()

int text_find_identifier_start ( const char *  str,
int  i 
)

Definition at line 2383 of file text.c.

References str, text_check_identifier(), and UNLIKELY.

Referenced by confirm_suggestion(), get_suggest_prefix(), and text_autocomplete_build().

◆ text_foreach_path()

static void text_foreach_path ( ID id,
BPathForeachPathData bpath_data 
)
static

Definition at line 157 of file text.c.

References BKE_bpath_foreach_path_allocated_process(), Text::filepath, and NULL.

◆ text_free_data()

static void text_free_data ( ID id)
static

Free (or release) any data used by this text (does not free the text itself).

Definition at line 144 of file text.c.

References BKE_text_free_lines(), BPY_text_free_code(), Text::filepath, and MEM_SAFE_FREE.

◆ text_from_buf()

static void text_from_buf ( Text text,
const unsigned char *  buffer,
const int  len 
)
static

used for load and reload (unlike txt_insert_buf) assumes all fields are empty

Definition at line 357 of file text.c.

References BLI_addtail(), BLI_assert, BLI_listbase_is_empty(), buffer, cleanup_textline(), Text::curc, Text::curl, ListBase::first, TextLine::format, len, TextLine::len, TextLine::line, Text::lines, MEM_mallocN, NULL, Text::selc, and Text::sell.

Referenced by BKE_text_load_ex(), and BKE_text_reload().

◆ text_init_data()

static void text_init_data ( ID id)
static

◆ txt_add_char()

bool txt_add_char ( Text text,
unsigned int  add 
)

◆ txt_add_char_intern()

static bool txt_add_char_intern ( Text text,
unsigned int  add,
bool  replace_tabs 
)
static

◆ txt_add_raw_char()

bool txt_add_raw_char ( Text text,
unsigned int  add 
)

Definition at line 1924 of file text.c.

References blender::bke::attribute_accessor_functions::add(), and txt_add_char_intern().

Referenced by txt_insert_buf().

◆ txt_backspace_char()

void txt_backspace_char ( Text text)

◆ txt_backspace_word()

void txt_backspace_word ( Text text)

Definition at line 1854 of file text.c.

References txt_delete_sel(), txt_jump_left(), and txt_make_dirty().

Referenced by text_delete_exec().

◆ txt_calc_tab_left()

int txt_calc_tab_left ( TextLine tl,
int  ch 
)

Definition at line 824 of file text.c.

References TextLine::line, and TXT_TABSIZE.

Referenced by text_delete_exec(), and txt_move_left().

◆ txt_calc_tab_right()

int txt_calc_tab_right ( TextLine tl,
int  ch 
)

Definition at line 844 of file text.c.

References TextLine::line, and TXT_TABSIZE.

Referenced by text_delete_exec(), and txt_move_right().

◆ txt_clean_text()

void txt_clean_text ( Text text)

◆ txt_combine_lines()

static void txt_combine_lines ( Text text,
TextLine linea,
TextLine lineb 
)
static

◆ txt_comment()

void txt_comment ( Text text)

Definition at line 2137 of file text.c.

References Text::curl, ELEM, NULL, Text::sell, txt_has_sel(), and txt_select_prefix().

Referenced by text_comment_exec().

◆ txt_convert_tab_to_spaces()

static void txt_convert_tab_to_spaces ( Text text)
static

Definition at line 1866 of file text.c.

References Text::curc, tab_to_spaces, txt_insert_buf(), and TXT_TABSIZE.

Referenced by txt_add_char_intern().

◆ txt_curs_cur()

static void txt_curs_cur ( Text text,
TextLine ***  linep,
int **  charp 
)
static

◆ txt_curs_sel()

static void txt_curs_sel ( Text text,
TextLine ***  linep,
int **  charp 
)
static

◆ txt_curs_swap()

static void txt_curs_swap ( Text text)
static

Definition at line 1137 of file text.c.

References Text::curc, Text::curl, Text::selc, and Text::sell.

Referenced by txt_order_cursors(), txt_pop_first(), and txt_pop_last().

◆ txt_cursor_is_line_end()

bool txt_cursor_is_line_end ( const Text text)

Definition at line 749 of file text.c.

References TextLine::len, Text::selc, and Text::sell.

◆ txt_cursor_is_line_start()

bool txt_cursor_is_line_start ( const Text text)

Definition at line 744 of file text.c.

References Text::selc.

◆ txt_delete_char()

void txt_delete_char ( Text text)

◆ txt_delete_line()

static void txt_delete_line ( Text text,
TextLine line 
)
static

◆ txt_delete_sel()

static void txt_delete_sel ( Text text)
static

◆ txt_delete_selected()

void txt_delete_selected ( Text text)

Definition at line 1929 of file text.c.

References txt_delete_sel(), and txt_make_dirty().

Referenced by text_cut_exec().

◆ txt_delete_word()

void txt_delete_word ( Text text)

Definition at line 1799 of file text.c.

References txt_delete_sel(), txt_jump_right(), and txt_make_dirty().

Referenced by text_delete_exec().

◆ txt_duplicate_line()

void txt_duplicate_line ( Text text)

◆ txt_extended_ascii_as_utf8()

int txt_extended_ascii_as_utf8 ( char **  str)

Use to a valid UTF-8 sequences. this function replaces extended ascii characters.

Definition at line 295 of file text.c.

References BLI_str_utf8_from_unicode(), BLI_str_utf8_invalid_byte(), blender::math::length(), MEM_freeN, MEM_mallocN, and str.

Referenced by blo_do_versions_260(), cleanup_textline(), and txt_insert_buf().

◆ txt_find_string()

int txt_find_string ( Text text,
const char *  findstr,
int  wrap,
int  match_case 
)

◆ txt_from_buf_for_undo()

void txt_from_buf_for_undo ( Text text,
const char *  buf,
size_t  buf_len 
)

◆ txt_get_span()

int txt_get_span ( TextLine from,
TextLine to 
)

◆ txt_has_sel()

bool txt_has_sel ( const Text text)

◆ txt_indent()

void txt_indent ( Text text)

Definition at line 2160 of file text.c.

References Text::curl, ELEM, Text::flags, NULL, Text::sell, tab_to_spaces, txt_select_prefix(), and TXT_TABSTOSPACES.

Referenced by text_indent_exec().

◆ txt_insert_buf()

void txt_insert_buf ( Text text,
const char *  in_buffer,
int  in_buffer_len 
)

◆ txt_jump_left()

void txt_jump_left ( Text text,
const bool  sel,
const bool  use_init_step 
)

◆ txt_jump_right()

void txt_jump_right ( Text text,
const bool  sel,
const bool  use_init_step 
)

◆ txt_make_dirty()

static void txt_make_dirty ( Text text)
static

◆ txt_move_bof()

void txt_move_bof ( Text text,
const bool  sel 
)

Definition at line 1045 of file text.c.

References ListBase::first, Text::lines, txt_curs_cur(), txt_curs_sel(), and txt_pop_sel().

Referenced by text_move_cursor().

◆ txt_move_bol()

void txt_move_bol ( Text text,
const bool  sel 
)

Definition at line 1001 of file text.c.

References txt_curs_cur(), txt_curs_sel(), and txt_pop_sel().

Referenced by text_move_cursor(), and txt_move_up().

◆ txt_move_down()

void txt_move_down ( Text text,
const bool  sel 
)

◆ txt_move_eof()

void txt_move_eof ( Text text,
const bool  sel 
)

Definition at line 1068 of file text.c.

References ListBase::last, Text::lines, txt_curs_cur(), txt_curs_sel(), and txt_pop_sel().

Referenced by BKE_text_write(), and text_move_cursor().

◆ txt_move_eol()

void txt_move_eol ( Text text,
const bool  sel 
)

Definition at line 1023 of file text.c.

References txt_curs_cur(), txt_curs_sel(), and txt_pop_sel().

Referenced by text_move_cursor(), and txt_move_down().

◆ txt_move_left()

void txt_move_left ( Text text,
const bool  sel 
)

◆ txt_move_lines()

void txt_move_lines ( struct Text text,
const int  direction 
)

◆ txt_move_right()

void txt_move_right ( Text text,
const bool  sel 
)

◆ txt_move_to()

void txt_move_to ( struct Text text,
unsigned int  line,
unsigned int  ch,
bool  sel 
)

Moves to a certain byte in a line, not a certain utf8-character.

Definition at line 1096 of file text.c.

References ListBase::first, Text::lines, TextLine::next, txt_curs_cur(), txt_curs_sel(), and txt_pop_sel().

Referenced by python_script_error_jump_text(), text_reload_exec(), text_replace_all(), text_state_decode(), txt_find_string(), and txt_move_toline().

◆ txt_move_toline()

void txt_move_toline ( Text text,
unsigned int  line,
const bool  sel 
)

Definition at line 1091 of file text.c.

References txt_move_to().

Referenced by text_find_and_replace(), text_jump_exec(), text_line_number_invoke(), and text_replace_all().

◆ txt_move_up()

void txt_move_up ( Text text,
const bool  sel 
)

◆ txt_new_line()

static TextLine* txt_new_line ( const char *  str)
static

Definition at line 628 of file text.c.

References str, and txt_new_linen().

Referenced by txt_clean_text(), and txt_duplicate_line().

◆ txt_new_linen()

static TextLine* txt_new_linen ( const char *  str,
int  str_len 
)
static

◆ txt_order_cursors()

void txt_order_cursors ( Text text,
const bool  reverse 
)

◆ txt_pop_first()

static void txt_pop_first ( Text text)
static

◆ txt_pop_last()

static void txt_pop_last ( Text text)
static

◆ txt_pop_sel()

void txt_pop_sel ( Text text)

◆ txt_replace_char()

bool txt_replace_char ( Text text,
unsigned int  add 
)

◆ txt_sel_all()

void txt_sel_all ( Text text)

◆ txt_sel_clear()

void txt_sel_clear ( struct Text text)

Reverse of txt_pop_sel Clears the selection and ensures the cursor is located at the selection (where the cursor is visually while editing).

Definition at line 1255 of file text.c.

References Text::curc, Text::curl, Text::selc, and Text::sell.

Referenced by text_move_cursor().

◆ txt_sel_line()

void txt_sel_line ( Text text)

Definition at line 1263 of file text.c.

References Text::curc, Text::curl, TextLine::len, Text::selc, and Text::sell.

Referenced by text_select_line_exec().

◆ txt_sel_set()

void txt_sel_set ( Text text,
int  startl,
int  startc,
int  endl,
int  endc 
)

◆ txt_sel_to_buf()

char* txt_sel_to_buf ( Text text,
size_t *  r_buf_strlen 
)

◆ txt_select_prefix()

static void txt_select_prefix ( Text text,
const char *  add,
bool  skip_blank_lines 
)
static

Generic prefix operation, use for comment & indent.

Note
caller must handle undo.

Definition at line 1987 of file text.c.

References blender::bke::attribute_accessor_functions::add(), BLI_assert, Text::curc, Text::curl, ELEM, len, TextLine::len, TextLine::line, make_new_line(), MEM_mallocN, TextLine::next, NULL, TextLine::prev, Text::selc, Text::sell, txt_clean_text(), and txt_make_dirty().

Referenced by txt_comment(), and txt_indent().

◆ txt_select_unprefix()

static bool txt_select_unprefix ( Text text,
const char *  remove,
const bool  require_all 
)
static

Generic un-prefix operation, use for comment & indent.

Parameters
require_allWhen true, all non-empty lines must have this prefix. Needed for comments where we might want to un-comment a block which contains some comments.
Note
caller must handle undo.

Definition at line 2066 of file text.c.

References BLI_assert, Text::curc, Text::curl, ELEM, l, TextLine::len, TextLine::line, MAX2, BMLoop::next, TextLine::next, NULL, TextLine::prev, blender::bke::attribute_accessor_functions::remove(), Text::selc, Text::sell, STREQLEN, txt_clean_text(), and txt_make_dirty().

Referenced by txt_uncomment(), and txt_unindent().

◆ txt_setcurr_tab_spaces()

int txt_setcurr_tab_spaces ( Text text,
int  space 
)

Definition at line 2213 of file text.c.

References Freestyle::a, Text::curc, Text::curl, ELEM, Text::flags, TextLine::line, NULL, and TXT_TABSTOSPACES.

Referenced by text_line_break_exec().

◆ txt_split_curline()

void txt_split_curline ( Text text)

◆ txt_to_buf()

char* txt_to_buf ( Text text,
size_t *  r_buf_strlen 
)

Definition at line 1426 of file text.c.

References BLI_listbase_is_empty(), l, Text::lines, LISTBASE_FOREACH, and MEM_mallocN.

◆ txt_to_buf_for_undo()

char* txt_to_buf_for_undo ( Text text,
size_t *  r_buf_len 
)

Definition at line 1341 of file text.c.

References l, Text::lines, LISTBASE_FOREACH, and MEM_mallocN.

◆ txt_uncomment()

bool txt_uncomment ( Text text)

Definition at line 2149 of file text.c.

References Text::curl, ELEM, NULL, Text::sell, and txt_select_unprefix().

Referenced by text_comment_exec().

◆ txt_unindent()

bool txt_unindent ( Text text)

Variable Documentation

◆ IDType_ID_TXT

IDTypeInfo IDType_ID_TXT
Initial value:
= {
.id_code = ID_TXT,
.id_filter = FILTER_ID_TXT,
.main_listbase_index = INDEX_ID_TXT,
.struct_size = sizeof(Text),
.name = "Text",
.name_plural = "texts",
.translation_context = BLT_I18NCONTEXT_ID_TEXT,
.asset_type_info = NULL,
.copy_data = text_copy_data,
.free_data = text_free_data,
.make_local = NULL,
.foreach_id = NULL,
.foreach_cache = NULL,
.foreach_path = text_foreach_path,
.owner_get = NULL,
.blend_write = text_blend_write,
.blend_read_data = text_blend_read_data,
.blend_read_lib = NULL,
.blend_read_expand = NULL,
.blend_read_undo_preserve = NULL,
.lib_override_apply_post = NULL,
}
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition: BKE_idtype.h:39
@ IDTYPE_FLAGS_NO_ANIMDATA
Definition: BKE_idtype.h:41
#define BLT_I18NCONTEXT_ID_TEXT
@ INDEX_ID_TXT
Definition: DNA_ID.h:1001
#define FILTER_ID_TXT
Definition: DNA_ID.h:923
@ ID_TXT
Definition: DNA_ID_enums.h:62
struct Text Text
static void init_data(ModifierData *md)
static void text_foreach_path(ID *id, BPathForeachPathData *bpath_data)
Definition: text.c:157
static void text_free_data(ID *id)
Definition: text.c:144
static void text_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
Definition: text.c:109
static void text_blend_read_data(BlendDataReader *reader, ID *id)
Definition: text.c:198
static void text_init_data(ID *id)
Definition: text.c:65
static void text_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition: text.c:166

Definition at line 230 of file text.c.

◆ tab_to_spaces

char tab_to_spaces[] = " "
static

Definition at line 1864 of file text.c.

Referenced by txt_convert_tab_to_spaces(), txt_indent(), and txt_unindent().