Blender
V3.3
|
#include <ctype.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_text_types.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BKE_context.h"
#include "BKE_screen.h"
#include "BKE_text.h"
#include "BKE_text_suggestions.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_screen.h"
#include "ED_text.h"
#include "ED_undo.h"
#include "UI_interface.h"
#include "text_format.h"
#include "text_intern.h"
Go to the source code of this file.
Functions | |
Public API | |
bool | text_do_suggest_select (SpaceText *st, ARegion *region, const int mval[2]) |
void | text_pop_suggest_list (void) |
Private API | |
static void | text_autocomplete_free (bContext *C, wmOperator *op) |
static GHash * | text_autocomplete_build (Text *text) |
static void | get_suggest_prefix (Text *text, int offset) |
static void | confirm_suggestion (Text *text) |
Auto Complete Operator | |
static int | doc_scroll = 0 |
static int | text_autocomplete_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) |
static int | text_autocomplete_modal (bContext *C, wmOperator *op, const wmEvent *event) |
static void | text_autocomplete_cancel (bContext *C, wmOperator *op) |
void | TEXT_OT_autocomplete (wmOperatorType *ot) |
Definition at line 245 of file text_autocomplete.c.
References BLI_assert, Text::curc, Text::curl, TextLine::line, SuggItem::name, text_find_identifier_start(), texttool_suggest_selected(), texttool_text_clear(), texttool_text_is_active(), and txt_insert_buf().
Referenced by text_autocomplete_invoke(), and text_autocomplete_modal().
Definition at line 227 of file text_autocomplete.c.
References Text::curc, Text::curl, len, TextLine::line, offset, text_find_identifier_start(), texttool_suggest_prefix(), and texttool_text_is_active().
Referenced by text_autocomplete_modal().
Definition at line 132 of file text_autocomplete.c.
References BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_str_new(), BLI_ghashIterator_getValue(), BLI_str_utf8_as_unicode(), BLI_str_utf8_as_unicode_step(), BLI_strdupn(), Text::curc, Text::curl, ED_text_format_get(), ListBase::first, TextFormatType::format_identifier, GHASH_ITER, len, TextLine::len, TextLine::line, Text::lines, TextLine::next, STREQLEN, text_check_identifier_nodigit_unicode(), text_check_identifier_unicode(), text_find_identifier_start(), texttool_suggest_add(), texttool_suggest_prefix(), texttool_text_clear(), and texttool_text_set_active().
Referenced by text_autocomplete_invoke().
|
static |
Definition at line 599 of file text_autocomplete.c.
References C, and text_autocomplete_free().
Referenced by TEXT_OT_autocomplete().
|
static |
Definition at line 583 of file text_autocomplete.c.
References BLI_ghash_free(), C, CTX_wm_space_text(), wmOperator::customdata, MEM_freeN, NULL, usdtokens::st(), and texttool_text_clear().
Referenced by text_autocomplete_cancel(), text_autocomplete_invoke(), and text_autocomplete_modal().
|
static |
Definition at line 285 of file text_autocomplete.c.
References C, confirm_suggestion(), CTX_data_edit_text(), CTX_wm_area(), CTX_wm_space_text(), wmOperator::customdata, ED_area_tag_redraw(), ED_text_undo_push_init(), ED_undo_push(), wmOperatorType::name, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, usdtokens::st(), text_autocomplete_build(), text_autocomplete_free(), text_update_line_edited(), texttool_suggest_first(), texttool_suggest_last(), wmOperator::type, and WM_event_add_modal_handler().
Referenced by TEXT_OT_autocomplete().
|
static |
Definition at line 315 of file text_autocomplete.c.
References blender::compositor::area(), ATTR_FALLTHROUGH, BKE_area_find_region_type(), C, confirm_suggestion(), CTX_wm_area(), CTX_wm_space_text(), doc_scroll, ED_area_tag_redraw(), ED_text_undo_push_init(), ED_undo_push(), EVT_BACKSPACEKEY, EVT_DOWNARROWKEY, EVT_ESCKEY, EVT_LEFTARROWKEY, EVT_LEFTSHIFTKEY, EVT_PADENTER, EVT_PAGEDOWNKEY, EVT_PAGEUPKEY, EVT_RETKEY, EVT_RIGHTARROWKEY, EVT_RIGHTSHIFTKEY, EVT_UPARROWKEY, get_suggest_prefix(), KM_CTRL, KM_PRESS, LEFTMOUSE, wmEvent::modifier, MOUSEMOVE, wmEvent::mval, wmOperatorType::name, SuggItem::next, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, SuggItem::prev, RGN_TYPE_WINDOW, usdtokens::st(), SUGG_LIST_SIZE, text_autocomplete_free(), text_check_whitespace(), text_do_suggest_select(), text_pop_suggest_list(), text_update_line_edited(), texttool_docs_clear(), texttool_docs_get(), texttool_suggest_clear(), texttool_suggest_first(), texttool_suggest_last(), texttool_suggest_select(), texttool_suggest_selected(), texttool_text_is_active(), TOOL_DOCUMENT, TOOL_SUGG_LIST, txt_move_left(), txt_move_right(), wmOperator::type, wmEvent::type, wmEvent::val, WHEELDOWNMOUSE, and WHEELUPMOUSE.
Referenced by TEXT_OT_autocomplete().
Definition at line 38 of file text_autocomplete.c.
References l, SuggItem::next, TextLine::prev, usdtokens::st(), SUGG_LIST_SIZE, SUGG_LIST_WIDTH, text_update_character_width(), texttool_suggest_first(), texttool_suggest_last(), texttool_suggest_select(), texttool_suggest_top(), texttool_text_is_active(), top, TXT_BODY_LEFT, TXT_LINE_HEIGHT, w(), ARegion::winy, x, and y.
Referenced by text_autocomplete_modal().
void TEXT_OT_autocomplete | ( | wmOperatorType * | ot | ) |
Definition at line 604 of file text_autocomplete.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, ot, wmOperatorType::poll, text_autocomplete_cancel(), text_autocomplete_invoke(), text_autocomplete_modal(), and text_space_edit_poll().
Referenced by text_operatortypes().
Definition at line 102 of file text_autocomplete.c.
References SuggItem::next, SUGG_LIST_SIZE, texttool_suggest_first(), texttool_suggest_selected(), texttool_suggest_top(), and top.
Referenced by text_autocomplete_modal().
|
static |
Definition at line 313 of file text_autocomplete.c.
Referenced by text_autocomplete_modal().