Blender  V3.3
Macros | Enumerations | Functions | Variables
text_intern.h File Reference

Go to the source code of this file.

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 DOC_WIDTH   40
 
#define DOC_HEIGHT   10
 
#define TOOL_SUGG_LIST   0x01
 
#define TOOL_DOCUMENT   0x02
 

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 (struct SpaceText *st, struct ARegion *region)
 
void text_update_line_edited (struct TextLine *line)
 
void text_update_edited (struct Text *text)
 
void text_update_character_width (struct SpaceText *st)
 
void text_scroll_to_cursor__area (struct SpaceText *st, struct ScrArea *area, bool center)
 
void text_update_cursor_moved (struct bContext *C)
 
int wrap_width (const struct SpaceText *st, struct ARegion *region)
 
void wrap_offset (const struct SpaceText *st, struct ARegion *region, struct TextLine *linein, int cursin, int *offl, int *offc)
 
void wrap_offset_in_line (const struct SpaceText *st, struct ARegion *region, struct TextLine *linein, int cursin, int *offl, int *offc)
 
int text_get_char_pos (const struct SpaceText *st, const char *line, int cur)
 
void text_drawcache_tag_update (struct SpaceText *st, int full)
 
void text_free_caches (struct SpaceText *st)
 
bool text_do_suggest_select (struct SpaceText *st, struct ARegion *region, const int mval[2])
 
void text_pop_suggest_list (void)
 
int text_get_visible_lines (const struct SpaceText *st, struct ARegion *region, const char *str)
 
int text_get_span_wrap (const struct SpaceText *st, struct ARegion *region, struct TextLine *from, struct TextLine *to)
 
int text_get_total_lines (struct SpaceText *st, struct ARegion *region)
 
void TEXT_OT_new (struct wmOperatorType *ot)
 
void TEXT_OT_open (struct wmOperatorType *ot)
 
void TEXT_OT_reload (struct wmOperatorType *ot)
 
void TEXT_OT_unlink (struct wmOperatorType *ot)
 
void TEXT_OT_save (struct wmOperatorType *ot)
 
void TEXT_OT_save_as (struct wmOperatorType *ot)
 
void TEXT_OT_make_internal (struct wmOperatorType *ot)
 
void TEXT_OT_run_script (struct wmOperatorType *ot)
 
void TEXT_OT_refresh_pyconstraints (struct wmOperatorType *ot)
 
void TEXT_OT_paste (struct wmOperatorType *ot)
 
void TEXT_OT_copy (struct wmOperatorType *ot)
 
void TEXT_OT_cut (struct wmOperatorType *ot)
 
void TEXT_OT_duplicate_line (struct wmOperatorType *ot)
 
void TEXT_OT_convert_whitespace (struct wmOperatorType *ot)
 
void TEXT_OT_comment_toggle (struct wmOperatorType *ot)
 
void TEXT_OT_unindent (struct wmOperatorType *ot)
 
void TEXT_OT_indent (struct wmOperatorType *ot)
 
void TEXT_OT_indent_or_autocomplete (struct wmOperatorType *ot)
 
void TEXT_OT_line_break (struct wmOperatorType *ot)
 
void TEXT_OT_insert (struct wmOperatorType *ot)
 
void TEXT_OT_select_line (struct wmOperatorType *ot)
 
void TEXT_OT_select_all (struct wmOperatorType *ot)
 
void TEXT_OT_select_word (struct wmOperatorType *ot)
 
void TEXT_OT_move_lines (struct wmOperatorType *ot)
 
void TEXT_OT_jump (struct wmOperatorType *ot)
 
void TEXT_OT_move (struct wmOperatorType *ot)
 
void TEXT_OT_move_select (struct wmOperatorType *ot)
 
void TEXT_OT_delete (struct wmOperatorType *ot)
 
void TEXT_OT_overwrite_toggle (struct wmOperatorType *ot)
 
void TEXT_OT_scroll (struct wmOperatorType *ot)
 
void TEXT_OT_scroll_bar (struct wmOperatorType *ot)
 
void TEXT_OT_selection_set (struct wmOperatorType *ot)
 
void TEXT_OT_cursor_set (struct wmOperatorType *ot)
 
void TEXT_OT_line_number (struct wmOperatorType *ot)
 
void TEXT_OT_find (struct wmOperatorType *ot)
 
void TEXT_OT_find_set_selected (struct wmOperatorType *ot)
 
void TEXT_OT_replace (struct wmOperatorType *ot)
 
void TEXT_OT_replace_set_selected (struct wmOperatorType *ot)
 
