diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_idtype.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_lib_remap.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/idtype.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_id_delete.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_intern.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_remap.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 24 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 1 |
8 files changed, 27 insertions, 17 deletions
diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h index ba6daa03436..54074c91fe6 100644 --- a/source/blender/blenkernel/BKE_idtype.h +++ b/source/blender/blenkernel/BKE_idtype.h @@ -151,7 +151,7 @@ extern IDTypeInfo IDType_ID_NT; extern IDTypeInfo IDType_ID_BR; // extern IDTypeInfo IDType_ID_PA; // extern IDTypeInfo IDType_ID_GD; -// extern IDTypeInfo IDType_ID_WM; +extern IDTypeInfo IDType_ID_WM; // extern IDTypeInfo IDType_ID_MC; // extern IDTypeInfo IDType_ID_MSK; // extern IDTypeInfo IDType_ID_LS; diff --git a/source/blender/blenkernel/BKE_lib_remap.h b/source/blender/blenkernel/BKE_lib_remap.h index 6105662c5d3..72c5f1d1b0e 100644 --- a/source/blender/blenkernel/BKE_lib_remap.h +++ b/source/blender/blenkernel/BKE_lib_remap.h @@ -103,11 +103,9 @@ void BKE_libblock_relink_ex(struct Main *bmain, void BKE_libblock_relink_to_newid(struct ID *id) ATTR_NONNULL(); -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_remap_editor_id_reference_cb)(struct ID *, 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_remap_editor_id_reference_set( BKE_library_remap_editor_id_reference_cb func); diff --git a/source/blender/blenkernel/intern/idtype.c b/source/blender/blenkernel/intern/idtype.c index e2c52520e47..a7274fbc23d 100644 --- a/source/blender/blenkernel/intern/idtype.c +++ b/source/blender/blenkernel/intern/idtype.c @@ -78,7 +78,7 @@ static void id_type_init(void) INIT_TYPE(ID_BR); // INIT_TYPE(ID_PA); // INIT_TYPE(ID_GD); - // INIT_TYPE(ID_WM); + INIT_TYPE(ID_WM); // INIT_TYPE(ID_MC); // INIT_TYPE(ID_MSK); // INIT_TYPE(ID_LS); diff --git a/source/blender/blenkernel/intern/lib_id_delete.c b/source/blender/blenkernel/intern/lib_id_delete.c index c36c5afa1cf..6a017d5a8d7 100644 --- a/source/blender/blenkernel/intern/lib_id_delete.c +++ b/source/blender/blenkernel/intern/lib_id_delete.c @@ -217,9 +217,7 @@ void BKE_libblock_free_datablock(ID *id, const int UNUSED(flag)) BKE_particlesettings_free((ParticleSettings *)id); break; case ID_WM: - if (free_windowmanager_cb) { - free_windowmanager_cb(NULL, (wmWindowManager *)id); - } + BLI_assert(0); break; case ID_GD: BKE_gpencil_free((bGPdata *)id, true); diff --git a/source/blender/blenkernel/intern/lib_intern.h b/source/blender/blenkernel/intern/lib_intern.h index bd5e4a8dfe2..9cc5db64d17 100644 --- a/source/blender/blenkernel/intern/lib_intern.h +++ b/source/blender/blenkernel/intern/lib_intern.h @@ -24,8 +24,6 @@ #ifndef __LIB_INTERN_H__ #define __LIB_INTERN_H__ -extern BKE_library_free_window_manager_cb free_windowmanager_cb; - extern BKE_library_free_notifier_reference_cb free_notifier_reference_cb; extern BKE_library_remap_editor_id_reference_cb remap_editor_id_reference_cb; diff --git a/source/blender/blenkernel/intern/lib_remap.c b/source/blender/blenkernel/intern/lib_remap.c index d8b32b6e04c..d4b7696074a 100644 --- a/source/blender/blenkernel/intern/lib_remap.c +++ b/source/blender/blenkernel/intern/lib_remap.c @@ -48,13 +48,6 @@ static CLG_LogRef LOG = {.identifier = "bke.lib_remap"}; -BKE_library_free_window_manager_cb free_windowmanager_cb = NULL; - -void BKE_library_callback_free_window_manager_set(BKE_library_free_window_manager_cb func) -{ - free_windowmanager_cb = func; -} - BKE_library_free_notifier_reference_cb free_notifier_reference_cb = NULL; void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func) diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index c0a653e5e2f..2edef54c778 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -37,9 +37,12 @@ #include "BLI_utildefines.h" #include "BLI_blenlib.h" +#include "BLT_translation.h" + #include "BKE_context.h" #include "BKE_global.h" #include "BKE_idprop.h" +#include "BKE_idtype.h" #include "BKE_lib_id.h" #include "BKE_main.h" #include "BKE_report.h" @@ -62,6 +65,27 @@ /* ****************************************************** */ +static void window_manager_free_data(ID *id) +{ + wm_close_and_free(NULL, (wmWindowManager *)id); +} + +IDTypeInfo IDType_ID_WM = { + .id_code = ID_WM, + .id_filter = 0, + .main_listbase_index = INDEX_ID_WM, + .struct_size = sizeof(wmWindowManager), + .name = "WindowManager", + .name_plural = "window_managers", + .translation_context = BLT_I18NCONTEXT_ID_WINDOWMANAGER, + .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_LIBLINKING | IDTYPE_FLAGS_NO_MAKELOCAL, + + .init_data = NULL, + .copy_data = NULL, + .free_data = window_manager_free_data, + .make_local = NULL, +}; + #define MAX_OP_REGISTERED 32 void WM_operator_free(wmOperator *op) diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index c428eefb028..a87f0a3e42c 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -247,7 +247,6 @@ void WM_init(bContext *C, int argc, const char **argv) ED_undosys_type_init(); - BKE_library_callback_free_window_manager_set(wm_close_and_free); /* lib_id.c */ BKE_library_callback_free_notifier_reference_set( WM_main_remove_notifier_reference); /* lib_id.c */ BKE_region_callback_free_gizmomap_set(wm_gizmomap_remove); /* screen.c */ |