Blender
V3.3
|
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_string_utils.h"
#include "DNA_space_types.h"
#include "DNA_text_types.h"
#include "ED_text.h"
#include "text_format.h"
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) |
bool | ED_text_is_syntax_highlight_supported (Text *text) |
Variables | |
static ListBase | tft_lb = {NULL, NULL} |
TextFormatType* ED_text_format_get | ( | Text * | text | ) |
Definition at line 172 of file text_format.c.
References BLI_strcasecmp(), TextFormatType::ext, ListBase::first, Text::id, ID::name, TextFormatType::next, and tft_lb.
Referenced by text_autocomplete_build().
void ED_text_format_register | ( | TextFormatType * | tft | ) |
Definition at line 167 of file text_format.c.
References BLI_addtail(), and tft_lb.
Referenced by ED_text_format_register_lua(), 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 202 of file text_format.c.
References BLI_path_extension(), BLI_strcasecmp(), BLI_string_is_decimal(), TextFormatType::ext, ListBase::first, Text::id, ID::name, TextFormatType::next, NULL, and tft_lb.
Referenced by text_draw_context_init().
int flatten_string | ( | const SpaceText * | st, |
FlattenString * | fs, | ||
const char * | in | ||
) |
Definition at line 56 of file text_format.c.
References FlattenString::accum, BLI_str_utf8_size_safe(), FlattenString::buf, FlattenString::fixedaccum, FlattenString::fixedbuf, flatten_string_append(), len, FlattenString::len, r, and usdtokens::st().
Referenced by text_convert_whitespace_exec(), txtfmt_lua_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
|
static |
Definition at line 24 of file text_format.c.
References FlattenString::accum, FlattenString::buf, Freestyle::c, FlattenString::fixedbuf, len, FlattenString::len, MEM_callocN, MEM_freeN, and FlattenString::pos.
Referenced by flatten_string().
void flatten_string_free | ( | FlattenString * | fs | ) |
Definition at line 89 of file text_format.c.
References FlattenString::accum, FlattenString::buf, FlattenString::fixedaccum, FlattenString::fixedbuf, and MEM_freeN.
Referenced by text_convert_whitespace_exec(), txtfmt_lua_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 99 of file text_format.c.
References BLI_assert, FlattenString::buf, len, FlattenString::pos, and str.
int text_check_format_len | ( | TextLine * | line, |
unsigned int | len | ||
) |
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 106 of file text_format.c.
References TextLine::format, len, MEM_freeN, and MEM_mallocN.
Referenced by txtfmt_lua_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 127 of file text_format.c.
References BLI_assert, BLI_str_utf8_size_safe(), len, size(), str, and type.
Referenced by txtfmt_lua_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 149 of file text_format.c.
References BLI_assert, len, str, and type.
Referenced by txtfmt_lua_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
Definition at line 166 of file text_format.c.
Referenced by ED_text_format_get(), ED_text_format_register(), and ED_text_is_syntax_highlight_supported().