|
Blender V5.0
|
#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_get().
Referenced by text_comment_exec().
| TextFormatType * ED_text_format_get | ( | Text * | text | ) |
Definition at line 176 of file text_format.cc.
References BLI_strcasecmp(), Text::id, LISTBASE_FOREACH, ID::name, and tft_lb.
Referenced by draw_text_main(), ED_text_format_comment_line_prefix(), and text_autocomplete_build().
| void ED_text_format_register | ( | TextFormatType * | tft | ) |
Definition at line 171 of file text_format.cc.
References BLI_addtail(), and tft_lb.
Referenced by 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(), Text::id, LISTBASE_FOREACH, ID::name, and tft_lb.
Referenced by 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_append(), i, in, FlattenString::len, len, and SpaceText::tabnumber.
Referenced by 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, i, FlattenString::len, len, MEM_calloc_arrayN(), MEM_freeN(), and FlattenString::pos.
Referenced by flatten_string().
| void flatten_string_free | ( | FlattenString * | fs | ) |
Definition at line 93 of file text_format.cc.
References FlattenString::accum, FlattenString::buf, FlattenString::fixedaccum, FlattenString::fixedbuf, and MEM_freeN().
Referenced by 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, len, FlattenString::pos, and str.
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(), and MEM_malloc_arrayN().
Referenced by 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, size(), and str.
Referenced by 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, and str.
Referenced by 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.
Referenced by 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(), and blender::Span< T >::end().
Referenced by 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().
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().