Blender V4.5
rna_internal_types.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 <optional>
12#include <string>
13
14#include "BLI_vector_set.hh"
15
16#include "DNA_listBase.h"
17
18#include "RNA_access.hh"
19#include "RNA_define.hh"
20#include "RNA_types.hh"
21
22struct BlenderRNA;
24struct ContainerRNA;
25struct FunctionRNA;
26struct GHash;
29struct IDProperty;
30struct Main;
31struct PointerRNA;
32struct PropertyRNA;
33struct ReportList;
34struct Scene;
35struct StructRNA;
36struct bContext;
37
38/* Function Callbacks */
39
50using UpdateFunc = void (*)(Main *bmain, Scene *active_scene, PointerRNA *ptr);
53
54using EditableFunc = int (*)(const PointerRNA *ptr, const char **r_info);
55using ItemEditableFunc = int (*)(const PointerRNA *ptr, int index);
58using StructPathFunc = std::optional<std::string> (*)(const PointerRNA *ptr);
59
62using PropBooleanSetFunc = void (*)(PointerRNA *ptr, bool value);
63using PropBooleanArrayGetFunc = void (*)(PointerRNA *ptr, bool *values);
64using PropBooleanArraySetFunc = void (*)(PointerRNA *ptr, const bool *values);
65using PropIntGetFunc = int (*)(PointerRNA *ptr);
66using PropIntSetFunc = void (*)(PointerRNA *ptr, int value);
67using PropIntArrayGetFunc = void (*)(PointerRNA *ptr, int *values);
68using PropIntArraySetFunc = void (*)(PointerRNA *ptr, const int *values);
69using PropIntRangeFunc = void (*)(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax);
70using PropFloatGetFunc = float (*)(PointerRNA *ptr);
71using PropFloatSetFunc = void (*)(PointerRNA *ptr, float value);
72using PropFloatArrayGetFunc = void (*)(PointerRNA *ptr, float *values);
73using PropFloatArraySetFunc = void (*)(PointerRNA *ptr, const float *values);
75 void (*)(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax);
76using PropStringGetFunc = void (*)(PointerRNA *ptr, char *value);
78using PropStringSetFunc = void (*)(PointerRNA *ptr, const char *value);
79using PropEnumGetFunc = int (*)(PointerRNA *ptr);
80using PropEnumSetFunc = void (*)(PointerRNA *ptr, int value);
83 PropertyRNA *prop,
84 bool *r_free);
88using PropPointerPollFunc = bool (*)(PointerRNA *ptr, const PointerRNA value);
90 const PointerRNA value,
91 const PropertyRNA *prop);
97using PropCollectionLookupIntFunc = bool (*)(PointerRNA *ptr, int key, PointerRNA *r_ptr);
99 const char *key,
100 PointerRNA *r_ptr);
102 int key,
103 const PointerRNA *assign_ptr);
104
105/* Extended versions with #PropertyRNA argument. */
106
108using PropBooleanSetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, bool value);
109using PropBooleanArrayGetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, bool *values);
110using PropBooleanArraySetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, const bool *values);
112using PropIntSetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, int value);
113using PropIntArrayGetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, int *values);
114using PropIntArraySetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, const int *values);
116 void (*)(PointerRNA *ptr, PropertyRNA *prop, int *min, int *max, int *softmin, int *softmax);
117using PropFloatGetFuncEx = float (*)(PointerRNA *ptr, PropertyRNA *prop);
118using PropFloatSetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, float value);
119using PropFloatArrayGetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, float *values);
120using PropFloatArraySetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, const float *values);
121using PropFloatRangeFuncEx = void (*)(
122 PointerRNA *ptr, PropertyRNA *prop, float *min, float *max, float *softmin, float *softmax);
123using PropStringGetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, char *value);
125using PropStringSetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, const char *value);
127using PropEnumSetFuncEx = void (*)(PointerRNA *ptr, PropertyRNA *prop, int value);
128
129/* Handling override operations, and also comparison. */
130
188
234using RNAPropOverrideDiff = void (*)(Main *bmain, RNAPropertyOverrideDiffContext &rnadiff_ctx);
235
246using RNAPropOverrideStore = bool (*)(Main *bmain,
247 PointerRNA *ptr_local,
248 PointerRNA *ptr_reference,
249 PointerRNA *ptr_storage,
250 PropertyRNA *prop_local,
251 PropertyRNA *prop_reference,
252 PropertyRNA *prop_storage,
253 int len_local,
254 int len_reference,
255 int len_storage,
257
297using RNAPropOverrideApply = bool (*)(Main *bmain, RNAPropertyOverrideApplyContext &rnaapply_ctx);
298
302
310
315 const char *identifier;
316
318 int flag;
319
321 const char *description;
322
325
332};
333
421
423{
424 return prop->identifier;
425}
426
440
441/* Property Types. */
442
461
487
515
547
566
578
594
676
692
693#define CONTAINER_RNA_ID(cont) (*(const char **)(((ContainerRNA *)(cont)) + 1))
unsigned int uint
These structs are the foundation for all linked lists in the library system.
eRNAOverrideApplyFlag
@ RNA_OVERRIDE_APPLY_FLAG_NOP
eRNAOverrideMatch
eRNACompareMode
@ RNA_EQ_COMPARE
eRNAOverrideMatchResult
#define RNA_MAX_ARRAY_DIMENSION
Definition RNA_define.hh:26
std::optional< std::string >(*)(const bContext *C, PointerRNA *ptr, PropertyRNA *prop) StringPropertyPathFilterFunc
Definition RNA_types.hh:726
PropertyScaleType
Definition RNA_types.hh:191
eStringPropertySearchFlag
Definition RNA_types.hh:687
PropertyType
Definition RNA_types.hh:149
bool(*)(Main *bmain, StructRNA *type) StructUnregisterFunc
Definition RNA_types.hh:885
void(*)(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn) StringPropertySearchFunc
Definition RNA_types.hh:715
void **(*)(PointerRNA *ptr) StructInstanceFunc
Definition RNA_types.hh:886
StructRNA *(*)(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) StructRegisterFunc
Definition RNA_types.hh:877
PropertyPathTemplateType
Definition RNA_types.hh:456
void(*)(bContext *C, ReportList *reports, PointerRNA *ptr, ParameterList *parms) CallFunc
Definition RNA_types.hh:836
RawPropertyType
Definition RNA_types.hh:588
PropertySubType
Definition RNA_types.hh:220
#define C
Definition RandGen.cpp:29
ReportList * reports
Definition WM_types.hh:1025
float length(VecOp< float, D >) RET
VectorSet< T, InlineBufferCapacity, DefaultProbingStrategy, CustomIDHash< T, GetIDFn >, CustomIDEqual< T, GetIDFn > > CustomIDVectorSet
bool(*)(Main *bmain, RNAPropertyOverrideApplyContext &rnaapply_ctx) RNAPropOverrideApply
const EnumPropertyItem *(*)(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free) PropEnumItemFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, const int *values) PropIntArraySetFuncEx
int(*)(PointerRNA *ptr, PropertyRNA *prop) PropStringLengthFuncEx
void(*)(PointerRNA *ptr, PropertyRNA *prop, int value) PropEnumSetFuncEx
StructRNA *(*)(PointerRNA *ptr) StructRefineFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, int *min, int *max, int *softmin, int *softmax) PropIntRangeFuncEx
void(*)(PointerRNA *ptr, PropertyRNA *prop, int value) PropIntSetFuncEx
void(*)(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) PropFloatRangeFunc
void(*)(PointerRNA *ptr, bool *values) PropBooleanArrayGetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, bool value) PropBooleanSetFuncEx
void(*)(CollectionPropertyIterator *iter) PropCollectionNextFunc
int(*)(PointerRNA *ptr) PropStringLengthFunc
void(*)(CollectionPropertyIterator *iter, PointerRNA *ptr) PropCollectionBeginFunc
void(*)(bContext *C, PointerRNA *ptr, PropertyRNA *prop) ContextPropUpdateFunc
bool(*)(PointerRNA *ptr, int key, PointerRNA *r_ptr) PropCollectionLookupIntFunc
PointerRNA(*)(CollectionPropertyIterator *iter) PropCollectionGetFunc
void(*)(bContext *C, PointerRNA *ptr) ContextUpdateFunc
IDProperty **(*)(PointerRNA *ptr) IDPropertiesFunc
void(*)(PointerRNA *ptr, const PointerRNA value, ReportList *reports) PropPointerSetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, const bool *values) PropBooleanArraySetFuncEx
PropertyFlagIntern
@ PROP_INTERN_BUILTIN
@ PROP_INTERN_RAW_ACCESS
@ PROP_INTERN_PTR_OWNERSHIP_FORCED
@ PROP_INTERN_FREE_POINTERS
@ PROP_INTERN_RAW_ARRAY
@ PROP_INTERN_RUNTIME
void(*)(PointerRNA *ptr, PropertyRNA *prop, const char *value) PropStringSetFuncEx
int(*)(const PointerRNA *ptr, int index) ItemEditableFunc
bool(*)(PointerRNA *ptr, PropertyRNA *prop) PropBooleanGetFuncEx
void(*)(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) PropIntRangeFunc
void(*)(PointerRNA *ptr, int value) PropEnumSetFunc
int(*)(PointerRNA *ptr) PropEnumGetFunc
void(*)(Main *bmain, Scene *active_scene, PointerRNA *ptr) UpdateFunc
int(*)(const PointerRNA *ptr, const char **r_info) EditableFunc
bool(*)(PointerRNA *ptr, const char *key, PointerRNA *r_ptr) PropCollectionLookupStringFunc
int(*)(PointerRNA *ptr, PropertyRNA *prop) PropEnumGetFuncEx
void(*)(PointerRNA *ptr, PropertyRNA *prop, char *value) PropStringGetFuncEx
void(*)(PointerRNA *ptr, PropertyRNA *prop, float value) PropFloatSetFuncEx
void(*)(PointerRNA *ptr, int value) PropIntSetFunc
int(*)(const PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) PropArrayLengthGetFunc
PointerRNA(*)(PointerRNA *ptr) PropPointerGetFunc
void(*)( PointerRNA *ptr, PropertyRNA *prop, float *min, float *max, float *softmin, float *softmax) PropFloatRangeFuncEx
bool(*)(PointerRNA *ptr, const PointerRNA value) PropPointerPollFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, const float *values) PropFloatArraySetFuncEx
void(*)(PointerRNA *ptr, PropertyRNA *prop, float *values) PropFloatArrayGetFuncEx
void(*)(PointerRNA *ptr, const float *values) PropFloatArraySetFunc
StructRNA *(*)(PointerRNA *ptr) PropPointerTypeFunc
void(*)(Main *bmain, RNAPropertyOverrideDiffContext &rnadiff_ctx) RNAPropOverrideDiff
void(*)(PointerRNA *ptr, char *value) PropStringGetFunc
void(*)(PointerRNA *ptr, bool value) PropBooleanSetFunc
bool(*)(Main *bmain, PointerRNA *ptr_local, PointerRNA *ptr_reference, PointerRNA *ptr_storage, PropertyRNA *prop_local, PropertyRNA *prop_reference, PropertyRNA *prop_storage, int len_local, int len_reference, int len_storage, IDOverrideLibraryPropertyOperation *opop) RNAPropOverrideStore
std::optional< std::string >(*)(const PointerRNA *ptr) StructPathFunc
int(*)(PointerRNA *ptr) PropCollectionLengthFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, int *values) PropIntArrayGetFuncEx
void(*)(PointerRNA *ptr, PropertyRNA *prop, bool *values) PropBooleanArrayGetFuncEx
void(*)(PointerRNA *ptr, const bool *values) PropBooleanArraySetFunc
bool(*)(PointerRNA *ptr) PropBooleanGetFunc
bool(*)(PointerRNA *ptr, int key, const PointerRNA *assign_ptr) PropCollectionAssignIntFunc
void(*)(PointerRNA *ptr, int *values) PropIntArrayGetFunc
void(*)(PointerRNA *ptr, float value) PropFloatSetFunc
bool(*)(PointerRNA *ptr, const PointerRNA value, const PropertyRNA *prop) PropPointerPollFuncPy
void(*)(PointerRNA *ptr, const int *values) PropIntArraySetFunc
int(*)(PointerRNA *ptr, PropertyRNA *prop) PropIntGetFuncEx
int(*)(PointerRNA *ptr) PropIntGetFunc
float(*)(PointerRNA *ptr, PropertyRNA *prop) PropFloatGetFuncEx
void(*)(PointerRNA *ptr, const char *value) PropStringSetFunc
float(*)(PointerRNA *ptr) PropFloatGetFunc
void(*)(PointerRNA *ptr, float *values) PropFloatArrayGetFunc
void(*)(CollectionPropertyIterator *iter) PropCollectionEndFunc
#define min(a, b)
Definition sort.cc:36
unsigned int structs_len
PropBooleanGetFuncEx get_default
PropBooleanArraySetFuncEx setarray_ex
PropBooleanArrayGetFuncEx getarray_ex
PropBooleanArraySetFunc setarray
const bool * defaultarray
PropBooleanArrayGetFuncEx get_default_array
PropBooleanSetFunc set
PropBooleanGetFunc get
PropBooleanSetFuncEx set_ex
PropBooleanGetFuncEx get_ex
PropBooleanArrayGetFunc getarray
PropCollectionNextFunc next
PropCollectionLookupStringFunc lookupstring
PropCollectionLengthFunc length
PropCollectionLookupIntFunc lookupint
PropCollectionBeginFunc begin
PropCollectionAssignIntFunc assignint
PropCollectionEndFunc end
PropCollectionGetFunc get
blender::CustomIDVectorSet< PropertyRNA *, PropertyRNAIdentifierGetter > * prop_lookup_set
const EnumPropertyItem * item
PropEnumSetFuncEx set_ex
PropEnumGetFuncEx get_default
PropEnumGetFunc get
const char * native_enum_type
PropEnumItemFunc item_fn
PropEnumGetFuncEx get_ex
PropEnumSetFunc set
PropFloatSetFuncEx set_ex
PropertyScaleType ui_scale_type
PropFloatGetFunc get
PropFloatRangeFuncEx range_ex
PropFloatArrayGetFuncEx getarray_ex
PropFloatArraySetFuncEx setarray_ex
PropFloatArrayGetFunc getarray
PropFloatGetFuncEx get_default
PropFloatSetFunc set
const float * defaultarray
PropFloatRangeFunc range
PropFloatArraySetFunc setarray
PropFloatGetFuncEx get_ex
PropFloatArrayGetFuncEx get_default_array
const char * identifier
PropertyRNA * c_ret
ContainerRNA cont
const char * description
PropIntRangeFuncEx range_ex
PropIntArrayGetFunc getarray
PropIntArrayGetFuncEx getarray_ex
PropIntRangeFunc range
PropIntArraySetFunc setarray
PropIntGetFuncEx get_ex
PropIntArrayGetFuncEx get_default_array
PropIntArraySetFuncEx setarray_ex
PropertyScaleType ui_scale_type
PropIntGetFuncEx get_default
PropIntSetFuncEx set_ex
PropPointerTypeFunc type_fn
PropPointerGetFunc get
PropPointerPollFunc poll
PropPointerSetFunc set
blender::StringRef operator()(const PropertyRNA *prop) const
ItemEditableFunc itemeditable
PropArrayLengthGetFunc getlength
const char * translation_context
RNAPropOverrideApply override_apply
unsigned int arraydimension
PropertyRNA * prev
EditableFunc editable
PropertyPathTemplateType path_template_type
RNAPropOverrideStore override_store
PropertyRNA * next
RNAPropOverrideDiff override_diff
PropertySubType subtype
unsigned int arraylength[RNA_MAX_ARRAY_DIMENSION]
const char * description
const char * name
unsigned int totarraylength
const char * identifier
RawPropertyType rawtype
PropertyType type
IDOverrideLibraryProperty * liboverride_property
IDOverrideLibraryPropertyOperation * liboverride_operation
eRNAOverrideMatchResult report_flag
StringPropertyPathFilterFunc path_filter
PropStringSetFunc set
PropStringLengthFuncEx length_ex
PropStringLengthFunc length
PropStringGetFuncEx get_ex
PropStringSetFuncEx set_ex
PropStringGetFunc get
StringPropertySearchFunc search
eStringPropertySearchFlag search_flag
StructRNA * nested
StructRegisterFunc reg
StructUnregisterFunc unreg
const char * name
const char * identifier
StructInstanceFunc instance
ContainerRNA cont
const char * translation_context
const EnumPropertyItem * prop_tag_defines
PropertyRNA * nameproperty
const char * description
IDPropertiesFunc idproperties
PropertyRNA * iteratorproperty
StructRNA * base
StructRefineFunc refine
StructPathFunc path
max
Definition text_draw.cc:251
PointerRNA * ptr
Definition wm_files.cc:4226