67 else if (!
ELEM(
c,
'\t',
' ')) {
68 *r_last_state =
false;
105 bool line_start =
true;
108 for (
int in_offset = 0; in_buf[in_offset]; in_offset++) {
112 if (in_buf[in_offset] ==
'\t' && line_start) {
118 const int out_size = strlen(in_buf) + num_tabs * (tab_size - 1) + 1;
119 char *out_buf =
MEM_mallocN(out_size *
sizeof(
char), __func__);
122 int spaces_until_tab = 0;
126 for (
int in_offset = 0; in_buf[in_offset]; in_offset++) {
130 if (in_buf[in_offset] ==
'\t' && line_start) {
132 int num_spaces = tab_size - (spaces_until_tab % tab_size);
133 spaces_until_tab = 0;
136 memset(&out_buf[out_offset],
' ', num_spaces);
137 out_offset += num_spaces;
140 if (in_buf[in_offset] ==
' ') {
143 else if (in_buf[in_offset] ==
'\n') {
144 spaces_until_tab = 0;
147 out_buf[out_offset++] = in_buf[in_offset];
151 out_buf[out_offset] =
'\0';
152 *r_out_buf_len = out_offset;
159 return (
x + (
st->runtime.cwidth_px / 2)) /
st->runtime.cwidth_px;
290 st->runtime.scroll_ofs_px[0] = 0;
291 st->runtime.scroll_ofs_px[1] = 0;
371 st->runtime.scroll_ofs_px[0] = 0;
372 st->runtime.scroll_ofs_px[1] = 0;
425 ot->
srna,
"internal", 0,
"Make Internal",
"Make text file internal after loading");
441 const int orig_top =
st->top;
443 const int orig_curc = text->
curc;
484 ot->
description =
"Reload active text data-block from its file";
569 ot->
name =
"Make Internal";
570 ot->
idname =
"TEXT_OT_make_internal";
600 reports,
RPT_ERROR,
"Cannot save text file, path \"%s\" is not writable", filepath);
608 "Unable to save '%s': %s",
610 errno ? strerror(errno) :
TIP_(
"unknown error writing file"));
615 fputs(tmp->
line, fp);
633 "Unable to stat '%s': %s",
635 errno ? strerror(errno) :
TIP_(
"unknown error stating file"));
769 const bool is_live = (reports ==
NULL);
772 void *curl_prev = text->
curl;
773 int curc_prev = text->
curc;
787 if (text->
curl != curl_prev || curc_prev != text->
curc) {
856 if (
data->text == text) {
867 if (
data->text == text) {
887 ot->
name =
"Refresh PyConstraints";
888 ot->
idname =
"TEXT_OT_refresh_pyconstraints";
961 "Paste text selected elsewhere rather than copied (X11 only)");
991 ot->
name =
"Duplicate Line";
992 ot->
idname =
"TEXT_OT_duplicate_line";
1099 bool text_before_cursor = text->
curc != 0 && !
ELEM(line->
line[text->
curc - 1],
' ',
'\t');
1100 if (text_before_cursor && (
txt_has_sel(text) ==
false)) {
1112 ot->
name =
"Indent or Autocomplete";
1113 ot->
idname =
"TEXT_OT_indent_or_autocomplete";
1229 for (
a = 0;
a < curts;
a++) {
1310 {0,
"TOGGLE", 0,
"Toggle Comments",
NULL},
1311 {1,
"COMMENT", 0,
"Comment",
NULL},
1312 {-1,
"UNCOMMENT", 0,
"Un-Comment",
NULL},
1317 ot->
name =
"Toggle Comments";
1318 ot->
idname =
"TEXT_OT_comment_toggle";
1329 prop =
RNA_def_enum(
ot->
srna,
"type", comment_items, 0,
"Type",
"Add or remove comments");
1352 size_t a, j, max_len = 0;
1372 tmp->
line = new_line;
1373 tmp->
len = strlen(new_line);
1375 if (tmp->
len > max_len) {
1381 char *tmp_line =
MEM_mallocN(
sizeof(*tmp_line) * (max_len + 1), __func__);
1384 const char *text_check_line = tmp->
line;
1385 const int text_check_line_len = tmp->
len;
1386 char *tmp_line_cur = tmp_line;
1387 const size_t tab_len =
st->tabnumber;
1391 for (
a = 0;
a < text_check_line_len;) {
1393 if (!(
a % tab_len) && (text_check_line[
a] ==
' ')) {
1396 (j < tab_len) && (
a + j < text_check_line_len) && (text_check_line[
a + j] ==
' ');
1403 if ((tmp_line_cur == tmp_line) &&
a != 0) {
1405 memcpy(tmp_line_cur, text_check_line,
a);
1408 *tmp_line_cur =
'\t';
1413 if (tmp_line_cur != tmp_line) {
1414 memcpy(tmp_line_cur, &text_check_line[
a], j);
1422 if (tmp_line_cur != tmp_line) {
1423 memcpy(tmp_line_cur, &text_check_line[
a],
len);
1424 tmp_line_cur +=
len;
1430 if (tmp_line_cur != tmp_line) {
1431 *tmp_line_cur =
'\0';
1434 BLI_assert(tmp_line_cur - tmp_line <= max_len);
1449 tmp->
len = strlen(tmp_line);
1468 ot->
name =
"Convert Whitespace";
1469 ot->
idname =
"TEXT_OT_convert_whitespace";
1485 "Type of whitespace to convert to");
1539 ot->
name =
"Select Line";
1540 ot->
idname =
"TEXT_OT_select_line";
1558 const bool use_init_step =
false;
1572 ot->
name =
"Select Word";
1573 ot->
idname =
"TEXT_OT_select_word";
1618 ot->
description =
"Move the currently selected line(s) up/down";
1638 {
LINE_BEGIN,
"LINE_BEGIN", 0,
"Line Begin",
""},
1639 {
LINE_END,
"LINE_END", 0,
"Line End",
""},
1640 {
FILE_TOP,
"FILE_TOP", 0,
"File Top",
""},
1641 {
FILE_BOTTOM,
"FILE_BOTTOM", 0,
"File Bottom",
""},
1642 {
PREV_CHAR,
"PREVIOUS_CHARACTER", 0,
"Previous Character",
""},
1643 {
NEXT_CHAR,
"NEXT_CHARACTER", 0,
"Next Character",
""},
1644 {
PREV_WORD,
"PREVIOUS_WORD", 0,
"Previous Word",
""},
1645 {
NEXT_WORD,
"NEXT_WORD", 0,
"Next Word",
""},
1646 {
PREV_LINE,
"PREVIOUS_LINE", 0,
"Previous Line",
""},
1647 {
NEXT_LINE,
"NEXT_LINE", 0,
"Next Line",
""},
1648 {
PREV_PAGE,
"PREVIOUS_PAGE", 0,
"Previous Page",
""},
1649 {
NEXT_PAGE,
"NEXT_PAGE", 0,
"Next Page",
""},
1657 int i, j, start, end,
max, chop, curs, loop, endj, found, selc;
1662 selc = start = endj = curs = found = 0;
1671 ch = linein->
line[j];
1673 chars =
st->tabnumber - i %
st->tabnumber;
1681 if (rell == 0 && i - start <= relc && i + columns - start > relc) {
1687 else if (i - end <= relc && i + columns - end > relc) {
1690 if (i + columns - start >
max) {
1696 if (selc > endj && !chop) {
1712 if (rell == 0 && i + columns - start > relc) {
1718 else if (ch ==
'\0') {
1725 else if (
ELEM(ch,
' ',
'-')) {
1731 if (rell == 0 && i + columns - start > relc) {
1750 int offl, offc, visible_lines;
1760 if (*rell - visible_lines + offl >= 0) {
1761 if (!(*linep)->next) {
1762 if (offl < visible_lines - 1) {
1763 *rell = visible_lines - 1;
1767 *charp = (*linep)->len;
1771 *rell -= visible_lines - offl;
1772 *linep = (*linep)->
next;
1780 if (*rell + offl <= 0) {
1781 if (!(*linep)->prev) {
1792 *linep = (*linep)->
prev;
1805 if (*rell + visible_lines >= 0) {
1806 *rell += visible_lines;
1810 if (!(*linep)->prev) {
1815 *rell += visible_lines;
1816 *linep = (*linep)->
prev;
1819 if (*rell - visible_lines < 0) {
1823 if (!(*linep)->next) {
1824 *rell = visible_lines - 1;
1828 *rell -= visible_lines;
1829 *linep = (*linep)->
next;
1841 int oldc, i, j,
max, start, end, endj, chop, loop;
1847 linep = &text->
sell;
1848 charp = &text->
selc;
1851 linep = &text->
curl;
1852 charp = &text->
curc;
1869 ch = (*linep)->line[j];
1871 chars =
st->tabnumber - i %
st->tabnumber;
1879 if (i + columns - start >
max) {
1900 else if (
ELEM(ch,
' ',
'-',
'\0')) {
1925 int oldc, i, j,
max, start, end, endj, chop, loop;
1931 linep = &text->
sell;
1932 charp = &text->
selc;
1935 linep = &text->
curl;
1936 charp = &text->
curc;
1953 ch = (*linep)->line[j];
1955 chars =
st->tabnumber - i %
st->tabnumber;
1963 if (i + columns - start >
max) {
1972 *charp = (*linep)->len;
1985 else if (ch ==
'\0') {
1986 *charp = (*linep)->len;
1990 else if (
ELEM(ch,
' ',
'-')) {
2009 int offl, offc,
col;
2014 linep = &text->
sell;
2015 charp = &text->
selc;
2018 linep = &text->
curl;
2019 charp = &text->
curc;
2028 if ((*linep)->prev) {
2031 *linep = (*linep)->
prev;
2050 int offl, offc,
col, visible_lines;
2055 linep = &text->
sell;
2056 charp = &text->
selc;
2059 linep = &text->
curl;
2060 charp = &text->
curc;
2066 if (offl < visible_lines - 1) {
2070 if ((*linep)->next) {
2071 *linep = (*linep)->
next;
2075 *charp = (*linep)->len;
2096 linep = &text->
sell;
2097 charp = &text->
selc;
2100 linep = &text->
curl;
2101 charp = &text->
curc;
2104 if (
st && region &&
st->wordwrap) {
2113 while (lines > 0 && (*linep)->next) {
2114 *linep = (*linep)->
next;
2117 while (lines < 0 && (*linep)->prev) {
2118 *linep = (*linep)->
prev;
2123 if (*charp > (*linep)->len) {
2124 *charp = (*linep)->
len;
2148 if (
st &&
st->wordwrap && region) {
2160 if (
st &&
st->wordwrap && region) {
2211 if (
st &&
st->wordwrap && region) {
2220 if (
st &&
st->wordwrap && region) {
2263 ot->
name =
"Move Cursor";
2291 ot->
name =
"Move Select";
2292 ot->
idname =
"TEXT_OT_move_select";
2305 "Where to move cursor to, to make a selection");
2323 else if (line > nlines) {
2356 prop =
RNA_def_int(
ot->
srna,
"line", 1, 1, INT_MAX,
"Line",
"Line number to jump to", 1, 10000);
2368 {
DEL_PREV_CHAR,
"PREVIOUS_CHARACTER", 0,
"Previous Character",
""},
2416 if (*curr !=
'\0') {
2418 if ((curr !=
prev) &&
2456 if (
st->live_edit) {
2484 "Which part of the text to delete");
2498 st->overwrite = !
st->overwrite;
2508 ot->
name =
"Toggle Overwrite";
2509 ot->
idname =
"TEXT_OT_overwrite_toggle";
2531 last = last - (
st->runtime.viewlines / 2);
2532 if (last > 0 &&
st->top > last) {
2614 const int mval[2] = {
event->xy[0],
event->xy[1]};
2639 for (
int i = 0; i < 2; i += 1) {
2648 int scroll_ofs_new[2] = {
2652 int scroll_ofs_px_new[2] = {
2657 for (
int i = 0; i < 2; i += 1) {
2659 while (scroll_ofs_px_new[i] < 0) {
2661 scroll_ofs_new[i] -= 1;
2665 if (scroll_ofs_new[i] < 0) {
2666 scroll_ofs_new[i] = 0;
2667 scroll_ofs_px_new[i] = 0;
2671 scroll_ofs_px_new[i] = 0;
2677 scroll_ofs_new[0] = 0;
2678 scroll_ofs_px_new[0] = 0;
2682 if (scroll_ofs_new[0] !=
st->left || scroll_ofs_new[1] !=
st->top ||
2685 scroll_ofs_px_new[1] !=
st->runtime.scroll_ofs_px[1]) {
2687 st->left = scroll_ofs_new[0];
2688 st->top = scroll_ofs_new[1];
2689 st->runtime.scroll_ofs_px[0] = scroll_ofs_px_new[0];
2690 st->runtime.scroll_ofs_px[1] = scroll_ofs_px_new[1];
2709 st->runtime.scroll_ofs_px[0] = 0;
2710 st->runtime.scroll_ofs_px[1] = 0;
2722 switch (event->
type) {
2735 st->runtime.viewlines *
2779 tsc->
mval_delta[0] = (
event->xy[0] -
event->prev_xy[0]) *
st->runtime.cwidth_px / 4;
2813 ot->
srna,
"lines", 1, INT_MIN, INT_MAX,
"Lines",
"Number of lines to scroll", -100, 100);
2845 const int *mval =
event->mval;
2853 if (mval[0] >
st->runtime.scroll_region_handle.xmin &&
2854 mval[0] <
st->runtime.scroll_region_handle.xmax) {
2855 if (mval[1] >=
st->runtime.scroll_region_handle.ymin &&
2856 mval[1] <=
st->runtime.scroll_region_handle.ymax) {
2861 if (mval[1] <
st->runtime.scroll_region_handle.ymin) {
2918 ot->
srna,
"lines", 1, INT_MIN, INT_MAX,
"Lines",
"Number of lines to scroll", -100, 100);
2938 if (
str[i] ==
'\t') {
2939 total +=
st->tabnumber - total %
st->tabnumber;
2951 int i = 0, j = 0,
col;
2953 while (*(
str + j)) {
2954 if (
str[j] ==
'\t') {
2955 col =
st->tabnumber - i %
st->tabnumber;
2961 if (i +
col > index) {
2977 if (*y < -st->
top) {
2981 for (i = -
st->top; i <= *y && linep; linep = linep->
next, i += lines) {
2984 if (i + lines > *
y) {
3006 int i = 0, start = 0, end =
max;
3007 int j, curs = 0, endj = 0;
3011 for (j = 0; !found && ((ch = linep->
line[j]) !=
'\0');
3018 chars =
st->tabnumber - i %
st->tabnumber;
3034 if (
y == 0 && i - start <= x && i + columns - start >
x) {
3041 else if (i - end <= x && i + columns - end >
x) {
3044 if (i + columns - start >
max) {
3050 if (charp > endj && !chop && ch !=
'\0') {
3062 if (j < linep->
len) {
3067 if (
y == 0 && i + columns - start >
x) {
3073 else if (
ELEM(ch,
' ',
'-',
'\0')) {
3078 if (
y == 0 && i + columns - start >
x) {
3099 linep =
st->text->lines.first;
3103 linep =
st->text->lines.last;
3140 linep = &text->
sell;
3141 charp = &text->
selc;
3144 linep = &text->
curl;
3145 charp = &text->
curc;
3152 if ((*linep)->next) {
3153 *linep = (*linep)->
next;
3159 if ((*linep)->prev) {
3160 *linep = (*linep)->
prev;
3170 *charp = (*linep)->len;
3205 if (event->
mval[1] < 0 || event->
mval[1] > region->
winy) {
3214 else if (!
st->wordwrap && (event->
mval[0] < 0 || event->
mval[0] > region->
winx)) {
3263 if (event->
mval[0] >=
st->runtime.scroll_region_handle.xmin) {
3274 ssel->
selc =
st->text->selc;
3285 switch (event->
type) {
3308 ot->
name =
"Set Selection";
3309 ot->
idname =
"TEXT_OT_selection_set";
3344 if (event->
mval[0] >=
st->runtime.scroll_region_handle.xmin) {
3382 const int *mval =
event->mval;
3384 static int jump_to = 0;
3385 static double last_jump = 0;
3389 if (!
st->showlinenrs) {
3393 if (!(mval[0] > 2 &&
3395 mval[1] > 2 && mval[1] < region->
winy - 2)) {
3400 if (!(event_ascii >=
'0' && event_ascii <=
'9')) {
3405 if (last_jump <
time - 1) {
3410 jump_to += (int)(event_ascii -
'0');
3424 ot->
name =
"Line Number";
3425 ot->
idname =
"TEXT_OT_line_number";
3455 if (
st &&
st->overwrite) {
3484 uint auto_close_char = 0;
3513 if (auto_close_match != 0) {
3547 ot->
srna,
"text",
NULL, 0,
"Text",
"Text to insert at the cursor position");
3559 #define TEXT_REPLACE 1
3570 if (!
st->findstr[0]) {
3584 found =
STREQ(
st->findstr, tmp);
3659 const int flags =
st->flags;
3662 if (!
st->findstr[0]) {
3667 const int orig_curc = text->
curc;
3742 if (!
st->findstr[0]) {
3752 ot->
name =
"Find & Set Selection";
3753 ot->
idname =
"TEXT_OT_find_set_selected";
3754 ot->
description =
"Find specified text and set as selected";
3783 ot->
name =
"Replace & Set Selection";
3784 ot->
idname =
"TEXT_OT_replace_set_selected";
3785 ot->
description =
"Replace text with specified text and set as selected";
3826 switch (resolution) {
3852 C,
IFACE_(
"File Modified Outside and Inside Blender"), ICON_NONE);
3856 IFACE_(
"Reload from disk (ignore local changes)"),
3862 IFACE_(
"Save to disk (ignore outside changes)"),
3868 IFACE_(
"Make text internal (separate copy)"),
3881 IFACE_(
"Make text internal (separate copy)"),
3905 ot->
name =
"Resolve Conflict";
3906 ot->
idname =
"TEXT_OT_resolve_conflict";
3907 ot->
description =
"When external text is out of sync, resolve the conflict";
3920 "How to solve conflict due to differences in internal and external text");
3942 ot->
name =
"To 3D Object";
3943 ot->
idname =
"TEXT_OT_to_3d_object";
3944 ot->
description =
"Create 3D text object from active text data-block";
3955 ot->
srna,
"split_lines", 0,
"Split Lines",
"Create one object per line in the text");
struct ScrArea * CTX_wm_area(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct SpaceText * CTX_wm_space_text(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
struct Text * CTX_data_edit_text(const bContext *C)
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id)
void BKE_id_delete(struct Main *bmain, void *idv) ATTR_NONNULL()
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void txt_move_down(struct Text *text, bool sel)
void void txt_split_curline(struct Text *text)
int txt_setcurr_tab_spaces(struct Text *text, int space)
bool txt_has_sel(const struct Text *text)
void txt_move_eof(struct Text *text, bool sel)
void txt_delete_selected(struct Text *text)
void txt_delete_char(struct Text *text)
bool txt_cursor_is_line_end(const struct Text *text)
void txt_sel_line(struct Text *text)
void txt_move_toline(struct Text *text, unsigned int line, bool sel)
bool txt_replace_char(struct Text *text, unsigned int add)
void txt_backspace_char(struct Text *text)
void txt_sel_clear(struct Text *text)
void txt_move_left(struct Text *text, bool sel)
bool txt_add_char(struct Text *text, unsigned int add)
int txt_calc_tab_left(struct TextLine *tl, int ch)
void txt_delete_word(struct Text *text)
char * txt_sel_to_buf(struct Text *text, size_t *r_buf_strlen)
struct Text * BKE_text_add(struct Main *bmain, const char *name)
bool txt_uncomment(struct Text *text)
int txt_get_span(struct TextLine *from, struct TextLine *to)
void int BKE_text_file_modified_check(struct Text *text)
void txt_move_bof(struct Text *text, bool sel)
void txt_move_right(struct Text *text, bool sel)
int txt_find_string(struct Text *text, const char *findstr, int wrap, int match_case)
void txt_move_lines(struct Text *text, int direction)
int txt_calc_tab_right(struct TextLine *tl, int ch)
void txt_jump_left(struct Text *text, bool sel, bool use_init_step)
void txt_move_eol(struct Text *text, bool sel)
void txt_backspace_word(struct Text *text)
void txt_jump_right(struct Text *text, bool sel, bool use_init_step)
void txt_move_up(struct Text *text, bool sel)
void txt_comment(struct Text *text)
void BKE_text_file_modified_ignore(struct Text *text)
void txt_move_bol(struct Text *text, bool sel)
void txt_sel_all(struct Text *text)
void txt_order_cursors(struct Text *text, bool reverse)
bool txt_unindent(struct Text *text)
void txt_indent(struct Text *text)
void txt_duplicate_line(struct Text *text)
struct Text * BKE_text_load_ex(struct Main *bmain, const char *filepath, const char *relbase, bool is_internal) ATTR_NONNULL(1
void txt_insert_buf(struct Text *text, const char *in_buffer, int in_buffer_len) ATTR_NONNULL(1
void txt_move_to(struct Text *text, unsigned int line, unsigned int ch, bool sel)
bool txt_cursor_is_line_start(const struct Text *text)
void txt_pop_sel(struct Text *text)
bool BKE_text_reload(struct Text *text)
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_file_is_writable(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2])
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
int BLI_strcasecmp(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
int BLI_str_utf8_offset_from_column(const char *str, int column) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
unsigned int BLI_str_utf8_as_unicode(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
unsigned int BLI_str_utf8_as_unicode_step(const char *__restrict p, size_t p_len, size_t *__restrict index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int BLI_str_utf8_char_width_safe(const char *p) 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_size_safe(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define BLT_I18NCONTEXT_ID_TEXT
void BPY_text_free_code(struct Text *text)
void BPY_pyconstraint_update(struct Object *owner, struct bConstraint *con)
bool bool BPY_run_text(struct bContext *C, struct Text *text, struct ReportList *reports, bool do_jump) ATTR_NONNULL(1
void DEG_id_tag_update(struct ID *id, int flag)
@ USER_TEXT_EDIT_AUTO_CLOSE
void ED_area_tag_redraw(ScrArea *area)
struct UndoStep * ED_text_undo_push_init(struct bContext *C)
void ED_text_scroll_to_cursor(struct SpaceText *st, struct ARegion *region, bool center)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble top
Read Guarded memory(de)allocation.
Platform independent time functions.
struct uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void UI_context_active_but_prop_get_templateID(struct bContext *C, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
void uiItemEnumO_ptr(uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, const char *propname, int value)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SyclQueue void void size_t num_bytes void
void ED_text_to_object(bContext *C, const Text *text, const bool split_lines)
ccl_global float * buffer
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
SymEdge< T > * prev(const SymEdge< T > *se)
static std::string replace_all(const StringRefNull str, const StringRefNull from, const StringRefNull to)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
static void update(bNodeTree *ntree)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
int RNA_string_length(PointerRNA *ptr, const char *name)
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen, int *r_len)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct PropertyRNA * prop
struct TextScroll::@557 state
struct bConstraint * next
struct bPoseChannel * next
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
struct wmOperatorType * type
int flatten_string(const SpaceText *st, FlattenString *fs, const char *in)
void flatten_string_free(FlattenString *fs)
#define TXT_LINE_HEIGHT(st)
int text_get_total_lines(struct SpaceText *st, struct ARegion *region)
#define TXT_NUMCOL_WIDTH(st)
void text_update_cursor_moved(struct bContext *C)
void wrap_offset_in_line(const struct SpaceText *st, struct ARegion *region, struct TextLine *linein, int cursin, int *offl, int *offc)
int wrap_width(const struct SpaceText *st, struct ARegion *region)
#define TXT_BODY_LEFT(st)
int text_get_visible_lines(const struct SpaceText *st, struct ARegion *region, const char *str)
void text_drawcache_tag_update(struct SpaceText *st, int full)
int text_get_char_pos(const struct SpaceText *st, const char *line, int cur)
void text_update_character_width(struct SpaceText *st)
static int text_scroll_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int text_replace_exec(bContext *C, wmOperator *op)
void TEXT_OT_replace_set_selected(wmOperatorType *ot)
static bool text_edit_poll(bContext *C)
static int text_replace_all(bContext *C)
static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
static int text_line_break_exec(bContext *C, wmOperator *UNUSED(op))
static bool text_data_poll(bContext *C)
static int text_to_3d_object_exec(bContext *C, wmOperator *op)
struct SetSelection SetSelection
void TEXT_OT_unlink(wmOperatorType *ot)
static int text_unindent_exec(bContext *C, wmOperator *UNUSED(op))
static int text_insert_exec(bContext *C, wmOperator *op)
static int text_select_word_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_overwrite_toggle(wmOperatorType *ot)
void TEXT_OT_reload(wmOperatorType *ot)
static void txt_screen_clamp(SpaceText *st, ARegion *region)
void TEXT_OT_open(wmOperatorType *ot)
static int text_save_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void text_update_edited(Text *text)
static int text_save_as_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int text_cut_exec(bContext *C, wmOperator *UNUSED(op))
static void text_open_init(bContext *C, wmOperator *op)
static int text_jump_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int text_resolve_conflict_exec(bContext *C, wmOperator *op)
static char * buf_tabs_to_spaces(const char *in_buf, const int tab_size, int *r_out_buf_len)
void TEXT_OT_replace(wmOperatorType *ot)
static int text_copy_exec(bContext *C, wmOperator *UNUSED(op))
static const EnumPropertyItem resolution_items[]
@ SCROLLHANDLE_MIN_OUTSIDE
@ SCROLLHANDLE_MAX_OUTSIDE
@ SCROLLHANDLE_INVALID_OUTSIDE
void TEXT_OT_run_script(wmOperatorType *ot)
static int text_run_script(bContext *C, ReportList *reports)
static int cursor_skip_find_line(SpaceText *st, ARegion *region, int lines, TextLine **linep, int *charp, int *rell, int *relc)
static void text_scroll_apply(bContext *C, wmOperator *op, const wmEvent *event)
static void text_scroll_state_init(TextScroll *tsc, SpaceText *st, ARegion *region)
static int text_select_all_exec(bContext *C, wmOperator *UNUSED(op))
static int text_refresh_pyconstraints_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
void TEXT_OT_copy(wmOperatorType *ot)
static int text_toggle_overwrite_exec(bContext *C, wmOperator *UNUSED(op))
static int text_find_exec(bContext *C, wmOperator *op)
static int text_selection_set_modal(bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_select_line(wmOperatorType *ot)
static void text_selection_set_cancel(bContext *C, wmOperator *op)
static void text_open_cancel(bContext *UNUSED(C), wmOperator *op)
static int text_find_and_replace(bContext *C, wmOperator *op, short mode)
void TEXT_OT_new(wmOperatorType *ot)
void TEXT_OT_indent_or_autocomplete(wmOperatorType *ot)
void TEXT_OT_scroll(wmOperatorType *ot)
static int text_cursor_set_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_line_break(wmOperatorType *ot)
static int text_selection_set_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int text_delete_exec(bContext *C, wmOperator *op)
static bool text_region_edit_poll(bContext *C)
void TEXT_OT_save_as(wmOperatorType *ot)
static bool text_region_scroll_poll(bContext *C)
static int text_open_exec(bContext *C, wmOperator *op)
static int move_lines_exec(bContext *C, wmOperator *op)
static void text_cursor_set_exit(bContext *C, wmOperator *op)
void TEXT_OT_paste(wmOperatorType *ot)
static int text_save_exec(bContext *C, wmOperator *op)
void TEXT_OT_make_internal(wmOperatorType *ot)
void TEXT_OT_to_3d_object(wmOperatorType *ot)
void TEXT_OT_indent(wmOperatorType *ot)
bool text_space_edit_poll(bContext *C)
void TEXT_OT_select_all(wmOperatorType *ot)
static void txt_wrap_move_eol(SpaceText *st, ARegion *region, const bool sel)
void TEXT_OT_select_word(wmOperatorType *ot)
void TEXT_OT_save(wmOperatorType *ot)
static int text_get_cursor_rel(SpaceText *st, ARegion *region, TextLine *linein, int rell, int relc)
static int text_scroll_bar_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_move_lines(wmOperatorType *ot)
static int text_scroll_exec(bContext *C, wmOperator *op)
void TEXT_OT_cursor_set(wmOperatorType *ot)
static int text_move_exec(bContext *C, wmOperator *op)
static int text_cursor_set_exec(bContext *C, wmOperator *op)
static int text_comment_exec(bContext *C, wmOperator *op)
static int text_jump_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem delete_type_items[]
void TEXT_OT_scroll_bar(wmOperatorType *ot)
void TEXT_OT_find(wmOperatorType *ot)
static int text_move_cursor(bContext *C, int type, bool select)
void TEXT_OT_duplicate_line(wmOperatorType *ot)
void TEXT_OT_move_select(wmOperatorType *ot)
static int flatten_width(SpaceText *st, const char *str)
static int text_reload_exec(bContext *C, wmOperator *op)
static int text_run_script_exec(bContext *C, wmOperator *op)
static bool text_new_poll(bContext *UNUSED(C))
BLI_INLINE int text_pixel_x_to_column(SpaceText *st, const int x)
static void text_cursor_timer_ensure(bContext *C, SetSelection *ssel)
static int text_line_number_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
static int text_open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
void TEXT_OT_jump(wmOperatorType *ot)
static int text_scroll_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void text_cursor_timer_remove(bContext *C, SetSelection *ssel)
static int text_move_select_exec(bContext *C, wmOperator *op)
void TEXT_OT_delete(wmOperatorType *ot)
void TEXT_OT_selection_set(wmOperatorType *ot)
static bool text_scroll_poll(bContext *C)
static int flatten_column_to_offset(SpaceText *st, const char *str, int index)
void TEXT_OT_find_set_selected(wmOperatorType *ot)
static int text_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int text_replace_set_selected_exec(bContext *C, wmOperator *UNUSED(op))
static int text_duplicate_line_exec(bContext *C, wmOperator *UNUSED(op))
static void txt_wrap_move_bol(SpaceText *st, ARegion *region, const bool sel)
void TEXT_OT_unindent(wmOperatorType *ot)
static void txt_screen_skip(SpaceText *st, ARegion *region, int lines)
static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
void TEXT_OT_insert(wmOperatorType *ot)
static int text_new_exec(bContext *C, wmOperator *UNUSED(op))
static const EnumPropertyItem whitespace_type_items[]
void TEXT_OT_comment_toggle(wmOperatorType *ot)
static char text_closing_character_pair_get(const char character)
static bool text_unlink_poll(bContext *C)
static int text_find_set_selected_exec(bContext *C, wmOperator *op)
void TEXT_OT_resolve_conflict(wmOperatorType *ot)
static int text_make_internal_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_move(wmOperatorType *ot)
static int text_indent_or_autocomplete_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_line_number(wmOperatorType *ot)
void text_update_line_edited(TextLine *line)
static void test_line_start(char c, bool *r_last_state)
static int text_save_as_exec(bContext *C, wmOperator *op)
static bool text_resolve_conflict_poll(bContext *C)
void TEXT_OT_convert_whitespace(wmOperatorType *ot)
static TextLine * get_line_pos_wrapped(SpaceText *st, ARegion *region, int *y)
static void txt_wrap_move_down(SpaceText *st, ARegion *region, const bool sel)
void TEXT_OT_cut(wmOperatorType *ot)
static int text_select_line_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot)
static void cursor_skip(SpaceText *st, ARegion *region, Text *text, int lines, const bool sel)
static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *region, int x, int y, const bool sel)
static void txt_wrap_move_up(SpaceText *st, ARegion *region, const bool sel)
static void text_cursor_set_apply(bContext *C, wmOperator *op, const wmEvent *event)
static int text_unlink_exec(bContext *C, wmOperator *UNUSED(op))
static void txt_copy_clipboard(Text *text)
static int text_paste_exec(bContext *C, wmOperator *op)
static void text_scroll_cancel(bContext *C, wmOperator *op)
static void scroll_exit(bContext *C, wmOperator *op)
struct TextScroll TextScroll
static void text_cursor_set_to_pos(SpaceText *st, ARegion *region, int x, int y, const bool sel)
static int text_indent_exec(bContext *C, wmOperator *UNUSED(op))
static const EnumPropertyItem move_type_items[]
static void txt_write_file(Main *bmain, Text *text, ReportList *reports)
double PIL_check_seconds_timer(void)
char WM_event_utf8_to_ascii(const struct wmEvent *event)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
int WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width)
void WM_event_remove_timer(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer)
void WM_clipboard_text_set(const char *buf, bool selection)
char * WM_clipboard_text_get(bool selection, int *r_len)
wmTimer * WM_event_add_timer(wmWindowManager *wm, wmWindow *win, int event_type, double timestep)