Blender V4.3
console_ops.cc File Reference
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <sys/stat.h>
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "BLI_dynstr.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_string_cursor_utf8.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BKE_context.hh"
#include "BKE_report.hh"
#include "BKE_screen.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_screen.hh"
#include "UI_view2d.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "console_intern.hh"

Go to the source code of this file.

Classes

struct  SetConsoleCursor
 

Macros

#define TAB_LENGTH   4
 

Functions

static void console_scroll_bottom (ARegion *region)
 
void console_textview_update_rect (SpaceConsole *sc, ARegion *region)
 
static void console_select_offset (SpaceConsole *sc, const int offset)
 
void console_history_free (SpaceConsole *sc, ConsoleLine *cl)
 
void console_scrollback_free (SpaceConsole *sc, ConsoleLine *cl)
 
static void console_scrollback_limit (SpaceConsole *sc)
 
static bool console_line_cursor_set (ConsoleLine *cl, int cursor)
 
static ConsoleLineconsole_lb_add__internal (ListBase *lb, ConsoleLine *from)
 
static ConsoleLineconsole_history_add (SpaceConsole *sc, ConsoleLine *from)
 
static ConsoleLineconsole_lb_add_str__internal (ListBase *lb, char *str, bool own)
 
ConsoleLineconsole_history_add_str (SpaceConsole *sc, char *str, bool own)
 
ConsoleLineconsole_scrollback_add_str (SpaceConsole *sc, char *str, bool own)
 
ConsoleLineconsole_history_verify (const bContext *C)
 
static void console_line_verify_length (ConsoleLine *ci, int len)
 
static void console_line_insert (ConsoleLine *ci, const char *str, int len)
 
static bool console_line_column_from_index (SpaceConsole *sc, const int pos, ConsoleLine **r_cl, int *r_cl_offset, int *r_col)
 
static int console_move_exec (bContext *C, wmOperator *op)
 
void CONSOLE_OT_move (wmOperatorType *ot)
 
static int console_insert_exec (bContext *C, wmOperator *op)
 
static int console_insert_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void CONSOLE_OT_insert (wmOperatorType *ot)
 
static int console_unindent_exec (bContext *C, wmOperator *)
 
void CONSOLE_OT_unindent (wmOperatorType *ot)
 
static int console_delete_exec (bContext *C, wmOperator *op)
 
void CONSOLE_OT_delete (wmOperatorType *ot)
 
static int console_clear_line_exec (bContext *C, wmOperator *)
 
void CONSOLE_OT_clear_line (wmOperatorType *ot)
 
static int console_clear_exec (bContext *C, wmOperator *op)
 
void CONSOLE_OT_clear (wmOperatorType *ot)
 
static int console_history_cycle_exec (bContext *C, wmOperator *op)
 
void CONSOLE_OT_history_cycle (wmOperatorType *ot)
 
static int console_history_append_exec (bContext *C, wmOperator *op)
 
void CONSOLE_OT_history_append (wmOperatorType *ot)
 
static int console_scrollback_append_exec (bContext *C, wmOperator *op)
 
void CONSOLE_OT_scrollback_append (wmOperatorType *ot)
 
static int console_copy_exec (bContext *C, wmOperator *op)
 
static bool console_copy_poll (bContext *C)
 
void CONSOLE_OT_copy (wmOperatorType *ot)
 
static int console_paste_exec (bContext *C, wmOperator *op)
 
void CONSOLE_OT_paste (wmOperatorType *ot)
 
static void console_cursor_set_to_pos (SpaceConsole *sc, ARegion *region, SetConsoleCursor *scu, const wmEvent *event)
 
static void console_modal_select_apply (bContext *C, wmOperator *op, const wmEvent *event)
 
static void console_cursor_set_exit (bContext *C, wmOperator *op)
 
static int console_modal_select_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int console_modal_select (bContext *C, wmOperator *op, const wmEvent *event)
 
static void console_modal_select_cancel (bContext *C, wmOperator *op)
 
void CONSOLE_OT_select_set (wmOperatorType *ot)
 
static int console_modal_select_all_invoke (bContext *C, wmOperator *, const wmEvent *)
 
void CONSOLE_OT_select_all (wmOperatorType *ot)
 
static int console_selectword_invoke (bContext *C, wmOperator *, const wmEvent *event)
 
void CONSOLE_OT_select_word (wmOperatorType *ot)
 
Utilities
static char * console_select_to_buffer (SpaceConsole *sc)
 
static void console_select_update_primary_clipboard (SpaceConsole *sc)
 
static int console_delete_editable_selection (SpaceConsole *sc)
 
Indent or Autocomplete Operator
static int console_indent_or_autocomplete_exec (bContext *C, wmOperator *)
 
void CONSOLE_OT_indent_or_autocomplete (wmOperatorType *ot)
 
Indent Operator
static int console_indent_exec (bContext *C, wmOperator *)
 
void CONSOLE_OT_indent (wmOperatorType *ot)
 

Variables

static const EnumPropertyItem console_move_type_items []
 
