|
Blender V4.3
|
#include <algorithm>#include "MEM_guardedalloc.h"#include "BLF_api.hh"#include "BLI_math_color.h"#include "BLI_string_utf8.h"#include "BLI_utildefines.h"#include "GPU_immediate.hh"#include "GPU_state.hh"#include "DNA_userdef_types.h"#include "UI_interface.hh"#include "UI_interface_icons.hh"#include "textview.hh"Go to the source code of this file.
Classes | |
| struct | TextViewDrawState |
Functions | |
| static void | textview_font_begin (const int font_id, const int lheight) |
| BLI_INLINE void | textview_step_sel (TextViewDrawState *tds, const int step) |
| static void | textview_draw_sel (const char *str, const int xy[2], const int str_len_draw, TextViewDrawState *tds, const uchar bg_sel[4]) |
| static int | textview_wrap_offsets (const char *str, const int str_len, const int width, int *r_lines, int **r_offsets) |
| static bool | textview_draw_string (TextViewDrawState *tds, const char *str, int str_len, const uchar fg[4], const uchar bg[4], int icon, const uchar icon_fg[4], const uchar icon_bg[4], const uchar bg_sel[4]) |
| int | textview_draw (TextViewContext *tvc, const bool do_draw, const int mval_init[2], void **r_mval_pick_item, int *r_mval_pick_offset) |
| int textview_draw | ( | TextViewContext * | tvc, |
| bool | do_draw, | ||
| const int | mval_init[2], | ||
| void ** | r_mval_pick_item, | ||
| int * | r_mval_pick_offset ) |
| r_mval_pick_item | The resulting item clicked on using mval_init. Set from the void pointer which holds the current iterator. Its type depends on the data being iterated over. |
| r_mval_pick_offset | The offset in bytes of the mval_init. Use for selection. |
Definition at line 304 of file textview.cc.
References TextViewContext::begin, BLF_descender(), BLF_fixed_width(), blf_mono_font, BLI_assert, TextViewDrawState::columns, TextViewContext::const_colors, TextViewDrawState::cwidth, TextViewDrawState::do_draw, TextViewContext::draw_cursor, TextViewContext::draw_rect, TextViewDrawState::draw_rect, TextViewContext::draw_rect_outer, TextViewDrawState::draw_rect_outer, TextViewContext::end, TextViewDrawState::font_id, int, TextViewContext::iter, TextViewContext::lheight, TextViewDrawState::lheight, TextViewContext::line_data, TextViewContext::line_get, TextViewDrawState::lofs, TextViewDrawState::mval, TextViewDrawState::mval_pick_offset, TextViewContext::row_vpadding, TextViewDrawState::row_vpadding, TextViewContext::scroll_ymax, TextViewDrawState::scroll_ymax, TextViewContext::scroll_ymin, TextViewDrawState::scroll_ymin, TextViewDrawState::sel, TextViewContext::sel_end, TextViewContext::sel_start, TextViewContext::step, textview_draw_string(), textview_font_begin(), TVC_LINE_BG, TVC_LINE_FG, TVC_LINE_ICON, TVC_LINE_ICON_BG, TVC_LINE_ICON_FG, rcti::xmax, rcti::xmin, TextViewDrawState::xy, xy, rcti::ymax, and rcti::ymin.
Referenced by console_textview_main__internal(), and info_textview_main__internal().
|
static |
Definition at line 63 of file textview.cc.
References BLI_str_utf8_offset_to_column_with_tabs(), TextViewDrawState::cwidth, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_I32, GPU_FETCH_INT_TO_FLOAT, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRecti(), immUnbindProgram(), immUniformColor4ubv(), immVertexFormat(), TextViewDrawState::lheight, max_ii(), min_ii(), pos, TextViewDrawState::sel, str, TVC_TAB_COLUMNS, and xy.
Referenced by textview_draw_string().
|
static |
return false if the last line is off the screen should be able to use this for any string type.
Definition at line 133 of file textview.cc.
References BLF_color4ubv(), BLF_draw_mono(), BLF_position(), BLI_str_utf8_offset_from_column_with_tabs(), CLAMP, col, TextViewDrawState::columns, copy_v2_v2_int(), TextViewDrawState::cwidth, TextViewDrawState::do_draw, TextViewDrawState::draw_rect, TextViewDrawState::draw_rect_outer, floor(), TextViewDrawState::font_id, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_I32, GPU_FETCH_INT_TO_FLOAT, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRecti(), immUnbindProgram(), immUniformColor4ubv(), immVertexFormat(), int, len, TextViewDrawState::lheight, TextViewDrawState::lofs, MEM_freeN(), TextViewDrawState::mval, TextViewDrawState::mval_pick_offset, pos, rgba_uchar_to_float(), TextViewDrawState::row_vpadding, TextViewDrawState::scroll_ymax, TextViewDrawState::sel, str, textview_draw_sel(), textview_step_sel(), textview_wrap_offsets(), TVC_TAB_COLUMNS, UI_CNR_ALL, UI_draw_roundbox_4fv(), UI_draw_roundbox_corner_set(), UI_icon_draw_ex(), UI_ICON_SIZE, UI_NO_ICON_OVERLAY_TEXT, UI_SCALE_FAC, rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, TextViewDrawState::xy, rctf::ymax, and rctf::ymin.
Referenced by textview_draw().
| BLI_INLINE void textview_step_sel | ( | TextViewDrawState * | tds, |
| const int | step ) |
Definition at line 57 of file textview.cc.
References TextViewDrawState::sel.
Referenced by textview_draw_string().
|
static |
Definition at line 98 of file textview.cc.
References BLI_str_utf8_char_width_safe(), BLI_str_utf8_size_safe(), BLI_UTF8_WIDTH_MAX, MEM_callocN, str, TVC_TAB_COLUMNS, and UNLIKELY.
Referenced by textview_draw_string().