Cleanup: Move `BKE_callbacks.h` and `BKE_cachefile.h` to CPP headers.

This commit is contained in:
Bastien Montagne 2024-02-09 19:29:34 +01:00
parent a9b2cf8ce6
commit deab8c085a
37 changed files with 106 additions and 132 deletions

View File

@ -19,7 +19,7 @@
#include "BLI_string_ref.hh"
#include "BLI_vector.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
struct IDRemapper;
struct Main;

View File

@ -9,7 +9,7 @@
#include "BLI_string.h"
#include "BKE_appdir.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_main.hh"
#include "DNA_asset_types.h"

View File

@ -5,7 +5,7 @@
#include "AS_asset_catalog.hh"
#include "AS_asset_library.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "asset_library_service.hh"

View File

@ -13,7 +13,7 @@
#include "asset_library_service.hh"
#include "BKE_appdir.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BLI_fileops.h"
#include "BLI_path_util.h"

View File

@ -1,70 +0,0 @@
/* SPDX-FileCopyrightText: 2016 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup bke
*/
#ifdef __cplusplus
extern "C" {
#endif
struct CacheFile;
struct CacheFileLayer;
struct CacheReader;
struct Depsgraph;
struct Main;
struct Object;
struct Scene;
void BKE_cachefiles_init(void);
void BKE_cachefiles_exit(void);
void *BKE_cachefile_add(struct Main *bmain, const char *name);
void BKE_cachefile_reload(struct Depsgraph *depsgraph, struct CacheFile *cache_file);
void BKE_cachefile_eval(struct Main *bmain,
struct Depsgraph *depsgraph,
struct CacheFile *cache_file);
bool BKE_cachefile_filepath_get(const struct Main *bmain,
const struct Depsgraph *depsgraph,
const struct CacheFile *cache_file,
char r_filepath[1024]);
double BKE_cachefile_time_offset(const struct CacheFile *cache_file, double time, double fps);
/* Modifiers and constraints open and free readers through these. */
void BKE_cachefile_reader_open(struct CacheFile *cache_file,
struct CacheReader **reader,
struct Object *object,
const char *object_path);
void BKE_cachefile_reader_free(struct CacheFile *cache_file, struct CacheReader **reader);
/**
* Determine whether the #CacheFile should use a render engine procedural. If so, data is not read
* from the file and bounding boxes are used to represent the objects in the Scene.
* Render engines will receive the bounding box as a placeholder but can instead
* load the data directly if they support it.
*/
bool BKE_cache_file_uses_render_procedural(const struct CacheFile *cache_file,
struct Scene *scene);
/**
* Add a layer to the cache_file. Return NULL if the `filepath` is already that of an existing
* layer or if the number of layers exceeds the maximum allowed layer count.
*/
struct CacheFileLayer *BKE_cachefile_add_layer(struct CacheFile *cache_file,
const char filepath[1024]);
struct CacheFileLayer *BKE_cachefile_get_active_layer(struct CacheFile *cache_file);
void BKE_cachefile_remove_layer(struct CacheFile *cache_file, struct CacheFileLayer *layer);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,58 @@
/* SPDX-FileCopyrightText: 2016 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup bke
*/
struct CacheFile;
struct CacheFileLayer;
struct CacheReader;
struct Depsgraph;
struct Main;
struct Object;
struct Scene;
void BKE_cachefiles_init(void);
void BKE_cachefiles_exit(void);
void *BKE_cachefile_add(Main *bmain, const char *name);
void BKE_cachefile_reload(Depsgraph *depsgraph, CacheFile *cache_file);
void BKE_cachefile_eval(Main *bmain, Depsgraph *depsgraph, CacheFile *cache_file);
bool BKE_cachefile_filepath_get(const Main *bmain,
const Depsgraph *depsgraph,
const CacheFile *cache_file,
char r_filepath[1024]);
double BKE_cachefile_time_offset(const CacheFile *cache_file, double time, double fps);
/* Modifiers and constraints open and free readers through these. */
void BKE_cachefile_reader_open(CacheFile *cache_file,
CacheReader **reader,
Object *object,
const char *object_path);
void BKE_cachefile_reader_free(CacheFile *cache_file, CacheReader **reader);
/**
* Determine whether the #CacheFile should use a render engine procedural. If so, data is not read
* from the file and bounding boxes are used to represent the objects in the Scene.
* Render engines will receive the bounding box as a placeholder but can instead
* load the data directly if they support it.
*/
bool BKE_cache_file_uses_render_procedural(const CacheFile *cache_file, Scene *scene);
/**
* Add a layer to the cache_file. Return NULL if the `filepath` is already that of an existing
* layer or if the number of layers exceeds the maximum allowed layer count.
*/
CacheFileLayer *BKE_cachefile_add_layer(CacheFile *cache_file, const char filepath[1024]);
CacheFileLayer *BKE_cachefile_get_active_layer(CacheFile *cache_file);
void BKE_cachefile_remove_layer(CacheFile *cache_file, CacheFileLayer *layer);

View File

@ -8,10 +8,6 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
struct Depsgraph;
struct ID;
struct Main;
@ -117,24 +113,18 @@ typedef enum {
BKE_CB_EVT_TOT,
} eCbEvent;
typedef struct bCallbackFuncStore {
struct bCallbackFuncStore *next, *prev;
void (*func)(struct Main *, struct PointerRNA **, int num_pointers, void *arg);
struct bCallbackFuncStore {
bCallbackFuncStore *next, *prev;
void (*func)(Main *, PointerRNA **, int num_pointers, void *arg);
void *arg;
short alloc;
} bCallbackFuncStore;
};
void BKE_callback_exec(struct Main *bmain,
struct PointerRNA **pointers,
int num_pointers,
eCbEvent evt);
void BKE_callback_exec_null(struct Main *bmain, eCbEvent evt);
void BKE_callback_exec_id(struct Main *bmain, struct ID *id, eCbEvent evt);
void BKE_callback_exec_id_depsgraph(struct Main *bmain,
struct ID *id,
struct Depsgraph *depsgraph,
eCbEvent evt);
void BKE_callback_exec_string(struct Main *bmain, eCbEvent evt, const char *str);
void BKE_callback_exec(Main *bmain, PointerRNA **pointers, int num_pointers, eCbEvent evt);
void BKE_callback_exec_null(Main *bmain, eCbEvent evt);
void BKE_callback_exec_id(Main *bmain, ID *id, eCbEvent evt);
void BKE_callback_exec_id_depsgraph(Main *bmain, ID *id, Depsgraph *depsgraph, eCbEvent evt);
void BKE_callback_exec_string(Main *bmain, eCbEvent evt, const char *str);
void BKE_callback_add(bCallbackFuncStore *funcstore, eCbEvent evt);
void BKE_callback_remove(bCallbackFuncStore *funcstore, eCbEvent evt);
@ -143,7 +133,3 @@ void BKE_callback_global_init(void);
* Call on application exit.
*/
void BKE_callback_global_finalize(void);
#ifdef __cplusplus
}
#endif