static const EnumPropertyItem console_delete_type_items []
 

Macro Definition Documentation

◆ TAB_LENGTH

#define TAB_LENGTH   4

Definition at line 40 of file console_ops.cc.

Referenced by console_indent_exec(), and console_unindent_exec().

Function Documentation

◆ console_clear_exec()

◆ console_clear_line_exec()

◆ console_copy_exec()

◆ console_copy_poll()

static bool console_copy_poll ( bContext * C)
static

◆ console_cursor_set_exit()

static void console_cursor_set_exit ( bContext * C,
wmOperator * op )
static

◆ console_cursor_set_to_pos()

◆ console_delete_editable_selection()

◆ console_delete_exec()

◆ console_history_add()

static ConsoleLine * console_history_add ( SpaceConsole * sc,
ConsoleLine * from )
static

◆ console_history_add_str()

ConsoleLine * console_history_add_str ( SpaceConsole * sc,
char * str,
bool own )

◆ console_history_append_exec()

◆ console_history_cycle_exec()

◆ console_history_free()

◆ console_history_verify()

◆ console_indent_exec()

◆ console_indent_or_autocomplete_exec()

◆ console_insert_exec()

◆ console_insert_invoke()

◆ console_lb_add__internal()

static ConsoleLine * console_lb_add__internal ( ListBase * lb,
ConsoleLine * from )
static

◆ console_lb_add_str__internal()

static ConsoleLine * console_lb_add_str__internal ( ListBase * lb,
char * str,
bool own )
static

◆ console_line_column_from_index()

static bool console_line_column_from_index ( SpaceConsole * sc,
const int pos,
ConsoleLine ** r_cl,
int * r_cl_offset,
int * r_col )
static

Take an absolute index and give the line/column info.

Note
be sure to call console_scrollback_prompt_begin first

Definition at line 343 of file console_ops.cc.

References ListBase::last, ConsoleLine::len, pos, ConsoleLine::prev, and SpaceConsole::scrollback.

Referenced by console_selectword_invoke().

◆ console_line_cursor_set()

◆ console_line_insert()

static void console_line_insert ( ConsoleLine * ci,
const char * str,
int len )
static

◆ console_line_verify_length()

static void console_line_verify_length ( ConsoleLine * ci,
int len )
static

◆ console_modal_select()

◆ console_modal_select_all_invoke()

◆ console_modal_select_apply()

◆ console_modal_select_cancel()

static void console_modal_select_cancel ( bContext * C,
wmOperator * op )
static

Definition at line 1361 of file console_ops.cc.

References console_cursor_set_exit().

Referenced by CONSOLE_OT_select_set().

◆ console_modal_select_invoke()

◆ console_move_exec()

◆ CONSOLE_OT_clear()

◆ CONSOLE_OT_clear_line()

◆ CONSOLE_OT_copy()

◆ CONSOLE_OT_delete()

◆ CONSOLE_OT_history_append()

◆ CONSOLE_OT_history_cycle()

◆ CONSOLE_OT_indent()

◆ CONSOLE_OT_indent_or_autocomplete()

◆ CONSOLE_OT_insert()

◆ CONSOLE_OT_move()

◆ CONSOLE_OT_paste()

◆ CONSOLE_OT_scrollback_append()

◆ CONSOLE_OT_select_all()

◆ CONSOLE_OT_select_set()

◆ CONSOLE_OT_select_word()

◆ CONSOLE_OT_unindent()

◆ console_paste_exec()

◆ console_scroll_bottom()

◆ console_scrollback_add_str()

ConsoleLine * console_scrollback_add_str ( SpaceConsole * sc,
char * str,
bool own )

◆ console_scrollback_append_exec()

◆ console_scrollback_free()

void console_scrollback_free ( SpaceConsole * sc,
ConsoleLine * cl )

◆ console_scrollback_limit()

static void console_scrollback_limit ( SpaceConsole * sc)
static

◆ console_select_offset()

◆ console_select_to_buffer()

◆ console_select_update_primary_clipboard()

◆ console_selectword_invoke()

◆ console_textview_update_rect()

◆ console_unindent_exec()

Variable Documentation

◆ console_delete_type_items

const EnumPropertyItem console_delete_type_items[]
static
Initial value:
= {
{DEL_NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
{DEL_PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
{DEL_NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
{DEL_PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ DEL_PREV_WORD
@ DEL_PREV_CHAR
@ DEL_NEXT_WORD
@ DEL_NEXT_CHAR

Definition at line 714 of file console_ops.cc.

Referenced by CONSOLE_OT_delete().

◆ console_move_type_items

const EnumPropertyItem console_move_type_items[]
static
Initial value:
= {
{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, nullptr, 0, nullptr, nullptr},
}
#define NEXT_CHAR(fmt)
@ LINE_BEGIN
@ PREV_WORD
@ PREV_CHAR
@ LINE_END
@ NEXT_WORD

Definition at line 373 of file console_ops.cc.

Referenced by CONSOLE_OT_move().