58 if (!last || !first) {
63 for (tmp =
st->text->curl,
l = -
st->top; tmp; tmp = tmp->
prev,
l++) {
73 y = region->
winy - lheight *
l - 2;
78 if (mval[0] <
x ||
x +
w < mval[0] || mval[1] <
y - h ||
y < mval[1]) {
83 for (i = 0, item = first; i < *
top && item->
next; i++, item = item->
next) {
88 tgti = (
y - mval[1] - 4) / lheight;
93 for (i = tgti; i > 0 && item->
next; i--, item = item->
next) {
112 while (item && item != sel) {
144 seek_len = text->
curc - i;
161 while (i_start < linep->
len) {
164 while ((i_start < linep->
len) &&
169 i_pos = i_end = i_start;
171 linep->
line, linep->
len, &i_pos)))) {
175 if ((i_start != i_end) &&
180 char *str_sub = &linep->
line[i_start];
181 const int choice_len = i_end - i_start;
183 if ((choice_len > seek_len) && (seek_len == 0 ||
STREQLEN(seek, str_sub, seek_len)) &&
186 char str_sub_last = str_sub[choice_len];
187 str_sub[choice_len] =
'\0';
193 str_sub[choice_len] = str_sub_last;
196 if (i_end != i_start) {
265 over = text->
curc - i;
270 const char *buf = sel->
name + over;
290 st->doplugins =
true;
322 int draw = 0, tools = 0, swallow = 0, scroll = 1;
334 switch (event->
type) {
419 if (
st->text->curl &&
st->text->curc > 0) {
420 char ch =
st->text->curl->line[
st->text->curc - 1];
456 if (
st->text->curl &&
st->text->curc <
st->text->curl->len) {
457 char ch =
st->text->curl->line[
st->text->curc];
500 while (sel && scroll--) {
532 while (sel && scroll--) {
594 st->doplugins =
false;
607 ot->
name =
"Text Auto Complete";
608 ot->
description =
"Show a list of used text in the open document";
609 ot->
idname =
"TEXT_OT_autocomplete";
struct ScrArea * CTX_wm_area(const bContext *C)
struct SpaceText * CTX_wm_space_text(const bContext *C)
struct Text * CTX_data_edit_text(const bContext *C)
struct ARegion * BKE_area_find_region_type(const struct ScrArea *area, int type)
int text_check_identifier_unicode(unsigned int ch)
void txt_move_left(struct Text *text, bool sel)
void txt_move_right(struct Text *text, bool sel)
int text_check_identifier_nodigit_unicode(unsigned int ch)
bool text_check_whitespace(char ch)
void txt_insert_buf(struct Text *text, const char *in_buffer, int in_buffer_len) ATTR_NONNULL(1
int text_find_identifier_start(const char *str, int i)
short texttool_text_is_active(struct Text *text)
void texttool_text_clear(void)
SuggItem * texttool_suggest_last(void)
char * texttool_docs_get(void)
void texttool_suggest_prefix(const char *prefix, int prefix_len)
void texttool_suggest_select(SuggItem *sel)
void texttool_docs_clear(void)
void texttool_suggest_add(const char *name, char type)
void texttool_text_set_active(struct Text *text)
SuggItem * texttool_suggest_selected(void)
void texttool_suggest_clear(void)
SuggItem * texttool_suggest_first(void)
int * texttool_suggest_top(void)
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_str_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
#define GHASH_ITER(gh_iter_, ghash_)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
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
#define STREQLEN(a, b, n)
void ED_area_tag_redraw(ScrArea *area)
struct UndoStep * ED_text_undo_push_init(struct bContext *C)
void ED_undo_push(struct bContext *C, const char *str)
_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.
ATTR_WARN_UNUSED_RESULT const BMLoop * l
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
char(* format_identifier)(const char *string)
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 *)
struct wmOperatorType * type
void text_pop_suggest_list(void)
void TEXT_OT_autocomplete(wmOperatorType *ot)
bool text_do_suggest_select(SpaceText *st, ARegion *region, const int mval[2])
static int text_autocomplete_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void text_autocomplete_free(bContext *C, wmOperator *op)
static GHash * text_autocomplete_build(Text *text)
static void confirm_suggestion(Text *text)
static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void get_suggest_prefix(Text *text, int offset)
static void text_autocomplete_cancel(bContext *C, wmOperator *op)
TextFormatType * ED_text_format_get(Text *text)
void text_update_line_edited(struct TextLine *line)
#define TXT_LINE_HEIGHT(st)
bool text_space_edit_poll(struct bContext *C)
#define TXT_BODY_LEFT(st)
void text_update_character_width(struct SpaceText *st)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)