|
Blender
V2.59
|
#include <stdlib.h>#include <string.h>#include <ctype.h>#include <sys/stat.h>#include "MEM_guardedalloc.h"#include "DNA_userdef_types.h"#include "BLI_blenlib.h"#include "BLI_dynstr.h"#include "BLI_utildefines.h"#include "BKE_context.h"#include "BKE_text.h"#include "WM_api.h"#include "WM_types.h"#include "UI_view2d.h"#include "ED_screen.h"#include "RNA_access.h"#include "RNA_define.h"#include "console_intern.h"Go to the source code of this file.
Definition in file console_ops.c.
| #define TAB_LENGTH 4 |
Definition at line 363 of file console_ops.c.
Referenced by insert_exec().
| typedef struct SetConsoleCursor SetConsoleCursor |
| static int clear_exec | ( | bContext * | C, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 503 of file console_ops.c.
References 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 ConsoleLine* console_history_add | ( | const bContext * | C, |
| ConsoleLine * | from | ||
| ) | [static] |
Definition at line 190 of file console_ops.c.
References console_lb_add__internal(), CTX_wm_space_console(), and SpaceConsole::history.
Referenced by console_history_verify(), and history_cycle_exec().
| ConsoleLine* console_history_add_str | ( | SpaceConsole * | sc, |
| char * | str, | ||
| int | own | ||
| ) |
Definition at line 217 of file console_ops.c.
References console_lb_add_str__internal(), and SpaceConsole::history.
Referenced by history_append_exec(), and report_replay_exec().
| static ConsoleLine* console_history_find | ( | SpaceConsole * | sc, |
| const char * | str, | ||
| ConsoleLine * | cl_ignore | ||
| ) | [static] |
Definition at line 93 of file console_ops.c.
References SpaceConsole::history, ListBase::last, ConsoleLine::line, NULL, and ConsoleLine::prev.
Referenced by history_append_exec(), and history_cycle_exec().
| void console_history_free | ( | SpaceConsole * | sc, |
| ConsoleLine * | cl | ||
| ) |
Definition at line 70 of file console_ops.c.
References BLI_remlink(), SpaceConsole::history, ConsoleLine::line, and MEM_freeN().
Referenced by clear_exec(), console_free(), history_append_exec(), and history_cycle_exec().
| ConsoleLine* console_history_verify | ( | const bContext * | C | ) |
Definition at line 228 of file console_ops.c.
References console_history_add(), CTX_wm_space_console(), SpaceConsole::history, ListBase::last, and NULL.
| static ConsoleLine* console_lb_add__internal | ( | ListBase * | lb, |
| ConsoleLine * | from | ||
| ) | [static] |
Definition at line 169 of file console_ops.c.
References BLI_addtail(), BLI_strdup(), ConsoleLine::cursor, ConsoleLine::len, ConsoleLine::len_alloc, ConsoleLine::line, MEM_callocN(), and ConsoleLine::type.
Referenced by console_history_add().
| static ConsoleLine* console_lb_add_str__internal | ( | ListBase * | lb, |
| char * | str, | ||
| int | own | ||
| ) | [static] |
Definition at line 206 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 int console_line_cursor_set | ( | ConsoleLine * | cl, |
| int | cursor | ||
| ) | [static] |
Definition at line 109 of file console_ops.c.
References ConsoleLine::cursor, and ConsoleLine::len.
Referenced by history_append_exec(), and move_exec().
| static int console_line_insert | ( | ConsoleLine * | ci, |
| char * | str | ||
| ) | [static] |
Definition at line 253 of file console_ops.c.
References console_line_verify_length(), ConsoleLine::cursor, ConsoleLine::len, and ConsoleLine::line.
Referenced by insert_exec(), and paste_exec().
| static void console_line_verify_length | ( | ConsoleLine * | ci, |
| int | len | ||
| ) | [static] |
Definition at line 239 of file console_ops.c.
References ConsoleLine::len, ConsoleLine::len_alloc, ConsoleLine::line, MEM_callocN(), and MEM_freeN().
Referenced by console_line_insert().
| static int console_modal_select | ( | bContext * | C, |
| wmOperator * | op, | ||
| wmEvent * | event | ||
| ) | [static] |
Definition at line 928 of file console_ops.c.
References console_modal_select_apply(), LEFTMOUSE, MIDDLEMOUSE, MOUSEMOVE, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, RIGHTMOUSE, set_cursor_exit(), and wmEvent::type.
Referenced by CONSOLE_OT_select_set().
| static void console_modal_select_apply | ( | bContext * | C, |
| wmOperator * | op, | ||
| wmEvent * | event | ||
| ) | [static] |
Definition at line 870 of file console_ops.c.
References CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), wmOperator::customdata, ED_area_tag_redraw(), SpaceConsole::sel_end, SpaceConsole::sel_start, set_cursor_to_pos(), and TRUE.
Referenced by console_modal_select(), and console_modal_select_invoke().
| static int console_modal_select_cancel | ( | bContext * | C, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 944 of file console_ops.c.
References OPERATOR_FINISHED, and set_cursor_exit().
Referenced by CONSOLE_OT_select_set().
| static int console_modal_select_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| wmEvent * | event | ||
| ) | [static] |
Definition at line 907 of file console_ops.c.
References 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().
| void CONSOLE_OT_clear | ( | wmOperatorType * | ot | ) |
Definition at line 529 of file console_ops.c.
References clear_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by console_operatortypes().
| void CONSOLE_OT_copy | ( | wmOperatorType * | ot | ) |
Definition at line 775 of file console_ops.c.
References copy_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, and wmOperatorType::poll.
Referenced by console_operatortypes().
| void CONSOLE_OT_delete | ( | wmOperatorType * | ot | ) |
Definition at line 486 of file console_ops.c.
References DEL_NEXT_CHAR, delete_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, wmOperatorType::poll, RNA_def_enum(), and wmOperatorType::srna.
Referenced by console_operatortypes().
| void CONSOLE_OT_history_append | ( | wmOperatorType * | ot | ) |
Definition at line 643 of file console_ops.c.
References wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, history_append_exec(), wmOperatorType::idname, wmOperatorType::name, 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 595 of file console_ops.c.
References wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, history_cycle_exec(), wmOperatorType::idname, wmOperatorType::name, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by console_operatortypes().
| void CONSOLE_OT_insert | ( | wmOperatorType * | ot | ) |
Definition at line 417 of file console_ops.c.
References wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, insert_exec(), insert_invoke(), wmOperatorType::invoke, wmOperatorType::name, wmOperatorType::poll, RNA_def_string(), and wmOperatorType::srna.
Referenced by console_operatortypes().
| void CONSOLE_OT_move | ( | wmOperatorType * | ot | ) |
Definition at line 348 of file console_ops.c.
References wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, LINE_BEGIN, move_exec(), wmOperatorType::name, wmOperatorType::poll, RNA_def_enum(), and wmOperatorType::srna.
Referenced by console_operatortypes().
| void CONSOLE_OT_paste | ( | wmOperatorType * | ot | ) |
Definition at line 826 of file console_ops.c.
References wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, paste_exec(), and wmOperatorType::poll.
Referenced by console_operatortypes().
| void CONSOLE_OT_scrollback_append | ( | wmOperatorType * | ot | ) |
Definition at line 684 of file console_ops.c.
References CONSOLE_LINE_ERROR, CONSOLE_LINE_INFO, CONSOLE_LINE_INPUT, CONSOLE_LINE_OUTPUT, wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, NULL, wmOperatorType::poll, RNA_def_enum(), RNA_def_string(), scrollback_append_exec(), and wmOperatorType::srna.
Referenced by console_operatortypes().
| void CONSOLE_OT_select_set | ( | wmOperatorType * | ot | ) |
Definition at line 950 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, and wmOperatorType::poll.
Referenced by console_operatortypes().
| ConsoleLine* console_scrollback_add_str | ( | SpaceConsole * | sc, |
| char * | str, | ||
| int | own | ||
| ) |
Definition at line 221 of file console_ops.c.
References console_lb_add_str__internal(), console_select_offset(), ConsoleLine::len, and SpaceConsole::scrollback.
Referenced by scrollback_append_exec().
| void console_scrollback_free | ( | SpaceConsole * | sc, |
| ConsoleLine * | cl | ||
| ) |
Definition at line 76 of file console_ops.c.
References BLI_remlink(), ConsoleLine::line, MEM_freeN(), and SpaceConsole::scrollback.
Referenced by clear_exec(), console_free(), and console_scrollback_limit().
| static void console_scrollback_limit | ( | SpaceConsole * | sc | ) | [static] |
Definition at line 83 of file console_ops.c.
References BLI_countlist(), console_scrollback_free(), ListBase::first, and SpaceConsole::scrollback.
Referenced by scrollback_append_exec().
| static void console_select_offset | ( | SpaceConsole * | sc, |
| const int | offset | ||
| ) | [static] |
Definition at line 64 of file console_ops.c.
References SpaceConsole::sel_end, and SpaceConsole::sel_start.
Referenced by console_scrollback_add_str(), delete_exec(), history_append_exec(), history_cycle_exec(), insert_exec(), and paste_exec().
| static void console_textview_update_rect | ( | SpaceConsole * | sc, |
| ARegion * | ar | ||
| ) | [static] |
Definition at line 57 of file console_ops.c.
References console_textview_height(), UI_view2d_totRect_set(), ARegion::v2d, and ARegion::winx.
Referenced by clear_exec(), delete_exec(), history_cycle_exec(), insert_exec(), paste_exec(), and scrollback_append_exec().
| static int copy_exec | ( | bContext * | C, |
| wmOperator * | UNUSEDop | ||
| ) | [static] |
Definition at line 709 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(), console_scrollback_prompt_begin(), console_scrollback_prompt_end(), CTX_wm_space_console(), ListBase::first, ConsoleLine::len, ConsoleLine::line, MAX2, MEM_freeN(), MIN2, ConsoleLine::next, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, SpaceConsole::scrollback, SpaceConsole::sel_end, SpaceConsole::sel_start, and WM_clipboard_text_set().
Referenced by CONSOLE_OT_copy().
| static char cursor_char | ( | ConsoleLine * | cl | ) | [static] |
Definition at line 124 of file console_ops.c.
References ConsoleLine::cursor, and ConsoleLine::line.
Referenced by move_exec().
| static char cursor_char_prev | ( | ConsoleLine * | cl | ) | [static] |
Definition at line 130 of file console_ops.c.
References ConsoleLine::cursor, and ConsoleLine::line.
Referenced by move_exec().
| static int delete_exec | ( | bContext * | C, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 441 of file console_ops.c.
References console_history_verify(), console_select_offset(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ConsoleLine::cursor, DEL_NEXT_CHAR, DEL_PREV_CHAR, ED_area_tag_redraw(), ConsoleLine::len, ConsoleLine::line, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, and RNA_enum_get().
Referenced by CONSOLE_OT_delete().
| static int history_append_exec | ( | bContext * | C, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 612 of file console_ops.c.
References console_history_add_str(), console_history_find(), console_history_free(), console_history_verify(), console_line_cursor_set(), console_select_offset(), CTX_wm_area(), 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(), and str.
Referenced by CONSOLE_OT_history_append().
| static int history_cycle_exec | ( | bContext * | C, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 548 of file console_ops.c.
References BLI_addhead(), BLI_addtail(), BLI_remlink(), console_history_add(), console_history_find(), console_history_free(), console_history_verify(), 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, ListBase::last, ConsoleLine::len, ConsoleLine::line, OPERATOR_FINISHED, ConsoleLine::prev, wmOperator::ptr, and RNA_boolean_get().
Referenced by CONSOLE_OT_history_cycle().
| static int insert_exec | ( | bContext * | C, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 364 of file console_ops.c.
References console_history_verify(), console_line_insert(), console_select_offset(), console_textview_update_rect(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), ConsoleLine::cursor, ED_area_tag_redraw(), MEM_freeN(), MEM_mallocN(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_string_get_alloc(), str, and TAB_LENGTH.
Referenced by CONSOLE_OT_insert(), and insert_invoke().
| static int insert_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| wmEvent * | event | ||
| ) | [static] |
Definition at line 398 of file console_ops.c.
References wmEvent::ctrl, insert_exec(), OPERATOR_PASS_THROUGH, wmEvent::oskey, wmOperator::ptr, RNA_string_length(), RNA_string_set(), and str.
Referenced by CONSOLE_OT_insert().
| static int move_exec | ( | bContext * | C, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 288 of file console_ops.c.
References console_history_verify(), console_line_cursor_set(), CTX_wm_area(), ConsoleLine::cursor, cursor_char(), cursor_char_prev(), ED_area_tag_redraw(), FALSE, LINE_BEGIN, LINE_END, NEXT_CHAR, NEXT_WORD, OPERATOR_FINISHED, PREV_CHAR, PREV_WORD, wmOperator::ptr, RNA_enum_get(), text_check_delim(), text_check_whitespace(), and TRUE.
Referenced by CONSOLE_OT_move().
| static int paste_exec | ( | bContext * | C, |
| wmOperator * | UNUSEDop | ||
| ) | [static] |
Definition at line 789 of file console_ops.c.
References console_history_verify(), console_line_insert(), 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().
| static int scrollback_append_exec | ( | bContext * | C, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 662 of file console_ops.c.
References 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, and ConsoleLine::type.
Referenced by CONSOLE_OT_scrollback_append().
| static void set_cursor_exit | ( | bContext * | UNUSEDC, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 892 of file console_ops.c.
References wmOperator::customdata, and MEM_freeN().
Referenced by console_modal_select(), and console_modal_select_cancel().
| static void set_cursor_to_pos | ( | SpaceConsole * | sc, |
| ARegion * | ar, | ||
| SetConsoleCursor * | scu, | ||
| int | mval[2], | ||
| int | UNUSEDsel | ||
| ) | [static] |
Definition at line 846 of file console_ops.c.
References console_char_pick(), SpaceConsole::sel_end, SetConsoleCursor::sel_init, and SpaceConsole::sel_start.
Referenced by console_modal_select_apply().
EnumPropertyItem delete_type_items[] [static] |
{
{DEL_NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
{DEL_PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
{0, NULL, 0, NULL, NULL}}
Definition at line 434 of file console_ops.c.
EnumPropertyItem move_type_items[] [static] |
{
{LINE_BEGIN, "LINE_BEGIN", 0, "Line Begin", ""},
{LINE_END, "LINE_END", 0, "Line End", ""},
{PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
{NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
{PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""},
{NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
{0, NULL, 0, NULL, NULL}}
Definition at line 279 of file console_ops.c.