Blender V5.3
textview.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_enum_flags.hh"
12
13#include "DNA_vec_types.h"
14
15namespace blender {
16
17#define TVC_TAB_COLUMNS 4
18
20 TVC_LINE_FG = (1 << 0),
21 TVC_LINE_BG = (1 << 1),
22 TVC_LINE_ICON = (1 << 2),
23 TVC_LINE_ICON_FG = (1 << 3),
25};
27
33
35
40
43
44 /* callbacks */
45 int (*begin)(TextViewContext *tvc);
46 void (*end)(TextViewContext *tvc);
47 const void *arg1;
48 const void *arg2;
49
50 /* iterator */
51 int (*step)(TextViewContext *tvc);
52 void (*line_get)(TextViewContext *tvc, const char **r_line, int *r_len);
54 uchar fg[4],
55 uchar bg[4],
56 int *r_icon,
57 uchar r_icon_fg[4],
58 uchar r_icon_bg[4]);
59 void (*draw_cursor)(TextViewContext *tvc, int char_width, int columns);
60 /* constant theme colors */
61 void (*const_colors)(TextViewContext *tvc, unsigned char bg_sel[4]);
62 const void *iter;
70};
71
80 bool do_draw,
81 const int mval_init[2],
82 void **r_mval_pick_item,
83 int *r_mval_pick_offset);
84
90int textview_wrap_offsets(const char *str, int str_len, int width, int *r_lines, int **r_offsets);
91
92} // namespace blender
#define ENUM_OPERATORS(_enum_type)
#define str(s)
BMesh Iterators.
int textview_wrap_offsets(const char *str, const int str_len, const int width, int *r_lines, int **r_offsets)
Definition textview.cc:98
int textview_draw(TextViewContext *tvc, const bool do_draw, const int mval_init[2], void **r_mval_pick_item, int *r_mval_pick_offset)
Definition textview.cc:302
unsigned char uchar
Definition BKE_text.h:58
eTextViewContext_LineFlag
Definition textview.hh:19
@ TVC_LINE_BG
Definition textview.hh:21
@ TVC_LINE_ICON_FG
Definition textview.hh:23
@ TVC_LINE_ICON_BG
Definition textview.hh:24
@ TVC_LINE_FG
Definition textview.hh:20
@ TVC_LINE_ICON
Definition textview.hh:22
void(*) const_colors(TextViewContext *tvc, unsigned char bg_sel[4])
Definition textview.hh:61
int(*) begin(TextViewContext *tvc)
Definition textview.hh:45
void(*) line_get(TextViewContext *tvc, const char **r_line, int *r_len)
Definition textview.hh:52
int(*) step(TextViewContext *tvc)
Definition textview.hh:51
void(*) draw_cursor(TextViewContext *tvc, int char_width, int columns)
Definition textview.hh:59
void(*) end(TextViewContext *tvc)
Definition textview.hh:46
enum eTextViewContext_LineFlag(*) line_data(TextViewContext *tvc, uchar fg[4], uchar bg[4], int *r_icon, uchar r_icon_fg[4], uchar r_icon_bg[4])
Definition textview.hh:53