Blender V5.0
text_intern.hh File Reference
#include "DNA_vec_types.h"

Go to the source code of this file.

Classes

struct  blender::ed::text::SpaceText_Runtime

Namespaces

namespace  blender
namespace  blender::ed
namespace  blender::ed::text

Macros

#define TXT_NUMCOL_PAD   1.0f
#define TXT_NUMCOL_WIDTH(st)
#define TXT_BODY_LPAD   1.0f
#define TXT_BODY_LEFT(st)
#define TXT_SCROLL_WIDTH   U.widget_unit
#define TXT_SCROLL_SPACE   ((int)(0.1f * U.widget_unit))
#define TXT_LINE_VPAD   0.3f
#define TXT_LINE_SPACING(st)
#define TXT_LINE_HEIGHT(st)
#define SUGG_LIST_SIZE   7
#define SUGG_LIST_WIDTH   20
#define TOOL_SUGG_LIST   0x01

Enumerations

enum  {
  LINE_BEGIN , LINE_END , FILE_TOP , FILE_BOTTOM ,
  PREV_CHAR , NEXT_CHAR , PREV_WORD , NEXT_WORD ,
  PREV_LINE , NEXT_LINE , PREV_PAGE , NEXT_PAGE
}
enum  { DEL_NEXT_CHAR , DEL_PREV_CHAR , DEL_NEXT_WORD , DEL_PREV_WORD }

Functions

void draw_text_main (SpaceText *st, ARegion *region)
void text_update_line_edited (TextLine *line)
void text_update_edited (Text *text)
void space_text_update_character_width (SpaceText *st)
void space_text_scroll_to_cursor_with_area (SpaceText *st, ScrArea *area, bool center)
void space_text_update_cursor_moved (bContext *C)
int space_text_wrap_width (const SpaceText *st, const ARegion *region)
void space_text_wrap_offset (const SpaceText *st, const ARegion *region, TextLine *linein, int cursin, int *offl, int *offc)
void space_text_wrap_offset_in_line (const SpaceText *st, const ARegion *region, TextLine *linein, int cursin, int *offl, int *offc)
int space_text_get_char_pos (const SpaceText *st, const char *line, int cur)
void space_text_drawcache_tag_update (SpaceText *st, bool full)
void space_text_free_caches (SpaceText *st)
bool space_text_do_suggest_select (SpaceText *st, const ARegion *region, const int mval[2])
void text_pop_suggest_list ()
int space_text_get_visible_lines (const SpaceText *st, const ARegion *region, const char *str)
int space_text_get_span_wrap (const SpaceText *st, const ARegion *region, const TextLine *from, const TextLine *to)
int space_text_get_total_lines (SpaceText *st, const ARegion *region)
void TEXT_OT_new (wmOperatorType *ot)
void TEXT_OT_open (wmOperatorType *ot)
void TEXT_OT_reload (wmOperatorType *ot)
void TEXT_OT_unlink (wmOperatorType *ot)
void TEXT_OT_save (wmOperatorType *ot)
void TEXT_OT_save_as (wmOperatorType *ot)
void TEXT_OT_make_internal (wmOperatorType *ot)
void TEXT_OT_run_script (wmOperatorType *ot)
void TEXT_OT_paste (wmOperatorType *ot)
void TEXT_OT_copy (wmOperatorType *ot)
void TEXT_OT_cut (wmOperatorType *ot)
void TEXT_OT_duplicate_line (wmOperatorType *ot)
void TEXT_OT_convert_whitespace (wmOperatorType *ot)
void TEXT_OT_comment_toggle (wmOperatorType *ot)
void TEXT_OT_unindent (wmOperatorType *ot)
void TEXT_OT_indent (wmOperatorType *ot)
void TEXT_OT_indent_or_autocomplete (wmOperatorType *ot)
void TEXT_OT_line_break (wmOperatorType *ot)
void TEXT_OT_insert (wmOperatorType *ot)
void TEXT_OT_select_line (wmOperatorType *ot)
void TEXT_OT_select_all (wmOperatorType *ot)
void TEXT_OT_select_word (wmOperatorType *ot)
void TEXT_OT_move_lines (wmOperatorType *ot)
void TEXT_OT_jump (wmOperatorType *ot)
void TEXT_OT_move (wmOperatorType *ot)
void TEXT_OT_move_select (wmOperatorType *ot)
void TEXT_OT_delete (wmOperatorType *ot)
void TEXT_OT_overwrite_toggle (wmOperatorType *ot)
void TEXT_OT_scroll (wmOperatorType *ot)
void TEXT_OT_scroll_bar (wmOperatorType *ot)
void TEXT_OT_selection_set (wmOperatorType *ot)
void TEXT_OT_cursor_set (wmOperatorType *ot)
void TEXT_OT_line_number (wmOperatorType *ot)
void TEXT_OT_find (wmOperatorType *ot)
void TEXT_OT_find_set_selected (wmOperatorType *ot)
void TEXT_OT_replace (wmOperatorType *ot)
void TEXT_OT_replace_set_selected (wmOperatorType *ot)
void TEXT_OT_jump_to_file_at_point (wmOperatorType *ot)
void TEXT_OT_start_find (wmOperatorType *ot)
void TEXT_OT_to_3d_object (wmOperatorType *ot)
void TEXT_OT_resolve_conflict (wmOperatorType *ot)
bool text_space_edit_poll (bContext *C)
void TEXT_OT_update_shader (wmOperatorType *ot)
void TEXT_OT_autocomplete (wmOperatorType *ot)

