Blender V4.3
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)    ((st)->runtime->cwidth_px * ((st)->runtime->line_number_display_digits + (2 * TXT_NUMCOL_PAD)))
 
#define TXT_BODY_LPAD   1.0f
 
#define TXT_BODY_LEFT(st)    ((st)->showlinenrs ? TXT_NUMCOL_WIDTH(st) : 0) + (TXT_BODY_LPAD * (st)->runtime->cwidth_px)
 
#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)   ((int)(TXT_LINE_VPAD * st->runtime->lheight_px))
 
#define TXT_LINE_HEIGHT(st)   ((int)((1.0f + TXT_LINE_VPAD) * st->runtime->lheight_px))
 
#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_refresh_pyconstraints (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_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 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)     ((st)->showlinenrs ? TXT_NUMCOL_WIDTH(st) : 0) + (TXT_BODY_LPAD * (st)->runtime->cwidth_px)

Definition at line 46 of file text_intern.hh.

Referenced by space_text_do_suggest_select(), and text_cursor_set_to_pos().

◆ 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

#define TXT_LINE_HEIGHT ( st)    ((int)((1.0f + TXT_LINE_VPAD) * st->runtime->lheight_px))

◆ TXT_LINE_SPACING

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

Definition at line 55 of file text_intern.hh.

◆ 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.

◆ TXT_NUMCOL_WIDTH

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

Definition at line 40 of file text_intern.hh.

Referenced by 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.

Enumeration Type Documentation

◆ 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.

◆ 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.

Function Documentation

◆ draw_text_main()

void draw_text_main ( SpaceText * st,
ARegion * region )

Referenced by text_main_region_draw().

◆ space_text_do_suggest_select()

◆ space_text_drawcache_tag_update()

◆ space_text_free_caches()

void space_text_free_caches ( SpaceText * st)

Referenced by text_free().

◆ space_text_get_char_pos()

int space_text_get_char_pos ( const SpaceText * st,
const char * line,
int cur )

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

int space_text_get_visible_lines ( const SpaceText * st,
const ARegion * region,
const char * str )

◆ 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.

◆ 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.

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

cursin - mem, offc - view.

Referenced by cursor_skip_find_line(), txt_wrap_move_down(), and txt_wrap_move_up().

◆ space_text_wrap_width()

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

◆ TEXT_OT_autocomplete()

◆ TEXT_OT_comment_toggle()

◆ TEXT_OT_convert_whitespace()

◆ TEXT_OT_copy()

◆ TEXT_OT_cursor_set()

◆ TEXT_OT_cut()

◆ TEXT_OT_delete()

◆ TEXT_OT_duplicate_line()

◆ TEXT_OT_find()

◆ TEXT_OT_find_set_selected()

◆ TEXT_OT_indent()

◆ TEXT_OT_indent_or_autocomplete()

◆ TEXT_OT_insert()

◆ TEXT_OT_jump()

◆ TEXT_OT_jump_to_file_at_point()

◆ TEXT_OT_line_break()

◆ TEXT_OT_line_number()

◆ TEXT_OT_make_internal()

◆ TEXT_OT_move()

◆ TEXT_OT_move_lines()

◆ TEXT_OT_move_select()

◆ TEXT_OT_new()

◆ TEXT_OT_open()

◆ TEXT_OT_overwrite_toggle()

◆ TEXT_OT_paste()

◆ TEXT_OT_refresh_pyconstraints()

◆ TEXT_OT_reload()

◆ TEXT_OT_replace()

◆ TEXT_OT_replace_set_selected()

◆ TEXT_OT_resolve_conflict()

◆ TEXT_OT_run_script()

◆ TEXT_OT_save()

◆ TEXT_OT_save_as()

◆ TEXT_OT_scroll()

◆ TEXT_OT_scroll_bar()

◆ TEXT_OT_select_all()

◆ TEXT_OT_select_line()

◆ TEXT_OT_select_word()

◆ TEXT_OT_selection_set()

◆ TEXT_OT_start_find()

◆ TEXT_OT_to_3d_object()

◆ TEXT_OT_unindent()

◆ TEXT_OT_unlink()

◆ text_pop_suggest_list()

void 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 180 of file text_intern.hh.