Blender  V3.3
wm.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2007 Blender Foundation. All rights reserved. */
3 
12 /* Allow using deprecated functionality for .blend file I/O. */
13 #define DNA_DEPRECATED_ALLOW
14 
15 #include <stddef.h>
16 #include <string.h>
17 
18 #include "BLI_sys_types.h"
19 
21 
22 #include "MEM_guardedalloc.h"
23 
24 #include "BLI_blenlib.h"
25 #include "BLI_utildefines.h"
26 
27 #include "BLT_translation.h"
28 
29 #include "BKE_context.h"
30 #include "BKE_global.h"
31 #include "BKE_idprop.h"
32 #include "BKE_idtype.h"
33 #include "BKE_lib_id.h"
34 #include "BKE_lib_query.h"
35 #include "BKE_main.h"
36 #include "BKE_report.h"
37 #include "BKE_screen.h"
38 #include "BKE_workspace.h"
39 
40 #include "WM_api.h"
41 #include "WM_message.h"
42 #include "WM_types.h"
43 #include "wm.h"
44 #include "wm_draw.h"
45 #include "wm_event_system.h"
46 #include "wm_window.h"
47 #ifdef WITH_XR_OPENXR
48 # include "wm_xr.h"
49 #endif
50 
51 #include "BKE_undo_system.h"
52 #include "ED_screen.h"
53 
54 #ifdef WITH_PYTHON
55 # include "BPY_extern.h"
56 # include "BPY_extern_run.h"
57 #endif
58 
59 #include "BLO_read_write.h"
60 
61 /* ****************************************************** */
62 
63 static void window_manager_free_data(ID *id)
64 {
66 }
67 
69 {
70  wmWindowManager *wm = (wmWindowManager *)id;
71 
72  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
74 
75  /* This pointer can be NULL during old files reading, better be safe than sorry. */
76  if (win->workspace_hook != NULL) {
77  ID *workspace = (ID *)BKE_workspace_active_get(win->workspace_hook);
79  /* Allow callback to set a different workspace. */
80  BKE_workspace_active_set(win->workspace_hook, (WorkSpace *)workspace);
82  return;
83  }
84 
86  }
87 
89  LISTBASE_FOREACH (ScrArea *, area, &win->global_areas.areabase) {
92  }
93  }
94  }
95 }
96 
97 static void write_wm_xr_data(BlendWriter *writer, wmXrData *xr_data)
98 {
100 }
101 
102 static void window_manager_blend_write(BlendWriter *writer, ID *id, const void *id_address)
103 {
104  wmWindowManager *wm = (wmWindowManager *)id;
105 
106  BLO_write_id_struct(writer, wmWindowManager, id_address, &wm->id);
107  BKE_id_blend_write(writer, &wm->id);
108  write_wm_xr_data(writer, &wm->xr);
109 
110  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
111  /* update deprecated screen member (for so loading in 2.7x uses the correct screen) */
112  win->screen = BKE_workspace_active_screen_get(win->workspace_hook);
113 
114  BLO_write_struct(writer, wmWindow, win);
115  BLO_write_struct(writer, WorkSpaceInstanceHook, win->workspace_hook);
116  BLO_write_struct(writer, Stereo3dFormat, win->stereo3d_format);
117 
118  BKE_screen_area_map_blend_write(writer, &win->global_areas);
119 
120  /* data is written, clear deprecated data again */
121  win->screen = NULL;
122  }
123 }
124 
125 static void direct_link_wm_xr_data(BlendDataReader *reader, wmXrData *xr_data)
126 {
128 }
129 
131 {
132  wmWindowManager *wm = (wmWindowManager *)id;
133 
134  id_us_ensure_real(&wm->id);
135  BLO_read_list(reader, &wm->windows);
136 
137  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
138  BLO_read_data_address(reader, &win->parent);
139 
140  WorkSpaceInstanceHook *hook = win->workspace_hook;
141  BLO_read_data_address(reader, &win->workspace_hook);
142 
143  /* This will be NULL for any pre-2.80 blend file. */
144  if (win->workspace_hook != NULL) {
145  /* We need to restore a pointer to this later when reading workspaces,
146  * so store in global oldnew-map.
147  * Note that this is only needed for versioning of older .blend files now. */
148  BLO_read_data_globmap_add(reader, hook, win->workspace_hook);
149  /* Cleanup pointers to data outside of this data-block scope. */
150  win->workspace_hook->act_layout = NULL;
151  win->workspace_hook->temp_workspace_store = NULL;
152  win->workspace_hook->temp_layout_store = NULL;
153  }
154 
155  BKE_screen_area_map_blend_read_data(reader, &win->global_areas);
156 
157  win->ghostwin = NULL;
158  win->gpuctx = NULL;
159  win->eventstate = NULL;
160  win->event_last_handled = NULL;
161  win->cursor_keymap_status = NULL;
162 #if defined(WIN32) || defined(__APPLE__)
163  win->ime_data = NULL;
164 #endif
165 
166  BLI_listbase_clear(&win->event_queue);
167  BLI_listbase_clear(&win->handlers);
168  BLI_listbase_clear(&win->modalhandlers);
169  BLI_listbase_clear(&win->gesture);
170 
171  win->active = 0;
172 
173  win->cursor = 0;
174  win->lastcursor = 0;
175  win->modalcursor = 0;
176  win->grabcursor = 0;
177  win->addmousemove = true;
178  win->event_queue_check_click = 0;
179  win->event_queue_check_drag = 0;
180  win->event_queue_check_drag_handled = 0;
181  BLO_read_data_address(reader, &win->stereo3d_format);
182 
183  /* Multi-view always fallback to anaglyph at file opening
184  * otherwise quad-buffer saved files can break Blender. */
185  if (win->stereo3d_format) {
186  win->stereo3d_format->display_mode = S3D_DISPLAY_ANAGLYPH;
187  }
188  }
189 
190  direct_link_wm_xr_data(reader, &wm->xr);
191 
197 
199  wm->defaultconf = NULL;
200  wm->addonconf = NULL;
201  wm->userconf = NULL;
202  wm->undo_stack = NULL;
203 
204  wm->message_bus = NULL;
205 
206  wm->xr.runtime = NULL;
207 
208  BLI_listbase_clear(&wm->jobs);
210 
211  wm->windrawable = NULL;
212  wm->winactive = NULL;
213  wm->initialized = 0;
214  wm->op_undo_depth = 0;
215  wm->is_interface_locked = 0;
216 }
217 
218 static void lib_link_wm_xr_data(BlendLibReader *reader, ID *parent_id, wmXrData *xr_data)
219 {
220  BLO_read_id_address(reader, parent_id->lib, &xr_data->session_settings.base_pose_object);
221 }
222 
224  WorkSpaceInstanceHook *hook,
225  ID *id)
226 {
227  WorkSpace *workspace = BKE_workspace_active_get(hook);
228  BLO_read_id_address(reader, id->lib, &workspace);
229 
230  BKE_workspace_active_set(hook, workspace);
231 }
232 
234 {
235  wmWindowManager *wm = (wmWindowManager *)id;
236 
237  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
238  if (win->workspace_hook) { /* NULL for old files */
239  lib_link_workspace_instance_hook(reader, win->workspace_hook, &wm->id);
240  }
241  BLO_read_id_address(reader, wm->id.lib, &win->scene);
242  /* deprecated, but needed for versioning (will be NULL'ed then) */
243  BLO_read_id_address(reader, NULL, &win->screen);
244 
245  /* The unpinned scene is a UI->Scene-data pointer, and should be NULL'ed on linking (like
246  * WorkSpace.pin_scene). But the WindowManager ID (owning the window) is never linked. */
247  BLI_assert(!ID_IS_LINKED(id));
248  BLO_read_id_address(reader, id->lib, &win->unpinned_scene);
249 
250  LISTBASE_FOREACH (ScrArea *, area, &win->global_areas.areabase) {
251  BKE_screen_area_blend_read_lib(reader, &wm->id, area);
252  }
253 
254  lib_link_wm_xr_data(reader, &wm->id, &wm->xr);
255  }
256 }
257 
259  .id_code = ID_WM,
260  .id_filter = FILTER_ID_WM,
261  .main_listbase_index = INDEX_ID_WM,
262  .struct_size = sizeof(wmWindowManager),
263  .name = "WindowManager",
264  .name_plural = "window_managers",
265  .translation_context = BLT_I18NCONTEXT_ID_WINDOWMANAGER,
267  .asset_type_info = NULL,
268 
269  .init_data = NULL,
270  .copy_data = NULL,
271  .free_data = window_manager_free_data,
272  .make_local = NULL,
273  .foreach_id = window_manager_foreach_id,
274  .foreach_cache = NULL,
275  .foreach_path = NULL,
276  .owner_get = NULL,
277 
278  .blend_write = window_manager_blend_write,
279  .blend_read_data = window_manager_blend_read_data,
280  .blend_read_lib = window_manager_blend_read_lib,
281  .blend_read_expand = NULL,
282 
283  .blend_read_undo_preserve = NULL,
284 
285  .lib_override_apply_post = NULL,
286 };
287 
288 #define MAX_OP_REGISTERED 32
289 
291 {
292 
293 #ifdef WITH_PYTHON
294  if (op->py_instance) {
295  /* Do this first in case there are any __del__ functions or similar that use properties. */
297  }
298 #endif
299 
300  if (op->ptr) {
301  op->properties = op->ptr->data;
302  MEM_freeN(op->ptr);
303  }
304 
305  if (op->properties) {
307  }
308 
309  if (op->reports && (op->reports->flag & RPT_FREE)) {
311  MEM_freeN(op->reports);
312  }
313 
314  if (op->macro.first) {
315  wmOperator *opm, *opmnext;
316  for (opm = op->macro.first; opm; opm = opmnext) {
317  opmnext = opm->next;
318  WM_operator_free(opm);
319  }
320  }
321 
322  MEM_freeN(op);
323 }
324 
326 {
327  op = op->next;
328  while (op != NULL) {
329  wmOperator *op_next = op->next;
330  BLI_remlink(&wm->operators, op);
331  WM_operator_free(op);
332  op = op_next;
333  }
334 }
335 
337 {
338  /* Not supported for Python. */
339  BLI_assert(op->py_instance == NULL);
340 
341  op->type = ot;
342  op->ptr->type = ot->srna;
343 
344  /* Ensure compatible properties. */
345  if (op->properties) {
346  PointerRNA ptr;
348 
350 
351  if (ptr.data) {
353  }
354 
356  }
357 }
358 
360 {
363 }
364 
366 {
368  int tot = 0;
369 
370  BLI_addtail(&wm->operators, op);
371 
372  /* Only count registered operators. */
373  while (op) {
374  wmOperator *op_prev = op->prev;
375  if (op->type->flag & OPTYPE_REGISTER) {
376  tot += 1;
377  }
378  if (tot > MAX_OP_REGISTERED) {
379  BLI_remlink(&wm->operators, op);
380  WM_operator_free(op);
381  }
382  op = op_prev;
383  }
384 
385  /* So the console is redrawn. */
388 }
389 
391 {
392  wmOperator *op;
393 
394  while ((op = BLI_pophead(&wm->operators))) {
395  WM_operator_free(op);
396  }
397 
399 }
400 
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 = NULL;
415  }
416  }
417  }
418  }
419  }
420 }
421 
422 /* ****************************************** */
423 
425 {
426  if (CTX_py_init_get(C) && !G.background) {
427 #ifdef WITH_PYTHON
428  BPY_run_string_eval(C, (const char *[]){"bpy", NULL}, "bpy.utils.keyconfig_init()");
429 #endif
430  }
431 }
432 
434 {
436 
437  /* Create standard key configs. */
438  if (wm->defaultconf == NULL) {
439  /* Keep lowercase to match the preset filename. */
441  }
442  if (wm->addonconf == NULL) {
443  wm->addonconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " addon", false);
444  }
445  if (wm->userconf == NULL) {
446  wm->userconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " user", false);
447  }
448 
449  /* Initialize only after python init is done, for keymaps that use python operators. */
450  if (CTX_py_init_get(C) && (wm->initialized & WM_KEYCONFIG_IS_INIT) == 0) {
451  /* create default key config, only initialize once,
452  * it's persistent across sessions */
453  if (!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
456 
458 
460  }
461 
462  /* Harmless, but no need to update in background mode. */
463  if (!G.background) {
465  }
467 
469  }
470 }
471 
473 {
474  Main *bmain = CTX_data_main(C);
476 
477  /* WM context. */
478  if (wm == NULL) {
479  wm = bmain->wm.first;
480  CTX_wm_manager_set(C, wm);
481  }
482 
483  if (wm == NULL || BLI_listbase_is_empty(&wm->windows)) {
484  return;
485  }
486 
487  /* Run before loading the keyconfig. */
488  if (wm->message_bus == NULL) {
490  }
491 
492  if (!G.background) {
493  /* Case: file-read. */
494  if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
497  }
498 
499  /* Case: no open windows at all, for old file reads. */
501  }
502 
503  /* Case: file-read. */
504  /* NOTE: this runs in background mode to set the screen context cb. */
505  if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
506  ED_screens_init(bmain, wm);
508  }
509 }
510 
512 {
514 
515  /* WM context. */
516  if (wm == NULL) {
517  wm = CTX_data_main(C)->wm.first;
518  CTX_wm_manager_set(C, wm);
519  }
520 
521  if (wm == NULL || BLI_listbase_is_empty(&wm->windows)) {
522  return;
523  }
524 
525  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
526  win->sizex = 0;
527  win->sizey = 0;
528  win->posx = 0;
529  win->posy = 0;
530  }
531 }
532 
534 {
535  wmWindowManager *wm = BKE_libblock_alloc(bmain, ID_WM, "WinMan", 0);
536  wmWindow *win;
537  bScreen *screen = CTX_wm_screen(C); /* XXX from file read hrmf */
538  WorkSpace *workspace;
539  WorkSpaceLayout *layout = BKE_workspace_layout_find_global(bmain, screen, &workspace);
540 
541  CTX_wm_manager_set(C, wm);
542  win = wm_window_new(bmain, wm, NULL, false);
543  win->scene = CTX_data_scene(C);
545  BKE_workspace_active_set(win->workspace_hook, workspace);
546  BKE_workspace_active_layout_set(win->workspace_hook, win->winid, workspace, layout);
547  screen->winid = win->winid;
548 
549  wm->winactive = win;
550  wm->file_saved = 1;
551  wm_window_make_drawable(wm, win);
552 }
553 
555 {
556  if (wm->autosavetimer) {
558  }
559 
560 #ifdef WITH_XR_OPENXR
561  /* May send notifier, so do before freeing notifier queue. */
562  wm_xr_exit(wm);
563 #endif
564 
565  wmWindow *win;
566  while ((win = BLI_pophead(&wm->windows))) {
567  /* Prevent draw clear to use screen. */
569  wm_window_free(C, wm, win);
570  }
571 
572  wmOperator *op;
573  while ((op = BLI_pophead(&wm->operators))) {
574  WM_operator_free(op);
575  }
576 
577  wmKeyConfig *keyconf;
578  while ((keyconf = BLI_pophead(&wm->keyconfigs))) {
579  WM_keyconfig_free(keyconf);
580  }
581 
583 
584  if (wm->message_bus != NULL) {
586  }
587 
588 #ifdef WITH_PYTHON
590 #endif
592 
593  WM_drag_free_list(&wm->drags);
594 
595  wm_reports_free(wm);
596 
597  if (wm->undo_stack) {
599  wm->undo_stack = NULL;
600  }
601 
602  if (C && CTX_wm_manager(C) == wm) {
604  }
605 }
606 
608 {
609  wmWindowManager *wm;
610  while ((wm = wmlist->first)) {
611  wm_close_and_free(C, wm);
612  BLI_remlink(wmlist, wm);
613  /* Don't handle user counts as this is only ever called once #G_MAIN has already been freed via
614  * #BKE_main_free so any ID's referenced by the window-manager (from ID properties) will crash.
615  * See: T100703. */
616  BKE_libblock_free_data(&wm->id, false);
618  MEM_freeN(wm);
619  }
620 }
621 
623 {
624  /* Single refresh before handling events.
625  * This ensures we don't run operators before the depsgraph has been evaluated. */
627 
628  while (1) {
629 
630  /* Get events from ghost, handle window events, add to window queues. */
632 
633  /* Per window, all events to the window, screen, area and region handlers. */
635 
636  /* Events have left notes about changes, we handle and cache it. */
638 
639  /* Execute cached changes draw. */
640  wm_draw_update(C);
641  }
642 }
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
bool CTX_py_init_get(bContext *C)
Definition: context.c:233
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:713
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1100
struct bScreen * CTX_wm_screen(const bContext *C)
Definition: context.c:733
void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm)
Definition: context.c:950
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
void IDP_SyncGroupTypes(struct IDProperty *dest, const struct IDProperty *src, bool do_arraylen) ATTR_NONNULL()
void IDP_FreeProperty(struct IDProperty *prop)
Definition: idprop.c:1093
@ IDTYPE_FLAGS_NO_ANIMDATA
Definition: BKE_idtype.h:41
@ IDTYPE_FLAGS_NO_COPY
Definition: BKE_idtype.h:30
@ IDTYPE_FLAGS_NO_LIBLINKING
Definition: BKE_idtype.h:32
void BKE_libblock_free_data(struct ID *id, bool do_id_user) ATTR_NONNULL()
Definition: lib_id_delete.c:44
void BKE_libblock_free_data_py(struct ID *id)
void * BKE_libblock_alloc(struct Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
Definition: lib_id.c:1050
void id_us_ensure_real(struct ID *id)
Definition: lib_id.c:260
void BKE_id_blend_write(struct BlendWriter *writer, struct ID *id)
Definition: lib_id.c:2008
bool BKE_lib_query_foreachid_iter_stop(struct LibraryForeachIDData *data)
Definition: lib_query.c:63
void BKE_lib_query_foreachid_process(struct LibraryForeachIDData *data, struct ID **id_pp, int cb_flag)
Definition: lib_query.c:68
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(_data, _id_super, _cb_flag)
#define BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(_data, _func_call)
@ IDWALK_INCLUDE_UI
int BKE_lib_query_foreachid_process_flags_get(struct LibraryForeachIDData *data)
Definition: lib_query.c:109
@ IDWALK_CB_USER_ONE
Definition: BKE_lib_query.h:79
@ IDWALK_CB_USER
Definition: BKE_lib_query.h:73
@ IDWALK_CB_NOP
Definition: BKE_lib_query.h:33
void BKE_reports_clear(ReportList *reports)
Definition: report.c:63
void BKE_reports_init(ReportList *reports, int flag)
Definition: report.c:50
void BKE_screen_foreach_id_screen_area(struct LibraryForeachIDData *data, struct ScrArea *area)
Definition: screen.c:85
void BKE_screen_area_map_blend_write(struct BlendWriter *writer, struct ScrAreaMap *area_map)
Definition: screen.c:1346
bool BKE_screen_area_map_blend_read_data(struct BlendDataReader *reader, struct ScrAreaMap *area_map)
Definition: screen.c:1747
void BKE_screen_view3d_shading_blend_read_data(struct BlendDataReader *reader, struct View3DShading *shading)
Definition: screen.c:1078
void BKE_screen_area_blend_read_lib(struct BlendLibReader *reader, struct ID *parent_id, struct ScrArea *area)
Definition: screen.c:1772
void BKE_screen_view3d_shading_blend_write(struct BlendWriter *writer, struct View3DShading *shading)
Definition: screen.c:1071
void BKE_undosys_stack_destroy(UndoStack *ustack)
Definition: undo_system.c:256
struct WorkSpace * BKE_workspace_active_get(struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition: workspace.c:516
struct bScreen * BKE_workspace_active_screen_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
void BKE_workspace_active_layout_set(struct WorkSpaceInstanceHook *hook, int winid, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) SETTER_ATTRS
Activate a layout.
Definition: workspace.c:557
void BKE_workspace_active_set(struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace) SETTER_ATTRS
Definition: workspace.c:520
struct WorkSpaceLayout * BKE_workspace_layout_find_global(const struct Main *bmain, const struct bScreen *screen, struct WorkSpace **r_workspace) ATTR_NONNULL(1
#define BLI_assert(a)
Definition: BLI_assert.h:46
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:269
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:221
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
Definition: BLI_listbase.h:273
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:100
#define STRNCPY(dst, src)
Definition: BLI_string.h:483
#define ARRAY_SIZE(arr)
#define BLO_read_data_address(reader, ptr_p)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_read_list(BlendDataReader *reader, struct ListBase *list)
Definition: readfile.c:5172
void BLO_read_data_globmap_add(BlendDataReader *reader, void *oldaddr, void *newaddr)
Definition: readfile.c:5293
#define BLO_read_id_address(reader, lib, id_ptr_p)
#define BLT_I18NCONTEXT_ID_WINDOWMANAGER
void BPY_DECREF_RNA_INVALIDATE(void *pyob_ptr)
void BPY_callback_wm_free(struct wmWindowManager *wm)
bool BPY_run_string_eval(struct bContext *C, const char *imports[], const char *expr)
#define FILTER_ID_WM
Definition: DNA_ID.h:936
@ INDEX_ID_WM
Definition: DNA_ID.h:1054
#define ID_IS_LINKED(_id)
Definition: DNA_ID.h:566
@ ID_WM
Definition: DNA_ID_enums.h:72
@ S3D_DISPLAY_ANAGLYPH
@ KEYCONF_INIT_DEFAULT
struct wmWindowManager wmWindowManager
@ WM_KEYCONFIG_IS_INIT
@ WM_WINDOW_IS_INIT
#define WM_KEYCONFIG_STR_DEFAULT
void ED_screens_init(struct Main *bmain, struct wmWindowManager *wm)
Definition: screen_edit.c:650
void ED_spacetypes_keymap(struct wmKeyConfig *keyconf)
Definition: spacetypes.c:178
Read Guarded memory(de)allocation.
static void init_data(ModifierData *md)
#define C
Definition: RandGen.cpp:25
@ WM_HANDLER_DO_FREE
Definition: WM_api.h:435
@ OPTYPE_REGISTER
Definition: WM_types.h:146
#define NC_WM
Definition: WM_types.h:324
#define ND_SPACE_INFO_REPORT
Definition: WM_types.h:463
#define ND_HISTORY
Definition: WM_types.h:363
#define NC_SPACE
Definition: WM_types.h:342
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
#define G(x, y, z)
static void area(int d1, int d2, int e1, int e2, float weights[2])
short id_code
Definition: BKE_idtype.h:114
Definition: DNA_ID.h:368
struct Library * lib
Definition: DNA_ID.h:372
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
ListBase wm
Definition: BKE_main.h:197
struct StructRNA * type
Definition: RNA_types.h:37
void * data
Definition: RNA_types.h:38
struct wmTimer * reporttimer
Wrapper for bScreen.
Object * base_pose_object
Definition: DNA_xr_types.h:25
struct View3DShading shading
Definition: DNA_xr_types.h:19
wmEventHandler head
struct StructRNA * srna
Definition: WM_types.h:969
struct ReportList * reports
IDProperty * properties
struct wmOperator * next
struct wmOperator * prev
struct wmOperatorType * type
struct PointerRNA * ptr
struct wmMsgBus * message_bus
struct wmKeyConfig * defaultconf
struct ReportList reports
struct UndoStack * undo_stack
struct wmWindow * winactive
struct wmKeyConfig * userconf
struct wmTimer * autosavetimer
struct wmWindow * windrawable
struct wmKeyConfig * addonconf
struct Scene * scene
char view_layer_name[64]
struct WorkSpaceInstanceHook * workspace_hook
XrSessionSettings session_settings
struct wmXrRuntimeData * runtime
void WM_main(bContext *C)
Definition: wm.c:622
void wm_close_and_free(bContext *C, wmWindowManager *wm)
Definition: wm.c:554
void wm_clear_default_size(bContext *C)
Definition: wm.c:511
void WM_operator_stack_clear(wmWindowManager *wm)
Definition: wm.c:390
void wm_close_and_free_all(bContext *C, ListBase *wmlist)
Definition: wm.c:607
static void lib_link_workspace_instance_hook(BlendLibReader *reader, WorkSpaceInstanceHook *hook, ID *id)
Definition: wm.c:223
static void window_manager_blend_read_data(BlendDataReader *reader, ID *id)
Definition: wm.c:130
static void window_manager_free_data(ID *id)
Definition: wm.c:63
void WM_operator_type_set(wmOperator *op, wmOperatorType *ot)
Definition: wm.c:336
void WM_operator_free_all_after(wmWindowManager *wm, struct wmOperator *op)
Definition: wm.c:325
static void window_manager_blend_read_lib(BlendLibReader *reader, ID *id)
Definition: wm.c:233
static void direct_link_wm_xr_data(BlendDataReader *reader, wmXrData *xr_data)
Definition: wm.c:125
void WM_keyconfig_init(bContext *C)
Definition: wm.c:433
void wm_operator_register(bContext *C, wmOperator *op)
Definition: wm.c:365
static void wm_reports_free(wmWindowManager *wm)
Definition: wm.c:359
void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot)
Definition: wm.c:401
void WM_check(bContext *C)
Definition: wm.c:472
IDTypeInfo IDType_ID_WM
Definition: wm.c:258
void WM_keyconfig_reload(bContext *C)
Definition: wm.c:424
static void window_manager_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition: wm.c:102
#define MAX_OP_REGISTERED
Definition: wm.c:288
void wm_add_default(Main *bmain, bContext *C)
Definition: wm.c:533
static void write_wm_xr_data(BlendWriter *writer, wmXrData *xr_data)
Definition: wm.c:97
void WM_operator_free(wmOperator *op)
Definition: wm.c:290
static void lib_link_wm_xr_data(BlendLibReader *reader, ID *parent_id, wmXrData *xr_data)
Definition: wm.c:218
static void window_manager_foreach_id(ID *id, LibraryForeachIDData *data)
Definition: wm.c:68
void WM_drag_free_list(ListBase *lb)
Definition: wm_dragdrop.cc:333
void wm_draw_update(bContext *C)
Definition: wm_draw.c:1302
void wm_event_do_handlers(bContext *C)
void WM_main_add_notifier(unsigned int type, void *reference)
void wm_event_do_refresh_wm_and_depsgraph(bContext *C)
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.c:1984
void wm_autosave_timer_end(wmWindowManager *wm)
Definition: wm_files.c:1976
PointerRNA * ptr
Definition: wm_files.c:3480
wmOperatorType * ot
Definition: wm_files.c:3479
void WM_keyconfig_update(wmWindowManager *wm)
Definition: wm_keymap.c:1829
void WM_keyconfig_free(wmKeyConfig *keyconf)
Definition: wm_keymap.c:321
wmKeyConfig * WM_keyconfig_new(wmWindowManager *wm, const char *idname, bool user_defined)
Definition: wm_keymap.c:259
void WM_keyconfig_update_tag(wmKeyMap *keymap, wmKeyMapItem *kmi)
Definition: wm_keymap.c:1787
void WM_msgbus_destroy(struct wmMsgBus *mbus)
struct wmMsgBus * WM_msgbus_create(void)
void wm_window_keymap(wmKeyConfig *keyconf)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
Definition: wm_operators.c:661
bool WM_operator_properties_default(PointerRNA *ptr, const bool do_update)
Definition: wm_operators.c:730
void WM_operator_properties_free(PointerRNA *ptr)
Definition: wm_operators.c:783
void WM_event_remove_timer(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer)
Definition: wm_window.c:1682
wmWindow * wm_window_new(const Main *bmain, wmWindowManager *wm, wmWindow *parent, bool dialog)
Definition: wm_window.c:252
void wm_window_process_events(const bContext *C)
Definition: wm_window.c:1537
void wm_window_make_drawable(wmWindowManager *wm, wmWindow *win)
Definition: wm_window.c:1028
void wm_window_free(bContext *C, wmWindowManager *wm, wmWindow *win)
Definition: wm_window.c:182
void wm_window_ghostwindows_ensure(wmWindowManager *wm)
Definition: wm_window.c:661
void wm_xr_exit(wmWindowManager *wm)
Definition: wm_xr.c:111