Cleanup: use func definitions for wm/notifiers/editors ID callbacks.

This commit is contained in:
Bastien Montagne 2015-11-10 20:34:59 +01:00
parent 78836c0211
commit 8c84a1873d
Notes: blender-bot 2023-02-14 08:32:20 +01:00
Referenced by issue #46772, Boolean modifier not displaying in viewport on startup and after exiting edit mode
Referenced by issue #46750, TexPaint artefacts after projecting image with alpha
Referenced by issue #46752, Collision between convex hull and triangle mesh causing slow fps in bge
Referenced by issue #46723, Issue with linking to rigs running Blender in new depsgraph mode
Referenced by issue #46469, Data Transfer Modifier don't work.
2 changed files with 13 additions and 9 deletions

View File

@ -118,9 +118,13 @@ void BKE_library_make_local(struct Main *bmain, struct Library *lib, bool untagg
struct ID *BKE_libblock_find_name_ex(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
struct ID *BKE_libblock_find_name(const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
void BKE_library_callback_free_window_manager_set(void (*func)(struct bContext *, struct wmWindowManager *));
void BKE_library_callback_free_notifier_reference_set(void (*func)(const void *));
void BKE_library_callback_free_editor_id_reference_set(void (*func)(const struct ID *));
typedef void (*BKE_library_free_window_manager_cb)(struct bContext *, struct wmWindowManager *);
typedef void (*BKE_library_free_notifier_reference_cb)(const void *);
typedef void (*BKE_library_free_editor_id_reference_cb)(const struct ID *);
void BKE_library_callback_free_window_manager_set(BKE_library_free_window_manager_cb func);
void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func);
void BKE_library_callback_free_editor_id_reference_set(BKE_library_free_editor_id_reference_cb func);
/* use when "" is given to new_id() */
#define ID_FALLBACK_NAME N_("Untitled")

View File

@ -1021,23 +1021,23 @@ static void BKE_library_free(Library *lib)
freePackedFile(lib->packedfile);
}
static void (*free_windowmanager_cb)(bContext *, wmWindowManager *) = NULL;
static BKE_library_free_window_manager_cb free_windowmanager_cb = NULL;
void BKE_library_callback_free_window_manager_set(void (*func)(bContext *C, wmWindowManager *) )
void BKE_library_callback_free_window_manager_set(BKE_library_free_window_manager_cb func)
{
free_windowmanager_cb = func;
}
static void (*free_notifier_reference_cb)(const void *) = NULL;
static BKE_library_free_notifier_reference_cb free_notifier_reference_cb = NULL;
void BKE_library_callback_free_notifier_reference_set(void (*func)(const void *) )
void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func)
{
free_notifier_reference_cb = func;
}
static void (*free_editor_id_reference_cb)(const ID *) = NULL;
static BKE_library_free_editor_id_reference_cb free_editor_id_reference_cb = NULL;
void BKE_library_callback_free_editor_id_reference_set(void (*func)(const ID *))
void BKE_library_callback_free_editor_id_reference_set(BKE_library_free_editor_id_reference_cb func)
{
free_editor_id_reference_cb = func;
}