Blender  V3.3
Classes | Macros | Typedefs | Functions | Variables
console_ops.c File Reference
#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
 

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 ConsoleLineconsole_history_find (SpaceConsole *sc, const char *str, ConsoleLine *cl_ignore)
 
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 int console_line_insert (ConsoleLine *ci, char *str)
 
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 *UNUSED(op))
 
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 *UNUSED(op))
 
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 *UNUSED(op))
 
void CONSOLE_OT_copy (wmOperatorType *ot)
 
static int console_paste_exec (bContext *C, wmOperator *UNUSED(op))
 
void CONSOLE_OT_paste (wmOperatorType *ot)
 
static void console_cursor_set_to_pos (SpaceConsole *sc, ARegion *region, SetConsoleCursor *scu, const int mval[2], int UNUSED(sel))
 
static void console_modal_select_apply (bContext *C, wmOperator *op, const wmEvent *event)
 
static void console_cursor_set_exit (bContext *UNUSED(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_selectword_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
 
void CONSOLE_OT_select_word (wmOperatorType *ot)
 
Indent or Autocomplete Operator
static int console_indent_or_autocomplete_exec (bContext *C, wmOperator *UNUSED(op))
 
void CONSOLE_OT_indent_or_autocomplete (wmOperatorType *ot)
 
Indent Operator
static int console_indent_exec (bContext *C, wmOperator *UNUSED(op))
 
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 367 of file console_ops.c.

Typedef Documentation

◆ SetConsoleCursor

Function Documentation

◆ console_clear_exec()

static int console_clear_exec ( bContext C,
wmOperator op 
)
static

◆ console_clear_line_exec()

static int console_clear_line_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ console_copy_exec()

static int console_copy_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ console_cursor_set_exit()

static void console_cursor_set_exit ( bContext UNUSEDC,
wmOperator op 
)
static

◆ console_cursor_set_to_pos()

static void console_cursor_set_to_pos ( SpaceConsole sc,
ARegion region,
SetConsoleCursor scu,
const int  mval[2],
int   UNUSEDsel 
)
static

◆ console_delete_exec()

static int console_delete_exec ( bContext C,
wmOperator op 
)
static

◆ 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()

static int console_history_append_exec ( bContext C,
wmOperator op 
)
static

◆ console_history_cycle_exec()

static int console_history_cycle_exec ( bContext C,
wmOperator op 
)
static

◆ console_history_find()

static ConsoleLine* console_history_find ( SpaceConsole sc,
const char *  str,
ConsoleLine cl_ignore 
)
static

◆ console_history_free()

void console_history_free ( SpaceConsole sc,
ConsoleLine cl 
)

◆ console_history_verify()

ConsoleLine* console_history_verify ( const bContext C)

◆ console_indent_exec()

static int console_indent_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ console_indent_or_autocomplete_exec()

static int console_indent_or_autocomplete_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ console_insert_exec()

static int console_insert_exec ( bContext C,
wmOperator op 
)
static

◆ console_insert_invoke()

static int console_insert_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ 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 256 of file console_ops.c.

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

Referenced by console_selectword_invoke().

◆ console_line_cursor_set()

static bool console_line_cursor_set ( ConsoleLine cl,
int  cursor 
)
static

◆ console_line_insert()

static int console_line_insert ( ConsoleLine ci,
char *  str 
)
static

◆ console_line_verify_length()

static void console_line_verify_length ( ConsoleLine ci,
int  len 
)
static

◆ console_modal_select()

static int console_modal_select ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ console_modal_select_apply()

static void console_modal_select_apply ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ console_modal_select_cancel()

static void console_modal_select_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 1205 of file console_ops.c.

References C, and console_cursor_set_exit().

Referenced by CONSOLE_OT_select_set().

◆ console_modal_select_invoke()

static int console_modal_select_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ console_move_exec()

static int console_move_exec ( bContext C,
wmOperator op 
)
static

◆ CONSOLE_OT_clear()

void CONSOLE_OT_clear ( wmOperatorType ot)

◆ CONSOLE_OT_clear_line()

void CONSOLE_OT_clear_line ( wmOperatorType ot)

◆ CONSOLE_OT_copy()

void CONSOLE_OT_copy ( wmOperatorType ot)

◆ CONSOLE_OT_delete()

void CONSOLE_OT_delete ( wmOperatorType ot)

◆ CONSOLE_OT_history_append()

void CONSOLE_OT_history_append ( wmOperatorType ot)

◆ CONSOLE_OT_history_cycle()

void CONSOLE_OT_history_cycle ( wmOperatorType ot)

◆ CONSOLE_OT_indent()

void CONSOLE_OT_indent ( wmOperatorType ot)

◆ CONSOLE_OT_indent_or_autocomplete()

void CONSOLE_OT_indent_or_autocomplete ( wmOperatorType ot)

◆ CONSOLE_OT_insert()

void CONSOLE_OT_insert ( wmOperatorType ot)

◆ CONSOLE_OT_move()

void CONSOLE_OT_move ( wmOperatorType ot)

◆ CONSOLE_OT_paste()

void CONSOLE_OT_paste ( wmOperatorType ot)

◆ CONSOLE_OT_scrollback_append()

void CONSOLE_OT_scrollback_append ( wmOperatorType ot)

◆ CONSOLE_OT_select_set()

void CONSOLE_OT_select_set ( wmOperatorType ot)

◆ CONSOLE_OT_select_word()

void CONSOLE_OT_select_word ( wmOperatorType ot)

◆ CONSOLE_OT_unindent()

void CONSOLE_OT_unindent ( wmOperatorType ot)

◆ console_paste_exec()

static int console_paste_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ console_scroll_bottom()

static void console_scroll_bottom ( ARegion region)
static

◆ console_scrollback_add_str()

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

◆ console_scrollback_append_exec()

static int console_scrollback_append_exec ( bContext C,
wmOperator op 
)
static

◆ 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()

static void console_select_offset ( SpaceConsole sc,
const int  offset 
)
static

◆ console_selectword_invoke()

static int console_selectword_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent event 
)
static

◆ console_textview_update_rect()

void console_textview_update_rect ( SpaceConsole sc,
ARegion region 
)

◆ console_unindent_exec()

static int console_unindent_exec ( bContext C,
wmOperator UNUSEDop 
)
static

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, NULL, 0, NULL, NULL},
}
@ DEL_PREV_WORD
Definition: curve_intern.h:24
@ DEL_PREV_CHAR
Definition: curve_intern.h:22
@ DEL_NEXT_WORD
Definition: curve_intern.h:23
@ DEL_NEXT_CHAR
Definition: curve_intern.h:21

Definition at line 592 of file console_ops.c.

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, NULL, 0, NULL, NULL},
}
#define NEXT_CHAR(fmt)
@ LINE_BEGIN
Definition: curve_intern.h:31
@ PREV_WORD
Definition: curve_intern.h:35
@ PREV_CHAR
Definition: curve_intern.h:33
@ LINE_END
Definition: curve_intern.h:32
@ NEXT_WORD
Definition: curve_intern.h:36

Definition at line 286 of file console_ops.c.

Referenced by CONSOLE_OT_move().