99 if (cl == cl_ignore) {
119 else if (cursor > cl->
len) {
120 cursor_new = cl->
len;
126 if (cursor_new == cl->
cursor) {
135 static void console_lb_debug__internal(
ListBase *lb)
140 for (cl = lb->
first; cl; cl = cl->
next) {
141 printf(
"<%s> ", cl->
line);
146 static void console_history_debug(
const bContext *
C)
150 console_lb_debug__internal(&sc->
history);
232 int new_len =
len + 1;
234 int new_len = (
len + 1) * 2;
277 offset += cl->
len + 1;
286 *r_cl_offset = offset;
287 *r_col = offset -
pos;
301 {
LINE_BEGIN,
"LINE_BEGIN", 0,
"Line Begin",
""},
302 {
LINE_END,
"LINE_END", 0,
"Line End",
""},
303 {
PREV_CHAR,
"PREVIOUS_CHARACTER", 0,
"Previous Character",
""},
304 {
NEXT_CHAR,
"NEXT_CHARACTER", 0,
"Next Character",
""},
305 {
PREV_WORD,
"PREVIOUS_WORD", 0,
"Previous Word",
""},
306 {
NEXT_WORD,
"NEXT_WORD", 0,
"Next Word",
""},
390 if (
str[0] ==
'\t' &&
str[1] ==
'\0') {
462 ot->
srna,
"text",
NULL, 0,
"Text",
"Text to insert at the cursor position");
474 if (text_before_cursor) {
486 ot->
name =
"Indent or Autocomplete";
487 ot->
idname =
"CONSOLE_OT_indent_or_autocomplete";
512 for (spaces = 0; spaces < ci->
len; spaces++) {
513 if (ci->
line[spaces] !=
' ') {
559 for (spaces = 0; spaces < ci->
len; spaces++) {
560 if (ci->
line[spaces] !=
' ') {
605 {
DEL_PREV_CHAR,
"PREVIOUS_CHARACTER", 0,
"Previous Character",
""},
703 "Which part of the text to delete");
734 ot->
idname =
"CONSOLE_OT_clear_line";
796 int prev_len = ci->
len;
843 ot->
name =
"History Cycle";
845 ot->
idname =
"CONSOLE_OT_history_cycle";
866 int prev_len = ci->
len;
899 ot->
name =
"History Append";
901 ot->
idname =
"CONSOLE_OT_history_append";
910 ot->
srna,
"current_character", 0, 0, INT_MAX,
"Cursor",
"The index of the cursor", 0, 10000);
915 "Remove duplicate items in the history");
959 ot->
name =
"Scrollback Append";
961 ot->
idname =
"CONSOLE_OT_scrollback_append";
971 console_line_type_items,
974 "Console output type");
997 offset += cl->
len + 1;
1007 sel[0] = offset - sc->
sel_end;
1011 if (sel[0] <= cl->
len && sel[1] >= 0) {
1012 int sta =
max_ii(sel[0], 0);
1022 sel[0] -= cl->
len + 1;
1023 sel[1] -= cl->
len + 1;
1041 ot->
name =
"Copy to Clipboard";
1060 char *buf_step, *buf_next;
1062 if (buf_str ==
NULL) {
1068 while ((buf_next = buf_step) && buf_next[0] !=
'\0') {
1069 buf_step = strchr(buf_next,
'\n');
1075 if (buf_next != buf_str) {
1096 ot->
name =
"Paste from Clipboard";
1125 if (pos < scu->sel_init) {
1146 mval[0] =
event->mval[0];
1147 mval[1] =
event->mval[1];
1199 switch (event->
type) {
1224 ot->
name =
"Set Selection";
1225 ot->
idname =
"CONSOLE_OT_select_set";
1250 int sel[2] = {n, n};
1256 sel[0] = offset - sel[0];
1257 sel[1] = offset - sel[1];
1274 ot->
name =
"Select Word";
1276 ot->
idname =
"CONSOLE_OT_select_word";
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct SpaceConsole * CTX_wm_space_console(const bContext *C)
char * txt_sel_to_buf(struct Text *text, int *r_buf_strlen)
bool txt_has_sel(struct Text *text)
A dynamically sized string ADT.
DynStr * BLI_dynstr_new(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_dynstr_nappend(DynStr *__restrict ds, const char *cstr, int len) ATTR_NONNULL()
int BLI_dynstr_get_len(DynStr *ds) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL()
char * BLI_dynstr_get_cstring(DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_dynstr_append(DynStr *__restrict ds, const char *cstr) ATTR_NONNULL()
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
char * BLI_strdupn(const char *str, const size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
void BLI_str_cursor_step_utf8(const char *str, size_t maxlen, int *pos, eStrCursorJumpDirection direction, eStrCursorJumpType jump, bool use_init_step)
int BLI_str_utf8_size_safe(const char *p) ATTR_NONNULL()
size_t BLI_str_utf8_from_unicode(unsigned int c, char *outbuf)
void ED_area_tag_redraw(ScrArea *area)
bool ED_operator_console_active(struct bContext *C)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei stride
Read Guarded memory(de)allocation.
void UI_view2d_totRect_set(struct View2D *v2d, int width, int height)
void console_scrollback_prompt_end(SpaceConsole *sc, ConsoleLine *cl_dummy)
int console_textview_height(SpaceConsole *sc, const ARegion *region)
void console_scrollback_prompt_begin(SpaceConsole *sc, ConsoleLine *cl_dummy)
int console_char_pick(SpaceConsole *sc, const ARegion *region, const int mval[2])
static int console_selectword_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
static bool console_line_cursor_set(ConsoleLine *cl, int cursor)
static int console_copy_exec(bContext *C, wmOperator *UNUSED(op))
static int console_line_insert(ConsoleLine *ci, char *str)
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 void console_modal_select_cancel(bContext *C, wmOperator *op)
static void console_line_verify_length(ConsoleLine *ci, int len)
static ConsoleLine * console_lb_add__internal(ListBase *lb, ConsoleLine *from)
static int console_clear_line_exec(bContext *C, wmOperator *UNUSED(op))
ConsoleLine * console_history_add_str(SpaceConsole *sc, char *str, bool own)
static int console_indent_or_autocomplete_exec(bContext *C, wmOperator *UNUSED(op))
static void console_cursor_set_to_pos(SpaceConsole *sc, ARegion *region, SetConsoleCursor *scu, const int mval[2], int UNUSED(sel))
static int console_unindent_exec(bContext *C, wmOperator *UNUSED(op))
void CONSOLE_OT_copy(wmOperatorType *ot)
void CONSOLE_OT_clear(wmOperatorType *ot)
static const EnumPropertyItem console_move_type_items[]
static const EnumPropertyItem console_delete_type_items[]
static bool console_line_column_from_index(SpaceConsole *sc, const int pos, ConsoleLine **r_cl, int *r_cl_offset, int *r_col)
void console_textview_update_rect(SpaceConsole *sc, ARegion *region)
void CONSOLE_OT_select_word(wmOperatorType *ot)
void CONSOLE_OT_delete(wmOperatorType *ot)
void CONSOLE_OT_indent(wmOperatorType *ot)
void CONSOLE_OT_select_set(wmOperatorType *ot)
static int console_history_append_exec(bContext *C, wmOperator *op)
static void console_scrollback_limit(SpaceConsole *sc)
static int console_history_cycle_exec(bContext *C, wmOperator *op)
static int console_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event)
struct SetConsoleCursor SetConsoleCursor
static int console_scrollback_append_exec(bContext *C, wmOperator *op)
static int console_move_exec(bContext *C, wmOperator *op)
void CONSOLE_OT_indent_or_autocomplete(wmOperatorType *ot)
void CONSOLE_OT_move(wmOperatorType *ot)
static int console_modal_select(bContext *C, wmOperator *op, const wmEvent *event)
static void console_scroll_bottom(ARegion *region)
void console_history_free(SpaceConsole *sc, ConsoleLine *cl)
void console_scrollback_free(SpaceConsole *sc, ConsoleLine *cl)
void CONSOLE_OT_clear_line(wmOperatorType *ot)
static int console_insert_exec(bContext *C, wmOperator *op)
void CONSOLE_OT_scrollback_append(wmOperatorType *ot)
static int console_paste_exec(bContext *C, wmOperator *UNUSED(op))
void CONSOLE_OT_insert(wmOperatorType *ot)
ConsoleLine * console_scrollback_add_str(SpaceConsole *sc, char *str, bool own)
static ConsoleLine * console_lb_add_str__internal(ListBase *lb, char *str, bool own)
void CONSOLE_OT_history_cycle(wmOperatorType *ot)
void CONSOLE_OT_unindent(wmOperatorType *ot)
static int console_delete_exec(bContext *C, wmOperator *op)
void CONSOLE_OT_history_append(wmOperatorType *ot)
static ConsoleLine * console_history_add(SpaceConsole *sc, ConsoleLine *from)
static int console_clear_exec(bContext *C, wmOperator *op)
void CONSOLE_OT_paste(wmOperatorType *ot)
static int console_modal_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
ConsoleLine * console_history_verify(const bContext *C)
static int console_indent_exec(bContext *C, wmOperator *UNUSED(op))
static ConsoleLine * console_history_find(SpaceConsole *sc, const char *str, ConsoleLine *cl_ignore)
static void console_select_offset(SpaceConsole *sc, const int offset)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
void(* MEM_freeN)(void *vmemh)
void *(* MEM_recallocN_id)(void *vmemh, size_t len, const char *str)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
int RNA_string_length(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct ConsoleLine * next
struct ConsoleLine * prev
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
int WM_operator_name_call(bContext *C, const char *opstring, short context, PointerRNA *properties)
void WM_clipboard_text_set(const char *buf, bool selection)
char * WM_clipboard_text_get(bool selection, int *r_len)