Blender
V5.0
source
blender
editors
include
ED_numinput.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
#define NUM_STR_REP_LEN 64
12
#define NUM_MAX_ELEMENTS 3
13
14
struct
bContext
;
15
struct
wmEvent
;
16
struct
UnitSettings
;
17
18
struct
NumInput
{
20
short
idx_max
;
21
int
unit_sys
;
23
int
unit_type
[
NUM_MAX_ELEMENTS
];
24
bool
unit_use_radians
;
25
27
short
flag
;
29
short
val_flag
[
NUM_MAX_ELEMENTS
];
31
float
val
[
NUM_MAX_ELEMENTS
];
33
float
val_org
[
NUM_MAX_ELEMENTS
];
35
float
val_inc
[
NUM_MAX_ELEMENTS
];
36
38
short
idx
;
40
char
str
[
NUM_STR_REP_LEN
];
43
int
str_cur
;
44
};
45
47
enum
{
48
NUM_AFFECT_ALL
= (1 << 0),
49
/* (1 << 9) and above are reserved for internal flags! */
50
};
51
53
enum
{
54
/* Public! */
55
NUM_NULL_ONE
= (1 << 0),
56
NUM_NO_NEGATIVE
= (1 << 1),
57
NUM_NO_ZERO
= (1 << 2),
58
NUM_NO_FRACTION
= (1 << 3),
59
/* (1 << 9) and above are reserved for internal flags! */
60
};
61
62
/* -------------------------------------------------------------------- */
65
79
80
void
initNumInput
(
NumInput
*n);
84
void
outputNumInput
(
NumInput
*n,
char
*
str
,
const
UnitSettings
&unit_settings);
85
bool
hasNumInput
(
const
NumInput
*n);
89
bool
applyNumInput
(
NumInput
*n,
float
*vec);
90
bool
handleNumInput
(
bContext
*
C
,
NumInput
*n,
const
wmEvent
*event);
91
93
#define NUM_MODAL_INCREMENT_UP 18
94
#define NUM_MODAL_INCREMENT_DOWN 19
95
96
bool
user_string_to_number
(
bContext
*
C
,
97
const
char
*
str
,
98
const
UnitSettings
&unit,
99
int
type,
100
double
*r_value,
101
bool
use_single_line_error,
102
char
**r_error);
103
initNumInput
void initNumInput(NumInput *n)
Definition
numinput.cc:70
NUM_STR_REP_LEN
#define NUM_STR_REP_LEN
Definition
ED_numinput.hh:11
NUM_AFFECT_ALL
@ NUM_AFFECT_ALL
Definition
ED_numinput.hh:48
user_string_to_number
bool user_string_to_number(bContext *C, const char *str, const UnitSettings &unit, int type, double *r_value, bool use_single_line_error, char **r_error)
Definition
numinput.cc:266
NUM_MAX_ELEMENTS
#define NUM_MAX_ELEMENTS
Definition
ED_numinput.hh:12
handleNumInput
bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
Definition
numinput.cc:312
applyNumInput
bool applyNumInput(NumInput *n, float *vec)
Definition
numinput.cc:190
NUM_NO_NEGATIVE
@ NUM_NO_NEGATIVE
Definition
ED_numinput.hh:56
NUM_NULL_ONE
@ NUM_NULL_ONE
Definition
ED_numinput.hh:55
NUM_NO_ZERO
@ NUM_NO_ZERO
Definition
ED_numinput.hh:57
NUM_NO_FRACTION
@ NUM_NO_FRACTION
Definition
ED_numinput.hh:58
outputNumInput
void outputNumInput(NumInput *n, char *str, const UnitSettings &unit_settings)
Definition
numinput.cc:88
hasNumInput
bool hasNumInput(const NumInput *n)
Definition
numinput.cc:171
C
#define C
Definition
RandGen.cpp:29
str
#define str(s)
Definition
ffmpeg_codecs.cc:103
NumInput
Definition
ED_numinput.hh:18
NumInput::idx_max
short idx_max
Definition
ED_numinput.hh:20
NumInput::val
float val[NUM_MAX_ELEMENTS]
Definition
ED_numinput.hh:31
NumInput::val_flag
short val_flag[NUM_MAX_ELEMENTS]
Definition
ED_numinput.hh:29
NumInput::unit_sys
int unit_sys
Definition
ED_numinput.hh:21
NumInput::val_inc
float val_inc[NUM_MAX_ELEMENTS]
Definition
ED_numinput.hh:35
NumInput::str
char str[NUM_STR_REP_LEN]
Definition
ED_numinput.hh:40
NumInput::val_org
float val_org[NUM_MAX_ELEMENTS]
Definition
ED_numinput.hh:33
NumInput::unit_type
int unit_type[NUM_MAX_ELEMENTS]
Definition
ED_numinput.hh:23
NumInput::flag
short flag
Definition
ED_numinput.hh:27
NumInput::unit_use_radians
bool unit_use_radians
Definition
ED_numinput.hh:24
NumInput::str_cur
int str_cur
Definition
ED_numinput.hh:43
NumInput::idx
short idx
Definition
ED_numinput.hh:38
UnitSettings
Definition
DNA_scene_types.h:1921
bContext
Definition
blenkernel/intern/context.cc:63
wmEvent
Definition
WM_types.hh:753
Generated on
for Blender by
doxygen
1.16.1