Cleanup: Replace typedef keyword in C++ headers

This commit is contained in:
Hans Goudey 2024-02-13 15:34:32 -05:00
parent 7b77c2ebd4
commit 5ba6f6d833
22 changed files with 160 additions and 151 deletions

View File

@ -11,13 +11,19 @@
#include "GPU_texture.h"
#include "GPU_vertex_buffer.h"
struct ColorManagedDisplay;
struct FontBLF;
struct GPUBatch;
struct GPUVertBuf;
struct GPUVertBufRaw;
#include FT_MULTIPLE_MASTERS_H /* Variable font support. */
/** Maximum variation axes per font. */
#define BLF_VARIATIONS_MAX 16
#define MAKE_DVAR_TAG(a, b, c, d) \
(((uint32_t)a << 24u) | ((uint32_t)b << 16u) | ((uint32_t)c << 8u) | ((uint32_t)d))
((uint32_t(a) << 24u) | (uint32_t(b) << 16u) | (uint32_t(c) << 8u) | (uint32_t(d)))
#define BLF_VARIATION_AXIS_WEIGHT MAKE_DVAR_TAG('w', 'g', 'h', 't') /* 'wght' weight axis. */
#define BLF_VARIATION_AXIS_SLANT MAKE_DVAR_TAG('s', 'l', 'n', 't') /* 'slnt' slant axis. */
@ -44,27 +50,27 @@ typedef int32_t ft_pix;
#define FT_PIX_ROUND(x) FT_PIX_FLOOR((x) + 32)
#define FT_PIX_CEIL(x) ((x) + 63)
BLI_INLINE int ft_pix_to_int(ft_pix v)
inline int ft_pix_to_int(ft_pix v)
{
return (int)(v >> 6);
return int(v >> 6);
}
BLI_INLINE int ft_pix_to_int_floor(ft_pix v)
inline int ft_pix_to_int_floor(ft_pix v)
{
return (int)(v >> 6); /* No need for explicit floor as the bits are removed when shifting. */
return int(v >> 6); /* No need for explicit floor as the bits are removed when shifting. */
}
BLI_INLINE int ft_pix_to_int_ceil(ft_pix v)
inline int ft_pix_to_int_ceil(ft_pix v)
{
return (int)(FT_PIX_CEIL(v) >> 6);
return int(FT_PIX_CEIL(v) >> 6);
}
BLI_INLINE ft_pix ft_pix_from_int(int v)
inline ft_pix ft_pix_from_int(int v)
{
return v * 64;
}
BLI_INLINE ft_pix ft_pix_from_float(float v)
inline ft_pix ft_pix_from_float(float v)
{
return lroundf(v * 64.0f);
}
@ -79,12 +85,12 @@ BLI_INLINE ft_pix ft_pix_from_float(float v)
/** A value in the kerning cache that indicates it is not yet set. */
#define KERNING_ENTRY_UNSET INT_MAX
typedef struct BatchBLF {
struct BatchBLF {
/** Can only batch glyph from the same font. */
struct FontBLF *font;
struct GPUBatch *batch;
struct GPUVertBuf *verts;
struct GPUVertBufRaw pos_step, col_step, offset_step, glyph_size_step, glyph_comp_len_step,
FontBLF *font;
GPUBatch *batch;
GPUVertBuf *verts;
GPUVertBufRaw pos_step, col_step, offset_step, glyph_size_step, glyph_comp_len_step,
glyph_mode_step;
unsigned int pos_loc, col_loc, offset_loc, glyph_size_loc, glyph_comp_len_loc, glyph_mode_loc;
unsigned int glyph_len;
@ -93,22 +99,22 @@ typedef struct BatchBLF {
/* Previous call `modelmatrix`. */
float mat[4][4];
bool enabled, active, simple_shader;
struct GlyphCacheBLF *glyph_cache;
} BatchBLF;
GlyphCacheBLF *glyph_cache;
};
extern BatchBLF g_batch;
typedef struct KerningCacheBLF {
struct KerningCacheBLF {
/**
* Cache a ascii glyph pairs. Only store the x offset we are interested in,
* instead of the full #FT_Vector since it's not used for drawing at the moment.
*/
int ascii_table[KERNING_CACHE_TABLE_SIZE][KERNING_CACHE_TABLE_SIZE];
} KerningCacheBLF;
};
typedef struct GlyphCacheBLF {
struct GlyphCacheBLF *next;
struct GlyphCacheBLF *prev;
struct GlyphCacheBLF {
GlyphCacheBLF *next;
GlyphCacheBLF *prev;
/** Font size. */
float size;
@ -133,12 +139,11 @@ typedef struct GlyphCacheBLF {
int bitmap_len;
int bitmap_len_landed;
int bitmap_len_alloc;
};
} GlyphCacheBLF;
typedef struct GlyphBLF {
struct GlyphBLF *next;
struct GlyphBLF *prev;
struct GlyphBLF {
GlyphBLF *next;
GlyphBLF *prev;
/** The character, as UTF-32. */
unsigned int c;
@ -183,10 +188,10 @@ typedef struct GlyphBLF {
*/
int pos[2];
struct GlyphCacheBLF *glyph_cache;
} GlyphBLF;
GlyphCacheBLF *glyph_cache;
};
typedef struct FontBufInfoBLF {
struct FontBufInfoBLF {
/** For draw to buffer, always set this to NULL after finish! */
float *fbuf;
@ -200,17 +205,16 @@ typedef struct FontBufInfoBLF {
int ch;
/** Display device used for color management. */
struct ColorManagedDisplay *display;
ColorManagedDisplay *display;
/** The color, the alphas is get from the glyph! (color is sRGB space). */
float col_init[4];
/** Cached conversion from 'col_init'. */
unsigned char col_char[4];
float col_float[4];
};
} FontBufInfoBLF;
typedef struct FontMetrics {
struct FontMetrics {
/** Indicate that these values have been properly loaded. */
bool valid;
/** This font's default weight, 100-900, 400 is normal. */
@ -274,9 +278,9 @@ typedef struct FontMetrics {
short superscript_xoffset;
/** Positive (!) number of font units below baseline for subscript characters. */
short superscript_yoffset;
} FontMetrics;
};
typedef struct FontBLF {
struct FontBLF {
/** Full path to font file or NULL if from memory. */
char *filepath;
@ -382,4 +386,4 @@ typedef struct FontBLF {
/** Mutex lock for glyph cache. */
ThreadMutex glyph_cache_mutex;
} FontBLF;
};

View File

@ -75,10 +75,10 @@ struct BPathForeachPathData;
* \return `true` if the path has been changed, and in that case,
* result must be written to `path_dst`.
*/
typedef bool (*BPathForeachPathFunctionCallback)(BPathForeachPathData *bpath_data,
char *path_dst,
size_t path_dst_maxncpy,
const char *path_src);
using BPathForeachPathFunctionCallback = bool (*)(BPathForeachPathData *bpath_data,
char *path_dst,
size_t path_dst_maxncpy,
const char *path_src);
/** Storage for common data needed across the BPath 'foreach_path' code. */
struct BPathForeachPathData {

View File

@ -69,7 +69,7 @@ struct PointerRNA;
* All callbacks here must be exposed via the Python module `bpy.app.handlers`,
* see `bpy_app_handlers.cc`.
*/
typedef enum {
enum eCbEvent {
BKE_CB_EVT_FRAME_CHANGE_PRE,
BKE_CB_EVT_FRAME_CHANGE_POST,
BKE_CB_EVT_RENDER_PRE,
@ -111,7 +111,7 @@ typedef enum {
BKE_CB_EVT_EXTENSION_REPOS_SYNC,
BKE_CB_EVT_EXTENSION_REPOS_UPGRADE,
BKE_CB_EVT_TOT,
} eCbEvent;
};
struct bCallbackFuncStore {
bCallbackFuncStore *next, *prev;

View File

@ -305,8 +305,8 @@ void BKE_collection_blend_read_data(BlendDataReader *reader, Collection *collect
/* Iteration callbacks. */
typedef void (*BKE_scene_objects_Cb)(Object *ob, void *data);
typedef void (*BKE_scene_collections_Cb)(Collection *ob, void *data);
using BKE_scene_objects_Cb = void (*)(Object *ob, void *data);
using BKE_scene_collections_Cb = void (*)(Collection *ob, void *data);
/* Iteration over objects in collection. */

View File

@ -32,7 +32,7 @@ struct Object;
struct rctf;
struct TextBox;
typedef int eBezTriple_Flag__Alias;
using eBezTriple_Flag__Alias = int;
struct CurveCache {
ListBase disp;

View File

@ -73,7 +73,7 @@ extern const CustomData_MeshMasks CD_MASK_EVERYTHING;
* CD_NUMTYPES elements, that indicate if a layer can be copied. */
/** Add/copy/merge allocation types. */
typedef enum eCDAllocType {
enum eCDAllocType {
/** Allocate and set to default, which is usually just zeroed memory. */
CD_SET_DEFAULT = 2,
/**
@ -81,18 +81,18 @@ typedef enum eCDAllocType {
* if all layer values will be set by the caller after creating the layer.
*/
CD_CONSTRUCT = 5,
} eCDAllocType;
};
#define CD_TYPE_AS_MASK(_type) (eCustomDataMask)((eCustomDataMask)1 << (eCustomDataMask)(_type))
void customData_mask_layers__print(const CustomData_MeshMasks *mask);
typedef void (*cd_interp)(
using cd_interp = void (*)(
const void **sources, const float *weights, const float *sub_weights, int count, void *dest);
typedef void (*cd_copy)(const void *source, void *dest, int count);
typedef void (*cd_set_default_value)(void *data, int count);
typedef void (*cd_free)(void *data, int count);
typedef bool (*cd_validate)(void *item, uint totitems, bool do_fixes);
using cd_copy = void (*)(const void *source, void *dest, int count);
using cd_set_default_value = void (*)(void *data, int count);
using cd_free = void (*)(void *data, int count);
using cd_validate = bool (*)(void *item, uint totitems, bool do_fixes);
/**
* Update mask_dst with layers defined in mask_src (equivalent to a bit-wise OR).

View File

@ -60,40 +60,40 @@ bool BKE_idtype_cache_key_cmp(const void *key_a_v, const void *key_b_v);
/* ********** Prototypes for #IDTypeInfo callbacks. ********** */
typedef void (*IDTypeInitDataFunction)(ID *id);
using IDTypeInitDataFunction = void (*)(ID *id);
/** \param flag: Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more). */
typedef void (*IDTypeCopyDataFunction)(Main *bmain, ID *id_dst, const ID *id_src, int flag);
using IDTypeCopyDataFunction = void (*)(Main *bmain, ID *id_dst, const ID *id_src, int flag);
typedef void (*IDTypeFreeDataFunction)(ID *id);
using IDTypeFreeDataFunction = void (*)(ID *id);
/** \param flags: See BKE_lib_id.hh's LIB_ID_MAKELOCAL_... flags. */
typedef void (*IDTypeMakeLocalFunction)(Main *bmain, ID *id, int flags);
using IDTypeMakeLocalFunction = void (*)(Main *bmain, ID *id, int flags);
typedef void (*IDTypeForeachIDFunction)(ID *id, LibraryForeachIDData *data);
using IDTypeForeachIDFunction = void (*)(ID *id, LibraryForeachIDData *data);
typedef enum eIDTypeInfoCacheCallbackFlags {
enum eIDTypeInfoCacheCallbackFlags {
/** Indicates to the callback that cache may be stored in the .blend file,
* so its pointer should not be cleared at read-time. */
IDTYPE_CACHE_CB_FLAGS_PERSISTENT = 1 << 0,
} eIDTypeInfoCacheCallbackFlags;
typedef void (*IDTypeForeachCacheFunctionCallback)(
ID *id, const IDCacheKey *cache_key, void **cache_p, uint flags, void *user_data);
typedef void (*IDTypeForeachCacheFunction)(ID *id,
IDTypeForeachCacheFunctionCallback function_callback,
void *user_data);
};
using IDTypeForeachCacheFunctionCallback =
void (*)(ID *id, const IDCacheKey *cache_key, void **cache_p, uint flags, void *user_data);
using IDTypeForeachCacheFunction = void (*)(ID *id,
IDTypeForeachCacheFunctionCallback function_callback,
void *user_data);
typedef void (*IDTypeForeachPathFunction)(ID *id, BPathForeachPathData *bpath_data);
using IDTypeForeachPathFunction = void (*)(ID *id, BPathForeachPathData *bpath_data);
typedef ID **(*IDTypeEmbeddedOwnerPointerGetFunction)(ID *id);
using IDTypeEmbeddedOwnerPointerGetFunction = ID **(*)(ID *id);
typedef void (*IDTypeBlendWriteFunction)(BlendWriter *writer, ID *id, const void *id_address);
typedef void (*IDTypeBlendReadDataFunction)(BlendDataReader *reader, ID *id);
typedef void (*IDTypeBlendReadAfterLiblinkFunction)(BlendLibReader *reader, ID *id);
using IDTypeBlendWriteFunction = void (*)(BlendWriter *writer, ID *id, const void *id_address);
using IDTypeBlendReadDataFunction = void (*)(BlendDataReader *reader, ID *id);
using IDTypeBlendReadAfterLiblinkFunction = void (*)(BlendLibReader *reader, ID *id);
typedef void (*IDTypeBlendReadUndoPreserve)(BlendLibReader *reader, ID *id_new, ID *id_old);
using IDTypeBlendReadUndoPreserve = void (*)(BlendLibReader *reader, ID *id_new, ID *id_old);
typedef void (*IDTypeLibOverrideApplyPost)(ID *id_dst, ID *id_src);
using IDTypeLibOverrideApplyPost = void (*)(ID *id_dst, ID *id_src);
struct IDTypeInfo {
/* ********** General IDType data. ********** */

View File

@ -212,7 +212,7 @@ ID *BKE_libblock_find_name_and_library(Main *bmain,
* Duplicate (a.k.a. deep copy) common processing options.
* See also eDupli_ID_Flags for options controlling what kind of IDs to duplicate.
*/
typedef enum eLibIDDuplicateFlags {
enum eLibIDDuplicateFlags {
/** This call to a duplicate function is part of another call for some parent ID.
* Therefore, this sub-process should not clear `newid` pointers, nor handle remapping itself.
* NOTE: In some cases (like Object one), the duplicate function may be called on the root ID
@ -222,7 +222,7 @@ typedef enum eLibIDDuplicateFlags {
/** This call is performed on a 'root' ID, and should therefore perform some decisions regarding
* sub-IDs (dependencies), check for linked vs. locale data, etc. */
LIB_ID_DUPLICATE_IS_ROOT_ID = 1 << 1,
} eLibIDDuplicateFlags;
} ;
ENUM_OPERATORS(eLibIDDuplicateFlags, LIB_ID_DUPLICATE_IS_ROOT_ID)

View File

@ -141,7 +141,7 @@ struct LibraryIDLinkCallbackData {
*
* \return a set of flags to control further iteration (0 to keep going).
*/
typedef int (*LibraryIDLinkCallback)(LibraryIDLinkCallbackData *cb_data);
using LibraryIDLinkCallback = int (*)(LibraryIDLinkCallbackData *cb_data);
/* Flags for the foreach function itself. */
enum {

View File

@ -10,12 +10,12 @@
#include "BLI_sys_types.h"
typedef struct BLI_HashMurmur2A {
struct BLI_HashMurmur2A {
uint32_t hash;
uint32_t tail;
uint32_t count;
uint32_t size;
} BLI_HashMurmur2A;
};
void BLI_hash_mm2a_init(BLI_HashMurmur2A *mm2, uint32_t seed);

View File

@ -249,7 +249,7 @@ void interpolate_cubic_mitchell_fl(
#define EWA_MAXIDX 255
extern const float EWA_WTS[EWA_MAXIDX + 1];
typedef void (*ewa_filter_read_pixel_cb)(void *userdata, int x, int y, float result[4]);
using ewa_filter_read_pixel_cb = void (*)(void *userdata, int x, int y, float result[4]);
void BLI_ewa_imp2radangle(
float A, float B, float C, float F, float *a, float *b, float *th, float *ecc);

View File

@ -367,7 +367,7 @@ void BLO_read_invalidate_message(BlendHandle *bh, Main *bmain, const char *messa
* \note merged with 'user-level' options from operators etc. in 16 lower bits
* (see #eFileSel_Params_Flag in DNA_space_types.h).
*/
typedef enum eBLOLibLinkFlags {
enum eBLOLibLinkFlags {
/** Generate a placeholder (empty ID) if not found in current lib file. */
BLO_LIBLINK_USE_PLACEHOLDERS = 1 << 16,
/** Force loaded ID to be tagged as #LIB_TAG_INDIRECT (used in reload context only). */
@ -388,7 +388,7 @@ typedef enum eBLOLibLinkFlags {
BLO_LIBLINK_OBDATA_INSTANCE = 1 << 24,
/** Instantiate collections as empties, instead of linking them into current view layer. */
BLO_LIBLINK_COLLECTION_INSTANCE = 1 << 25,
} eBLOLibLinkFlags;
};
/**
* Struct for passing arguments to

View File

@ -57,12 +57,12 @@ struct DRWUpdateContext {
};
void DRW_notify_view_update(const DRWUpdateContext *update_ctx);
typedef enum eDRWSelectStage {
enum eDRWSelectStage {
DRW_SELECT_PASS_PRE = 1,
DRW_SELECT_PASS_POST,
} eDRWSelectStage;
typedef bool (*DRW_SelectPassFn)(eDRWSelectStage stage, void *user_data);
typedef bool (*DRW_ObjectFilterFn)(Object *ob, void *user_data);
};
using DRW_SelectPassFn = bool (*)(eDRWSelectStage stage, void *user_data);
using DRW_ObjectFilterFn = bool (*)(Object *ob, void *user_data);
/**
* Everything starts here.

View File

@ -25,13 +25,13 @@ struct Scene;
/**
* Shape resolution level of detail.
*/
typedef enum eDRWLevelOfDetail {
enum eDRWLevelOfDetail {
DRW_LOD_LOW = 0,
DRW_LOD_MEDIUM = 1,
DRW_LOD_HIGH = 2,
DRW_LOD_MAX, /* Max number of level of detail */
} eDRWLevelOfDetail;
};
void DRW_shape_cache_free();

View File

@ -15,6 +15,6 @@
namespace blender::gpu {
typedef Vector<StringRef> DebugStack;
using DebugStack = Vector<StringRef>;
} // namespace blender::gpu

View File

@ -19,7 +19,7 @@
struct GPUTexture;
typedef enum GPUAttachmentType : int {
enum GPUAttachmentType : int {
GPU_FB_DEPTH_ATTACHMENT = 0,
GPU_FB_DEPTH_STENCIL_ATTACHMENT,
GPU_FB_COLOR_ATTACHMENT0,
@ -35,7 +35,7 @@ typedef enum GPUAttachmentType : int {
* the maximum number of COLOR attachments specified by glDrawBuffers. */
GPU_FB_MAX_ATTACHMENT,
} GPUAttachmentType;
};
#define GPU_FB_MAX_COLOR_ATTACHMENT (GPU_FB_MAX_ATTACHMENT - GPU_FB_COLOR_ATTACHMENT0)

View File

@ -17,7 +17,7 @@
namespace blender {
namespace gpu {
typedef enum eGPUTextureFormatFlag {
enum eGPUTextureFormatFlag {
/* The format has a depth component and can be used as depth attachment. */
GPU_FORMAT_DEPTH = (1 << 0),
/* The format has a stencil component and can be used as stencil attachment. */
@ -36,7 +36,7 @@ typedef enum eGPUTextureFormatFlag {
GPU_FORMAT_SIGNED = (1 << 7),
GPU_FORMAT_DEPTH_STENCIL = (GPU_FORMAT_DEPTH | GPU_FORMAT_STENCIL),
} eGPUTextureFormatFlag;
};
ENUM_OPERATORS(eGPUTextureFormatFlag, GPU_FORMAT_SIGNED)

View File

@ -627,7 +627,7 @@ void IMB_processor_apply_threaded(
void(init_handle)(void *handle, int start_line, int tot_line, void *customdata),
void *(do_thread)(void *));
typedef void (*ScanlineThreadFunc)(void *custom_data, int scanline);
using ScanlineThreadFunc = void (*)(void *custom_data, int scanline);
void IMB_processor_apply_threaded_scanlines(int total_scanlines,
ScanlineThreadFunc do_thread,
void *custom_data);

View File

@ -58,5 +58,5 @@ void IMB_metadata_copy(ImBuf *dimb, ImBuf *simb);
IDProperty *IMB_anim_load_metadata(ImBufAnim *anim);
/* Invoke callback for every value stored in the metadata. */
typedef void (*IMBMetadataForeachCb)(const char *field, const char *value, void *userdata);
using IMBMetadataForeachCb = void (*)(const char *field, const char *value, void *userdata);
void IMB_metadata_foreach(ImBuf *ibuf, IMBMetadataForeachCb callback, void *userdata);

View File

@ -18,11 +18,14 @@
struct ImBuf;
struct MovieCache;
typedef void (*MovieCacheGetKeyDataFP)(void *userkey, int *framenr, int *proxy, int *render_flags);
using MovieCacheGetKeyDataFP = void (*)(void *userkey,
int *framenr,
int *proxy,
int *render_flags);
typedef void *(*MovieCacheGetPriorityDataFP)(void *userkey);
typedef int (*MovieCacheGetItemPriorityFP)(void *last_userkey, void *priority_data);
typedef void (*MovieCachePriorityDeleterFP)(void *priority_data);
using MovieCacheGetPriorityDataFP = void *(*)(void *userkey);
using MovieCacheGetItemPriorityFP = int (*)(void *last_userkey, void *priority_data);
using MovieCachePriorityDeleterFP = void (*)(void *priority_data);
void IMB_moviecache_init(void);
void IMB_moviecache_destruct(void);

View File

@ -451,10 +451,10 @@ void RNA_def_property_override_funcs(PropertyRNA *prop,
const char *store,
const char *apply);
typedef void (*RNAPropertyUpdateFunc)(Main *, Scene *, PointerRNA *);
typedef void (*RNAPropertyUpdateFuncWithContextAndProperty)(bContext *C,
PointerRNA *ptr,
PropertyRNA *prop);
using RNAPropertyUpdateFunc = void (*)(Main *, Scene *, PointerRNA *);
using RNAPropertyUpdateFuncWithContextAndProperty = void (*)(bContext *C,
PointerRNA *ptr,
PropertyRNA *prop);
void RNA_def_property_update_runtime(PropertyRNA *prop, RNAPropertyUpdateFunc func);
void RNA_def_property_update_runtime_with_context_and_property(

View File

@ -383,7 +383,7 @@ ENUM_OPERATORS(ParameterFlag, PARM_PYFUNC_OPTIONAL)
struct CollectionPropertyIterator;
struct Link;
typedef int (*IteratorSkipFunc)(CollectionPropertyIterator *iter, void *data);
using IteratorSkipFunc = int (*)(CollectionPropertyIterator *iter, void *data);
struct ListBaseIterator {
Link *link;
@ -513,27 +513,29 @@ struct EnumPropertyItem {
#define RNA_ENUM_ITEM_SEPR_COLUMN RNA_ENUM_ITEM_HEADING("", NULL)
/* extended versions with PropertyRNA argument */
typedef bool (*BooleanPropertyGetFunc)(PointerRNA *ptr, PropertyRNA *prop);
typedef void (*BooleanPropertySetFunc)(PointerRNA *ptr, PropertyRNA *prop, bool value);
typedef void (*BooleanArrayPropertyGetFunc)(PointerRNA *ptr, PropertyRNA *prop, bool *values);
typedef void (*BooleanArrayPropertySetFunc)(PointerRNA *ptr,
PropertyRNA *prop,
const bool *values);
typedef int (*IntPropertyGetFunc)(PointerRNA *ptr, PropertyRNA *prop);
typedef void (*IntPropertySetFunc)(PointerRNA *ptr, PropertyRNA *prop, int value);
typedef void (*IntArrayPropertyGetFunc)(PointerRNA *ptr, PropertyRNA *prop, int *values);
typedef void (*IntArrayPropertySetFunc)(PointerRNA *ptr, PropertyRNA *prop, const int *values);
typedef void (*IntPropertyRangeFunc)(
PointerRNA *ptr, PropertyRNA *prop, int *min, int *max, int *softmin, int *softmax);
typedef float (*FloatPropertyGetFunc)(PointerRNA *ptr, PropertyRNA *prop);
typedef void (*FloatPropertySetFunc)(PointerRNA *ptr, PropertyRNA *prop, float value);
typedef void (*FloatArrayPropertyGetFunc)(PointerRNA *ptr, PropertyRNA *prop, float *values);
typedef void (*FloatArrayPropertySetFunc)(PointerRNA *ptr, PropertyRNA *prop, const float *values);
typedef void (*FloatPropertyRangeFunc)(
using BooleanPropertyGetFunc = bool (*)(PointerRNA *ptr, PropertyRNA *prop);
using BooleanPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, bool value);
using BooleanArrayPropertyGetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, bool *values);
using BooleanArrayPropertySetFunc = void (*)(PointerRNA *ptr,
PropertyRNA *prop,
const bool *values);
using IntPropertyGetFunc = int (*)(PointerRNA *ptr, PropertyRNA *prop);
using IntPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, int value);
using IntArrayPropertyGetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, int *values);
using IntArrayPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, const int *values);
using IntPropertyRangeFunc =
void (*)(PointerRNA *ptr, PropertyRNA *prop, int *min, int *max, int *softmin, int *softmax);
using FloatPropertyGetFunc = float (*)(PointerRNA *ptr, PropertyRNA *prop);
using FloatPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, float value);
using FloatArrayPropertyGetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, float *values);
using FloatArrayPropertySetFunc = void (*)(PointerRNA *ptr,
PropertyRNA *prop,
const float *values);
using FloatPropertyRangeFunc = void (*)(
PointerRNA *ptr, PropertyRNA *prop, float *min, float *max, float *softmin, float *softmax);
typedef void (*StringPropertyGetFunc)(PointerRNA *ptr, PropertyRNA *prop, char *value);
typedef int (*StringPropertyLengthFunc)(PointerRNA *ptr, PropertyRNA *prop);
typedef void (*StringPropertySetFunc)(PointerRNA *ptr, PropertyRNA *prop, const char *value);
using StringPropertyGetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, char *value);
using StringPropertyLengthFunc = int (*)(PointerRNA *ptr, PropertyRNA *prop);
using StringPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, const char *value);
struct StringPropertySearchVisitParams {
/** Text being searched for (never NULL). */
@ -564,8 +566,8 @@ ENUM_OPERATORS(eStringPropertySearchFlag, PROP_STRING_SEARCH_SUGGESTION)
* Visit string search candidates, `text` may be freed once this callback has finished,
* so references to it should not be held.
*/
typedef void (*StringPropertySearchVisitFunc)(void *visit_user_data,
const StringPropertySearchVisitParams *params);
using StringPropertySearchVisitFunc = void (*)(void *visit_user_data,
const StringPropertySearchVisitParams *params);
/**
* \param C: context, may be NULL (in this case all available items should be shown).
* \param ptr: RNA pointer.
@ -577,20 +579,20 @@ typedef void (*StringPropertySearchVisitFunc)(void *visit_user_data,
* responsible for storing the search results.
* \param visit_user_data: Caller defined data, passed to `visit_fn`.
*/
typedef void (*StringPropertySearchFunc)(const bContext *C,
PointerRNA *ptr,
PropertyRNA *prop,
const char *edit_text,
StringPropertySearchVisitFunc visit_fn,
void *visit_user_data);
using StringPropertySearchFunc = void (*)(const bContext *C,
PointerRNA *ptr,
PropertyRNA *prop,
const char *edit_text,
StringPropertySearchVisitFunc visit_fn,
void *visit_user_data);
typedef int (*EnumPropertyGetFunc)(PointerRNA *ptr, PropertyRNA *prop);
typedef void (*EnumPropertySetFunc)(PointerRNA *ptr, PropertyRNA *prop, int value);
using EnumPropertyGetFunc = int (*)(PointerRNA *ptr, PropertyRNA *prop);
using EnumPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, int value);
/* same as PropEnumItemFunc */
typedef const EnumPropertyItem *(*EnumPropertyItemFunc)(bContext *C,
PointerRNA *ptr,
PropertyRNA *prop,
bool *r_free);
using EnumPropertyItemFunc = const EnumPropertyItem *(*)(bContext *C,
PointerRNA *ptr,
PropertyRNA *prop,
bool *r_free);
struct PropertyRNA;
@ -690,7 +692,7 @@ enum FunctionFlag {
FUNC_FREE_POINTERS = (1 << 10),
};
typedef void (*CallFunc)(bContext *C, ReportList *reports, PointerRNA *ptr, ParameterList *parms);
using CallFunc = void (*)(bContext *C, ReportList *reports, PointerRNA *ptr, ParameterList *parms);
struct FunctionRNA;
@ -725,22 +727,22 @@ enum StructFlag {
STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID = (1 << 11),
};
typedef int (*StructValidateFunc)(PointerRNA *ptr, void *data, bool *have_function);
typedef int (*StructCallbackFunc)(bContext *C,
PointerRNA *ptr,
FunctionRNA *func,
ParameterList *list);
typedef void (*StructFreeFunc)(void *data);
typedef StructRNA *(*StructRegisterFunc)(Main *bmain,
ReportList *reports,
void *data,
const char *identifier,
StructValidateFunc validate,
StructCallbackFunc call,
StructFreeFunc free);
using StructValidateFunc = int (*)(PointerRNA *ptr, void *data, bool *have_function);
using StructCallbackFunc = int (*)(bContext *C,
PointerRNA *ptr,
FunctionRNA *func,
ParameterList *list);
using StructFreeFunc = void (*)(void *data);
using StructRegisterFunc = StructRNA *(*)(Main *bmain,
ReportList *reports,
void *data,
const char *identifier,
StructValidateFunc validate,
StructCallbackFunc call,
StructFreeFunc free);
/** Return true when `type` was successfully unregistered & freed. */
typedef bool (*StructUnregisterFunc)(Main *bmain, StructRNA *type);
typedef void **(*StructInstanceFunc)(PointerRNA *ptr);
using StructUnregisterFunc = bool (*)(Main *bmain, StructRNA *type);
using StructInstanceFunc = void **(*)(PointerRNA *ptr);
struct StructRNA;