diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-03-09 13:17:37 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-03-09 14:49:04 +0300 |
commit | 0de5156a24845867bb0d7dd618f5d00b6efd424b (patch) | |
tree | b4fa72e4c7108fd1c128fd31426f8c2335f2099b /source/blender/windowmanager | |
parent | f881162f81e57d3959b5e3bd917fbf0d6a4146c4 (diff) |
Cleanup: WindowManager: Move to IDTypeInfo and remove unused WM API.
Getting rid of one static 'registered' callback in BKE, yeah!
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 24 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 1 |
2 files changed, 24 insertions, 1 deletions
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 */ |