Variables

const char * text_context_dir []

Macro Definition Documentation

◆ SUGG_LIST_SIZE

#define SUGG_LIST_SIZE   7

◆ SUGG_LIST_WIDTH

#define SUGG_LIST_WIDTH   20

Definition at line 60 of file text_intern.hh.

Referenced by draw_suggestion_list(), and space_text_do_suggest_select().

◆ TOOL_SUGG_LIST

#define TOOL_SUGG_LIST   0x01

Definition at line 62 of file text_intern.hh.

Referenced by text_autocomplete_modal().

◆ TXT_BODY_LEFT

#define TXT_BODY_LEFT ( st)

◆ TXT_BODY_LPAD

#define TXT_BODY_LPAD   1.0f

Definition at line 44 of file text_intern.hh.

Referenced by text_line_number_invoke().

◆ TXT_LINE_HEIGHT

◆ TXT_LINE_SPACING

#define TXT_LINE_SPACING ( st)
Value:
((int)(TXT_LINE_VPAD * st->runtime->lheight_px))

Definition at line 55 of file text_intern.hh.

Referenced by draw_text_decoration().

◆ TXT_LINE_VPAD

#define TXT_LINE_VPAD   0.3f

Definition at line 53 of file text_intern.hh.

◆ TXT_NUMCOL_PAD

#define TXT_NUMCOL_PAD   1.0f

Definition at line 38 of file text_intern.hh.

Referenced by draw_text_main().

◆ TXT_NUMCOL_WIDTH

#define TXT_NUMCOL_WIDTH ( st)
Value:
((st)->runtime->cwidth_px * ((st)->runtime->line_number_display_digits + (2 * TXT_NUMCOL_PAD)))
#define TXT_NUMCOL_PAD

Definition at line 40 of file text_intern.hh.

Referenced by draw_text_main(), and text_line_number_invoke().

◆ TXT_SCROLL_SPACE

#define TXT_SCROLL_SPACE   ((int)(0.1f * U.widget_unit))

Definition at line 50 of file text_intern.hh.

Referenced by text_scroll_bar_invoke().

◆ TXT_SCROLL_WIDTH

#define TXT_SCROLL_WIDTH   U.widget_unit

Definition at line 49 of file text_intern.hh.

Referenced by draw_text_main(), and ED_space_text_scroll_to_cursor().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEL_NEXT_CHAR 
DEL_PREV_CHAR 
DEL_NEXT_WORD 
DEL_PREV_WORD 

Definition at line 114 of file text_intern.hh.

◆ anonymous enum

anonymous enum
Enumerator
LINE_BEGIN 
LINE_END 
FILE_TOP 
FILE_BOTTOM 
PREV_CHAR 
NEXT_CHAR 
PREV_WORD 
NEXT_WORD 
PREV_LINE 
NEXT_LINE 
PREV_PAGE 
NEXT_PAGE 

