Cleanup: Remove unnecessary keywords from C++ headers

- Remove unnecessary `struct`
- Use `using` instead of `typedef`
- Remove `void` from `(void)` as function arguments
This commit is contained in:
Hans Goudey 2024-01-04 15:07:48 -05:00
parent 15ae8c3064
commit d6cfd7d1f4
68 changed files with 892 additions and 1043 deletions

View File

@ -237,4 +237,4 @@ void openSubdiv_deleteEvaluatorCache(OpenSubdiv_EvaluatorCache *evaluator_cache)
// Return the GLSL source code from the OpenSubDiv library used for patch evaluation.
// This function is not thread-safe.
const char *openSubdiv_getGLSLPatchBasisSource(void);
const char *openSubdiv_getGLSLPatchBasisSource();

View File

@ -40,7 +40,7 @@ struct EditBone;
*
* \see #armature_bonecoll_new
*/
struct BoneCollection *ANIM_bonecoll_new(const char *name) ATTR_WARN_UNUSED_RESULT;
BoneCollection *ANIM_bonecoll_new(const char *name) ATTR_WARN_UNUSED_RESULT;
/**
* Free the bone collection.
@ -50,20 +50,20 @@ struct BoneCollection *ANIM_bonecoll_new(const char *name) ATTR_WARN_UNUSED_RESU
*
* \see ANIM_armature_bonecoll_remove
*/
void ANIM_bonecoll_free(struct BoneCollection *bcoll);
void ANIM_bonecoll_free(BoneCollection *bcoll);
/**
* Recalculate the armature & bone runtime data.
*
* TODO: move to BKE?
*/
void ANIM_armature_runtime_refresh(struct bArmature *armature);
void ANIM_armature_runtime_refresh(bArmature *armature);
/**
* Free armature & bone runtime data.
* TODO: move to BKE?
*/
void ANIM_armature_runtime_free(struct bArmature *armature);
void ANIM_armature_runtime_free(bArmature *armature);
/**
* Add a new bone collection to the given armature.
@ -99,7 +99,7 @@ void ANIM_armature_bonecoll_remove_from_index(bArmature *armature, const int ind
/**
* Remove a bone collection from the armature.
*/
void ANIM_armature_bonecoll_remove(struct bArmature *armature, struct BoneCollection *bcoll);
void ANIM_armature_bonecoll_remove(bArmature *armature, BoneCollection *bcoll);
/**
* Set the given bone collection as the active one.
@ -109,15 +109,14 @@ void ANIM_armature_bonecoll_remove(struct bArmature *armature, struct BoneCollec
* The bone collection MUST already be owned by this armature. If it is not,
* this function will simply clear the active bone collection.
*/
void ANIM_armature_bonecoll_active_set(struct bArmature *armature, struct BoneCollection *bcoll);
void ANIM_armature_bonecoll_active_set(bArmature *armature, BoneCollection *bcoll);
/**
* Set the bone collection with the given index as the active one.
*
* Pass -1 to clear the active bone collection.
*/
void ANIM_armature_bonecoll_active_index_set(struct bArmature *armature,
int bone_collection_index);
void ANIM_armature_bonecoll_active_index_set(bArmature *armature, int bone_collection_index);
/**
* Set the bone collection with the given name as the active one.
@ -125,7 +124,7 @@ void ANIM_armature_bonecoll_active_index_set(struct bArmature *armature,
* Pass an empty name to clear the active bone collection. A non-existent name will also cause the
* active bone collection to be cleared.
*/
void ANIM_armature_bonecoll_active_name_set(struct bArmature *armature, const char *name);
void ANIM_armature_bonecoll_active_name_set(bArmature *armature, const char *name);
/**
* Refresh the Armature runtime info about the active bone collection.
@ -136,7 +135,7 @@ void ANIM_armature_bonecoll_active_name_set(struct bArmature *armature, const ch
* collection. If that named collection cannot be found, the name will be
* cleared.
*/
void ANIM_armature_bonecoll_active_runtime_refresh(struct bArmature *armature);
void ANIM_armature_bonecoll_active_runtime_refresh(bArmature *armature);
/**
* Determine whether the given bone collection is editable.
@ -144,8 +143,7 @@ void ANIM_armature_bonecoll_active_runtime_refresh(struct bArmature *armature);
* Bone collections are editable when they are local, so either on a local Armature or added to a
* linked Armature via a library override in the local file.
*/
bool ANIM_armature_bonecoll_is_editable(const struct bArmature *armature,
const struct BoneCollection *bcoll);
bool ANIM_armature_bonecoll_is_editable(const bArmature *armature, const BoneCollection *bcoll);
/**
* Move the bone collection at from_index to its sibling at to_index.
@ -196,23 +194,19 @@ int ANIM_armature_bonecoll_move_before_after_index(bArmature *armature,
* \see blender::animrig::armature_bonecoll_move_to_parent() to move bone
* collections between different parents.
*/
bool ANIM_armature_bonecoll_move(struct bArmature *armature,
struct BoneCollection *bcoll,
int step);
bool ANIM_armature_bonecoll_move(bArmature *armature, BoneCollection *bcoll, int step);
struct BoneCollection *ANIM_armature_bonecoll_get_by_name(
struct bArmature *armature, const char *name) ATTR_WARN_UNUSED_RESULT;
BoneCollection *ANIM_armature_bonecoll_get_by_name(bArmature *armature,
const char *name) ATTR_WARN_UNUSED_RESULT;
/** Scan the bone collections to find the one with the given name.
*
* \return the index of the bone collection, or -1 if not found.
*/
int ANIM_armature_bonecoll_get_index_by_name(struct bArmature *armature,
int ANIM_armature_bonecoll_get_index_by_name(bArmature *armature,
const char *name) ATTR_WARN_UNUSED_RESULT;
void ANIM_armature_bonecoll_name_set(struct bArmature *armature,
struct BoneCollection *bcoll,
const char *name);
void ANIM_armature_bonecoll_name_set(bArmature *armature, BoneCollection *bcoll, const char *name);
/**
* Show this bone collection.
@ -250,26 +244,23 @@ void ANIM_armature_bonecoll_is_visible_set(bArmature *armature,
* \return true if the bone was actually assigned, false if not (f.e. when it already was assigned
* previously).
*/
bool ANIM_armature_bonecoll_assign(struct BoneCollection *bcoll, struct Bone *bone);
bool ANIM_armature_bonecoll_assign_editbone(struct BoneCollection *bcoll, struct EditBone *ebone);
bool ANIM_armature_bonecoll_assign_and_move(struct BoneCollection *bcoll, struct Bone *bone);
bool ANIM_armature_bonecoll_assign_and_move_editbone(struct BoneCollection *bcoll,
struct EditBone *ebone);
bool ANIM_armature_bonecoll_unassign(struct BoneCollection *bcoll, struct Bone *bone);
bool ANIM_armature_bonecoll_unassign_editbone(struct BoneCollection *bcoll,
struct EditBone *ebone);
void ANIM_armature_bonecoll_unassign_all(struct Bone *bone);
void ANIM_armature_bonecoll_unassign_all_editbone(struct EditBone *ebone);
bool ANIM_armature_bonecoll_assign(BoneCollection *bcoll, Bone *bone);
bool ANIM_armature_bonecoll_assign_editbone(BoneCollection *bcoll, EditBone *ebone);
bool ANIM_armature_bonecoll_assign_and_move(BoneCollection *bcoll, Bone *bone);
bool ANIM_armature_bonecoll_assign_and_move_editbone(BoneCollection *bcoll, EditBone *ebone);
bool ANIM_armature_bonecoll_unassign(BoneCollection *bcoll, Bone *bone);
bool ANIM_armature_bonecoll_unassign_editbone(BoneCollection *bcoll, EditBone *ebone);
void ANIM_armature_bonecoll_unassign_all(Bone *bone);
void ANIM_armature_bonecoll_unassign_all_editbone(EditBone *ebone);
/* Assign the edit bone to the armature's active collection. */
void ANIM_armature_bonecoll_assign_active(const struct bArmature *armature,
struct EditBone *ebone);
void ANIM_armature_bonecoll_assign_active(const bArmature *armature, EditBone *ebone);
/**
* Return whether the Armature's active bone is assigned to the given bone collection.
*/
bool ANIM_armature_bonecoll_contains_active_bone(const struct bArmature *armature,
const struct BoneCollection *bcoll);
bool ANIM_armature_bonecoll_contains_active_bone(const bArmature *armature,
const BoneCollection *bcoll);
/**
* Reconstruct the bone collection memberships, based on the bone runtime data.
@ -277,7 +268,7 @@ bool ANIM_armature_bonecoll_contains_active_bone(const struct bArmature *armatur
* This is needed to transition out of armature edit mode. That removes all bones, and
* recreates them from the edit-bones.
*/
void ANIM_armature_bonecoll_reconstruct(struct bArmature *armature);
void ANIM_armature_bonecoll_reconstruct(bArmature *armature);
/*
* Armature/Bone Layer abstractions. These functions are intended as the sole
@ -290,43 +281,38 @@ void ANIM_armature_bonecoll_reconstruct(struct bArmature *armature);
*/
/** Return true when any of the bone's collections is visible. */
bool ANIM_bone_in_visible_collection(const struct bArmature *armature, const struct Bone *bone);
bool ANIM_bone_in_visible_collection(const bArmature *armature, const Bone *bone);
inline bool ANIM_bone_is_visible(const struct bArmature *armature, const struct Bone *bone)
inline bool ANIM_bone_is_visible(const bArmature *armature, const Bone *bone)
{
const bool bone_itself_visible = (bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0;
return bone_itself_visible && ANIM_bone_in_visible_collection(armature, bone);
}
bool ANIM_bonecoll_is_visible_editbone(const struct bArmature *armature,
const struct EditBone *ebone);
bool ANIM_bonecoll_is_visible_editbone(const bArmature *armature, const EditBone *ebone);
inline bool ANIM_bone_is_visible_editbone(const struct bArmature *armature,
const struct EditBone *ebone)
inline bool ANIM_bone_is_visible_editbone(const bArmature *armature, const EditBone *ebone)
{
const bool bone_itself_visible = (ebone->flag & BONE_HIDDEN_A) == 0;
return bone_itself_visible && ANIM_bonecoll_is_visible_editbone(armature, ebone);
}
inline bool ANIM_bonecoll_is_visible_pchan(const struct bArmature *armature,
const struct bPoseChannel *pchan)
inline bool ANIM_bonecoll_is_visible_pchan(const bArmature *armature, const bPoseChannel *pchan)
{
return ANIM_bone_in_visible_collection(armature, pchan->bone);
}
inline bool ANIM_bonecoll_is_visible_actbone(const struct bArmature *armature)
inline bool ANIM_bonecoll_is_visible_actbone(const bArmature *armature)
{
return ANIM_bone_in_visible_collection(armature, armature->act_bone);
}
void ANIM_armature_bonecoll_show_all(struct bArmature *armature);
void ANIM_armature_bonecoll_hide_all(struct bArmature *armature);
void ANIM_armature_bonecoll_show_all(bArmature *armature);
void ANIM_armature_bonecoll_hide_all(bArmature *armature);
void ANIM_armature_bonecoll_show_from_bone(struct bArmature *armature, const struct Bone *bone);
void ANIM_armature_bonecoll_show_from_ebone(struct bArmature *armature,
const struct EditBone *ebone);
void ANIM_armature_bonecoll_show_from_pchan(struct bArmature *armature,
const struct bPoseChannel *pchan);
void ANIM_armature_bonecoll_show_from_bone(bArmature *armature, const Bone *bone);
void ANIM_armature_bonecoll_show_from_ebone(bArmature *armature, const EditBone *ebone);
void ANIM_armature_bonecoll_show_from_pchan(bArmature *armature, const bPoseChannel *pchan);
namespace blender::animrig {

View File

@ -42,6 +42,6 @@ class BoneColor : public ::BoneColor {
* This returns the pose bone's own color, unless it's set to "default", then it defaults to the
* armature bone color.
*/
const BoneColor &ANIM_bonecolor_posebone_get(const struct bPoseChannel *pose_bone);
const BoneColor &ANIM_bonecolor_posebone_get(const bPoseChannel *pose_bone);
}; // namespace blender::animrig

View File

@ -42,7 +42,7 @@ std::optional<blender::Vector<uint8_t>> blendthumb_create_png_data_from_thumb(
* This function extracts the thumbnail from the .blend file into thumb.
* Returns #BT_OK for success and the relevant error code otherwise.
*/
eThumbStatus blendthumb_create_thumb_from_file(struct FileReader *rawfile, Thumbnail *thumb);
eThumbStatus blendthumb_create_thumb_from_file(FileReader *rawfile, Thumbnail *thumb);
/* INTEGER CODES */
#ifdef __BIG_ENDIAN__

View File

@ -106,7 +106,7 @@ struct DerivedMesh {
* *{vert/edge/face}_r (must point to a buffer large enough)
*/
void (*copyVertArray)(DerivedMesh *dm, float (*r_positions)[3]);
void (*copyEdgeArray)(DerivedMesh *dm, struct vec2i *r_edge);
void (*copyEdgeArray)(DerivedMesh *dm, vec2i *r_edge);
void (*copyCornerVertArray)(DerivedMesh *dm, int *r_corner_verts);
void (*copyCornerEdgeArray)(DerivedMesh *dm, int *r_corner_edges);
void (*copyPolyArray)(DerivedMesh *dm, int *r_face_offsets);
@ -123,9 +123,9 @@ struct DerivedMesh {
/** Optional grid access for subsurf */
int (*getNumGrids)(DerivedMesh *dm);
int (*getGridSize)(DerivedMesh *dm);
struct CCGElem **(*getGridData)(DerivedMesh *dm);
CCGElem **(*getGridData)(DerivedMesh *dm);
int *(*getGridOffset)(DerivedMesh *dm);
void (*getGridKey)(DerivedMesh *dm, struct CCGKey *key);
void (*getGridKey)(DerivedMesh *dm, CCGKey *key);
unsigned int **(*getGridHidden)(DerivedMesh *dm);
/* Direct Access Operations

View File

@ -34,16 +34,16 @@ struct bGPDstroke;
struct bPose;
struct bPoseChannel;
typedef struct EditBone {
struct EditBone *next, *prev;
struct EditBone {
EditBone *next, *prev;
/** User-Defined Properties on this Bone */
struct IDProperty *prop;
IDProperty *prop;
/**
* Edit-bones have a one-way link (i.e. children refer
* to parents. This is converted to a two-way link for
* normal bones when leaving edit-mode.
*/
struct EditBone *parent;
EditBone *parent;
/** (64 == MAXBONENAME) */
char name[64];
/**
@ -93,8 +93,8 @@ typedef struct EditBone {
short bbone_prev_flag;
short bbone_next_flag;
/** Next/prev bones to use as handle references when calculating bbones (optional) */
struct EditBone *bbone_prev;
struct EditBone *bbone_next;
EditBone *bbone_prev;
EditBone *bbone_next;
/* Used for display */
/** in Armature space, rest pos matrix */
@ -105,54 +105,53 @@ typedef struct EditBone {
float disp_bbone_mat[32][4][4];
/** connected child temporary during drawing */
struct EditBone *bbone_child;
EditBone *bbone_child;
BoneColor color; /* MUST be named the same as in bPoseChannel and Bone structs. */
::BoneColor color; /* MUST be named the same as in bPoseChannel and Bone structs. */
ListBase /*BoneCollectionReference*/ bone_collections;
/* Used to store temporary data */
union {
struct EditBone *ebone;
struct Bone *bone;
EditBone *ebone;
Bone *bone;
void *p;
int i;
} temp;
} EditBone;
};
typedef struct PoseTarget {
struct PoseTarget *next, *prev;
struct PoseTarget {
PoseTarget *next, *prev;
struct bConstraint *con; /* the constraint of this target */
int tip; /* index of tip pchan in PoseTree */
} PoseTarget;
bConstraint *con; /* the constraint of this target */
int tip; /* index of tip pchan in PoseTree */
};
typedef struct PoseTree {
struct PoseTree *next, *prev;
struct PoseTree {
PoseTree *next, *prev;
int type; /* type of IK that this serves (CONSTRAINT_TYPE_KINEMATIC or ..._SPLINEIK) */
int totchannel; /* number of pose channels */
struct ListBase targets; /* list of targets of the tree */
struct bPoseChannel **pchan; /* array of pose channels */
int *parent; /* and their parents */
ListBase targets; /* list of targets of the tree */
bPoseChannel **pchan; /* array of pose channels */
int *parent; /* and their parents */
float (*basis_change)[3][3]; /* basis change result from solver */
int iterations; /* iterations from the constraint */
int stretch; /* disable stretching */
} PoseTree;
};
/* Core armature functionality. */
struct bArmature *BKE_armature_add(struct Main *bmain, const char *name);
struct bArmature *BKE_armature_from_object(struct Object *ob);
int BKE_armature_bonelist_count(const struct ListBase *lb);
void BKE_armature_bonelist_free(struct ListBase *lb, bool do_id_user);
void BKE_armature_editbonelist_free(struct ListBase *lb, bool do_id_user);
bArmature *BKE_armature_add(Main *bmain, const char *name);
bArmature *BKE_armature_from_object(Object *ob);
int BKE_armature_bonelist_count(const ListBase *lb);
void BKE_armature_bonelist_free(ListBase *lb, bool do_id_user);
void BKE_armature_editbonelist_free(ListBase *lb, bool do_id_user);
void BKE_armature_copy_bone_transforms(struct bArmature *armature_dst,
const struct bArmature *armature_src);
void BKE_armature_copy_bone_transforms(bArmature *armature_dst, const bArmature *armature_src);
void BKE_armature_transform(struct bArmature *arm, const float mat[4][4], bool do_props);
void BKE_armature_transform(bArmature *arm, const float mat[4][4], bool do_props);
std::optional<blender::Bounds<blender::float3>> BKE_armature_min_max(const bPose *pose);
@ -171,8 +170,8 @@ std::optional<blender::Bounds<blender::float3>> BKE_armature_min_max(const bPose
* \param use_empty_drawtype: When enabled, the draw type of empty custom-objects is taken into
* account when calculating the bounds.
*/
void BKE_pchan_minmax(const struct Object *ob,
const struct bPoseChannel *pchan,
void BKE_pchan_minmax(const Object *ob,
const bPoseChannel *pchan,
const bool use_empty_drawtype,
float r_min[3],
float r_max[3]);
@ -184,8 +183,7 @@ void BKE_pchan_minmax(const struct Object *ob,
*
* \note This uses #BKE_pchan_minmax, see its documentation for details on bounds calculation.
*/
bool BKE_pose_minmax(
struct Object *ob, float r_min[3], float r_max[3], bool use_hidden, bool use_select);
bool BKE_pose_minmax(Object *ob, float r_min[3], float r_max[3], bool use_hidden, bool use_select);
/**
* Finds the best possible extension to the name on a particular axis.
@ -204,12 +202,12 @@ bool bone_autoside_name(char name[64], int strip_number, short axis, float head,
* #BKE_armature_bone_hash_make first to hash the bone names and speed up
* queries.
*/
struct Bone *BKE_armature_find_bone_name(struct bArmature *arm, const char *name);
Bone *BKE_armature_find_bone_name(bArmature *arm, const char *name);
void BKE_armature_bone_hash_make(struct bArmature *arm);
void BKE_armature_bone_hash_free(struct bArmature *arm);
void BKE_armature_bone_hash_make(bArmature *arm);
void BKE_armature_bone_hash_free(bArmature *arm);
bool BKE_armature_bone_flag_test_recursive(const struct Bone *bone, int flag);
bool BKE_armature_bone_flag_test_recursive(const Bone *bone, int flag);
/**
* Using `vec` with dist to bone `b1 - b2`.
@ -221,25 +219,23 @@ float distfactor_to_bone(
* Updates vectors and matrices on rest-position level, only needed
* after editing armature itself, now only on reading file.
*/
void BKE_armature_where_is(struct bArmature *arm);
void BKE_armature_where_is(bArmature *arm);
/**
* Recursive part, calculates rest-position of entire tree of children.
* \note Used when exiting edit-mode too.
*/
void BKE_armature_where_is_bone(struct Bone *bone,
const struct Bone *bone_parent,
bool use_recursion);
void BKE_armature_where_is_bone(Bone *bone, const Bone *bone_parent, bool use_recursion);
/**
* Clear pointers of object's pose
* (needed in remap case, since we cannot always wait for a complete pose rebuild).
*/
void BKE_pose_clear_pointers(struct bPose *pose);
void BKE_pose_remap_bone_pointers(struct bArmature *armature, struct bPose *pose);
void BKE_pose_clear_pointers(bPose *pose);
void BKE_pose_remap_bone_pointers(bArmature *armature, bPose *pose);
/**
* Update the links for the B-Bone handles from Bone data.
*/
void BKE_pchan_rebuild_bbone_handles(struct bPose *pose, struct bPoseChannel *pchan);
void BKE_pose_channels_clear_with_null_bone(struct bPose *pose, bool do_id_user);
void BKE_pchan_rebuild_bbone_handles(bPose *pose, bPoseChannel *pchan);
void BKE_pose_channels_clear_with_null_bone(bPose *pose, bool do_id_user);
/**
* Only after leave edit-mode, duplicating, validating older files, library syncing.
*
@ -247,58 +243,52 @@ void BKE_pose_channels_clear_with_null_bone(struct bPose *pose, bool do_id_user)
*
* \param bmain: May be NULL, only used to tag depsgraph as being dirty.
*/
void BKE_pose_rebuild(struct Main *bmain,
struct Object *ob,
struct bArmature *arm,
bool do_id_user);
void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm, bool do_id_user);
/**
* Ensures object's pose is rebuilt if needed.
*
* \param bmain: May be NULL, only used to tag depsgraph as being dirty.
*/
void BKE_pose_ensure(struct Main *bmain,
struct Object *ob,
struct bArmature *arm,
bool do_id_user);
void BKE_pose_ensure(Main *bmain, Object *ob, bArmature *arm, bool do_id_user);
/**
* \note This is the only function adding poses.
* \note This only reads anim data from channels, and writes to channels.
*/
void BKE_pose_where_is(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob);
void BKE_pose_where_is(Depsgraph *depsgraph, Scene *scene, Object *ob);
/**
* The main armature solver, does all constraints excluding IK.
*
* \param pchan: pose-channel - validated, as having bone and parent pointer.
* \param do_extra: when zero skips loc/size/rot, constraints and strip modifiers.
*/
void BKE_pose_where_is_bone(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
struct bPoseChannel *pchan,
void BKE_pose_where_is_bone(Depsgraph *depsgraph,
Scene *scene,
Object *ob,
bPoseChannel *pchan,
float ctime,
bool do_extra);
/**
* Calculate tail of pose-channel.
*/
void BKE_pose_where_is_bone_tail(struct bPoseChannel *pchan);
void BKE_pose_where_is_bone_tail(bPoseChannel *pchan);
/**
* Evaluate the action and apply it to the pose. If any pose bones are selected, only FCurves that
* relate to those bones are evaluated.
*/
void BKE_pose_apply_action_selected_bones(struct Object *ob,
struct bAction *action,
struct AnimationEvalContext *anim_eval_context);
void BKE_pose_apply_action_selected_bones(Object *ob,
bAction *action,
AnimationEvalContext *anim_eval_context);
/**
* Evaluate the action and apply it to the pose. Ignore selection state of the bones.
*/
void BKE_pose_apply_action_all_bones(struct Object *ob,
struct bAction *action,
struct AnimationEvalContext *anim_eval_context);
void BKE_pose_apply_action_all_bones(Object *ob,
bAction *action,
AnimationEvalContext *anim_eval_context);
void BKE_pose_apply_action_blend(struct Object *ob,
struct bAction *action,
struct AnimationEvalContext *anim_eval_context,
void BKE_pose_apply_action_blend(Object *ob,
bAction *action,
AnimationEvalContext *anim_eval_context,
float blend_factor);
void vec_roll_to_mat3(const float vec[3], float roll, float r_mat[3][3]);
@ -323,21 +313,19 @@ void mat3_vec_to_roll(const float mat[3][3], const float vec[3], float *r_roll);
/**
* Convert World-Space Matrix to Pose-Space Matrix.
*/
void BKE_armature_mat_world_to_pose(struct Object *ob,
const float inmat[4][4],
float outmat[4][4]);
void BKE_armature_mat_world_to_pose(Object *ob, const float inmat[4][4], float outmat[4][4]);
/**
* Convert World-Space Location to Pose-Space Location
* \note this cannot be used to convert to pose-space location of the supplied
* pose-channel into its local space (i.e. 'visual'-keyframing).
*/
void BKE_armature_loc_world_to_pose(struct Object *ob, const float inloc[3], float outloc[3]);
void BKE_armature_loc_world_to_pose(Object *ob, const float inloc[3], float outloc[3]);
/**
* Convert Pose-Space Matrix to Bone-Space Matrix.
* \note this cannot be used to convert to pose-space transforms of the supplied
* pose-channel into its local space (i.e. 'visual'-keyframing).
*/
void BKE_armature_mat_pose_to_bone(struct bPoseChannel *pchan,
void BKE_armature_mat_pose_to_bone(bPoseChannel *pchan,
const float inmat[4][4],
float outmat[4][4]);
/**
@ -345,13 +333,11 @@ void BKE_armature_mat_pose_to_bone(struct bPoseChannel *pchan,
* \note this cannot be used to convert to pose-space location of the supplied
* pose-channel into its local space (i.e. 'visual'-keyframing).
*/
void BKE_armature_loc_pose_to_bone(struct bPoseChannel *pchan,
const float inloc[3],
float outloc[3]);
void BKE_armature_loc_pose_to_bone(bPoseChannel *pchan, const float inloc[3], float outloc[3]);
/**
* Convert Bone-Space Matrix to Pose-Space Matrix.
*/
void BKE_armature_mat_bone_to_pose(struct bPoseChannel *pchan,
void BKE_armature_mat_bone_to_pose(bPoseChannel *pchan,
const float inmat[4][4],
float outmat[4][4]);
/**
@ -363,58 +349,58 @@ void BKE_armature_mat_pose_to_delta(float delta_mat[4][4],
float pose_mat[4][4],
float arm_mat[4][4]);
void BKE_armature_mat_pose_to_bone_ex(struct Depsgraph *depsgraph,
struct Object *ob,
struct bPoseChannel *pchan,
void BKE_armature_mat_pose_to_bone_ex(Depsgraph *depsgraph,
Object *ob,
bPoseChannel *pchan,
const float inmat[4][4],
float outmat[4][4]);
/**
* Same as #BKE_object_mat3_to_rot().
*/
void BKE_pchan_mat3_to_rot(struct bPoseChannel *pchan, const float mat[3][3], bool use_compat);
void BKE_pchan_mat3_to_rot(bPoseChannel *pchan, const float mat[3][3], bool use_compat);
/**
* Same as #BKE_object_rot_to_mat3().
*/
void BKE_pchan_rot_to_mat3(const struct bPoseChannel *pchan, float r_mat[3][3]);
void BKE_pchan_rot_to_mat3(const bPoseChannel *pchan, float r_mat[3][3]);
/**
* Apply a 4x4 matrix to the pose bone,
* similar to #BKE_object_apply_mat4().
*/
void BKE_pchan_apply_mat4(struct bPoseChannel *pchan, const float mat[4][4], bool use_compat);
void BKE_pchan_apply_mat4(bPoseChannel *pchan, const float mat[4][4], bool use_compat);
/**
* Convert the loc/rot/size to \a r_chanmat (typically #bPoseChannel.chan_mat).
*/
void BKE_pchan_to_mat4(const struct bPoseChannel *pchan, float r_chanmat[4][4]);
void BKE_pchan_to_mat4(const bPoseChannel *pchan, float r_chanmat[4][4]);
/**
* Convert the loc/rot/size to mat4 (`pchan.chan_mat`),
* used in `constraint.cc` too.
*/
void BKE_pchan_calc_mat(struct bPoseChannel *pchan);
void BKE_pchan_calc_mat(bPoseChannel *pchan);
/**
* Simple helper, computes the offset bone matrix:
* `offs_bone = yoffs(b-1) + root(b) + bonemat(b)`.
*/
void BKE_bone_offset_matrix_get(const struct Bone *bone, float offs_bone[4][4]);
void BKE_bone_offset_matrix_get(const Bone *bone, float offs_bone[4][4]);
/* Transformation inherited from the parent bone. These matrices apply the effects of
* HINGE/NO_SCALE/NO_LOCAL_LOCATION options over the pchan loc/rot/scale transformations. */
typedef struct BoneParentTransform {
struct BoneParentTransform {
float rotscale_mat[4][4]; /* parent effect on rotation & scale pose channels */
float loc_mat[4][4]; /* parent effect on location pose channel */
float post_scale[3]; /* additional scale to apply with post-multiply */
} BoneParentTransform;
};
/* Matrix-like algebra operations on the transform */
void BKE_bone_parent_transform_clear(struct BoneParentTransform *bpt);
void BKE_bone_parent_transform_invert(struct BoneParentTransform *bpt);
void BKE_bone_parent_transform_combine(const struct BoneParentTransform *in1,
const struct BoneParentTransform *in2,
struct BoneParentTransform *result);
void BKE_bone_parent_transform_clear(BoneParentTransform *bpt);
void BKE_bone_parent_transform_invert(BoneParentTransform *bpt);
void BKE_bone_parent_transform_combine(const BoneParentTransform *in1,
const BoneParentTransform *in2,
BoneParentTransform *result);
void BKE_bone_parent_transform_apply(const struct BoneParentTransform *bpt,
void BKE_bone_parent_transform_apply(const BoneParentTransform *bpt,
const float inmat[4][4],
float outmat[4][4]);
@ -439,8 +425,8 @@ void BKE_bone_parent_transform_apply(const struct BoneParentTransform *bpt,
* pose-channel into its local space (i.e. 'visual'-keyframing).
* (NOTE(@mont29): I don't understand that, so I keep it :p).
*/
void BKE_bone_parent_transform_calc_from_pchan(const struct bPoseChannel *pchan,
struct BoneParentTransform *r_bpt);
void BKE_bone_parent_transform_calc_from_pchan(const bPoseChannel *pchan,
BoneParentTransform *r_bpt);
/**
* Compute the parent transform using data decoupled from specific data structures.
*
@ -455,7 +441,7 @@ void BKE_bone_parent_transform_calc_from_matrices(int bone_flag,
const float offs_bone[4][4],
const float parent_arm_mat[4][4],
const float parent_pose_mat[4][4],
struct BoneParentTransform *r_bpt);
BoneParentTransform *r_bpt);
/**
* Rotation Mode Conversions - Used for Pose-Channels + Objects.
@ -470,11 +456,11 @@ void BKE_rotMode_change_values(
/* B-Bone support */
#define MAX_BBONE_SUBDIV 32
typedef struct Mat4 {
struct Mat4 {
float mat[4][4];
} Mat4;
};
typedef struct BBoneSplineParameters {
struct BBoneSplineParameters {
int segments;
float length;
@ -494,26 +480,26 @@ typedef struct BBoneSplineParameters {
float roll1, roll2;
float scale_in[3], scale_out[3];
float curve_in_x, curve_in_z, curve_out_x, curve_out_z;
} BBoneSplineParameters;
};
/**
* Get "next" and "prev" bones - these are used for handle calculations.
*/
void BKE_pchan_bbone_handles_get(struct bPoseChannel *pchan,
struct bPoseChannel **r_prev,
struct bPoseChannel **r_next);
void BKE_pchan_bbone_handles_get(bPoseChannel *pchan,
bPoseChannel **r_prev,
bPoseChannel **r_next);
/**
* Compute B-Bone spline parameters for the given channel.
*/
void BKE_pchan_bbone_spline_params_get(struct bPoseChannel *pchan,
void BKE_pchan_bbone_spline_params_get(bPoseChannel *pchan,
bool rest,
struct BBoneSplineParameters *r_param);
BBoneSplineParameters *r_param);
/**
* Fills the array with the desired amount of bone->segments elements.
* This calculation is done within unit bone space.
*/
void BKE_pchan_bbone_spline_setup(struct bPoseChannel *pchan,
void BKE_pchan_bbone_spline_setup(bPoseChannel *pchan,
bool rest,
bool for_deform,
Mat4 *result_array);
@ -532,19 +518,18 @@ void BKE_pchan_bbone_handles_compute(const BBoneSplineParameters *param,
* Fills the array with the desired amount of `bone->segments` elements.
* This calculation is done within unit bone space.
*/
int BKE_pchan_bbone_spline_compute(struct BBoneSplineParameters *param,
int BKE_pchan_bbone_spline_compute(BBoneSplineParameters *param,
bool for_deform,
Mat4 *result_array);
/**
* Compute and cache the B-Bone shape in the channel runtime struct.
*/
void BKE_pchan_bbone_segments_cache_compute(struct bPoseChannel *pchan);
void BKE_pchan_bbone_segments_cache_compute(bPoseChannel *pchan);
/**
* Copy cached B-Bone segments from one channel to another.
*/
void BKE_pchan_bbone_segments_cache_copy(struct bPoseChannel *pchan,
struct bPoseChannel *pchan_from);
void BKE_pchan_bbone_segments_cache_copy(bPoseChannel *pchan, bPoseChannel *pchan_from);
/**
* Calculate index and blend factor for the two B-Bone segment nodes
@ -555,7 +540,7 @@ void BKE_pchan_bbone_segments_cache_copy(struct bPoseChannel *pchan,
* \param r_index: OUTPUT index of the first segment joint affecting the point.
* \param r_blend_next: OUTPUT blend factor between the first and the second segment in [0..1]
*/
void BKE_pchan_bbone_deform_clamp_segment_index(const struct bPoseChannel *pchan,
void BKE_pchan_bbone_deform_clamp_segment_index(const bPoseChannel *pchan,
float head_tail,
int *r_index,
float *r_blend_next);
@ -569,7 +554,7 @@ void BKE_pchan_bbone_deform_clamp_segment_index(const struct bPoseChannel *pchan
* \param r_index: OUTPUT index of the first segment joint affecting the point.
* \param r_blend_next: OUTPUT blend factor between the first and the second segment in [0..1]
*/
void BKE_pchan_bbone_deform_segment_index(const struct bPoseChannel *pchan,
void BKE_pchan_bbone_deform_segment_index(const bPoseChannel *pchan,
const float *co,
int *r_index,
float *r_blend_next);
@ -610,57 +595,44 @@ struct bKinematicConstraint;
struct bPose;
struct bSplineIKConstraint;
struct bPoseChannel *BKE_armature_ik_solver_find_root(struct bPoseChannel *pchan,
struct bKinematicConstraint *data);
struct bPoseChannel *BKE_armature_splineik_solver_find_root(struct bPoseChannel *pchan,
struct bSplineIKConstraint *data);
bPoseChannel *BKE_armature_ik_solver_find_root(bPoseChannel *pchan, bKinematicConstraint *data);
bPoseChannel *BKE_armature_splineik_solver_find_root(bPoseChannel *pchan,
bSplineIKConstraint *data);
void BKE_pose_splineik_init_tree(struct Scene *scene, struct Object *ob, float ctime);
void BKE_splineik_execute_tree(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
struct bPoseChannel *pchan_root,
float ctime);
void BKE_pose_splineik_init_tree(Scene *scene, Object *ob, float ctime);
void BKE_splineik_execute_tree(
Depsgraph *depsgraph, Scene *scene, Object *ob, bPoseChannel *pchan_root, float ctime);
void BKE_pose_pchan_index_rebuild(struct bPose *pose);
void BKE_pose_pchan_index_rebuild(bPose *pose);
void BKE_pose_eval_init(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *object);
void BKE_pose_eval_init(Depsgraph *depsgraph, Scene *scene, Object *object);
void BKE_pose_eval_init_ik(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *object);
void BKE_pose_eval_init_ik(Depsgraph *depsgraph, Scene *scene, Object *object);
void BKE_pose_eval_bone(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *object,
int pchan_index);
void BKE_pose_eval_bone(Depsgraph *depsgraph, Scene *scene, Object *object, int pchan_index);
void BKE_pose_constraints_evaluate(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *object,
void BKE_pose_constraints_evaluate(Depsgraph *depsgraph,
Scene *scene,
Object *object,
int pchan_index);
void BKE_pose_bone_done(struct Depsgraph *depsgraph, struct Object *object, int pchan_index);
void BKE_pose_bone_done(Depsgraph *depsgraph, Object *object, int pchan_index);
void BKE_pose_eval_bbone_segments(struct Depsgraph *depsgraph,
struct Object *object,
int pchan_index);
void BKE_pose_eval_bbone_segments(Depsgraph *depsgraph, Object *object, int pchan_index);
void BKE_pose_iktree_evaluate(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *object,
void BKE_pose_iktree_evaluate(Depsgraph *depsgraph,
Scene *scene,
Object *object,
int rootchan_index);
void BKE_pose_splineik_evaluate(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *object,
void BKE_pose_splineik_evaluate(Depsgraph *depsgraph,
Scene *scene,
Object *object,
int rootchan_index);
void BKE_pose_eval_done(struct Depsgraph *depsgraph, struct Object *object);
void BKE_pose_eval_done(Depsgraph *depsgraph, Object *object);
void BKE_pose_eval_cleanup(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *object);
void BKE_pose_eval_cleanup(Depsgraph *depsgraph, Scene *scene, Object *object);
/* -------------------------------------------------------------------- */
/** \name Deform 3D Coordinates by Armature (`armature_deform.cc`)
@ -669,35 +641,35 @@ void BKE_pose_eval_cleanup(struct Depsgraph *depsgraph,
/* Note that we could have a 'BKE_armature_deform_coords' that doesn't take object data
* currently there are no callers for this though. */
void BKE_armature_deform_coords_with_gpencil_stroke(const struct Object *ob_arm,
const struct Object *ob_target,
void BKE_armature_deform_coords_with_gpencil_stroke(const Object *ob_arm,
const Object *ob_target,
float (*vert_coords)[3],
float (*vert_deform_mats)[3][3],
int vert_coords_len,
int deformflag,
float (*vert_coords_prev)[3],
const char *defgrp_name,
struct bGPDstroke *gps_target);
bGPDstroke *gps_target);
void BKE_armature_deform_coords_with_mesh(const struct Object *ob_arm,
const struct Object *ob_target,
void BKE_armature_deform_coords_with_mesh(const Object *ob_arm,
const Object *ob_target,
float (*vert_coords)[3],
float (*vert_deform_mats)[3][3],
int vert_coords_len,
int deformflag,
float (*vert_coords_prev)[3],
const char *defgrp_name,
const struct Mesh *me_target);
const Mesh *me_target);
void BKE_armature_deform_coords_with_editmesh(const struct Object *ob_arm,
const struct Object *ob_target,
void BKE_armature_deform_coords_with_editmesh(const Object *ob_arm,
const Object *ob_target,
float (*vert_coords)[3],
float (*vert_deform_mats)[3][3],
int vert_coords_len,
int deformflag,
float (*vert_coords_prev)[3],
const char *defgrp_name,
struct BMEditMesh *em_target);
BMEditMesh *em_target);
/** \} */

View File

@ -34,7 +34,7 @@ struct AssetTypeInfo {
OnMarkAssetFn on_mark_asset_fn;
};
AssetMetaData *BKE_asset_metadata_create(void);
AssetMetaData *BKE_asset_metadata_create();
void BKE_asset_metadata_free(AssetMetaData **asset_data);
/**

View File

@ -50,7 +50,7 @@ bool BKE_blendfile_library_path_explode(const char *path,
*
* \note Currently does attempt to open and read (part of) the given file.
*/
bool BKE_blendfile_is_readable(const char *path, struct ReportList *reports);
bool BKE_blendfile_is_readable(const char *path, ReportList *reports);
/**
* Shared setup function that makes the data from `bfd` into the current blend file,
@ -116,7 +116,7 @@ UserDef *BKE_blendfile_userdef_read(const char *filepath, ReportList *reports);
UserDef *BKE_blendfile_userdef_read_from_memory(const void *filebuf,
int filelength,
ReportList *reports);
UserDef *BKE_blendfile_userdef_from_defaults(void);
UserDef *BKE_blendfile_userdef_from_defaults();
/**
* Only write the #UserDef in a `.blend`.

View File

@ -13,8 +13,8 @@ struct Library;
struct LibraryLink_Params;
struct ReportList;
typedef struct BlendfileLinkAppendContext BlendfileLinkAppendContext;
typedef struct BlendfileLinkAppendContextItem BlendfileLinkAppendContextItem;
struct BlendfileLinkAppendContext;
struct BlendfileLinkAppendContextItem;
/**
* Allocate and initialize a new context to link/append data-blocks.
@ -136,10 +136,10 @@ enum eBlendfileLinkAppendForeachItemFlag {
*
* \return `true` if iteration should continue, `false` otherwise.
*/
typedef bool (*BKE_BlendfileLinkAppendContexteItemFunction)(
BlendfileLinkAppendContext *lapp_context,
BlendfileLinkAppendContextItem *item,
void *userdata);
using BKE_BlendfileLinkAppendContexteItemFunction =
bool (*)(BlendfileLinkAppendContext *lapp_context,
BlendfileLinkAppendContextItem *item,
void *userdata);
/**
* Iterate over all (or a subset) of the items listed in given #BlendfileLinkAppendContext,
* and call the `callback_function` on them.

View File

@ -7,19 +7,20 @@
* \ingroup bke
*/
struct CBData;
struct ColorBand;
/** #ColorBand.data length. */
#define MAXCOLORBAND 32
void BKE_colorband_init(struct ColorBand *coba, bool rangetype);
void BKE_colorband_init_from_table_rgba(struct ColorBand *coba,
void BKE_colorband_init(ColorBand *coba, bool rangetype);
void BKE_colorband_init_from_table_rgba(ColorBand *coba,
const float (*array)[4],
int array_len,
bool filter_sample);
struct ColorBand *BKE_colorband_add(bool rangetype);
bool BKE_colorband_evaluate(const struct ColorBand *coba, float in, float out[4]);
void BKE_colorband_evaluate_table_rgba(const struct ColorBand *coba, float **array, int *size);
struct CBData *BKE_colorband_element_add(struct ColorBand *coba, float position);
bool BKE_colorband_element_remove(struct ColorBand *coba, int index);
void BKE_colorband_update_sort(struct ColorBand *coba);
ColorBand *BKE_colorband_add(bool rangetype);
bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4]);
void BKE_colorband_evaluate_table_rgba(const ColorBand *coba, float **array, int *size);
CBData *BKE_colorband_element_add(ColorBand *coba, float position);
bool BKE_colorband_element_remove(ColorBand *coba, int index);
void BKE_colorband_update_sort(ColorBand *coba);

View File

@ -20,22 +20,22 @@ struct ImBuf;
struct Scopes;
struct rctf;
void BKE_curvemapping_set_defaults(struct CurveMapping *cumap,
void BKE_curvemapping_set_defaults(CurveMapping *cumap,
int tot,
float minx,
float miny,
float maxx,
float maxy,
short default_handle_type);
struct CurveMapping *BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
void BKE_curvemapping_free_data(struct CurveMapping *cumap);
void BKE_curvemapping_free(struct CurveMapping *cumap);
void BKE_curvemapping_copy_data(struct CurveMapping *target, const struct CurveMapping *cumap);
struct CurveMapping *BKE_curvemapping_copy(const struct CurveMapping *cumap);
CurveMapping *BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
void BKE_curvemapping_free_data(CurveMapping *cumap);
void BKE_curvemapping_free(CurveMapping *cumap);
void BKE_curvemapping_copy_data(CurveMapping *target, const CurveMapping *cumap);
CurveMapping *BKE_curvemapping_copy(const CurveMapping *cumap);
void BKE_curvemapping_set_black_white_ex(const float black[3],
const float white[3],
float r_bwmul[3]);
void BKE_curvemapping_set_black_white(struct CurveMapping *cumap,
void BKE_curvemapping_set_black_white(CurveMapping *cumap,
const float black[3],
const float white[3]);
@ -48,62 +48,58 @@ enum {
/**
* Reset the view for current curve.
*/
void BKE_curvemapping_reset_view(struct CurveMapping *cumap);
void BKE_curvemap_reset(struct CurveMap *cuma, const struct rctf *clipr, int preset, int slope);
void BKE_curvemapping_reset_view(CurveMapping *cumap);
void BKE_curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope);
/**
* Removes with flag set.
*/
void BKE_curvemap_remove(struct CurveMap *cuma, short flag);
void BKE_curvemap_remove(CurveMap *cuma, short flag);
/**
* Remove specified point.
*/
bool BKE_curvemap_remove_point(struct CurveMap *cuma, struct CurveMapPoint *cmp);
struct CurveMapPoint *BKE_curvemap_insert(struct CurveMap *cuma, float x, float y);
bool BKE_curvemap_remove_point(CurveMap *cuma, CurveMapPoint *cmp);
CurveMapPoint *BKE_curvemap_insert(CurveMap *cuma, float x, float y);
/**
* \param type: #eBezTriple_Handle
*/
void BKE_curvemap_handle_set(struct CurveMap *cuma, int type);
void BKE_curvemap_handle_set(CurveMap *cuma, int type);
/**
* \note only does current curvemap!.
*/
void BKE_curvemapping_changed(struct CurveMapping *cumap, bool rem_doubles);
void BKE_curvemapping_changed_all(struct CurveMapping *cumap);
void BKE_curvemapping_changed(CurveMapping *cumap, bool rem_doubles);
void BKE_curvemapping_changed_all(CurveMapping *cumap);
/**
* Call before _all_ evaluation functions.
*/
void BKE_curvemapping_init(struct CurveMapping *cumap);
void BKE_curvemapping_init(CurveMapping *cumap);
/**
* Keep these `const CurveMap` - to help with thread safety.
* \note Single curve, no table check.
* \note Table should be verified.
*/
float BKE_curvemap_evaluateF(const struct CurveMapping *cumap,
const struct CurveMap *cuma,
float value);
float BKE_curvemap_evaluateF(const CurveMapping *cumap, const CurveMap *cuma, float value);
/**
* Single curve, with table check.
* Works with curve 'cur'.
*/
float BKE_curvemapping_evaluateF(const struct CurveMapping *cumap, int cur, float value);
float BKE_curvemapping_evaluateF(const CurveMapping *cumap, int cur, float value);
/**
* Vector case.
*/
void BKE_curvemapping_evaluate3F(const struct CurveMapping *cumap,
float vecout[3],
const float vecin[3]);
void BKE_curvemapping_evaluate3F(const CurveMapping *cumap, float vecout[3], const float vecin[3]);
/**
* RGB case, no black/white points, no pre-multiply.
*/
void BKE_curvemapping_evaluateRGBF(const struct CurveMapping *cumap,
void BKE_curvemapping_evaluateRGBF(const CurveMapping *cumap,
float vecout[3],
const float vecin[3]);
/**
* Byte version of #BKE_curvemapping_evaluateRGBF.
*/
void BKE_curvemapping_evaluate_premulRGB(const struct CurveMapping *cumap,
void BKE_curvemapping_evaluate_premulRGB(const CurveMapping *cumap,
unsigned char vecout_byte[3],
const unsigned char vecin_byte[3]);
/**
@ -116,7 +112,7 @@ void BKE_curvemapping_evaluate_premulRGB(const struct CurveMapping *cumap,
* \param black: Use instead of cumap->black
* \param bwmul: Use instead of cumap->bwmul
*/
void BKE_curvemapping_evaluate_premulRGBF_ex(const struct CurveMapping *cumap,
void BKE_curvemapping_evaluate_premulRGBF_ex(const CurveMapping *cumap,
float vecout[3],
const float vecin[3],
const float black[3],
@ -124,31 +120,29 @@ void BKE_curvemapping_evaluate_premulRGBF_ex(const struct CurveMapping *cumap,
/**
* RGB with black/white points and pre-multiply. tables are checked.
*/
void BKE_curvemapping_evaluate_premulRGBF(const struct CurveMapping *cumap,
void BKE_curvemapping_evaluate_premulRGBF(const CurveMapping *cumap,
float vecout[3],
const float vecin[3]);
bool BKE_curvemapping_RGBA_does_something(const struct CurveMapping *cumap);
void BKE_curvemapping_table_F(const struct CurveMapping *cumap, float **array, int *size);
void BKE_curvemapping_table_RGBA(const struct CurveMapping *cumap, float **array, int *size);
bool BKE_curvemapping_RGBA_does_something(const CurveMapping *cumap);
void BKE_curvemapping_table_F(const CurveMapping *cumap, float **array, int *size);
void BKE_curvemapping_table_RGBA(const CurveMapping *cumap, float **array, int *size);
/** Get the minimum x value of each curve map table. */
void BKE_curvemapping_get_range_minimums(const struct CurveMapping *curve_mapping,
float minimums[4]);
void BKE_curvemapping_get_range_minimums(const CurveMapping *curve_mapping, float minimums[4]);
/**
* Get the reciprocal of the difference between the maximum and the minimum x value of each curve
* map table. Evaluation parameters can be multiplied by this value to be normalized. If the
* difference is zero, 1^8 is returned.
*/
void BKE_curvemapping_compute_range_dividers(const struct CurveMapping *curve_mapping,
float dividers[4]);
void BKE_curvemapping_compute_range_dividers(const CurveMapping *curve_mapping, float dividers[4]);
/**
* Compute the slopes at the start and end points of each curve map. The slopes are multiplied by
* the range of the curve map to compensate for parameter normalization. If the slope is vertical,
* 1^8 is returned.
*/
void BKE_curvemapping_compute_slopes(const struct CurveMapping *curve_mapping,
void BKE_curvemapping_compute_slopes(const CurveMapping *curve_mapping,
float start_slopes[4],
float end_slopes[4]);
@ -164,36 +158,35 @@ void BKE_curvemapping_compute_slopes(const struct CurveMapping *curve_mapping,
* - The end point is at (1, 1).
* Note that this could return false even if the curve map is identity, this happens in the case
* when more than 2 points exist in the curve map but all points are collinear. */
bool BKE_curvemapping_is_map_identity(const struct CurveMapping *curve_mapping, int index);
bool BKE_curvemapping_is_map_identity(const CurveMapping *curve_mapping, int index);
/**
* Call when you do images etc, needs restore too. also verifies tables.
* non-const (these modify the curve).
*/
void BKE_curvemapping_premultiply(struct CurveMapping *cumap, bool restore);
void BKE_curvemapping_premultiply(CurveMapping *cumap, bool restore);
void BKE_curvemapping_blend_write(struct BlendWriter *writer, const struct CurveMapping *cumap);
void BKE_curvemapping_curves_blend_write(struct BlendWriter *writer,
const struct CurveMapping *cumap);
void BKE_curvemapping_blend_write(BlendWriter *writer, const CurveMapping *cumap);
void BKE_curvemapping_curves_blend_write(BlendWriter *writer, const CurveMapping *cumap);
/**
* \note `cumap` itself has been read already.
*/
void BKE_curvemapping_blend_read(struct BlendDataReader *reader, struct CurveMapping *cumap);
void BKE_curvemapping_blend_read(BlendDataReader *reader, CurveMapping *cumap);
void BKE_histogram_update_sample_line(struct Histogram *hist,
struct ImBuf *ibuf,
const struct ColorManagedViewSettings *view_settings,
const struct ColorManagedDisplaySettings *display_settings);
void BKE_scopes_update(struct Scopes *scopes,
struct ImBuf *ibuf,
const struct ColorManagedViewSettings *view_settings,
const struct ColorManagedDisplaySettings *display_settings);
void BKE_scopes_free(struct Scopes *scopes);
void BKE_scopes_new(struct Scopes *scopes);
void BKE_histogram_update_sample_line(Histogram *hist,
ImBuf *ibuf,
const ColorManagedViewSettings *view_settings,
const ColorManagedDisplaySettings *display_settings);
void BKE_scopes_update(Scopes *scopes,
ImBuf *ibuf,
const ColorManagedViewSettings *view_settings,
const ColorManagedDisplaySettings *display_settings);
void BKE_scopes_free(Scopes *scopes);
void BKE_scopes_new(Scopes *scopes);
void BKE_color_managed_display_settings_init(struct ColorManagedDisplaySettings *settings);
void BKE_color_managed_display_settings_copy(struct ColorManagedDisplaySettings *new_settings,
const struct ColorManagedDisplaySettings *settings);
void BKE_color_managed_display_settings_init(ColorManagedDisplaySettings *settings);
void BKE_color_managed_display_settings_copy(ColorManagedDisplaySettings *new_settings,
const ColorManagedDisplaySettings *settings);
/**
* Initialize view settings to be best suitable for render type of viewing.
@ -201,8 +194,8 @@ void BKE_color_managed_display_settings_copy(struct ColorManagedDisplaySettings
* is specified.
*/
void BKE_color_managed_view_settings_init_render(
struct ColorManagedViewSettings *settings,
const struct ColorManagedDisplaySettings *display_settings,
ColorManagedViewSettings *settings,
const ColorManagedDisplaySettings *display_settings,
const char *view_transform);
/**
@ -210,23 +203,21 @@ void BKE_color_managed_view_settings_init_render(
* For example,s movie clips while tracking.
*/
void BKE_color_managed_view_settings_init_default(
struct ColorManagedViewSettings *settings,
const struct ColorManagedDisplaySettings *display_settings);
ColorManagedViewSettings *settings, const ColorManagedDisplaySettings *display_settings);
void BKE_color_managed_view_settings_copy(struct ColorManagedViewSettings *new_settings,
const struct ColorManagedViewSettings *settings);
void BKE_color_managed_view_settings_free(struct ColorManagedViewSettings *settings);
void BKE_color_managed_view_settings_copy(ColorManagedViewSettings *new_settings,
const ColorManagedViewSettings *settings);
void BKE_color_managed_view_settings_free(ColorManagedViewSettings *settings);
void BKE_color_managed_view_settings_blend_write(struct BlendWriter *writer,
struct ColorManagedViewSettings *settings);
void BKE_color_managed_view_settings_blend_read_data(struct BlendDataReader *reader,
struct ColorManagedViewSettings *settings);
void BKE_color_managed_view_settings_blend_write(BlendWriter *writer,
ColorManagedViewSettings *settings);
void BKE_color_managed_view_settings_blend_read_data(BlendDataReader *reader,
ColorManagedViewSettings *settings);
void BKE_color_managed_colorspace_settings_init(
struct ColorManagedColorspaceSettings *colorspace_settings);
ColorManagedColorspaceSettings *colorspace_settings);
void BKE_color_managed_colorspace_settings_copy(
struct ColorManagedColorspaceSettings *colorspace_settings,
const struct ColorManagedColorspaceSettings *settings);
bool BKE_color_managed_colorspace_settings_equals(
const struct ColorManagedColorspaceSettings *settings1,
const struct ColorManagedColorspaceSettings *settings2);
ColorManagedColorspaceSettings *colorspace_settings,
const ColorManagedColorspaceSettings *settings);
bool BKE_color_managed_colorspace_settings_equals(const ColorManagedColorspaceSettings *settings1,
const ColorManagedColorspaceSettings *settings2);

View File

@ -8,6 +8,8 @@
#include "RNA_types.hh"
struct bContext;
#define FH_MAX_FILE_EXTENSIONS_STR 512
struct FileHandlerType {
@ -22,7 +24,7 @@ struct FileHandlerType {
char file_extensions_str[FH_MAX_FILE_EXTENSIONS_STR];
/** Check if file handler can be used on file drop. */
bool (*poll_drop)(const struct bContext *C, FileHandlerType *file_handle_type);
bool (*poll_drop)(const bContext *C, FileHandlerType *file_handle_type);
/** List of file extensions supported by the file handler. */
blender::Vector<std::string> file_extensions;

View File

@ -111,13 +111,13 @@ enum {
ID_REMAP_NO_ORIG_POINTERS_ACCESS = 1 << 20,
};
typedef enum eIDRemapType {
enum eIDRemapType {
/** Remap an ID reference to a new reference. The new reference can also be null. */
ID_REMAP_TYPE_REMAP = 0,
/** Cleanup all IDs used by a specific one. */
ID_REMAP_TYPE_CLEANUP = 1,
} eIDRemapType;
};
/**
* Replace all references in given Main using the given \a mappings
@ -192,15 +192,15 @@ void BKE_libblock_relink_multiple(Main *bmain,
*/
void BKE_libblock_relink_to_newid(Main *bmain, ID *id, int remap_flag) ATTR_NONNULL();
typedef void (*BKE_library_free_notifier_reference_cb)(const void *);
typedef void (*BKE_library_remap_editor_id_reference_cb)(const IDRemapper *mappings);
using BKE_library_free_notifier_reference_cb = void (*)(const void *);
using BKE_library_remap_editor_id_reference_cb = void (*)(const IDRemapper *mappings);
void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func);
void BKE_library_callback_remap_editor_id_reference_set(
BKE_library_remap_editor_id_reference_cb func);
/* IDRemapper */
typedef enum IDRemapperApplyResult {
enum IDRemapperApplyResult {
/** No remapping rules available for the source. */
ID_REMAP_RESULT_SOURCE_UNAVAILABLE,
/** Source isn't mappable (e.g. NULL). */
@ -209,9 +209,9 @@ typedef enum IDRemapperApplyResult {
ID_REMAP_RESULT_SOURCE_REMAPPED,
/** Source has been set to NULL. */
ID_REMAP_RESULT_SOURCE_UNASSIGNED,
} IDRemapperApplyResult;
};
typedef enum IDRemapperApplyOptions {
enum IDRemapperApplyOptions {
/**
* Update the user count of the old and new ID data-block.
*
@ -240,17 +240,17 @@ typedef enum IDRemapperApplyOptions {
ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF = (1 << 2),
ID_REMAP_APPLY_DEFAULT = 0,
} IDRemapperApplyOptions;
};
ENUM_OPERATORS(IDRemapperApplyOptions, ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF)
typedef void (*IDRemapperIterFunction)(ID *old_id, ID *new_id, void *user_data);
using IDRemapperIterFunction = void (*)(ID *old_id, ID *new_id, void *user_data);
/**
* Create a new ID Remapper.
*
* An ID remapper stores multiple remapping rules.
*/
IDRemapper *BKE_id_remapper_create(void);
IDRemapper *BKE_id_remapper_create();
void BKE_id_remapper_clear(IDRemapper *id_remapper);
bool BKE_id_remapper_is_empty(const IDRemapper *id_remapper);

View File

@ -465,7 +465,7 @@ const char *BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL();
* \warning Usage is not recommended,
* you should always try to get a valid Main pointer from context.
*/
const char *BKE_main_blendfile_path_from_global(void);
const char *BKE_main_blendfile_path_from_global();
/**
* \return A pointer to the \a ListBase of given \a bmain for requested \a type ID type.

View File

@ -24,7 +24,7 @@ struct ID;
struct Main;
struct UniqueName_Map;
UniqueName_Map *BKE_main_namemap_create(void) ATTR_WARN_UNUSED_RESULT;
UniqueName_Map *BKE_main_namemap_create() ATTR_WARN_UNUSED_RESULT;
void BKE_main_namemap_destroy(UniqueName_Map **r_name_map) ATTR_NONNULL();
/**

View File

@ -85,7 +85,7 @@ struct PBVHFrustumPlanes {
BLI_INLINE BMesh *BKE_pbvh_get_bmesh(PBVH *pbvh)
{
return ((struct PBVHPublic *)pbvh)->bm;
return ((PBVHPublic *)pbvh)->bm;
}
Mesh *BKE_pbvh_get_mesh(PBVH *pbvh);

View File

@ -35,7 +35,7 @@ void BKE_volume_dense_float_grid_clear(DenseFloatVolumeGrid *dense_grid);
/* Wireframe */
typedef void (*BKE_volume_wireframe_cb)(
using BKE_volume_wireframe_cb = void (*)(
void *userdata, const float (*verts)[3], const int (*edges)[2], int totvert, int totedge);
void BKE_volume_grid_wireframe(const Volume *volume,

View File

@ -48,10 +48,10 @@ Mesh *volume_to_mesh(const openvdb::GridBase &grid,
* Convert an OpenVDB volume grid to corresponding mesh data: vertex positions and quad and
* triangle indices.
*/
struct OpenVDBMeshData volume_to_mesh_data(const openvdb::GridBase &grid,
const VolumeToMeshResolution &resolution,
float threshold,
float adaptivity);
OpenVDBMeshData volume_to_mesh_data(const openvdb::GridBase &grid,
const VolumeToMeshResolution &resolution,
float threshold,
float adaptivity);
/**
* Convert mesh data from the format provided by OpenVDB into Blender's #Mesh data structure.

View File

@ -18,7 +18,7 @@
struct ListBase;
typedef bool (*UniquenameCheckCallback)(void *arg, const char *name);
using UniquenameCheckCallback = bool (*)(void *arg, const char *name);
/* ------------------------------------------------------------------------- */
/** \name String Replace

View File

@ -224,7 +224,7 @@ void *BLO_read_get_new_packed_address(BlendDataReader *reader, const void *old_a
#define BLO_read_packed_address(reader, ptr_p) \
*((void **)ptr_p) = BLO_read_get_new_packed_address((reader), *(ptr_p))
typedef void (*BlendReadListFn)(BlendDataReader *reader, void *data);
using BlendReadListFn = void (*)(BlendDataReader *reader, void *data);
/**
* Updates all `->prev` and `->next` pointers of the list elements.
* Updates the `list->first` and `list->last` pointers.

View File

@ -55,14 +55,14 @@ struct MemFileUndoData {
};
/* FileReader-compatible wrapper for reading MemFiles */
typedef struct {
struct UndoReader {
FileReader reader;
MemFile *memfile;
int undo_direction;
bool memchunk_identical;
} UndoReader;
};
/* Actually only used `writefile.cc`. */

View File

@ -9,10 +9,6 @@
* \brief external `writefile.cc` function prototypes.
*/
#ifdef __cplusplus
extern "C" {
#endif
struct BlendThumbnail;
struct Main;
struct MemFile;
@ -27,7 +23,7 @@ struct ReportList;
/**
* Adjust paths when saving (kept unless #BlendFileWriteParams.use_save_as_copy is set).
*/
typedef enum eBLO_WritePathRemap {
enum eBLO_WritePathRemap {
/** No path manipulation. */
BLO_WRITE_PATH_REMAP_NONE = 0,
/** Remap existing relative paths (default). */
@ -36,7 +32,7 @@ typedef enum eBLO_WritePathRemap {
BLO_WRITE_PATH_REMAP_RELATIVE_ALL = 2,
/** Make all paths absolute. */
BLO_WRITE_PATH_REMAP_ABSOLUTE = 3,
} eBLO_WritePathRemap;
};
/** Similar to #BlendFileReadParams. */
struct BlendFileWriteParams {
@ -46,28 +42,21 @@ struct BlendFileWriteParams {
/** On write, restore paths after editing them (see #BLO_WRITE_PATH_REMAP_RELATIVE). */
uint use_save_as_copy : 1;
uint use_userdef : 1;
const struct BlendThumbnail *thumb;
const BlendThumbnail *thumb;
};
/**
* \return Success.
*/
extern bool BLO_write_file(struct Main *mainvar,
extern bool BLO_write_file(Main *mainvar,
const char *filepath,
int write_flags,
const struct BlendFileWriteParams *params,
struct ReportList *reports);
const BlendFileWriteParams *params,
ReportList *reports);
/**
* \return Success.
*/
extern bool BLO_write_file_mem(struct Main *mainvar,
struct MemFile *compare,
struct MemFile *current,
int write_flags);
extern bool BLO_write_file_mem(Main *mainvar, MemFile *compare, MemFile *current, int write_flags);
/** \} */
#ifdef __cplusplus
}
#endif

View File

@ -161,15 +161,13 @@ void BM_elem_select_copy(BMesh *bm_dst, void *ele_dst_v, const void *ele_src_v);
* as this is the mesh they have control over (active UV layer for rendering for example).
*/
void BM_mesh_copy_init_customdata_from_mesh_array(BMesh *bm_dst,
const struct Mesh *me_src_array[],
const Mesh *me_src_array[],
int me_src_array_len,
const struct BMAllocTemplate *allocsize);
const BMAllocTemplate *allocsize);
void BM_mesh_copy_init_customdata_from_mesh(BMesh *bm_dst,
const struct Mesh *me_src,
const struct BMAllocTemplate *allocsize);
void BM_mesh_copy_init_customdata(BMesh *bm_dst,
BMesh *bm_src,
const struct BMAllocTemplate *allocsize);
const Mesh *me_src,
const BMAllocTemplate *allocsize);
void BM_mesh_copy_init_customdata(BMesh *bm_dst, BMesh *bm_src, const BMAllocTemplate *allocsize);
/**
* Similar to #BM_mesh_copy_init_customdata but copies all layers ignoring
* flags like #CD_FLAG_NOCOPY.
@ -182,5 +180,5 @@ void BM_mesh_copy_init_customdata(BMesh *bm_dst,
void BM_mesh_copy_init_customdata_all_layers(BMesh *bm_dst,
BMesh *bm_src,
char htype,
const struct BMAllocTemplate *allocsize);
const BMAllocTemplate *allocsize);
BMesh *BM_mesh_copy(BMesh *bm_old);

View File

@ -17,7 +17,7 @@ struct ListBase;
* \return listbase of listbases, each linking to a vertex.
*/
int BM_mesh_edgeloops_find(BMesh *bm,
struct ListBase *r_eloops,
ListBase *r_eloops,
bool (*test_fn)(BMEdge *, void *user_data),
void *user_data);
bool BM_mesh_edgeloops_find_path(BMesh *bm,
@ -27,33 +27,31 @@ bool BM_mesh_edgeloops_find_path(BMesh *bm,
BMVert *v_src,
BMVert *v_dst);
void BM_mesh_edgeloops_free(struct ListBase *eloops);
void BM_mesh_edgeloops_calc_center(BMesh *bm, struct ListBase *eloops);
void BM_mesh_edgeloops_calc_normal(BMesh *bm, struct ListBase *eloops);
void BM_mesh_edgeloops_calc_normal_aligned(BMesh *bm,
struct ListBase *eloops,
const float no_align[3]);
void BM_mesh_edgeloops_free(ListBase *eloops);
void BM_mesh_edgeloops_calc_center(BMesh *bm, ListBase *eloops);
void BM_mesh_edgeloops_calc_normal(BMesh *bm, ListBase *eloops);
void BM_mesh_edgeloops_calc_normal_aligned(BMesh *bm, ListBase *eloops, const float no_align[3]);
void BM_mesh_edgeloops_calc_order(BMesh *bm, ListBase *eloops, bool use_normals);
/**
* Copy a single edge-loop.
* \return new edge-loops.
*/
struct BMEdgeLoopStore *BM_edgeloop_copy(struct BMEdgeLoopStore *el_store);
struct BMEdgeLoopStore *BM_edgeloop_from_verts(BMVert **v_arr, int v_arr_tot, bool is_closed);
BMEdgeLoopStore *BM_edgeloop_copy(BMEdgeLoopStore *el_store);
BMEdgeLoopStore *BM_edgeloop_from_verts(BMVert **v_arr, int v_arr_tot, bool is_closed);
void BM_edgeloop_free(struct BMEdgeLoopStore *el_store);
bool BM_edgeloop_is_closed(struct BMEdgeLoopStore *el_store);
int BM_edgeloop_length_get(struct BMEdgeLoopStore *el_store);
struct ListBase *BM_edgeloop_verts_get(struct BMEdgeLoopStore *el_store);
const float *BM_edgeloop_normal_get(struct BMEdgeLoopStore *el_store);
const float *BM_edgeloop_center_get(struct BMEdgeLoopStore *el_store);
void BM_edgeloop_free(BMEdgeLoopStore *el_store);
bool BM_edgeloop_is_closed(BMEdgeLoopStore *el_store);
int BM_edgeloop_length_get(BMEdgeLoopStore *el_store);
ListBase *BM_edgeloop_verts_get(BMEdgeLoopStore *el_store);
const float *BM_edgeloop_normal_get(BMEdgeLoopStore *el_store);
const float *BM_edgeloop_center_get(BMEdgeLoopStore *el_store);
/**
* Edges are assigned to one vert -> the next.
*/
void BM_edgeloop_edges_get(struct BMEdgeLoopStore *el_store, BMEdge **e_arr);
void BM_edgeloop_calc_center(BMesh *bm, struct BMEdgeLoopStore *el_store);
bool BM_edgeloop_calc_normal(BMesh *bm, struct BMEdgeLoopStore *el_store);
void BM_edgeloop_edges_get(BMEdgeLoopStore *el_store, BMEdge **e_arr);
void BM_edgeloop_calc_center(BMesh *bm, BMEdgeLoopStore *el_store);
bool BM_edgeloop_calc_normal(BMesh *bm, BMEdgeLoopStore *el_store);
/**
* For open loops that are straight lines,
* calculating the normal as if it were a polygon is meaningless.
@ -61,17 +59,13 @@ bool BM_edgeloop_calc_normal(BMesh *bm, struct BMEdgeLoopStore *el_store);
* Instead use an alignment vector and calculate the normal based on that.
*/
bool BM_edgeloop_calc_normal_aligned(BMesh *bm,
struct BMEdgeLoopStore *el_store,
BMEdgeLoopStore *el_store,
const float no_align[3]);
void BM_edgeloop_flip(BMesh *bm, struct BMEdgeLoopStore *el_store);
void BM_edgeloop_expand(BMesh *bm,
struct BMEdgeLoopStore *el_store,
int el_store_len,
bool split,
struct GSet *split_edges);
void BM_edgeloop_flip(BMesh *bm, BMEdgeLoopStore *el_store);
void BM_edgeloop_expand(
BMesh *bm, BMEdgeLoopStore *el_store, int el_store_len, bool split, GSet *split_edges);
bool BM_edgeloop_overlap_check(struct BMEdgeLoopStore *el_store_a,
struct BMEdgeLoopStore *el_store_b);
bool BM_edgeloop_overlap_check(BMEdgeLoopStore *el_store_a, BMEdgeLoopStore *el_store_b);
#define BM_EDGELINK_NEXT(el_store, elink) \
(elink)->next ? \
@ -80,5 +74,4 @@ bool BM_edgeloop_overlap_check(struct BMEdgeLoopStore *el_store_a,
NULL)
#define BM_EDGELOOP_NEXT(el_store) \
(CHECK_TYPE_INLINE(el_store, struct BMEdgeLoopStore *), \
(struct BMEdgeLoopStore *)((LinkData *)el_store)->next)
(CHECK_TYPE_INLINE(el_store, BMEdgeLoopStore *), (BMEdgeLoopStore *)((LinkData *)el_store)->next)

View File

@ -110,17 +110,17 @@ void BM_loop_interp_from_face(
*/
void BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f);
struct LinkNode *BM_vert_loop_groups_data_layer_create(
BMesh *bm, BMVert *v, int layer_n, const float *loop_weights, struct MemArena *arena);
LinkNode *BM_vert_loop_groups_data_layer_create(
BMesh *bm, BMVert *v, int layer_n, const float *loop_weights, MemArena *arena);
/**
* Take existing custom data and merge each fan's data.
*/
void BM_vert_loop_groups_data_layer_merge(BMesh *bm, struct LinkNode *groups, int layer_n);
void BM_vert_loop_groups_data_layer_merge(BMesh *bm, LinkNode *groups, int layer_n);
/**
* A version of #BM_vert_loop_groups_data_layer_merge
* that takes an array of loop-weights (aligned with #BM_LOOPS_OF_VERT iterator).
*/
void BM_vert_loop_groups_data_layer_merge_weights(BMesh *bm,
struct LinkNode *groups,
LinkNode *groups,
int layer_n,
const float *loop_weights);

View File

@ -150,21 +150,21 @@ typedef void *(*BMIter__step_cb)(void *);
/* Iterator Structure */
/* NOTE: some of these vars are not used,
* so they have been commented to save stack space since this struct is used all over */
typedef struct BMIter {
struct BMIter {
/* keep union first */
union {
struct BMIter__elem_of_mesh elem_of_mesh;
BMIter__elem_of_mesh elem_of_mesh;
struct BMIter__edge_of_vert edge_of_vert;
struct BMIter__face_of_vert face_of_vert;
struct BMIter__loop_of_vert loop_of_vert;
struct BMIter__loop_of_edge loop_of_edge;
struct BMIter__loop_of_loop loop_of_loop;
struct BMIter__face_of_edge face_of_edge;
struct BMIter__vert_of_edge vert_of_edge;
struct BMIter__vert_of_face vert_of_face;
struct BMIter__edge_of_face edge_of_face;
struct BMIter__loop_of_face loop_of_face;
BMIter__edge_of_vert edge_of_vert;
BMIter__face_of_vert face_of_vert;
BMIter__loop_of_vert loop_of_vert;
BMIter__loop_of_edge loop_of_edge;
BMIter__loop_of_loop loop_of_loop;
BMIter__face_of_edge face_of_edge;
BMIter__vert_of_edge vert_of_edge;
BMIter__vert_of_face vert_of_face;
BMIter__edge_of_face edge_of_face;
BMIter__loop_of_face loop_of_face;
} data;
BMIter__begin_cb begin;
@ -172,7 +172,7 @@ typedef struct BMIter {
int count; /* NOTE: only some iterators set this, don't rely on it. */
char itype;
} BMIter;
};
/**
* \note Use #BM_vert_at_index / #BM_edge_at_index / #BM_face_at_index for mesh arrays.

View File

@ -12,9 +12,8 @@ struct BMFace;
struct BMVert;
struct BMesh;
struct RangeTreeUInt;
typedef struct BMLog BMLog;
typedef struct BMLogEntry BMLogEntry;
struct BMLog;
struct BMLogEntry;
/**
* Allocate, initialize, and assign a new BMLog.
@ -110,7 +109,7 @@ void BM_log_redo(BMesh *bm, BMLog *log);
* state so that a subsequent redo operation will restore the newer
* vertex state.
*/
void BM_log_vert_before_modified(BMLog *log, struct BMVert *v, int cd_vert_mask_offset);
void BM_log_vert_before_modified(BMLog *log, BMVert *v, int cd_vert_mask_offset);
/**
* Log a new vertex as added to the #BMesh.
@ -119,7 +118,7 @@ void BM_log_vert_before_modified(BMLog *log, struct BMVert *v, int cd_vert_mask_
* of added vertices, with the key being its ID and the value
* containing everything needed to reconstruct that vertex.
*/
void BM_log_vert_added(BMLog *log, struct BMVert *v, int cd_vert_mask_offset);
void BM_log_vert_added(BMLog *log, BMVert *v, int cd_vert_mask_offset);
/**
* Log a face before it is modified.
@ -127,7 +126,7 @@ void BM_log_vert_added(BMLog *log, struct BMVert *v, int cd_vert_mask_offset);
* This is intended to handle only header flags and we always
* assume face has been added before.
*/
void BM_log_face_modified(BMLog *log, struct BMFace *f);
void BM_log_face_modified(BMLog *log, BMFace *f);
/**
* Log a new face as added to the #BMesh.
@ -136,7 +135,7 @@ void BM_log_face_modified(BMLog *log, struct BMFace *f);
* of added faces, with the key being its ID and the value containing
* everything needed to reconstruct that face.
*/
void BM_log_face_added(BMLog *log, struct BMFace *f);
void BM_log_face_added(BMLog *log, BMFace *f);
/**
* Log a vertex as removed from the #BMesh.
@ -155,7 +154,7 @@ void BM_log_face_added(BMLog *log, struct BMFace *f);
* If there's a move record for the vertex, that's used as the
* vertices original location, then the move record is deleted.
*/
void BM_log_vert_removed(BMLog *log, struct BMVert *v, int cd_vert_mask_offset);
void BM_log_vert_removed(BMLog *log, BMVert *v, int cd_vert_mask_offset);
/**
* Log a face as removed from the #BMesh.
@ -171,7 +170,7 @@ void BM_log_vert_removed(BMLog *log, struct BMVert *v, int cd_vert_mask_offset);
* its ID and the value containing everything needed to reconstruct
* that face.
*/
void BM_log_face_removed(BMLog *log, struct BMFace *f);
void BM_log_face_removed(BMLog *log, BMFace *f);
/**
* Log all vertices/faces in the #BMesh as added.

View File

@ -28,8 +28,7 @@ struct BMeshCreateParams {
*
* \note ob is needed by multires
*/
BMesh *BM_mesh_create(const struct BMAllocTemplate *allocsize,
const struct BMeshCreateParams *params);
BMesh *BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params);
/**
* \brief BMesh Free Mesh
@ -162,15 +161,15 @@ void BM_mesh_remap(BMesh *bm, const uint *vert_idx, const uint *edge_idx, const
* but could also be used for packing fragmented bmeshes.
*/
void BM_mesh_rebuild(BMesh *bm,
const struct BMeshCreateParams *params,
struct BLI_mempool *vpool,
struct BLI_mempool *epool,
struct BLI_mempool *lpool,
struct BLI_mempool *fpool);
const BMeshCreateParams *params,
BLI_mempool *vpool,
BLI_mempool *epool,
BLI_mempool *lpool,
BLI_mempool *fpool);
typedef struct BMAllocTemplate {
struct BMAllocTemplate {
int totvert, totedge, totloop, totface;
} BMAllocTemplate;
};
/* used as an extern, defined in bmesh.h */
extern const BMAllocTemplate bm_mesh_allocsize_default;

View File

@ -25,16 +25,16 @@ struct BMeshNormalsUpdate_Params {
*
* Updates the normals of a mesh.
*/
void BM_mesh_normals_update_ex(BMesh *bm, const struct BMeshNormalsUpdate_Params *param);
void BM_mesh_normals_update_ex(BMesh *bm, const BMeshNormalsUpdate_Params *param);
void BM_mesh_normals_update(BMesh *bm);
/**
* A version of #BM_mesh_normals_update that updates a subset of geometry,
* used to avoid the overhead of updating everything.
*/
void BM_mesh_normals_update_with_partial_ex(BMesh *bm,
const struct BMPartialUpdate *bmpinfo,
const struct BMeshNormalsUpdate_Params *param);
void BM_mesh_normals_update_with_partial(BMesh *bm, const struct BMPartialUpdate *bmpinfo);
const BMPartialUpdate *bmpinfo,
const BMeshNormalsUpdate_Params *param);
void BM_mesh_normals_update_with_partial(BMesh *bm, const BMPartialUpdate *bmpinfo);
/**
* \brief BMesh Compute Normals from/to external data.
@ -59,7 +59,7 @@ void BM_loops_calc_normal_vcos(BMesh *bm,
const float (*fnos)[3],
bool use_split_normals,
float (*r_lnos)[3],
struct MLoopNorSpaceArray *r_lnors_spacearr,
MLoopNorSpaceArray *r_lnors_spacearr,
short (*clnors_data)[2],
int cd_loop_clnors_offset,
bool do_rebuild);
@ -84,16 +84,15 @@ void BM_lnorspace_err(BMesh *bm);
#endif
/* Loop Generics */
struct BMLoopNorEditDataArray *BM_loop_normal_editdata_array_init(BMesh *bm,
bool do_all_loops_of_vert);
void BM_loop_normal_editdata_array_free(struct BMLoopNorEditDataArray *lnors_ed_arr);
BMLoopNorEditDataArray *BM_loop_normal_editdata_array_init(BMesh *bm, bool do_all_loops_of_vert);
void BM_loop_normal_editdata_array_free(BMLoopNorEditDataArray *lnors_ed_arr);
/**
* \warning This function sets #BM_ELEM_TAG on loops & edges via #bm_mesh_loops_calc_normals,
* take care to run this before setting up tags.
*/
bool BM_custom_loop_normals_to_vector_layer(struct BMesh *bm);
void BM_custom_loop_normals_from_vector_layer(struct BMesh *bm, bool add_sharp_edges);
bool BM_custom_loop_normals_to_vector_layer(BMesh *bm);
void BM_custom_loop_normals_from_vector_layer(BMesh *bm, bool add_sharp_edges);
/**
* Define sharp edges as needed to mimic 'autosmooth' from angle threshold.

View File

@ -13,10 +13,10 @@
/**
* Parameters used to determine which kinds of data needs to be generated.
*/
typedef struct BMPartialUpdate_Params {
struct BMPartialUpdate_Params {
bool do_normals;
bool do_tessellate;
} BMPartialUpdate_Params;
};
/**
* Cached data to speed up partial updates.
@ -30,7 +30,7 @@ typedef struct BMPartialUpdate_Params {
* - Partial normal updates use face & loop indices,
* setting them to dirty values between updates will slow down normal recalculation.
*/
typedef struct BMPartialUpdate {
struct BMPartialUpdate {
BMVert **verts;
BMFace **faces;
int verts_len, verts_len_alloc;
@ -38,7 +38,7 @@ typedef struct BMPartialUpdate {
/** Store the parameters used in creation so invalid use can be asserted. */
BMPartialUpdate_Params params;
} BMPartialUpdate;
};
/**
* All Tagged & Connected, see: #BM_mesh_partial_create_from_verts

View File

@ -20,7 +20,7 @@ struct BMeshCalcTessellation_Params {
void BM_mesh_calc_tessellation_ex(BMesh *bm,
BMLoop *(*looptris)[3],
const struct BMeshCalcTessellation_Params *params);
const BMeshCalcTessellation_Params *params);
void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3]);
/**
@ -30,8 +30,8 @@ void BM_mesh_calc_tessellation_beauty(BMesh *bm, BMLoop *(*looptris)[3]);
void BM_mesh_calc_tessellation_with_partial_ex(BMesh *bm,
BMLoop *(*looptris)[3],
const struct BMPartialUpdate *bmpinfo,
const struct BMeshCalcTessellation_Params *params);
const BMPartialUpdate *bmpinfo,
const BMeshCalcTessellation_Params *params);
void BM_mesh_calc_tessellation_with_partial(BMesh *bm,
BMLoop *(*looptris)[3],
const struct BMPartialUpdate *bmpinfo);
const BMPartialUpdate *bmpinfo);

View File

@ -32,7 +32,7 @@ void BM_mesh_bevel(BMesh *bm,
bool affect_type,
bool use_weights,
bool limit_offset,
const struct MDeformVert *dvert,
const MDeformVert *dvert,
int vertex_group,
int mat,
bool loop_slide,
@ -43,5 +43,5 @@ void BM_mesh_bevel(BMesh *bm,
int miter_outer,
int miter_inner,
float spread,
const struct CurveProfile *custom_profile,
const CurveProfile *custom_profile,
int vmesh_method);

View File

@ -8,26 +8,26 @@
* \ingroup bmesh
*/
struct LinkNode *BM_mesh_calc_path_uv_region_vert(BMesh *bm,
BMElem *ele_src,
BMElem *ele_dst,
int cd_loop_uv_offset,
bool (*filter_fn)(BMLoop *, void *user_data),
void *user_data) ATTR_WARN_UNUSED_RESULT
LinkNode *BM_mesh_calc_path_uv_region_vert(BMesh *bm,
BMElem *ele_src,
BMElem *ele_dst,
int cd_loop_uv_offset,
bool (*filter_fn)(BMLoop *, void *user_data),
void *user_data) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3);
struct LinkNode *BM_mesh_calc_path_uv_region_edge(BMesh *bm,
BMElem *ele_src,
BMElem *ele_dst,
int cd_loop_uv_offset,
bool (*filter_fn)(BMLoop *, void *user_data),
void *user_data) ATTR_WARN_UNUSED_RESULT
LinkNode *BM_mesh_calc_path_uv_region_edge(BMesh *bm,
BMElem *ele_src,
BMElem *ele_dst,
int cd_loop_uv_offset,
bool (*filter_fn)(BMLoop *, void *user_data),
void *user_data) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3);
struct LinkNode *BM_mesh_calc_path_uv_region_face(BMesh *bm,
BMElem *ele_src,
BMElem *ele_dst,
int cd_loop_uv_offset,
bool (*filter_fn)(BMFace *, void *user_data),
void *user_data) ATTR_WARN_UNUSED_RESULT
LinkNode *BM_mesh_calc_path_uv_region_face(BMesh *bm,
BMElem *ele_src,
BMElem *ele_dst,
int cd_loop_uv_offset,
bool (*filter_fn)(BMFace *, void *user_data),
void *user_data) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3);

View File

@ -76,7 +76,7 @@ void DEG_relations_tag_update(Main *bmain);
*/
struct DepsNodeHandle;
typedef enum eDepsSceneComponentType {
enum eDepsSceneComponentType {
/* Parameters Component - Default when nothing else fits
* (i.e. just SDNA property setting). */
DEG_SCENE_COMP_PARAMETERS,
@ -85,9 +85,9 @@ typedef enum eDepsSceneComponentType {
DEG_SCENE_COMP_ANIMATION,
/* Sequencer Component (Scene Only). */
DEG_SCENE_COMP_SEQUENCER,
} eDepsSceneComponentType;
};
typedef enum eDepsObjectComponentType {
enum eDepsObjectComponentType {
/* Used in query API, to denote which component caller is interested in. */
DEG_OB_COMP_ANY,
@ -114,7 +114,7 @@ typedef enum eDepsObjectComponentType {
DEG_OB_COMP_SHADING,
/* Cache Component */
DEG_OB_COMP_CACHE,
} eDepsObjectComponentType;
};
void DEG_add_scene_relation(DepsNodeHandle *node_handle,
Scene *scene,

View File

@ -133,13 +133,13 @@ bool DEG_is_fully_evaluated(const Depsgraph *depsgraph);
/** \name DEG object iterators
* \{ */
typedef enum DegIterFlag {
enum DegIterFlag {
DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY = (1 << 0),
DEG_ITER_OBJECT_FLAG_LINKED_INDIRECTLY = (1 << 1),
DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET = (1 << 2),
DEG_ITER_OBJECT_FLAG_VISIBLE = (1 << 3),
DEG_ITER_OBJECT_FLAG_DUPLI = (1 << 4),
} DegIterFlag;
};
ENUM_OPERATORS(DegIterFlag, DEG_ITER_OBJECT_FLAG_DUPLI)
struct DEGObjectIterSettings {

View File

@ -43,8 +43,8 @@ struct TimeSourceNode;
/* Dependency Graph object */
struct Depsgraph {
typedef Vector<OperationNode *> OperationNodes;
typedef Vector<IDNode *> IDDepsNodes;
using OperationNodes = Vector<OperationNode *>;
using IDDepsNodes = Vector<IDNode *>;
Depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode);
~Depsgraph();

View File

@ -32,7 +32,6 @@
#include "BLI_vector_set.hh"
struct Depsgraph;
struct CustomData_MeshMasks;
namespace blender::deg {

View File

@ -169,7 +169,7 @@ struct Node {
* The reason why all depsgraph nodes are descended from this type (apart
* from basic serialization benefits - from the typeinfo) is that we can
* have relationships between these nodes. */
typedef Vector<Relation *> Relations;
using Relations = Vector<Relation *>;
string name; /* Identifier - mainly for debugging purposes. */
NodeType type; /* Structural type of node. */

View File

@ -17,7 +17,7 @@ namespace blender::deg {
struct ComponentNode;
typedef uint64_t IDComponentsMask;
using IDComponentsMask = uint64_t;
/* NOTE: We use max comparison to mark an id node that is linked more than once
* So keep this enum ordered accordingly. */

View File

@ -20,7 +20,7 @@ struct ComponentNode;
/* Evaluation Operation for atomic operation */
/* XXX: move this to another header that can be exposed? */
typedef function<void(::Depsgraph *)> DepsEvalOperationCb;
using DepsEvalOperationCb = function<void(::Depsgraph *)>;
/* Identifiers for common operations (as an enum). */
enum class OperationCode {

View File

@ -94,7 +94,7 @@ struct DRWSubdivLooseGeom {
* This holds the various buffers used to evaluate and render subdivision through OpenGL.
* \{ */
typedef struct DRWSubdivCache {
struct DRWSubdivCache {
Mesh *mesh;
BMesh *bm;
Subdiv *subdiv;
@ -181,7 +181,7 @@ typedef struct DRWSubdivCache {
/* Extra flags, passed to the UBO. */
bool is_edit_mode;
bool use_hide;
} DRWSubdivCache;
};
/* Only frees the data of the cache, caller is responsible to free the cache itself if necessary.
*/

View File

@ -1788,15 +1788,15 @@ void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *arg, uiFre
*/
void UI_but_func_tooltip_label_set(uiBut *but, std::function<std::string(const uiBut *but)> func);
typedef enum uiTooltipStyle {
enum uiTooltipStyle {
UI_TIP_STYLE_NORMAL = 0, /* Regular text. */
UI_TIP_STYLE_HEADER, /* Header text. */
UI_TIP_STYLE_MONO, /* Mono-spaced text. */
UI_TIP_STYLE_IMAGE, /* Image field. */
UI_TIP_STYLE_SPACER, /* Padding to separate sections. */
} uiTooltipStyle;
};
typedef enum uiTooltipColorID {
enum uiTooltipColorID {
UI_TIP_LC_MAIN = 0, /* Color of primary text. */
UI_TIP_LC_VALUE, /* Color for the value of buttons (also shortcuts). */
UI_TIP_LC_ACTIVE, /* Color of titles of active enum values. */
@ -1804,7 +1804,7 @@ typedef enum uiTooltipColorID {
UI_TIP_LC_PYTHON, /* Color of python snippets. */
UI_TIP_LC_ALERT, /* Warning text color, eg: why operator can't run. */
UI_TIP_LC_MAX
} uiTooltipColorID;
};
void UI_but_func_tooltip_custom_set(uiBut *but,
uiButToolTipCustomFunc func,

View File

@ -122,9 +122,9 @@ bool vertex_paint_poll_ignore_tool(bContext *C);
*/
bool vertex_paint_mode_poll(bContext *C);
typedef void (*VPaintTransform_Callback)(const float col[3],
const void *user_data,
float r_col[3]);
using VPaintTransform_Callback = void (*)(const float col[3],
const void *user_data,
float r_col[3]);
void PAINT_OT_weight_paint_toggle(wmOperatorType *ot);
void PAINT_OT_weight_paint(wmOperatorType *ot);

View File

@ -24,77 +24,77 @@ extern const char *image_context_dir[]; /* doc access */
/* `image_draw.cc` */
void draw_image_main_helpers(const struct bContext *C, struct ARegion *region);
void draw_image_cache(const struct bContext *C, struct ARegion *region);
void draw_image_sample_line(struct SpaceImage *sima);
void draw_image_main_helpers(const bContext *C, ARegion *region);
void draw_image_cache(const bContext *C, ARegion *region);
void draw_image_sample_line(SpaceImage *sima);
/* `image_ops.cc` */
bool space_image_main_region_poll(struct bContext *C);
bool space_image_view_center_cursor_poll(struct bContext *C);
bool space_image_main_region_poll(bContext *C);
bool space_image_view_center_cursor_poll(bContext *C);
void IMAGE_OT_view_all(struct wmOperatorType *ot);
void IMAGE_OT_view_pan(struct wmOperatorType *ot);
void IMAGE_OT_view_selected(struct wmOperatorType *ot);
void IMAGE_OT_view_center_cursor(struct wmOperatorType *ot);
void IMAGE_OT_view_cursor_center(struct wmOperatorType *ot);
void IMAGE_OT_view_zoom(struct wmOperatorType *ot);
void IMAGE_OT_view_zoom_in(struct wmOperatorType *ot);
void IMAGE_OT_view_zoom_out(struct wmOperatorType *ot);
void IMAGE_OT_view_zoom_ratio(struct wmOperatorType *ot);
void IMAGE_OT_view_zoom_border(struct wmOperatorType *ot);
void IMAGE_OT_view_all(wmOperatorType *ot);
void IMAGE_OT_view_pan(wmOperatorType *ot);
void IMAGE_OT_view_selected(wmOperatorType *ot);
void IMAGE_OT_view_center_cursor(wmOperatorType *ot);
void IMAGE_OT_view_cursor_center(wmOperatorType *ot);
void IMAGE_OT_view_zoom(wmOperatorType *ot);
void IMAGE_OT_view_zoom_in(wmOperatorType *ot);
void IMAGE_OT_view_zoom_out(wmOperatorType *ot);
void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot);
void IMAGE_OT_view_zoom_border(wmOperatorType *ot);
#ifdef WITH_INPUT_NDOF
void IMAGE_OT_view_ndof(struct wmOperatorType *ot);
void IMAGE_OT_view_ndof(wmOperatorType *ot);
#endif
void IMAGE_OT_new(struct wmOperatorType *ot);
void IMAGE_OT_new(wmOperatorType *ot);
/**
* Called by other space types too.
*/
void IMAGE_OT_open(struct wmOperatorType *ot);
void IMAGE_OT_file_browse(struct wmOperatorType *ot);
void IMAGE_OT_open(wmOperatorType *ot);
void IMAGE_OT_file_browse(wmOperatorType *ot);
/**
* Called by other space types too.
*/
void IMAGE_OT_match_movie_length(struct wmOperatorType *ot);
void IMAGE_OT_replace(struct wmOperatorType *ot);
void IMAGE_OT_reload(struct wmOperatorType *ot);
void IMAGE_OT_save(struct wmOperatorType *ot);
void IMAGE_OT_save_as(struct wmOperatorType *ot);
void IMAGE_OT_save_sequence(struct wmOperatorType *ot);
void IMAGE_OT_save_all_modified(struct wmOperatorType *ot);
void IMAGE_OT_pack(struct wmOperatorType *ot);
void IMAGE_OT_unpack(struct wmOperatorType *ot);
void IMAGE_OT_clipboard_copy(struct wmOperatorType *ot);
void IMAGE_OT_clipboard_paste(struct wmOperatorType *ot);
void IMAGE_OT_match_movie_length(wmOperatorType *ot);
void IMAGE_OT_replace(wmOperatorType *ot);
void IMAGE_OT_reload(wmOperatorType *ot);
void IMAGE_OT_save(wmOperatorType *ot);
void IMAGE_OT_save_as(wmOperatorType *ot);
void IMAGE_OT_save_sequence(wmOperatorType *ot);
void IMAGE_OT_save_all_modified(wmOperatorType *ot);
void IMAGE_OT_pack(wmOperatorType *ot);
void IMAGE_OT_unpack(wmOperatorType *ot);
void IMAGE_OT_clipboard_copy(wmOperatorType *ot);
void IMAGE_OT_clipboard_paste(wmOperatorType *ot);
void IMAGE_OT_flip(struct wmOperatorType *ot);
void IMAGE_OT_invert(struct wmOperatorType *ot);
void IMAGE_OT_resize(struct wmOperatorType *ot);
void IMAGE_OT_flip(wmOperatorType *ot);
void IMAGE_OT_invert(wmOperatorType *ot);
void IMAGE_OT_resize(wmOperatorType *ot);
void IMAGE_OT_cycle_render_slot(struct wmOperatorType *ot);
void IMAGE_OT_clear_render_slot(struct wmOperatorType *ot);
void IMAGE_OT_add_render_slot(struct wmOperatorType *ot);
void IMAGE_OT_remove_render_slot(struct wmOperatorType *ot);
void IMAGE_OT_cycle_render_slot(wmOperatorType *ot);
void IMAGE_OT_clear_render_slot(wmOperatorType *ot);
void IMAGE_OT_add_render_slot(wmOperatorType *ot);
void IMAGE_OT_remove_render_slot(wmOperatorType *ot);
void IMAGE_OT_sample(struct wmOperatorType *ot);
void IMAGE_OT_sample_line(struct wmOperatorType *ot);
void IMAGE_OT_curves_point_set(struct wmOperatorType *ot);
void IMAGE_OT_sample(wmOperatorType *ot);
void IMAGE_OT_sample_line(wmOperatorType *ot);
void IMAGE_OT_curves_point_set(wmOperatorType *ot);
void IMAGE_OT_change_frame(struct wmOperatorType *ot);
void IMAGE_OT_change_frame(wmOperatorType *ot);
void IMAGE_OT_read_viewlayers(struct wmOperatorType *ot);
void IMAGE_OT_render_border(struct wmOperatorType *ot);
void IMAGE_OT_clear_render_border(struct wmOperatorType *ot);
void IMAGE_OT_read_viewlayers(wmOperatorType *ot);
void IMAGE_OT_render_border(wmOperatorType *ot);
void IMAGE_OT_clear_render_border(wmOperatorType *ot);
void IMAGE_OT_tile_add(struct wmOperatorType *ot);
void IMAGE_OT_tile_remove(struct wmOperatorType *ot);
void IMAGE_OT_tile_fill(struct wmOperatorType *ot);
void IMAGE_OT_tile_add(wmOperatorType *ot);
void IMAGE_OT_tile_remove(wmOperatorType *ot);
void IMAGE_OT_tile_fill(wmOperatorType *ot);
/* image_panels.c */
/**
* Gets active viewer user.
*/
struct ImageUser *ntree_get_active_iuser(struct bNodeTree *ntree);
void image_buttons_register(struct ARegionType *art);
ImageUser *ntree_get_active_iuser(bNodeTree *ntree);
void image_buttons_register(ARegionType *art);

View File

@ -86,7 +86,7 @@ enum TreeTraversalAction {
TRAVERSE_SKIP_CHILDS,
};
typedef TreeTraversalAction (*TreeTraversalFunc)(TreeElement *te, void *customdata);
using TreeTraversalFunc = TreeTraversalAction (*)(TreeElement *te, void *customdata);
struct TreeElement {
TreeElement *next, *prev, *parent;
@ -382,13 +382,13 @@ bool outliner_is_co_within_mode_column(SpaceOutliner *space_outliner, const floa
void outliner_item_mode_toggle(bContext *C, TreeViewContext *tvc, TreeElement *te, bool do_extend);
/* `outliner_edit.cc` */
typedef void (*outliner_operation_fn)(bContext *C,
ReportList *,
Scene *scene,
TreeElement *,
TreeStoreElem *,
TreeStoreElem *,
void *);
using outliner_operation_fn = void (*)(bContext *C,
ReportList *,
Scene *scene,
TreeElement *,
TreeStoreElem *,
TreeStoreElem *,
void *);
/**
* \param recurse_selected: Set to false for operations which are already

View File

@ -15,7 +15,7 @@
struct rcti;
/** Flags for mode of operation. */
typedef enum eGPUSelectMode {
enum eGPUSelectMode {
GPU_SELECT_ALL = 1,
/* gpu_select_query */
GPU_SELECT_NEAREST_FIRST_PASS = 2,
@ -23,12 +23,12 @@ typedef enum eGPUSelectMode {
/* gpu_select_pick */
GPU_SELECT_PICK_ALL = 4,
GPU_SELECT_PICK_NEAREST = 5,
} eGPUSelectMode;
};
/**
* The result of calling #GPU_select_begin & #GPU_select_end.
*/
typedef struct GPUSelectResult {
struct GPUSelectResult {
/** The selection identifier matching the value passed in by #GPU_select_load_id. */
unsigned int id;
/**
@ -39,7 +39,7 @@ typedef struct GPUSelectResult {
* this has not been included as Blender doesn't need this however support could be added.
*/
unsigned int depth;
} GPUSelectResult;
};
using GPUSelectStorage = blender::Vector<GPUSelectResult, 2500>;
struct GPUSelectBuffer {
@ -50,7 +50,7 @@ struct GPUSelectBuffer {
* Initialize and provide buffer for results.
*/
void GPU_select_begin(GPUSelectBuffer *buffer,
const struct rcti *input,
const rcti *input,
eGPUSelectMode mode,
int oldhits);
/**
@ -58,7 +58,7 @@ void GPU_select_begin(GPUSelectBuffer *buffer,
* Uses the new Select-Next engine if enabled.
*/
void GPU_select_begin_next(GPUSelectBuffer *buffer,
const struct rcti *input,
const rcti *input,
eGPUSelectMode mode,
int oldhits);
/**
@ -99,4 +99,4 @@ uint GPU_select_buffer_remove_by_id(blender::MutableSpan<GPUSelectResult> hit_re
/**
* Part of the solution copied from `rect_subregion_stride_calc`.
*/
void GPU_select_buffer_stride_realign(const struct rcti *src, const struct rcti *dst, uint *r_buf);
void GPU_select_buffer_stride_realign(const rcti *src, const rcti *dst, uint *r_buf);

View File

@ -17,7 +17,7 @@ namespace blender::io {
class PersistentID {
protected:
constexpr static int array_length_ = MAX_DUPLI_RECUR;
typedef std::array<int, array_length_> PIDArray;
using PIDArray = std::array<int, array_length_>;
PIDArray persistent_id_;
explicit PersistentID(const PIDArray &persistent_id_values);

View File

@ -755,7 +755,7 @@ void _RNA_warning(const char *format, ...) ATTR_PRINTF_FORMAT(1, 2);
* \note In practice, #EQ_STRICT and #EQ_COMPARE have same behavior currently,
* and will yield same result.
*/
typedef enum eRNACompareMode {
enum eRNACompareMode {
/* Only care about equality, not full comparison. */
/** Set/unset ignored. */
RNA_EQ_STRICT,
@ -765,7 +765,7 @@ typedef enum eRNACompareMode {
RNA_EQ_UNSET_MATCH_NONE,
/** Full comparison. */
RNA_EQ_COMPARE,
} eRNACompareMode;
};
bool RNA_property_equals(
Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, PropertyRNA *prop, eRNACompareMode mode);
@ -774,7 +774,7 @@ bool RNA_struct_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, eRNACo
/* Override. */
/** Flags for #RNA_struct_override_matches. */
typedef enum eRNAOverrideMatch {
enum eRNAOverrideMatch {
/** Do not compare properties that are not overridable. */
RNA_OVERRIDE_COMPARE_IGNORE_NON_OVERRIDABLE = 1 << 0,
/** Do not compare properties that are already overridden. */
@ -786,10 +786,10 @@ typedef enum eRNAOverrideMatch {
RNA_OVERRIDE_COMPARE_RESTORE = 1 << 17,
/** Tag for restoration of property's value(s) to reference ones, if needed and possible. */
RNA_OVERRIDE_COMPARE_TAG_FOR_RESTORE = 1 << 18,
} eRNAOverrideMatch;
};
ENUM_OPERATORS(eRNAOverrideMatch, RNA_OVERRIDE_COMPARE_TAG_FOR_RESTORE)
typedef enum eRNAOverrideMatchResult {
enum eRNAOverrideMatchResult {
RNA_OVERRIDE_MATCH_RESULT_INIT = 0,
/**
@ -804,10 +804,10 @@ typedef enum eRNAOverrideMatchResult {
RNA_OVERRIDE_MATCH_RESULT_RESTORE_TAGGED = 1 << 1,
/** Some properties were reset to reference values. */
RNA_OVERRIDE_MATCH_RESULT_RESTORED = 1 << 2,
} eRNAOverrideMatchResult;
};
ENUM_OPERATORS(eRNAOverrideMatchResult, RNA_OVERRIDE_MATCH_RESULT_RESTORED)
typedef enum eRNAOverrideStatus {
enum eRNAOverrideStatus {
/** The property is overridable. */
RNA_OVERRIDE_STATUS_OVERRIDABLE = 1 << 0,
/** The property is overridden. */
@ -816,7 +816,7 @@ typedef enum eRNAOverrideStatus {
RNA_OVERRIDE_STATUS_MANDATORY = 1 << 2,
/** The override status of this property is locked. */
RNA_OVERRIDE_STATUS_LOCKED = 1 << 3,
} eRNAOverrideStatus;
};
ENUM_OPERATORS(eRNAOverrideStatus, RNA_OVERRIDE_STATUS_LOCKED)
/**
@ -848,7 +848,7 @@ bool RNA_struct_override_store(Main *bmain,
PointerRNA *ptr_storage,
IDOverrideLibrary *override);
typedef enum eRNAOverrideApplyFlag {
enum eRNAOverrideApplyFlag {
RNA_OVERRIDE_APPLY_FLAG_NOP = 0,
/**
* Hack to work around/fix older broken overrides: Do not apply override operations affecting ID
@ -861,7 +861,7 @@ typedef enum eRNAOverrideApplyFlag {
/** Only perform restore operations. */
RNA_OVERRIDE_APPLY_FLAG_RESTORE_ONLY = 1 << 2,
} eRNAOverrideApplyFlag;
};
/**
* Apply given \a override operations on \a id_ptr_dst, using \a id_ptr_src

View File

@ -387,7 +387,7 @@ class SocketDeclarationBuilder : public BaseSocketDeclarationBuilder {
using SocketDeclarationPtr = std::unique_ptr<SocketDeclaration>;
typedef void (*PanelDrawButtonsFunction)(uiLayout *, bContext *, PointerRNA *);
using PanelDrawButtonsFunction = void (*)(uiLayout *, bContext *, PointerRNA *);
/**
* Describes a panel containing sockets or other panels.

View File

@ -30,7 +30,6 @@
#endif
struct bContext;
typedef struct bContext bContext;
struct bNodeExecContext;
struct bNodeExecData;
struct bNodeTreeExec;

View File

@ -50,7 +50,7 @@ struct TexParams {
const MTex *mtex;
};
typedef void (*TexFn)(float *out, TexParams *params, bNode *node, bNodeStack **in, short thread);
using TexFn = void (*)(float *out, TexParams *params, bNode *node, bNodeStack **in, short thread);
struct TexDelegate {
TexCallData *cdata;

View File

@ -14,8 +14,11 @@
struct ListBase;
struct Main;
struct Mask;
struct MovieClip;
struct Scene;
struct Sequence;
struct Stereo3dFormat;
/** #SeqLoadData.flags */
enum eSeqLoadFlags {
@ -36,22 +39,22 @@ struct SeqLoadData {
struct {
int len;
int end_frame;
} image; /* Only for image strips. */
struct Scene *scene; /* Only for scene strips. */
struct MovieClip *clip; /* Only for clip strips. */
struct Mask *mask; /* Only for mask strips. */
} image; /* Only for image strips. */
Scene *scene; /* Only for scene strips. */
MovieClip *clip; /* Only for clip strips. */
Mask *mask; /* Only for mask strips. */
struct {
int type;
int end_frame;
struct Sequence *seq1;
struct Sequence *seq2;
struct Sequence *seq3;
Sequence *seq1;
Sequence *seq2;
Sequence *seq3;
} effect; /* Only for effect strips. */
eSeqLoadFlags flags;
eSeqImageFitMethod fit_method;
bool use_multiview;
char views_format;
struct Stereo3dFormat *stereo3d_format;
Stereo3dFormat *stereo3d_format;
bool allow_invalid_file; /* Used by RNA API to create placeholder strips. */
double r_video_stream_start; /* For AV synchronization. Set by `SEQ_add_movie_strip`. */
bool adjust_playback_rate;

View File

@ -52,10 +52,10 @@ void SEQ_edit_flag_for_removal(Scene *scene, ListBase *seqbase, Sequence *seq);
void SEQ_edit_remove_flagged_sequences(Scene *scene, ListBase *seqbase);
void SEQ_edit_update_muting(Editing *ed);
typedef enum eSeqSplitMethod {
enum eSeqSplitMethod {
SEQ_SPLIT_SOFT,
SEQ_SPLIT_HARD,
} eSeqSplitMethod;
};
/**
* Split Sequence at timeline_frame in two.

View File

@ -33,7 +33,7 @@ struct SeqEffectHandle {
/* number of input strips needed
* (called directly after construction) */
int (*num_inputs)(void);
int (*num_inputs)();
/* load is called first time after readblenfile in
* get_sequence_effect automatically */

View File

@ -15,7 +15,7 @@ struct Sequence;
/**
* Callback format for the for_each function below.
*/
typedef bool (*SeqForEachFunc)(Sequence *seq, void *user_data);
using SeqForEachFunc = bool (*)(Sequence *seq, void *user_data);
/**
* Utility function to recursively iterate through all sequence strips in a `seqbase` list.

View File

@ -28,28 +28,26 @@ bool SEQ_transform_seqbase_shuffle_ex(ListBase *seqbasep,
Sequence *test,
Scene *evil_scene,
int channel_delta);
bool SEQ_transform_seqbase_shuffle(struct ListBase *seqbasep,
struct Sequence *test,
struct Scene *evil_scene);
bool SEQ_transform_seqbase_shuffle(ListBase *seqbasep, Sequence *test, Scene *evil_scene);
bool SEQ_transform_seqbase_shuffle_time(blender::Span<Sequence *> strips_to_shuffle,
blender::Span<Sequence *> time_dependent_strips,
struct ListBase *seqbasep,
struct Scene *evil_scene,
struct ListBase *markers,
ListBase *seqbasep,
Scene *evil_scene,
ListBase *markers,
bool use_sync_markers);
bool SEQ_transform_seqbase_shuffle_time(blender::Span<Sequence *> strips_to_shuffle,
struct ListBase *seqbasep,
struct Scene *evil_scene,
struct ListBase *markers,
ListBase *seqbasep,
Scene *evil_scene,
ListBase *markers,
bool use_sync_markers);
void SEQ_transform_handle_overlap(struct Scene *scene,
struct ListBase *seqbasep,
void SEQ_transform_handle_overlap(Scene *scene,
ListBase *seqbasep,
blender::Span<Sequence *> transformed_strips,
blender::Span<Sequence *> time_dependent_strips,
bool use_sync_markers);
void SEQ_transform_handle_overlap(struct Scene *scene,
struct ListBase *seqbasep,
void SEQ_transform_handle_overlap(Scene *scene,
ListBase *seqbasep,
blender::Span<Sequence *> transformed_strips,
bool use_sync_markers);
/**
@ -126,7 +124,7 @@ void SEQ_image_preview_unit_from_px(const Scene *scene, const float co_src[2], f
* \param r_min: Minimum x and y values
* \param r_max: Maximum x and y values
*/
void SEQ_image_transform_bounding_box_from_collection(struct Scene *scene,
void SEQ_image_transform_bounding_box_from_collection(Scene *scene,
blender::Span<Sequence *> strips,
bool apply_rotation,
float r_min[2],

View File

@ -13,16 +13,17 @@
struct ImBuf;
struct Main;
struct Scene;
struct SeqCache;
struct SeqRenderData;
struct Sequence;
struct SeqCacheKey {
struct SeqCache *cache_owner;
SeqCache *cache_owner;
void *userkey;
struct SeqCacheKey *link_prev; /* Used for linking intermediate items to final frame. */
struct SeqCacheKey *link_next; /* Used for linking intermediate items to final frame. */
struct Sequence *seq;
struct SeqRenderData context;
SeqCacheKey *link_prev; /* Used for linking intermediate items to final frame. */
SeqCacheKey *link_next; /* Used for linking intermediate items to final frame. */
Sequence *seq;
SeqRenderData context;
float frame_index; /* Usually same as timeline_frame. Mapped to media for RAW entries. */
float timeline_frame; /* Only for reference - used for freeing when cache is full. */
float cost; /* In short: render time(s) divided by playback frame duration(s) */

View File

@ -8,10 +8,6 @@
* \ingroup sequencer
*/
#ifdef __cplusplus
extern "C" {
#endif
struct Scene;
/* **********************************************************************
@ -21,18 +17,10 @@ struct Scene;
* **********************************************************************
*/
void seq_anim_add_suffix(struct Scene *scene, struct anim *anim, int view_id);
void seq_multiview_name(struct Scene *scene,
int view_id,
const char *prefix,
const char *ext,
char *r_path,
size_t r_size);
void seq_anim_add_suffix(Scene *scene, anim *anim, int view_id);
void seq_multiview_name(
Scene *scene, int view_id, const char *prefix, const char *ext, char *r_path, size_t r_size);
/**
* The number of files will vary according to the stereo format.
*/
int seq_num_files(struct Scene *scene, char views_format, bool is_multiview);
#ifdef __cplusplus
}
#endif
int seq_num_files(Scene *scene, char views_format, bool is_multiview);

View File

@ -131,7 +131,7 @@ class AssetRepresentation;
}
using AssetRepresentationHandle = blender::asset_system::AssetRepresentation;
typedef void (*wmGenericUserDataFreeFn)(void *data);
using wmGenericUserDataFreeFn = void (*)(void *data);
struct wmGenericUserData {
void *data;
@ -919,17 +919,17 @@ struct wmTimer {
bool sleep;
};
typedef enum wmWarningSize {
enum wmWarningSize {
WM_WARNING_SIZE_SMALL = 0,
WM_WARNING_SIZE_LARGE,
} wmWarningSize;
};
typedef enum wmWarningPosition {
enum wmWarningPosition {
WM_WARNING_POSITION_MOUSE = 0,
WM_WARNING_POSITION_CENTER,
} wmWarningPosition;
};
typedef struct wmWarningDetails {
struct wmWarningDetails {
char title[1024];
char message[1024];
char message2[1024];
@ -942,7 +942,7 @@ typedef struct wmWarningDetails {
bool cancel_default;
bool mouse_move_quit;
bool red_alert;
} wmWarningDetails;
};
/**
* Communication/status data owned by the wmJob, and passed to the worker code when calling
@ -1074,7 +1074,7 @@ struct wmOperatorType {
/**
* If using WM_operator_confirm the following can override all parts of the dialog.
*/
void (*warning)(struct bContext *C, struct wmOperator *, wmWarningDetails *warning);
void (*warning)(bContext *C, wmOperator *, wmWarningDetails *warning);
/** RNA for properties */
StructRNA *srna;

View File

@ -39,38 +39,31 @@ struct wmWindowManager;
/* -------------------------------------------------------------------- */
/* wmGizmo */
struct wmGizmo *WM_gizmo_new_ptr(const struct wmGizmoType *gzt,
struct wmGizmoGroup *gzgroup,
struct PointerRNA *properties);
wmGizmo *WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties);
/**
* \param idname: Must be a valid gizmo type name,
* if you need to check it exists use #WM_gizmo_new_ptr
* because callers of this function don't NULL check the return value.
*/
struct wmGizmo *WM_gizmo_new(const char *idname,
struct wmGizmoGroup *gzgroup,
struct PointerRNA *properties);
wmGizmo *WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties);
/**
* \warning this doesn't check #wmGizmoMap (highlight, selection etc).
* Typical use is when freeing the windowing data,
* where caller can manage clearing selection, highlight... etc.
*/
void WM_gizmo_free(struct wmGizmo *gz);
void WM_gizmo_free(wmGizmo *gz);
/**
* Free \a gizmo and unlink from \a gizmolist.
* \a gizmolist is allowed to be NULL.
*/
void WM_gizmo_unlink(ListBase *gizmolist,
struct wmGizmoMap *gzmap,
struct wmGizmo *gz,
struct bContext *C);
void WM_gizmo_unlink(ListBase *gizmolist, wmGizmoMap *gzmap, wmGizmo *gz, bContext *C);
/**
* Remove from selection array without running callbacks.
*/
bool WM_gizmo_select_unlink(struct wmGizmoMap *gzmap, struct wmGizmo *gz);
bool WM_gizmo_select_set(struct wmGizmoMap *gzmap, struct wmGizmo *gz, bool select);
bool WM_gizmo_highlight_set(struct wmGizmoMap *gzmap, struct wmGizmo *gz);
bool WM_gizmo_select_unlink(wmGizmoMap *gzmap, wmGizmo *gz);
bool WM_gizmo_select_set(wmGizmoMap *gzmap, wmGizmo *gz, bool select);
bool WM_gizmo_highlight_set(wmGizmoMap *gzmap, wmGizmo *gz);
/**
* Special function to run from setup so gizmos start out interactive.
@ -78,68 +71,62 @@ bool WM_gizmo_highlight_set(struct wmGizmoMap *gzmap, struct wmGizmo *gz);
* We could do this when linking them,
* but this complicates things since the window update code needs to run first.
*/
void WM_gizmo_modal_set_from_setup(struct wmGizmoMap *gzmap,
struct bContext *C,
struct wmGizmo *gz,
int part_index,
const struct wmEvent *event);
void WM_gizmo_modal_set_from_setup(
wmGizmoMap *gzmap, bContext *C, wmGizmo *gz, int part_index, const wmEvent *event);
/**
* Replaces the current gizmo modal.
* The substitute gizmo start out interactive.
* It is similar to #WM_gizmo_modal_set_from_setup but without operator initialization.
*/
void WM_gizmo_modal_set_while_modal(struct wmGizmoMap *gzmap,
struct bContext *C,
struct wmGizmo *gz,
const struct wmEvent *event);
void WM_gizmo_modal_set_while_modal(wmGizmoMap *gzmap,
bContext *C,
wmGizmo *gz,
const wmEvent *event);
struct wmGizmoOpElem *WM_gizmo_operator_get(struct wmGizmo *gz, int part_index);
struct PointerRNA *WM_gizmo_operator_set(struct wmGizmo *gz,
int part_index,
struct wmOperatorType *ot,
struct IDProperty *properties);
int WM_gizmo_operator_invoke(struct bContext *C,
struct wmGizmo *gz,
struct wmGizmoOpElem *gzop,
const struct wmEvent *event);
wmGizmoOpElem *WM_gizmo_operator_get(wmGizmo *gz, int part_index);
PointerRNA *WM_gizmo_operator_set(wmGizmo *gz,
int part_index,
wmOperatorType *ot,
IDProperty *properties);
int WM_gizmo_operator_invoke(bContext *C, wmGizmo *gz, wmGizmoOpElem *gzop, const wmEvent *event);
/* Callbacks. */
void WM_gizmo_set_fn_custom_modal(struct wmGizmo *gz, wmGizmoFnModal fn);
void WM_gizmo_set_fn_custom_modal(wmGizmo *gz, wmGizmoFnModal fn);
void WM_gizmo_set_matrix_location(struct wmGizmo *gz, const float origin[3]);
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3]);
/**
* #wmGizmo.matrix utility, set the orientation by its Z axis.
*/
void WM_gizmo_set_matrix_rotation_from_z_axis(struct wmGizmo *gz, const float z_axis[3]);
void WM_gizmo_set_matrix_rotation_from_z_axis(wmGizmo *gz, const float z_axis[3]);
/**
* #wmGizmo.matrix utility, set the orientation by its Y/Z axis.
*/
void WM_gizmo_set_matrix_rotation_from_yz_axis(struct wmGizmo *gz,
void WM_gizmo_set_matrix_rotation_from_yz_axis(wmGizmo *gz,
const float y_axis[3],
const float z_axis[3]);
void WM_gizmo_set_matrix_offset_location(struct wmGizmo *gz, const float offset[3]);
void WM_gizmo_set_matrix_offset_location(wmGizmo *gz, const float offset[3]);
/**
* #wmGizmo.matrix_offset utility, set the orientation by its Z axis.
*/
void WM_gizmo_set_matrix_offset_rotation_from_z_axis(struct wmGizmo *gz, const float z_axis[3]);
void WM_gizmo_set_matrix_offset_rotation_from_z_axis(wmGizmo *gz, const float z_axis[3]);
/**
* #wmGizmo.matrix_offset utility, set the orientation by its Y/Z axis.
*/
void WM_gizmo_set_matrix_offset_rotation_from_yz_axis(struct wmGizmo *gz,
void WM_gizmo_set_matrix_offset_rotation_from_yz_axis(wmGizmo *gz,
const float y_axis[3],
const float z_axis[3]);
void WM_gizmo_set_flag(struct wmGizmo *gz, int flag, bool enable);
void WM_gizmo_set_scale(struct wmGizmo *gz, float scale);
void WM_gizmo_set_line_width(struct wmGizmo *gz, float line_width);
void WM_gizmo_set_flag(wmGizmo *gz, int flag, bool enable);
void WM_gizmo_set_scale(wmGizmo *gz, float scale);
void WM_gizmo_set_line_width(wmGizmo *gz, float line_width);
void WM_gizmo_get_color(const struct wmGizmo *gz, float color[4]);
void WM_gizmo_set_color(struct wmGizmo *gz, const float color[4]);
void WM_gizmo_get_color_highlight(const struct wmGizmo *gz, float color_hi[4]);
void WM_gizmo_set_color_highlight(struct wmGizmo *gz, const float color[4]);
void WM_gizmo_get_color(const wmGizmo *gz, float color[4]);
void WM_gizmo_set_color(wmGizmo *gz, const float color[4]);
void WM_gizmo_get_color_highlight(const wmGizmo *gz, float color_hi[4]);
void WM_gizmo_set_color_highlight(wmGizmo *gz, const float color[4]);
/**
* Leaving values NULL use values from #wmGizmo.
@ -151,25 +138,23 @@ struct WM_GizmoMatrixParams {
const float *scale_final;
};
void WM_gizmo_calc_matrix_final_params(const struct wmGizmo *gz,
const struct WM_GizmoMatrixParams *params,
void WM_gizmo_calc_matrix_final_params(const wmGizmo *gz,
const WM_GizmoMatrixParams *params,
float r_mat[4][4]);
void WM_gizmo_calc_matrix_final_no_offset(const struct wmGizmo *gz, float r_mat[4][4]);
void WM_gizmo_calc_matrix_final_no_offset(const wmGizmo *gz, float r_mat[4][4]);
void WM_gizmo_calc_matrix_final(const struct wmGizmo *gz, float r_mat[4][4]);
void WM_gizmo_calc_matrix_final(const wmGizmo *gz, float r_mat[4][4]);
/* Properties. */
void WM_gizmo_properties_create_ptr(struct PointerRNA *ptr, struct wmGizmoType *gzt);
void WM_gizmo_properties_create(struct PointerRNA *ptr, const char *gtstring);
void WM_gizmo_properties_create_ptr(PointerRNA *ptr, wmGizmoType *gzt);
void WM_gizmo_properties_create(PointerRNA *ptr, const char *gtstring);
/**
* Similar to #WM_gizmo_properties_create
* except its uses ID properties used for key-maps and macros.
*/
void WM_gizmo_properties_alloc(struct PointerRNA **ptr,
struct IDProperty **properties,
const char *gtstring);
void WM_gizmo_properties_sanitize(struct PointerRNA *ptr, bool no_context);
void WM_gizmo_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *gtstring);
void WM_gizmo_properties_sanitize(PointerRNA *ptr, bool no_context);
/**
* Set all props to their default.
*
@ -178,178 +163,165 @@ void WM_gizmo_properties_sanitize(struct PointerRNA *ptr, bool no_context);
* \note There's nothing specific to gizmos here.
* This could be made a general function.
*/
bool WM_gizmo_properties_default(struct PointerRNA *ptr, bool do_update);
bool WM_gizmo_properties_default(PointerRNA *ptr, bool do_update);
/**
* Remove all props without #PROP_SKIP_SAVE.
*/
void WM_gizmo_properties_reset(struct wmGizmo *gz);
void WM_gizmo_properties_clear(struct PointerRNA *ptr);
void WM_gizmo_properties_free(struct PointerRNA *ptr);
void WM_gizmo_properties_reset(wmGizmo *gz);
void WM_gizmo_properties_clear(PointerRNA *ptr);
void WM_gizmo_properties_free(PointerRNA *ptr);
/* `wm_gizmo_type.cc` */
const struct wmGizmoType *WM_gizmotype_find(const char *idname, bool quiet);
void WM_gizmotype_append(void (*gtfunc)(struct wmGizmoType *));
void WM_gizmotype_append_ptr(void (*gtfunc)(struct wmGizmoType *, void *), void *userdata);
bool WM_gizmotype_remove(struct bContext *C, struct Main *bmain, const char *idname);
void WM_gizmotype_remove_ptr(struct bContext *C, struct Main *bmain, struct wmGizmoType *gzt);
const wmGizmoType *WM_gizmotype_find(const char *idname, bool quiet);
void WM_gizmotype_append(void (*gtfunc)(wmGizmoType *));
void WM_gizmotype_append_ptr(void (*gtfunc)(wmGizmoType *, void *), void *userdata);
bool WM_gizmotype_remove(bContext *C, Main *bmain, const char *idname);
void WM_gizmotype_remove_ptr(bContext *C, Main *bmain, wmGizmoType *gzt);
/**
* Free but don't remove from #GHash.
*/
void WM_gizmotype_free_ptr(struct wmGizmoType *gzt);
void WM_gizmotype_free_ptr(wmGizmoType *gzt);
/**
* Caller must free.
*/
void WM_gizmotype_iter(struct GHashIterator *ghi);
void WM_gizmotype_iter(GHashIterator *ghi);
/* `wm_gizmo_group_type.cc` */
struct wmGizmoGroupType *WM_gizmogrouptype_find(const char *idname, bool quiet);
struct wmGizmoGroupType *WM_gizmogrouptype_append(void (*wtfunc)(struct wmGizmoGroupType *));
struct wmGizmoGroupType *WM_gizmogrouptype_append_ptr(void (*wtfunc)(struct wmGizmoGroupType *,
void *),
void *userdata);
wmGizmoGroupType *WM_gizmogrouptype_find(const char *idname, bool quiet);
wmGizmoGroupType *WM_gizmogrouptype_append(void (*wtfunc)(wmGizmoGroupType *));
wmGizmoGroupType *WM_gizmogrouptype_append_ptr(void (*wtfunc)(wmGizmoGroupType *, void *),
void *userdata);
/**
* Caller must free.
*/
void WM_gizmogrouptype_iter(struct GHashIterator *ghi);
void WM_gizmogrouptype_iter(GHashIterator *ghi);
/**
* Append and insert into a gizmo type-map.
* This is most common for C gizmos which are enabled by default.
*/
struct wmGizmoGroupTypeRef *WM_gizmogrouptype_append_and_link(
struct wmGizmoMapType *gzmap_type, void (*wtfunc)(struct wmGizmoGroupType *));
wmGizmoGroupTypeRef *WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_type,
void (*wtfunc)(wmGizmoGroupType *));
/* `wm_gizmo_map.cc` */
/* Dynamic Updates (for RNA runtime registration) */
void WM_gizmoconfig_update_tag_group_type_init(struct wmGizmoMapType *gzmap_type,
struct wmGizmoGroupType *gzgt);
void WM_gizmoconfig_update_tag_group_type_remove(struct wmGizmoMapType *gzmap_type,
struct wmGizmoGroupType *gzgt);
void WM_gizmoconfig_update_tag_group_type_init(wmGizmoMapType *gzmap_type, wmGizmoGroupType *gzgt);
void WM_gizmoconfig_update_tag_group_type_remove(wmGizmoMapType *gzmap_type,
wmGizmoGroupType *gzgt);
/**
* Run in case new types have been added (runs often, early exit where possible).
* Follows #WM_keyconfig_update conventions.
*/
void WM_gizmoconfig_update(struct Main *bmain);
void WM_gizmoconfig_update(Main *bmain);
void WM_gizmoconfig_update_tag_group_remove(struct wmGizmoMap *gzmap);
void WM_gizmoconfig_update_tag_group_remove(wmGizmoMap *gzmap);
/* wm_maniulator_target_props.c */
struct wmGizmoProperty *WM_gizmo_target_property_array(struct wmGizmo *gz);
struct wmGizmoProperty *WM_gizmo_target_property_at_index(struct wmGizmo *gz, int index);
struct wmGizmoProperty *WM_gizmo_target_property_find(struct wmGizmo *gz, const char *idname);
wmGizmoProperty *WM_gizmo_target_property_array(wmGizmo *gz);
wmGizmoProperty *WM_gizmo_target_property_at_index(wmGizmo *gz, int index);
wmGizmoProperty *WM_gizmo_target_property_find(wmGizmo *gz, const char *idname);
void WM_gizmo_target_property_def_rna_ptr(struct wmGizmo *gz,
const struct wmGizmoPropertyType *gz_prop_type,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
void WM_gizmo_target_property_def_rna_ptr(wmGizmo *gz,
const wmGizmoPropertyType *gz_prop_type,
PointerRNA *ptr,
PropertyRNA *prop,
int index);
void WM_gizmo_target_property_def_rna(struct wmGizmo *gz,
const char *idname,
struct PointerRNA *ptr,
const char *propname,
int index);
void WM_gizmo_target_property_def_rna(
wmGizmo *gz, const char *idname, PointerRNA *ptr, const char *propname, int index);
void WM_gizmo_target_property_def_func_ptr(struct wmGizmo *gz,
const struct wmGizmoPropertyType *gz_prop_type,
const struct wmGizmoPropertyFnParams *params);
void WM_gizmo_target_property_def_func(struct wmGizmo *gz,
void WM_gizmo_target_property_def_func_ptr(wmGizmo *gz,
const wmGizmoPropertyType *gz_prop_type,
const wmGizmoPropertyFnParams *params);
void WM_gizmo_target_property_def_func(wmGizmo *gz,
const char *idname,
const struct wmGizmoPropertyFnParams *params);
const wmGizmoPropertyFnParams *params);
void WM_gizmo_target_property_clear_rna_ptr(struct wmGizmo *gz,
const struct wmGizmoPropertyType *gz_prop_type);
void WM_gizmo_target_property_clear_rna(struct wmGizmo *gz, const char *idname);
void WM_gizmo_target_property_clear_rna_ptr(wmGizmo *gz, const wmGizmoPropertyType *gz_prop_type);
void WM_gizmo_target_property_clear_rna(wmGizmo *gz, const char *idname);
bool WM_gizmo_target_property_is_valid_any(struct wmGizmo *gz);
bool WM_gizmo_target_property_is_valid(const struct wmGizmoProperty *gz_prop);
float WM_gizmo_target_property_float_get(const struct wmGizmo *gz,
struct wmGizmoProperty *gz_prop);
void WM_gizmo_target_property_float_set(struct bContext *C,
const struct wmGizmo *gz,
struct wmGizmoProperty *gz_prop,
bool WM_gizmo_target_property_is_valid_any(wmGizmo *gz);
bool WM_gizmo_target_property_is_valid(const wmGizmoProperty *gz_prop);
float WM_gizmo_target_property_float_get(const wmGizmo *gz, wmGizmoProperty *gz_prop);
void WM_gizmo_target_property_float_set(bContext *C,
const wmGizmo *gz,
wmGizmoProperty *gz_prop,
float value);
void WM_gizmo_target_property_float_get_array(const struct wmGizmo *gz,
struct wmGizmoProperty *gz_prop,
void WM_gizmo_target_property_float_get_array(const wmGizmo *gz,
wmGizmoProperty *gz_prop,
float *value);
void WM_gizmo_target_property_float_set_array(struct bContext *C,
const struct wmGizmo *gz,
struct wmGizmoProperty *gz_prop,
void WM_gizmo_target_property_float_set_array(bContext *C,
const wmGizmo *gz,
wmGizmoProperty *gz_prop,
const float *value);
bool WM_gizmo_target_property_float_range_get(const struct wmGizmo *gz,
struct wmGizmoProperty *gz_prop,
bool WM_gizmo_target_property_float_range_get(const wmGizmo *gz,
wmGizmoProperty *gz_prop,
float range[2]);
int WM_gizmo_target_property_array_length(const struct wmGizmo *gz,
struct wmGizmoProperty *gz_prop);
int WM_gizmo_target_property_array_length(const wmGizmo *gz, wmGizmoProperty *gz_prop);
/* Definitions. */
const struct wmGizmoPropertyType *WM_gizmotype_target_property_find(const struct wmGizmoType *gzt,
const char *idname);
void WM_gizmotype_target_property_def(struct wmGizmoType *gzt,
const wmGizmoPropertyType *WM_gizmotype_target_property_find(const wmGizmoType *gzt,
const char *idname);
void WM_gizmotype_target_property_def(wmGizmoType *gzt,
const char *idname,
int data_type,
int array_length);
/* Utilities. */
void WM_gizmo_do_msg_notify_tag_refresh(struct bContext *C,
struct wmMsgSubscribeKey *msg_key,
struct wmMsgSubscribeValue *msg_val);
void WM_gizmo_do_msg_notify_tag_refresh(bContext *C,
wmMsgSubscribeKey *msg_key,
wmMsgSubscribeValue *msg_val);
/**
* Runs on the "prepare draw" pass, drawing the region clears.
*/
void WM_gizmo_target_property_subscribe_all(struct wmGizmo *gz,
struct wmMsgBus *mbus,
struct ARegion *region);
void WM_gizmo_target_property_subscribe_all(wmGizmo *gz, wmMsgBus *mbus, ARegion *region);
/**
* Auto-key function if auto-key is enabled.
*/
void WM_gizmo_target_property_anim_autokey(struct bContext *C,
const struct wmGizmo *gz,
struct wmGizmoProperty *gz_prop);
void WM_gizmo_target_property_anim_autokey(bContext *C,
const wmGizmo *gz,
wmGizmoProperty *gz_prop);
/* -------------------------------------------------------------------- */
/* wmGizmoGroup */
/* Callbacks for 'wmGizmoGroupType.setup_keymap' */
struct wmKeyMap *WM_gizmogroup_setup_keymap_generic(const struct wmGizmoGroupType *gzgt,
struct wmKeyConfig *kc);
struct wmKeyMap *WM_gizmogroup_setup_keymap_generic_select(const struct wmGizmoGroupType *gzgt,
struct wmKeyConfig *kc);
struct wmKeyMap *WM_gizmogroup_setup_keymap_generic_drag(const struct wmGizmoGroupType *gzgt,
struct wmKeyConfig *kc);
struct wmKeyMap *WM_gizmogroup_setup_keymap_generic_maybe_drag(const struct wmGizmoGroupType *gzgt,
struct wmKeyConfig *kc);
wmKeyMap *WM_gizmogroup_setup_keymap_generic(const wmGizmoGroupType *gzgt, wmKeyConfig *kc);
wmKeyMap *WM_gizmogroup_setup_keymap_generic_select(const wmGizmoGroupType *gzgt, wmKeyConfig *kc);
wmKeyMap *WM_gizmogroup_setup_keymap_generic_drag(const wmGizmoGroupType *gzgt, wmKeyConfig *kc);
wmKeyMap *WM_gizmogroup_setup_keymap_generic_maybe_drag(const wmGizmoGroupType *gzgt,
wmKeyConfig *kc);
/* Utility functions (not callbacks). */
struct wmKeyMap *WM_gizmo_keymap_generic_with_keyconfig(struct wmKeyConfig *kc);
struct wmKeyMap *WM_gizmo_keymap_generic(struct wmWindowManager *wm);
wmKeyMap *WM_gizmo_keymap_generic_with_keyconfig(wmKeyConfig *kc);
wmKeyMap *WM_gizmo_keymap_generic(wmWindowManager *wm);
struct wmKeyMap *WM_gizmo_keymap_generic_select_with_keyconfig(struct wmKeyConfig *kc);
struct wmKeyMap *WM_gizmo_keymap_generic_select(struct wmWindowManager *wm);
wmKeyMap *WM_gizmo_keymap_generic_select_with_keyconfig(wmKeyConfig *kc);
wmKeyMap *WM_gizmo_keymap_generic_select(wmWindowManager *wm);
struct wmKeyMap *WM_gizmo_keymap_generic_drag_with_keyconfig(struct wmKeyConfig *kc);
struct wmKeyMap *WM_gizmo_keymap_generic_drag(struct wmWindowManager *wm);
wmKeyMap *WM_gizmo_keymap_generic_drag_with_keyconfig(wmKeyConfig *kc);
wmKeyMap *WM_gizmo_keymap_generic_drag(wmWindowManager *wm);
struct wmKeyMap *WM_gizmo_keymap_generic_click_drag_with_keyconfig(struct wmKeyConfig *kc);
struct wmKeyMap *WM_gizmo_keymap_generic_click_drag(struct wmWindowManager *wm);
wmKeyMap *WM_gizmo_keymap_generic_click_drag_with_keyconfig(wmKeyConfig *kc);
wmKeyMap *WM_gizmo_keymap_generic_click_drag(wmWindowManager *wm);
/**
* Drag or press depending on preference.
*/
struct wmKeyMap *WM_gizmo_keymap_generic_maybe_drag_with_keyconfig(struct wmKeyConfig *kc);
struct wmKeyMap *WM_gizmo_keymap_generic_maybe_drag(struct wmWindowManager *wm);
wmKeyMap *WM_gizmo_keymap_generic_maybe_drag_with_keyconfig(wmKeyConfig *kc);
wmKeyMap *WM_gizmo_keymap_generic_maybe_drag(wmWindowManager *wm);
void WM_gizmogroup_ensure_init(const struct bContext *C, struct wmGizmoGroup *gzgroup);
void WM_gizmogroup_ensure_init(const bContext *C, wmGizmoGroup *gzgroup);
/* Sort utilities for use with 'BLI_listbase_sort'. */
@ -362,125 +334,110 @@ int WM_gizmo_cmp_temp_fl_reverse(const void *gz_a_ptr, const void *gz_b_ptr);
/**
* Creates a gizmo-map with all registered gizmos for that type
*/
struct wmGizmoMap *WM_gizmomap_new_from_type(const struct wmGizmoMapType_Params *gzmap_params);
wmGizmoMap *WM_gizmomap_new_from_type(const wmGizmoMapType_Params *gzmap_params);
/**
* Re-create the gizmos (use when changing theme settings).
*/
void WM_gizmomap_reinit(struct wmGizmoMap *gzmap);
const struct ListBase *WM_gizmomap_group_list(struct wmGizmoMap *gzmap);
struct wmGizmoGroup *WM_gizmomap_group_find(struct wmGizmoMap *gzmap, const char *idname);
struct wmGizmoGroup *WM_gizmomap_group_find_ptr(struct wmGizmoMap *gzmap,
const struct wmGizmoGroupType *gzgt);
void WM_gizmomap_reinit(wmGizmoMap *gzmap);
const ListBase *WM_gizmomap_group_list(wmGizmoMap *gzmap);
wmGizmoGroup *WM_gizmomap_group_find(wmGizmoMap *gzmap, const char *idname);
wmGizmoGroup *WM_gizmomap_group_find_ptr(wmGizmoMap *gzmap, const wmGizmoGroupType *gzgt);
eWM_GizmoFlagMapDrawStep WM_gizmomap_drawstep_from_gizmo_group(const struct wmGizmoGroup *gzgroup);
void WM_gizmomap_tag_refresh_drawstep(struct wmGizmoMap *gzmap, eWM_GizmoFlagMapDrawStep drawstep);
void WM_gizmomap_tag_refresh(struct wmGizmoMap *gzmap);
eWM_GizmoFlagMapDrawStep WM_gizmomap_drawstep_from_gizmo_group(const wmGizmoGroup *gzgroup);
void WM_gizmomap_tag_refresh_drawstep(wmGizmoMap *gzmap, eWM_GizmoFlagMapDrawStep drawstep);
void WM_gizmomap_tag_refresh(wmGizmoMap *gzmap);
bool WM_gizmomap_tag_delay_refresh_for_tweak_check(struct wmGizmoMap *gzmap);
bool WM_gizmomap_tag_delay_refresh_for_tweak_check(wmGizmoMap *gzmap);
void WM_gizmomap_draw(struct wmGizmoMap *gzmap,
const struct bContext *C,
eWM_GizmoFlagMapDrawStep drawstep);
void WM_gizmomap_add_handlers(struct ARegion *region, struct wmGizmoMap *gzmap);
void WM_gizmomap_draw(wmGizmoMap *gzmap, const bContext *C, eWM_GizmoFlagMapDrawStep drawstep);
void WM_gizmomap_add_handlers(ARegion *region, wmGizmoMap *gzmap);
/**
* Select/Deselect all selectable gizmos in \a gzmap.
* \return if selection has changed.
*
* TODO: select all by type.
*/
bool WM_gizmomap_select_all(struct bContext *C, struct wmGizmoMap *gzmap, int action);
bool WM_gizmomap_cursor_set(const struct wmGizmoMap *gzmap, struct wmWindow *win);
void WM_gizmomap_message_subscribe(const struct bContext *C,
struct wmGizmoMap *gzmap,
struct ARegion *region,
struct wmMsgBus *mbus);
bool WM_gizmomap_is_any_selected(const struct wmGizmoMap *gzmap);
struct wmGizmo *WM_gizmomap_get_modal(const struct wmGizmoMap *gzmap);
bool WM_gizmomap_select_all(bContext *C, wmGizmoMap *gzmap, int action);
bool WM_gizmomap_cursor_set(const wmGizmoMap *gzmap, wmWindow *win);
void WM_gizmomap_message_subscribe(const bContext *C,
wmGizmoMap *gzmap,
ARegion *region,
wmMsgBus *mbus);
bool WM_gizmomap_is_any_selected(const wmGizmoMap *gzmap);
wmGizmo *WM_gizmomap_get_modal(const wmGizmoMap *gzmap);
/**
* \note We could use a callback to define bounds, for now just use matrix location.
*/
bool WM_gizmomap_minmax(const struct wmGizmoMap *gzmap,
bool use_hidden,
bool use_select,
float r_min[3],
float r_max[3]);
bool WM_gizmomap_minmax(
const wmGizmoMap *gzmap, bool use_hidden, bool use_select, float r_min[3], float r_max[3]);
struct ARegion *WM_gizmomap_tooltip_init(struct bContext *C,
struct ARegion *region,
int *pass,
double *pass_delay,
bool *r_exit_on_event);
ARegion *WM_gizmomap_tooltip_init(
bContext *C, ARegion *region, int *pass, double *pass_delay, bool *r_exit_on_event);
/* -------------------------------------------------------------------- */
/* wmGizmoMapType */
struct wmGizmoMapType *WM_gizmomaptype_find(const struct wmGizmoMapType_Params *gzmap_params);
struct wmGizmoMapType *WM_gizmomaptype_ensure(const struct wmGizmoMapType_Params *gzmap_params);
wmGizmoMapType *WM_gizmomaptype_find(const wmGizmoMapType_Params *gzmap_params);
wmGizmoMapType *WM_gizmomaptype_ensure(const wmGizmoMapType_Params *gzmap_params);
struct wmGizmoGroupTypeRef *WM_gizmomaptype_group_find(struct wmGizmoMapType *gzmap_type,
const char *idname);
struct wmGizmoGroupTypeRef *WM_gizmomaptype_group_find_ptr(struct wmGizmoMapType *gzmap_type,
const struct wmGizmoGroupType *gzgt);
wmGizmoGroupTypeRef *WM_gizmomaptype_group_find(wmGizmoMapType *gzmap_type, const char *idname);
wmGizmoGroupTypeRef *WM_gizmomaptype_group_find_ptr(wmGizmoMapType *gzmap_type,
const wmGizmoGroupType *gzgt);
/**
* Use this for registering gizmos on startup.
* For runtime, use #WM_gizmomaptype_group_link_runtime.
*/
struct wmGizmoGroupTypeRef *WM_gizmomaptype_group_link(struct wmGizmoMapType *gzmap_type,
const char *idname);
struct wmGizmoGroupTypeRef *WM_gizmomaptype_group_link_ptr(struct wmGizmoMapType *gzmap_type,
struct wmGizmoGroupType *gzgt);
wmGizmoGroupTypeRef *WM_gizmomaptype_group_link(wmGizmoMapType *gzmap_type, const char *idname);
wmGizmoGroupTypeRef *WM_gizmomaptype_group_link_ptr(wmGizmoMapType *gzmap_type,
wmGizmoGroupType *gzgt);
void WM_gizmomaptype_group_init_runtime_keymap(const struct Main *bmain,
struct wmGizmoGroupType *gzgt);
void WM_gizmomaptype_group_init_runtime(const struct Main *bmain,
struct wmGizmoMapType *gzmap_type,
struct wmGizmoGroupType *gzgt);
wmGizmoGroup *WM_gizmomaptype_group_init_runtime_with_region(struct wmGizmoMapType *gzmap_type,
struct wmGizmoGroupType *gzgt,
struct ARegion *region);
void WM_gizmomaptype_group_unlink(struct bContext *C,
struct Main *bmain,
struct wmGizmoMapType *gzmap_type,
const struct wmGizmoGroupType *gzgt);
void WM_gizmomaptype_group_init_runtime_keymap(const Main *bmain, wmGizmoGroupType *gzgt);
void WM_gizmomaptype_group_init_runtime(const Main *bmain,
wmGizmoMapType *gzmap_type,
wmGizmoGroupType *gzgt);
wmGizmoGroup *WM_gizmomaptype_group_init_runtime_with_region(wmGizmoMapType *gzmap_type,
wmGizmoGroupType *gzgt,
ARegion *region);
void WM_gizmomaptype_group_unlink(bContext *C,
Main *bmain,
wmGizmoMapType *gzmap_type,
const wmGizmoGroupType *gzgt);
/**
* Unlike #WM_gizmomaptype_group_unlink this doesn't maintain correct state, simply free.
*/
void WM_gizmomaptype_group_free(struct wmGizmoGroupTypeRef *gzgt);
void WM_gizmomaptype_group_free(wmGizmoGroupTypeRef *gzgt);
/* -------------------------------------------------------------------- */
/* GizmoGroup */
/* Add/Ensure/Remove (High level API) */
void WM_gizmo_group_type_add_ptr_ex(struct wmGizmoGroupType *gzgt,
struct wmGizmoMapType *gzmap_type);
void WM_gizmo_group_type_add_ptr(struct wmGizmoGroupType *gzgt);
void WM_gizmo_group_type_add_ptr_ex(wmGizmoGroupType *gzgt, wmGizmoMapType *gzmap_type);
void WM_gizmo_group_type_add_ptr(wmGizmoGroupType *gzgt);
void WM_gizmo_group_type_add(const char *idname);
bool WM_gizmo_group_type_ensure_ptr_ex(struct wmGizmoGroupType *gzgt,
struct wmGizmoMapType *gzmap_type);
bool WM_gizmo_group_type_ensure_ptr(struct wmGizmoGroupType *gzgt);
bool WM_gizmo_group_type_ensure_ptr_ex(wmGizmoGroupType *gzgt, wmGizmoMapType *gzmap_type);
bool WM_gizmo_group_type_ensure_ptr(wmGizmoGroupType *gzgt);
bool WM_gizmo_group_type_ensure(const char *idname);
/**
* Call #WM_gizmo_group_type_free_ptr after to remove & free.
*/
void WM_gizmo_group_type_remove_ptr_ex(struct Main *bmain,
struct wmGizmoGroupType *gzgt,
struct wmGizmoMapType *gzmap_type);
void WM_gizmo_group_type_remove_ptr(struct Main *bmain, struct wmGizmoGroupType *gzgt);
void WM_gizmo_group_type_remove(struct Main *bmain, const char *idname);
void WM_gizmo_group_type_remove_ptr_ex(Main *bmain,
wmGizmoGroupType *gzgt,
wmGizmoMapType *gzmap_type);
void WM_gizmo_group_type_remove_ptr(Main *bmain, wmGizmoGroupType *gzgt);
void WM_gizmo_group_type_remove(Main *bmain, const char *idname);
void WM_gizmo_group_type_unlink_delayed_ptr_ex(struct wmGizmoGroupType *gzgt,
struct wmGizmoMapType *gzmap_type);
void WM_gizmo_group_type_unlink_delayed_ptr(struct wmGizmoGroupType *gzgt);
void WM_gizmo_group_type_unlink_delayed_ptr_ex(wmGizmoGroupType *gzgt, wmGizmoMapType *gzmap_type);
void WM_gizmo_group_type_unlink_delayed_ptr(wmGizmoGroupType *gzgt);
void WM_gizmo_group_type_unlink_delayed(const char *idname);
void WM_gizmo_group_unlink_delayed_ptr_from_space(struct wmGizmoGroupType *gzgt,
struct wmGizmoMapType *gzmap_type,
struct ScrArea *area);
void WM_gizmo_group_unlink_delayed_ptr_from_space(wmGizmoGroupType *gzgt,
wmGizmoMapType *gzmap_type,
ScrArea *area);
void WM_gizmo_group_type_free_ptr(wmGizmoGroupType *gzgt);
bool WM_gizmo_group_type_free(const char *idname);
@ -488,24 +445,24 @@ bool WM_gizmo_group_type_free(const char *idname);
/**
* Has the result of unlinking and linking (re-initializes gizmo's).
*/
void WM_gizmo_group_type_reinit_ptr_ex(struct Main *bmain,
struct wmGizmoGroupType *gzgt,
struct wmGizmoMapType *gzmap_type);
void WM_gizmo_group_type_reinit_ptr(struct Main *bmain, struct wmGizmoGroupType *gzgt);
void WM_gizmo_group_type_reinit(struct Main *bmain, const char *idname);
void WM_gizmo_group_type_reinit_ptr_ex(Main *bmain,
wmGizmoGroupType *gzgt,
wmGizmoMapType *gzmap_type);
void WM_gizmo_group_type_reinit_ptr(Main *bmain, wmGizmoGroupType *gzgt);
void WM_gizmo_group_type_reinit(Main *bmain, const char *idname);
/* Utilities */
bool WM_gizmo_context_check_drawstep(const struct bContext *C, eWM_GizmoFlagMapDrawStep step);
bool WM_gizmo_context_check_drawstep(const bContext *C, eWM_GizmoFlagMapDrawStep step);
void WM_gizmo_group_remove_by_tool(struct bContext *C,
struct Main *bmain,
const struct wmGizmoGroupType *gzgt,
const struct bToolRef *tref);
void WM_gizmo_group_remove_by_tool(bContext *C,
Main *bmain,
const wmGizmoGroupType *gzgt,
const bToolRef *tref);
void WM_gizmo_group_tag_remove(struct wmGizmoGroup *gzgroup);
void WM_gizmo_group_tag_remove(wmGizmoGroup *gzgroup);
/* Wrap Group Type Callbacks. */
bool WM_gizmo_group_type_poll(const struct bContext *C, const struct wmGizmoGroupType *gzgt);
void WM_gizmo_group_refresh(const struct bContext *C, struct wmGizmoGroup *gzgroup);
bool WM_gizmo_group_type_poll(const bContext *C, const wmGizmoGroupType *gzgt);
void WM_gizmo_group_refresh(const bContext *C, wmGizmoGroup *gzgroup);

View File

@ -19,11 +19,15 @@
#include "DNA_listBase.h"
struct wmGizmo;
struct wmGizmoType;
struct wmGizmoGroup;
struct wmGizmoGroupType;
struct wmGizmoMap;
struct wmGizmoMapType;
struct wmGizmoProperty;
struct wmGizmoPropertyType;
struct wmKeyConfig;
struct wmOperatorType;
/* -------------------------------------------------------------------- */
/* Enum Typedef's */
@ -31,20 +35,20 @@ struct wmKeyConfig;
/**
* #wmGizmo.state
*/
typedef enum eWM_GizmoFlagState {
enum eWM_GizmoFlagState {
/** While hovered. */
WM_GIZMO_STATE_HIGHLIGHT = (1 << 0),
/** While dragging. */
WM_GIZMO_STATE_MODAL = (1 << 1),
WM_GIZMO_STATE_SELECT = (1 << 2),
} eWM_GizmoFlagState;
};
ENUM_OPERATORS(eWM_GizmoFlagState, WM_GIZMO_STATE_SELECT)
/**
* #wmGizmo.flag
* Flags for individual gizmos.
*/
typedef enum eWM_GizmoFlag {
enum eWM_GizmoFlag {
/** Draw *only* while hovering. */
WM_GIZMO_DRAW_HOVER = (1 << 0),
/** Draw while dragging. */
@ -80,7 +84,7 @@ typedef enum eWM_GizmoFlag {
/** Don't use tool-tips for this gizmo (can be distracting). */
WM_GIZMO_NO_TOOLTIP = (1 << 12),
} eWM_GizmoFlag;
};
ENUM_OPERATORS(eWM_GizmoFlag, WM_GIZMO_NO_TOOLTIP);
@ -88,7 +92,7 @@ ENUM_OPERATORS(eWM_GizmoFlag, WM_GIZMO_NO_TOOLTIP);
* #wmGizmoGroupType.flag
* Flags that influence the behavior of all gizmos in the group.
*/
typedef enum eWM_GizmoFlagGroupTypeFlag {
enum eWM_GizmoFlagGroupTypeFlag {
/** Mark gizmo-group as being 3D */
WM_GIZMOGROUPTYPE_3D = (1 << 0),
/** Scale gizmos as 3D object that respects zoom (otherwise zoom independent draw size).
@ -146,25 +150,25 @@ typedef enum eWM_GizmoFlagGroupTypeFlag {
* however for VR it's sometimes needed.
*/
WM_GIZMOGROUPTYPE_VR_REDRAWS = (1 << 10),
} eWM_GizmoFlagGroupTypeFlag;
};
ENUM_OPERATORS(eWM_GizmoFlagGroupTypeFlag, WM_GIZMOGROUPTYPE_VR_REDRAWS);
/**
* #wmGizmoGroup.init_flag
*/
typedef enum eWM_GizmoFlagGroupInitFlag {
enum eWM_GizmoFlagGroupInitFlag {
/** Gizmo-group has been initialized. */
WM_GIZMOGROUP_INIT_SETUP = (1 << 0),
WM_GIZMOGROUP_INIT_REFRESH = (1 << 1),
} eWM_GizmoFlagGroupInitFlag;
};
ENUM_OPERATORS(eWM_GizmoFlagGroupInitFlag, WM_GIZMOGROUP_INIT_REFRESH)
/**
* #wmGizmoMapType.type_update_flag
* Gizmo-map type update flag
*/
typedef enum eWM_GizmoFlagMapTypeUpdateFlag {
enum eWM_GizmoFlagMapTypeUpdateFlag {
/** A new type has been added, needs to be initialized for all views. */
WM_GIZMOMAPTYPE_UPDATE_INIT = (1 << 0),
WM_GIZMOMAPTYPE_UPDATE_REMOVE = (1 << 1),
@ -172,7 +176,7 @@ typedef enum eWM_GizmoFlagMapTypeUpdateFlag {
/** Needed because keymap may be registered before and after window initialization.
* So we need to keep track of keymap initialization separately. */
WM_GIZMOMAPTYPE_KEYMAP_INIT = (1 << 2),
} eWM_GizmoFlagMapTypeUpdateFlag;
};
ENUM_OPERATORS(eWM_GizmoFlagMapTypeUpdateFlag, WM_GIZMOMAPTYPE_KEYMAP_INIT)
/* -------------------------------------------------------------------- */
@ -184,45 +188,45 @@ ENUM_OPERATORS(eWM_GizmoFlagMapTypeUpdateFlag, WM_GIZMOMAPTYPE_KEYMAP_INIT)
*
* \note Gizmos are responsible for handling this #wmGizmo.modal callback.
*/
typedef enum {
enum eWM_GizmoFlagTweak {
/* Drag with extra precision (Shift). */
WM_GIZMO_TWEAK_PRECISE = (1 << 0),
/* Drag with snap enabled (Ctrl). */
WM_GIZMO_TWEAK_SNAP = (1 << 1),
} eWM_GizmoFlagTweak;
};
#include "wm_gizmo_fn.hh"
typedef struct wmGizmoOpElem {
struct wmOperatorType *type;
struct wmGizmoOpElem {
wmOperatorType *type;
/** Operator properties if gizmo spawns and controls an operator,
* or owner pointer if gizmo spawns and controls a property. */
PointerRNA ptr;
bool is_redo;
} wmGizmoOpElem;
};
/* gizmos are set per region by registering them on gizmo-maps */
struct wmGizmo {
struct wmGizmo *next, *prev;
wmGizmo *next, *prev;
/** While we don't have a real type, use this to put type-like vars. */
const struct wmGizmoType *type;
const wmGizmoType *type;
/** Overrides 'type->modal' when set.
* Note that this is a workaround, remove if we can. */
wmGizmoFnModal custom_modal;
/** Pointer back to group this gizmo is in (just for quick access). */
struct wmGizmoGroup *parent_gzgroup;
wmGizmoGroup *parent_gzgroup;
/** Optional keymap to use for this gizmo (overrides #wmGizmoGroupType.keymap) */
struct wmKeyMap *keymap;
wmKeyMap *keymap;
void *py_instance;
/** Rna pointer to access properties. */
struct PointerRNA *ptr;
PointerRNA *ptr;
/** Flags that influence the behavior or how the gizmos are drawn. */
eWM_GizmoFlag flag;
@ -274,7 +278,7 @@ struct wmGizmo {
wmGizmoOpElem *op_data;
int op_data_len;
struct IDProperty *properties;
IDProperty *properties;
/** Redraw tag. */
bool do_draw;
@ -288,8 +292,8 @@ struct wmGizmo {
};
/** Similar to #PropertyElemRNA, but has an identifier. */
typedef struct wmGizmoProperty {
const struct wmGizmoPropertyType *type;
struct wmGizmoProperty {
const wmGizmoPropertyType *type;
PointerRNA ptr;
PropertyRNA *prop;
@ -303,10 +307,10 @@ typedef struct wmGizmoProperty {
wmGizmoPropertyFnFree free_fn;
void *user_data;
} custom_func;
} wmGizmoProperty;
};
typedef struct wmGizmoPropertyType {
struct wmGizmoPropertyType *next, *prev;
struct wmGizmoPropertyType {
wmGizmoPropertyType *next, *prev;
/** #PropertyType, typically #PROP_FLOAT. */
int data_type;
int array_length;
@ -316,21 +320,21 @@ typedef struct wmGizmoPropertyType {
/** over alloc. */
char idname[0];
} wmGizmoPropertyType;
};
/**
* Simple utility wrapper for storing a single gizmo as wmGizmoGroup.customdata (which gets freed).
*/
typedef struct wmGizmoWrapper {
struct wmGizmo *gizmo;
} wmGizmoWrapper;
struct wmGizmoWrapper {
wmGizmo *gizmo;
};
struct wmGizmoMapType_Params {
short spaceid;
short regionid;
};
typedef struct wmGizmoType {
struct wmGizmoType {
const char *idname; /* MAX_NAME */
@ -389,27 +393,26 @@ typedef struct wmGizmoType {
wmGizmoFnFree free;
/** RNA for properties. */
struct StructRNA *srna;
StructRNA *srna;
/** RNA integration. */
ExtensionRNA rna_ext;
ListBase target_property_defs;
int target_property_defs_len;
} wmGizmoType;
};
/* -------------------------------------------------------------------- */
/* wmGizmoGroup */
/** Factory class for a gizmo-group type, gets called every time a new area is spawned. */
typedef struct wmGizmoGroupTypeRef {
struct wmGizmoGroupTypeRef *next, *prev;
struct wmGizmoGroupType *type;
} wmGizmoGroupTypeRef;
struct wmGizmoGroupTypeRef {
wmGizmoGroupTypeRef *next, *prev;
wmGizmoGroupType *type;
};
/* factory class for a gizmo-group type, gets called every time a new area is spawned */
typedef struct wmGizmoGroupType {
struct wmGizmoGroupType {
const char *idname; /* MAX_NAME */
/** Gizmo-group name - displayed in UI (keymap editor). */
const char *name;
@ -436,15 +439,15 @@ typedef struct wmGizmoGroupType {
wmGizmoGroupFnMsgBusSubscribe message_subscribe;
/** Keymap created with callback from above. */
struct wmKeyMap *keymap;
wmKeyMap *keymap;
/** Only for convenient removal. */
struct wmKeyConfig *keyconf;
wmKeyConfig *keyconf;
/* NOTE: currently gizmo-group instances don't store properties,
* they're kept in the tool properties. */
/** RNA for properties. */
struct StructRNA *srna;
StructRNA *srna;
/** RNA integration. */
ExtensionRNA rna_ext;
@ -455,28 +458,27 @@ typedef struct wmGizmoGroupType {
eWM_GizmoFlagMapTypeUpdateFlag type_update_flag;
/** Same as gizmo-maps, so registering/unregistering goes to the correct region. */
struct wmGizmoMapType_Params gzmap_params;
wmGizmoMapType_Params gzmap_params;
/**
* Number of #wmGizmoGroup instances.
* Decremented when 'tag_remove' is set, or when removed.
*/
int users;
};
} wmGizmoGroupType;
struct wmGizmoGroup {
wmGizmoGroup *next, *prev;
typedef struct wmGizmoGroup {
struct wmGizmoGroup *next, *prev;
struct wmGizmoGroupType *type;
wmGizmoGroupType *type;
ListBase gizmos;
struct wmGizmoMap *parent_gzmap;
wmGizmoMap *parent_gzmap;
/** Python stores the class instance here. */
void *py_instance;
/** Errors and warnings storage. */
struct ReportList *reports;
ReportList *reports;
/** Has the same result as hiding all gizmos individually. */
union {
@ -494,7 +496,7 @@ typedef struct wmGizmoGroup {
/** For freeing customdata from above. */
void (*customdata_free)(void *);
eWM_GizmoFlagGroupInitFlag init_flag;
} wmGizmoGroup;
};
/* -------------------------------------------------------------------- */
/* wmGizmoMap */
@ -502,10 +504,10 @@ typedef struct wmGizmoGroup {
/**
* Pass a value of this enum to #WM_gizmomap_draw to tell it what to draw.
*/
typedef enum eWM_GizmoFlagMapDrawStep {
enum eWM_GizmoFlagMapDrawStep {
/** Draw 2D gizmo-groups (#WM_GIZMOGROUPTYPE_3D not set). */
WM_GIZMOMAP_DRAWSTEP_2D = 0,
/** Draw 3D gizmo-groups (#WM_GIZMOGROUPTYPE_3D set). */
WM_GIZMOMAP_DRAWSTEP_3D,
} eWM_GizmoFlagMapDrawStep;
};
#define WM_GIZMOMAP_DRAWSTEP_MAX 2

View File

@ -14,10 +14,6 @@ struct wmKeyConfig;
#include "wm_gizmo_fn.hh"
#ifdef __cplusplus
extern "C" {
#endif
/* -------------------------------------------------------------------- */
/* wmGizmo */
@ -28,13 +24,13 @@ extern "C" {
* \return if the selection has changed.
*/
bool wm_gizmo_select_set_ex(
struct wmGizmoMap *gzmap, struct wmGizmo *gz, bool select, bool use_array, bool use_callback);
bool wm_gizmo_select_and_highlight(bContext *C, struct wmGizmoMap *gzmap, struct wmGizmo *gz);
wmGizmoMap *gzmap, wmGizmo *gz, bool select, bool use_array, bool use_callback);
bool wm_gizmo_select_and_highlight(bContext *C, wmGizmoMap *gzmap, wmGizmo *gz);
void wm_gizmo_calculate_scale(struct wmGizmo *gz, const bContext *C);
void wm_gizmo_update(struct wmGizmo *gz, const bContext *C, bool refresh_map);
void wm_gizmo_calculate_scale(wmGizmo *gz, const bContext *C);
void wm_gizmo_update(wmGizmo *gz, const bContext *C, bool refresh_map);
int wm_gizmo_is_visible(struct wmGizmo *gz);
int wm_gizmo_is_visible(wmGizmo *gz);
enum {
WM_GIZMO_IS_VISIBLE_UPDATE = (1 << 0),
WM_GIZMO_IS_VISIBLE_DRAW = (1 << 1),
@ -55,47 +51,44 @@ enum {
/**
* Create a new gizmo-group from \a gzgt.
*/
struct wmGizmoGroup *wm_gizmogroup_new_from_type(struct wmGizmoMap *gzmap,
struct wmGizmoGroupType *gzgt);
void wm_gizmogroup_free(bContext *C, struct wmGizmoGroup *gzgroup);
wmGizmoGroup *wm_gizmogroup_new_from_type(wmGizmoMap *gzmap, wmGizmoGroupType *gzgt);
void wm_gizmogroup_free(bContext *C, wmGizmoGroup *gzgroup);
/**
* Add \a gizmo to \a gzgroup and make sure its name is unique within the group.
*/
void wm_gizmogroup_gizmo_register(struct wmGizmoGroup *gzgroup, struct wmGizmo *gz);
struct wmGizmoGroup *wm_gizmogroup_find_by_type(const struct wmGizmoMap *gzmap,
const struct wmGizmoGroupType *gzgt);
struct wmGizmo *wm_gizmogroup_find_intersected_gizmo(wmWindowManager *wm,
const struct wmGizmoGroup *gzgroup,
struct bContext *C,
int event_modifier,
const int mval[2],
int *r_part);
void wm_gizmogroup_gizmo_register(wmGizmoGroup *gzgroup, wmGizmo *gz);
wmGizmoGroup *wm_gizmogroup_find_by_type(const wmGizmoMap *gzmap, const wmGizmoGroupType *gzgt);
wmGizmo *wm_gizmogroup_find_intersected_gizmo(wmWindowManager *wm,
const wmGizmoGroup *gzgroup,
bContext *C,
int event_modifier,
const int mval[2],
int *r_part);
/**
* Adds all gizmos of \a gzgroup that can be selected to the head of \a listbase.
* Added items need freeing!
*/
void wm_gizmogroup_intersectable_gizmos_to_list(wmWindowManager *wm,
const struct wmGizmoGroup *gzgroup,
const wmGizmoGroup *gzgroup,
int event_modifier,
struct BLI_Buffer *visible_gizmos);
bool wm_gizmogroup_is_visible_in_drawstep(const struct wmGizmoGroup *gzgroup,
BLI_Buffer *visible_gizmos);
bool wm_gizmogroup_is_visible_in_drawstep(const wmGizmoGroup *gzgroup,
eWM_GizmoFlagMapDrawStep drawstep);
void wm_gizmogrouptype_setup_keymap(struct wmGizmoGroupType *gzgt, struct wmKeyConfig *keyconf);
void wm_gizmogrouptype_setup_keymap(wmGizmoGroupType *gzgt, wmKeyConfig *keyconf);
wmKeyMap *wm_gizmogroup_tweak_modal_keymap(struct wmKeyConfig *keyconf);
wmKeyMap *wm_gizmogroup_tweak_modal_keymap(wmKeyConfig *keyconf);
/* -------------------------------------------------------------------- */
/* wmGizmoMap */
typedef struct wmGizmoMapSelectState {
struct wmGizmoMapSelectState {
struct wmGizmo **items;
int len, len_alloc;
} wmGizmoMapSelectState;
};
struct wmGizmoMap {
struct wmGizmoMapType *type;
wmGizmoMapType *type;
ListBase groups; /* wmGizmoGroup */
/* private, update tagging (enum defined in C source). */
@ -115,11 +108,11 @@ struct wmGizmoMap {
*/
struct {
/* we redraw the gizmo-map when this changes */
struct wmGizmo *highlight;
wmGizmo *highlight;
/* User has clicked this gizmo and it gets all input. */
struct wmGizmo *modal;
wmGizmo *modal;
/* array for all selected gizmos */
struct wmGizmoMapSelectState select;
wmGizmoMapSelectState select;
/* cursor location at point of entering modal (see: WM_GIZMO_MOVE_CURSOR) */
int event_xy[2];
short event_grabcursor;
@ -135,7 +128,7 @@ struct wmGizmoMap {
* \note There is only ever one of these for every (area, region) combination.
*/
struct wmGizmoMapType {
struct wmGizmoMapType *next, *prev;
wmGizmoMapType *next, *prev;
short spaceid, regionid;
/* types of gizmo-groups for this gizmo-map type */
ListBase grouptype_refs;
@ -144,16 +137,12 @@ struct wmGizmoMapType {
eWM_GizmoFlagMapTypeUpdateFlag type_update_flag;
};
void wm_gizmomap_select_array_clear(struct wmGizmoMap *gzmap);
void wm_gizmomap_select_array_clear(wmGizmoMap *gzmap);
/**
* Deselect all selected gizmos in \a gzmap.
* \return if selection has changed.
*/
bool wm_gizmomap_deselect_all(struct wmGizmoMap *gzmap);
void wm_gizmomap_select_array_shrink(struct wmGizmoMap *gzmap, int len_subtract);
void wm_gizmomap_select_array_push_back(struct wmGizmoMap *gzmap, wmGizmo *gz);
void wm_gizmomap_select_array_remove(struct wmGizmoMap *gzmap, wmGizmo *gz);
#ifdef __cplusplus
}
#endif
bool wm_gizmomap_deselect_all(wmGizmoMap *gzmap);
void wm_gizmomap_select_array_shrink(wmGizmoMap *gzmap, int len_subtract);
void wm_gizmomap_select_array_push_back(wmGizmoMap *gzmap, wmGizmo *gz);
void wm_gizmomap_select_array_remove(wmGizmoMap *gzmap, wmGizmo *gz);

View File

@ -12,65 +12,57 @@
#include "BLI_compiler_attrs.h"
struct wmKeyMap;
struct wmMsgBus;
/* wmGizmoGroup */
typedef bool (*wmGizmoGroupFnPoll)(const struct bContext *,
struct wmGizmoGroupType *) ATTR_WARN_UNUSED_RESULT;
typedef void (*wmGizmoGroupFnInit)(const struct bContext *, struct wmGizmoGroup *);
typedef void (*wmGizmoGroupFnRefresh)(const struct bContext *, struct wmGizmoGroup *);
typedef void (*wmGizmoGroupFnDrawPrepare)(const struct bContext *, struct wmGizmoGroup *);
typedef void (*wmGizmoGroupFnInvokePrepare)(const struct bContext *,
struct wmGizmoGroup *,
struct wmGizmo *,
const struct wmEvent *);
typedef struct wmKeyMap *(*wmGizmoGroupFnSetupKeymap)(const struct wmGizmoGroupType *,
struct wmKeyConfig *)ATTR_WARN_UNUSED_RESULT;
typedef void (*wmGizmoGroupFnMsgBusSubscribe)(const struct bContext *,
struct wmGizmoGroup *,
struct wmMsgBus *);
using wmGizmoGroupFnPoll = bool (*)(const bContext *, wmGizmoGroupType *);
using wmGizmoGroupFnInit = void (*)(const bContext *, wmGizmoGroup *);
using wmGizmoGroupFnRefresh = void (*)(const bContext *, wmGizmoGroup *);
using wmGizmoGroupFnDrawPrepare = void (*)(const bContext *, wmGizmoGroup *);
using wmGizmoGroupFnInvokePrepare = void (*)(const bContext *,
wmGizmoGroup *,
wmGizmo *,
const wmEvent *);
using wmGizmoGroupFnSetupKeymap = wmKeyMap *(*)(const wmGizmoGroupType *, wmKeyConfig *);
using wmGizmoGroupFnMsgBusSubscribe = void (*)(const bContext *, wmGizmoGroup *, wmMsgBus *);
/* wmGizmo */
/* See: wmGizmoType for docs on each type. */
typedef void (*wmGizmoFnSetup)(struct wmGizmo *);
typedef void (*wmGizmoFnDraw)(const struct bContext *, struct wmGizmo *);
typedef void (*wmGizmoFnDrawSelect)(const struct bContext *, struct wmGizmo *, int);
typedef int (*wmGizmoFnTestSelect)(struct bContext *, struct wmGizmo *, const int mval[2]);
typedef int (*wmGizmoFnModal)(struct bContext *,
struct wmGizmo *,
const struct wmEvent *,
eWM_GizmoFlagTweak);
typedef void (*wmGizmoFnPropertyUpdate)(struct wmGizmo *, struct wmGizmoProperty *);
typedef void (*wmGizmoFnMatrixBasisGet)(const struct wmGizmo *, float[4][4]);
typedef int (*wmGizmoFnInvoke)(struct bContext *, struct wmGizmo *, const struct wmEvent *);
typedef void (*wmGizmoFnExit)(struct bContext *, struct wmGizmo *, const bool);
typedef int (*wmGizmoFnCursorGet)(struct wmGizmo *);
typedef bool (*wmGizmoFnScreenBoundsGet)(struct bContext *,
struct wmGizmo *,
rcti *r_bounding_box) ATTR_WARN_UNUSED_RESULT;
typedef void (*wmGizmoFnSelectRefresh)(struct wmGizmo *);
typedef void (*wmGizmoFnFree)(struct wmGizmo *);
using wmGizmoFnSetup = void (*)(wmGizmo *);
using wmGizmoFnDraw = void (*)(const bContext *, wmGizmo *);
using wmGizmoFnDrawSelect = void (*)(const bContext *, wmGizmo *, int);
using wmGizmoFnTestSelect = int (*)(bContext *, wmGizmo *, const int mval[2]);
using wmGizmoFnModal = int (*)(bContext *, wmGizmo *, const wmEvent *, eWM_GizmoFlagTweak);
using wmGizmoFnPropertyUpdate = void (*)(wmGizmo *, wmGizmoProperty *);
using wmGizmoFnMatrixBasisGet = void (*)(const wmGizmo *, float[4][4]);
using wmGizmoFnInvoke = int (*)(bContext *, wmGizmo *, const wmEvent *);
using wmGizmoFnExit = void (*)(bContext *, wmGizmo *, const bool);
using wmGizmoFnCursorGet = int (*)(wmGizmo *);
using wmGizmoFnScreenBoundsGet = bool (*)(bContext *, wmGizmo *, rcti *r_bounding_box);
using wmGizmoFnSelectRefresh = void (*)(wmGizmo *);
using wmGizmoFnFree = void (*)(wmGizmo *);
/* wmGizmoProperty ('value' type defined by 'wmGizmoProperty.data_type') */
typedef void (*wmGizmoPropertyFnGet)(const struct wmGizmo *,
struct wmGizmoProperty *,
/* typically 'float *' */
void *value);
typedef void (*wmGizmoPropertyFnSet)(const struct wmGizmo *,
struct wmGizmoProperty *,
/* typically 'const float *' */
const void *value);
typedef void (*wmGizmoPropertyFnRangeGet)(const struct wmGizmo *,
struct wmGizmoProperty *,
/* typically 'float[2]' */
void *range);
typedef void (*wmGizmoPropertyFnFree)(const struct wmGizmo *, struct wmGizmoProperty *);
using wmGizmoPropertyFnGet = void (*)(const wmGizmo *,
wmGizmoProperty *,
/* typically 'float *' */
void *value);
using wmGizmoPropertyFnSet = void (*)(const wmGizmo *,
wmGizmoProperty *,
/* typically 'const float *' */
const void *value);
using wmGizmoPropertyFnRangeGet = void (*)(const wmGizmo *,
wmGizmoProperty *,
/* typically 'float[2]' */
void *range);
using wmGizmoPropertyFnFree = void (*)(const wmGizmo *, wmGizmoProperty *);
typedef struct wmGizmoPropertyFnParams {
struct wmGizmoPropertyFnParams {
wmGizmoPropertyFnGet value_get_fn;
wmGizmoPropertyFnSet value_set_fn;
wmGizmoPropertyFnRangeGet range_get_fn;
wmGizmoPropertyFnFree free_fn;
void *user_data;
} wmGizmoPropertyFnParams;
};

View File

@ -26,19 +26,19 @@ struct wmOperatorType;
/* `wm_gizmo_type.cc`, for init/exit */
void wm_gizmotype_free(void);
void wm_gizmotype_free();
/**
* Called on initialize #WM_init().
*/
void wm_gizmotype_init(void);
void wm_gizmotype_init();
/* wm_gizmogroup_type.c, for init/exit */
void wm_gizmogrouptype_free(void);
void wm_gizmogrouptype_free();
/**
* Called on initialize #WM_init().
*/
void wm_gizmogrouptype_init(void);
void wm_gizmogrouptype_init();
/** \} */
@ -46,10 +46,10 @@ void wm_gizmogrouptype_init(void);
/** \name #wmGizmoGroup
* \{ */
void GIZMOGROUP_OT_gizmo_select(struct wmOperatorType *ot);
void GIZMOGROUP_OT_gizmo_tweak(struct wmOperatorType *ot);
void GIZMOGROUP_OT_gizmo_select(wmOperatorType *ot);
void GIZMOGROUP_OT_gizmo_tweak(wmOperatorType *ot);
bool wm_gizmogroup_is_any_selected(const struct wmGizmoGroup *gzgroup);
bool wm_gizmogroup_is_any_selected(const wmGizmoGroup *gzgroup);
/** \} */
@ -57,48 +57,40 @@ bool wm_gizmogroup_is_any_selected(const struct wmGizmoGroup *gzgroup);
/** \name #wmGizmoMap
* \{ */
void wm_gizmomap_remove(struct wmGizmoMap *gzmap);
void wm_gizmomap_remove(wmGizmoMap *gzmap);
/**
* Initialize key-maps for all existing gizmo-groups
*/
void wm_gizmos_keymap(struct wmKeyConfig *keyconf);
void wm_gizmos_keymap(wmKeyConfig *keyconf);
void wm_gizmomaps_handled_modal_update(bContext *C,
struct wmEvent *event,
struct wmEventHandler_Op *handler);
void wm_gizmomaps_handled_modal_update(bContext *C, wmEvent *event, wmEventHandler_Op *handler);
/**
* Prepare context for gizmo handling (but only if area/region is
* part of screen). Version of #wm_handler_op_context for gizmos.
*/
void wm_gizmomap_handler_context_op(bContext *C, struct wmEventHandler_Op *handler);
void wm_gizmomap_handler_context_gizmo(bContext *C, struct wmEventHandler_Gizmo *handler);
void wm_gizmomap_handler_context_op(bContext *C, wmEventHandler_Op *handler);
void wm_gizmomap_handler_context_gizmo(bContext *C, wmEventHandler_Gizmo *handler);
/**
* Try to find a gizmo under the mouse position. 2D intersections have priority over
* 3D ones (could check for smallest screen-space distance but not needed right now).
*/
struct wmGizmo *wm_gizmomap_highlight_find(struct wmGizmoMap *gzmap,
bContext *C,
const struct wmEvent *event,
int *r_part);
bool wm_gizmomap_highlight_set(struct wmGizmoMap *gzmap,
const bContext *C,
struct wmGizmo *gz,
int part);
struct wmGizmo *wm_gizmomap_highlight_get(struct wmGizmoMap *gzmap);
wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap,
bContext *C,
const wmEvent *event,
int *r_part);
bool wm_gizmomap_highlight_set(wmGizmoMap *gzmap, const bContext *C, wmGizmo *gz, int part);
wmGizmo *wm_gizmomap_highlight_get(wmGizmoMap *gzmap);
/**
* Caller should call exit when (enable == False).
*/
void wm_gizmomap_modal_set(struct wmGizmoMap *gzmap,
bContext *C,
struct wmGizmo *gz,
const struct wmEvent *event,
bool enable);
void wm_gizmomap_modal_set(
wmGizmoMap *gzmap, bContext *C, wmGizmo *gz, const wmEvent *event, bool enable);
struct wmGizmo *wm_gizmomap_modal_get(struct wmGizmoMap *gzmap);
struct wmGizmo **wm_gizmomap_selected_get(wmGizmoMap *gzmap, int *r_selected_len);
struct ListBase *wm_gizmomap_groups_get(wmGizmoMap *gzmap);
wmGizmo *wm_gizmomap_modal_get(wmGizmoMap *gzmap);
wmGizmo **wm_gizmomap_selected_get(wmGizmoMap *gzmap, int *r_selected_len);
ListBase *wm_gizmomap_groups_get(wmGizmoMap *gzmap);
/** \} */
@ -106,6 +98,6 @@ struct ListBase *wm_gizmomap_groups_get(wmGizmoMap *gzmap);
/** \name #wmGizmoMapType
* \{ */
void wm_gizmomaptypes_free(void);
void wm_gizmomaptypes_free();
/** \} */

View File

@ -9,4 +9,4 @@
#include "BLI_sys_types.h"
bool WM_platform_support_perform_checks(void);
bool WM_platform_support_perform_checks();

View File

@ -30,4 +30,4 @@ void WM_ghost_show_message_box(const char *title,
GHOST_TDrawingContextType wm_ghost_drawing_context_type(const eGPUBackendType gpu_backend);
void wm_test_opengl_deprecation_warning(struct bContext *C);
void wm_test_opengl_deprecation_warning(bContext *C);

View File

@ -20,7 +20,7 @@
struct Object;
struct wmXrActionSet;
typedef struct wmXrSessionState {
struct wmXrSessionState {
bool is_started;
/** Last known viewer pose (centroid of eyes, in world space) stored for queries. */
@ -67,9 +67,9 @@ typedef struct wmXrSessionState {
struct wmXrActionSet *active_action_set;
/* Name of the action set (if any) to activate before the next actions sync. */
char active_action_set_next[64]; /* MAX_NAME */
} wmXrSessionState;
};
typedef struct wmXrRuntimeData {
struct wmXrRuntimeData {
GHOST_XrContextHandle context;
/** The window the session was started in. Stored to be able to follow its view-layer. This may
@ -86,15 +86,15 @@ typedef struct wmXrRuntimeData {
ListBase actionmaps; /* #XrActionMap */
short actactionmap;
short selactionmap;
} wmXrRuntimeData;
};
typedef struct wmXrViewportPair {
struct wmXrViewportPair {
struct wmXrViewportPair *next, *prev;
struct GPUOffScreen *offscreen;
struct GPUViewport *viewport;
} wmXrViewportPair;
};
typedef struct {
struct wmXrSurfaceData {
/** Off-screen buffers/viewports for each view. */
ListBase viewports; /* #wmXrViewportPair */
@ -102,9 +102,9 @@ typedef struct {
struct ARegionType *controller_art;
/** Controller draw callback handle. */
void *controller_draw_handle;
} wmXrSurfaceData;
};
typedef struct wmXrDrawData {
struct wmXrDrawData {
struct Scene *scene;
struct Depsgraph *depsgraph;
@ -120,9 +120,9 @@ typedef struct wmXrDrawData {
/** Offset to _subtract_ from the OpenXR eye and viewer pose to get the wanted effective pose
* (e.g. a pose exactly at the landmark position). */
float eye_position_ofs[3]; /* Local/view space. */
} wmXrDrawData;
};
typedef struct wmXrController {
struct wmXrController {
struct wmXrController *next, *prev;
/** OpenXR user path identifier. */
char subaction_path[64]; /* XR_MAX_USER_PATH_LENGTH */
@ -138,9 +138,9 @@ typedef struct wmXrController {
/** Controller model. */
struct GPUBatch *model;
} wmXrController;
};
typedef struct wmXrAction {
struct wmXrAction {
char *name;
eXrActionType type;
unsigned int count_subaction_paths;
@ -171,16 +171,16 @@ typedef struct wmXrAction {
eXrOpFlag op_flag;
eXrActionFlag action_flag;
eXrHapticFlag haptic_flag;
} wmXrAction;
};
typedef struct wmXrHapticAction {
struct wmXrHapticAction {
struct wmXrHapticAction *next, *prev;
wmXrAction *action;
const char *subaction_path;
int64_t time_start;
} wmXrHapticAction;
};
typedef struct wmXrActionSet {
struct wmXrActionSet {
char *name;
/** XR pose actions that determine the controller grip/aim transforms. */
@ -191,11 +191,11 @@ typedef struct wmXrActionSet {
ListBase active_modal_actions;
/** Currently active haptic actions. */
ListBase active_haptic_actions;
} wmXrActionSet;
};
/* `wm_xr.cc` */
wmXrRuntimeData *wm_xr_runtime_data_create(void);
wmXrRuntimeData *wm_xr_runtime_data_create();
void wm_xr_runtime_data_free(wmXrRuntimeData **runtime);
/* `wm_xr_session.cc` */
@ -218,7 +218,7 @@ void wm_xr_session_state_update(const XrSessionSettings *settings,
wmXrSessionState *state);
bool wm_xr_session_surface_offscreen_ensure(wmXrSurfaceData *surface_data,
const GHOST_XrDrawViewInfo *draw_view);
void *wm_xr_session_gpu_binding_context_create(void);
void *wm_xr_session_gpu_binding_context_create();
void wm_xr_session_gpu_binding_context_destroy(GHOST_ContextHandle context);
void wm_xr_session_actions_init(wmXrData *xr);
@ -241,4 +241,4 @@ void wm_xr_pose_scale_to_imat(const GHOST_XrPose *pose, float scale, float r_ima
* callback (see GHOST_XrDrawViewFunc()) and executed for each view (read: eye).
*/
void wm_xr_draw_view(const GHOST_XrDrawViewInfo *draw_view, void *customdata);
void wm_xr_draw_controllers(const struct bContext *C, struct ARegion *region, void *customdata);
void wm_xr_draw_controllers(const bContext *C, ARegion *region, void *customdata);

View File

@ -12,7 +12,7 @@ struct wmWindow;
struct wmWindowManager;
struct wmXrData;
typedef void (*wmXrSessionExitFn)(const wmXrData *xr_data);
using wmXrSessionExitFn = void (*)(const wmXrData *xr_data);
/* `wm_xr.cc` */
@ -23,4 +23,4 @@ bool wm_xr_events_handle(wmWindowManager *wm);
/* `wm_xr_operators.cc` */
void wm_xr_operatortypes_register(void);
void wm_xr_operatortypes_register();