Blender V2.61 - r43446
|
#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 374 of file console_ops.c.
Referenced by console_insert_exec().
typedef struct SetConsoleCursor SetConsoleCursor |
static int console_clear_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 518 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 int console_copy_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 738 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 void console_cursor_set_exit | ( | bContext * | UNUSEDC, |
wmOperator * | op | ||
) | [static] |
Definition at line 923 of file console_ops.c.
References wmOperator::customdata, and MEM_freeN().
Referenced by console_modal_select(), and console_modal_select_cancel().
static void console_cursor_set_to_pos | ( | SpaceConsole * | sc, |
ARegion * | ar, | ||
SetConsoleCursor * | scu, | ||
int | mval[2], | ||
int | UNUSEDsel | ||
) | [static] |
Definition at line 877 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().
static int console_delete_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 454 of file console_ops.c.
References 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_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 ConsoleLine* console_history_add | ( | const bContext * | C, |
ConsoleLine * | from | ||
) | [static] |
Definition at line 196 of file console_ops.c.
References console_lb_add__internal(), CTX_wm_space_console(), and SpaceConsole::history.
Referenced by console_history_cycle_exec(), and console_history_verify().
ConsoleLine* console_history_add_str | ( | SpaceConsole * | sc, |
char * | str, | ||
int | own | ||
) |
Definition at line 223 of file console_ops.c.
References console_lb_add_str__internal(), and SpaceConsole::history.
Referenced by console_history_append_exec(), and report_replay_exec().
static int console_history_append_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 629 of file console_ops.c.
References 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(), and str.
Referenced by CONSOLE_OT_history_append().
static int console_history_cycle_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 563 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_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, ListBase::last, ConsoleLine::len, ConsoleLine::line, OPERATOR_FINISHED, ConsoleLine::prev, wmOperator::ptr, and RNA_boolean_get().
Referenced by CONSOLE_OT_history_cycle().
static ConsoleLine* console_history_find | ( | SpaceConsole * | sc, |
const char * | str, | ||
ConsoleLine * | cl_ignore | ||
) | [static] |
Definition at line 99 of file console_ops.c.
References SpaceConsole::history, ListBase::last, ConsoleLine::line, NULL, and ConsoleLine::prev.
Referenced by console_history_append_exec(), and console_history_cycle_exec().
void console_history_free | ( | SpaceConsole * | sc, |
ConsoleLine * | cl | ||
) |
Definition at line 76 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 234 of file console_ops.c.
References console_history_add(), CTX_wm_space_console(), SpaceConsole::history, ListBase::last, and NULL.
static int console_insert_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 375 of file console_ops.c.
References 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(), ConsoleLine::cursor, 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 int console_insert_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 411 of file console_ops.c.
References console_insert_exec(), wmEvent::ctrl, OPERATOR_PASS_THROUGH, wmEvent::oskey, wmOperator::ptr, RNA_string_length(), RNA_string_set(), and str.
Referenced by CONSOLE_OT_insert().
static ConsoleLine* console_lb_add__internal | ( | ListBase * | lb, |
ConsoleLine * | from | ||
) | [static] |
Definition at line 175 of file console_ops.c.
References BLI_addtail(), BLI_strdup(), ConsoleLine::cursor, ConsoleLine::len, ConsoleLine::len_alloc, ConsoleLine::line, MEM_callocN(), strlen(), 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 212 of file console_ops.c.
References BLI_addtail(), BLI_strdup(), ConsoleLine::len, ConsoleLine::len_alloc, ConsoleLine::line, MEM_callocN(), str, and strlen().
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 115 of file console_ops.c.
References ConsoleLine::cursor, and ConsoleLine::len.
Referenced by console_history_append_exec(), and console_move_exec().
static int console_line_insert | ( | ConsoleLine * | ci, |
char * | str | ||
) | [static] |
Definition at line 259 of file console_ops.c.
References console_line_verify_length(), ConsoleLine::cursor, len(), ConsoleLine::len, ConsoleLine::line, and strlen().
Referenced by console_insert_exec(), and console_paste_exec().
static void console_line_verify_length | ( | ConsoleLine * | ci, |
int | len | ||
) | [static] |
Definition at line 245 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 959 of file console_ops.c.
References console_cursor_set_exit(), console_modal_select_apply(), LEFTMOUSE, MIDDLEMOUSE, MOUSEMOVE, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, RIGHTMOUSE, 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 901 of file console_ops.c.
References console_cursor_set_to_pos(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_console(), wmOperator::customdata, ED_area_tag_redraw(), SpaceConsole::sel_end, SpaceConsole::sel_start, 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 975 of file console_ops.c.
References console_cursor_set_exit(), and OPERATOR_FINISHED.
Referenced by CONSOLE_OT_select_set().
static int console_modal_select_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 938 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().
static int console_move_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 294 of file console_ops.c.
References console_history_verify(), console_line_cursor_set(), console_scroll_bottom(), CTX_wm_area(), CTX_wm_region(), 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().
void CONSOLE_OT_clear | ( | wmOperatorType * | ot | ) |
Definition at line 544 of file console_ops.c.
References console_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 804 of file console_ops.c.
References console_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 501 of file console_ops.c.
References console_delete_exec(), DEL_NEXT_CHAR, 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 667 of file console_ops.c.
References console_history_append_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::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 612 of file console_ops.c.
References console_history_cycle_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_insert | ( | wmOperatorType * | ot | ) |
Definition at line 430 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, wmOperatorType::poll, RNA_def_string(), and wmOperatorType::srna.
Referenced by console_operatortypes().
void CONSOLE_OT_move | ( | wmOperatorType * | ot | ) |
Definition at line 359 of file console_ops.c.
References console_move_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, LINE_BEGIN, wmOperatorType::name, wmOperatorType::poll, RNA_def_enum(), and wmOperatorType::srna.
Referenced by console_operatortypes().
void CONSOLE_OT_paste | ( | wmOperatorType * | ot | ) |
Definition at line 857 of file console_ops.c.
References console_paste_exec(), wmOperatorType::description, ED_operator_console_active(), wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, and wmOperatorType::poll.
Referenced by console_operatortypes().
void CONSOLE_OT_scrollback_append | ( | wmOperatorType * | ot | ) |
Definition at line 713 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, 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 981 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().
static int console_paste_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 818 of file console_ops.c.
References 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().
static void console_scroll_bottom | ( | ARegion * | ar | ) | [static] |
Definition at line 56 of file console_ops.c.
References View2D::cur, ARegion::v2d, View2D::winy, rctf::ymax, and rctf::ymin.
Referenced by console_delete_exec(), console_history_append_exec(), console_history_cycle_exec(), console_insert_exec(), console_move_exec(), and console_paste_exec().
ConsoleLine* console_scrollback_add_str | ( | SpaceConsole * | sc, |
char * | str, | ||
int | own | ||
) |
Definition at line 227 of file console_ops.c.
References console_lb_add_str__internal(), console_select_offset(), ConsoleLine::len, and SpaceConsole::scrollback.
Referenced by console_scrollback_append_exec().
static int console_scrollback_append_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 686 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().
void console_scrollback_free | ( | SpaceConsole * | sc, |
ConsoleLine * | cl | ||
) |
Definition at line 82 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 void console_scrollback_limit | ( | SpaceConsole * | sc | ) | [static] |
Definition at line 89 of file console_ops.c.
References BLI_countlist(), console_scrollback_free(), ListBase::first, SpaceConsole::scrollback, UserDef::scrollback, and U.
Referenced by console_scrollback_append_exec().
static void console_select_offset | ( | SpaceConsole * | sc, |
const int | offset | ||
) | [static] |
Definition at line 70 of file console_ops.c.
References SpaceConsole::sel_end, and SpaceConsole::sel_start.
Referenced by console_delete_exec(), console_history_append_exec(), console_history_cycle_exec(), console_insert_exec(), console_paste_exec(), and console_scrollback_add_str().
static void console_textview_update_rect | ( | SpaceConsole * | sc, |
ARegion * | ar | ||
) | [static] |
Definition at line 63 of file console_ops.c.
References console_textview_height(), UI_view2d_totRect_set(), ARegion::v2d, and ARegion::winx.
Referenced by console_clear_exec(), console_delete_exec(), console_history_cycle_exec(), console_insert_exec(), console_paste_exec(), and console_scrollback_append_exec().
static char cursor_char | ( | ConsoleLine * | cl | ) | [static] |
Definition at line 130 of file console_ops.c.
References ConsoleLine::cursor, and ConsoleLine::line.
Referenced by console_move_exec().
static char cursor_char_prev | ( | ConsoleLine * | cl | ) | [static] |
Definition at line 136 of file console_ops.c.
References ConsoleLine::cursor, and ConsoleLine::line.
Referenced by console_move_exec().
EnumPropertyItem console_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 447 of file console_ops.c.
EnumPropertyItem console_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 285 of file console_ops.c.