Definition at line 100 of file text_intern.hh.

Function Documentation

◆ draw_text_main()

◆ space_text_do_suggest_select()

◆ space_text_drawcache_tag_update()

◆ space_text_free_caches()

void space_text_free_caches ( SpaceText * st)

Definition at line 783 of file text_draw.cc.

References DrawCache::line_height, MEM_freeN(), and SpaceText::runtime.

Referenced by text_free().

◆ space_text_get_char_pos()

◆ space_text_get_span_wrap()

int space_text_get_span_wrap ( const SpaceText * st,
const ARegion * region,
const TextLine * from,
const TextLine * to )

◆ space_text_get_total_lines()

int space_text_get_total_lines ( SpaceText * st,
const ARegion * region )

◆ space_text_get_visible_lines()

◆ space_text_scroll_to_cursor_with_area()

void space_text_scroll_to_cursor_with_area ( SpaceText * st,
ScrArea * area,
bool center )

Takes an area instead of a region, use for listeners.

Definition at line 1754 of file text_draw.cc.

References BKE_area_find_region_type(), Text::curl, ED_space_text_scroll_to_cursor(), ELEM, RGN_TYPE_WINDOW, and SpaceText::text.

Referenced by space_text_update_cursor_moved().

◆ space_text_update_character_width()

◆ space_text_update_cursor_moved()

◆ space_text_wrap_offset()

void space_text_wrap_offset ( const SpaceText * st,
const ARegion * region,
TextLine * linein,
int cursin,
int * offl,
int * offc )

Sets (offl, offc) for transforming (line, curs) to its wrapped position.

References cursin, and str.

Referenced by draw_brackets(), draw_suggestion_list(), draw_text_decoration(), ED_space_text_region_location_from_cursor(), and ED_space_text_scroll_to_cursor().

◆ space_text_wrap_offset_in_line()

void space_text_wrap_offset_in_line ( const SpaceText * st,
const ARegion * region,
TextLine * linein,
int cursin,
int * offl,
int * offc )

◆ space_text_wrap_width()

◆ TEXT_OT_autocomplete()

◆ TEXT_OT_comment_toggle()

void TEXT_OT_comment_toggle ( wmOperatorType * ot)

◆ TEXT_OT_convert_whitespace()

void TEXT_OT_convert_whitespace ( wmOperatorType * ot)

◆ TEXT_OT_copy()

void TEXT_OT_copy ( wmOperatorType * ot)

Definition at line 1103 of file text_ops.cc.

References ot, text_copy_exec(), and text_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_cursor_set()

void TEXT_OT_cursor_set ( wmOperatorType * ot)

◆ TEXT_OT_cut()

void TEXT_OT_cut ( wmOperatorType * ot)

Definition at line 1144 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_cut_exec(), and text_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_delete()

◆ TEXT_OT_duplicate_line()

void TEXT_OT_duplicate_line ( wmOperatorType * ot)

Definition at line 1057 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_duplicate_line_exec(), and text_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_find()

void TEXT_OT_find ( wmOperatorType * ot)

Definition at line 3836 of file text_ops.cc.

References ot, text_find_exec(), and text_space_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_find_set_selected()

void TEXT_OT_find_set_selected ( wmOperatorType * ot)

Definition at line 3948 of file text_ops.cc.

References ot, text_find_set_selected_exec(), and text_space_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_indent()

void TEXT_OT_indent ( wmOperatorType * ot)

Definition at line 1227 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_edit_poll(), and text_indent_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_indent_or_autocomplete()

void TEXT_OT_indent_or_autocomplete ( wmOperatorType * ot)

Definition at line 1181 of file text_ops.cc.

References ot, text_edit_poll(), and text_indent_or_autocomplete_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_insert()

◆ TEXT_OT_jump()

◆ TEXT_OT_jump_to_file_at_point()

◆ TEXT_OT_line_break()

void TEXT_OT_line_break ( wmOperatorType * ot)

Definition at line 1325 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_edit_poll(), and text_line_break_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_line_number()

