28 BLF_size(font_id, 0.8f * lheight, 72);
61 const int str_len_draw,
63 const uchar bg_sel[4])
65 const int sel[2] = {tds->
sel[0], tds->
sel[1]};
66 const int cwidth = tds->
cwidth;
67 const int lheight = tds->
lheight;
69 if (sel[0] <= str_len_draw && sel[1] >= 0) {
93 const char *
str,
int len,
int width,
int *r_lines,
int **r_offsets)
101 sizeof(**r_offsets) *
109 if (i + columns > end) {
110 (*r_offsets)[*r_lines] = j;
130 const uchar icon_fg[4],
131 const uchar icon_bg[4],
132 const uchar bg_sel[4])
140 int line_bottom = tds->
xy[1];
141 int line_top = line_bottom + line_height;
143 int y_next = line_top;
148 if (y_next >= tds->
mval[1]) {
153 int iofs = (int)((
float)(y_next - tds->
mval[1]) / tds->
lheight);
154 ofs += offsets[
MIN2(iofs, tot_lines - 1)];
161 CLAMP(ofs, 0, str_len);
173 if (y_next < tds->scroll_ymin) {
178 if (tds->
sel[0] != tds->
sel[1]) {
194 tds->
sel[0] = str_len - sel_orig[1];
195 tds->
sel[1] = str_len - sel_orig[0];
217 .xmax = bg_size + hpadding,
218 .ymin = line_top - bg_size - vpadding,
219 .ymax = line_top - vpadding,
245 const int final_offset = offsets[tot_lines - 1];
246 len = str_len - final_offset;
247 s =
str + final_offset;
249 if (tds->
sel[0] != tds->
sel[1]) {
251 const int pos[2] = {tds->
xy[0], line_bottom};
263 for (i = tot_lines - 1; i > 0; i--) {
264 len = offsets[i] - offsets[i - 1];
265 s =
str + offsets[i - 1];
267 if (tds->
sel[0] != tds->
sel[1]) {
295 const int mval_init[2],
296 void **r_mval_pick_item,
297 int *r_mval_pick_offset)
304 int sel[2] = {-1, -1};
305 uchar fg[4], bg[4], icon_fg[4], icon_bg[4];
316 const int mval[2] = {
317 (mval_init[0] == INT_MAX) ?
320 (mval_init[1] == INT_MAX) ?
325 if (r_mval_pick_offset !=
NULL) {
326 *r_mval_pick_offset = 0;
357 if (tvc->
begin(tvc)) {
358 uchar bg_sel[4] = {0};
366 const char *ext_line;
370 const int y_prev =
xy[1];
373 data_flag = tvc->
line_data(tvc, fg, bg, &icon, icon_fg, icon_bg);
376 tvc->
line_get(tvc, &ext_line, &ext_len);
396 if (is_out_of_view_y) {
401 if ((mval[1] != INT_MAX) && (mval[1] >= y_prev && mval[1] <=
xy[1])) {
402 *r_mval_pick_item = (
void *)tvc->
iter;
408 }
while (tvc->
step(tvc));
420 return xy[1] - y_orig;
int BLF_descender(int fontid) ATTR_WARN_UNUSED_RESULT
int BLF_draw_mono(int fontid, const char *str, size_t str_len, int cwidth) ATTR_NONNULL(2)
float BLF_fixed_width(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
void BLF_size(int fontid, float size, int dpi)
void BLF_position(int fontid, float x, float y, float z)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
int BLI_str_utf8_offset_from_column(const char *str, int column) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define BLI_UTF8_WIDTH_MAX
int BLI_str_utf8_char_width_safe(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_str_utf8_offset_to_column(const char *str, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_str_utf8_size_safe(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
@ GPU_SHADER_2D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
void UI_draw_roundbox_4fv(const struct rctf *rect, bool filled, float rad, const float col[4])
void UI_draw_roundbox_corner_set(int type)
void UI_icon_draw_ex(float x, float y, int icon_id, float aspect, float alpha, float desaturate, const uchar mono_color[4], bool mono_border)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void(* line_get)(struct TextViewContext *tvc, const char **r_line, int *r_len)
int(* begin)(struct TextViewContext *tvc)
void(* const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4])
enum eTextViewContext_LineFlag(* line_data)(struct TextViewContext *tvc, uchar fg[4], uchar bg[4], int *r_icon, uchar r_icon_fg[4], uchar r_icon_bg[4])
void(* end)(struct TextViewContext *tvc)
int(* step)(struct TextViewContext *tvc)
void(* draw_cursor)(struct TextViewContext *tvc, int cwidth, int columns)
const rcti * draw_rect_outer
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])
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 void textview_font_begin(const int font_id, const int lheight)
int textview_draw(TextViewContext *tvc, const bool do_draw, const int mval_init[2], void **r_mval_pick_item, int *r_mval_pick_offset)
BLI_INLINE void textview_step_sel(TextViewDrawState *tds, const int step)
static int textview_wrap_offsets(const char *str, int len, int width, int *r_lines, int **r_offsets)
struct TextViewDrawState TextViewDrawState