Blender V4.5
wm.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2007 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
13/* Allow using deprecated functionality for .blend file I/O. */
14#define DNA_DEPRECATED_ALLOW
15
16#include <cstring>
17
19
20#include "MEM_guardedalloc.h"
21
22#include "BLI_ghash.h"
23#include "BLI_listbase.h"
24#include "BLI_string.h"
25#include "BLI_utildefines.h"
26
27#include "BLT_translation.hh"
28
29#include "BKE_context.hh"
30#include "BKE_global.hh"
31#include "BKE_idprop.hh"
32#include "BKE_idtype.hh"
33#include "BKE_lib_id.hh"
34#include "BKE_lib_query.hh"
35#include "BKE_main.hh"
36#include "BKE_report.hh"
37#include "BKE_screen.hh"
38#include "BKE_workspace.hh"
39
40#include "WM_api.hh"
41#include "WM_keymap.hh"
42#include "WM_message.hh"
43#include "WM_types.hh"
44#include "wm.hh"
45#include "wm_draw.hh"
46#include "wm_event_system.hh"
47#include "wm_window.hh"
48#ifdef WITH_XR_OPENXR
49# include "wm_xr.hh"
50#endif
51
52#include "BKE_undo_system.hh"
53#include "ED_screen.hh"
54
55#ifdef WITH_PYTHON
56# include "BPY_extern.hh"
57# include "BPY_extern_run.hh"
58#endif
59
60#include "BLO_read_write.hh"
61
62/* ****************************************************** */
63
65{
66 wm_close_and_free(nullptr, (wmWindowManager *)id);
67}
68
70{
71 wmWindowManager *wm = reinterpret_cast<wmWindowManager *>(id);
73
74 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
76
77 /* This pointer can be nullptr during old files reading. */
78 if (win->workspace_hook != nullptr) {
79 ID *workspace = (ID *)BKE_workspace_active_get(win->workspace_hook);
81 /* Allow callback to set a different workspace. */
82 BKE_workspace_active_set(win->workspace_hook, (WorkSpace *)workspace);
84 return;
85 }
86 }
87
89
90 if (flag & IDWALK_INCLUDE_UI) {
91 LISTBASE_FOREACH (ScrArea *, area, &win->global_areas.areabase) {
94 }
95 }
96
99 }
100 }
101
104}
105
106static void write_wm_xr_data(BlendWriter *writer, wmXrData *xr_data)
107{
109}
110
111static void window_manager_blend_write(BlendWriter *writer, ID *id, const void *id_address)
112{
114
115 wm->runtime = nullptr;
116
117 BLO_write_id_struct(writer, wmWindowManager, id_address, &wm->id);
118 BKE_id_blend_write(writer, &wm->id);
119 write_wm_xr_data(writer, &wm->xr);
120
121 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
122 /* Update deprecated screen member (for so loading in 2.7x uses the correct screen). */
123 win->screen = BKE_workspace_active_screen_get(win->workspace_hook);
124
125 BLO_write_struct(writer, wmWindow, win);
126 BLO_write_struct(writer, WorkSpaceInstanceHook, win->workspace_hook);
127 BLO_write_struct(writer, Stereo3dFormat, win->stereo3d_format);
128
129 BKE_screen_area_map_blend_write(writer, &win->global_areas);
130
131 /* Data is written, clear deprecated data again. */
132 win->screen = nullptr;
133 }
134}
135
140
142{
144
145 id_us_ensure_real(&wm->id);
147
148 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
149 BLO_read_struct(reader, wmWindow, &win->parent);
150
151 WorkSpaceInstanceHook *hook = win->workspace_hook;
152 BLO_read_struct(reader, WorkSpaceInstanceHook, &win->workspace_hook);
153
154 /* This will be nullptr for any pre-2.80 blend file. */
155 if (win->workspace_hook != nullptr) {
156 /* We need to restore a pointer to this later when reading workspaces,
157 * so store in global oldnew-map.
158 * Note that this is only needed for versioning of older .blend files now. */
159 BLO_read_data_globmap_add(reader, hook, win->workspace_hook);
160 /* Cleanup pointers to data outside of this data-block scope. */
161 win->workspace_hook->act_layout = nullptr;
162 win->workspace_hook->temp_workspace_store = nullptr;
163 win->workspace_hook->temp_layout_store = nullptr;
164 }
165
166 if (!BKE_screen_area_map_blend_read_data(reader, &win->global_areas)) {
167 BLO_read_data_invalidate(reader, "Corrupt .blend file, failed to read window areas.");
168 }
169
170 win->ghostwin = nullptr;
171 win->gpuctx = nullptr;
172 win->eventstate = nullptr;
173 win->eventstate_prev_press_time_ms = 0;
174 win->event_last_handled = nullptr;
175 win->cursor_keymap_status = nullptr;
176
177 BLI_listbase_clear(&win->handlers);
178 BLI_listbase_clear(&win->modalhandlers);
179 BLI_listbase_clear(&win->gesture);
180
181 win->active = 0;
182
183 win->cursor = 0;
184 win->lastcursor = 0;
185 win->modalcursor = 0;
186 win->grabcursor = 0;
187 win->addmousemove = true;
188 win->event_queue_check_click = 0;
189 win->event_queue_check_drag = 0;
190 win->event_queue_check_drag_handled = 0;
191 win->event_queue_consecutive_gesture_type = EVENT_NONE;
192 win->event_queue_consecutive_gesture_data = nullptr;
193 BLO_read_struct(reader, Stereo3dFormat, &win->stereo3d_format);
194
195 /* Multi-view always falls back to anaglyph at file opening
196 * otherwise quad-buffer saved files can break Blender. */
197 if (win->stereo3d_format) {
198 win->stereo3d_format->display_mode = S3D_DISPLAY_ANAGLYPH;
199 }
200 win->runtime = MEM_new<blender::bke::WindowRuntime>(__func__);
201 }
202
203 direct_link_wm_xr_data(reader, &wm->xr);
204
208
210 wm->defaultconf = nullptr;
211 wm->addonconf = nullptr;
212 wm->userconf = nullptr;
213 wm->undo_stack = nullptr;
214
215 wm->message_bus = nullptr;
216
217 wm->xr.runtime = nullptr;
218
221
222 wm->windrawable = nullptr;
223 wm->winactive = nullptr;
224 wm->init_flag = 0;
225 wm->op_undo_depth = 0;
227 wm->extensions_blocked = 0;
228
229 BLI_assert(wm->runtime == nullptr);
230 wm->runtime = MEM_new<blender::bke::WindowManagerRuntime>(__func__);
231}
232
234{
235 wmWindowManager *wm = reinterpret_cast<wmWindowManager *>(id);
236
237 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
238 LISTBASE_FOREACH (ScrArea *, area, &win->global_areas.areabase) {
240 }
241 }
242}
243
245 /*id_code*/ wmWindowManager::id_type,
246 /*id_filter*/ FILTER_ID_WM,
247 /*dependencies_id_types*/ FILTER_ID_SCE | FILTER_ID_WS,
248 /*main_listbase_index*/ INDEX_ID_WM,
249 /*struct_size*/ sizeof(wmWindowManager),
250 /*name*/ "WindowManager",
251 /*name_plural*/ N_("window_managers"),
252 /*translation_context*/ BLT_I18NCONTEXT_ID_WINDOWMANAGER,
255 /*asset_type_info*/ nullptr,
256
257 /*init_data*/ nullptr,
258 /*copy_data*/ nullptr,
259 /*free_data*/ window_manager_free_data,
260 /*make_local*/ nullptr,
261 /*foreach_id*/ window_manager_foreach_id,
262 /*foreach_cache*/ nullptr,
263 /*foreach_path*/ nullptr,
264 /*owner_pointer_get*/ nullptr,
265
266 /*blend_write*/ window_manager_blend_write,
267 /*blend_read_data*/ window_manager_blend_read_data,
268 /*blend_read_after_liblink*/ window_manager_blend_read_after_liblink,
269
270 /*blend_read_undo_preserve*/ nullptr,
271
272 /*lib_override_apply_post*/ nullptr,
273};
274
275#define MAX_OP_REGISTERED 32
276
278{
279
280#ifdef WITH_PYTHON
281 if (op->py_instance) {
282 /* Do this first in case there are any __del__ functions or similar that use properties. */
284 }
285#endif
286
287 if (op->ptr) {
288 op->properties = static_cast<IDProperty *>(op->ptr->data);
289 MEM_delete(op->ptr);
290 }
291
292 if (op->properties) {
294 }
295
296 if (op->reports && (op->reports->flag & RPT_FREE)) {
298 MEM_freeN(op->reports);
299 }
300
301 if (op->macro.first) {
302 wmOperator *opm, *opmnext;
303 for (opm = static_cast<wmOperator *>(op->macro.first); opm; opm = opmnext) {
304 opmnext = opm->next;
305 WM_operator_free(opm);
306 }
307 }
308
309 MEM_freeN(op);
310}
311
313{
314 op = op->next;
315 while (op != nullptr) {
316 wmOperator *op_next = op->next;
317 BLI_remlink(&wm->operators, op);
319 op = op_next;
320 }
321}
322
324{
325 /* Not supported for Python. */
326 BLI_assert(op->py_instance == nullptr);
327
328 op->type = ot;
329 op->ptr->type = ot->srna;
330
331 /* Ensure compatible properties. */
332 if (op->properties) {
335
337
338 if (ptr.data) {
339 IDP_SyncGroupTypes(op->properties, static_cast<const IDProperty *>(ptr.data), true);
340 }
341
343 }
344}
345
347{
348 WM_event_timer_remove(wm, nullptr, wm->runtime->reports.reporttimer);
349}
350
352{
354 int tot = 0;
355
356 BLI_addtail(&wm->operators, op);
357
358 /* Only count registered operators. */
359 while (op) {
360 wmOperator *op_prev = op->prev;
361 if (op->type->flag & OPTYPE_REGISTER) {
362 tot += 1;
363 }
364 if (tot > MAX_OP_REGISTERED) {
365 BLI_remlink(&wm->operators, op);
367 }
368 op = op_prev;
369 }
370
371 /* So the console is redrawn. */
374}
375
377{
378 while (wmOperator *op = static_cast<wmOperator *>(BLI_pophead(&wm->operators))) {
380 }
381
383}
384
386{
387 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
389 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
390 switch (area->spacetype) {
391 case SPACE_FILE: {
392 SpaceFile *sfile = static_cast<SpaceFile *>(area->spacedata.first);
393 if (sfile->op && sfile->op->type == ot) {
394 /* Freed as part of the handler. */
395 sfile->op = nullptr;
396 }
397 break;
398 }
399 }
400 }
401 }
402
403 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
404 ListBase *lb[2] = {&win->handlers, &win->modalhandlers};
405 for (int i = 0; i < ARRAY_SIZE(lb); i++) {
406 LISTBASE_FOREACH (wmEventHandler *, handler_base, lb[i]) {
407 if (handler_base->type == WM_HANDLER_TYPE_OP) {
408 wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base;
409 if (handler->op && handler->op->type == ot) {
410 /* Don't run op->cancel because it needs the context,
411 * assume whoever unregisters the operator will cleanup. */
412 handler->head.flag |= WM_HANDLER_DO_FREE;
413 WM_operator_free(handler->op);
414 handler->op = nullptr;
415 }
416 }
417 }
418 }
419 }
420}
421
422/* ****************************************** */
423
425{
426 if (CTX_py_init_get(C) && !G.background) {
427#ifdef WITH_PYTHON
428 const char *imports[] = {"bpy", nullptr};
429 BPY_run_string_eval(C, imports, "bpy.utils.keyconfig_init()");
430#endif
431 }
432}
433
435{
437
438 /* Create standard key configuration. */
439 if (wm->defaultconf == nullptr) {
440 /* Keep lowercase to match the preset filename. */
442 }
443 if (wm->addonconf == nullptr) {
444 wm->addonconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " addon", false);
445 }
446 if (wm->userconf == nullptr) {
447 wm->userconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " user", false);
448 }
449
450 /* Initialize only after python init is done, for keymaps that use python operators. */
451 if (CTX_py_init_get(C) && (wm->init_flag & WM_INIT_FLAG_KEYCONFIG) == 0) {
452 /* Create default key config, only initialize once,
453 * it's persistent across sessions. */
454 if (!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
457
459
461 }
462
463 /* Harmless, but no need to update in background mode. */
464 if (!G.background) {
465 WM_keyconfig_update_tag(nullptr, nullptr);
466 }
467 /* Don't call #WM_keyconfig_update here because add-ons have not yet been registered yet. */
468
470 }
471}
472
474{
475 Main *bmain = CTX_data_main(C);
477
478 /* WM context. */
479 if (wm == nullptr) {
480 wm = static_cast<wmWindowManager *>(bmain->wm.first);
481 CTX_wm_manager_set(C, wm);
482 }
483
484 if (wm == nullptr || BLI_listbase_is_empty(&wm->windows)) {
485 return;
486 }
487
488 /* Run before loading the keyconfig. */
489 if (wm->message_bus == nullptr) {
491 }
492
493 if (!G.background) {
494 /* Case: file-read. */
495 if ((wm->init_flag & WM_INIT_FLAG_WINDOW) == 0) {
498 }
499
500 /* Case: no open windows at all, for old file reads. */
502 }
503
504 /* Case: file-read. */
505 /* NOTE: this runs in background mode to set the screen context cb. */
506 if ((wm->init_flag & WM_INIT_FLAG_WINDOW) == 0) {
507 ED_screens_init(C, bmain, wm);
509 }
510}
511
513{
515
516 /* WM context. */
517 if (wm == nullptr) {
518 wm = static_cast<wmWindowManager *>(CTX_data_main(C)->wm.first);
519 CTX_wm_manager_set(C, wm);
520 }
521
522 if (wm == nullptr || BLI_listbase_is_empty(&wm->windows)) {
523 return;
524 }
525
526 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
527 win->sizex = 0;
528 win->sizey = 0;
529 win->posx = 0;
530 win->posy = 0;
531 }
532}
533
535{
536 wmWindowManager *wm = static_cast<wmWindowManager *>(
537 BKE_libblock_alloc(bmain, ID_WM, "WinMan", 0));
538 wmWindow *win;
539 bScreen *screen = CTX_wm_screen(C); /* XXX: from file read hrmf. */
540 WorkSpace *workspace;
541 WorkSpaceLayout *layout = BKE_workspace_layout_find_global(bmain, screen, &workspace);
542
543 BKE_reports_init(&wm->runtime->reports, RPT_STORE);
544
545 CTX_wm_manager_set(C, wm);
546 win = wm_window_new(bmain, wm, nullptr, false);
547 win->scene = CTX_data_scene(C);
550 BKE_workspace_active_layout_set(win->workspace_hook, win->winid, workspace, layout);
551 screen->winid = win->winid;
552
553 wm->winactive = win;
554 wm->file_saved = 1;
555 wm->runtime = MEM_new<blender::bke::WindowManagerRuntime>(__func__);
557}
558
560{
561 /* NOTE: this also runs when built without `WITH_XR_OPENXR`.
562 * It's necessary to prevent leaks when XR data is created or loaded into non XR builds.
563 * This can occur when Python reads all properties (see the `bl_rna_paths` test). */
564
565 /* Note that non-runtime data in `wm->xr` is freed as part of freeing the window manager. */
568 wm->xr.session_settings.shading.prop = nullptr;
569 }
570}
571
573{
574 if (wm->autosavetimer) {
576 }
577
578#ifdef WITH_XR_OPENXR
579 /* May send notifier, so do before freeing notifier queue. */
580 wm_xr_exit(wm);
581#endif
582 wm_xr_data_free(wm);
583
584 while (wmWindow *win = static_cast<wmWindow *>(BLI_pophead(&wm->windows))) {
585 /* Prevent draw clear to use screen. `workspace_hook` may be null for a window that was not
586 * completely read from an invalid file. */
587 if (win->workspace_hook != nullptr) {
588 BKE_workspace_active_set(win->workspace_hook, nullptr);
589 }
590 wm_window_free(C, wm, win);
591 }
592
593 while (wmOperator *op = static_cast<wmOperator *>(BLI_pophead(&wm->operators))) {
595 }
596
597 while (wmKeyConfig *keyconf = static_cast<wmKeyConfig *>(BLI_pophead(&wm->keyconfigs))) {
598 WM_keyconfig_free(keyconf);
599 }
600
601 if (wm->message_bus != nullptr) {
603 }
604
605#ifdef WITH_PYTHON
607#endif
609
611
612 wm_reports_free(wm);
613
614 /* NOTE(@ideasman42): typically timers are associated with windows and timers will have been
615 * freed when the windows are removed. However timers can be created which don't have windows
616 * and in this case it's necessary to free them on exit, see: #109953. */
618
619 if (wm->undo_stack) {
621 wm->undo_stack = nullptr;
622 }
623
624 if (C && CTX_wm_manager(C) == wm) {
625 CTX_wm_manager_set(C, nullptr);
626 }
627
628 MEM_delete(wm->runtime);
629}
630
632{
633 /* Single refresh before handling events.
634 * This ensures we don't run operators before the depsgraph has been evaluated. */
636
637 while (true) {
638
639 /* Get events from ghost, handle window events, add to window queues. */
641
642 /* Per window, all events to the window, screen, area and region handlers. */
644
645 /* Events have left notes about changes, we handle and cache it. */
647
648 /* Execute cached changes draw. */
650 }
651}
bScreen * CTX_wm_screen(const bContext *C)
bool CTX_py_init_get(bContext *C)
void CTX_wm_manager_set(bContext *C, wmWindowManager *wm)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void IDP_FreeProperty(IDProperty *prop)
Definition idprop.cc:1243
void IDP_SyncGroupTypes(IDProperty *dest, const IDProperty *src, bool do_arraylen) ATTR_NONNULL()
Definition idprop.cc:607
@ IDTYPE_FLAGS_NO_ANIMDATA
Definition BKE_idtype.hh:46
@ IDTYPE_FLAGS_NO_COPY
Definition BKE_idtype.hh:30
@ IDTYPE_FLAGS_NO_LIBLINKING
Definition BKE_idtype.hh:32
@ IDTYPE_FLAGS_NO_MEMFILE_UNDO
Definition BKE_idtype.hh:55
@ IDTYPE_FLAGS_NEVER_UNUSED
Definition BKE_idtype.hh:69
void * BKE_libblock_alloc(Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
Definition lib_id.cc:1428
void id_us_ensure_real(ID *id)
Definition lib_id.cc:308
void BKE_id_blend_write(BlendWriter *writer, ID *id)
Definition lib_id.cc:2611
#define BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data_, func_call_)
void BKE_lib_query_foreachid_process(LibraryForeachIDData *data, ID **id_pp, LibraryForeachIDCallbackFlag cb_flag)
Definition lib_query.cc:78
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
@ IDWALK_CB_USER_ONE
@ IDWALK_CB_USER
@ IDWALK_CB_NOP
LibraryForeachIDFlag BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
Definition lib_query.cc:129
bool BKE_lib_query_foreachid_iter_stop(const LibraryForeachIDData *data)
Definition lib_query.cc:73
@ IDWALK_DO_DEPRECATED_POINTERS
@ IDWALK_INCLUDE_UI
void BKE_reports_free(ReportList *reports)
Definition report.cc:70
void BKE_reports_init(ReportList *reports, int flag)
Definition report.cc:55
void BKE_screen_view3d_shading_blend_read_data(BlendDataReader *reader, View3DShading *shading)
Definition screen.cc:1097
void BKE_screen_area_map_blend_write(BlendWriter *writer, ScrAreaMap *area_map)
Definition screen.cc:1198
void BKE_screen_area_blend_read_after_liblink(BlendLibReader *reader, ID *parent_id, ScrArea *area)
Definition screen.cc:1485
void BKE_screen_view3d_shading_blend_write(BlendWriter *writer, View3DShading *shading)
Definition screen.cc:1090
bool BKE_screen_area_map_blend_read_data(BlendDataReader *reader, ScrAreaMap *area_map)
Definition screen.cc:1439
void BKE_screen_foreach_id_screen_area(LibraryForeachIDData *data, ScrArea *area)
Definition screen.cc:92
void BKE_undosys_stack_destroy(UndoStack *ustack)
void BKE_workspace_active_layout_set(WorkSpaceInstanceHook *hook, int winid, WorkSpace *workspace, WorkSpaceLayout *layout) SETTER_ATTRS
Activate a layout.
Definition workspace.cc:603
bScreen * BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition workspace.cc:612
WorkSpace * BKE_workspace_active_get(WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition workspace.cc:561
void BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) SETTER_ATTRS
Definition workspace.cc:565
WorkSpaceLayout * BKE_workspace_layout_find_global(const Main *bmain, const bScreen *screen, WorkSpace **r_workspace) ATTR_NONNULL(1
#define BLI_assert(a)
Definition BLI_assert.h:46
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:497
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:131
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:252
std::string data
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
#define ARRAY_SIZE(arr)
void BLO_read_data_invalidate(BlendDataReader *reader, const char *message)
Definition readfile.cc:5937
#define BLO_write_id_struct(writer, struct_name, id_address, id)
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_read_data_globmap_add(BlendDataReader *reader, void *oldaddr, void *newaddr)
Definition readfile.cc:5922
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define BLT_I18NCONTEXT_ID_WINDOWMANAGER
void BPY_DECREF_RNA_INVALIDATE(void *pyob_ptr)
void BPY_callback_wm_free(wmWindowManager *wm)
bool BPY_run_string_eval(bContext *C, const char *imports[], const char *expr)
#define FILTER_ID_WM
Definition DNA_ID.h:1142
#define FILTER_ID_WS
Definition DNA_ID.h:1134
@ INDEX_ID_WM
Definition DNA_ID.h:1263
#define FILTER_ID_SCE
Definition DNA_ID.h:1125
@ ID_WM
@ S3D_DISPLAY_ANAGLYPH
@ SPACE_FILE
struct wmWindowManager wmWindowManager
@ WM_INIT_FLAG_KEYCONFIG
@ WM_INIT_FLAG_WINDOW
#define WM_KEYCONFIG_STR_DEFAULT
@ KEYCONF_INIT_DEFAULT
@ WM_EXTENSIONS_UPDATE_UNSET
void ED_spacetypes_keymap(wmKeyConfig *keyconf)
void ED_screens_init(bContext *C, Main *bmain, wmWindowManager *wm)
Read Guarded memory(de)allocation.
@ WM_HANDLER_DO_FREE
Definition WM_api.hh:549
#define NC_WM
Definition WM_types.hh:371
#define ND_SPACE_INFO_REPORT
Definition WM_types.hh:517
@ OPTYPE_REGISTER
Definition WM_types.hh:180
#define ND_HISTORY
Definition WM_types.hh:412
#define NC_SPACE
Definition WM_types.hh:389
PointerRNA ptr
StringRefNull name
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
#define G(x, y, z)
Definition DNA_ID.h:404
void * first
ListBase wm
Definition BKE_main.hh:276
StructRNA * type
Definition RNA_types.hh:52
void * data
Definition RNA_types.hh:53
struct wmOperator * op
struct IDProperty * prop
Wrapper for bScreen.
Object * base_pose_object
struct View3DShading shading
ListBase areabase
wmEventHandler head
eWM_EventHandlerFlag flag
StructRNA * srna
Definition WM_types.hh:1124
struct ReportList * reports
IDProperty * properties
struct wmOperator * next
struct wmOperator * prev
struct wmOperatorType * type
struct PointerRNA * ptr
struct wmMsgBus * message_bus
struct wmKeyConfig * defaultconf
WindowManagerRuntimeHandle * runtime
struct UndoStack * undo_stack
struct wmWindow * winactive
struct wmKeyConfig * userconf
struct wmTimer * autosavetimer
struct wmWindow * windrawable
struct wmKeyConfig * addonconf
struct wmWindow * parent
struct Scene * scene
struct WorkSpaceInstanceHook * workspace_hook
XrSessionSettings session_settings
struct wmXrRuntimeData * runtime
#define N_(msgid)
void WM_main(bContext *C)
Definition wm.cc:631
void wm_close_and_free(bContext *C, wmWindowManager *wm)
Definition wm.cc:572
static void wm_xr_data_free(wmWindowManager *wm)
Definition wm.cc:559
void wm_clear_default_size(bContext *C)
Definition wm.cc:512
void WM_operator_stack_clear(wmWindowManager *wm)
Definition wm.cc:376
static void window_manager_blend_read_data(BlendDataReader *reader, ID *id)
Definition wm.cc:141
static void window_manager_free_data(ID *id)
Definition wm.cc:64
void WM_operator_type_set(wmOperator *op, wmOperatorType *ot)
Definition wm.cc:323
static void window_manager_blend_read_after_liblink(BlendLibReader *reader, ID *id)
Definition wm.cc:233
static void direct_link_wm_xr_data(BlendDataReader *reader, wmXrData *xr_data)
Definition wm.cc:136
void WM_keyconfig_init(bContext *C)
Definition wm.cc:434
void wm_operator_register(bContext *C, wmOperator *op)
Definition wm.cc:351
static void wm_reports_free(wmWindowManager *wm)
Definition wm.cc:346
void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot)
Definition wm.cc:385
void WM_check(bContext *C)
Definition wm.cc:473
IDTypeInfo IDType_ID_WM
Definition wm.cc:244
void WM_keyconfig_reload(bContext *C)
Definition wm.cc:424
static void window_manager_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition wm.cc:111
#define MAX_OP_REGISTERED
Definition wm.cc:275
void wm_add_default(Main *bmain, bContext *C)
Definition wm.cc:534
static void write_wm_xr_data(BlendWriter *writer, wmXrData *xr_data)
Definition wm.cc:106
void WM_operator_free_all_after(wmWindowManager *wm, wmOperator *op)
Definition wm.cc:312
void WM_operator_free(wmOperator *op)
Definition wm.cc:277
static void window_manager_foreach_id(ID *id, LibraryForeachIDData *data)
Definition wm.cc:69
void WM_drag_free_list(ListBase *lb)
void wm_draw_update(bContext *C)
Definition wm_draw.cc:1581
void wm_event_do_handlers(bContext *C)
void wm_event_do_refresh_wm_and_depsgraph(bContext *C)
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void wm_event_do_notifiers(bContext *C)
@ WM_HANDLER_TYPE_OP
@ EVENT_NONE
void WM_file_autosave_init(wmWindowManager *wm)
Definition wm_files.cc:2381
void wm_autosave_timer_end(wmWindowManager *wm)
Definition wm_files.cc:2373
wmOperatorType * ot
Definition wm_files.cc:4240
wmKeyConfig * WM_keyconfig_new(wmWindowManager *wm, const char *idname, bool user_defined)
Definition wm_keymap.cc:291
void WM_keyconfig_free(wmKeyConfig *keyconf)
Definition wm_keymap.cc:361
void WM_keyconfig_update_tag(wmKeyMap *keymap, wmKeyMapItem *kmi)
void WM_msgbus_destroy(wmMsgBus *mbus)
wmMsgBus * WM_msgbus_create()
void wm_window_keymap(wmKeyConfig *keyconf)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
bool WM_operator_properties_default(PointerRNA *ptr, const bool do_update)
void WM_operator_properties_free(PointerRNA *ptr)
wmWindow * wm_window_new(const Main *bmain, wmWindowManager *wm, wmWindow *parent, bool dialog)
Definition wm_window.cc:317
void WM_event_timers_free_all(wmWindowManager *wm)
void wm_window_events_process(const bContext *C)
void wm_window_make_drawable(wmWindowManager *wm, wmWindow *win)
void wm_window_free(bContext *C, wmWindowManager *wm, wmWindow *win)
Definition wm_window.cc:240
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)
void wm_window_ghostwindows_ensure(wmWindowManager *wm)
Definition wm_window.cc:993
bScreen * WM_window_get_active_screen(const wmWindow *win)
void wm_xr_exit(wmWindowManager *wm)
Definition wm_xr.cc:132