Blender V4.3
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 <cstddef>
17#include <cstring>
18
19#include "BLI_ghash.h"
20#include "BLI_sys_types.h"
21
23
24#include "MEM_guardedalloc.h"
25
26#include "BLI_blenlib.h"
27#include "BLI_utildefines.h"
28
29#include "BLT_translation.hh"
30
31#include "BKE_context.hh"
32#include "BKE_global.hh"
33#include "BKE_idprop.hh"
34#include "BKE_idtype.hh"
35#include "BKE_lib_id.hh"
36#include "BKE_lib_query.hh"
37#include "BKE_main.hh"
38#include "BKE_report.hh"
39#include "BKE_screen.hh"
40#include "BKE_workspace.hh"
41
42#include "WM_api.hh"
43#include "WM_message.hh"
44#include "WM_types.hh"
45#include "wm.hh"
46#include "wm_draw.hh"
47#include "wm_event_system.hh"
48#include "wm_window.hh"
49#ifdef WITH_XR_OPENXR
50# include "wm_xr.hh"
51#endif
52
53#include "BKE_undo_system.hh"
54#include "ED_screen.hh"
55
56#ifdef WITH_PYTHON
57# include "BPY_extern.hh"
58# include "BPY_extern_run.hh"
59#endif
60
61#include "BLO_read_write.hh"
62
63/* ****************************************************** */
64
66{
67 wm_close_and_free(nullptr, (wmWindowManager *)id);
68}
69
71{
72 wmWindowManager *wm = reinterpret_cast<wmWindowManager *>(id);
74
75 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
77
78 /* This pointer can be nullptr during old files reading. */
79 if (win->workspace_hook != nullptr) {
80 ID *workspace = (ID *)BKE_workspace_active_get(win->workspace_hook);
82 /* Allow callback to set a different workspace. */
83 BKE_workspace_active_set(win->workspace_hook, (WorkSpace *)workspace);
85 return;
86 }
87 }
88
89 BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, win->unpinned_scene, IDWALK_CB_NOP);
90
91 if (flag & IDWALK_INCLUDE_UI) {
92 LISTBASE_FOREACH (ScrArea *, area, &win->global_areas.areabase) {
95 }
96 }
97
100 }
101 }
102
105}
106
107static void write_wm_xr_data(BlendWriter *writer, wmXrData *xr_data)
108{
110}
111
112static void window_manager_blend_write(BlendWriter *writer, ID *id, const void *id_address)
113{
115
116 wm->runtime = nullptr;
117
118 BLO_write_id_struct(writer, wmWindowManager, id_address, &wm->id);
119 BKE_id_blend_write(writer, &wm->id);
120 write_wm_xr_data(writer, &wm->xr);
121
122 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
123 /* Update deprecated screen member (for so loading in 2.7x uses the correct screen). */
124 win->screen = BKE_workspace_active_screen_get(win->workspace_hook);
125
126 BLO_write_struct(writer, wmWindow, win);
127 BLO_write_struct(writer, WorkSpaceInstanceHook, win->workspace_hook);
128 BLO_write_struct(writer, Stereo3dFormat, win->stereo3d_format);
129
130 BKE_screen_area_map_blend_write(writer, &win->global_areas);
131
132 /* Data is written, clear deprecated data again. */
133 win->screen = nullptr;
134 }
135}
136
141
143{
145
146 id_us_ensure_real(&wm->id);
148
149 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
150 BLO_read_struct(reader, wmWindow, &win->parent);
151
152 WorkSpaceInstanceHook *hook = win->workspace_hook;
153 BLO_read_struct(reader, WorkSpaceInstanceHook, &win->workspace_hook);
154
155 /* This will be nullptr for any pre-2.80 blend file. */
156 if (win->workspace_hook != nullptr) {
157 /* We need to restore a pointer to this later when reading workspaces,
158 * so store in global oldnew-map.
159 * Note that this is only needed for versioning of older .blend files now. */
160 BLO_read_data_globmap_add(reader, hook, win->workspace_hook);
161 /* Cleanup pointers to data outside of this data-block scope. */
162 win->workspace_hook->act_layout = nullptr;
163 win->workspace_hook->temp_workspace_store = nullptr;
164 win->workspace_hook->temp_layout_store = nullptr;
165 }
166
167 BKE_screen_area_map_blend_read_data(reader, &win->global_areas);
168
169 win->ghostwin = nullptr;
170 win->gpuctx = nullptr;
171 win->eventstate = nullptr;
172 win->eventstate_prev_press_time_ms = 0;
173 win->event_last_handled = nullptr;
174 win->cursor_keymap_status = nullptr;
175#if defined(WIN32) || defined(__APPLE__)
176 win->ime_data = nullptr;
177 win->ime_data_is_composing = false;
178#endif
179
180 BLI_listbase_clear(&win->event_queue);
181 BLI_listbase_clear(&win->handlers);
182 BLI_listbase_clear(&win->modalhandlers);
183 BLI_listbase_clear(&win->gesture);
184
185 win->active = 0;
186
187 win->cursor = 0;
188 win->lastcursor = 0;
189 win->modalcursor = 0;
190 win->grabcursor = 0;
191 win->addmousemove = true;
192 win->event_queue_check_click = 0;
193 win->event_queue_check_drag = 0;
194 win->event_queue_check_drag_handled = 0;
195 win->event_queue_consecutive_gesture_type = 0;
196 win->event_queue_consecutive_gesture_data = nullptr;
197 BLO_read_struct(reader, Stereo3dFormat, &win->stereo3d_format);
198
199 /* Multi-view always fallback to anaglyph at file opening
200 * otherwise quad-buffer saved files can break Blender. */
201 if (win->stereo3d_format) {
202 win->stereo3d_format->display_mode = S3D_DISPLAY_ANAGLYPH;
203 }
204 }
205
206 direct_link_wm_xr_data(reader, &wm->xr);
207
212 wm->notifier_queue_set = nullptr;
213 wm->notifier_current = nullptr;
214
216 wm->defaultconf = nullptr;
217 wm->addonconf = nullptr;
218 wm->userconf = nullptr;
219 wm->undo_stack = nullptr;
220
221 wm->message_bus = nullptr;
222
223 wm->xr.runtime = nullptr;
224
227
228 wm->windrawable = nullptr;
229 wm->winactive = nullptr;
230 wm->init_flag = 0;
231 wm->op_undo_depth = 0;
233 wm->extensions_blocked = 0;
234
235 BLI_assert(wm->runtime == nullptr);
236 wm->runtime = MEM_new<blender::bke::WindowManagerRuntime>(__func__);
237}
238
240{
241 wmWindowManager *wm = reinterpret_cast<wmWindowManager *>(id);
242
243 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
244 LISTBASE_FOREACH (ScrArea *, area, &win->global_areas.areabase) {
246 }
247 }
248}
249
251 /*id_code*/ ID_WM,
252 /*id_filter*/ FILTER_ID_WM,
253 /*dependencies_id_types*/ FILTER_ID_SCE | FILTER_ID_WS,
254 /*main_listbase_index*/ INDEX_ID_WM,
255 /*struct_size*/ sizeof(wmWindowManager),
256 /*name*/ "WindowManager",
257 /*name_plural*/ N_("window_managers"),
258 /*translation_context*/ BLT_I18NCONTEXT_ID_WINDOWMANAGER,
261 /*asset_type_info*/ nullptr,
262
263 /*init_data*/ nullptr,
264 /*copy_data*/ nullptr,
265 /*free_data*/ window_manager_free_data,
266 /*make_local*/ nullptr,
267 /*foreach_id*/ window_manager_foreach_id,
268 /*foreach_cache*/ nullptr,
269 /*foreach_path*/ nullptr,
270 /*owner_pointer_get*/ nullptr,
271
272 /*blend_write*/ window_manager_blend_write,
273 /*blend_read_data*/ window_manager_blend_read_data,
274 /*blend_read_after_liblink*/ window_manager_blend_read_after_liblink,
275
276 /*blend_read_undo_preserve*/ nullptr,
277
278 /*lib_override_apply_post*/ nullptr,
279};
280
281#define MAX_OP_REGISTERED 32
282
284{
285
286#ifdef WITH_PYTHON
287 if (op->py_instance) {
288 /* Do this first in case there are any __del__ functions or similar that use properties. */
290 }
291#endif
292
293 if (op->ptr) {
294 op->properties = static_cast<IDProperty *>(op->ptr->data);
295 MEM_delete(op->ptr);
296 }
297
298 if (op->properties) {
300 }
301
302 if (op->reports && (op->reports->flag & RPT_FREE)) {
304 MEM_freeN(op->reports);
305 }
306
307 if (op->macro.first) {
308 wmOperator *opm, *opmnext;
309 for (opm = static_cast<wmOperator *>(op->macro.first); opm; opm = opmnext) {
310 opmnext = opm->next;
311 WM_operator_free(opm);
312 }
313 }
314
315 MEM_freeN(op);
316}
317
319{
320 op = op->next;
321 while (op != nullptr) {
322 wmOperator *op_next = op->next;
323 BLI_remlink(&wm->operators, op);
325 op = op_next;
326 }
327}
328
330{
331 /* Not supported for Python. */
332 BLI_assert(op->py_instance == nullptr);
333
334 op->type = ot;
335 op->ptr->type = ot->srna;
336
337 /* Ensure compatible properties. */
338 if (op->properties) {
341
343
344 if (ptr.data) {
345 IDP_SyncGroupTypes(op->properties, static_cast<const IDProperty *>(ptr.data), true);
346 }
347
349 }
350}
351
353{
354 WM_event_timer_remove(wm, nullptr, wm->runtime->reports.reporttimer);
355}
356
358{
360 int tot = 0;
361
362 BLI_addtail(&wm->operators, op);
363
364 /* Only count registered operators. */
365 while (op) {
366 wmOperator *op_prev = op->prev;
367 if (op->type->flag & OPTYPE_REGISTER) {
368 tot += 1;
369 }
370 if (tot > MAX_OP_REGISTERED) {
371 BLI_remlink(&wm->operators, op);
373 }
374 op = op_prev;
375 }
376
377 /* So the console is redrawn. */
380}
381
383{
384 while (wmOperator *op = static_cast<wmOperator *>(BLI_pophead(&wm->operators))) {
386 }
387
389}
390
392{
393 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
395 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
396 switch (area->spacetype) {
397 case SPACE_FILE: {
398 SpaceFile *sfile = static_cast<SpaceFile *>(area->spacedata.first);
399 if (sfile->op && sfile->op->type == ot) {
400 /* Freed as part of the handler. */
401 sfile->op = nullptr;
402 }
403 break;
404 }
405 }
406 }
407 }
408
409 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
410 ListBase *lb[2] = {&win->handlers, &win->modalhandlers};
411 for (int i = 0; i < ARRAY_SIZE(lb); i++) {
412 LISTBASE_FOREACH (wmEventHandler *, handler_base, lb[i]) {
413 if (handler_base->type == WM_HANDLER_TYPE_OP) {
414 wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base;
415 if (handler->op && handler->op->type == ot) {
416 /* Don't run op->cancel because it needs the context,
417 * assume whoever unregisters the operator will cleanup. */
418 handler->head.flag |= WM_HANDLER_DO_FREE;
419 WM_operator_free(handler->op);
420 handler->op = nullptr;
421 }
422 }
423 }
424 }
425 }
426}
427
428/* ****************************************** */
429
431{
432 if (CTX_py_init_get(C) && !G.background) {
433#ifdef WITH_PYTHON
434 const char *imports[] = {"bpy", nullptr};
435 BPY_run_string_eval(C, imports, "bpy.utils.keyconfig_init()");
436#endif
437 }
438}
439
441{
443
444 /* Create standard key configs. */
445 if (wm->defaultconf == nullptr) {
446 /* Keep lowercase to match the preset filename. */
448 }
449 if (wm->addonconf == nullptr) {
450 wm->addonconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " addon", false);
451 }
452 if (wm->userconf == nullptr) {
453 wm->userconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " user", false);
454 }
455
456 /* Initialize only after python init is done, for keymaps that use python operators. */
457 if (CTX_py_init_get(C) && (wm->init_flag & WM_INIT_FLAG_KEYCONFIG) == 0) {
458 /* Create default key config, only initialize once,
459 * it's persistent across sessions. */
460 if (!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
463
465
467 }
468
469 /* Harmless, but no need to update in background mode. */
470 if (!G.background) {
471 WM_keyconfig_update_tag(nullptr, nullptr);
472 }
473 /* Don't call #WM_keyconfig_update here because add-ons have not yet been registered yet. */
474
476 }
477}
478
480{
481 Main *bmain = CTX_data_main(C);
483
484 /* WM context. */
485 if (wm == nullptr) {
486 wm = static_cast<wmWindowManager *>(bmain->wm.first);
487 CTX_wm_manager_set(C, wm);
488 }
489
490 if (wm == nullptr || BLI_listbase_is_empty(&wm->windows)) {
491 return;
492 }
493
494 /* Run before loading the keyconfig. */
495 if (wm->message_bus == nullptr) {
497 }
498
499 if (!G.background) {
500 /* Case: file-read. */
501 if ((wm->init_flag & WM_INIT_FLAG_WINDOW) == 0) {
504 }
505
506 /* Case: no open windows at all, for old file reads. */
508 }
509
510 /* Case: file-read. */
511 /* NOTE: this runs in background mode to set the screen context cb. */
512 if ((wm->init_flag & WM_INIT_FLAG_WINDOW) == 0) {
513 ED_screens_init(C, bmain, wm);
515 }
516}
517
519{
521
522 /* WM context. */
523 if (wm == nullptr) {
524 wm = static_cast<wmWindowManager *>(CTX_data_main(C)->wm.first);
525 CTX_wm_manager_set(C, wm);
526 }
527
528 if (wm == nullptr || BLI_listbase_is_empty(&wm->windows)) {
529 return;
530 }
531
532 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
533 win->sizex = 0;
534 win->sizey = 0;
535 win->posx = 0;
536 win->posy = 0;
537 }
538}
539
541{
542 wmWindowManager *wm = static_cast<wmWindowManager *>(
543 BKE_libblock_alloc(bmain, ID_WM, "WinMan", 0));
544 wmWindow *win;
545 bScreen *screen = CTX_wm_screen(C); /* XXX: from file read hrmf. */
546 WorkSpace *workspace;
547 WorkSpaceLayout *layout = BKE_workspace_layout_find_global(bmain, screen, &workspace);
548
549 BKE_reports_init(&wm->runtime->reports, RPT_STORE);
550
551 CTX_wm_manager_set(C, wm);
552 win = wm_window_new(bmain, wm, nullptr, false);
553 win->scene = CTX_data_scene(C);
556 BKE_workspace_active_layout_set(win->workspace_hook, win->winid, workspace, layout);
557 screen->winid = win->winid;
558
559 wm->winactive = win;
560 wm->file_saved = 1;
561 wm->runtime = MEM_new<blender::bke::WindowManagerRuntime>(__func__);
563}
564
566{
567 if (wm->autosavetimer) {
569 }
570
571#ifdef WITH_XR_OPENXR
572 /* May send notifier, so do before freeing notifier queue. */
573 wm_xr_exit(wm);
574#endif
575
576 while (wmWindow *win = static_cast<wmWindow *>(BLI_pophead(&wm->windows))) {
577 /* Prevent draw clear to use screen. */
578 BKE_workspace_active_set(win->workspace_hook, nullptr);
579 wm_window_free(C, wm, win);
580 }
581
582 while (wmOperator *op = static_cast<wmOperator *>(BLI_pophead(&wm->operators))) {
584 }
585
586 while (wmKeyConfig *keyconf = static_cast<wmKeyConfig *>(BLI_pophead(&wm->keyconfigs))) {
587 WM_keyconfig_free(keyconf);
588 }
589
591 if (wm->notifier_queue_set) {
592 BLI_gset_free(wm->notifier_queue_set, nullptr);
593 wm->notifier_queue_set = nullptr;
594 }
595 BLI_assert(wm->notifier_current == nullptr);
596 wm->notifier_current = nullptr;
597
598 if (wm->message_bus != nullptr) {
600 }
601
602#ifdef WITH_PYTHON
604#endif
606
608
609 wm_reports_free(wm);
610
611 /* NOTE(@ideasman42): typically timers are associated with windows and timers will have been
612 * freed when the windows are removed. However timers can be created which don't have windows
613 * and in this case it's necessary to free them on exit, see: #109953. */
615
616 if (wm->undo_stack) {
618 wm->undo_stack = nullptr;
619 }
620
621 if (C && CTX_wm_manager(C) == wm) {
622 CTX_wm_manager_set(C, nullptr);
623 }
624
625 MEM_delete(wm->runtime);
626}
627
629{
630 /* Single refresh before handling events.
631 * This ensures we don't run operators before the depsgraph has been evaluated. */
633
634 while (true) {
635
636 /* Get events from ghost, handle window events, add to window queues. */
638
639 /* Per window, all events to the window, screen, area and region handlers. */
641
642 /* Events have left notes about changes, we handle and cache it. */
644
645 /* Execute cached changes draw. */
647 }
648}
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:1227
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:41
@ 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:50
@ IDTYPE_FLAGS_NEVER_UNUSED
Definition BKE_idtype.hh:64
void * BKE_libblock_alloc(Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
Definition lib_id.cc:1415
void id_us_ensure_real(ID *id)
Definition lib_id.cc:306
void BKE_id_blend_write(BlendWriter *writer, ID *id)
Definition lib_id.cc:2560
void BKE_lib_query_foreachid_process(LibraryForeachIDData *data, ID **id_pp, int cb_flag)
Definition lib_query.cc:71
#define BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data_, func_call_)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
@ IDWALK_CB_USER_ONE
@ IDWALK_CB_USER
@ IDWALK_CB_NOP
int BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
Definition lib_query.cc:120
@ IDWALK_DO_DEPRECATED_POINTERS
@ IDWALK_INCLUDE_UI
bool BKE_lib_query_foreachid_iter_stop(const LibraryForeachIDData *data)
Definition lib_query.cc:66
void BKE_reports_free(ReportList *reports)
Definition report.cc:69
void BKE_reports_init(ReportList *reports, int flag)
Definition report.cc:54
void BKE_screen_view3d_shading_blend_read_data(BlendDataReader *reader, View3DShading *shading)
Definition screen.cc:1055
void BKE_screen_area_map_blend_write(BlendWriter *writer, ScrAreaMap *area_map)
Definition screen.cc:1152
void BKE_screen_area_blend_read_after_liblink(BlendLibReader *reader, ID *parent_id, ScrArea *area)
Definition screen.cc:1405
void BKE_screen_view3d_shading_blend_write(BlendWriter *writer, View3DShading *shading)
Definition screen.cc:1048
bool BKE_screen_area_map_blend_read_data(BlendDataReader *reader, ScrAreaMap *area_map)
Definition screen.cc:1359
void BKE_screen_foreach_id_screen_area(LibraryForeachIDData *data, ScrArea *area)
Definition screen.cc:84
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:604
bScreen * BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition workspace.cc:613
WorkSpace * BKE_workspace_active_get(WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition workspace.cc:562
void BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) SETTER_ATTRS
Definition workspace.cc:566
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:50
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
Definition BLI_ghash.c:1034
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:496
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:130
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:251
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define ARRAY_SIZE(arr)
#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:5140
#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:1201
#define FILTER_ID_WS
Definition DNA_ID.h:1193
@ INDEX_ID_WM
Definition DNA_ID.h:1322
#define FILTER_ID_SCE
Definition DNA_ID.h:1184
@ ID_WM
@ S3D_DISPLAY_ANAGLYPH
@ SPACE_FILE
@ WM_INIT_FLAG_KEYCONFIG
@ WM_INIT_FLAG_WINDOW
@ KEYCONF_INIT_DEFAULT
struct wmWindowManager wmWindowManager
#define WM_KEYCONFIG_STR_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:470
@ OPTYPE_REGISTER
Definition WM_types.hh:160
#define NC_WM
Definition WM_types.hh:341
#define ND_SPACE_INFO_REPORT
Definition WM_types.hh:486
#define ND_HISTORY
Definition WM_types.hh:382
#define NC_SPACE
Definition WM_types.hh:359
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
#define G(x, y, z)
Definition DNA_ID.h:413
void * first
ListBase wm
Definition BKE_main.hh:239
StructRNA * type
Definition RNA_types.hh:41
void * data
Definition RNA_types.hh:42
struct wmOperator * op
Wrapper for bScreen.
Object * base_pose_object
struct View3DShading shading
wmEventHandler head
eWM_EventHandlerFlag flag
StructRNA * srna
Definition WM_types.hh:1080
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 GSet * notifier_queue_set
struct wmKeyConfig * addonconf
const struct wmNotifier * notifier_current
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:628
void wm_close_and_free(bContext *C, wmWindowManager *wm)
Definition wm.cc:565
void wm_clear_default_size(bContext *C)
Definition wm.cc:518
void WM_operator_stack_clear(wmWindowManager *wm)
Definition wm.cc:382
static void window_manager_blend_read_data(BlendDataReader *reader, ID *id)
Definition wm.cc:142
static void window_manager_free_data(ID *id)
Definition wm.cc:65
void WM_operator_type_set(wmOperator *op, wmOperatorType *ot)
Definition wm.cc:329
static void window_manager_blend_read_after_liblink(BlendLibReader *reader, ID *id)
Definition wm.cc:239
static void direct_link_wm_xr_data(BlendDataReader *reader, wmXrData *xr_data)
Definition wm.cc:137
void WM_keyconfig_init(bContext *C)
Definition wm.cc:440
void wm_operator_register(bContext *C, wmOperator *op)
Definition wm.cc:357
static void wm_reports_free(wmWindowManager *wm)
Definition wm.cc:352
void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot)
Definition wm.cc:391
void WM_check(bContext *C)
Definition wm.cc:479
IDTypeInfo IDType_ID_WM
Definition wm.cc:250
void WM_keyconfig_reload(bContext *C)
Definition wm.cc:430
static void window_manager_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition wm.cc:112
#define MAX_OP_REGISTERED
Definition wm.cc:281
void wm_add_default(Main *bmain, bContext *C)
Definition wm.cc:540
static void write_wm_xr_data(BlendWriter *writer, wmXrData *xr_data)
Definition wm.cc:107
void WM_operator_free_all_after(wmWindowManager *wm, wmOperator *op)
Definition wm.cc:318
void WM_operator_free(wmOperator *op)
Definition wm.cc:283
static void window_manager_foreach_id(ID *id, LibraryForeachIDData *data)
Definition wm.cc:70
void WM_drag_free_list(ListBase *lb)
void wm_draw_update(bContext *C)
Definition wm_draw.cc:1541
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
void WM_file_autosave_init(wmWindowManager *wm)
Definition wm_files.cc:2353
void wm_autosave_timer_end(wmWindowManager *wm)
Definition wm_files.cc:2345
PointerRNA * ptr
Definition wm_files.cc:4126
wmOperatorType * ot
Definition wm_files.cc:4125
wmKeyConfig * WM_keyconfig_new(wmWindowManager *wm, const char *idname, bool user_defined)
Definition wm_keymap.cc:289
void WM_keyconfig_free(wmKeyConfig *keyconf)
Definition wm_keymap.cc:360
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:308
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:235
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)
void wm_window_ghostwindows_ensure(wmWindowManager *wm)
Definition wm_window.cc:880
bScreen * WM_window_get_active_screen(const wmWindow *win)
uint8_t flag
Definition wm_window.cc:138
void wm_xr_exit(wmWindowManager *wm)
Definition wm_xr.cc:116