From 0de5156a24845867bb0d7dd618f5d00b6efd424b Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 9 Mar 2020 11:17:37 +0100 Subject: Cleanup: WindowManager: Move to IDTypeInfo and remove unused WM API. Getting rid of one static 'registered' callback in BKE, yeah! --- source/blender/windowmanager/intern/wm.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source/blender/windowmanager/intern/wm.c') 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) -- cgit v1.2.3