|
Blender V4.5
|
#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_listbase.h"#include "BLI_path_utils.hh"#include "BLI_string.h"#include "BLI_string_utf8.h"#include "BLI_string_utils.hh"#include "DNA_space_types.h"#include "DNA_text_types.h"#include "ED_text.hh"#include "text_format.hh"Go to the source code of this file.
Functions | |
| static void | flatten_string_append (FlattenString *fs, const char *c, int accum, int len) |
| int | flatten_string (const SpaceText *st, FlattenString *fs, const char *in) |
| void | flatten_string_free (FlattenString *fs) |
| int | flatten_string_strlen (FlattenString *fs, const char *str) |
| int | text_check_format_len (TextLine *line, uint len) |
| void | text_format_fill (const char **str_p, char **fmt_p, const char type, const int len) |
| void | text_format_fill_ascii (const char **str_p, char **fmt_p, const char type, const int len) |
| void | ED_text_format_register (TextFormatType *tft) |
| TextFormatType * | ED_text_format_get (Text *text) |
| const char * | ED_text_format_comment_line_prefix (Text *text) |
| bool | ED_text_is_syntax_highlight_supported (Text *text) |
| int | text_format_string_literal_find (const Span< const char * > string_literals, const char *text) |
| bool | text_format_string_literals_check_sorted_array (const Span< const char * > string_literals) |
Variables | |
| static ListBase | tft_lb = {nullptr, nullptr} |
| const char * ED_text_format_comment_line_prefix | ( | Text * | text | ) |
Definition at line 204 of file text_format.cc.
References ED_text_format_comment_line_prefix(), and ED_text_format_get().
Referenced by ED_text_format_comment_line_prefix(), and text_comment_exec().
| TextFormatType * ED_text_format_get | ( | Text * | text | ) |
Definition at line 176 of file text_format.cc.
References BLI_strcasecmp(), ED_text_format_get(), ListBase::first, Text::id, LISTBASE_FOREACH, ID::name, and tft_lb.
Referenced by draw_text_main(), ED_text_format_comment_line_prefix(), ED_text_format_get(), and text_autocomplete_build().
| void ED_text_format_register | ( | TextFormatType * | tft | ) |
Definition at line 171 of file text_format.cc.
References BLI_addtail(), ED_text_format_register(), and tft_lb.
Referenced by ED_text_format_register(), ED_text_format_register_glsl(), ED_text_format_register_osl(), ED_text_format_register_pov(), ED_text_format_register_pov_ini(), and ED_text_format_register_py().
| bool ED_text_is_syntax_highlight_supported | ( | Text * | text | ) |
Definition at line 210 of file text_format.cc.
References BLI_path_extension(), BLI_strcasecmp(), BLI_string_is_decimal(), ED_text_is_syntax_highlight_supported(), Text::id, LISTBASE_FOREACH, ID::name, and tft_lb.
Referenced by ED_text_is_syntax_highlight_supported(), and space_text_draw_context_init().
| int flatten_string | ( | const SpaceText * | st, |
| FlattenString * | fs, | ||
| const char * | in ) |
Definition at line 60 of file text_format.cc.
References FlattenString::accum, BLI_str_utf8_size_safe(), FlattenString::buf, FlattenString::fixedaccum, FlattenString::fixedbuf, flatten_string(), flatten_string_append(), i, in, FlattenString::len, len(), and SpaceText::tabnumber.
Referenced by flatten_string(), space_text_draw(), space_text_draw_wrapped(), text_convert_whitespace_exec(), txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
|
static |
Definition at line 28 of file text_format.cc.
References FlattenString::accum, FlattenString::buf, FlattenString::fixedbuf, flatten_string_append(), i, FlattenString::len, len(), MEM_calloc_arrayN(), MEM_freeN(), and FlattenString::pos.
Referenced by flatten_string(), and flatten_string_append().
| void flatten_string_free | ( | FlattenString * | fs | ) |
Definition at line 93 of file text_format.cc.
References FlattenString::accum, FlattenString::buf, FlattenString::fixedaccum, FlattenString::fixedbuf, flatten_string_free(), and MEM_freeN().
Referenced by flatten_string_free(), space_text_draw(), space_text_draw_wrapped(), text_convert_whitespace_exec(), txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
| int flatten_string_strlen | ( | FlattenString * | fs, |
| const char * | str ) |
Takes a string within fs->buf and returns its length.
Definition at line 103 of file text_format.cc.
References BLI_assert, FlattenString::buf, flatten_string_strlen(), len(), FlattenString::pos, and str.
Referenced by flatten_string_strlen().
Ensures the format string for the given line is long enough, reallocating as needed. Allocation is done here, alone, to ensure consistency.
Definition at line 110 of file text_format.cc.
References TextLine::format, len(), MEM_freeN(), MEM_malloc_arrayN(), and text_check_format_len().
Referenced by text_check_format_len(), txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
| void text_format_fill | ( | const char ** | str_p, |
| char ** | fmt_p, | ||
| char | type, | ||
| int | len ) |
Fill the string with formatting constant, advancing str_p and fmt_p
| len | length in bytes of fmt_p to fill. |
Definition at line 131 of file text_format.cc.
References BLI_assert, BLI_str_utf8_size_safe(), i, len(), str, and text_format_fill().
Referenced by text_format_fill(), txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
| void text_format_fill_ascii | ( | const char ** | str_p, |
| char ** | fmt_p, | ||
| char | type, | ||
| int | len ) |
ASCII version of text_format_fill, use when we no the text being stepped over is ASCII (as is the case for most keywords)
Definition at line 153 of file text_format.cc.
References BLI_assert, len(), str, and text_format_fill_ascii().
Referenced by text_format_fill_ascii(), txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
| int text_format_string_literal_find | ( | const Span< const char * > | string_literals, |
| const char * | text ) |
Definition at line 243 of file text_format.cc.
References text_format_string_literal_find().
Referenced by text_format_string_literal_find(), text_format_string_literal_find(), txtfmt_glsl_find_builtinfunc(), txtfmt_glsl_find_reserved(), txtfmt_glsl_find_specialvar(), txtfmt_ini_find_bool(), txtfmt_ini_find_keyword(), txtfmt_ini_find_reserved(), txtfmt_osl_find_builtinfunc(), txtfmt_osl_find_reserved(), txtfmt_osl_find_specialvar(), txtfmt_pov_find_bool(), txtfmt_pov_find_keyword(), txtfmt_pov_find_reserved_builtins(), txtfmt_pov_find_reserved_keywords(), txtfmt_pov_find_specialvar(), txtfmt_py_find_bool(), txtfmt_py_find_builtinfunc(), and txtfmt_py_find_specialvar().
| bool text_format_string_literals_check_sorted_array | ( | const Span< const char * > | string_literals | ) |
Definition at line 263 of file text_format.cc.
References b, blender::Span< T >::begin(), blender::Span< T >::end(), and text_format_string_literals_check_sorted_array().
Referenced by ED_text_format_register_glsl(), ED_text_format_register_osl(), ED_text_format_register_pov(), ED_text_format_register_pov_ini(), ED_text_format_register_py(), text_format_string_literals_check_sorted_array(), and text_format_string_literals_check_sorted_array().
Definition at line 170 of file text_format.cc.
Referenced by ED_text_format_get(), ED_text_format_register(), and ED_text_is_syntax_highlight_supported().