82 else if (!
ELEM(
c,
'\t',
' ')) {
83 *r_last_state =
false;
95 bool line_start =
true;
98 for (
int in_offset = 0; in_buf[in_offset]; in_offset++) {
102 if (in_buf[in_offset] ==
'\t' && line_start) {
108 const int out_size = strlen(in_buf) + num_tabs * (tab_size - 1) + 1;
109 char *out_buf =
MEM_mallocN(out_size *
sizeof(
char), __func__);
112 int spaces_until_tab = 0;
116 for (
int in_offset = 0; in_buf[in_offset]; in_offset++) {
120 if (in_buf[in_offset] ==
'\t' && line_start) {
122 int num_spaces = tab_size - (spaces_until_tab % tab_size);
123 spaces_until_tab = 0;
126 memset(&out_buf[out_offset],
' ', num_spaces);
127 out_offset += num_spaces;
130 if (in_buf[in_offset] ==
' ') {
133 else if (in_buf[in_offset] ==
'\n') {
134 spaces_until_tab = 0;
137 out_buf[out_offset++] = in_buf[in_offset];
141 out_buf[out_offset] =
'\0';
417 ot->
srna,
"internal", 0,
"Make Internal",
"Make text file internal after loading");
433 const int orig_top = st->
top;
435 const int orig_curc = text->
curc;
476 ot->
description =
"Reload active text data-block from its file";
561 ot->
name =
"Make Internal";
562 ot->
idname =
"TEXT_OT_make_internal";
592 reports,
RPT_ERROR,
"Cannot save text file, path \"%s\" is not writable", filepath);
600 "Unable to save '%s': %s",
602 errno ? strerror(errno) :
TIP_(
"unknown error writing file"));
607 fputs(tmp->
line, fp);
616 text->
mtime = st.st_mtime;
625 "Unable to stat '%s': %s",
627 errno ? strerror(errno) :
TIP_(
"unknown error stating file"));
761 const bool is_live = (reports ==
NULL);
764 void *curl_prev = text->
curl;
765 int curc_prev = text->
curc;
779 if (text->
curl != curl_prev || curc_prev != text->
curc) {
786 reports,
RPT_ERROR,
"Python script failed, check the message in the system console");
850 if (
data->text == text) {
861 if (
data->text == text) {
881 ot->
name =
"Refresh PyConstraints";
882 ot->
idname =
"TEXT_OT_refresh_pyconstraints";
955 "Paste text selected elsewhere rather than copied (X11 only)");
985 ot->
name =
"Duplicate Line";
986 ot->
idname =
"TEXT_OT_duplicate_line";
1093 bool text_before_cursor = text->
curc != 0 && !
ELEM(line->
line[text->
curc - 1],
' ',
'\t');
1094 if (text_before_cursor && (
txt_has_sel(text) ==
false)) {
1106 ot->
name =
"Indent or Autocomplete";
1107 ot->
idname =
"TEXT_OT_indent_or_autocomplete";
1223 for (
a = 0;
a < curts;
a++) {
1304 {0,
"TOGGLE", 0,
"Toggle Comments",
NULL},
1305 {1,
"COMMENT", 0,
"Comment",
NULL},
1306 {-1,
"UNCOMMENT", 0,
"Un-Comment",
NULL},
1311 ot->
name =
"Toggle Comments";
1312 ot->
idname =
"TEXT_OT_comment_toggle";
1323 prop =
RNA_def_enum(
ot->
srna,
"type", comment_items, 0,
"Type",
"Add or remove comments");
1346 size_t a, j, max_len = 0;
1366 tmp->
line = new_line;
1367 tmp->
len = strlen(new_line);
1369 if (tmp->
len > max_len) {
1375 char *tmp_line =
MEM_mallocN(
sizeof(*tmp_line) * (max_len + 1), __func__);
1378 const char *text_check_line = tmp->
line;
1379 const int text_check_line_len = tmp->
len;
1380 char *tmp_line_cur = tmp_line;
1385 for (
a = 0;
a < text_check_line_len;) {
1387 if (!(
a % tab_len) && (text_check_line[
a] ==
' ')) {
1390 (j < tab_len) && (
a + j < text_check_line_len) && (text_check_line[
a + j] ==
' ');
1397 if ((tmp_line_cur == tmp_line) &&
a != 0) {
1399 memcpy(tmp_line_cur, text_check_line,
a);
1402 *tmp_line_cur =
'\t';
1407 if (tmp_line_cur != tmp_line) {
1408 memcpy(tmp_line_cur, &text_check_line[
a], j);
1416 if (tmp_line_cur != tmp_line) {
1417 memcpy(tmp_line_cur, &text_check_line[
a],
len);
1418 tmp_line_cur +=
len;
1424 if (tmp_line_cur != tmp_line) {
1425 *tmp_line_cur =
'\0';
1428 BLI_assert(tmp_line_cur - tmp_line <= max_len);
1443 tmp->
len = strlen(tmp_line);
1462 ot->
name =
"Convert Whitespace";
1463 ot->
idname =
"TEXT_OT_convert_whitespace";
1479 "Type of whitespace to convert to");
1533 ot->
name =
"Select Line";
1534 ot->
idname =
"TEXT_OT_select_line";
1552 const bool use_init_step =
false;
1566 ot->
name =
"Select Word";
1567 ot->
idname =
"TEXT_OT_select_word";
1612 ot->
description =
"Move the currently selected line(s) up/down";
1632 {
LINE_BEGIN,
"LINE_BEGIN", 0,
"Line Begin",
""},
1633 {
LINE_END,
"LINE_END", 0,
"Line End",
""},
1634 {
FILE_TOP,
"FILE_TOP", 0,
"File Top",
""},
1635 {
FILE_BOTTOM,
"FILE_BOTTOM", 0,
"File Bottom",
""},
1636 {
PREV_CHAR,
"PREVIOUS_CHARACTER", 0,
"Previous Character",
""},
1637 {
NEXT_CHAR,
"NEXT_CHARACTER", 0,
"Next Character",
""},
1638 {
PREV_WORD,
"PREVIOUS_WORD", 0,
"Previous Word",
""},
1639 {
NEXT_WORD,
"NEXT_WORD", 0,
"Next Word",
""},
1640 {
PREV_LINE,
"PREVIOUS_LINE", 0,
"Previous Line",
""},
1641 {
NEXT_LINE,
"NEXT_LINE", 0,
"Next Line",
""},
1642 {
PREV_PAGE,
"PREVIOUS_PAGE", 0,
"Previous Page",
""},
1643 {
NEXT_PAGE,
"NEXT_PAGE", 0,
"Next Page",
""},
1651 int i, j, start, end,
max, chop, curs, loop, endj, found, selc;
1656 selc = start = endj = curs = found = 0;
1665 ch = linein->
line[j];
1675 if (rell == 0 && i - start <= relc && i + columns - start > relc) {
1681 else if (i - end <= relc && i + columns - end > relc) {
1684 if (i + columns - start >
max) {
1690 if (selc > endj && !chop) {
1706 if (rell == 0 && i + columns - start > relc) {
1712 else if (ch ==
'\0') {
1719 else if (
ELEM(ch,
' ',
'-')) {
1725 if (rell == 0 && i + columns - start > relc) {
1744 int offl, offc, visible_lines;
1754 if (*rell - visible_lines + offl >= 0) {
1755 if (!(*linep)->next) {
1756 if (offl < visible_lines - 1) {
1757 *rell = visible_lines - 1;
1761 *charp = (*linep)->len;
1765 *rell -= visible_lines - offl;
1766 *linep = (*linep)->
next;
1774 if (*rell + offl <= 0) {
1775 if (!(*linep)->prev) {
1786 *linep = (*linep)->
prev;
1799 if (*rell + visible_lines >= 0) {
1800 *rell += visible_lines;
1804 if (!(*linep)->prev) {
1809 *rell += visible_lines;
1810 *linep = (*linep)->
prev;
1813 if (*rell - visible_lines < 0) {
1817 if (!(*linep)->next) {
1818 *rell = visible_lines - 1;
1822 *rell -= visible_lines;
1823 *linep = (*linep)->
next;
1835 int oldc, i, j,
max, start, end, endj, chop, loop;
1841 linep = &text->
sell;
1842 charp = &text->
selc;
1845 linep = &text->
curl;
1846 charp = &text->
curc;
1863 ch = (*linep)->line[j];
1873 if (i + columns - start >
max) {
1894 else if (
ELEM(ch,
' ',
'-',
'\0')) {
1919 int oldc, i, j,
max, start, end, endj, chop, loop;
1925 linep = &text->
sell;
1926 charp = &text->
selc;
1929 linep = &text->
curl;
1930 charp = &text->
curc;
1947 ch = (*linep)->line[j];
1957 if (i + columns - start >
max) {
1966 *charp = (*linep)->len;
1979 else if (ch ==
'\0') {
1980 *charp = (*linep)->len;
1984 else if (
ELEM(ch,
' ',
'-')) {
2003 int offl, offc,
col;
2008 linep = &text->
sell;
2009 charp = &text->
selc;
2012 linep = &text->
curl;
2013 charp = &text->
curc;
2022 if ((*linep)->prev) {
2025 *linep = (*linep)->
prev;
2044 int offl, offc,
col, visible_lines;
2049 linep = &text->
sell;
2050 charp = &text->
selc;
2053 linep = &text->
curl;
2054 charp = &text->
curc;
2060 if (offl < visible_lines - 1) {
2064 if ((*linep)->next) {
2065 *linep = (*linep)->
next;
2069 *charp = (*linep)->len;
2090 linep = &text->
sell;
2091 charp = &text->
selc;
2094 linep = &text->
curl;
2095 charp = &text->
curc;
2098 if (st && region && st->
wordwrap) {
2107 while (lines > 0 && (*linep)->next) {
2108 *linep = (*linep)->
next;
2111 while (lines < 0 && (*linep)->prev) {
2112 *linep = (*linep)->
prev;
2117 if (*charp > (*linep)->len) {
2118 *charp = (*linep)->
len;
2142 if (st && st->
wordwrap && region) {
2154 if (st && st->
wordwrap && region) {
2205 if (st && st->
wordwrap && region) {
2214 if (st && st->
wordwrap && region) {
2257 ot->
name =
"Move Cursor";
2285 ot->
name =
"Move Select";
2286 ot->
idname =
"TEXT_OT_move_select";
2299 "Where to move cursor to, to make a selection");
2317 else if (line > nlines) {
2350 prop =
RNA_def_int(
ot->
srna,
"line", 1, 1, INT_MAX,
"Line",
"Line number to jump to", 1, 10000);
2362 {
DEL_PREV_CHAR,
"PREVIOUS_CHARACTER", 0,
"Previous Character",
""},
2468 "Which part of the text to delete");
2492 ot->
name =
"Toggle Overwrite";
2493 ot->
idname =
"TEXT_OT_overwrite_toggle";
2516 if (last > 0 && st->
top > last) {
2598 const int mval[2] = {
event->x,
event->y};
2625 for (
int i = 0; i < 2; i += 1) {
2634 int scroll_ofs_new[2] = {
2638 int scroll_ofs_px_new[2] = {
2643 for (
int i = 0; i < 2; i += 1) {
2645 while (scroll_ofs_px_new[i] < 0) {
2647 scroll_ofs_new[i] -= 1;
2651 if (scroll_ofs_new[i] < 0) {
2652 scroll_ofs_new[i] = 0;
2653 scroll_ofs_px_new[i] = 0;
2657 scroll_ofs_px_new[i] = 0;
2663 scroll_ofs_new[0] = 0;
2664 scroll_ofs_px_new[0] = 0;
2668 if (scroll_ofs_new[0] != st->
left || scroll_ofs_new[1] != st->
top ||
2673 st->
left = scroll_ofs_new[0];
2674 st->
top = scroll_ofs_new[1];
2708 switch (event->
type) {
2801 ot->
srna,
"lines", 1, INT_MIN, INT_MAX,
"Lines",
"Number of lines to scroll", -100, 100);
2833 const int *mval =
event->mval;
2907 ot->
srna,
"lines", 1, INT_MIN, INT_MAX,
"Lines",
"Number of lines to scroll", -100, 100);
2927 if (
str[i] ==
'\t') {
2940 int i = 0, j = 0,
col;
2942 while (*(
str + j)) {
2943 if (
str[j] ==
'\t') {
2950 if (i +
col > index) {
2966 if (*y < -st->
top) {
2970 for (i = -st->
top; i <= *y && linep; linep = linep->
next, i += lines) {
2973 if (i + lines > *
y) {
2995 int i = 0, start = 0, end =
max;
2996 int j, curs = 0, endj = 0;
3000 for (j = 0; !found && ((ch = linep->
line[j]) !=
'\0');
3023 if (
y == 0 && i - start <= x && i + columns - start >
x) {
3030 else if (i - end <= x && i + columns - end >
x) {
3033 if (i + columns - start >
max) {
3039 if (charp > endj && !chop && ch !=
'\0') {
3051 if (j < linep->
len) {
3056 if (
y == 0 && i + columns - start >
x) {
3062 else if (
ELEM(ch,
' ',
'-',
'\0')) {
3067 if (
y == 0 && i + columns - start >
x) {
3129 linep = &text->
sell;
3130 charp = &text->
selc;
3133 linep = &text->
curl;
3134 charp = &text->
curc;
3141 if ((*linep)->next) {
3142 *linep = (*linep)->
next;
3148 if ((*linep)->prev) {
3149 *linep = (*linep)->
prev;
3159 *charp = (*linep)->len;
3194 if (event->
mval[1] < 0 || event->
mval[1] > region->
winy) {
3274 switch (event->
type) {
3297 ot->
name =
"Set Selection";
3298 ot->
idname =
"TEXT_OT_selection_set";
3371 const int *mval =
event->mval;
3373 static int jump_to = 0;
3374 static double last_jump = 0;
3382 if (!(mval[0] > 2 &&
3384 mval[1] > 2 && mval[1] < region->
winy - 2)) {
3388 if (!(event->
ascii >=
'0' && event->
ascii <=
'9')) {
3393 if (last_jump <
time - 1) {
3398 jump_to += (int)(event->
ascii -
'0');
3412 ot->
name =
"Line Number";
3413 ot->
idname =
"TEXT_OT_line_number";
3528 ot->
srna,
"text",
NULL, 0,
"Text",
"Text to insert at the cursor position");
3540 #define TEXT_REPLACE 1
3640 const int flags = st->
flags;
3648 const int orig_curc = text->
curc;
3733 ot->
name =
"Find & Set Selection";
3734 ot->
idname =
"TEXT_OT_find_set_selected";
3735 ot->
description =
"Find specified text and set as selected";
3764 ot->
name =
"Replace & Set Selection";
3765 ot->
idname =
"TEXT_OT_replace_set_selected";
3766 ot->
description =
"Replace text with specified text and set as selected";
3807 switch (resolution) {
3833 C,
IFACE_(
"File Modified Outside and Inside Blender"), ICON_NONE);
3837 IFACE_(
"Reload from disk (ignore local changes)"),
3843 IFACE_(
"Save to disk (ignore outside changes)"),
3849 IFACE_(
"Make text internal (separate copy)"),
3862 IFACE_(
"Make text internal (separate copy)"),
3886 ot->
name =
"Resolve Conflict";
3887 ot->
idname =
"TEXT_OT_resolve_conflict";
3888 ot->
description =
"When external text is out of sync, resolve the conflict";
3901 "How to solve conflict due to differences in internal and external text");
3923 ot->
name =
"To 3D Object";
3924 ot->
idname =
"TEXT_OT_to_3d_object";
3925 ot->
description =
"Create 3D text object from active text data-block";
3936 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)
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_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void txt_move_eol(struct Text *text, const bool sel)
char * txt_sel_to_buf(struct Text *text, int *r_buf_strlen)
void txt_move_left(struct Text *text, const bool sel)
int BKE_text_file_modified_check(struct Text *text)
void txt_split_curline(struct Text *text)
int txt_setcurr_tab_spaces(struct Text *text, int space)
void txt_delete_selected(struct Text *text)
void txt_delete_char(struct Text *text)
void txt_sel_line(struct Text *text)
void txt_move_right(struct Text *text, const 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)
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)
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 txt_jump_left(struct Text *text, const bool sel, const bool use_init_step)
void txt_move_bol(struct Text *text, const bool sel)
int txt_find_string(struct Text *text, const char *findstr, int wrap, int match_case)
int txt_calc_tab_right(struct TextLine *tl, int ch)
void txt_move_to(struct Text *text, unsigned int line, unsigned int ch, const bool sel)
void txt_move_eof(struct Text *text, const bool sel)
void txt_order_cursors(struct Text *text, const bool reverse)
void txt_move_lines(struct Text *text, const int direction)
void txt_backspace_word(struct Text *text)
void txt_insert_buf(struct Text *text, const char *in_buffer)
void txt_comment(struct Text *text)
void BKE_text_file_modified_ignore(struct Text *text)
void txt_move_up(struct Text *text, const bool sel)
bool txt_has_sel(struct Text *text)
void txt_sel_all(struct Text *text)
void txt_move_bof(struct Text *text, const bool sel)
void txt_move_down(struct Text *text, const bool sel)
bool txt_unindent(struct Text *text)
struct Text * BKE_text_load_ex(struct Main *bmain, const char *file, const char *relpath, const bool is_internal)
void txt_indent(struct Text *text)
void txt_duplicate_line(struct Text *text)
bool txt_cursor_is_line_end(struct Text *text)
void txt_pop_sel(struct Text *text)
void txt_jump_right(struct Text *text, const bool sel, const bool use_init_step)
bool BKE_text_reload(struct Text *text)
bool txt_cursor_is_line_start(struct Text *text)
void txt_move_toline(struct Text *text, unsigned int line, const bool sel)
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_file_is_writable(const char *file) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
FILE * BLI_fopen(const char *filename, const char *mode) 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)
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, const size_t maxncpy) ATTR_NONNULL()
int BLI_str_utf8_char_width_safe(const char *p) ATTR_NONNULL()
int BLI_str_utf8_size_safe(const char *p) ATTR_NONNULL()
int BLI_str_utf8_offset_from_column(const char *str, int column)
char * BLI_str_prev_char_utf8(const char *p) ATTR_NONNULL()
size_t BLI_str_utf8_from_unicode(unsigned int c, char *outbuf)
unsigned int BLI_str_utf8_as_unicode_step(const char *__restrict p, size_t *__restrict index) ATTR_NONNULL()
#define BLT_I18NCONTEXT_ID_TEXT
void BPY_text_free_code(struct Text *text)
void BPY_pyconstraint_update(struct Object *owner, struct bConstraint *con)
bool BPY_run_text(struct bContext *C, struct Text *text, struct ReportList *reports, const bool do_jump)
void DEG_id_tag_update(struct ID *id, int flag)
#define ID_IS_LINKED(_id)
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 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 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 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()
#define WM_FILESEL_FILEPATH
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void ED_text_to_object(bContext *C, const Text *text, const bool split_lines)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int 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)
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)
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)
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen)
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 rcti scroll_region_handle
SpaceText_Runtime runtime
struct TextScroll::@533 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_save_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
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)
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)
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 char * buf_tabs_to_spaces(const char *in_buf, const int tab_size)
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 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)
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
int WM_operator_name_call(bContext *C, const char *opstring, short context, PointerRNA *properties)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, short action, short flag, short display, 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)