Blender V5.0
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
12
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_utf8.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 BKE_screen_area_map_blend_read_data(reader, &win->global_areas);
167
168 win->ghostwin = nullptr;
169 win->gpuctx = nullptr;
170 win->eventstate = nullptr;
171 win->eventstate_prev_press_time_ms = 0;
172 win->event_last_handled = nullptr;
173 win->cursor_keymap_status = nullptr;
174
175 BLI_listbase_clear(&win->handlers);
176 BLI_listbase_clear(&win->modalhandlers);
177 BLI_listbase_clear(&win->gesture);
178
179 win->active = 0;
180
181 win->cursor = 0;
182 win->lastcursor = 0;
183 win->modalcursor = 0;
184 win->grabcursor = 0;
185 win->addmousemove = true;
186 win->event_queue_check_click = 0;
187 win->event_queue_check_drag = 0;
188 win->event_queue_check_drag_handled = 0;
189 win->event_queue_consecutive_gesture_type = EVENT_NONE;
190 win->event_queue_consecutive_gesture_data = nullptr;
191 BLO_read_struct(reader, Stereo3dFormat, &win->stereo3d_format);
192
193 /* Multi-view always falls back to anaglyph at file opening
194 * otherwise quad-buffer saved files can break Blender. */
195 if (win->stereo3d_format) {
196 win->stereo3d_format->display_mode = S3D_DISPLAY_ANAGLYPH;
197 }
198 win->runtime = MEM_new<blender::bke::WindowRuntime>(__func__);
199 }
200
201 direct_link_wm_xr_data(reader, &wm->xr);
202
203 wm->xr.runtime = nullptr;
204
205 wm->init_flag = 0;
206 wm->op_undo_depth = 0;
208 wm->extensions_blocked = 0;
209
210 BLI_assert(wm->runtime == nullptr);
211 wm->runtime = MEM_new<blender::bke::WindowManagerRuntime>(__func__);
212}
213
215{
216 wmWindowManager *wm = reinterpret_cast<wmWindowManager *>(id);
217
218 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
219 LISTBASE_FOREACH (ScrArea *, area, &win->global_areas.areabase) {
221 }
222 }
223}
224
226 /*id_code*/ wmWindowManager::id_type,
227 /*id_filter*/ FILTER_ID_WM,
228 /*dependencies_id_types*/ FILTER_ID_SCE | FILTER_ID_WS,
229 /*main_listbase_index*/ INDEX_ID_WM,
230 /*struct_size*/ sizeof(wmWindowManager),
231 /*name*/ "WindowManager",
232 /*name_plural*/ N_("window_managers"),
233 /*translation_context*/ BLT_I18NCONTEXT_ID_WINDOWMANAGER,
236 /*asset_type_info*/ nullptr,
237
238 /*init_data*/ nullptr,
239 /*copy_data*/ nullptr,
240 /*free_data*/ window_manager_free_data,
241 /*make_local*/ nullptr,
242 /*foreach_id*/ window_manager_foreach_id,
243 /*foreach_cache*/ nullptr,
244 /*foreach_path*/ nullptr,
245 /*foreach_working_space_color*/ nullptr,
246 /*owner_pointer_get*/ nullptr,
247
248 /*blend_write*/ window_manager_blend_write,
249 /*blend_read_data*/ window_manager_blend_read_data,
250 /*blend_read_after_liblink*/ window_manager_blend_read_after_liblink,
251
252 /*blend_read_undo_preserve*/ nullptr,
253
254 /*lib_override_apply_post*/ nullptr,
255};
256
257#define MAX_OP_REGISTERED 32
258
260{
261
262#ifdef WITH_PYTHON
263 if (op->py_instance) {
264 /* Do this first in case there are any __del__ functions or similar that use properties. */
266 }
267#endif
268
269 if (op->ptr) {
270 op->properties = static_cast<IDProperty *>(op->ptr->data);
271 MEM_delete(op->ptr);
272 }
273
274 if (op->properties) {
276 }
277
278 if (op->reports && (op->reports->flag & RPT_FREE)) {
280 MEM_freeN(op->reports);
281 }
282
283 if (op->macro.first) {
284 wmOperator *opm, *opmnext;
285 for (opm = static_cast<wmOperator *>(op->macro.first); opm; opm = opmnext) {
286 opmnext = opm->next;
287 WM_operator_free(opm);
288 }
289 }
290
291 MEM_freeN(op);
292}
293
295{
296 op = op->next;
297 while (op != nullptr) {
298 wmOperator *op_next = op->next;
299 BLI_remlink(&wm->runtime->operators, op);
301 op = op_next;
302 }
303}
304
306{
307 /* Not supported for Python. */
308 BLI_assert(op->py_instance == nullptr);
309
310 op->type = ot;
311 op->ptr->type = ot->srna;
312
313 /* Ensure compatible properties. */
314 if (op->properties) {
317
319
320 if (ptr.data) {
321 IDP_SyncGroupTypes(op->properties, static_cast<const IDProperty *>(ptr.data), true);
322 }
323
325 }
326}
327
329{
330 WM_event_timer_remove(wm, nullptr, wm->runtime->reports.reporttimer);
331}
332
334{
336 int tot = 0;
337
338 BLI_addtail(&wm->runtime->operators, op);
339
340 /* Only count registered operators. */
341 while (op) {
342 wmOperator *op_prev = op->prev;
343 if (op->type->flag & OPTYPE_REGISTER) {
344 tot += 1;
345 }
346 if (tot > MAX_OP_REGISTERED) {
347 BLI_remlink(&wm->runtime->operators, op);
349 }
350 op = op_prev;
351 }
352
353 /* So the console is redrawn. */
356}
357
359{
360 while (wmOperator *op = static_cast<wmOperator *>(BLI_pophead(&wm->runtime->operators))) {
362 }
363
365}
366
368{
369 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
371 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
372 switch (area->spacetype) {
373 case SPACE_FILE: {
374 SpaceFile *sfile = static_cast<SpaceFile *>(area->spacedata.first);
375 if (sfile->op && sfile->op->type == ot) {
376 /* Freed as part of the handler. */
377 sfile->op = nullptr;
378 }
379 break;
380 }
381 }
382 }
383 }
384
385 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
386 ListBase *lb[2] = {&win->handlers, &win->modalhandlers};
387 for (int i = 0; i < ARRAY_SIZE(lb); i++) {
388 LISTBASE_FOREACH (wmEventHandler *, handler_base, lb[i]) {
389 if (handler_base->type == WM_HANDLER_TYPE_OP) {
390 wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base;
391 if (handler->op && handler->op->type == ot) {
392 /* Don't run op->cancel because it needs the context,
393 * assume whoever unregisters the operator will cleanup. */
394 handler->head.flag |= WM_HANDLER_DO_FREE;
395 WM_operator_free(handler->op);
396 handler->op = nullptr;
397 }
398 }
399 }
400 }
401 }
402}
403
404/* ****************************************** */
405
407{
408 if (CTX_py_init_get(C) && !G.background) {
409#ifdef WITH_PYTHON
410 const char *imports[] = {"bpy", nullptr};
411 BPY_run_string_eval(C, imports, "bpy.utils.keyconfig_init()");
412#endif
413 }
414}
415
417{
419
420 /* Create standard key configuration. */
421 if (wm->runtime->defaultconf == nullptr) {
422 /* Keep lowercase to match the preset filename. */
423 wm->runtime->defaultconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT, false);
424 }
425 if (wm->runtime->addonconf == nullptr) {
426 wm->runtime->addonconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " addon", false);
427 }
428 if (wm->runtime->userconf == nullptr) {
429 wm->runtime->userconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " user", false);
430 }
431
432 /* Initialize only after python init is done, for keymaps that use python operators. */
433 if (CTX_py_init_get(C) && (wm->init_flag & WM_INIT_FLAG_KEYCONFIG) == 0) {
434 /* Create default key config, only initialize once,
435 * it's persistent across sessions. */
436 if (!(wm->runtime->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
437 wm_window_keymap(wm->runtime->defaultconf);
438 ED_spacetypes_keymap(wm->runtime->defaultconf);
439
441
442 wm->runtime->defaultconf->flag |= KEYCONF_INIT_DEFAULT;
443 }
444
445 /* Harmless, but no need to update in background mode. */
446 if (!G.background) {
447 WM_keyconfig_update_tag(nullptr, nullptr);
448 }
449 /* Don't call #WM_keyconfig_update here because add-ons have not yet been registered yet. */
450
452 }
453}
454
456{
457 Main *bmain = CTX_data_main(C);
459
460 /* WM context. */
461 if (wm == nullptr) {
462 wm = static_cast<wmWindowManager *>(bmain->wm.first);
464 }
465
466 if (wm == nullptr || BLI_listbase_is_empty(&wm->windows)) {
467 return;
468 }
469
470 /* Run before loading the keyconfig. */
471 if (wm->runtime->message_bus == nullptr) {
472 wm->runtime->message_bus = WM_msgbus_create();
473 }
474
475 if (!G.background) {
476 /* Case: file-read. */
477 if ((wm->init_flag & WM_INIT_FLAG_WINDOW) == 0) {
480 }
481
482 /* Case: no open windows at all, for old file reads. */
484 }
485
486 /* Case: file-read. */
487 /* NOTE: this runs in background mode to set the screen context cb. */
488 if ((wm->init_flag & WM_INIT_FLAG_WINDOW) == 0) {
489 ED_screens_init(C, bmain, wm);
491 }
492}
493
495{
497
498 /* WM context. */
499 if (wm == nullptr) {
500 wm = static_cast<wmWindowManager *>(CTX_data_main(C)->wm.first);
502 }
503
504 if (wm == nullptr || BLI_listbase_is_empty(&wm->windows)) {
505 return;
506 }
507
508 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
509 win->sizex = 0;
510 win->sizey = 0;
511 win->posx = 0;
512 win->posy = 0;
513 }
514}
515
517{
518 wmWindowManager *wm = static_cast<wmWindowManager *>(
519 BKE_libblock_alloc(bmain, ID_WM, "WinMan", 0));
520 wmWindow *win;
521 bScreen *screen = CTX_wm_screen(C); /* XXX: from file read hrmf. */
522 WorkSpace *workspace;
523 WorkSpaceLayout *layout = BKE_workspace_layout_find_global(bmain, screen, &workspace);
524
526 win = wm_window_new(bmain, wm, nullptr, false);
527 win->scene = CTX_data_scene(C);
530 BKE_workspace_active_layout_set(win->workspace_hook, win->winid, workspace, layout);
531 screen->winid = win->winid;
532
533 wm->runtime = MEM_new<blender::bke::WindowManagerRuntime>(__func__);
534 wm->runtime->winactive = win;
535 wm->file_saved = 1;
537}
538
540{
541 /* NOTE: this also runs when built without `WITH_XR_OPENXR`.
542 * It's necessary to prevent leaks when XR data is created or loaded into non XR builds.
543 * This can occur when Python reads all properties (see the `bl_rna_paths` test). */
544
545 /* Note that non-runtime data in `wm->xr` is freed as part of freeing the window manager. */
548 wm->xr.session_settings.shading.prop = nullptr;
549 }
550}
551
553{
554 if (wm->autosavetimer) {
556 }
557
558#ifdef WITH_XR_OPENXR
559 /* May send notifier, so do before freeing notifier queue. */
560 wm_xr_exit(wm);
561#endif
562 wm_xr_data_free(wm);
563
564 while (wmWindow *win = static_cast<wmWindow *>(BLI_pophead(&wm->windows))) {
565 /* Prevent draw clear to use screen. */
566 BKE_workspace_active_set(win->workspace_hook, nullptr);
567 wm_window_free(C, wm, win);
568 }
569
570#ifdef WITH_PYTHON
572#endif
573
574 wm_reports_free(wm);
575
576 if (C && CTX_wm_manager(C) == wm) {
577 CTX_wm_manager_set(C, nullptr);
578 }
579
580 MEM_delete(wm->runtime);
581}
582
584{
585 /* Single refresh before handling events.
586 * This ensures we don't run operators before the depsgraph has been evaluated. */
588
589 while (true) {
590
591 /* Get events from ghost, handle window events, add to window queues. */
593
594 /* Per window, all events to the window, screen, area and region handlers. */
596
597 /* Events have left notes about changes, we handle and cache it. */
599
600 /* Execute cached changes draw. */
602 }
603}
bScreen * CTX_wm_screen(const bContext *C)
void CTX_wm_manager_set(bContext *C, wmWindowManager *wm)
bool CTX_py_init_get(const bContext *C)
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:1251
void IDP_SyncGroupTypes(IDProperty *dest, const IDProperty *src, bool do_arraylen) ATTR_NONNULL()
Definition idprop.cc:612
@ IDTYPE_FLAGS_NO_ANIMDATA
Definition BKE_idtype.hh:49
@ IDTYPE_FLAGS_NO_COPY
Definition BKE_idtype.hh:33
@ IDTYPE_FLAGS_NO_LIBLINKING
Definition BKE_idtype.hh:35
@ IDTYPE_FLAGS_NO_MEMFILE_UNDO
Definition BKE_idtype.hh:58
@ IDTYPE_FLAGS_NEVER_UNUSED
Definition BKE_idtype.hh:72
IDTypeInfo IDType_ID_WM
Definition wm.cc:225
void * BKE_libblock_alloc(Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
Definition lib_id.cc:1447
void id_us_ensure_real(ID *id)
Definition lib_id.cc:313
void BKE_id_blend_write(BlendWriter *writer, ID *id)
Definition lib_id.cc:2631
#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
@ RPT_FREE
Definition BKE_report.hh:57
void BKE_reports_free(ReportList *reports)
Definition report.cc:97
void BKE_screen_view3d_shading_blend_read_data(BlendDataReader *reader, View3DShading *shading)
Definition screen.cc:1096
void BKE_screen_area_map_blend_write(BlendWriter *writer, ScrAreaMap *area_map)
Definition screen.cc:1202
void BKE_screen_area_blend_read_after_liblink(BlendLibReader *reader, ID *parent_id, ScrArea *area)
Definition screen.cc:1470
void BKE_screen_view3d_shading_blend_write(BlendWriter *writer, View3DShading *shading)
Definition screen.cc:1089
bool BKE_screen_area_map_blend_read_data(BlendDataReader *reader, ScrAreaMap *area_map)
Definition screen.cc:1423
void BKE_screen_foreach_id_screen_area(LibraryForeachIDData *data, ScrArea *area)
Definition screen.cc:97
void BKE_workspace_active_layout_set(WorkSpaceInstanceHook *hook, int winid, WorkSpace *workspace, WorkSpaceLayout *layout) SETTER_ATTRS
Activate a layout.
Definition workspace.cc:605
bScreen * BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition workspace.cc:614
WorkSpace * BKE_workspace_active_get(WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition workspace.cc:563
void BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) SETTER_ATTRS
Definition workspace.cc:567
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 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
#define STRNCPY_UTF8(dst, src)
#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:5968
#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:1234
#define FILTER_ID_WS
Definition DNA_ID.h:1226
@ INDEX_ID_WM
Definition DNA_ID.h:1354
#define FILTER_ID_SCE
Definition DNA_ID.h:1217
@ ID_WM
@ S3D_DISPLAY_ANAGLYPH
@ SPACE_FILE
@ WM_INIT_FLAG_KEYCONFIG
@ WM_INIT_FLAG_WINDOW
@ KEYCONF_INIT_DEFAULT
#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.
#define C
Definition RandGen.cpp:29
@ WM_HANDLER_DO_FREE
Definition WM_api.hh:585
#define NC_WM
Definition WM_types.hh:374
@ OPTYPE_REGISTER
Definition WM_types.hh:180
#define ND_SPACE_INFO_REPORT
Definition WM_types.hh:520
#define ND_HISTORY
Definition WM_types.hh:415
#define NC_SPACE
Definition WM_types.hh:392
BMesh const char void * data
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
#define G(x, y, z)
const char * name
Definition DNA_ID.h:414
void * first
ListBase wm
Definition BKE_main.hh:307
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
struct ReportList * reports
IDProperty * properties
struct wmOperator * next
struct wmOperator * prev
struct wmOperatorType * type
struct PointerRNA * ptr
WindowManagerRuntimeHandle * runtime
struct wmTimer * autosavetimer
struct wmWindow * parent
struct Scene * scene
struct WorkSpaceInstanceHook * workspace_hook
XrSessionSettings session_settings
struct wmXrRuntimeData * runtime
i
Definition text_draw.cc:230
#define N_(msgid)
void WM_main(bContext *C)
Definition wm.cc:583
void wm_close_and_free(bContext *C, wmWindowManager *wm)
Definition wm.cc:552
static void wm_xr_data_free(wmWindowManager *wm)
Definition wm.cc:539
void wm_clear_default_size(bContext *C)
Definition wm.cc:494
void WM_operator_stack_clear(wmWindowManager *wm)
Definition wm.cc:358
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:305
static void window_manager_blend_read_after_liblink(BlendLibReader *reader, ID *id)
Definition wm.cc:214
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:416
void wm_operator_register(bContext *C, wmOperator *op)
Definition wm.cc:333
static void wm_reports_free(wmWindowManager *wm)
Definition wm.cc:328
void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot)
Definition wm.cc:367
void WM_check(bContext *C)
Definition wm.cc:455
void WM_keyconfig_reload(bContext *C)
Definition wm.cc:406
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:257
void wm_add_default(Main *bmain, bContext *C)
Definition wm.cc:516
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:294
void WM_operator_free(wmOperator *op)
Definition wm.cc:259
static void window_manager_foreach_id(ID *id, LibraryForeachIDData *data)
Definition wm.cc:69
void wm_draw_update(bContext *C)
Definition wm_draw.cc:1614
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:2394
void wm_autosave_timer_end(wmWindowManager *wm)
Definition wm_files.cc:2386
PointerRNA * ptr
Definition wm_files.cc:4238
wmOperatorType * ot
Definition wm_files.cc:4237
wmKeyConfig * WM_keyconfig_new(wmWindowManager *wm, const char *idname, bool user_defined)
Definition wm_keymap.cc:291
void WM_keyconfig_update_tag(wmKeyMap *keymap, wmKeyMapItem *kmi)
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:319
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:245
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)
void wm_window_ghostwindows_ensure(wmWindowManager *wm)
bScreen * WM_window_get_active_screen(const wmWindow *win)
uint8_t flag
Definition wm_window.cc:145
void wm_xr_exit(wmWindowManager *wm)
Definition wm_xr.cc:132