Blender  V2.93
textview.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
24  TVC_LINE_FG = (1 << 0),
25  TVC_LINE_BG = (1 << 1),
26  TVC_LINE_ICON = (1 << 2),
27  TVC_LINE_ICON_FG = (1 << 3),
28  TVC_LINE_ICON_BG = (1 << 4)
29 };
30 
31 typedef struct TextViewContext {
33  int lheight;
36 
38 
43 
46 
47  /* callbacks */
48  int (*begin)(struct TextViewContext *tvc);
49  void (*end)(struct TextViewContext *tvc);
50  const void *arg1;
51  const void *arg2;
52 
53  /* iterator */
54  int (*step)(struct TextViewContext *tvc);
55  void (*line_get)(struct TextViewContext *tvc, const char **r_line, int *r_len);
57  uchar fg[4],
58  uchar bg[4],
59  int *r_icon,
60  uchar r_icon_fg[4],
61  uchar r_icon_bg[4]);
62  void (*draw_cursor)(struct TextViewContext *tvc, int cwidth, int columns);
63  /* constant theme colors */
64  void (*const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4]);
65  const void *iter;
72  int iter_tmp;
73 
75 
76 int textview_draw(struct TextViewContext *tvc,
77  const bool do_draw,
78  const int mval_init[2],
79  void **r_mval_pick_item,
80  int *r_mval_pick_offset);
unsigned char uchar
Definition: BLI_sys_types.h:86
const void * arg2
Definition: textview.h:51
rcti draw_rect
Definition: textview.h:40
const void * arg1
Definition: textview.h:50
void(* line_get)(struct TextViewContext *tvc, const char **r_line, int *r_len)
Definition: textview.h:55
const void * iter
Definition: textview.h:65
int iter_char_end
Definition: textview.h:70
int row_vpadding
Definition: textview.h:37
int iter_char_begin
Definition: textview.h:68
int(* begin)(struct TextViewContext *tvc)
Definition: textview.h:48
void(* const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4])
Definition: textview.h:64
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])
Definition: textview.h:56
void(* end)(struct TextViewContext *tvc)
Definition: textview.h:49
int(* step)(struct TextViewContext *tvc)
Definition: textview.h:54
void(* draw_cursor)(struct TextViewContext *tvc, int cwidth, int columns)
Definition: textview.h:62
rcti draw_rect_outer
Definition: textview.h:42
eTextViewContext_LineFlag
Definition: textview.h:23
@ TVC_LINE_ICON
Definition: textview.h:26
@ TVC_LINE_ICON_FG
Definition: textview.h:27
@ TVC_LINE_ICON_BG
Definition: textview.h:28
@ TVC_LINE_BG
Definition: textview.h:25
@ TVC_LINE_FG
Definition: textview.h:24
struct TextViewContext TextViewContext
int textview_draw(struct TextViewContext *tvc, const bool do_draw, const int mval_init[2], void **r_mval_pick_item, int *r_mval_pick_offset)
Definition: textview.c:313