void TEXT_OT_start_find (struct wmOperatorType *ot)
 
void TEXT_OT_to_3d_object (struct wmOperatorType *ot)
 
void TEXT_OT_resolve_conflict (struct wmOperatorType *ot)
 
bool text_space_edit_poll (struct bContext *C)
 
void TEXT_OT_autocomplete (struct wmOperatorType *ot)
 

Variables

const char * text_context_dir []
 

Macro Definition Documentation

◆ DOC_HEIGHT

#define DOC_HEIGHT   10

Definition at line 58 of file text_intern.h.

◆ DOC_WIDTH

#define DOC_WIDTH   40

Definition at line 57 of file text_intern.h.

◆ SUGG_LIST_SIZE

#define SUGG_LIST_SIZE   7

Definition at line 55 of file text_intern.h.

◆ SUGG_LIST_WIDTH

#define SUGG_LIST_WIDTH   20

Definition at line 56 of file text_intern.h.

◆ TOOL_DOCUMENT

#define TOOL_DOCUMENT   0x02

Definition at line 61 of file text_intern.h.

◆ TOOL_SUGG_LIST

#define TOOL_SUGG_LIST   0x01

Definition at line 60 of file text_intern.h.

◆ 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 42 of file text_intern.h.

◆ TXT_BODY_LPAD

#define TXT_BODY_LPAD   1.0f

Definition at line 40 of file text_intern.h.

◆ TXT_LINE_HEIGHT

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

Definition at line 53 of file text_intern.h.

◆ TXT_LINE_SPACING

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

Definition at line 51 of file text_intern.h.

◆ TXT_LINE_VPAD

#define TXT_LINE_VPAD   0.3f

Definition at line 49 of file text_intern.h.

◆ TXT_NUMCOL_PAD

#define TXT_NUMCOL_PAD   1.0f

Definition at line 34 of file text_intern.h.

◆ 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 36 of file text_intern.h.

◆ TXT_SCROLL_SPACE

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

Definition at line 46 of file text_intern.h.

◆ TXT_SCROLL_WIDTH

#define TXT_SCROLL_WIDTH   U.widget_unit

Definition at line 45 of file text_intern.h.

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 99 of file text_intern.h.

◆ anonymous enum

anonymous enum
Enumerator
DEL_NEXT_CHAR 
DEL_PREV_CHAR 
DEL_NEXT_WORD 
DEL_PREV_WORD 

Definition at line 113 of file text_intern.h.

Function Documentation

◆ draw_text_main()

void draw_text_main ( struct SpaceText st,
struct ARegion region 
)

Referenced by text_main_region_draw().

◆ text_do_suggest_select()

bool text_do_suggest_select ( struct SpaceText st,
struct ARegion region,
const int  mval[2] 
)

◆ text_drawcache_tag_update()

void text_drawcache_tag_update ( struct SpaceText st,
int  full 
)

◆ text_free_caches()

void text_free_caches ( struct SpaceText st)

Referenced by text_free().

◆ text_get_char_pos()

int text_get_char_pos ( const struct SpaceText st,
const char *  line,
int  cur 
)

◆ text_get_span_wrap()

int text_get_span_wrap ( const struct SpaceText st,
struct ARegion region,
struct TextLine from,
struct TextLine to 
)

◆ text_get_total_lines()

int text_get_total_lines ( struct SpaceText st,
struct ARegion region 
)

◆ text_get_visible_lines()

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

◆ TEXT_OT_autocomplete()

void TEXT_OT_autocomplete ( struct wmOperatorType ot)

◆ TEXT_OT_comment_toggle()

void TEXT_OT_comment_toggle ( struct wmOperatorType ot)

◆ TEXT_OT_convert_whitespace()

void TEXT_OT_convert_whitespace ( struct wmOperatorType ot)

◆ TEXT_OT_copy()

void TEXT_OT_copy ( struct wmOperatorType ot)

◆ TEXT_OT_cursor_set()

void TEXT_OT_cursor_set ( struct wmOperatorType ot)

◆ TEXT_OT_cut()

void TEXT_OT_cut ( struct wmOperatorType ot)

◆ TEXT_OT_delete()

void TEXT_OT_delete ( struct wmOperatorType ot)

◆ TEXT_OT_duplicate_line()

void TEXT_OT_duplicate_line ( struct wmOperatorType ot)

◆ TEXT_OT_find()

void TEXT_OT_find ( struct wmOperatorType ot)

◆ TEXT_OT_find_set_selected()

void TEXT_OT_find_set_selected ( struct wmOperatorType ot)

◆ TEXT_OT_indent()

void TEXT_OT_indent ( struct wmOperatorType ot)

