Blender V5.3
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
11namespace blender {
12
14bool ED_numinput_double_is_int(double value);
15
16#define NUM_STR_REP_LEN 64
17#define NUM_MAX_ELEMENTS 3
18
19struct bContext;
20struct wmEvent;
21struct UnitSettings;
22
52
54enum {
55 NUM_AFFECT_ALL = (1 << 0),
56 /* (1 << 9) and above are reserved for internal flags! */
57};
58
60enum {
61 /* Public! */
62 NUM_NULL_ONE = (1 << 0),
63 NUM_NO_NEGATIVE = (1 << 1),
64 NUM_NO_ZERO = (1 << 2),
65 NUM_NO_FRACTION = (1 << 3),
71 /* (1 << 9) and above are reserved for internal flags! */
72};
73
74/* -------------------------------------------------------------------- */
77
91
92void initNumInput(NumInput *n);
96void outputNumInput(NumInput *n, char *str, const UnitSettings &unit_settings);
97bool hasNumInput(const NumInput *n);
101bool applyNumInput(NumInput *n, float *vec);
102bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event);
103
105#define NUM_MODAL_INCREMENT_UP 18
106#define NUM_MODAL_INCREMENT_DOWN 19
107
113bool user_string_to_number(bContext *C,
114 const char *str,
115 const UnitSettings &unit,
116 int type,
117 double *r_value,
118 double *r_value_no_units,
119 bool use_single_line_error,
120 char **r_error);
121
123
124} // namespace blender
#define NUM_STR_REP_LEN
#define NUM_MAX_ELEMENTS
#define C
Definition RandGen.cpp:29
#define str(s)
BMesh Iterators.
bool ED_numinput_double_is_int(double value)
Definition numinput.cc:73
bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
Definition numinput.cc:344
bool hasNumInput(const NumInput *n)
Definition numinput.cc:188
@ NUM_AFFECT_ALL
bool user_string_to_number(bContext *C, const char *str, const UnitSettings &unit, int type, double *r_value, double *r_value_no_units, bool use_single_line_error, char **r_error)
Definition numinput.cc:284
void initNumInput(NumInput *n)
Definition numinput.cc:85
bool applyNumInput(NumInput *n, float *vec)
Definition numinput.cc:207
void outputNumInput(NumInput *n, char *str, const UnitSettings &unit_settings)
Definition numinput.cc:104
@ NUM_INT_INPUT_VALUE
@ NUM_NO_NEGATIVE
@ NUM_NO_FRACTION
float val[NUM_MAX_ELEMENTS]
int unit_type[NUM_MAX_ELEMENTS]
float val_org[NUM_MAX_ELEMENTS]
float val_inc[NUM_MAX_ELEMENTS]
char str[NUM_STR_REP_LEN]
double val_no_units[NUM_MAX_ELEMENTS]
short val_flag[NUM_MAX_ELEMENTS]