void TEXT_OT_line_number ( wmOperatorType * ot)

Definition at line 3541 of file text_ops.cc.

References ot, text_line_number_invoke(), and text_region_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_make_internal()

void TEXT_OT_make_internal ( wmOperatorType * ot)

Definition at line 679 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_edit_poll(), and text_make_internal_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_move()

void TEXT_OT_move ( wmOperatorType * ot)

Definition at line 2371 of file text_ops.cc.

References LINE_BEGIN, move_type_items, ot, RNA_def_enum(), text_edit_poll(), and text_move_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_move_lines()

void TEXT_OT_move_lines ( wmOperatorType * ot)

◆ TEXT_OT_move_select()

void TEXT_OT_move_select ( wmOperatorType * ot)

◆ TEXT_OT_new()

void TEXT_OT_new ( wmOperatorType * ot)

Definition at line 379 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_new_exec(), and text_new_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_open()

◆ TEXT_OT_overwrite_toggle()

void TEXT_OT_overwrite_toggle ( wmOperatorType * ot)

Definition at line 2618 of file text_ops.cc.

References ot, text_space_edit_poll(), and text_toggle_overwrite_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_paste()

void TEXT_OT_paste ( wmOperatorType * ot)

◆ TEXT_OT_reload()

void TEXT_OT_reload ( wmOperatorType * ot)

Definition at line 581 of file text_ops.cc.

References ot, text_edit_poll(), text_reload_exec(), and text_reload_invoke().

Referenced by text_operatortypes().

◆ TEXT_OT_replace()

◆ TEXT_OT_replace_set_selected()

void TEXT_OT_replace_set_selected ( wmOperatorType * ot)

Definition at line 3979 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_replace_set_selected_exec(), and text_space_edit_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_resolve_conflict()

◆ TEXT_OT_run_script()

void TEXT_OT_run_script ( wmOperatorType * ot)

Definition at line 944 of file text_ops.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, text_data_poll(), and text_run_script_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_save()

void TEXT_OT_save ( wmOperatorType * ot)

Definition at line 784 of file text_ops.cc.

References ot, text_edit_poll(), text_save_exec(), and text_save_invoke().

Referenced by text_operatortypes().

◆ TEXT_OT_save_as()

◆ TEXT_OT_scroll()

◆ TEXT_OT_scroll_bar()

◆ TEXT_OT_select_all()

void TEXT_OT_select_all ( wmOperatorType * ot)

Definition at line 1599 of file text_ops.cc.

References ot, text_edit_poll(), and text_select_all_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_select_line()

void TEXT_OT_select_line ( wmOperatorType * ot)

Definition at line 1631 of file text_ops.cc.

References ot, text_edit_poll(), and text_select_line_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_select_word()

void TEXT_OT_select_word ( wmOperatorType * ot)

Definition at line 1664 of file text_ops.cc.

References ot, text_edit_poll(), and text_select_word_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_selection_set()

void TEXT_OT_selection_set ( wmOperatorType * ot)

◆ TEXT_OT_start_find()

void TEXT_OT_start_find ( wmOperatorType * ot)

Definition at line 109 of file text_header.cc.

References ot, text_properties_poll(), and text_text_search_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_to_3d_object()

void TEXT_OT_to_3d_object ( wmOperatorType * ot)

◆ TEXT_OT_unindent()

void TEXT_OT_unindent ( wmOperatorType * ot)

Definition at line 1268 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_edit_poll(), and text_unindent_exec().

Referenced by text_operatortypes().

◆ TEXT_OT_unlink()

void TEXT_OT_unlink ( wmOperatorType * ot)

Definition at line 643 of file text_ops.cc.

References OPTYPE_UNDO, ot, text_unlink_exec(), text_unlink_invoke(), and text_unlink_poll().

Referenced by text_operatortypes().

◆ TEXT_OT_update_shader()

void TEXT_OT_update_shader ( wmOperatorType * ot)

◆ text_pop_suggest_list()

◆ text_space_edit_poll()

◆ text_update_edited()

◆ text_update_line_edited()

Variable Documentation

◆ text_context_dir

const char* text_context_dir[]

Definition at line 181 of file text_intern.hh.