Blender  V2.93
wm.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2007 Blender Foundation.
17  * All rights reserved.
18  */
19 
28 /* Allow using deprecated functionality for .blend file I/O. */
29 #define DNA_DEPRECATED_ALLOW
30 
31 #include <stddef.h>
32 #include <string.h>
33 
34 #include "BLI_sys_types.h"
35 
37 
38 #include "MEM_guardedalloc.h"
39 
40 #include "BLI_blenlib.h"
41 #include "BLI_utildefines.h"
42 
43 #include "BLT_translation.h"
44 
45 #include "BKE_context.h"
46 #include "BKE_global.h"
47 #include "BKE_idprop.h"
48 #include "BKE_idtype.h"
49 #include "BKE_lib_id.h"
50 #include "BKE_lib_query.h"
51 #include "BKE_main.h"
52 #include "BKE_report.h"
53 #include "BKE_screen.h"
54 #include "BKE_workspace.h"
55 
56 #include "WM_api.h"
57 #include "WM_message.h"
58 #include "WM_types.h"
59 #include "wm.h"
60 #include "wm_draw.h"
61 #include "wm_event_system.h"
62 #include "wm_window.h"
63 #ifdef WITH_XR_OPENXR
64 # include "wm_xr.h"
65 #endif
66 
67 #include "BKE_undo_system.h"
68 #include "ED_screen.h"
69 
70 #ifdef WITH_PYTHON
71 # include "BPY_extern.h"
72 # include "BPY_extern_run.h"
73 #endif
74 
75 #include "BLO_read_write.h"
76 
77 /* ****************************************************** */
78 
79 static void window_manager_free_data(ID *id)
80 {
82 }
83 
85 {
86  wmWindowManager *wm = (wmWindowManager *)id;
87 
88  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
90 
91  /* This pointer can be NULL during old files reading, better be safe than sorry. */
92  if (win->workspace_hook != NULL) {
93  ID *workspace = (ID *)BKE_workspace_active_get(win->workspace_hook);
95  /* Allow callback to set a different workspace. */
96  BKE_workspace_active_set(win->workspace_hook, (WorkSpace *)workspace);
97  }
99  LISTBASE_FOREACH (ScrArea *, area, &win->global_areas.areabase) {
101  }
102  }
103  }
104 }
105 
106 static void write_wm_xr_data(BlendWriter *writer, wmXrData *xr_data)
107 {
109 }
110 
111 static void window_manager_blend_write(BlendWriter *writer, ID *id, const void *id_address)
112 {
113  wmWindowManager *wm = (wmWindowManager *)id;
114 
115  BLO_write_id_struct(writer, wmWindowManager, id_address, &wm->id);
116  BKE_id_blend_write(writer, &wm->id);
117  write_wm_xr_data(writer, &wm->xr);
118 
119  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
120  /* update deprecated screen member (for so loading in 2.7x uses the correct screen) */
121  win->screen = BKE_workspace_active_screen_get(win->workspace_hook);
122 
123  BLO_write_struct(writer, wmWindow, win);
124  BLO_write_struct(writer, WorkSpaceInstanceHook, win->workspace_hook);
125  BLO_write_struct(writer, Stereo3dFormat, win->stereo3d_format);
126 
127  BKE_screen_area_map_blend_write(writer, &win->global_areas);
128 
129  /* data is written, clear deprecated data again */
130  win->screen = NULL;
131  }
132 }
133 
134 static void direct_link_wm_xr_data(BlendDataReader *reader, wmXrData *xr_data)
135 {
137 }
138 
140 {
141  wmWindowManager *wm = (wmWindowManager *)id;
142 
143  id_us_ensure_real(&wm->id);
144  BLO_read_list(reader, &wm->windows);
145 
146  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
147  BLO_read_data_address(reader, &win->parent);
148 
149  WorkSpaceInstanceHook *hook = win->workspace_hook;
150  BLO_read_data_address(reader, &win->workspace_hook);
151 
152  /* This will be NULL for any pre-2.80 blend file. */
153  if (win->workspace_hook != NULL) {
154  /* We need to restore a pointer to this later when reading workspaces,
155  * so store in global oldnew-map.
156  * Note that this is only needed for versioning of older .blend files now.. */
157  BLO_read_data_globmap_add(reader, hook, win->workspace_hook);
158  /* Cleanup pointers to data outside of this data-block scope. */
159  win->workspace_hook->act_layout = NULL;
160  win->workspace_hook->temp_workspace_store = NULL;
161  win->workspace_hook->temp_layout_store = NULL;
162  }
163 
164  BKE_screen_area_map_blend_read_data(reader, &win->global_areas);
165 
166  win->ghostwin = NULL;
167  win->gpuctx = NULL;
168  win->eventstate = NULL;
169  win->cursor_keymap_status = NULL;
170  win->tweak = NULL;
171 #ifdef WIN32
172  win->ime_data = NULL;
173 #endif
174 
175  BLI_listbase_clear(&win->event_queue);
176  BLI_listbase_clear(&win->handlers);
177  BLI_listbase_clear(&win->modalhandlers);
178  BLI_listbase_clear(&win->gesture);
179 
180  win->active = 0;
181 
182  win->cursor = 0;
183  win->lastcursor = 0;
184  win->modalcursor = 0;
185  win->grabcursor = 0;
186  win->addmousemove = true;
187  win->event_queue_check_click = 0;
188  win->event_queue_check_drag = 0;
189  win->event_queue_check_drag_handled = 0;
190  BLO_read_data_address(reader, &win->stereo3d_format);
191 
192  /* Multi-view always fallback to anaglyph at file opening
193  * otherwise quad-buffer saved files can break Blender. */
194  if (win->stereo3d_format) {
195  win->stereo3d_format->display_mode = S3D_DISPLAY_ANAGLYPH;
196  }
197  }
198 
199  direct_link_wm_xr_data(reader, &wm->xr);
200 
206 
208  wm->defaultconf = NULL;
209  wm->addonconf = NULL;
210  wm->userconf = NULL;
211  wm->undo_stack = NULL;
212 
213  wm->message_bus = NULL;
214 
215  wm->xr.runtime = NULL;
216 
217  BLI_listbase_clear(&wm->jobs);
219 
220  wm->windrawable = NULL;
221  wm->winactive = NULL;
222  wm->initialized = 0;
223  wm->op_undo_depth = 0;
224  wm->is_interface_locked = 0;
225 }
226 
227 static void lib_link_wm_xr_data(BlendLibReader *reader, ID *parent_id, wmXrData *xr_data)
228 {
229  BLO_read_id_address(reader, parent_id->lib, &xr_data->session_settings.base_pose_object);
230 }
231 
233  WorkSpaceInstanceHook *hook,
234  ID *id)
235 {
236  WorkSpace *workspace = BKE_workspace_active_get(hook);
237  BLO_read_id_address(reader, id->lib, &workspace);
238  BKE_workspace_active_set(hook, workspace);
239 }
240 
242 {
243  wmWindowManager *wm = (wmWindowManager *)id;
244 
245  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
246  if (win->workspace_hook) { /* NULL for old files */
247  lib_link_workspace_instance_hook(reader, win->workspace_hook, &wm->id);
248  }
249  BLO_read_id_address(reader, wm->id.lib, &win->scene);
250  /* deprecated, but needed for versioning (will be NULL'ed then) */
251  BLO_read_id_address(reader, NULL, &win->screen);
252 
253  LISTBASE_FOREACH (ScrArea *, area, &win->global_areas.areabase) {
254  BKE_screen_area_blend_read_lib(reader, &wm->id, area);
255  }
256 
257  lib_link_wm_xr_data(reader, &wm->id, &wm->xr);
258  }
259 }
260 
262  .id_code = ID_WM,
263  .id_filter = 0,
264  .main_listbase_index = INDEX_ID_WM,
265  .struct_size = sizeof(wmWindowManager),
266  .name = "WindowManager",
267  .name_plural = "window_managers",
268  .translation_context = BLT_I18NCONTEXT_ID_WINDOWMANAGER,
271 
272  .init_data = NULL,
273  .copy_data = NULL,
274  .free_data = window_manager_free_data,
275  .make_local = NULL,
276  .foreach_id = window_manager_foreach_id,
277  .foreach_cache = NULL,
278  .owner_get = NULL,
279 
280  .blend_write = window_manager_blend_write,
281  .blend_read_data = window_manager_blend_read_data,
282  .blend_read_lib = window_manager_blend_read_lib,
283  .blend_read_expand = NULL,
284 
285  .blend_read_undo_preserve = NULL,
286 
287  .lib_override_apply_post = NULL,
288 };
289 
290 #define MAX_OP_REGISTERED 32
291 
293 {
294 
295 #ifdef WITH_PYTHON
296  if (op->py_instance) {
297  /* Do this first in case there are any __del__ functions or similar that use properties. */
299  }
300 #endif
301 
302  if (op->ptr) {
303  op->properties = op->ptr->data;
304  MEM_freeN(op->ptr);
305  }
306 
307  if (op->properties) {
309  }
310 
311  if (op->reports && (op->reports->flag & RPT_FREE)) {
313  MEM_freeN(op->reports);
314  }
315 
316  if (op->macro.first) {
317  wmOperator *opm, *opmnext;
318  for (opm = op->macro.first; opm; opm = opmnext) {
319  opmnext = opm->next;
320  WM_operator_free(opm);
321  }
322  }
323 
324  MEM_freeN(op);
325 }
326 
328 {
329  op = op->next;
330  while (op != NULL) {
331  wmOperator *op_next = op->next;
332  BLI_remlink(&wm->operators, op);
333  WM_operator_free(op);
334  op = op_next;
335  }
336 }
337 
346 {
347  /* Not supported for Python. */
348  BLI_assert(op->py_instance == NULL);
349 
350  op->type = ot;
351  op->ptr->type = ot->srna;
352 
353  /* Ensure compatible properties. */
354  if (op->properties) {
355  PointerRNA ptr;
357 
359 
360  if (ptr.data) {
362  }
363 
365  }
366 }
367 
369 {
372 }
373 
374 /* All operations get registered in the windowmanager here. */
375 /* Called on event handling by event_system.c. */
377 {
379  int tot = 0;
380 
381  BLI_addtail(&wm->operators, op);
382 
383  /* Only count registered operators. */
384  while (op) {
385  wmOperator *op_prev = op->prev;
386  if (op->type->flag & OPTYPE_REGISTER) {
387  tot += 1;
388  }
389  if (tot > MAX_OP_REGISTERED) {
390  BLI_remlink(&wm->operators, op);
391  WM_operator_free(op);
392  }
393  op = op_prev;
394  }
395 
396  /* So the console is redrawn. */
399 }
400 
402 {
403  wmOperator *op;
404 
405  while ((op = BLI_pophead(&wm->operators))) {
406  WM_operator_free(op);
407  }
408 
410 }
411 
417 {
418  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
419  ListBase *lb[2] = {&win->handlers, &win->modalhandlers};
420  for (int i = 0; i < ARRAY_SIZE(lb); i++) {
421  LISTBASE_FOREACH (wmEventHandler *, handler_base, lb[i]) {
422  if (handler_base->type == WM_HANDLER_TYPE_OP) {
423  wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base;
424  if (handler->op && handler->op->type == ot) {
425  /* don't run op->cancel because it needs the context,
426  * assume whoever unregisters the operator will cleanup */
427  handler->head.flag |= WM_HANDLER_DO_FREE;
428  WM_operator_free(handler->op);
429  handler->op = NULL;
430  }
431  }
432  }
433  }
434  }
435 }
436 
437 /* ****************************************** */
438 
440 {
441  if (CTX_py_init_get(C) && !G.background) {
442 #ifdef WITH_PYTHON
443  BPY_run_string_eval(C, (const char *[]){"bpy", NULL}, "bpy.utils.keyconfig_init()");
444 #endif
445  }
446 }
447 
449 {
451 
452  /* Create standard key configs. */
453  if (wm->defaultconf == NULL) {
454  /* Keep lowercase to match the preset filename. */
456  }
457  if (wm->addonconf == NULL) {
458  wm->addonconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " addon", false);
459  }
460  if (wm->userconf == NULL) {
461  wm->userconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " user", false);
462  }
463 
464  /* Initialize only after python init is done, for keymaps that use python operators. */
465  if (CTX_py_init_get(C) && (wm->initialized & WM_KEYCONFIG_IS_INIT) == 0) {
466  /* create default key config, only initialize once,
467  * it's persistent across sessions */
468  if (!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
471 
473 
475  }
476 
477  /* Harmless, but no need to update in background mode. */
478  if (!G.background) {
480  }
482 
484  }
485 }
486 
488 {
489  Main *bmain = CTX_data_main(C);
491 
492  /* WM context. */
493  if (wm == NULL) {
494  wm = bmain->wm.first;
495  CTX_wm_manager_set(C, wm);
496  }
497 
498  if (wm == NULL || BLI_listbase_is_empty(&wm->windows)) {
499  return;
500  }
501 
502  /* Run before loading the keyconfig. */
503  if (wm->message_bus == NULL) {
505  }
506 
507  if (!G.background) {
508  /* Case: fileread. */
509  if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
511  WM_autosave_init(wm);
512  }
513 
514  /* Case: no open windows at all, for old file reads. */
516  }
517 
518  /* Case: fileread. */
519  /* Note: this runs in background mode to set the screen context cb. */
520  if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
521  ED_screens_init(bmain, wm);
523  }
524 }
525 
527 {
529 
530  /* WM context. */
531  if (wm == NULL) {
532  wm = CTX_data_main(C)->wm.first;
533  CTX_wm_manager_set(C, wm);
534  }
535 
536  if (wm == NULL || BLI_listbase_is_empty(&wm->windows)) {
537  return;
538  }
539 
540  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
541  win->sizex = 0;
542  win->sizey = 0;
543  win->posx = 0;
544  win->posy = 0;
545  }
546 }
547 
548 /* On startup, it adds all data, for matching. */
550 {
551  wmWindowManager *wm = BKE_libblock_alloc(bmain, ID_WM, "WinMan", 0);
552  wmWindow *win;
553  bScreen *screen = CTX_wm_screen(C); /* XXX from file read hrmf */
554  WorkSpace *workspace;
555  WorkSpaceLayout *layout = BKE_workspace_layout_find_global(bmain, screen, &workspace);
556 
557  CTX_wm_manager_set(C, wm);
558  win = wm_window_new(bmain, wm, NULL, false);
559  win->scene = CTX_data_scene(C);
561  BKE_workspace_active_set(win->workspace_hook, workspace);
562  BKE_workspace_active_layout_set(win->workspace_hook, win->winid, workspace, layout);
563  screen->winid = win->winid;
564 
565  wm->winactive = win;
566  wm->file_saved = 1;
567  wm_window_make_drawable(wm, win);
568 }
569 
570 /* Context is allowed to be NULL, do not free wm itself (lib_id.c). */
572 {
573  if (wm->autosavetimer) {
575  }
576 
577 #ifdef WITH_XR_OPENXR
578  /* May send notifier, so do before freeing notifier queue. */
579  wm_xr_exit(wm);
580 #endif
581 
582  wmWindow *win;
583  while ((win = BLI_pophead(&wm->windows))) {
584  /* Prevent draw clear to use screen. */
586  wm_window_free(C, wm, win);
587  }
588 
589  wmOperator *op;
590  while ((op = BLI_pophead(&wm->operators))) {
591  WM_operator_free(op);
592  }
593 
594  wmKeyConfig *keyconf;
595  while ((keyconf = BLI_pophead(&wm->keyconfigs))) {
596  WM_keyconfig_free(keyconf);
597  }
598 
600 
601  if (wm->message_bus != NULL) {
603  }
604 
605 #ifdef WITH_PYTHON
607 #endif
609 
610  WM_drag_free_list(&wm->drags);
611 
612  wm_reports_free(wm);
613 
614  if (wm->undo_stack) {
616  wm->undo_stack = NULL;
617  }
618 
619  if (C && CTX_wm_manager(C) == wm) {
621  }
622 }
623 
625 {
626  wmWindowManager *wm;
627  while ((wm = wmlist->first)) {
628  wm_close_and_free(C, wm);
629  BLI_remlink(wmlist, wm);
630  BKE_libblock_free_data(&wm->id, true);
632  MEM_freeN(wm);
633  }
634 }
635 
637 {
638  /* Single refresh before handling events.
639  * This ensures we don't run operators before the depsgraph has been evaluated. */
641 
642  while (1) {
643 
644  /* Get events from ghost, handle window events, add to window queues. */
646 
647  /* Per window, all events to the window, screen, area and region handlers. */
649 
650  /* Events have left notes about changes, we handle and cache it. */
652 
653  /* Execute cached changes draw. */
654  wm_draw_update(C);
655  }
656 }
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
bool CTX_py_init_get(bContext *C)
Definition: context.c:215
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:689
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct bScreen * CTX_wm_screen(const bContext *C)
Definition: context.c:709
void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm)
Definition: context.c:926
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
void IDP_FreeProperty(struct IDProperty *prop)
Definition: idprop.c:1040
void IDP_SyncGroupTypes(struct IDProperty *dest, const struct IDProperty *src, const bool do_arraylen) ATTR_NONNULL()
@ IDTYPE_FLAGS_NO_MAKELOCAL
Definition: BKE_idtype.h:49
@ IDTYPE_FLAGS_NO_ANIMDATA
Definition: BKE_idtype.h:51
@ IDTYPE_FLAGS_NO_COPY
Definition: BKE_idtype.h:45
@ IDTYPE_FLAGS_NO_LIBLINKING
Definition: BKE_idtype.h:47
void BKE_libblock_free_data_py(struct ID *id)
void BKE_libblock_free_data(struct ID *id, const bool do_id_user) ATTR_NONNULL()
Definition: lib_id_delete.c:55
void * BKE_libblock_alloc(struct Main *bmain, short type, const char *name, const int flag) ATTR_WARN_UNUSED_RESULT
Definition: lib_id.c:1062
void id_us_ensure_real(struct ID *id)
Definition: lib_id.c:238
void BKE_id_blend_write(struct BlendWriter *writer, struct ID *id)
Definition: lib_id.c:2395
@ IDWALK_INCLUDE_UI
#define BKE_LIB_FOREACHID_PROCESS(_data, _id_super, _cb_flag)
int BKE_lib_query_foreachid_process_flags_get(struct LibraryForeachIDData *data)
Definition: lib_query.c:123
@ IDWALK_CB_USER_ONE
Definition: BKE_lib_query.h:93
@ IDWALK_CB_NOP
Definition: BKE_lib_query.h:47
#define BKE_LIB_FOREACHID_PROCESS_ID(_data, _id, _cb_flag)
void BKE_reports_clear(ReportList *reports)
Definition: report.c:84
void BKE_reports_init(ReportList *reports, int flag)
Definition: report.c:66
void BKE_screen_foreach_id_screen_area(struct LibraryForeachIDData *data, struct ScrArea *area)
Definition: screen.c:100
void BKE_screen_area_map_blend_write(struct BlendWriter *writer, struct ScrAreaMap *area_map)
Definition: screen.c:1390
bool BKE_screen_area_map_blend_read_data(struct BlendDataReader *reader, struct ScrAreaMap *area_map)
Definition: screen.c:1777
void BKE_screen_view3d_shading_blend_read_data(struct BlendDataReader *reader, struct View3DShading *shading)
Definition: screen.c:1131
void BKE_screen_area_blend_read_lib(struct BlendLibReader *reader, struct ID *parent_id, struct ScrArea *area)
Definition: screen.c:1802
void BKE_screen_view3d_shading_blend_write(struct BlendWriter *writer, struct View3DShading *shading)
Definition: screen.c:1124
void BKE_undosys_stack_destroy(UndoStack *ustack)
Definition: undo_system.c:271
void BKE_workspace_active_layout_set(struct WorkSpaceInstanceHook *hook, const int winid, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) SETTER_ATTRS
Activate a layout.
Definition: workspace.c:594
struct WorkSpace * BKE_workspace_active_get(struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition: workspace.c:535
struct bScreen * BKE_workspace_active_screen_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
void BKE_workspace_active_set(struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace) SETTER_ATTRS
Definition: workspace.c:539
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:58
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:124
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:257
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
Definition: BLI_listbase.h:128
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:547
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:133
#define STRNCPY(dst, src)
Definition: BLI_string.h:163
#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:5654
void BLO_read_data_globmap_add(BlendDataReader *reader, void *oldaddr, void *newaddr)
Definition: readfile.c:5775
#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)
@ INDEX_ID_WM
Definition: DNA_ID.h:855
@ ID_WM
Definition: DNA_ID_enums.h:84
@ S3D_DISPLAY_ANAGLYPH
struct wmWindowManager wmWindowManager
@ KEYCONF_INIT_DEFAULT
@ 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:532
void ED_spacetypes_keymap(struct wmKeyConfig *keyconf)
Definition: spacetypes.c:190
Read Guarded memory(de)allocation.
static void init_data(ModifierData *md)
#define C
Definition: RandGen.cpp:39
@ WM_HANDLER_DO_FREE
Definition: WM_api.h:318
@ OPTYPE_REGISTER
Definition: WM_types.h:153
#define NC_WM
Definition: WM_types.h:276
#define ND_SPACE_INFO_REPORT
Definition: WM_types.h:415
#define ND_HISTORY
Definition: WM_types.h:314
#define NC_SPACE
Definition: WM_types.h:293
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
static void area(int d1, int d2, int e1, int e2, float weights[2])
short id_code
Definition: BKE_idtype.h:120
Definition: DNA_ID.h:273
struct Library * lib
Definition: DNA_ID.h:277
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
ListBase wm
Definition: BKE_main.h:175
struct StructRNA * type
Definition: RNA_types.h:51
void * data
Definition: RNA_types.h:52
struct wmTimer * reporttimer
Wrapper for bScreen.
Object * base_pose_object
Definition: DNA_xr_types.h:37
struct View3DShading shading
Definition: DNA_xr_types.h:31
wmEventHandler head
struct StructRNA * srna
Definition: WM_types.h:802
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 wmKeyConfig * userconf
struct wmTimer * autosavetimer
struct wmWindow * windrawable
struct wmKeyConfig * addonconf
struct wmWindow * winactive
struct Scene * scene
char view_layer_name[64]
struct WorkSpaceInstanceHook * workspace_hook
XrSessionSettings session_settings
struct wmXrRuntimeData * runtime
#define G(x, y, z)
void WM_main(bContext *C)
Definition: wm.c:636
void wm_close_and_free(bContext *C, wmWindowManager *wm)
Definition: wm.c:571
void wm_clear_default_size(bContext *C)
Definition: wm.c:526
void WM_operator_stack_clear(wmWindowManager *wm)
Definition: wm.c:401
void wm_close_and_free_all(bContext *C, ListBase *wmlist)
Definition: wm.c:624
static void lib_link_workspace_instance_hook(BlendLibReader *reader, WorkSpaceInstanceHook *hook, ID *id)
Definition: wm.c:232
static void window_manager_blend_read_data(BlendDataReader *reader, ID *id)
Definition: wm.c:139
static void window_manager_free_data(ID *id)
Definition: wm.c:79
void WM_operator_type_set(wmOperator *op, wmOperatorType *ot)
Definition: wm.c:345
void WM_operator_free_all_after(wmWindowManager *wm, struct wmOperator *op)
Definition: wm.c:327
static void window_manager_blend_read_lib(BlendLibReader *reader, ID *id)
Definition: wm.c:241
static void direct_link_wm_xr_data(BlendDataReader *reader, wmXrData *xr_data)
Definition: wm.c:134
void WM_keyconfig_init(bContext *C)
Definition: wm.c:448
void wm_operator_register(bContext *C, wmOperator *op)
Definition: wm.c:376
static void wm_reports_free(wmWindowManager *wm)
Definition: wm.c:368
void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot)
Definition: wm.c:416
void WM_check(bContext *C)
Definition: wm.c:487
IDTypeInfo IDType_ID_WM
Definition: wm.c:261
void WM_keyconfig_reload(bContext *C)
Definition: wm.c:439
static void window_manager_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition: wm.c:111
#define MAX_OP_REGISTERED
Definition: wm.c:290
void wm_add_default(Main *bmain, bContext *C)
Definition: wm.c:549
static void write_wm_xr_data(BlendWriter *writer, wmXrData *xr_data)
Definition: wm.c:106
void WM_operator_free(wmOperator *op)
Definition: wm.c:292
static void lib_link_wm_xr_data(BlendLibReader *reader, ID *parent_id, wmXrData *xr_data)
Definition: wm.c:227
static void window_manager_foreach_id(ID *id, LibraryForeachIDData *data)
Definition: wm.c:84
void WM_drag_free_list(struct ListBase *lb)
Definition: wm_dragdrop.c:212
void wm_draw_update(bContext *C)
Definition: wm_draw.c:1033
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_autosave_timer_end(wmWindowManager *wm)
Definition: wm_files.c:1692
PointerRNA * ptr
Definition: wm_files.c:3157
wmOperatorType * ot
Definition: wm_files.c:3156
void WM_autosave_init(wmWindowManager *wm)
Definition: wm_files.c:1700
void WM_keyconfig_update(wmWindowManager *wm)
Definition: wm_keymap.c:1781
void WM_keyconfig_free(wmKeyConfig *keyconf)
Definition: wm_keymap.c:340
wmKeyConfig * WM_keyconfig_new(wmWindowManager *wm, const char *idname, bool user_defined)
Definition: wm_keymap.c:278
void WM_keyconfig_update_tag(wmKeyMap *keymap, wmKeyMapItem *kmi)
Definition: wm_keymap.c:1739
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:584
bool WM_operator_properties_default(PointerRNA *ptr, const bool do_update)
Definition: wm_operators.c:657
void WM_operator_properties_free(PointerRNA *ptr)
Definition: wm_operators.c:711
void WM_event_remove_timer(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer)
Definition: wm_window.c:1669
wmWindow * wm_window_new(const Main *bmain, wmWindowManager *wm, wmWindow *parent, bool dialog)
Definition: wm_window.c:263
void wm_window_process_events(const bContext *C)
Definition: wm_window.c:1550
void wm_window_make_drawable(wmWindowManager *wm, wmWindow *win)
Definition: wm_window.c:1054
void wm_window_free(bContext *C, wmWindowManager *wm, wmWindow *win)
Definition: wm_window.c:202
void wm_window_ghostwindows_ensure(wmWindowManager *wm)
Definition: wm_window.c:693
void wm_xr_exit(wmWindowManager *wm)
Definition: wm_xr.c:115