Cleanup: use const arguments for accessor functions
This commit is contained in:
@@ -151,7 +151,7 @@ typedef struct PoseTree {
|
||||
|
||||
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(struct ListBase *lb);
|
||||
int BKE_armature_bonelist_count(const struct ListBase *lb);
|
||||
void BKE_armature_bonelist_free(struct ListBase *lb, const bool do_id_user);
|
||||
void BKE_armature_editbonelist_free(struct ListBase *lb, const bool do_id_user);
|
||||
|
||||
|
||||
@@ -164,7 +164,8 @@ bool BKE_collection_move(struct Main *bmain,
|
||||
bool BKE_collection_cycle_find(struct Collection *new_ancestor, struct Collection *collection);
|
||||
bool BKE_collection_cycles_fix(struct Main *bmain, struct Collection *collection);
|
||||
|
||||
bool BKE_collection_has_collection(struct Collection *parent, struct Collection *collection);
|
||||
bool BKE_collection_has_collection(const struct Collection *parent,
|
||||
const struct Collection *collection);
|
||||
|
||||
void BKE_collection_parent_relations_rebuild(struct Collection *collection);
|
||||
void BKE_main_collections_parent_relations_rebuild(struct Main *bmain);
|
||||
|
||||
@@ -227,9 +227,9 @@ struct FCurve *BKE_fcurve_find_by_rna_context_ui(struct bContext *C,
|
||||
/* Binary search algorithm for finding where to 'insert' BezTriple with given frame number.
|
||||
* Returns the index to insert at (data already at that index will be offset if replace is 0)
|
||||
*/
|
||||
int BKE_fcurve_bezt_binarysearch_index(struct BezTriple array[],
|
||||
float frame,
|
||||
int arraylen,
|
||||
int BKE_fcurve_bezt_binarysearch_index(const struct BezTriple array[],
|
||||
const float frame,
|
||||
const int arraylen,
|
||||
bool *r_replace);
|
||||
|
||||
/* fcurve_cache.c */
|
||||
|
||||
@@ -90,7 +90,7 @@ typedef struct GPencilPointCoordinates {
|
||||
float pressure;
|
||||
} GPencilPointCoordinates;
|
||||
|
||||
int BKE_gpencil_stroke_point_count(struct bGPdata *gpd);
|
||||
int BKE_gpencil_stroke_point_count(const struct bGPdata *gpd);
|
||||
void BKE_gpencil_point_coords_get(struct bGPdata *gpd, GPencilPointCoordinates *elem_data);
|
||||
void BKE_gpencil_point_coords_apply(struct bGPdata *gpd, const GPencilPointCoordinates *elem_data);
|
||||
void BKE_gpencil_point_coords_apply_with_mat4(struct bGPdata *gpd,
|
||||
|
||||
@@ -76,7 +76,7 @@ void BKE_keyblock_update_from_lattice(struct Lattice *lt, struct KeyBlock *kb);
|
||||
void BKE_keyblock_convert_from_lattice(struct Lattice *lt, struct KeyBlock *kb);
|
||||
void BKE_keyblock_convert_to_lattice(struct KeyBlock *kb, struct Lattice *lt);
|
||||
|
||||
int BKE_keyblock_curve_element_count(struct ListBase *nurb);
|
||||
int BKE_keyblock_curve_element_count(const struct ListBase *nurb);
|
||||
void BKE_keyblock_curve_data_transform(const struct ListBase *nurb,
|
||||
const float mat[4][4],
|
||||
const void *src,
|
||||
|
||||
@@ -92,7 +92,7 @@ bool BKE_layer_collection_activate(struct ViewLayer *view_layer, struct LayerCol
|
||||
struct LayerCollection *BKE_layer_collection_activate_parent(struct ViewLayer *view_layer,
|
||||
struct LayerCollection *lc);
|
||||
|
||||
int BKE_layer_collection_count(struct ViewLayer *view_layer);
|
||||
int BKE_layer_collection_count(const struct ViewLayer *view_layer);
|
||||
|
||||
struct LayerCollection *BKE_layer_collection_from_index(struct ViewLayer *view_layer,
|
||||
const int index);
|
||||
@@ -107,8 +107,8 @@ void BKE_layer_collection_local_sync_all(const struct Main *bmain);
|
||||
void BKE_main_collection_sync_remap(const struct Main *bmain);
|
||||
|
||||
struct LayerCollection *BKE_layer_collection_first_from_scene_collection(
|
||||
struct ViewLayer *view_layer, const struct Collection *collection);
|
||||
bool BKE_view_layer_has_collection(struct ViewLayer *view_layer,
|
||||
const struct ViewLayer *view_layer, const struct Collection *collection);
|
||||
bool BKE_view_layer_has_collection(const struct ViewLayer *view_layer,
|
||||
const struct Collection *collection);
|
||||
bool BKE_scene_has_object(struct Scene *scene, struct Object *ob);
|
||||
|
||||
@@ -367,7 +367,7 @@ void BKE_view_layer_visible_bases_iterator_end(BLI_Iterator *iter);
|
||||
struct ObjectsInViewLayerParams {
|
||||
uint no_dup_data : 1;
|
||||
|
||||
bool (*filter_fn)(struct Object *ob, void *user_data);
|
||||
bool (*filter_fn)(const struct Object *ob, void *user_data);
|
||||
void *filter_userdata;
|
||||
};
|
||||
|
||||
@@ -388,7 +388,7 @@ struct ObjectsInModeParams {
|
||||
int object_mode;
|
||||
uint no_dup_data : 1;
|
||||
|
||||
bool (*filter_fn)(struct Object *ob, void *user_data);
|
||||
bool (*filter_fn)(const struct Object *ob, void *user_data);
|
||||
void *filter_userdata;
|
||||
};
|
||||
|
||||
@@ -412,8 +412,8 @@ struct Object **BKE_view_layer_array_from_objects_in_mode_params(
|
||||
BKE_view_layer_array_from_bases_in_mode_params( \
|
||||
view_layer, v3d, r_len, &(const struct ObjectsInModeParams)__VA_ARGS__)
|
||||
|
||||
bool BKE_view_layer_filter_edit_mesh_has_uvs(struct Object *ob, void *user_data);
|
||||
bool BKE_view_layer_filter_edit_mesh_has_edges(struct Object *ob, void *user_data);
|
||||
bool BKE_view_layer_filter_edit_mesh_has_uvs(const struct Object *ob, void *user_data);
|
||||
bool BKE_view_layer_filter_edit_mesh_has_edges(const struct Object *ob, void *user_data);
|
||||
|
||||
/* Utility macros that wrap common args (add more as needed). */
|
||||
|
||||
|
||||
@@ -474,7 +474,7 @@ bool BKE_pbvh_node_vert_update_check_any(PBVH *pbvh, PBVHNode *node);
|
||||
// void BKE_pbvh_node_BB_reset(PBVHNode *node);
|
||||
// void BKE_pbvh_node_BB_expand(PBVHNode *node, float co[3]);
|
||||
|
||||
bool pbvh_has_mask(PBVH *pbvh);
|
||||
bool pbvh_has_mask(const PBVH *pbvh);
|
||||
void pbvh_show_mask_set(PBVH *pbvh, bool show_mask);
|
||||
|
||||
bool pbvh_has_face_sets(PBVH *pbvh);
|
||||
|
||||
@@ -172,7 +172,7 @@ void BKE_shaderfx_copydata_ex(struct ShaderFxData *fx,
|
||||
void BKE_shaderfx_copy(struct ListBase *dst, const struct ListBase *src);
|
||||
void BKE_shaderfx_foreach_ID_link(struct Object *ob, ShaderFxIDWalkFunc walk, void *userData);
|
||||
|
||||
bool BKE_shaderfx_has_gpencil(struct Object *ob);
|
||||
bool BKE_shaderfx_has_gpencil(const struct Object *ob);
|
||||
|
||||
void BKE_shaderfx_blend_write(struct BlendWriter *writer, struct ListBase *fxbase);
|
||||
void BKE_shaderfx_blend_read_data(struct BlendDataReader *reader, struct ListBase *lb);
|
||||
|
||||
@@ -48,7 +48,7 @@ char *txt_to_buf(struct Text *text, int *r_buf_strlen);
|
||||
void txt_clean_text(struct Text *text);
|
||||
void txt_order_cursors(struct Text *text, const bool reverse);
|
||||
int txt_find_string(struct Text *text, const char *findstr, int wrap, int match_case);
|
||||
bool txt_has_sel(struct Text *text);
|
||||
bool txt_has_sel(const struct Text *text);
|
||||
int txt_get_span(struct TextLine *from, struct TextLine *to);
|
||||
void txt_move_up(struct Text *text, const bool sel);
|
||||
void txt_move_down(struct Text *text, const bool sel);
|
||||
@@ -85,8 +85,8 @@ bool txt_uncomment(struct Text *text);
|
||||
void txt_move_lines(struct Text *text, const int direction);
|
||||
void txt_duplicate_line(struct Text *text);
|
||||
int txt_setcurr_tab_spaces(struct Text *text, int space);
|
||||
bool txt_cursor_is_line_start(struct Text *text);
|
||||
bool txt_cursor_is_line_end(struct Text *text);
|
||||
bool txt_cursor_is_line_start(const struct Text *text);
|
||||
bool txt_cursor_is_line_end(const struct Text *text);
|
||||
|
||||
int txt_calc_tab_left(struct TextLine *tl, int ch);
|
||||
int txt_calc_tab_right(struct TextLine *tl, int ch);
|
||||
|
||||
@@ -178,7 +178,7 @@ UndoStack *BKE_undosys_stack_create(void);
|
||||
void BKE_undosys_stack_destroy(UndoStack *ustack);
|
||||
void BKE_undosys_stack_clear(UndoStack *ustack);
|
||||
void BKE_undosys_stack_clear_active(UndoStack *ustack);
|
||||
bool BKE_undosys_stack_has_undo(UndoStack *ustack, const char *name);
|
||||
bool BKE_undosys_stack_has_undo(const UndoStack *ustack, const char *name);
|
||||
void BKE_undosys_stack_init_from_main(UndoStack *ustack, struct Main *bmain);
|
||||
void BKE_undosys_stack_init_from_context(UndoStack *ustack, struct bContext *C);
|
||||
UndoStep *BKE_undosys_stack_active_with_type(UndoStack *ustack, const UndoType *ut);
|
||||
|
||||
@@ -358,7 +358,7 @@ bArmature *BKE_armature_from_object(Object *ob)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int BKE_armature_bonelist_count(ListBase *lb)
|
||||
int BKE_armature_bonelist_count(const ListBase *lb)
|
||||
{
|
||||
int i = 0;
|
||||
LISTBASE_FOREACH (Bone *, bone, lb) {
|
||||
|
||||
@@ -79,7 +79,8 @@ static bool collection_object_remove(Main *bmain,
|
||||
static CollectionChild *collection_find_child(Collection *parent, Collection *collection);
|
||||
static CollectionParent *collection_find_parent(Collection *child, Collection *collection);
|
||||
|
||||
static bool collection_find_child_recursive(Collection *parent, Collection *collection);
|
||||
static bool collection_find_child_recursive(const Collection *parent,
|
||||
const Collection *collection);
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -1521,9 +1522,9 @@ static CollectionChild *collection_find_child(Collection *parent, Collection *co
|
||||
return BLI_findptr(&parent->children, collection, offsetof(CollectionChild, collection));
|
||||
}
|
||||
|
||||
static bool collection_find_child_recursive(Collection *parent, Collection *collection)
|
||||
static bool collection_find_child_recursive(const Collection *parent, const Collection *collection)
|
||||
{
|
||||
LISTBASE_FOREACH (CollectionChild *, child, &parent->children) {
|
||||
LISTBASE_FOREACH (const CollectionChild *, child, &parent->children) {
|
||||
if (child->collection == collection) {
|
||||
return true;
|
||||
}
|
||||
@@ -1536,7 +1537,7 @@ static bool collection_find_child_recursive(Collection *parent, Collection *coll
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BKE_collection_has_collection(Collection *parent, Collection *collection)
|
||||
bool BKE_collection_has_collection(const Collection *parent, const Collection *collection)
|
||||
{
|
||||
return collection_find_child_recursive(parent, collection);
|
||||
}
|
||||
|
||||
@@ -510,8 +510,11 @@ FCurve *BKE_fcurve_find_by_rna_context_ui(bContext *C,
|
||||
* with optional argument for precision required.
|
||||
* Returns the index to insert at (data already at that index will be offset if replace is 0)
|
||||
*/
|
||||
static int BKE_fcurve_bezt_binarysearch_index_ex(
|
||||
BezTriple array[], float frame, int arraylen, float threshold, bool *r_replace)
|
||||
static int BKE_fcurve_bezt_binarysearch_index_ex(const BezTriple array[],
|
||||
const float frame,
|
||||
const int arraylen,
|
||||
const float threshold,
|
||||
bool *r_replace)
|
||||
{
|
||||
int start = 0, end = arraylen;
|
||||
int loopbreaker = 0, maxloop = arraylen * 2;
|
||||
@@ -597,9 +600,9 @@ static int BKE_fcurve_bezt_binarysearch_index_ex(
|
||||
/* Binary search algorithm for finding where to insert BezTriple. (for use by insert_bezt_fcurve)
|
||||
* Returns the index to insert at (data already at that index will be offset if replace is 0)
|
||||
*/
|
||||
int BKE_fcurve_bezt_binarysearch_index(BezTriple array[],
|
||||
float frame,
|
||||
int arraylen,
|
||||
int BKE_fcurve_bezt_binarysearch_index(const BezTriple array[],
|
||||
const float frame,
|
||||
const int arraylen,
|
||||
bool *r_replace)
|
||||
{
|
||||
/* This is just a wrapper which uses the default threshold. */
|
||||
|
||||
@@ -2616,7 +2616,7 @@ void BKE_gpencil_transform(bGPdata *gpd, const float mat[4][4])
|
||||
}
|
||||
|
||||
/* Used for "move only origins" in object_data_transform.c */
|
||||
int BKE_gpencil_stroke_point_count(bGPdata *gpd)
|
||||
int BKE_gpencil_stroke_point_count(const bGPdata *gpd)
|
||||
{
|
||||
int total_points = 0;
|
||||
|
||||
@@ -2624,7 +2624,7 @@ int BKE_gpencil_stroke_point_count(bGPdata *gpd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
|
||||
LISTBASE_FOREACH (const bGPDlayer *, gpl, &gpd->layers) {
|
||||
/* FIXME: For now, we just skip parented layers.
|
||||
* Otherwise, we have to update each frame to find
|
||||
* the current parent position/effects.
|
||||
@@ -2633,7 +2633,7 @@ int BKE_gpencil_stroke_point_count(bGPdata *gpd)
|
||||
continue;
|
||||
}
|
||||
|
||||
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
|
||||
LISTBASE_FOREACH (const bGPDframe *, gpf, &gpl->frames) {
|
||||
LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
|
||||
total_points += gps->totpoints;
|
||||
}
|
||||
|
||||
@@ -2048,9 +2048,9 @@ void BKE_keyblock_convert_to_lattice(KeyBlock *kb, Lattice *lt)
|
||||
|
||||
/************************* Curve ************************/
|
||||
|
||||
int BKE_keyblock_curve_element_count(ListBase *nurb)
|
||||
int BKE_keyblock_curve_element_count(const ListBase *nurb)
|
||||
{
|
||||
Nurb *nu;
|
||||
const Nurb *nu;
|
||||
int tot = 0;
|
||||
|
||||
nu = nurb->first;
|
||||
|
||||
@@ -676,10 +676,10 @@ LayerCollection *BKE_layer_collection_activate_parent(ViewLayer *view_layer, Lay
|
||||
/**
|
||||
* Recursively get the count of collections
|
||||
*/
|
||||
static int collection_count(ListBase *lb)
|
||||
static int collection_count(const ListBase *lb)
|
||||
{
|
||||
int i = 0;
|
||||
LISTBASE_FOREACH (LayerCollection *, lc, lb) {
|
||||
LISTBASE_FOREACH (const LayerCollection *, lc, lb) {
|
||||
i += collection_count(&lc->layer_collections) + 1;
|
||||
}
|
||||
return i;
|
||||
@@ -689,7 +689,7 @@ static int collection_count(ListBase *lb)
|
||||
* Get the total number of collections
|
||||
* (including all the nested collections)
|
||||
*/
|
||||
int BKE_layer_collection_count(ViewLayer *view_layer)
|
||||
int BKE_layer_collection_count(const ViewLayer *view_layer)
|
||||
{
|
||||
return collection_count(&view_layer->layer_collections);
|
||||
}
|
||||
@@ -1504,7 +1504,7 @@ static LayerCollection *find_layer_collection_by_scene_collection(LayerCollectio
|
||||
/**
|
||||
* Return the first matching LayerCollection in the ViewLayer for the Collection.
|
||||
*/
|
||||
LayerCollection *BKE_layer_collection_first_from_scene_collection(ViewLayer *view_layer,
|
||||
LayerCollection *BKE_layer_collection_first_from_scene_collection(const ViewLayer *view_layer,
|
||||
const Collection *collection)
|
||||
{
|
||||
LISTBASE_FOREACH (LayerCollection *, layer_collection, &view_layer->layer_collections) {
|
||||
@@ -1520,7 +1520,7 @@ LayerCollection *BKE_layer_collection_first_from_scene_collection(ViewLayer *vie
|
||||
/**
|
||||
* See if view layer has the scene collection linked directly, or indirectly (nested)
|
||||
*/
|
||||
bool BKE_view_layer_has_collection(ViewLayer *view_layer, const Collection *collection)
|
||||
bool BKE_view_layer_has_collection(const ViewLayer *view_layer, const Collection *collection)
|
||||
{
|
||||
return BKE_layer_collection_first_from_scene_collection(view_layer, collection) != NULL;
|
||||
}
|
||||
|
||||
@@ -164,11 +164,11 @@ Object **BKE_view_layer_array_from_objects_in_mode_params(ViewLayer *view_layer,
|
||||
/** \name Filter Functions
|
||||
* \{ */
|
||||
|
||||
bool BKE_view_layer_filter_edit_mesh_has_uvs(Object *ob, void *UNUSED(user_data))
|
||||
bool BKE_view_layer_filter_edit_mesh_has_uvs(const Object *ob, void *UNUSED(user_data))
|
||||
{
|
||||
if (ob->type == OB_MESH) {
|
||||
Mesh *me = ob->data;
|
||||
BMEditMesh *em = me->edit_mesh;
|
||||
const Mesh *me = ob->data;
|
||||
const BMEditMesh *em = me->edit_mesh;
|
||||
if (em != NULL) {
|
||||
if (CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV) != -1) {
|
||||
return true;
|
||||
@@ -178,11 +178,11 @@ bool BKE_view_layer_filter_edit_mesh_has_uvs(Object *ob, void *UNUSED(user_data)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BKE_view_layer_filter_edit_mesh_has_edges(Object *ob, void *UNUSED(user_data))
|
||||
bool BKE_view_layer_filter_edit_mesh_has_edges(const Object *ob, void *UNUSED(user_data))
|
||||
{
|
||||
if (ob->type == OB_MESH) {
|
||||
Mesh *me = ob->data;
|
||||
BMEditMesh *em = me->edit_mesh;
|
||||
const Mesh *me = ob->data;
|
||||
const BMEditMesh *em = me->edit_mesh;
|
||||
if (em != NULL) {
|
||||
if (em->bm->totedge != 0) {
|
||||
return true;
|
||||
|
||||
@@ -2985,7 +2985,7 @@ void pbvh_vertex_iter_init(PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int m
|
||||
}
|
||||
}
|
||||
|
||||
bool pbvh_has_mask(PBVH *pbvh)
|
||||
bool pbvh_has_mask(const PBVH *pbvh)
|
||||
{
|
||||
switch (pbvh->type) {
|
||||
case PBVH_GRIDS:
|
||||
|
||||
@@ -58,9 +58,9 @@ static ShaderFxTypeInfo *shader_fx_types[NUM_SHADER_FX_TYPES] = {NULL};
|
||||
/* Methods - Evaluation Loops, etc. */
|
||||
|
||||
/* check if exist grease pencil effects */
|
||||
bool BKE_shaderfx_has_gpencil(Object *ob)
|
||||
bool BKE_shaderfx_has_gpencil(const Object *ob)
|
||||
{
|
||||
ShaderFxData *fx;
|
||||
const ShaderFxData *fx;
|
||||
for (fx = ob->shader_fx.first; fx; fx = fx->next) {
|
||||
const ShaderFxTypeInfo *fxi = BKE_shaderfx_get_info(fx->type);
|
||||
if (fxi->type == eShaderFxType_GpencilType) {
|
||||
|
||||
@@ -3205,7 +3205,7 @@ void sbObjectToSoftbody(Object *ob)
|
||||
free_softbody_intern(ob->soft);
|
||||
}
|
||||
|
||||
static bool object_has_edges(Object *ob)
|
||||
static bool object_has_edges(const Object *ob)
|
||||
{
|
||||
if (ob->type == OB_MESH) {
|
||||
return ((Mesh *)ob->data)->totedge;
|
||||
|
||||
@@ -781,12 +781,12 @@ static void txt_curs_sel(Text *text, TextLine ***linep, int **charp)
|
||||
*charp = &text->selc;
|
||||
}
|
||||
|
||||
bool txt_cursor_is_line_start(Text *text)
|
||||
bool txt_cursor_is_line_start(const Text *text)
|
||||
{
|
||||
return (text->selc == 0);
|
||||
}
|
||||
|
||||
bool txt_cursor_is_line_end(Text *text)
|
||||
bool txt_cursor_is_line_end(const Text *text)
|
||||
{
|
||||
return (text->selc == text->sell->len);
|
||||
}
|
||||
@@ -1239,7 +1239,7 @@ void txt_order_cursors(Text *text, const bool reverse)
|
||||
}
|
||||
}
|
||||
|
||||
bool txt_has_sel(Text *text)
|
||||
bool txt_has_sel(const Text *text)
|
||||
{
|
||||
return ((text->curl != text->sell) || (text->curc != text->selc));
|
||||
}
|
||||
|
||||
@@ -368,10 +368,10 @@ void BKE_undosys_stack_init_from_context(UndoStack *ustack, bContext *C)
|
||||
}
|
||||
|
||||
/* name optional */
|
||||
bool BKE_undosys_stack_has_undo(UndoStack *ustack, const char *name)
|
||||
bool BKE_undosys_stack_has_undo(const UndoStack *ustack, const char *name)
|
||||
{
|
||||
if (name) {
|
||||
UndoStep *us = BLI_rfindstring(&ustack->steps, name, offsetof(UndoStep, name));
|
||||
const UndoStep *us = BLI_rfindstring(&ustack->steps, name, offsetof(UndoStep, name));
|
||||
return us && us->prev;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ void BLI_dynstr_appendf(DynStr *__restrict ds, const char *__restrict format, ..
|
||||
void BLI_dynstr_vappendf(DynStr *__restrict ds, const char *__restrict format, va_list args)
|
||||
ATTR_PRINTF_FORMAT(2, 0) ATTR_NONNULL(1, 2);
|
||||
|
||||
int BLI_dynstr_get_len(DynStr *ds) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||
char *BLI_dynstr_get_cstring(DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||
void BLI_dynstr_get_cstring_ex(DynStr *__restrict ds, char *__restrict rets) ATTR_NONNULL();
|
||||
int BLI_dynstr_get_len(const DynStr *ds) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||
char *BLI_dynstr_get_cstring(const DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||
void BLI_dynstr_get_cstring_ex(const DynStr *__restrict ds, char *__restrict rets) ATTR_NONNULL();
|
||||
|
||||
void BLI_dynstr_clear(DynStr *ds) ATTR_NONNULL();
|
||||
void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL();
|
||||
|
||||
@@ -57,8 +57,10 @@ void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP free_value);
|
||||
void BLI_edgehash_print(EdgeHash *eh);
|
||||
void BLI_edgehash_insert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val);
|
||||
bool BLI_edgehash_reinsert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val);
|
||||
void *BLI_edgehash_lookup(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
void *BLI_edgehash_lookup_default(EdgeHash *eh,
|
||||
void *BLI_edgehash_lookup(const EdgeHash *eh,
|
||||
unsigned int v0,
|
||||
unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
void *BLI_edgehash_lookup_default(const EdgeHash *eh,
|
||||
unsigned int v0,
|
||||
unsigned int v1,
|
||||
void *default_value) ATTR_WARN_UNUSED_RESULT;
|
||||
@@ -73,8 +75,10 @@ bool BLI_edgehash_remove(EdgeHash *eh,
|
||||
EdgeHashFreeFP free_value);
|
||||
|
||||
void *BLI_edgehash_popkey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_edgehash_haskey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
int BLI_edgehash_len(EdgeHash *eh) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_edgehash_haskey(const EdgeHash *eh,
|
||||
unsigned int v0,
|
||||
unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
int BLI_edgehash_len(const EdgeHash *eh) ATTR_WARN_UNUSED_RESULT;
|
||||
void BLI_edgehash_clear_ex(EdgeHash *eh, EdgeHashFreeFP free_value, const uint reserve);
|
||||
void BLI_edgehash_clear(EdgeHash *eh, EdgeHashFreeFP free_value);
|
||||
|
||||
@@ -86,7 +90,7 @@ BLI_INLINE void BLI_edgehashIterator_step(EdgeHashIterator *ehi)
|
||||
{
|
||||
ehi->index++;
|
||||
}
|
||||
BLI_INLINE bool BLI_edgehashIterator_isDone(EdgeHashIterator *ehi)
|
||||
BLI_INLINE bool BLI_edgehashIterator_isDone(const EdgeHashIterator *ehi)
|
||||
{
|
||||
return ehi->index >= ehi->length;
|
||||
}
|
||||
@@ -128,10 +132,12 @@ typedef struct EdgeSetIterator {
|
||||
EdgeSet *BLI_edgeset_new_ex(const char *info, const unsigned int nentries_reserve)
|
||||
ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
|
||||
EdgeSet *BLI_edgeset_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
|
||||
int BLI_edgeset_len(EdgeSet *es) ATTR_WARN_UNUSED_RESULT;
|
||||
int BLI_edgeset_len(const EdgeSet *es) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_edgeset_add(EdgeSet *es, unsigned int v0, unsigned int v1);
|
||||
void BLI_edgeset_insert(EdgeSet *es, unsigned int v0, unsigned int v1);
|
||||
bool BLI_edgeset_haskey(EdgeSet *es, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_edgeset_haskey(const EdgeSet *es,
|
||||
unsigned int v0,
|
||||
unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
void BLI_edgeset_free(EdgeSet *es);
|
||||
|
||||
/* rely on inline api for now */
|
||||
@@ -150,7 +156,7 @@ BLI_INLINE void BLI_edgesetIterator_step(EdgeSetIterator *esi)
|
||||
{
|
||||
esi->index++;
|
||||
}
|
||||
BLI_INLINE bool BLI_edgesetIterator_isDone(EdgeSetIterator *esi)
|
||||
BLI_INLINE bool BLI_edgesetIterator_isDone(const EdgeSetIterator *esi)
|
||||
{
|
||||
return esi->index >= esi->length;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ GHash *BLI_ghash_new_ex(GHashHashFP hashfp,
|
||||
GHash *BLI_ghash_new(GHashHashFP hashfp,
|
||||
GHashCmpFP cmpfp,
|
||||
const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
|
||||
GHash *BLI_ghash_copy(GHash *gh,
|
||||
GHash *BLI_ghash_copy(const GHash *gh,
|
||||
GHashKeyCopyFP keycopyfp,
|
||||
GHashValCopyFP valcopyfp) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
|
||||
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp);
|
||||
@@ -96,8 +96,8 @@ void BLI_ghash_insert(GHash *gh, void *key, void *val);
|
||||
bool BLI_ghash_reinsert(
|
||||
GHash *gh, void *key, void *val, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp);
|
||||
void *BLI_ghash_replace_key(GHash *gh, void *key);
|
||||
void *BLI_ghash_lookup(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
void *BLI_ghash_lookup_default(GHash *gh,
|
||||
void *BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
void *BLI_ghash_lookup_default(const GHash *gh,
|
||||
const void *key,
|
||||
void *val_default) ATTR_WARN_UNUSED_RESULT;
|
||||
void **BLI_ghash_lookup_p(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
@@ -116,10 +116,10 @@ void BLI_ghash_clear_ex(GHash *gh,
|
||||
void *BLI_ghash_popkey(GHash *gh,
|
||||
const void *key,
|
||||
GHashKeyFreeFP keyfreefp) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_ghash_haskey(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_ghash_pop(GHash *gh, GHashIterState *state, void **r_key, void **r_val)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||
unsigned int BLI_ghash_len(GHash *gh) ATTR_WARN_UNUSED_RESULT;
|
||||
unsigned int BLI_ghash_len(const GHash *gh) ATTR_WARN_UNUSED_RESULT;
|
||||
void BLI_ghash_flag_set(GHash *gh, unsigned int flag);
|
||||
void BLI_ghash_flag_clear(GHash *gh, unsigned int flag);
|
||||
|
||||
@@ -138,7 +138,7 @@ void BLI_ghashIterator_step(GHashIterator *ghi);
|
||||
BLI_INLINE void *BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
|
||||
BLI_INLINE void *BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
|
||||
BLI_INLINE void **BLI_ghashIterator_getValue_p(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
|
||||
BLI_INLINE bool BLI_ghashIterator_done(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
|
||||
BLI_INLINE bool BLI_ghashIterator_done(const GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
|
||||
|
||||
struct _gh_Entry {
|
||||
void *next, *key, *val;
|
||||
@@ -155,7 +155,7 @@ BLI_INLINE void **BLI_ghashIterator_getValue_p(GHashIterator *ghi)
|
||||
{
|
||||
return &((struct _gh_Entry *)ghi->curEntry)->val;
|
||||
}
|
||||
BLI_INLINE bool BLI_ghashIterator_done(GHashIterator *ghi)
|
||||
BLI_INLINE bool BLI_ghashIterator_done(const GHashIterator *ghi)
|
||||
{
|
||||
return !ghi->curEntry;
|
||||
}
|
||||
@@ -202,8 +202,8 @@ GSet *BLI_gset_new_ex(GSetHashFP hashfp,
|
||||
GSet *BLI_gset_new(GSetHashFP hashfp,
|
||||
GSetCmpFP cmpfp,
|
||||
const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
|
||||
GSet *BLI_gset_copy(GSet *gs, GSetKeyCopyFP keycopyfp) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
|
||||
unsigned int BLI_gset_len(GSet *gs) ATTR_WARN_UNUSED_RESULT;
|
||||
GSet *BLI_gset_copy(const GSet *gs, GSetKeyCopyFP keycopyfp) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
|
||||
unsigned int BLI_gset_len(const GSet *gs) ATTR_WARN_UNUSED_RESULT;
|
||||
void BLI_gset_flag_set(GSet *gs, unsigned int flag);
|
||||
void BLI_gset_flag_clear(GSet *gs, unsigned int flag);
|
||||
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp);
|
||||
@@ -212,7 +212,7 @@ bool BLI_gset_add(GSet *gs, void *key);
|
||||
bool BLI_gset_ensure_p_ex(GSet *gs, const void *key, void ***r_key);
|
||||
bool BLI_gset_reinsert(GSet *gh, void *key, GSetKeyFreeFP keyfreefp);
|
||||
void *BLI_gset_replace_key(GSet *gs, void *key);
|
||||
bool BLI_gset_haskey(GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_gset_haskey(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_gset_pop(GSet *gs, GSetIterState *state, void **r_key) ATTR_WARN_UNUSED_RESULT
|
||||
ATTR_NONNULL();
|
||||
bool BLI_gset_remove(GSet *gs, const void *key, GSetKeyFreeFP keyfreefp);
|
||||
@@ -220,7 +220,7 @@ void BLI_gset_clear_ex(GSet *gs, GSetKeyFreeFP keyfreefp, const unsigned int nen
|
||||
void BLI_gset_clear(GSet *gs, GSetKeyFreeFP keyfreefp);
|
||||
|
||||
/* When set's are used for key & value. */
|
||||
void *BLI_gset_lookup(GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
void *BLI_gset_lookup(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
void *BLI_gset_pop_key(GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT;
|
||||
|
||||
/** \} */
|
||||
@@ -260,9 +260,9 @@ BLI_INLINE void BLI_gsetIterator_step(GSetIterator *gsi)
|
||||
{
|
||||
BLI_ghashIterator_step((GHashIterator *)gsi);
|
||||
}
|
||||
BLI_INLINE bool BLI_gsetIterator_done(GSetIterator *gsi)
|
||||
BLI_INLINE bool BLI_gsetIterator_done(const GSetIterator *gsi)
|
||||
{
|
||||
return BLI_ghashIterator_done((GHashIterator *)gsi);
|
||||
return BLI_ghashIterator_done((const GHashIterator *)gsi);
|
||||
}
|
||||
|
||||
#define GSET_ITER(gs_iter_, gset_) \
|
||||
@@ -282,8 +282,8 @@ BLI_INLINE bool BLI_gsetIterator_done(GSetIterator *gsi)
|
||||
|
||||
/* For testing, debugging only */
|
||||
#ifdef GHASH_INTERNAL_API
|
||||
int BLI_ghash_buckets_len(GHash *gh);
|
||||
int BLI_gset_buckets_len(GSet *gs);
|
||||
int BLI_ghash_buckets_len(const GHash *gh);
|
||||
int BLI_gset_buckets_len(const GSet *gs);
|
||||
|
||||
double BLI_ghash_calc_quality_ex(GHash *gh,
|
||||
double *r_load,
|
||||
|
||||
@@ -48,7 +48,7 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr) ATTR_NONNULL(1, 2);
|
||||
void BLI_mempool_clear_ex(BLI_mempool *pool, const int totelem_reserve) ATTR_NONNULL(1);
|
||||
void BLI_mempool_clear(BLI_mempool *pool) ATTR_NONNULL(1);
|
||||
void BLI_mempool_destroy(BLI_mempool *pool) ATTR_NONNULL(1);
|
||||
int BLI_mempool_len(BLI_mempool *pool) ATTR_NONNULL(1);
|
||||
int BLI_mempool_len(const BLI_mempool *pool) ATTR_NONNULL(1);
|
||||
void *BLI_mempool_findelem(BLI_mempool *pool, unsigned int index) ATTR_WARN_UNUSED_RESULT
|
||||
ATTR_NONNULL(1);
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ void BLI_dynstr_appendf(DynStr *__restrict ds, const char *__restrict format, ..
|
||||
* \param ds: The DynStr of interest.
|
||||
* \return The length of \a ds.
|
||||
*/
|
||||
int BLI_dynstr_get_len(DynStr *ds)
|
||||
int BLI_dynstr_get_len(const DynStr *ds)
|
||||
{
|
||||
return ds->curlen;
|
||||
}
|
||||
@@ -296,10 +296,10 @@ int BLI_dynstr_get_len(DynStr *ds)
|
||||
* \param ds: The DynStr of interest.
|
||||
* \param rets: The string to fill.
|
||||
*/
|
||||
void BLI_dynstr_get_cstring_ex(DynStr *__restrict ds, char *__restrict rets)
|
||||
void BLI_dynstr_get_cstring_ex(const DynStr *__restrict ds, char *__restrict rets)
|
||||
{
|
||||
char *s;
|
||||
DynStrElem *dse;
|
||||
const DynStrElem *dse;
|
||||
|
||||
for (s = rets, dse = ds->elems; dse; dse = dse->next) {
|
||||
int slen = strlen(dse->str);
|
||||
@@ -320,7 +320,7 @@ void BLI_dynstr_get_cstring_ex(DynStr *__restrict ds, char *__restrict rets)
|
||||
* \param ds: The DynStr of interest.
|
||||
* \return The contents of \a ds as a c-string.
|
||||
*/
|
||||
char *BLI_dynstr_get_cstring(DynStr *ds)
|
||||
char *BLI_dynstr_get_cstring(const DynStr *ds)
|
||||
{
|
||||
char *rets = MEM_mallocN(ds->curlen + 1, "dynstr_cstring");
|
||||
BLI_dynstr_get_cstring_ex(ds, rets);
|
||||
|
||||
@@ -122,8 +122,8 @@ struct GHash {
|
||||
|
||||
BLI_INLINE void ghash_entry_copy(GHash *gh_dst,
|
||||
Entry *dst,
|
||||
GHash *gh_src,
|
||||
Entry *src,
|
||||
const GHash *gh_src,
|
||||
const Entry *src,
|
||||
GHashKeyCopyFP keycopyfp,
|
||||
GHashValCopyFP valcopyfp)
|
||||
{
|
||||
@@ -143,7 +143,7 @@ BLI_INLINE void ghash_entry_copy(GHash *gh_dst,
|
||||
/**
|
||||
* Get the full hash for a key.
|
||||
*/
|
||||
BLI_INLINE uint ghash_keyhash(GHash *gh, const void *key)
|
||||
BLI_INLINE uint ghash_keyhash(const GHash *gh, const void *key)
|
||||
{
|
||||
return gh->hashfp(key);
|
||||
}
|
||||
@@ -151,7 +151,7 @@ BLI_INLINE uint ghash_keyhash(GHash *gh, const void *key)
|
||||
/**
|
||||
* Get the full hash for an entry.
|
||||
*/
|
||||
BLI_INLINE uint ghash_entryhash(GHash *gh, const Entry *e)
|
||||
BLI_INLINE uint ghash_entryhash(const GHash *gh, const Entry *e)
|
||||
{
|
||||
return gh->hashfp(e->key);
|
||||
}
|
||||
@@ -159,7 +159,7 @@ BLI_INLINE uint ghash_entryhash(GHash *gh, const Entry *e)
|
||||
/**
|
||||
* Get the bucket-index for an already-computed full hash.
|
||||
*/
|
||||
BLI_INLINE uint ghash_bucket_index(GHash *gh, const uint hash)
|
||||
BLI_INLINE uint ghash_bucket_index(const GHash *gh, const uint hash)
|
||||
{
|
||||
#ifdef GHASH_USE_MODULO_BUCKETS
|
||||
return hash % gh->nbuckets;
|
||||
@@ -171,7 +171,7 @@ BLI_INLINE uint ghash_bucket_index(GHash *gh, const uint hash)
|
||||
/**
|
||||
* Find the index of next used bucket, starting from \a curr_bucket (\a gh is assumed non-empty).
|
||||
*/
|
||||
BLI_INLINE uint ghash_find_next_bucket_index(GHash *gh, uint curr_bucket)
|
||||
BLI_INLINE uint ghash_find_next_bucket_index(const GHash *gh, uint curr_bucket)
|
||||
{
|
||||
if (curr_bucket >= gh->nbuckets) {
|
||||
curr_bucket = 0;
|
||||
@@ -381,7 +381,7 @@ BLI_INLINE void ghash_buckets_reset(GHash *gh, const uint nentries)
|
||||
* Takes hash and bucket_index arguments to avoid calling #ghash_keyhash and #ghash_bucket_index
|
||||
* multiple times.
|
||||
*/
|
||||
BLI_INLINE Entry *ghash_lookup_entry_ex(GHash *gh, const void *key, const uint bucket_index)
|
||||
BLI_INLINE Entry *ghash_lookup_entry_ex(const GHash *gh, const void *key, const uint bucket_index)
|
||||
{
|
||||
Entry *e;
|
||||
/* If we do not store GHash, not worth computing it for each entry here!
|
||||
@@ -422,7 +422,7 @@ BLI_INLINE Entry *ghash_lookup_entry_prev_ex(GHash *gh,
|
||||
/**
|
||||
* Internal lookup function. Only wraps #ghash_lookup_entry_ex
|
||||
*/
|
||||
BLI_INLINE Entry *ghash_lookup_entry(GHash *gh, const void *key)
|
||||
BLI_INLINE Entry *ghash_lookup_entry(const GHash *gh, const void *key)
|
||||
{
|
||||
const uint hash = ghash_keyhash(gh, key);
|
||||
const uint bucket_index = ghash_bucket_index(gh, hash);
|
||||
@@ -652,7 +652,7 @@ static void ghash_free_cb(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP va
|
||||
/**
|
||||
* Copy the GHash.
|
||||
*/
|
||||
static GHash *ghash_copy(GHash *gh, GHashKeyCopyFP keycopyfp, GHashValCopyFP valcopyfp)
|
||||
static GHash *ghash_copy(const GHash *gh, GHashKeyCopyFP keycopyfp, GHashValCopyFP valcopyfp)
|
||||
{
|
||||
GHash *gh_new;
|
||||
uint i;
|
||||
@@ -724,7 +724,7 @@ GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info)
|
||||
* Copy given GHash. Keys and values are also copied if relevant callback is provided,
|
||||
* else pointers remain the same.
|
||||
*/
|
||||
GHash *BLI_ghash_copy(GHash *gh, GHashKeyCopyFP keycopyfp, GHashValCopyFP valcopyfp)
|
||||
GHash *BLI_ghash_copy(const GHash *gh, GHashKeyCopyFP keycopyfp, GHashValCopyFP valcopyfp)
|
||||
{
|
||||
return ghash_copy(gh, keycopyfp, valcopyfp);
|
||||
}
|
||||
@@ -741,7 +741,7 @@ void BLI_ghash_reserve(GHash *gh, const uint nentries_reserve)
|
||||
/**
|
||||
* \return size of the GHash.
|
||||
*/
|
||||
uint BLI_ghash_len(GHash *gh)
|
||||
uint BLI_ghash_len(const GHash *gh)
|
||||
{
|
||||
return gh->nentries;
|
||||
}
|
||||
@@ -800,7 +800,7 @@ void *BLI_ghash_replace_key(GHash *gh, void *key)
|
||||
* \note When NULL is a valid value, use #BLI_ghash_lookup_p to differentiate a missing key
|
||||
* from a key with a NULL value. (Avoids calling #BLI_ghash_haskey before #BLI_ghash_lookup)
|
||||
*/
|
||||
void *BLI_ghash_lookup(GHash *gh, const void *key)
|
||||
void *BLI_ghash_lookup(const GHash *gh, const void *key)
|
||||
{
|
||||
GHashEntry *e = (GHashEntry *)ghash_lookup_entry(gh, key);
|
||||
BLI_assert(!(gh->flag & GHASH_FLAG_IS_GSET));
|
||||
@@ -810,7 +810,7 @@ void *BLI_ghash_lookup(GHash *gh, const void *key)
|
||||
/**
|
||||
* A version of #BLI_ghash_lookup which accepts a fallback argument.
|
||||
*/
|
||||
void *BLI_ghash_lookup_default(GHash *gh, const void *key, void *val_default)
|
||||
void *BLI_ghash_lookup_default(const GHash *gh, const void *key, void *val_default)
|
||||
{
|
||||
GHashEntry *e = (GHashEntry *)ghash_lookup_entry(gh, key);
|
||||
BLI_assert(!(gh->flag & GHASH_FLAG_IS_GSET));
|
||||
@@ -938,7 +938,7 @@ void *BLI_ghash_popkey(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp)
|
||||
/**
|
||||
* \return true if the \a key is in \a gh.
|
||||
*/
|
||||
bool BLI_ghash_haskey(GHash *gh, const void *key)
|
||||
bool BLI_ghash_haskey(const GHash *gh, const void *key)
|
||||
{
|
||||
return (ghash_lookup_entry(gh, key) != NULL);
|
||||
}
|
||||
@@ -1130,12 +1130,12 @@ GSet *BLI_gset_new(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info)
|
||||
/**
|
||||
* Copy given GSet. Keys are also copied if callback is provided, else pointers remain the same.
|
||||
*/
|
||||
GSet *BLI_gset_copy(GSet *gs, GHashKeyCopyFP keycopyfp)
|
||||
GSet *BLI_gset_copy(const GSet *gs, GHashKeyCopyFP keycopyfp)
|
||||
{
|
||||
return (GSet *)ghash_copy((GHash *)gs, keycopyfp, NULL);
|
||||
return (GSet *)ghash_copy((const GHash *)gs, keycopyfp, NULL);
|
||||
}
|
||||
|
||||
uint BLI_gset_len(GSet *gs)
|
||||
uint BLI_gset_len(const GSet *gs)
|
||||
{
|
||||
return ((GHash *)gs)->nentries;
|
||||
}
|
||||
@@ -1172,7 +1172,7 @@ bool BLI_gset_ensure_p_ex(GSet *gs, const void *key, void ***r_key)
|
||||
{
|
||||
const uint hash = ghash_keyhash((GHash *)gs, key);
|
||||
const uint bucket_index = ghash_bucket_index((GHash *)gs, hash);
|
||||
GSetEntry *e = (GSetEntry *)ghash_lookup_entry_ex((GHash *)gs, key, bucket_index);
|
||||
GSetEntry *e = (GSetEntry *)ghash_lookup_entry_ex((const GHash *)gs, key, bucket_index);
|
||||
const bool haskey = (e != NULL);
|
||||
|
||||
if (!haskey) {
|
||||
@@ -1213,9 +1213,9 @@ bool BLI_gset_remove(GSet *gs, const void *key, GSetKeyFreeFP keyfreefp)
|
||||
return BLI_ghash_remove((GHash *)gs, key, keyfreefp, NULL);
|
||||
}
|
||||
|
||||
bool BLI_gset_haskey(GSet *gs, const void *key)
|
||||
bool BLI_gset_haskey(const GSet *gs, const void *key)
|
||||
{
|
||||
return (ghash_lookup_entry((GHash *)gs, key) != NULL);
|
||||
return (ghash_lookup_entry((const GHash *)gs, key) != NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1277,9 +1277,9 @@ void BLI_gset_flag_clear(GSet *gs, uint flag)
|
||||
/**
|
||||
* Returns the pointer to the key if it's found.
|
||||
*/
|
||||
void *BLI_gset_lookup(GSet *gs, const void *key)
|
||||
void *BLI_gset_lookup(const GSet *gs, const void *key)
|
||||
{
|
||||
Entry *e = ghash_lookup_entry((GHash *)gs, key);
|
||||
Entry *e = ghash_lookup_entry((const GHash *)gs, key);
|
||||
return e ? e->key : NULL;
|
||||
}
|
||||
|
||||
@@ -1311,13 +1311,13 @@ void *BLI_gset_pop_key(GSet *gs, const void *key)
|
||||
/**
|
||||
* \return number of buckets in the GHash.
|
||||
*/
|
||||
int BLI_ghash_buckets_len(GHash *gh)
|
||||
int BLI_ghash_buckets_len(const GHash *gh)
|
||||
{
|
||||
return (int)gh->nbuckets;
|
||||
}
|
||||
int BLI_gset_buckets_len(GSet *gs)
|
||||
int BLI_gset_buckets_len(const GSet *gs)
|
||||
{
|
||||
return BLI_ghash_buckets_len((GHash *)gs);
|
||||
return BLI_ghash_buckets_len((const GHash *)gs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -452,7 +452,7 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr)
|
||||
}
|
||||
}
|
||||
|
||||
int BLI_mempool_len(BLI_mempool *pool)
|
||||
int BLI_mempool_len(const BLI_mempool *pool)
|
||||
{
|
||||
return (int)pool->totused;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ BLI_INLINE EdgeHashEntry *edgehash_insert(EdgeHash *eh, Edge edge, void *value)
|
||||
}
|
||||
}
|
||||
|
||||
BLI_INLINE EdgeHashEntry *edgehash_lookup_entry(EdgeHash *eh, uint v0, uint v1)
|
||||
BLI_INLINE EdgeHashEntry *edgehash_lookup_entry(const EdgeHash *eh, uint v0, uint v1)
|
||||
{
|
||||
Edge edge = init_edge(v0, v1);
|
||||
|
||||
@@ -310,7 +310,7 @@ bool BLI_edgehash_reinsert(EdgeHash *eh, uint v0, uint v1, void *value)
|
||||
/**
|
||||
* A version of #BLI_edgehash_lookup which accepts a fallback argument.
|
||||
*/
|
||||
void *BLI_edgehash_lookup_default(EdgeHash *eh, uint v0, uint v1, void *default_value)
|
||||
void *BLI_edgehash_lookup_default(const EdgeHash *eh, uint v0, uint v1, void *default_value)
|
||||
{
|
||||
EdgeHashEntry *entry = edgehash_lookup_entry(eh, v0, v1);
|
||||
return entry ? entry->value : default_value;
|
||||
@@ -322,7 +322,7 @@ void *BLI_edgehash_lookup_default(EdgeHash *eh, uint v0, uint v1, void *default_
|
||||
* to differentiate between key-value being NULL and
|
||||
* lack of key then see #BLI_edgehash_lookup_p().
|
||||
*/
|
||||
void *BLI_edgehash_lookup(EdgeHash *eh, uint v0, uint v1)
|
||||
void *BLI_edgehash_lookup(const EdgeHash *eh, uint v0, uint v1)
|
||||
{
|
||||
EdgeHashEntry *entry = edgehash_lookup_entry(eh, v0, v1);
|
||||
return entry ? entry->value : NULL;
|
||||
@@ -423,7 +423,7 @@ void *BLI_edgehash_popkey(EdgeHash *eh, uint v0, uint v1)
|
||||
/**
|
||||
* Return boolean true/false if edge (v0,v1) in hash.
|
||||
*/
|
||||
bool BLI_edgehash_haskey(EdgeHash *eh, uint v0, uint v1)
|
||||
bool BLI_edgehash_haskey(const EdgeHash *eh, uint v0, uint v1)
|
||||
{
|
||||
return edgehash_lookup_entry(eh, v0, v1) != NULL;
|
||||
}
|
||||
@@ -431,7 +431,7 @@ bool BLI_edgehash_haskey(EdgeHash *eh, uint v0, uint v1)
|
||||
/**
|
||||
* Return number of keys in hash.
|
||||
*/
|
||||
int BLI_edgehash_len(EdgeHash *eh)
|
||||
int BLI_edgehash_len(const EdgeHash *eh)
|
||||
{
|
||||
return (int)eh->length;
|
||||
}
|
||||
@@ -533,7 +533,7 @@ void BLI_edgeset_free(EdgeSet *es)
|
||||
MEM_freeN(es);
|
||||
}
|
||||
|
||||
int BLI_edgeset_len(EdgeSet *es)
|
||||
int BLI_edgeset_len(const EdgeSet *es)
|
||||
{
|
||||
return (int)es->length;
|
||||
}
|
||||
@@ -608,7 +608,7 @@ void BLI_edgeset_insert(EdgeSet *es, uint v0, uint v1)
|
||||
}
|
||||
}
|
||||
|
||||
bool BLI_edgeset_haskey(EdgeSet *es, uint v0, uint v1)
|
||||
bool BLI_edgeset_haskey(const EdgeSet *es, uint v0, uint v1)
|
||||
{
|
||||
Edge edge = init_edge(v0, v1);
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ static void displacement_principled_nodes(bNode *node)
|
||||
}
|
||||
}
|
||||
|
||||
static bool node_has_roughness(bNode *node)
|
||||
static bool node_has_roughness(const bNode *node)
|
||||
{
|
||||
return ELEM(node->type,
|
||||
SH_NODE_BSDF_ANISOTROPIC,
|
||||
|
||||
@@ -1217,7 +1217,7 @@ static bool skip_fcurve_with_name(
|
||||
*
|
||||
* \return true if F-Curve has errors/is disabled
|
||||
*/
|
||||
static bool fcurve_has_errors(FCurve *fcu)
|
||||
static bool fcurve_has_errors(const FCurve *fcu)
|
||||
{
|
||||
/* F-Curve disabled - path eval error */
|
||||
if (fcu->flag & FCURVE_DISABLED) {
|
||||
@@ -1226,7 +1226,7 @@ static bool fcurve_has_errors(FCurve *fcu)
|
||||
|
||||
/* driver? */
|
||||
if (fcu->driver) {
|
||||
ChannelDriver *driver = fcu->driver;
|
||||
const ChannelDriver *driver = fcu->driver;
|
||||
DriverVar *dvar;
|
||||
|
||||
/* error flag on driver usually means that there is an error
|
||||
|
||||
@@ -2810,7 +2810,7 @@ bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
|
||||
/* --------------- API/Per-Datablock Handling ------------------- */
|
||||
|
||||
/* Checks if some F-Curve has a keyframe for a given frame */
|
||||
bool fcurve_frame_has_keyframe(FCurve *fcu, float frame, short filter)
|
||||
bool fcurve_frame_has_keyframe(const FCurve *fcu, float frame, short filter)
|
||||
{
|
||||
/* quick sanity check */
|
||||
if (ELEM(NULL, fcu, fcu->bezt)) {
|
||||
|
||||
@@ -111,10 +111,10 @@ static bool swap_selection_bpoint(BPoint *bp)
|
||||
return select_bpoint(bp, SELECT, SELECT, VISIBLE);
|
||||
}
|
||||
|
||||
bool ED_curve_nurb_select_check(View3D *v3d, Nurb *nu)
|
||||
bool ED_curve_nurb_select_check(const View3D *v3d, const Nurb *nu)
|
||||
{
|
||||
if (nu->type == CU_BEZIER) {
|
||||
BezTriple *bezt;
|
||||
const BezTriple *bezt;
|
||||
int i;
|
||||
|
||||
for (i = nu->pntsu, bezt = nu->bezt; i--; bezt++) {
|
||||
@@ -124,7 +124,7 @@ bool ED_curve_nurb_select_check(View3D *v3d, Nurb *nu)
|
||||
}
|
||||
}
|
||||
else {
|
||||
BPoint *bp;
|
||||
const BPoint *bp;
|
||||
int i;
|
||||
|
||||
for (i = nu->pntsu * nu->pntsv, bp = nu->bp; i--; bp++) {
|
||||
@@ -136,12 +136,12 @@ bool ED_curve_nurb_select_check(View3D *v3d, Nurb *nu)
|
||||
return false;
|
||||
}
|
||||
|
||||
int ED_curve_nurb_select_count(View3D *v3d, Nurb *nu)
|
||||
int ED_curve_nurb_select_count(const View3D *v3d, const Nurb *nu)
|
||||
{
|
||||
int sel = 0;
|
||||
|
||||
if (nu->type == CU_BEZIER) {
|
||||
BezTriple *bezt;
|
||||
const BezTriple *bezt;
|
||||
int i;
|
||||
|
||||
for (i = nu->pntsu, bezt = nu->bezt; i--; bezt++) {
|
||||
@@ -151,7 +151,7 @@ int ED_curve_nurb_select_count(View3D *v3d, Nurb *nu)
|
||||
}
|
||||
}
|
||||
else {
|
||||
BPoint *bp;
|
||||
const BPoint *bp;
|
||||
int i;
|
||||
|
||||
for (i = nu->pntsu * nu->pntsv, bp = nu->bp; i--; bp++) {
|
||||
@@ -227,7 +227,7 @@ bool ED_curve_nurb_deselect_all(const Nurb *nu)
|
||||
return changed;
|
||||
}
|
||||
|
||||
int ED_curve_select_count(View3D *v3d, struct EditNurb *editnurb)
|
||||
int ED_curve_select_count(const View3D *v3d, const EditNurb *editnurb)
|
||||
{
|
||||
int sel = 0;
|
||||
Nurb *nu;
|
||||
@@ -239,9 +239,9 @@ int ED_curve_select_count(View3D *v3d, struct EditNurb *editnurb)
|
||||
return sel;
|
||||
}
|
||||
|
||||
bool ED_curve_select_check(View3D *v3d, struct EditNurb *editnurb)
|
||||
bool ED_curve_select_check(const View3D *v3d, const EditNurb *editnurb)
|
||||
{
|
||||
LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
|
||||
LISTBASE_FOREACH (const Nurb *, nu, &editnurb->nurbs) {
|
||||
if (ED_curve_nurb_select_check(v3d, nu)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -319,9 +319,9 @@ bool ED_gizmotypes_snap_3d_invert_snap_get(struct wmGizmo *gz)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ED_gizmotypes_snap_3d_is_enabled(wmGizmo *gz)
|
||||
bool ED_gizmotypes_snap_3d_is_enabled(const wmGizmo *gz)
|
||||
{
|
||||
SnapGizmo3D *snap_gizmo = (SnapGizmo3D *)gz;
|
||||
const SnapGizmo3D *snap_gizmo = (const SnapGizmo3D *)gz;
|
||||
return snap_gizmo->is_enabled;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ void ED_gpencil_layer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, bool onlys
|
||||
/* Selection Tools */
|
||||
|
||||
/* check if one of the frames in this layer is selected */
|
||||
bool ED_gpencil_layer_frame_select_check(bGPDlayer *gpl)
|
||||
bool ED_gpencil_layer_frame_select_check(const bGPDlayer *gpl)
|
||||
{
|
||||
/* error checking */
|
||||
if (gpl == NULL) {
|
||||
@@ -115,7 +115,7 @@ bool ED_gpencil_layer_frame_select_check(bGPDlayer *gpl)
|
||||
}
|
||||
|
||||
/* stop at the first one found */
|
||||
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
|
||||
LISTBASE_FOREACH (const bGPDframe *, gpf, &gpl->frames) {
|
||||
if (gpf->flag & GP_FRAME_SELECT) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -871,20 +871,20 @@ void GPENCIL_OT_frame_clean_loose(wmOperatorType *ot)
|
||||
}
|
||||
|
||||
/* ********************* Clean Duplicated Frames ************************** */
|
||||
static bool gpencil_frame_is_equal(bGPDframe *gpf_a, bGPDframe *gpf_b)
|
||||
static bool gpencil_frame_is_equal(const bGPDframe *gpf_a, const bGPDframe *gpf_b)
|
||||
{
|
||||
if ((gpf_a == NULL) || (gpf_b == NULL)) {
|
||||
return false;
|
||||
}
|
||||
/* If the number of strokes is different, cannot be equal. */
|
||||
int totstrokes_a = BLI_listbase_count(&gpf_a->strokes);
|
||||
int totstrokes_b = BLI_listbase_count(&gpf_b->strokes);
|
||||
const int totstrokes_a = BLI_listbase_count(&gpf_a->strokes);
|
||||
const int totstrokes_b = BLI_listbase_count(&gpf_b->strokes);
|
||||
if ((totstrokes_a == 0) || (totstrokes_b == 0) || (totstrokes_a != totstrokes_b)) {
|
||||
return false;
|
||||
}
|
||||
/* Loop all strokes and check. */
|
||||
bGPDstroke *gps_a = gpf_a->strokes.first;
|
||||
bGPDstroke *gps_b = gpf_b->strokes.first;
|
||||
const bGPDstroke *gps_a = gpf_a->strokes.first;
|
||||
const bGPDstroke *gps_b = gpf_b->strokes.first;
|
||||
for (int i = 0; i < totstrokes_a; i++) {
|
||||
/* If the number of points is different, cannot be equal. */
|
||||
if (gps_a->totpoints != gps_b->totpoints) {
|
||||
@@ -924,8 +924,8 @@ static bool gpencil_frame_is_equal(bGPDframe *gpf_a, bGPDframe *gpf_b)
|
||||
|
||||
/* Loop points and check if equals or not. */
|
||||
for (int p = 0; p < gps_a->totpoints; p++) {
|
||||
bGPDspoint *pt_a = &gps_a->points[p];
|
||||
bGPDspoint *pt_b = &gps_b->points[p];
|
||||
const bGPDspoint *pt_a = &gps_a->points[p];
|
||||
const bGPDspoint *pt_b = &gps_b->points[p];
|
||||
if (!equals_v3v3(&pt_a->x, &pt_b->x)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1381,7 +1381,7 @@ static float gpencil_sculpt_rotation_eval_get(tGP_BrushEditData *gso,
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
GP_SpaceConversion *gsc = &gso->gsc;
|
||||
const GP_SpaceConversion *gsc = &gso->gsc;
|
||||
bGPDstroke *gps_orig = (gps_eval->runtime.gps_orig) ? gps_eval->runtime.gps_orig : gps_eval;
|
||||
bGPDspoint *pt_orig = &gps_orig->points[pt_eval->runtime.idx_orig];
|
||||
bGPDspoint *pt_prev_eval = NULL;
|
||||
|
||||
@@ -3106,8 +3106,8 @@ void ED_gpencil_sbuffer_vertex_color_set(Depsgraph *depsgraph,
|
||||
}
|
||||
|
||||
/* Get the bigger 2D bound box points. */
|
||||
void ED_gpencil_projected_2d_bound_box(GP_SpaceConversion *gsc,
|
||||
bGPDstroke *gps,
|
||||
void ED_gpencil_projected_2d_bound_box(const GP_SpaceConversion *gsc,
|
||||
const bGPDstroke *gps,
|
||||
const float diff_mat[4][4],
|
||||
float r_min[2],
|
||||
float r_max[2])
|
||||
@@ -3140,7 +3140,7 @@ void ED_gpencil_projected_2d_bound_box(GP_SpaceConversion *gsc,
|
||||
}
|
||||
|
||||
/* Check if the stroke collides with brush. */
|
||||
bool ED_gpencil_stroke_check_collision(GP_SpaceConversion *gsc,
|
||||
bool ED_gpencil_stroke_check_collision(const GP_SpaceConversion *gsc,
|
||||
bGPDstroke *gps,
|
||||
const float mouse[2],
|
||||
const int radius,
|
||||
@@ -3175,9 +3175,9 @@ bool ED_gpencil_stroke_check_collision(GP_SpaceConversion *gsc,
|
||||
* \param diff_mat: View matrix.
|
||||
* \return True if the point is inside.
|
||||
*/
|
||||
bool ED_gpencil_stroke_point_is_inside(bGPDstroke *gps,
|
||||
GP_SpaceConversion *gsc,
|
||||
int mouse[2],
|
||||
bool ED_gpencil_stroke_point_is_inside(const bGPDstroke *gps,
|
||||
const GP_SpaceConversion *gsc,
|
||||
const int mouse[2],
|
||||
const float diff_mat[4][4])
|
||||
{
|
||||
bool hit = false;
|
||||
@@ -3190,7 +3190,7 @@ bool ED_gpencil_stroke_point_is_inside(bGPDstroke *gps,
|
||||
mcoords = MEM_mallocN(sizeof(int[2]) * len, __func__);
|
||||
|
||||
/* Convert stroke to 2D array of points. */
|
||||
bGPDspoint *pt;
|
||||
const bGPDspoint *pt;
|
||||
int i;
|
||||
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
|
||||
bGPDspoint pt2;
|
||||
@@ -3214,7 +3214,7 @@ bool ED_gpencil_stroke_point_is_inside(bGPDstroke *gps,
|
||||
}
|
||||
|
||||
bGPDstroke *ED_gpencil_stroke_nearest_to_ends(bContext *C,
|
||||
GP_SpaceConversion *gsc,
|
||||
const GP_SpaceConversion *gsc,
|
||||
bGPDlayer *gpl,
|
||||
bGPDframe *gpf,
|
||||
bGPDstroke *gps,
|
||||
|
||||
@@ -60,21 +60,21 @@ bool ED_curve_editnurb_select_pick(
|
||||
struct Nurb *ED_curve_add_nurbs_primitive(
|
||||
struct bContext *C, struct Object *obedit, float mat[4][4], int type, int newob);
|
||||
|
||||
bool ED_curve_nurb_select_check(struct View3D *v3d, struct Nurb *nu);
|
||||
int ED_curve_nurb_select_count(struct View3D *v3d, struct Nurb *nu);
|
||||
bool ED_curve_nurb_select_check(const struct View3D *v3d, const struct Nurb *nu);
|
||||
int ED_curve_nurb_select_count(const struct View3D *v3d, const struct Nurb *nu);
|
||||
bool ED_curve_nurb_select_all(const struct Nurb *nu);
|
||||
bool ED_curve_nurb_deselect_all(const struct Nurb *nu);
|
||||
|
||||
int ED_curve_join_objects_exec(struct bContext *C, struct wmOperator *op);
|
||||
|
||||
/* editcurve_select.c */
|
||||
bool ED_curve_select_check(struct View3D *v3d, struct EditNurb *editnurb);
|
||||
bool ED_curve_select_check(const struct View3D *v3d, const struct EditNurb *editnurb);
|
||||
bool ED_curve_deselect_all(struct EditNurb *editnurb);
|
||||
bool ED_curve_deselect_all_multi_ex(struct Base **bases, int bases_len);
|
||||
bool ED_curve_deselect_all_multi(struct bContext *C);
|
||||
bool ED_curve_select_all(struct EditNurb *editnurb);
|
||||
bool ED_curve_select_swap(struct EditNurb *editnurb, bool hide_handles);
|
||||
int ED_curve_select_count(struct View3D *v3d, struct EditNurb *editnurb);
|
||||
int ED_curve_select_count(const struct View3D *v3d, const struct EditNurb *editnurb);
|
||||
|
||||
/* editcurve_undo.c */
|
||||
void ED_curve_undosys_type(struct UndoType *ut);
|
||||
|
||||
@@ -275,7 +275,7 @@ void ED_gizmotypes_snap_3d_flag_clear(struct wmGizmo *gz, eSnapGizmo flag);
|
||||
bool ED_gizmotypes_snap_3d_flag_test(struct wmGizmo *gz, eSnapGizmo flag);
|
||||
|
||||
bool ED_gizmotypes_snap_3d_invert_snap_get(struct wmGizmo *gz);
|
||||
bool ED_gizmotypes_snap_3d_is_enabled(struct wmGizmo *gz);
|
||||
bool ED_gizmotypes_snap_3d_is_enabled(const struct wmGizmo *gz);
|
||||
|
||||
short ED_gizmotypes_snap_3d_update(struct wmGizmo *gz,
|
||||
struct Depsgraph *depsgraph,
|
||||
|
||||
@@ -189,7 +189,7 @@ bool ED_gpencil_layer_frames_looper(struct bGPDlayer *gpl,
|
||||
bool (*gpf_cb)(struct bGPDframe *, struct Scene *));
|
||||
void ED_gpencil_layer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, bool onlysel);
|
||||
|
||||
bool ED_gpencil_layer_frame_select_check(struct bGPDlayer *gpl);
|
||||
bool ED_gpencil_layer_frame_select_check(const struct bGPDlayer *gpl);
|
||||
void ED_gpencil_layer_frame_select_set(struct bGPDlayer *gpl, short mode);
|
||||
void ED_gpencil_layer_frames_select_box(struct bGPDlayer *gpl,
|
||||
float min,
|
||||
@@ -364,23 +364,23 @@ void ED_gpencil_init_random_settings(struct Brush *brush,
|
||||
const int mval[2],
|
||||
struct GpRandomSettings *random_settings);
|
||||
|
||||
bool ED_gpencil_stroke_check_collision(struct GP_SpaceConversion *gsc,
|
||||
bool ED_gpencil_stroke_check_collision(const struct GP_SpaceConversion *gsc,
|
||||
struct bGPDstroke *gps,
|
||||
const float mouse[2],
|
||||
const int radius,
|
||||
const float diff_mat[4][4]);
|
||||
bool ED_gpencil_stroke_point_is_inside(struct bGPDstroke *gps,
|
||||
struct GP_SpaceConversion *gsc,
|
||||
int mouse[2],
|
||||
bool ED_gpencil_stroke_point_is_inside(const struct bGPDstroke *gps,
|
||||
const struct GP_SpaceConversion *gsc,
|
||||
const int mouse[2],
|
||||
const float diff_mat[4][4]);
|
||||
void ED_gpencil_projected_2d_bound_box(struct GP_SpaceConversion *gsc,
|
||||
struct bGPDstroke *gps,
|
||||
void ED_gpencil_projected_2d_bound_box(const struct GP_SpaceConversion *gsc,
|
||||
const struct bGPDstroke *gps,
|
||||
const float diff_mat[4][4],
|
||||
float r_min[2],
|
||||
float r_max[2]);
|
||||
|
||||
struct bGPDstroke *ED_gpencil_stroke_nearest_to_ends(struct bContext *C,
|
||||
struct GP_SpaceConversion *gsc,
|
||||
const struct GP_SpaceConversion *gsc,
|
||||
struct bGPDlayer *gpl,
|
||||
struct bGPDframe *gpf,
|
||||
struct bGPDstroke *gps,
|
||||
|
||||
@@ -452,7 +452,7 @@ bool autokeyframe_cfra_can_key(const struct Scene *scene, struct ID *id);
|
||||
/* Lesser Keyframe Checking API call:
|
||||
* - Used for the buttons to check for keyframes...
|
||||
*/
|
||||
bool fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter);
|
||||
bool fcurve_frame_has_keyframe(const struct FCurve *fcu, float frame, short filter);
|
||||
|
||||
/* Lesser Keyframe Checking API call:
|
||||
* - Returns whether the current value of a given property differs from the interpolated value.
|
||||
|
||||
@@ -100,7 +100,7 @@ bool ED_masklayer_frames_looper(struct MaskLayer *mask_layer,
|
||||
struct Scene *));
|
||||
void ED_masklayer_make_cfra_list(struct MaskLayer *mask_layer, ListBase *elems, bool onlysel);
|
||||
|
||||
bool ED_masklayer_frame_select_check(struct MaskLayer *mask_layer);
|
||||
bool ED_masklayer_frame_select_check(const struct MaskLayer *mask_layer);
|
||||
void ED_masklayer_frame_select_set(struct MaskLayer *mask_layer, short mode);
|
||||
void ED_masklayer_frames_select_box(struct MaskLayer *mask_layer,
|
||||
float min,
|
||||
|
||||
@@ -110,7 +110,7 @@ bool ED_node_is_geometry(struct SpaceNode *snode);
|
||||
void ED_node_shader_default(const struct bContext *C, struct ID *id);
|
||||
void ED_node_composit_default(const struct bContext *C, struct Scene *scene);
|
||||
void ED_node_texture_default(const struct bContext *C, struct Tex *tex);
|
||||
bool ED_node_select_check(ListBase *lb);
|
||||
bool ED_node_select_check(const ListBase *lb);
|
||||
void ED_node_select_all(ListBase *lb, int action);
|
||||
void ED_node_post_apply_transform(struct bContext *C, struct bNodeTree *ntree);
|
||||
void ED_node_set_active(struct Main *bmain,
|
||||
|
||||
@@ -62,7 +62,8 @@ struct Object *ED_object_active_context(const struct bContext *C);
|
||||
void ED_collection_hide_menu_draw(const struct bContext *C, struct uiLayout *layout);
|
||||
|
||||
Object **ED_object_array_in_mode_or_selected(struct bContext *C,
|
||||
bool (*filter_fn)(struct Object *ob, void *user_data),
|
||||
bool (*filter_fn)(const struct Object *ob,
|
||||
void *user_data),
|
||||
void *filter_user_data,
|
||||
uint *r_objects_len);
|
||||
|
||||
@@ -387,7 +388,7 @@ void ED_object_mode_generic_exit(struct Main *bmain,
|
||||
struct Depsgraph *depsgraph,
|
||||
struct Scene *scene,
|
||||
struct Object *ob);
|
||||
bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, struct Object *ob);
|
||||
bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, const struct Object *ob);
|
||||
|
||||
void ED_object_posemode_set_for_weight_paint(struct bContext *C,
|
||||
struct Main *bmain,
|
||||
|
||||
@@ -3489,7 +3489,7 @@ static void widget_menubut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state),
|
||||
/**
|
||||
* Draw menu buttons still with triangles when field is not embossed
|
||||
*/
|
||||
static void widget_menubut_embossn(uiBut *UNUSED(but),
|
||||
static void widget_menubut_embossn(const uiBut *UNUSED(but),
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
@@ -3512,7 +3512,7 @@ static void widget_menubut_embossn(uiBut *UNUSED(but),
|
||||
* Draw number buttons still with triangles when field is not embossed
|
||||
*/
|
||||
static void widget_numbut_embossn(
|
||||
uiBut *UNUSED(but), uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
|
||||
const uiBut *UNUSED(but), uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
|
||||
{
|
||||
widget_numbut_draw(wcol, rect, state, roundboxalign, true);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void ED_masklayer_make_cfra_list(MaskLayer *mask_layer, ListBase *elems, bool on
|
||||
/* Selection Tools */
|
||||
|
||||
/* check if one of the frames in this layer is selected */
|
||||
bool ED_masklayer_frame_select_check(MaskLayer *mask_layer)
|
||||
bool ED_masklayer_frame_select_check(const MaskLayer *mask_layer)
|
||||
{
|
||||
MaskLayerShape *mask_layer_shape;
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ Object *ED_object_active_context(const bContext *C)
|
||||
* (assuming they need to be modified).
|
||||
*/
|
||||
Object **ED_object_array_in_mode_or_selected(bContext *C,
|
||||
bool (*filter_fn)(Object *ob, void *user_data),
|
||||
bool (*filter_fn)(const Object *ob, void *user_data),
|
||||
void *filter_user_data,
|
||||
uint *r_objects_len)
|
||||
{
|
||||
|
||||
@@ -401,9 +401,9 @@ void ED_object_mode_generic_exit(struct Main *bmain,
|
||||
ed_object_mode_generic_exit_ex(bmain, depsgraph, scene, ob, false);
|
||||
}
|
||||
|
||||
bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, struct Object *ob)
|
||||
bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, const struct Object *ob)
|
||||
{
|
||||
return ed_object_mode_generic_exit_ex(NULL, depsgraph, NULL, ob, true);
|
||||
return ed_object_mode_generic_exit_ex(NULL, depsgraph, NULL, (Object *)ob, true);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -83,7 +83,7 @@ static bool vertex_group_supported_poll_ex(bContext *C, const Object *ob);
|
||||
/** \name Local Utility Functions
|
||||
* \{ */
|
||||
|
||||
static bool object_array_for_wpaint_filter(Object *ob, void *user_data)
|
||||
static bool object_array_for_wpaint_filter(const Object *ob, void *user_data)
|
||||
{
|
||||
bContext *C = user_data;
|
||||
if (vertex_group_supported_poll_ex(C, ob)) {
|
||||
|
||||
@@ -103,7 +103,7 @@ static bool object_materials_supported_poll_ex(bContext *C, const Object *ob);
|
||||
/** \name Local Utilities
|
||||
* \{ */
|
||||
|
||||
static bool object_array_for_shading_edit_mode_enabled_filter(Object *ob, void *user_data)
|
||||
static bool object_array_for_shading_edit_mode_enabled_filter(const Object *ob, void *user_data)
|
||||
{
|
||||
bContext *C = user_data;
|
||||
if (object_materials_supported_poll_ex(C, ob)) {
|
||||
@@ -120,7 +120,7 @@ static Object **object_array_for_shading_edit_mode_enabled(bContext *C, uint *r_
|
||||
C, object_array_for_shading_edit_mode_enabled_filter, C, r_objects_len);
|
||||
}
|
||||
|
||||
static bool object_array_for_shading_edit_mode_disabled_filter(Object *ob, void *user_data)
|
||||
static bool object_array_for_shading_edit_mode_disabled_filter(const Object *ob, void *user_data)
|
||||
{
|
||||
bContext *C = user_data;
|
||||
if (object_materials_supported_poll_ex(C, ob)) {
|
||||
|
||||
@@ -1357,9 +1357,9 @@ void NODE_OT_duplicate(wmOperatorType *ot)
|
||||
ot->srna, "keep_inputs", false, "Keep Inputs", "Keep the input links to duplicated nodes");
|
||||
}
|
||||
|
||||
bool ED_node_select_check(ListBase *lb)
|
||||
bool ED_node_select_check(const ListBase *lb)
|
||||
{
|
||||
LISTBASE_FOREACH (bNode *, node, lb) {
|
||||
LISTBASE_FOREACH (const bNode *, node, lb) {
|
||||
if (node->flag & NODE_SELECT) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1150,7 +1150,7 @@ int constraintModeToIndex(const TransInfo *t)
|
||||
}
|
||||
}
|
||||
|
||||
bool isLockConstraint(TransInfo *t)
|
||||
bool isLockConstraint(const TransInfo *t)
|
||||
{
|
||||
int mode = t->con.mode;
|
||||
|
||||
|
||||
@@ -46,5 +46,5 @@ void postSelectConstraint(TransInfo *t);
|
||||
void setNearestAxis(TransInfo *t);
|
||||
int constraintModeToIndex(const TransInfo *t);
|
||||
char constraintModeToChar(const TransInfo *t);
|
||||
bool isLockConstraint(TransInfo *t);
|
||||
bool isLockConstraint(const TransInfo *t);
|
||||
int getConstraintSpaceDimension(const TransInfo *t);
|
||||
|
||||
@@ -1358,9 +1358,9 @@ int RNA_parameter_flag(PropertyRNA *prop);
|
||||
|
||||
ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr, FunctionRNA *func);
|
||||
void RNA_parameter_list_free(ParameterList *parms);
|
||||
int RNA_parameter_list_size(ParameterList *parms);
|
||||
int RNA_parameter_list_arg_count(ParameterList *parms);
|
||||
int RNA_parameter_list_ret_count(ParameterList *parms);
|
||||
int RNA_parameter_list_size(const ParameterList *parms);
|
||||
int RNA_parameter_list_arg_count(const ParameterList *parms);
|
||||
int RNA_parameter_list_ret_count(const ParameterList *parms);
|
||||
|
||||
void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter);
|
||||
void RNA_parameter_list_next(ParameterIterator *iter);
|
||||
|
||||
@@ -7357,17 +7357,17 @@ void RNA_parameter_list_free(ParameterList *parms)
|
||||
parms->func = NULL;
|
||||
}
|
||||
|
||||
int RNA_parameter_list_size(ParameterList *parms)
|
||||
int RNA_parameter_list_size(const ParameterList *parms)
|
||||
{
|
||||
return parms->alloc_size;
|
||||
}
|
||||
|
||||
int RNA_parameter_list_arg_count(ParameterList *parms)
|
||||
int RNA_parameter_list_arg_count(const ParameterList *parms)
|
||||
{
|
||||
return parms->arg_count;
|
||||
}
|
||||
|
||||
int RNA_parameter_list_ret_count(ParameterList *parms)
|
||||
int RNA_parameter_list_ret_count(const ParameterList *parms)
|
||||
{
|
||||
return parms->ret_count;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ void modifier_vgroup_ui(uiLayout *layout,
|
||||
* Check whether Modifier is a simulation or not. Used for switching to the
|
||||
* physics/particles context tab.
|
||||
*/
|
||||
static int modifier_is_simulation(ModifierData *md)
|
||||
static int modifier_is_simulation(const ModifierData *md)
|
||||
{
|
||||
/* Physic Tab */
|
||||
if (ELEM(md->type,
|
||||
|
||||
@@ -76,7 +76,7 @@ typedef struct BakeHighPolyData {
|
||||
} BakeHighPolyData;
|
||||
|
||||
/* external_engine.c */
|
||||
bool RE_bake_has_engine(struct Render *re);
|
||||
bool RE_bake_has_engine(const struct Render *re);
|
||||
|
||||
bool RE_bake_engine(struct Render *re,
|
||||
struct Depsgraph *depsgraph,
|
||||
|
||||
@@ -735,9 +735,9 @@ void RE_bake_engine_set_engine_parameters(Render *re, Main *bmain, Scene *scene)
|
||||
render_copy_renderdata(&re->r, &scene->r);
|
||||
}
|
||||
|
||||
bool RE_bake_has_engine(Render *re)
|
||||
bool RE_bake_has_engine(const Render *re)
|
||||
{
|
||||
RenderEngineType *type = RE_engines_find(re->r.engine);
|
||||
const RenderEngineType *type = RE_engines_find(re->r.engine);
|
||||
return (type->bake != NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -804,9 +804,9 @@ void render_result_views_new(RenderResult *rr, const RenderData *rd)
|
||||
}
|
||||
}
|
||||
|
||||
bool render_result_has_views(RenderResult *rr)
|
||||
bool render_result_has_views(const RenderResult *rr)
|
||||
{
|
||||
RenderView *rv = rr->views.first;
|
||||
const RenderView *rv = rr->views.first;
|
||||
return (rv && (rv->next || rv->name[0]));
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ void render_result_rect_get_pixels(struct RenderResult *rr,
|
||||
|
||||
void render_result_views_shallowcopy(struct RenderResult *dst, struct RenderResult *src);
|
||||
void render_result_views_shallowdelete(struct RenderResult *rr);
|
||||
bool render_result_has_views(struct RenderResult *rr);
|
||||
bool render_result_has_views(const struct RenderResult *rr);
|
||||
|
||||
#define FOREACH_VIEW_LAYER_TO_RENDER_BEGIN(re_, iter_) \
|
||||
{ \
|
||||
|
||||
@@ -71,7 +71,7 @@ bool SEQ_iterator_ensure(SeqCollection *collection,
|
||||
struct Sequence *SEQ_iterator_yield(SeqIterator *iterator);
|
||||
|
||||
SeqCollection *SEQ_collection_create(void);
|
||||
uint SEQ_collection_len(SeqCollection *collection);
|
||||
uint SEQ_collection_len(const SeqCollection *collection);
|
||||
bool SEQ_collection_append_strip(struct Sequence *seq, SeqCollection *data);
|
||||
bool SEQ_collection_remove_strip(struct Sequence *seq, SeqCollection *data);
|
||||
void SEQ_collection_free(SeqCollection *collection);
|
||||
|
||||
@@ -49,7 +49,7 @@ struct Sequence *SEQ_get_sequence_by_name(struct ListBase *seqbase,
|
||||
bool recursive);
|
||||
struct Mask *SEQ_active_mask_get(struct Scene *scene);
|
||||
void SEQ_alpha_mode_from_file_extension(struct Sequence *seq);
|
||||
bool SEQ_sequence_has_source(struct Sequence *seq);
|
||||
bool SEQ_sequence_has_source(const struct Sequence *seq);
|
||||
void SEQ_set_scale_to_fit(const struct Sequence *seq,
|
||||
const int image_width,
|
||||
const int image_height,
|
||||
|
||||
@@ -117,7 +117,7 @@ SeqCollection *SEQ_collection_create(void)
|
||||
/**
|
||||
* Return number of items in collection.
|
||||
*/
|
||||
uint SEQ_collection_len(SeqCollection *collection)
|
||||
uint SEQ_collection_len(const SeqCollection *collection)
|
||||
{
|
||||
return BLI_gset_len(collection->set);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ typedef struct PrefetchJob {
|
||||
bool stop;
|
||||
} PrefetchJob;
|
||||
|
||||
static bool seq_prefetch_is_playing(Main *bmain)
|
||||
static bool seq_prefetch_is_playing(const Main *bmain)
|
||||
{
|
||||
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||
if (screen->animtimer) {
|
||||
@@ -101,7 +101,7 @@ static bool seq_prefetch_is_playing(Main *bmain)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool seq_prefetch_is_scrubbing(Main *bmain)
|
||||
static bool seq_prefetch_is_scrubbing(const Main *bmain)
|
||||
{
|
||||
|
||||
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||
|
||||
@@ -87,7 +87,7 @@ static void seq_sequence_lookup_rebuild(const struct Scene *scene, struct Sequen
|
||||
seq_sequence_lookup_build(scene, *lookup);
|
||||
}
|
||||
|
||||
static bool seq_sequence_lookup_is_valid(struct SequenceLookup *lookup)
|
||||
static bool seq_sequence_lookup_is_valid(const struct SequenceLookup *lookup)
|
||||
{
|
||||
return (lookup->tag & SEQ_LOOKUP_TAG_INVALID) == 0;
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ void SEQ_alpha_mode_from_file_extension(Sequence *seq)
|
||||
|
||||
/* called on draw, needs to be fast,
|
||||
* we could cache and use a flag if we want to make checks for file paths resolving for eg. */
|
||||
bool SEQ_sequence_has_source(Sequence *seq)
|
||||
bool SEQ_sequence_has_source(const Sequence *seq)
|
||||
{
|
||||
switch (seq->type) {
|
||||
case SEQ_TYPE_MASK:
|
||||
|
||||
@@ -775,20 +775,20 @@ enum {
|
||||
|
||||
struct wmJob *WM_jobs_get(struct wmWindowManager *wm,
|
||||
struct wmWindow *win,
|
||||
void *owner,
|
||||
const void *owner,
|
||||
const char *name,
|
||||
int flag,
|
||||
int job_type);
|
||||
|
||||
bool WM_jobs_test(struct wmWindowManager *wm, void *owner, int job_type);
|
||||
float WM_jobs_progress(struct wmWindowManager *wm, void *owner);
|
||||
char *WM_jobs_name(struct wmWindowManager *wm, void *owner);
|
||||
double WM_jobs_starttime(struct wmWindowManager *wm, void *owner);
|
||||
void *WM_jobs_customdata(struct wmWindowManager *wm, void *owner);
|
||||
bool WM_jobs_test(const struct wmWindowManager *wm, const void *owner, int job_type);
|
||||
float WM_jobs_progress(const struct wmWindowManager *wm, const void *owner);
|
||||
const char *WM_jobs_name(const struct wmWindowManager *wm, const void *owner);
|
||||
double WM_jobs_starttime(const struct wmWindowManager *wm, const void *owner);
|
||||
void *WM_jobs_customdata(struct wmWindowManager *wm, const void *owner);
|
||||
void *WM_jobs_customdata_from_type(struct wmWindowManager *wm, int job_type);
|
||||
|
||||
bool WM_jobs_is_running(struct wmJob *);
|
||||
bool WM_jobs_is_stopped(wmWindowManager *wm, void *owner);
|
||||
bool WM_jobs_is_running(const struct wmJob *wm_job);
|
||||
bool WM_jobs_is_stopped(const wmWindowManager *wm, const void *owner);
|
||||
void *WM_jobs_customdata_get(struct wmJob *);
|
||||
void WM_jobs_customdata_set(struct wmJob *, void *customdata, void (*free)(void *));
|
||||
void WM_jobs_timer(struct wmJob *, double timestep, unsigned int note, unsigned int endnote);
|
||||
@@ -805,15 +805,15 @@ void WM_jobs_callbacks(struct wmJob *,
|
||||
void (*endjob)(void *));
|
||||
|
||||
void WM_jobs_start(struct wmWindowManager *wm, struct wmJob *);
|
||||
void WM_jobs_stop(struct wmWindowManager *wm, void *owner, void *startjob);
|
||||
void WM_jobs_stop(struct wmWindowManager *wm, const void *owner, void *startjob);
|
||||
void WM_jobs_kill(struct wmWindowManager *wm,
|
||||
void *owner,
|
||||
void (*)(void *, short int *, short int *, float *));
|
||||
void WM_jobs_kill_all(struct wmWindowManager *wm);
|
||||
void WM_jobs_kill_all_except(struct wmWindowManager *wm, void *owner);
|
||||
void WM_jobs_kill_type(struct wmWindowManager *wm, void *owner, int job_type);
|
||||
void WM_jobs_kill_all_except(struct wmWindowManager *wm, const void *owner);
|
||||
void WM_jobs_kill_type(struct wmWindowManager *wm, const void *owner, int job_type);
|
||||
|
||||
bool WM_jobs_has_running(struct wmWindowManager *wm);
|
||||
bool WM_jobs_has_running(const struct wmWindowManager *wm);
|
||||
|
||||
void WM_job_main_thread_lock_acquire(struct wmJob *job);
|
||||
void WM_job_main_thread_lock_release(struct wmJob *job);
|
||||
|
||||
@@ -113,7 +113,7 @@ struct wmJob {
|
||||
unsigned int note, endnote;
|
||||
|
||||
/* internal */
|
||||
void *owner;
|
||||
const void *owner;
|
||||
int flag;
|
||||
short suspended, running, ready, do_update, stop, job_type;
|
||||
float progress;
|
||||
@@ -158,7 +158,7 @@ static void wm_job_main_thread_yield(wmJob *wm_job)
|
||||
/**
|
||||
* Finds if type or owner, compare for it, otherwise any matching job.
|
||||
*/
|
||||
static wmJob *wm_job_find(wmWindowManager *wm, void *owner, const int job_type)
|
||||
static wmJob *wm_job_find(const wmWindowManager *wm, const void *owner, const int job_type)
|
||||
{
|
||||
if (owner && job_type) {
|
||||
LISTBASE_FOREACH (wmJob *, wm_job, &wm->jobs) {
|
||||
@@ -193,8 +193,12 @@ static wmJob *wm_job_find(wmWindowManager *wm, void *owner, const int job_type)
|
||||
* \note every owner only gets a single job,
|
||||
* adding a new one will stop running job and when stopped it starts the new one.
|
||||
*/
|
||||
wmJob *WM_jobs_get(
|
||||
wmWindowManager *wm, wmWindow *win, void *owner, const char *name, int flag, int job_type)
|
||||
wmJob *WM_jobs_get(wmWindowManager *wm,
|
||||
wmWindow *win,
|
||||
const void *owner,
|
||||
const char *name,
|
||||
int flag,
|
||||
int job_type)
|
||||
{
|
||||
wmJob *wm_job = wm_job_find(wm, owner, job_type);
|
||||
|
||||
@@ -220,7 +224,7 @@ wmJob *WM_jobs_get(
|
||||
}
|
||||
|
||||
/* returns true if job runs, for UI (progress) indicators */
|
||||
bool WM_jobs_test(wmWindowManager *wm, void *owner, int job_type)
|
||||
bool WM_jobs_test(const wmWindowManager *wm, const void *owner, int job_type)
|
||||
{
|
||||
/* job can be running or about to run (suspended) */
|
||||
LISTBASE_FOREACH (wmJob *, wm_job, &wm->jobs) {
|
||||
@@ -236,9 +240,9 @@ bool WM_jobs_test(wmWindowManager *wm, void *owner, int job_type)
|
||||
return false;
|
||||
}
|
||||
|
||||
float WM_jobs_progress(wmWindowManager *wm, void *owner)
|
||||
float WM_jobs_progress(const wmWindowManager *wm, const void *owner)
|
||||
{
|
||||
wmJob *wm_job = wm_job_find(wm, owner, WM_JOB_TYPE_ANY);
|
||||
const wmJob *wm_job = wm_job_find(wm, owner, WM_JOB_TYPE_ANY);
|
||||
|
||||
if (wm_job && wm_job->flag & WM_JOB_PROGRESS) {
|
||||
return wm_job->progress;
|
||||
@@ -278,9 +282,9 @@ static void wm_jobs_update_progress_bars(wmWindowManager *wm)
|
||||
}
|
||||
|
||||
/* time that job started */
|
||||
double WM_jobs_starttime(wmWindowManager *wm, void *owner)
|
||||
double WM_jobs_starttime(const wmWindowManager *wm, const void *owner)
|
||||
{
|
||||
wmJob *wm_job = wm_job_find(wm, owner, WM_JOB_TYPE_ANY);
|
||||
const wmJob *wm_job = wm_job_find(wm, owner, WM_JOB_TYPE_ANY);
|
||||
|
||||
if (wm_job && wm_job->flag & WM_JOB_PROGRESS) {
|
||||
return wm_job->start_time;
|
||||
@@ -289,7 +293,7 @@ double WM_jobs_starttime(wmWindowManager *wm, void *owner)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *WM_jobs_name(wmWindowManager *wm, void *owner)
|
||||
const char *WM_jobs_name(const wmWindowManager *wm, const void *owner)
|
||||
{
|
||||
wmJob *wm_job = wm_job_find(wm, owner, WM_JOB_TYPE_ANY);
|
||||
|
||||
@@ -300,7 +304,7 @@ char *WM_jobs_name(wmWindowManager *wm, void *owner)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *WM_jobs_customdata(wmWindowManager *wm, void *owner)
|
||||
void *WM_jobs_customdata(wmWindowManager *wm, const void *owner)
|
||||
{
|
||||
wmJob *wm_job = wm_job_find(wm, owner, WM_JOB_TYPE_ANY);
|
||||
|
||||
@@ -322,12 +326,12 @@ void *WM_jobs_customdata_from_type(wmWindowManager *wm, int job_type)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool WM_jobs_is_running(wmJob *wm_job)
|
||||
bool WM_jobs_is_running(const wmJob *wm_job)
|
||||
{
|
||||
return wm_job->running;
|
||||
}
|
||||
|
||||
bool WM_jobs_is_stopped(wmWindowManager *wm, void *owner)
|
||||
bool WM_jobs_is_stopped(const wmWindowManager *wm, const void *owner)
|
||||
{
|
||||
wmJob *wm_job = wm_job_find(wm, owner, WM_JOB_TYPE_ANY);
|
||||
return wm_job ? wm_job->stop : true; /* XXX to be redesigned properly. */
|
||||
@@ -560,7 +564,7 @@ void WM_jobs_kill_all(wmWindowManager *wm)
|
||||
}
|
||||
|
||||
/* wait until every job ended, except for one owner (used in undo to keep screen job alive) */
|
||||
void WM_jobs_kill_all_except(wmWindowManager *wm, void *owner)
|
||||
void WM_jobs_kill_all_except(wmWindowManager *wm, const void *owner)
|
||||
{
|
||||
LISTBASE_FOREACH_MUTABLE (wmJob *, wm_job, &wm->jobs) {
|
||||
if (wm_job->owner != owner) {
|
||||
@@ -569,7 +573,7 @@ void WM_jobs_kill_all_except(wmWindowManager *wm, void *owner)
|
||||
}
|
||||
}
|
||||
|
||||
void WM_jobs_kill_type(struct wmWindowManager *wm, void *owner, int job_type)
|
||||
void WM_jobs_kill_type(struct wmWindowManager *wm, const void *owner, int job_type)
|
||||
{
|
||||
LISTBASE_FOREACH_MUTABLE (wmJob *, wm_job, &wm->jobs) {
|
||||
if (!owner || wm_job->owner == owner) {
|
||||
@@ -581,7 +585,7 @@ void WM_jobs_kill_type(struct wmWindowManager *wm, void *owner, int job_type)
|
||||
}
|
||||
|
||||
/* signal job(s) from this owner or callback to stop, timer is required to get handled */
|
||||
void WM_jobs_stop(wmWindowManager *wm, void *owner, void *startjob)
|
||||
void WM_jobs_stop(wmWindowManager *wm, const void *owner, void *startjob)
|
||||
{
|
||||
LISTBASE_FOREACH (wmJob *, wm_job, &wm->jobs) {
|
||||
if (wm_job->owner == owner || wm_job->startjob == startjob) {
|
||||
@@ -702,9 +706,9 @@ void wm_jobs_timer(wmWindowManager *wm, wmTimer *wt)
|
||||
wm_jobs_update_progress_bars(wm);
|
||||
}
|
||||
|
||||
bool WM_jobs_has_running(wmWindowManager *wm)
|
||||
bool WM_jobs_has_running(const wmWindowManager *wm)
|
||||
{
|
||||
LISTBASE_FOREACH (wmJob *, wm_job, &wm->jobs) {
|
||||
LISTBASE_FOREACH (const wmJob *, wm_job, &wm->jobs) {
|
||||
if (wm_job->running) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user