View File

@ -352,8 +352,8 @@ set(SRC
BKE_bpath.hh
BKE_brush.hh
BKE_bvhutils.hh
BKE_cachefile.h
BKE_callbacks.h
BKE_cachefile.hh
BKE_callbacks.hh
BKE_camera.h
BKE_ccg.h
BKE_cdderivedmesh.h

View File

@ -27,8 +27,8 @@
#include "BKE_blender_version.h" /* own include */
#include "BKE_blendfile.hh"
#include "BKE_brush.hh"
#include "BKE_cachefile.h"
#include "BKE_callbacks.h"
#include "BKE_cachefile.hh"
#include "BKE_callbacks.hh"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_image.h"

View File

@ -26,7 +26,7 @@
#include "BKE_anim_data.h"
#include "BKE_bpath.hh"
#include "BKE_cachefile.h"
#include "BKE_cachefile.hh"
#include "BKE_idtype.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"

View File

@ -9,7 +9,7 @@
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "MEM_guardedalloc.h"

View File

@ -49,7 +49,7 @@
#include "BKE_animsys.h"
#include "BKE_armature.hh"
#include "BKE_bvhutils.hh"
#include "BKE_cachefile.h"
#include "BKE_cachefile.hh"
#include "BKE_camera.h"
#include "BKE_constraint.h"
#include "BKE_curve.hh"

View File

@ -40,7 +40,7 @@
#include "DNA_workspace_types.h"
#include "DNA_world_types.h"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BLI_blenlib.h"
#include "BLI_math_rotation.h"
#include "BLI_string.h"
@ -59,7 +59,7 @@
#include "BKE_animsys.h"
#include "BKE_armature.hh"
#include "BKE_bpath.hh"
#include "BKE_cachefile.h"
#include "BKE_cachefile.hh"
#include "BKE_collection.h"
#include "BKE_colortools.hh"
#include "BKE_curveprofile.h"

View File

@ -7,7 +7,7 @@
#include "BKE_appdir.hh"
#include "BKE_blender.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_idtype.hh"

View File

@ -57,7 +57,7 @@
#include "BKE_animsys.h"
#include "BKE_armature.hh"
#include "BKE_bake_geometry_nodes_modifier.hh"
#include "BKE_cachefile.h"
#include "BKE_cachefile.hh"
#include "BKE_collection.h"
#include "BKE_constraint.h"
#include "BKE_curve.hh"

View File

@ -20,7 +20,7 @@
#include "BLT_translation.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_gpencil_geom_legacy.h"

View File

@ -49,7 +49,7 @@
#include "BKE_action.h"
#include "BKE_blender_version.h"
#include "BKE_blendfile.hh"
#include "BKE_cachefile.h"
#include "BKE_cachefile.hh"
#include "BKE_colorband.hh"
#include "BKE_colortools.hh"
#include "BKE_constraint.h"

View File

@ -15,7 +15,7 @@
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BKE_cachefile.h"
#include "BKE_cachefile.hh"
#include "BKE_context.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"

View File

@ -24,7 +24,7 @@
#include "BLI_string.h"
#include "BKE_attribute.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_editmesh.hh"
#include "BKE_global.h"

View File

@ -32,7 +32,7 @@
#include "DNA_userdef_types.h"
#include "DNA_workspace_types.h"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_editmesh.hh"
#include "BKE_fcurve.h"

View File

@ -16,7 +16,7 @@
#include "DNA_text_types.h"
#include "DNA_world_types.h"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_image.h"

View File

@ -19,7 +19,7 @@
#include "BLI_fileops.h"
#include "BLI_path_util.h"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_main.hh"
#include "BKE_preferences.h"

View File

@ -21,7 +21,7 @@
#include "BLT_translation.hh"
#include "BKE_blender_undo.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_layer.hh"

View File

@ -28,7 +28,7 @@ using namespace Freestyle;
#include "DNA_material_types.h"
#include "DNA_text_types.h"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_freestyle.h"
#include "BKE_global.h"

View File

@ -30,7 +30,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_cachefile.h"
#include "BKE_cachefile.hh"
#include "BKE_context.hh"
#include "BKE_curve.hh"
#include "BKE_global.h"

View File

@ -12,7 +12,7 @@
#include "BKE_appdir.hh"
#include "BKE_blender_version.h"
#include "BKE_cachefile.h"
#include "BKE_cachefile.hh"
#include "BKE_cdderivedmesh.h"
#include "BKE_context.hh"
#include "BKE_global.h"

View File

@ -27,7 +27,7 @@ const EnumPropertyItem rna_enum_velocity_unit_items[] = {
# include "BLI_string.h"
# include "BKE_cachefile.h"
# include "BKE_cachefile.hh"
# include "DEG_depsgraph.hh"
# include "DEG_depsgraph_build.hh"

View File

@ -279,7 +279,7 @@ static const EnumPropertyItem modifier_noise_random_mode_items[] = {
# include "DNA_material_types.h"
# include "DNA_particle_types.h"
# include "BKE_cachefile.h"
# include "BKE_cachefile.hh"
# include "BKE_context.hh"
# include "BKE_gpencil_legacy.h"
# include "BKE_gpencil_modifier_legacy.h"

View File

@ -731,7 +731,7 @@ const EnumPropertyItem rna_enum_subdivision_boundary_smooth_items[] = {
# include "DNA_material_types.h"
# include "DNA_particle_types.h"
# include "BKE_cachefile.h"
# include "BKE_cachefile.hh"
# include "BKE_context.hh"
# include "BKE_deform.hh"
# include "BKE_material.h"

View File

@ -30,7 +30,7 @@
#include "BKE_addon.h"
#include "BKE_appdir.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_sound.h"
#include "BKE_studiolight.h"

View File

@ -25,7 +25,7 @@
#include "MEM_guardedalloc.h"
#include "BKE_cachefile.h"
#include "BKE_cachefile.hh"
#include "BKE_context.hh"
#include "BKE_lib_query.hh"
#include "BKE_mesh.hh"

View File

@ -13,7 +13,7 @@
#include "BLI_utildefines.h"
#include <Python.h>
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "RNA_access.hh"
#include "RNA_prototypes.h"
@ -41,7 +41,7 @@ static PyTypeObject BlenderAppCbType;
"the file being loaded, an empty string for the startup-file."
/**
* See `BKE_callbacks.h` #eCbEvent declaration for the policy on naming.
* See `BKE_callbacks.hh` #eCbEvent declaration for the policy on naming.
*/
static PyStructSequence_Field app_cb_info_fields[] = {
{"frame_change_pre",

View File

@ -43,7 +43,7 @@
#include "BKE_anim_data.h"
#include "BKE_animsys.h" /* <------ should this be here?, needed for sequencer update */
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_camera.h"
#include "BKE_colortools.hh"
#include "BKE_global.h"

View File

@ -67,7 +67,7 @@
#include "BKE_blender.hh"
#include "BKE_blender_version.h"
#include "BKE_blendfile.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_idprop.h"

View File

@ -35,7 +35,7 @@
#include "BKE_blender.hh"
#include "BKE_blendfile.hh"
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_icons.h"

View File

@ -6,7 +6,7 @@
* \ingroup wm
*/
#include "BKE_callbacks.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_idprop.h"

View File

@ -35,8 +35,8 @@
#include "BKE_appdir.hh"
#include "BKE_blender.hh"
#include "BKE_brush.hh"
#include "BKE_cachefile.h"
#include "BKE_callbacks.h"
#include "BKE_cachefile.hh"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_cpp_types.hh"
#include "BKE_global.h"