◆ TEXT_OT_indent_or_autocomplete()

void TEXT_OT_indent_or_autocomplete ( struct wmOperatorType ot)

◆ TEXT_OT_insert()

void TEXT_OT_insert ( struct wmOperatorType ot)

◆ TEXT_OT_jump()

void TEXT_OT_jump ( struct wmOperatorType ot)

◆ TEXT_OT_line_break()

void TEXT_OT_line_break ( struct wmOperatorType ot)

◆ TEXT_OT_line_number()

void TEXT_OT_line_number ( struct wmOperatorType ot)

◆ TEXT_OT_make_internal()

void TEXT_OT_make_internal ( struct wmOperatorType ot)

◆ TEXT_OT_move()

void TEXT_OT_move ( struct wmOperatorType ot)

◆ TEXT_OT_move_lines()

void TEXT_OT_move_lines ( struct wmOperatorType ot)

◆ TEXT_OT_move_select()

void TEXT_OT_move_select ( struct wmOperatorType ot)

◆ TEXT_OT_new()

void TEXT_OT_new ( struct wmOperatorType ot)

◆ TEXT_OT_open()

void TEXT_OT_open ( struct wmOperatorType ot)

◆ TEXT_OT_overwrite_toggle()

void TEXT_OT_overwrite_toggle ( struct wmOperatorType ot)

◆ TEXT_OT_paste()

void TEXT_OT_paste ( struct wmOperatorType ot)

◆ TEXT_OT_refresh_pyconstraints()

void TEXT_OT_refresh_pyconstraints ( struct wmOperatorType ot)

◆ TEXT_OT_reload()

void TEXT_OT_reload ( struct wmOperatorType ot)

◆ TEXT_OT_replace()

void TEXT_OT_replace ( struct wmOperatorType ot)

◆ TEXT_OT_replace_set_selected()

void TEXT_OT_replace_set_selected ( struct wmOperatorType ot)

◆ TEXT_OT_resolve_conflict()

void TEXT_OT_resolve_conflict ( struct wmOperatorType ot)

◆ TEXT_OT_run_script()

void TEXT_OT_run_script ( struct wmOperatorType ot)

◆ TEXT_OT_save()

void TEXT_OT_save ( struct wmOperatorType ot)

◆ TEXT_OT_save_as()

void TEXT_OT_save_as ( struct wmOperatorType ot)

◆ TEXT_OT_scroll()

void TEXT_OT_scroll ( struct wmOperatorType ot)

◆ TEXT_OT_scroll_bar()

void TEXT_OT_scroll_bar ( struct wmOperatorType ot)

◆ TEXT_OT_select_all()

void TEXT_OT_select_all ( struct wmOperatorType ot)

◆ TEXT_OT_select_line()

void TEXT_OT_select_line ( struct wmOperatorType ot)

◆ TEXT_OT_select_word()

void TEXT_OT_select_word ( struct wmOperatorType ot)

◆ TEXT_OT_selection_set()

void TEXT_OT_selection_set ( struct wmOperatorType ot)

◆ TEXT_OT_start_find()

void TEXT_OT_start_find ( struct wmOperatorType ot)

◆ TEXT_OT_to_3d_object()

void TEXT_OT_to_3d_object ( struct wmOperatorType ot)

◆ TEXT_OT_unindent()

void TEXT_OT_unindent ( struct wmOperatorType ot)

◆ TEXT_OT_unlink()

void TEXT_OT_unlink ( struct wmOperatorType ot)

◆ text_pop_suggest_list()

void text_pop_suggest_list ( void  )

◆ text_scroll_to_cursor__area()

void text_scroll_to_cursor__area ( struct SpaceText st,
struct ScrArea area,
bool  center 
)

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

◆ text_space_edit_poll()

bool text_space_edit_poll ( struct bContext C)

◆ text_update_character_width()

void text_update_character_width ( struct SpaceText st)

◆ text_update_cursor_moved()

void text_update_cursor_moved ( struct bContext C)

◆ text_update_edited()

void text_update_edited ( struct Text text)

◆ text_update_line_edited()

void text_update_line_edited ( struct TextLine line)

◆ wrap_offset()

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

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

◆ wrap_offset_in_line()

void wrap_offset_in_line ( const struct SpaceText st,
struct ARegion region,
struct 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().

◆ wrap_width()

int wrap_width ( const struct SpaceText st,
struct ARegion region 
)

Variable Documentation

◆ text_context_dir

const char* text_context_dir[]
extern

Definition at line 221 of file space_text.c.

Referenced by bpy_context_members(), and text_context().