79 const char tab_columns = 1;
89 const char tab_columns = 1;
97 const TextDrawContext *tdc,
int x,
int y,
const char *c,
const int c_len)
100 const char tab_columns = 1;
109static void txt_format_text(
SpaceText *st)
118 txt_format_line(st, linep, 0);
126 switch (formatchar) {
201 max = st->
runtime->cwidth_px ? (winx -
x) / st->
runtime->cwidth_px : 0;
202 return max > 8 ?
max : 8;
210 int i, j, start, end,
max;
226 linep =
static_cast<TextLine *
>(text->lines.first);
228 while (i > 0 && linep) {
232 if (linep == linein) {
244 (*offl) += lines - 1;
264 if (linep == linein && i < cursin) {
274 if (i + columns - start > max) {
275 end = std::min(end, i);
277 if (chop && linep == linein && i >= cursin) {
280 *offc -= end - start;
287 *offc -= end - start;
293 else if (
ELEM(ch,
' ',
'-')) {
296 if (linep == linein && i >= cursin) {
303 if (linep == linein) {
313 int i, j, start, end, chars,
max;
338 ch = linein->
line[j];
351 if (i + columns - start > max) {
352 end = std::min(end, i);
354 if (chop && i >= cursin) {
357 *offc -= end - start;
364 *offc -= end - start;
370 else if (
ELEM(ch,
' ',
'-')) {
387 if (line[i] ==
'\t') {
397static const char *txt_utf8_forward_columns(
const char *
str,
int columns,
int *
padding)
402 if (columns -
col < 0) {
417static int space_text_draw_wrapped(
const SpaceText *st,
432 int mi, ma, mstart, mend;
433 char fmt_prev = 0xff;
435 const int clip_min_y = -
int(st->
runtime->lheight_px - 1);
453 if (i + columns > end) {
463 mend = txt_utf8_forward_columns(
str + mend, max, &
padding) -
str;
469 for (a = fstart, ma = mstart; ma < mend; a++) {
471 if (fmt_prev !=
format[a]) {
485 mend = txt_utf8_forward_columns(
str + mend, max, &
padding) -
str;
488 if (y <= clip_min_y) {
492 else if (
ELEM(
str[mi],
' ',
'-')) {
499 for (a = fstart, ma = mstart;
str[ma] && y > clip_min_y; a++) {
501 if (fmt_prev !=
format[a]) {
516static void space_text_draw(
const SpaceText *st,
528 const char *in =
nullptr;
544 if (maxwidth &&
w + columns > cshift + maxwidth) {
561 int a, str_shift = 0;
562 char fmt_prev = 0xff;
564 for (a = 0; a < amount; a++) {
565 if (
format[a] != fmt_prev) {
588 int total_lines, nlines;
591 int winx, wordwrap, showlinenrs, tabnumber;
598 int valid_head, valid_tail;
601static void space_text_drawcache_init(
SpaceText *st)
603 DrawCache *drawcache =
static_cast<DrawCache *
>(
604 MEM_callocN(
sizeof(DrawCache),
"text draw cache"));
606 drawcache->winx = -1;
608 drawcache->text_id[0] =
'\0';
610 st->
runtime->drawcache = drawcache;
613static void space_text_update_drawcache(
SpaceText *st,
const ARegion *region)
615 DrawCache *drawcache;
616 bool full_update =
false;
620 if (st->
runtime->drawcache ==
nullptr) {
621 space_text_drawcache_init(st);
626 drawcache =
static_cast<DrawCache *
>(st->
runtime->drawcache);
627 nlines = drawcache->nlines;
632 full_update |= drawcache->winx != region->winx;
634 full_update |= drawcache->wordwrap != st->
wordwrap;
636 full_update |= drawcache->showlinenrs != st->
showlinenrs;
638 full_update |= drawcache->tabnumber != st->
tabnumber;
640 full_update |= drawcache->lheight != st->
runtime->lheight_px;
642 full_update |= drawcache->cwidth_px != st->
runtime->cwidth_px;
648 if (full_update || !drawcache->line_height) {
649 drawcache->valid_head = 0;
650 drawcache->valid_tail = 0;
651 drawcache->update =
true;
654 if (drawcache->update) {
656 int lineno = 0,
size, lines_count;
657 int *fp = drawcache->line_height, *new_tail, *old_tail;
660 size =
sizeof(
int) * nlines;
666 fp =
static_cast<int *
>(
MEM_callocN(size,
"text drawcache line_height"));
669 drawcache->valid_tail = drawcache->valid_head = 0;
670 old_tail = fp + drawcache->nlines - drawcache->valid_tail;
671 new_tail = fp + nlines - drawcache->valid_tail;
672 memmove(new_tail, old_tail, drawcache->valid_tail);
674 drawcache->total_lines = 0;
681 if (drawcache->valid_head) {
682 lines_count = fp[lineno];
683 drawcache->valid_head--;
685 else if (lineno > new_tail - fp) {
686 lines_count = fp[lineno];
692 fp[lineno] = lines_count;
696 drawcache->total_lines += lines_count;
699 drawcache->line_height = fp;
705 if (full_update || drawcache->update) {
713 drawcache->total_lines = nlines;
716 drawcache->nlines = nlines;
719 drawcache->winx = region->winx;
721 drawcache->lheight = st->
runtime->lheight_px;
722 drawcache->cwidth_px = st->
runtime->cwidth_px;
729 drawcache->update =
false;
730 drawcache->valid_head = 0;
731 drawcache->valid_tail = 0;
741 if (st->
runtime->drawcache !=
nullptr) {
742 DrawCache *drawcache =
static_cast<DrawCache *
>(st->
runtime->drawcache);
745 if (drawcache->update) {
755 if (curlno < sellno) {
756 drawcache->valid_head = curlno;
757 drawcache->valid_tail = drawcache->nlines - sellno - 1;
760 drawcache->valid_head = sellno;
761 drawcache->valid_tail = drawcache->nlines - curlno - 1;
767 if (drawcache->valid_head > 0) {
768 drawcache->valid_head--;
770 if (drawcache->valid_tail > 0) {
771 drawcache->valid_tail--;
775 drawcache->valid_head = 0;
776 drawcache->valid_tail = 0;
779 drawcache->update =
true;
785 DrawCache *drawcache =
static_cast<DrawCache *
>(st->
runtime->drawcache);
788 if (drawcache->line_height) {
803static int space_text_get_visible_lines_no(
const SpaceText *st,
int lineno)
805 const DrawCache *drawcache =
static_cast<const DrawCache *
>(st->
runtime->drawcache);
807 return drawcache->line_height[lineno];
812 int i, j, start, end,
max, lines, chars;
833 if (i + columns - start > max) {
835 start = std::min(end, i);
838 else if (
ELEM(ch,
' ',
'-')) {
874 DrawCache *drawcache;
876 space_text_update_drawcache(st, region);
877 drawcache =
static_cast<DrawCache *
>(st->
runtime->drawcache);
879 return drawcache->total_lines;
890 int lhlstart, lhlend, ltexth, sell_off, curl_off;
891 short barheight, barstart, hlstart, hlend, blank_lines;
892 short pix_available, pix_top_margin, pix_bottom_margin, pix_bardiff;
894 pix_top_margin = (0.4 *
U.widget_unit);
895 pix_bottom_margin = (0.4 *
U.widget_unit);
896 pix_available = region->winy - pix_top_margin - pix_bottom_margin;
898 blank_lines = st->
runtime->viewlines / 2;
901 r_back->
xmin = region->winx - (0.6 *
U.widget_unit);
902 r_back->
xmax = region->winx;
904 r_back->
ymax = region->winy;
906 r_scroll->
xmax = region->winx - (0.2 *
U.widget_unit);
907 r_scroll->
xmin = r_scroll->
xmax - (0.4 *
U.widget_unit);
908 r_scroll->
ymin = pix_top_margin;
909 r_scroll->
ymax = pix_available;
913 if (ltexth + blank_lines < st->top + st->
runtime->viewlines) {
914 blank_lines = st->
top + st->
runtime->viewlines - ltexth;
917 ltexth += blank_lines;
919 barheight = (ltexth > 0) ? (st->
runtime->viewlines * pix_available) / ltexth : 0;
921 if (barheight < 20) {
922 pix_bardiff = 20 - barheight;
925 barstart = (ltexth > 0) ? ((pix_available - pix_bardiff) * st->
top) / ltexth : 0;
927 st->
runtime->scroll_region_handle = *r_scroll;
928 st->
runtime->scroll_region_handle.ymax -= barstart;
929 st->
runtime->scroll_region_handle.ymin = st->
runtime->scroll_region_handle.ymax - barheight;
931 CLAMP(st->
runtime->scroll_region_handle.ymin, pix_bottom_margin, region->winy - pix_top_margin);
932 CLAMP(st->
runtime->scroll_region_handle.ymax, pix_bottom_margin, region->winy - pix_top_margin);
934 st->
runtime->scroll_px_per_line = (pix_available > 0) ?
float(ltexth) / pix_available : 0;
935 if (st->
runtime->scroll_px_per_line < 0.1f) {
936 st->
runtime->scroll_px_per_line = 0.1f;
943 lhlstart = std::min(curl_off, sell_off);
944 lhlend = std::max(curl_off, sell_off);
947 hlstart = (lhlstart * pix_available) / ltexth;
948 hlend = (lhlend * pix_available) / ltexth;
951 if (pix_bardiff > 0) {
953 if (st->
runtime->viewlines && lhlstart >= st->
top &&
954 lhlstart <= st->top + st->
runtime->viewlines)
957 hlstart = (((pix_available - pix_bardiff) * lhlstart) / ltexth) +
958 (pix_bardiff * (lhlstart - st->
top) / st->
runtime->viewlines);
960 else if (lhlstart > st->
top + st->
runtime->viewlines && hlstart < barstart + barheight &&
964 hlstart = barstart + barheight;
966 else if (lhlend > st->
top && lhlstart < st->top && hlstart > barstart) {
971 if (hlend <= hlstart) {
976 if (st->
runtime->viewlines && lhlend >= st->
top &&
977 lhlend <= st->top + st->
runtime->viewlines)
980 hlend = (((pix_available - pix_bardiff) * lhlend) / ltexth) +
981 (pix_bardiff * (lhlend - st->
top) / st->
runtime->viewlines);
983 else if (lhlend < st->top && hlend >= barstart - 2 && hlend < barstart + barheight) {
987 else if (lhlend > st->
top + st->
runtime->viewlines &&
988 lhlstart < st->top + st->
runtime->viewlines && hlend < barstart + barheight)
991 hlend = barstart + barheight;
994 if (hlend <= hlstart) {
1004 if (hlend - hlstart < 2) {
1005 hlend = hlstart + 2;
1008 st->
runtime->scroll_region_select = *r_scroll;
1009 st->
runtime->scroll_region_select.ymax = region->winy - pix_top_margin - hlstart;
1010 st->
runtime->scroll_region_select.ymin = region->winy - pix_top_margin - hlend;
1012 CLAMP(st->
runtime->scroll_region_select.ymin, pix_bottom_margin, region->winy - pix_top_margin);
1013 CLAMP(st->
runtime->scroll_region_select.ymax, pix_bottom_margin, region->winy - pix_top_margin);
1016static void draw_textscroll(
const SpaceText *st,
const rcti *scroll,
const rcti *back)
1028 immRecti(
pos, back->xmin, back->ymin, back->xmax, back->ymax);
1033 &st->
runtime->scroll_region_handle,
1043 rect.
xmin = st->
runtime->scroll_region_select.xmin + 1;
1044 rect.
xmax = st->
runtime->scroll_region_select.xmax - 1;
1045 rect.
ymin = st->
runtime->scroll_region_select.ymin;
1046 rect.
ymax = st->
runtime->scroll_region_select.ymax;
1062 SuggItem *item, *first, *last, *sel;
1064 int offl, offc, vcurl, vcurc;
1065 int w, boxw = 0, boxh, i,
x,
y, *
top;
1067 const int margin_x = 2;
1079 if (!first || !last) {
1093 y = region->winy - (vcurl + 1) * lheight - 2;
1103 if (x + boxw > region->winx) {
1104 x = std::max(0, region->winx - boxw);
1111 rect.
xmax = x + boxw;
1112 rect.
ymin = y - boxh;
1122 immRecti(
pos, x - 1, y + 1, x + boxw + 1, y - boxh - 1);
1129 for (i = 0, item = first; i < *top && item->
next; i++, item = item->
next) {
1133 for (i = 0; i <
SUGG_LIST_SIZE && item; i++, item = item->next) {
1134 int len = txt_utf8_forward_columns(item->name,
SUGG_LIST_WIDTH,
nullptr) - item->name;
1148 immRecti(posi, x + margin_x, y - 3, x + margin_x +
w, y + lheight - 3);
1154 space_text_draw(st, tdc,
str, 0, 0, x + margin_x, y - 1,
nullptr);
1171 int vcurl, vcurc, vsell, vselc;
1172 bool hidden =
false;
1186 if (text->curl == text->sell && text->curc == text->selc && !st->
line_hlight && hidden) {
1196 if (text->curl != text->sell || text->curc != text->selc) {
1209 int y = region->winy;
1211 y += st->
runtime->scroll_ofs_px[1];
1214 if (vcurl == vsell) {
1215 y -= vcurl * lheight;
1217 if (vcurc < vselc) {
1219 x + vcurc * st->
runtime->cwidth_px,
1221 x + vselc * st->
runtime->cwidth_px,
1226 x + vselc * st->
runtime->cwidth_px,
1228 x + vcurc * st->
runtime->cwidth_px,
1233 int froml, fromc, tol, toc;
1235 if (vcurl < vsell) {
1248 y -= froml * lheight;
1251 pos, x + fromc * st->
runtime->cwidth_px -
U.pixelsize, y, region->winx, y - lheight);
1254 for (
int i = froml + 1; i < tol; i++) {
1255 immRecti(
pos, x -
U.pixelsize, y, region->winx, y - lheight);
1259 if (x + toc * st->
runtime->cwidth_px > x) {
1276 y1 = region->winy - (vsell - offl) * lheight;
1278 y1 += st->
runtime->scroll_ofs_px[1];
1280 y2 = y1 - (lheight * visible_lines);
1283 y1 = region->winy - vsell * lheight;
1285 y1 += st->
runtime->scroll_ofs_px[1];
1287 y2 = y1 - (lheight);
1290 if (!(y1 < 0 || y2 > region->winy)) {
1291 float highlight_color[4];
1293 highlight_color[3] = 0.1f;
1304 int y = region->winy - vsell * lheight;
1306 y += st->
runtime->scroll_ofs_px[1];
1312 char ch = text->sell->line[text->selc];
1321 pos, x, y - lheight -
U.pixelsize, x +
w +
U.pixelsize, y - lheight - (3 *
U.pixelsize));
1324 immRecti(
pos, x -
U.pixelsize, y, x +
U.pixelsize, y - lheight);
1341 int b, fc, find, stack, viewc, viewl, offl, offc,
x,
y;
1342 int startc, endc, c;
1351 startl = text->curl;
1352 startc = text->curc;
1354 if (
b == 0 && startc > 0) {
1381 while (c < linep->
len) {
1394 else if (
b == -find) {
1404 linep = linep->
next;
1429 else if (
b == -find) {
1441 linep = linep->
prev;
1444 fc = strlen(linep->
format) - 1;
1459 if (!endl || endc == -1) {
1465 y = region->winy - st->
runtime->lheight_px;
1467 y += st->
runtime->scroll_ofs_px[1];
1471 ch = startl->
line[startc];
1485 ch = endl->line[endc];
1513 int i,
x,
y, winx, linecount = 0, lineno = 0;
1514 int wraplinecount = 0, wrap_skip = 0;
1515 int margin_column_x;
1526 const int clip_min_y = -
int(st->
runtime->lheight_px - 1);
1534 space_text_update_drawcache(st, region);
1537 if (!text->curl || !text->sell || !text->lines.first || !text->lines.last) {
1542 calc_text_rcts(st, region, &scroll, &back);
1546 tmp =
static_cast<TextLine *
>(text->lines.first);
1548 for (i = 0; i < st->
top && tmp; i++) {
1554 int lines = space_text_get_visible_lines_no(st, lineno);
1556 if (wraplinecount + lines > st->
top) {
1557 wrap_skip = st->
top - wraplinecount;
1561 wraplinecount += lines;
1588 st->
runtime->line_number_display_digits = 0;
1592 y = region->winy - st->
runtime->lheight_px;
1593 int viewlines = st->
runtime->viewlines;
1595 y += st->
runtime->scroll_ofs_px[1];
1602 draw_text_decoration(st, region);
1607 for (i = 0; y > clip_min_y && i < viewlines && tmp; i++, tmp = tmp->
next) {
1615 SNPRINTF(linenr,
"%*d", st->
runtime->line_number_display_digits, i + linecount + 1);
1623 int lines = space_text_draw_wrapped(
1624 st, &tdc, tmp->line, x, y, winx - x, tmp->format, wrap_skip);
1630 st, &tdc, tmp->line, st->
left, region->winx / st->
runtime->cwidth_px, x, y, tmp->format);
1639 if (margin_column_x >= x) {
1643 float margin_color[4];
1645 margin_color[3] = 0.2f;
1648 immRecti(
pos, margin_column_x, 0, margin_column_x +
U.pixelsize, region->winy);
1655 draw_brackets(st, &tdc, region);
1656 draw_textscroll(st, &scroll, &back);
1658 draw_suggestion_list(st, &tdc, region);
1701 int i,
x, winx = region->winx;
1727 else if (st->
top > i) {
1742 st->
left += (x - winx / 2) / st->
runtime->cwidth_px;
1747 st->
left += ((x + 1) / st->
runtime->cwidth_px) - 1;
1749 else if (x > winx) {
1750 st->
left += ((x - (winx + 1)) / st->
runtime->cwidth_px) + 1;
1762 st->
runtime->scroll_ofs_px[0] = 0;
1763 st->
runtime->scroll_ofs_px[1] = 0;
1791 const int cursor_co[2],
1806 if (char_ofs < 0 || char_ofs > line->len) {
1819 r_pixel_co[0] = (char_pos + offc - st->
left) * st->
runtime->cwidth_px + linenr_offset;
1820 r_pixel_co[1] = (region->winy - ((cursor_co[0] + offl - st->
top) * lheight)) - lheight;
SpaceText * CTX_wm_space_text(const bContext *C)
bScreen * CTX_wm_screen(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
ScrArea * BKE_screen_find_big_area(const bScreen *screen, int spacetype, short min)
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
void txt_clean_text(struct Text *text)
int text_check_bracket(char ch)
int txt_get_span(const struct TextLine *from, const struct TextLine *to)
int text_find_identifier_start(const char *str, int i)
short texttool_text_is_active(struct Text *text)
int * texttool_suggest_top(void)
SuggItem * texttool_suggest_first(void)
SuggItem * texttool_suggest_last(void)
SuggItem * texttool_suggest_selected(void)
void BLF_size(int fontid, float size)
float BLF_fixed_width(int fontid) ATTR_WARN_UNUSED_RESULT
#define BLF_DRAW_STR_DUMMY_MAX
void BLF_position(int fontid, float x, float y, float z)
int BLF_draw_mono(int fontid, const char *str, size_t str_len, int cwidth, int tab_columns) ATTR_NONNULL(2)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
MINLINE int integer_digits_i(int i)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
int BLI_str_utf8_offset_from_index(const char *str, size_t str_len, int index_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_str_utf8_char_width_safe(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t size_t BLI_strnlen_utf8(const char *strc, size_t strc_maxlen) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
int BLI_str_utf8_size_safe(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t size_t size_t int BLI_str_utf8_offset_to_index(const char *str, size_t str_len, int offset_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
const char * BLI_str_find_prev_char_utf8(const char *p, const char *str_start) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1
int BLI_str_utf8_offset_to_column(const char *str, size_t str_len, int offset_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define STREQLEN(a, b, n)
bool ED_text_activate_in_screen(bContext *C, Text *text)
void ED_space_text_scroll_to_cursor(SpaceText *st, ARegion *region, bool center)
bool ED_space_text_region_location_from_cursor(const SpaceText *st, const ARegion *region, const int cursor_co[2], int r_pixel_co[2])
bool ED_text_is_syntax_highlight_supported(Text *text)
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
void ui_draw_dropshadow(const rctf *rct, float radius, float width, float aspect, float alpha)
void UI_draw_roundbox_corner_set(int type)
void UI_draw_widget_scroll(uiWidgetColors *wcol, const rcti *rect, const rcti *slider, int state)
void UI_draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float color[4])
void UI_GetThemeColor3fv(int colorid, float col[3])
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_FontThemeColor(int fontid, int colorid)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
local_group_size(16, 16) .push_constant(Type b
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static void update(bNodeTree *ntree)
float wrap(float value, float max, float min)
SpaceText_Runtime * runtime
void(* format_line)(SpaceText *st, TextLine *line, bool do_next)
uiWidgetColors wcol_scroll
void text_pop_suggest_list()
static int text_font_draw(const TextDrawContext *tdc, int x, int y, const char *str)
int ED_space_text_visible_lines_get(const SpaceText *st)
static int text_font_draw_character(const TextDrawContext *tdc, int x, int y, char c)
static void space_text_draw_context_init(const SpaceText *st, TextDrawContext *tdc)
static int text_font_draw_character_utf8(const TextDrawContext *tdc, int x, int y, const char *c, const int c_len)
static void text_font_end(const TextDrawContext *)
static void text_font_begin(const TextDrawContext *tdc)
static void format_draw_color(const TextDrawContext *tdc, char formatchar)
int flatten_string(const SpaceText *st, FlattenString *fs, const char *in)
void flatten_string_free(FlattenString *fs)
TextFormatType * ED_text_format_get(Text *text)
void space_text_drawcache_tag_update(SpaceText *st, bool full)
int space_text_wrap_width(const SpaceText *st, const ARegion *region)
#define TXT_LINE_SPACING(st)
void space_text_free_caches(SpaceText *st)
#define TXT_LINE_HEIGHT(st)
void draw_text_main(SpaceText *st, ARegion *region)
#define TXT_NUMCOL_WIDTH(st)
void space_text_update_cursor_moved(bContext *C)
void space_text_wrap_offset(const SpaceText *st, const ARegion *region, TextLine *linein, int cursin, int *offl, int *offc)
void space_text_update_character_width(SpaceText *st)
int space_text_get_visible_lines(const SpaceText *st, const ARegion *region, const char *str)
void space_text_wrap_offset_in_line(const SpaceText *st, const ARegion *region, TextLine *linein, int cursin, int *offl, int *offc)
void space_text_scroll_to_cursor_with_area(SpaceText *st, ScrArea *area, bool center)
int space_text_get_span_wrap(const SpaceText *st, const ARegion *region, const TextLine *from, const TextLine *to)
#define TXT_BODY_LEFT(st)
int space_text_get_total_lines(SpaceText *st, const ARegion *region)
int space_text_get_char_pos(const SpaceText *st, const char *line, int cur)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)