Blender
V3.3
|
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "BLI_dynstr.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_string_cursor_utf8.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_screen.h"
#include "UI_view2d.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "console_intern.h"
Go to the source code of this file.
Classes | |
struct | SetConsoleCursor |
Macros | |
#define | TAB_LENGTH 4 |
Typedefs | |
typedef struct SetConsoleCursor | SetConsoleCursor |
Variables | |
static const EnumPropertyItem | console_move_type_items [] |
static const EnumPropertyItem | console_delete_type_items [] |
#define TAB_LENGTH 4 |
Definition at line 367 of file console_ops.c.
typedef struct SetConsoleCursor SetConsoleCursor |
|
static |
Definition at line 731 of file console_ops.c.
References C, console_history_free(), console_history_verify(), console_scrollback_free(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ED_area_tag_redraw(), ListBase::first, SpaceConsole::history, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), and SpaceConsole::scrollback.
Referenced by CONSOLE_OT_clear().
|
static |
Definition at line 695 of file console_ops.c.
References C, console_history_add(), console_history_verify(), console_scroll_bottom(), console_select_offset(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ED_area_tag_redraw(), ConsoleLine::len, NULL, OPERATOR_CANCELLED, and OPERATOR_FINISHED.
Referenced by CONSOLE_OT_clear_line().
|
static |
Definition at line 966 of file console_ops.c.
References BLI_dynstr_append(), BLI_dynstr_free(), BLI_dynstr_get_cstring(), BLI_dynstr_get_len(), BLI_dynstr_nappend(), BLI_dynstr_new(), C, console_scrollback_prompt_begin(), console_scrollback_prompt_end(), CTX_wm_space_console(), ListBase::first, ConsoleLine::len, ConsoleLine::line, max_ii(), MEM_freeN, min_ii(), ConsoleLine::next, NULL, offset, OPERATOR_CANCELLED, OPERATOR_FINISHED, SpaceConsole::scrollback, SpaceConsole::sel_end, SpaceConsole::sel_start, and WM_clipboard_text_set().
Referenced by CONSOLE_OT_copy().
|
static |
Definition at line 1149 of file console_ops.c.
References buffer, wmOperator::customdata, MEM_freeN, txt_has_sel(), txt_sel_to_buf(), and WM_clipboard_text_set().
Referenced by console_modal_select(), and console_modal_select_cancel().
|
static |
Definition at line 1102 of file console_ops.c.
References console_char_pick(), pos, SpaceConsole::sel_end, SetConsoleCursor::sel_init, and SpaceConsole::sel_start.
Referenced by console_modal_select_apply().
|
static |
Definition at line 600 of file console_ops.c.
References BLI_assert, BLI_str_cursor_step_utf8(), C, console_history_verify(), console_scroll_bottom(), console_select_offset(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ConsoleLine::cursor, DEL_NEXT_CHAR, DEL_NEXT_WORD, DEL_PREV_CHAR, DEL_PREV_WORD, ED_area_tag_redraw(), ConsoleLine::len, ConsoleLine::line, OPERATOR_CANCELLED, OPERATOR_FINISHED, pos, wmOperator::ptr, RNA_enum_get(), STRCUR_DIR_NEXT, STRCUR_DIR_PREV, STRCUR_JUMP_DELIM, STRCUR_JUMP_NONE, stride, and type.
Referenced by CONSOLE_OT_delete().
|
static |
Definition at line 161 of file console_ops.c.
References console_lb_add__internal(), from, and SpaceConsole::history.
Referenced by console_clear_line_exec(), console_history_cycle_exec(), and console_history_verify().
ConsoleLine* console_history_add_str | ( | SpaceConsole * | sc, |
char * | str, | ||
bool | own | ||
) |
Definition at line 190 of file console_ops.c.
References console_lb_add_str__internal(), SpaceConsole::history, and str.
Referenced by console_history_append_exec(), and report_replay_exec().
|
static |
Definition at line 845 of file console_ops.c.
References blender::compositor::area(), C, console_history_add_str(), console_history_find(), console_history_free(), console_history_verify(), console_line_cursor_set(), console_scroll_bottom(), console_select_offset(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ED_area_tag_redraw(), ConsoleLine::len, ConsoleLine::line, MEM_freeN, NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), RNA_int_get(), RNA_string_get_alloc(), str, and STREQ.
Referenced by CONSOLE_OT_history_append().
|
static |
Definition at line 777 of file console_ops.c.
References BLI_addhead(), BLI_addtail(), BLI_remlink(), C, console_history_add(), console_history_find(), console_history_free(), console_history_verify(), console_scroll_bottom(), console_select_offset(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ED_area_tag_redraw(), ListBase::first, SpaceConsole::history, if(), ListBase::last, ConsoleLine::len, ConsoleLine::line, OPERATOR_FINISHED, ConsoleLine::prev, wmOperator::ptr, RNA_boolean_get(), and STREQ.
Referenced by CONSOLE_OT_history_cycle().
|
static |
Definition at line 80 of file console_ops.c.
References SpaceConsole::history, ListBase::last, ConsoleLine::line, NULL, ConsoleLine::prev, str, and STREQ.
Referenced by console_history_append_exec(), and console_history_cycle_exec().
void console_history_free | ( | SpaceConsole * | sc, |
ConsoleLine * | cl | ||
) |
Definition at line 58 of file console_ops.c.
References BLI_remlink(), SpaceConsole::history, ConsoleLine::line, and MEM_freeN.
Referenced by console_clear_exec(), console_free(), console_history_append_exec(), and console_history_cycle_exec().
ConsoleLine* console_history_verify | ( | const bContext * | C | ) |
Definition at line 201 of file console_ops.c.
References C, console_history_add(), CTX_wm_space_console(), SpaceConsole::history, ListBase::last, and NULL.
Referenced by console_clear_exec(), console_clear_line_exec(), console_delete_exec(), console_history_append_exec(), console_history_cycle_exec(), console_indent_exec(), console_indent_or_autocomplete_exec(), console_insert_exec(), console_move_exec(), console_paste_exec(), console_scrollback_append_exec(), and console_unindent_exec().
|
static |
Definition at line 493 of file console_ops.c.
References BLI_assert, C, console_history_verify(), console_line_cursor_set(), console_line_verify_length(), console_scroll_bottom(), console_select_offset(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ConsoleLine::cursor, ED_area_tag_redraw(), len, ConsoleLine::len, ConsoleLine::line, OPERATOR_FINISHED, and TAB_LENGTH.
Referenced by CONSOLE_OT_indent().
|
static |
Definition at line 448 of file console_ops.c.
References BLI_str_utf8_size_safe(), C, console_history_verify(), ConsoleLine::cursor, ELEM, ConsoleLine::line, NULL, OPERATOR_FINISHED, WM_OP_EXEC_DEFAULT, WM_OP_INVOKE_DEFAULT, and WM_operator_name_call().
Referenced by CONSOLE_OT_indent_or_autocomplete().
|
static |
Definition at line 368 of file console_ops.c.
References C, console_history_verify(), console_line_insert(), console_scroll_bottom(), console_select_offset(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ED_area_tag_redraw(), len, MEM_freeN, MEM_mallocN, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_string_get_alloc(), str, and TAB_LENGTH.
Referenced by console_insert_invoke(), and CONSOLE_OT_insert().
|
static |
Definition at line 402 of file console_ops.c.
References BLI_str_utf8_size_safe(), BLI_UTF8_MAX, C, console_insert_exec(), KM_CTRL, KM_OSKEY, len, wmEvent::modifier, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_string_length(), RNA_string_set(), str, and wmEvent::utf8_buf.
Referenced by CONSOLE_OT_insert().
|
static |
Definition at line 140 of file console_ops.c.
References BLI_addtail(), BLI_assert, BLI_strdupn(), ConsoleLine::cursor, from, ConsoleLine::len, ConsoleLine::len_alloc, ConsoleLine::line, MEM_callocN, and ConsoleLine::type.
Referenced by console_history_add().
|
static |
Definition at line 175 of file console_ops.c.
References BLI_addtail(), BLI_strdup(), ConsoleLine::len, ConsoleLine::len_alloc, ConsoleLine::line, MEM_callocN, and str.
Referenced by console_history_add_str(), and console_scrollback_add_str().
|
static |
Take an absolute index and give the line/column info.
Definition at line 256 of file console_ops.c.
References ListBase::last, ConsoleLine::len, NULL, offset, pos, ConsoleLine::prev, and SpaceConsole::scrollback.
Referenced by console_selectword_invoke().
|
static |
Definition at line 98 of file console_ops.c.
References ConsoleLine::cursor, and ConsoleLine::len.
Referenced by console_history_append_exec(), console_indent_exec(), console_move_exec(), and console_unindent_exec().
|
static |
Definition at line 227 of file console_ops.c.
References console_line_verify_length(), ConsoleLine::cursor, len, ConsoleLine::len, ConsoleLine::line, and str.
Referenced by console_insert_exec(), and console_paste_exec().
|
static |
Definition at line 212 of file console_ops.c.
References len, ConsoleLine::len_alloc, ConsoleLine::line, and MEM_recallocN_id.
Referenced by console_indent_exec(), console_line_insert(), and console_unindent_exec().
|
static |
Definition at line 1186 of file console_ops.c.
References C, console_cursor_set_exit(), console_modal_select_apply(), KM_RELEASE, LEFTMOUSE, MIDDLEMOUSE, MOUSEMOVE, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, RIGHTMOUSE, wmEvent::type, and wmEvent::val.
Referenced by CONSOLE_OT_select_set().
|
static |
Definition at line 1127 of file console_ops.c.
References C, console_cursor_set_to_pos(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), wmOperator::customdata, ED_area_tag_redraw(), SpaceConsole::sel_end, and SpaceConsole::sel_start.
Referenced by console_modal_select(), and console_modal_select_invoke().
|
static |
Definition at line 1205 of file console_ops.c.
References C, and console_cursor_set_exit().
Referenced by CONSOLE_OT_select_set().
|
static |
Definition at line 1165 of file console_ops.c.
References C, console_modal_select_apply(), CTX_wm_space_console(), wmOperator::customdata, MEM_callocN, OPERATOR_RUNNING_MODAL, SpaceConsole::sel_end, SetConsoleCursor::sel_init, SetConsoleCursor::sel_old, SpaceConsole::sel_start, and WM_event_add_modal_handler().
Referenced by CONSOLE_OT_select_set().
|
static |
Definition at line 296 of file console_ops.c.
References blender::compositor::area(), BLI_str_cursor_step_utf8(), C, console_history_verify(), console_line_cursor_set(), console_scroll_bottom(), CTX_wm_area(), CTX_wm_region(), ConsoleLine::cursor, ED_area_tag_redraw(), ConsoleLine::len, ConsoleLine::line, LINE_BEGIN, LINE_END, NEXT_CHAR, NEXT_WORD, OPERATOR_FINISHED, pos, PREV_CHAR, PREV_WORD, wmOperator::ptr, RNA_enum_get(), STRCUR_DIR_NEXT, STRCUR_DIR_PREV, STRCUR_JUMP_ALL, STRCUR_JUMP_DELIM, STRCUR_JUMP_NONE, and type.
Referenced by CONSOLE_OT_move().
void CONSOLE_OT_clear | ( | wmOperatorType * | ot | ) |
Definition at line 760 of file console_ops.c.
References console_clear_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by console_operatortypes().
void CONSOLE_OT_clear_line | ( | wmOperatorType * | ot | ) |
Definition at line 718 of file console_ops.c.
References console_clear_line_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, and wmOperatorType::poll.
Referenced by console_operatortypes().
void CONSOLE_OT_copy | ( | wmOperatorType * | ot | ) |
Definition at line 1027 of file console_ops.c.
References console_copy_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, and wmOperatorType::poll.
Referenced by console_operatortypes().
void CONSOLE_OT_delete | ( | wmOperatorType * | ot | ) |
Definition at line 675 of file console_ops.c.
References console_delete_exec(), console_delete_type_items, DEL_NEXT_CHAR, wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, RNA_def_enum(), and wmOperatorType::srna.
Referenced by console_operatortypes().
void CONSOLE_OT_history_append | ( | wmOperatorType * | ot | ) |
Definition at line 885 of file console_ops.c.
References console_history_append_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, NULL, ot, wmOperatorType::poll, RNA_def_boolean(), RNA_def_int(), RNA_def_string(), and wmOperatorType::srna.
Referenced by console_operatortypes().
void CONSOLE_OT_history_cycle | ( | wmOperatorType * | ot | ) |
Definition at line 829 of file console_ops.c.
References console_history_cycle_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by console_operatortypes().
void CONSOLE_OT_indent | ( | wmOperatorType * | ot | ) |
Definition at line 526 of file console_ops.c.
References console_indent_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, and wmOperatorType::poll.
Referenced by console_operatortypes().
void CONSOLE_OT_indent_or_autocomplete | ( | wmOperatorType * | ot | ) |
Definition at line 472 of file console_ops.c.
References console_indent_or_autocomplete_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, ot, and wmOperatorType::poll.
Referenced by console_operatortypes().
void CONSOLE_OT_insert | ( | wmOperatorType * | ot | ) |
Definition at line 424 of file console_ops.c.
References console_insert_exec(), console_insert_invoke(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, NULL, ot, wmOperatorType::poll, PROP_SKIP_SAVE, RNA_def_property_flag(), RNA_def_string(), and wmOperatorType::srna.
Referenced by console_operatortypes().
void CONSOLE_OT_move | ( | wmOperatorType * | ot | ) |
Definition at line 351 of file console_ops.c.
References console_move_exec(), console_move_type_items, wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, LINE_BEGIN, wmOperatorType::name, ot, wmOperatorType::poll, RNA_def_enum(), and wmOperatorType::srna.
Referenced by console_operatortypes().
void CONSOLE_OT_paste | ( | wmOperatorType * | ot | ) |
Definition at line 1082 of file console_ops.c.
References console_paste_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, and wmOperatorType::poll.
Referenced by console_operatortypes().
void CONSOLE_OT_scrollback_append | ( | wmOperatorType * | ot | ) |
Definition at line 936 of file console_ops.c.
References CONSOLE_LINE_ERROR, CONSOLE_LINE_INFO, CONSOLE_LINE_INPUT, CONSOLE_LINE_OUTPUT, console_scrollback_append_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, NULL, ot, wmOperatorType::poll, RNA_def_enum(), RNA_def_string(), and wmOperatorType::srna.
Referenced by console_operatortypes().
void CONSOLE_OT_select_set | ( | wmOperatorType * | ot | ) |
Definition at line 1210 of file console_ops.c.
References wmOperatorType::cancel, console_modal_select(), console_modal_select_cancel(), console_modal_select_invoke(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, ot, and wmOperatorType::poll.
Referenced by console_operatortypes().
void CONSOLE_OT_select_word | ( | wmOperatorType * | ot | ) |
Definition at line 1260 of file console_ops.c.
References console_selectword_invoke(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, ot, and wmOperatorType::poll.
Referenced by console_operatortypes().
void CONSOLE_OT_unindent | ( | wmOperatorType * | ot | ) |
Definition at line 580 of file console_ops.c.
References console_unindent_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, and wmOperatorType::poll.
Referenced by console_operatortypes().
|
static |
Definition at line 1041 of file console_ops.c.
References C, console_history_verify(), console_line_insert(), console_scroll_bottom(), console_select_offset(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ED_area_tag_redraw(), MEM_freeN, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, WM_clipboard_text_get(), WM_OP_EXEC_DEFAULT, and WM_operator_name_call().
Referenced by CONSOLE_OT_paste().
Definition at line 38 of file console_ops.c.
References View2D::cur, float(), ARegion::v2d, View2D::winy, rctf::ymax, and rctf::ymin.
Referenced by console_clear_line_exec(), console_delete_exec(), console_history_append_exec(), console_history_cycle_exec(), console_indent_exec(), console_insert_exec(), console_move_exec(), console_paste_exec(), and console_unindent_exec().
ConsoleLine* console_scrollback_add_str | ( | SpaceConsole * | sc, |
char * | str, | ||
bool | own | ||
) |
Definition at line 194 of file console_ops.c.
References console_lb_add_str__internal(), console_select_offset(), ConsoleLine::len, SpaceConsole::scrollback, and str.
Referenced by console_scrollback_append_exec().
|
static |
Definition at line 908 of file console_ops.c.
References C, console_history_verify(), console_scrollback_add_str(), console_scrollback_limit(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ED_area_tag_redraw(), NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), RNA_string_get_alloc(), str, type, and ConsoleLine::type.
Referenced by CONSOLE_OT_scrollback_append().
void console_scrollback_free | ( | SpaceConsole * | sc, |
ConsoleLine * | cl | ||
) |
Definition at line 64 of file console_ops.c.
References BLI_remlink(), ConsoleLine::line, MEM_freeN, and SpaceConsole::scrollback.
Referenced by console_clear_exec(), console_free(), and console_scrollback_limit().
|
static |
Definition at line 71 of file console_ops.c.
References BLI_listbase_count(), console_scrollback_free(), ListBase::first, and SpaceConsole::scrollback.
Referenced by console_scrollback_append_exec().
|
static |
Definition at line 52 of file console_ops.c.
References offset, SpaceConsole::sel_end, and SpaceConsole::sel_start.
Referenced by console_clear_line_exec(), console_delete_exec(), console_history_append_exec(), console_history_cycle_exec(), console_indent_exec(), console_insert_exec(), console_paste_exec(), console_scrollback_add_str(), and console_unindent_exec().
|
static |
Definition at line 1224 of file console_ops.c.
References BLI_str_cursor_step_utf8(), C, console_char_pick(), console_line_column_from_index(), console_scrollback_prompt_begin(), console_scrollback_prompt_end(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ED_area_tag_redraw(), ConsoleLine::len, ConsoleLine::line, wmEvent::mval, NULL, offset, OPERATOR_CANCELLED, OPERATOR_FINISHED, pos, ret, SpaceConsole::sel_end, SpaceConsole::sel_start, STRCUR_DIR_NEXT, STRCUR_DIR_PREV, and STRCUR_JUMP_DELIM.
Referenced by CONSOLE_OT_select_word().
void console_textview_update_rect | ( | SpaceConsole * | sc, |
ARegion * | region | ||
) |
Definition at line 45 of file console_ops.c.
References console_textview_height(), UI_view2d_totRect_set(), ARegion::v2d, and ARegion::winx.
Referenced by console_clear_exec(), console_clear_line_exec(), console_delete_exec(), console_history_cycle_exec(), console_indent_exec(), console_insert_exec(), console_main_region_listener(), console_paste_exec(), console_scrollback_append_exec(), and console_unindent_exec().
|
static |
Definition at line 540 of file console_ops.c.
References BLI_assert, C, console_history_verify(), console_line_cursor_set(), console_line_verify_length(), console_scroll_bottom(), console_select_offset(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ConsoleLine::cursor, ED_area_tag_redraw(), len, ConsoleLine::len, ConsoleLine::line, OPERATOR_CANCELLED, OPERATOR_FINISHED, and TAB_LENGTH.
Referenced by CONSOLE_OT_unindent().
|
static |
Definition at line 592 of file console_ops.c.
Referenced by CONSOLE_OT_delete().
|
static |