Blender
V4.3
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
9
#pragma once
10
11
#define NUM_STR_REP_LEN 64
12
#define NUM_MAX_ELEMENTS 3
13
14
struct
wmEvent
;
15
struct
UnitSettings
;
16
17
struct
NumInput
{
19
short
idx_max
;
20
int
unit_sys
;
22
int
unit_type
[
NUM_MAX_ELEMENTS
];
23
bool
unit_use_radians
;
24
26
short
flag
;
28
short
val_flag
[
NUM_MAX_ELEMENTS
];
30
float
val
[
NUM_MAX_ELEMENTS
];
32
float
val_org
[
NUM_MAX_ELEMENTS
];
34
float
val_inc
[
NUM_MAX_ELEMENTS
];
35
37
short
idx
;
39
char
str
[
NUM_STR_REP_LEN
];
42
int
str_cur
;
43
};
44
46
enum
{
47
NUM_AFFECT_ALL
= (1 << 0),
48
/* (1 << 9) and above are reserved for internal flags! */
49
};
50
52
enum
{
53
/* Public! */
54
NUM_NULL_ONE
= (1 << 0),
55
NUM_NO_NEGATIVE
= (1 << 1),
56
NUM_NO_ZERO
= (1 << 2),
57
NUM_NO_FRACTION
= (1 << 3),
58
/* (1 << 9) and above are reserved for internal flags! */
59
};
60
61
/* -------------------------------------------------------------------- */
79
void
initNumInput
(
NumInput
*n);
83
void
outputNumInput
(
NumInput
*n,
char
*
str
,
const
UnitSettings
*unit_settings);
84
bool
hasNumInput
(
const
NumInput
*n);
88
bool
applyNumInput
(
NumInput
*n,
float
*vec);
89
bool
handleNumInput
(
bContext
*C,
NumInput
*n,
const
wmEvent
*event);
90
92
#define NUM_MODAL_INCREMENT_UP 18
93
#define NUM_MODAL_INCREMENT_DOWN 19
94
95
bool
user_string_to_number
(
bContext
*C,
96
const
char
*
str
,
97
const
UnitSettings
*unit,
98
int
type,
99
double
*r_value,
100
bool
use_single_line_error,
101
char
**r_error);
102
initNumInput
void initNumInput(NumInput *n)
Definition
numinput.cc:70
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_AFFECT_ALL
@ NUM_AFFECT_ALL
Definition
ED_numinput.hh:47
NUM_STR_REP_LEN
#define NUM_STR_REP_LEN
Definition
ED_numinput.hh:11
outputNumInput
void outputNumInput(NumInput *n, char *str, const UnitSettings *unit_settings)
Definition
numinput.cc:88
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:55
NUM_NULL_ONE
@ NUM_NULL_ONE
Definition
ED_numinput.hh:54
NUM_NO_ZERO
@ NUM_NO_ZERO
Definition
ED_numinput.hh:56
NUM_NO_FRACTION
@ NUM_NO_FRACTION
Definition
ED_numinput.hh:57
hasNumInput
bool hasNumInput(const NumInput *n)
Definition
numinput.cc:171
str
#define str(s)
Definition
ffmpeg_codecs.cc:103
NumInput
Definition
ED_numinput.hh:17
NumInput::idx_max
short idx_max
Definition
ED_numinput.hh:19
NumInput::val
float val[NUM_MAX_ELEMENTS]
Definition
ED_numinput.hh:30
NumInput::val_flag
short val_flag[NUM_MAX_ELEMENTS]
Definition
ED_numinput.hh:28
NumInput::unit_sys
int unit_sys
Definition
ED_numinput.hh:20
NumInput::val_inc
float val_inc[NUM_MAX_ELEMENTS]
Definition
ED_numinput.hh:34
NumInput::str
char str[NUM_STR_REP_LEN]
Definition
ED_numinput.hh:39
NumInput::val_org
float val_org[NUM_MAX_ELEMENTS]
Definition
ED_numinput.hh:32
NumInput::unit_type
int unit_type[NUM_MAX_ELEMENTS]
Definition
ED_numinput.hh:22
NumInput::flag
short flag
Definition
ED_numinput.hh:26
NumInput::unit_use_radians
bool unit_use_radians
Definition
ED_numinput.hh:23
NumInput::str_cur
int str_cur
Definition
ED_numinput.hh:42
NumInput::idx
short idx
Definition
ED_numinput.hh:37
UnitSettings
Definition
DNA_scene_types.h:1797
bContext
Definition
blenkernel/intern/context.cc:61
wmEvent
Definition
WM_types.hh:718
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0