|
Blender V5.3
|
#include <algorithm>#include "MEM_guardedalloc.h"#include "BLF_api.hh"#include "BLI_listbase.hh"#include "BLI_rect.hh"#include "BLI_string.hh"#include "BLI_string_utf8.hh"#include "DNA_screen_types.h"#include "DNA_space_types.h"#include "DNA_text_types.h"#include "BKE_context.hh"#include "BKE_screen.hh"#include "BKE_text.h"#include "BKE_text_suggestions.h"#include "ED_text.hh"#include "GPU_immediate.hh"#include "GPU_state.hh"#include "UI_interface.hh"#include "UI_resources.hh"#include "text_format.hh"#include "text_intern.hh"#include "WM_api.hh"#include "WM_types.hh"Go to the source code of this file.
Classes | |
| struct | blender::TextDrawContext |
| struct | blender::DrawCache |
Namespaces | |
| namespace | blender |
| BMesh Iterators. | |
Functions | |
Text Run-Time Access | |
| int | blender::ED_space_text_visible_lines_get (const SpaceText *st) |
Text Font Drawing | |
| static void | blender::space_text_draw_context_init (const SpaceText *st, TextDrawContext *tdc) |
| static void | blender::text_font_begin (const TextDrawContext *tdc) |
| static void | blender::text_font_end (const TextDrawContext *) |
| static int | blender::text_font_draw (const TextDrawContext *tdc, int x, int y, const char *str) |
| static int | blender::text_font_draw_character (const TextDrawContext *tdc, int x, int y, char c) |
| static int | blender::text_font_draw_character_utf8 (const TextDrawContext *tdc, int x, int y, const char *c, const int c_len) |
| static void | blender::format_draw_color (const TextDrawContext *tdc, char formatchar) |
Draw Text | |
Notes on Word-WrapAll word-wrap functions follow the algorithm below to maintain consistency:
def wrap(line, view_width, wrap_chars):
draw_start = 0
draw_end = view_width
pos = 0
for c in line:
if pos-draw_start >= view_width:
print line[draw_start:draw_end]
draw_start = draw_end
draw_end += view_width
elif c in wrap_chars:
draw_end = pos+1
pos += 1
print line[draw_start:]
| |
| int | blender::space_text_wrap_width (const SpaceText *st, const ARegion *region) |
| void | blender::space_text_wrap_offset (const SpaceText *st, const ARegion *region, TextLine *linein, int cursin, int *offl, int *offc) |
| void | blender::space_text_wrap_offset_in_line (const SpaceText *st, const ARegion *region, TextLine *linein, int cursin, int *offl, int *offc) |
| int | blender::space_text_get_char_pos (const SpaceText *st, const char *line, int cur) |
| static int | blender::space_text_get_format_index (const SpaceText *st, const char *line, int cur) |
| static const char * | blender::txt_utf8_forward_columns (const char *str, int columns, int *padding) |
| static int | blender::space_text_draw_wrapped (const SpaceText *st, const TextDrawContext *tdc, const char *str, int x, int y, int w, const char *format, int skip) |
| static void | blender::space_text_draw (const SpaceText *st, const TextDrawContext *tdc, char *str, int cshift, int maxwidth, int x, int y, const char *format) |
Cache Utilities | |
| static void | blender::space_text_drawcache_init (SpaceText *st) |
| static void | blender::space_text_update_drawcache (SpaceText *st, const ARegion *region) |
| void | blender::space_text_drawcache_tag_update (SpaceText *st, const bool full) |
| void | blender::space_text_free_caches (SpaceText *st) |
Word-Wrap Utilities | |
| static int | blender::space_text_get_visible_lines_no (const SpaceText *st, int lineno) |
| int | blender::space_text_get_visible_lines (const SpaceText *st, const ARegion *region, const char *str) |
| int | blender::space_text_get_span_wrap (const SpaceText *st, const ARegion *region, const TextLine *from, const TextLine *to) |
| int | blender::space_text_get_total_lines (SpaceText *st, const ARegion *region) |
Draw Scroll-Bar | |
| static void | blender::calc_text_rcts (SpaceText *st, ARegion *region, rcti *r_scroll, rcti *r_back) |
| static void | blender::draw_textscroll (const SpaceText *st, const rcti *scroll, const rcti *back) |
Draw Suggestion List | |
| static void | blender::draw_suggestion_list (const SpaceText *st, const TextDrawContext *tdc, ARegion *region) |
Draw Cursor | |
| static void | blender::draw_text_decoration (SpaceText *st, ARegion *region) |
Draw Matching Brackets | |
| static void | blender::draw_brackets (const SpaceText *st, const TextDrawContext *tdc, ARegion *region) |
Main Region Drawing | |
| void | blender::draw_text_main (SpaceText *st, ARegion *region) |
Update & Coordinate Conversion | |
| void | blender::space_text_update_character_width (SpaceText *st) |
| bool | blender::ED_text_activate_in_screen (bContext *C, Text *text) |
| void | blender::ED_space_text_scroll_to_cursor (SpaceText *st, ARegion *region, bool center) |
| void | blender::space_text_scroll_to_cursor_with_area (SpaceText *st, ScrArea *area, const bool center) |
| void | blender::space_text_update_cursor_moved (bContext *C) |
| static int2 | blender::space_text_region_xy_from_cursor (const SpaceText *st, const ARegion *region, TextLine *line, const int line_index, const int char_ofs) |
| std::optional< int2 > | blender::space_text_cursor_region_xy_get (const SpaceText *st, const ARegion *region) |
| bool | blender::ED_space_text_region_location_from_cursor (const SpaceText *st, const ARegion *region, const int cursor_co[2], int r_pixel_co[2]) |