Blender  V2.93
wm_init_exit.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 
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 
30 #ifdef _WIN32
31 # define WIN32_LEAN_AND_MEAN
32 # include <windows.h>
33 #endif
34 
35 #include "MEM_guardedalloc.h"
36 
37 #include "CLG_log.h"
38 
39 #include "DNA_genfile.h"
40 #include "DNA_scene_types.h"
41 #include "DNA_userdef_types.h"
43 
44 #include "BLI_listbase.h"
45 #include "BLI_path_util.h"
46 #include "BLI_string.h"
47 #include "BLI_task.h"
48 #include "BLI_threads.h"
49 #include "BLI_timer.h"
50 #include "BLI_utildefines.h"
51 
52 #include "BLO_undofile.h"
53 #include "BLO_writefile.h"
54 
55 #include "BKE_blender.h"
56 #include "BKE_blendfile.h"
57 #include "BKE_callbacks.h"
58 #include "BKE_context.h"
59 #include "BKE_font.h"
60 #include "BKE_global.h"
61 #include "BKE_icons.h"
62 #include "BKE_image.h"
63 #include "BKE_keyconfig.h"
64 #include "BKE_lib_remap.h"
65 #include "BKE_main.h"
66 #include "BKE_mball_tessellate.h"
67 #include "BKE_node.h"
68 #include "BKE_report.h"
69 #include "BKE_scene.h"
70 #include "BKE_screen.h"
71 #include "BKE_sound.h"
72 
73 #include "BKE_addon.h"
74 #include "BKE_appdir.h"
75 #include "BKE_mask.h" /* free mask clipboard */
76 #include "BKE_material.h" /* BKE_material_copybuf_clear */
77 #include "BKE_studiolight.h"
78 #include "BKE_tracking.h" /* free tracking clipboard */
79 
80 #include "RE_engine.h"
81 #include "RE_pipeline.h" /* RE_ free stuff */
82 
83 #include "SEQ_clipboard.h" /* free seq clipboard */
84 
85 #include "IMB_thumbs.h"
86 
87 #ifdef WITH_PYTHON
88 # include "BPY_extern.h"
89 # include "BPY_extern_python.h"
90 # include "BPY_extern_run.h"
91 #endif
92 
93 #include "GHOST_C-api.h"
94 #include "GHOST_Path-api.h"
95 
96 #include "RNA_define.h"
97 
98 #include "WM_api.h"
99 #include "WM_message.h"
100 #include "WM_types.h"
101 
102 #include "wm.h"
103 #include "wm_cursors.h"
104 #include "wm_event_system.h"
105 #include "wm_files.h"
106 #include "wm_platform_support.h"
107 #include "wm_surface.h"
108 #include "wm_window.h"
109 
110 #include "ED_anim_api.h"
111 #include "ED_armature.h"
112 #include "ED_gpencil.h"
113 #include "ED_keyframes_edit.h"
114 #include "ED_keyframing.h"
115 #include "ED_node.h"
116 #include "ED_render.h"
117 #include "ED_screen.h"
118 #include "ED_space_api.h"
119 #include "ED_undo.h"
120 #include "ED_util.h"
121 
122 #include "BLF_api.h"
123 #include "BLT_lang.h"
124 #include "UI_interface.h"
125 #include "UI_resources.h"
126 
127 #include "GPU_context.h"
128 #include "GPU_init_exit.h"
129 #include "GPU_material.h"
130 
131 #include "BKE_sound.h"
132 #include "BKE_subdiv.h"
133 
134 #include "COM_compositor.h"
135 
136 #include "DEG_depsgraph.h"
137 #include "DEG_depsgraph_query.h"
138 
139 #include "DRW_engine.h"
140 
148 
150 {
151  ReportList *reports = CTX_wm_reports(C);
152 
153  BLI_assert(!reports || BLI_listbase_is_empty(&reports->list));
154 
155  BKE_reports_init(reports, RPT_STORE);
156 }
158 {
160 }
161 
162 static bool wm_start_with_console = false;
163 
165 {
166  wm_start_with_console = value;
167 }
168 
176 static bool opengl_is_init = false;
177 
178 void WM_init_opengl(void)
179 {
180  /* must be called only once */
181  BLI_assert(opengl_is_init == false);
182 
183  if (G.background) {
184  /* Ghost is still not init elsewhere in background mode. */
186  }
187 
188  /* Needs to be first to have an ogl context bound. */
190 
191  GPU_init();
192 
194 
195  opengl_is_init = true;
196 }
197 
198 static void sound_jack_sync_callback(Main *bmain, int mode, double time)
199 {
200  /* Ugly: Blender doesn't like it when the animation is played back during rendering. */
201  if (G.is_rendering) {
202  return;
203  }
204 
205  wmWindowManager *wm = bmain->wm.first;
206 
207  LISTBASE_FOREACH (wmWindow *, window, &wm->windows) {
209  if ((scene->audio.flag & AUDIO_SYNC) == 0) {
210  continue;
211  }
212  ViewLayer *view_layer = WM_window_get_active_view_layer(window);
214  if (depsgraph == NULL) {
215  continue;
216  }
217  BKE_sound_lock();
218  Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
219  BKE_sound_jack_scene_update(scene_eval, mode, time);
221  }
222 }
223 
224 /* only called once, for startup */
225 void WM_init(bContext *C, int argc, const char **argv)
226 {
227 
228  if (!G.background) {
229  wm_ghost_init(C); /* note: it assigns C to ghost! */
232  }
233 
235 
238 
241 
242  WM_paneltype_init(); /* Lookup table only. */
247 
249 
251  WM_main_remove_notifier_reference); /* lib_id.c */
255  WM_main_remap_editor_id_reference); /* lib_id.c */
258 
259  ED_spacetypes_init(); /* editors/space_api/spacetype.c */
260 
262 
263  BLF_init();
264 
265  BLT_lang_init();
266  /* Must call first before doing any '.blend' file reading,
267  * since versioning code may create new IDs... See T57066. */
269 
270  /* Init icons before reading .blend files for preview icons, which can
271  * get triggered by the depsgraph. This is also done in background mode
272  * for scripts that do background processing with preview icons. */
274 
275  /* reports cant be initialized before the wm,
276  * but keep before file reading, since that may report errors */
278 
280 
281  /* get the default database, plus a wm */
282  bool is_factory_startup = true;
283  const bool use_data = true;
284  const bool use_userdef = true;
285 
286  /* Studio-lights needs to be init before we read the home-file,
287  * otherwise the versioning cannot find the default studio-light. */
289 
290  BLI_assert((G.fileflags & G_FILE_NO_UI) == 0);
291 
293  NULL,
294  G.factory_startup,
295  false,
296  use_data,
297  use_userdef,
298  NULL,
300  &is_factory_startup);
301 
302  /* Call again to set from userpreferences... */
304 
305  /* For fsMenu. Called here so can include user preference paths if needed. */
306  ED_file_init();
307 
308  /* That one is generated on demand, we need to be sure it's clear on init. */
310 
311  if (!G.background) {
312 
313 #ifdef WITH_INPUT_NDOF
314  /* sets 3D mouse deadzone */
315  WM_ndof_deadzone_set(U.ndof_deadzone);
316 #endif
317  WM_init_opengl();
318 
320  exit(-1);
321  }
322 
323  UI_init();
324  }
325 
326  BKE_subdiv_init();
327 
329 
330  /* note: there is a bug where python needs initializing before loading the
331  * startup.blend because it may contain PyDrivers. It also needs to be after
332  * initializing space types and other internal data.
333  *
334  * However cant redo this at the moment. Solution is to load python
335  * before wm_homefile_read() or make py-drivers check if python is running.
336  * Will try fix when the crash can be repeated. - campbell. */
337 
338 #ifdef WITH_PYTHON
339  BPY_python_start(C, argc, argv);
341 #else
342  (void)argc; /* unused */
343  (void)argv; /* unused */
344 #endif
345 
346  if (!G.background && !wm_start_with_console) {
348  }
349 
352 
354 
355  /* allow a path of "", this is what happens when making a new file */
356 #if 0
357  if (BKE_main_blendfile_path_from_global()[0] == '\0') {
359  G_MAIN->name, sizeof(G_MAIN->name), BKE_appdir_folder_default(), "untitled.blend");
360  }
361 #endif
362 
363  BLI_strncpy(G.lib, BKE_main_blendfile_path_from_global(), sizeof(G.lib));
364 
365 #ifdef WITH_COMPOSITOR
366  if (1) {
367  extern void *COM_linker_hack;
369  }
370 #endif
371 
372  {
373  Main *bmain = CTX_data_main(C);
374  /* note, logic here is from wm_file_read_post,
375  * call functions that depend on Python being initialized. */
376 
377  /* normally 'wm_homefile_read' will do this,
378  * however python is not initialized when called from this function.
379  *
380  * unlikely any handlers are set but its possible,
381  * note that recovering the last session does its own callbacks. */
382  CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first);
383 
386  if (is_factory_startup) {
388  }
389 
390  wm_file_read_report(C, bmain);
391 
392  if (!G.background) {
394  }
395  }
396 }
397 
399 {
400  if ((U.uiflag & USER_SPLASH_DISABLE) == 0) {
402  wmWindow *prevwin = CTX_wm_window(C);
403 
404  if (wm->windows.first) {
407  CTX_wm_window_set(C, prevwin);
408  }
409  }
410 }
411 
412 /* free strings of open recent files */
413 static void free_openrecent(void)
414 {
415  LISTBASE_FOREACH (RecentFile *, recent, &G.recent_files) {
416  MEM_freeN(recent->filepath);
417  }
418 
419  BLI_freelistN(&(G.recent_files));
420 }
421 
422 #ifdef WIN32
423 /* Read console events until there is a key event. Also returns on any error. */
424 static void wait_for_console_key(void)
425 {
426  HANDLE hConsoleInput = GetStdHandle(STD_INPUT_HANDLE);
427 
428  if (!ELEM(hConsoleInput, NULL, INVALID_HANDLE_VALUE) && FlushConsoleInputBuffer(hConsoleInput)) {
429  for (;;) {
430  INPUT_RECORD buffer;
431  DWORD ignored;
432 
433  if (!ReadConsoleInput(hConsoleInput, &buffer, 1, &ignored)) {
434  break;
435  }
436 
437  if (buffer.EventType == KEY_EVENT) {
438  break;
439  }
440  }
441  }
442 }
443 #endif
444 
445 static int wm_exit_handler(bContext *C, const wmEvent *event, void *userdata)
446 {
447  WM_exit(C);
448 
449  UNUSED_VARS(event, userdata);
450  return WM_UI_HANDLER_BREAK;
451 }
452 
458 {
459  /* What we do here is a little bit hacky, but quite simple and doesn't require bigger
460  * changes: Add a handler wrapping WM_exit() to cause a delayed call of it. */
461 
462  wmWindow *win = CTX_wm_window(C);
463 
464  /* Use modal UI handler for now.
465  * Could add separate WM handlers or so, but probably not worth it. */
467  WM_event_add_mousemove(win); /* ensure handler actually gets called */
468 }
469 
473 void WM_exit_ex(bContext *C, const bool do_python)
474 {
476 
477  /* first wrap up running stuff, we assume only the active WM is running */
478  /* modal handlers are on window level freed, others too? */
479  /* note; same code copied in wm_files.c */
480  if (C && wm) {
481  if (!G.background) {
482  struct MemFile *undo_memfile = wm->undo_stack ?
484  NULL;
485  if (undo_memfile != NULL) {
486  /* save the undo state as quit.blend */
487  Main *bmain = CTX_data_main(C);
488  char filename[FILE_MAX];
489  bool has_edited;
490  const int fileflags = G.fileflags & ~G_FILE_COMPRESS;
491 
492  BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_base(), BLENDER_QUIT_FILE);
493 
494  has_edited = ED_editors_flush_edits(bmain);
495 
496  if ((has_edited &&
498  bmain, filename, fileflags, &(const struct BlendFileWriteParams){0}, NULL)) ||
499  (undo_memfile && BLO_memfile_write_file(undo_memfile, filename))) {
500  printf("Saved session recovery to '%s'\n", filename);
501  }
502  }
503  }
504 
505  WM_jobs_kill_all(wm);
506 
507  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
508  CTX_wm_window_set(C, win); /* needed by operator close callbacks */
509  WM_event_remove_handlers(C, &win->handlers);
510  WM_event_remove_handlers(C, &win->modalhandlers);
512  }
513 
514  if (!G.background) {
515  if ((U.pref_flag & USER_PREF_FLAG_SAVE) && ((G.f & G_FLAG_USERPREF_NO_SAVE_ON_EXIT) == 0)) {
516  if (U.runtime.is_dirty) {
518  }
519  }
520  /* Free the callback data used on file-open
521  * (will be set when a recover operation has run). */
523  }
524  }
525 
526 #if defined(WITH_PYTHON) && !defined(WITH_PYTHON_MODULE)
527  /* Without this, we there isn't a good way to manage false-positive resource leaks
528  * where a #PyObject references memory allocated with guarded-alloc, T71362.
529  *
530  * This allows add-ons to free resources when unregistered (which is good practice anyway).
531  *
532  * Don't run this code when built as a Python module as this runs when Python is in the
533  * process of shutting down, where running a snippet like this will crash, see T82675.
534  * Instead use the `atexit` module, installed by #BPY_python_start */
535  BPY_run_string_eval(C, (const char *[]){"addon_utils", NULL}, "addon_utils.disable_all()");
536 #endif
537 
538  BLI_timer_free();
539 
541 
545 
548  wm_dropbox_free();
551 
552  /* all non-screen and non-space stuff editors did, like editmode */
553  if (C) {
554  Main *bmain = CTX_data_main(C);
555  ED_editors_exit(bmain, true);
556  }
557 
559 
560  free_openrecent();
561 
563 
564  /* render code might still access databases */
566  RE_engines_exit();
567 
568  ED_preview_free_dbase(); /* frees a Main dbase, before BKE_blender_free! */
569 
570  if (wm) {
571  /* Before BKE_blender_free! - since the ListBases get freed there. */
572  wm_free_reports(wm);
573  }
574 
575  SEQ_clipboard_free(); /* sequencer.c */
580 
581 #ifdef WITH_COMPOSITOR
583 #endif
584 
585  BKE_subdiv_exit();
586 
587  if (opengl_is_init) {
589  }
590 
591  BKE_blender_free(); /* blender.c, does entire library and spacetypes */
592  // BKE_material_copybuf_free();
599 
600  /* free gizmo-maps after freeing blender,
601  * so no deleted data get accessed during cleaning up of areas. */
605 
606  BLF_exit();
607 
608  if (opengl_is_init) {
611  GPU_exit();
614  }
615 
616 #ifdef WITH_INTERNATIONAL
617  BLT_lang_free();
618 #endif
619 
621 
622  // free_txt_data();
623 
624 #ifdef WITH_PYTHON
625  /* option not to close python so we can use 'atexit' */
626  if (do_python && ((C == NULL) || CTX_py_init_get(C))) {
627  /* NOTE: (old note)
628  * before BKE_blender_free so Python's garbage-collection happens while library still exists.
629  * Needed at least for a rare crash that can happen in python-drivers.
630  *
631  * Update for Blender 2.5, move after #BKE_blender_free because Blender now holds references
632  * to #PyObject's so #Py_DECREF'ing them after Python ends causes bad problems every time
633  * the python-driver bug can be fixed if it happens again we can deal with it then. */
634  BPY_python_end();
635  }
636 #else
637  (void)do_python;
638 #endif
639 
640  ED_file_exit(); /* for fsmenu */
641 
642  UI_exit();
644 
645  RNA_exit(); /* should be after BPY_python_end so struct python slots are cleared */
646 
648 
649  wm_ghost_exit();
650 
651  CTX_free(C);
652 
654 
656 
659 
660  /* No need to call this early, rather do it late so that other
661  * pieces of Blender using sound may exit cleanly, see also T50676. */
662  BKE_sound_exit();
663 
664  BKE_appdir_exit();
665  CLG_exit();
666 
668 
670 
672 }
673 
680 {
681  WM_exit_ex(C, true);
682 
683  printf("\nBlender quit\n");
684 
685 #ifdef WIN32
686  /* ask user to press a key when in debug mode */
687  if (G.debug & G_DEBUG) {
688  printf("Press any key to exit . . .\n\n");
689  wait_for_console_key();
690  }
691 #endif
692 
693  exit(G.is_break == true);
694 }
695 
701 {
703 }
void BKE_addon_pref_type_free(void)
Definition: addon.c:135
void BKE_addon_pref_type_init(void)
Definition: addon.c:129
const char * BKE_appdir_folder_default(void)
Definition: appdir.c:157
void BKE_appdir_exit(void)
Definition: appdir.c:119
void BKE_tempdir_session_purge(void)
Definition: appdir.c:1190
#define BLENDER_QUIT_FILE
Definition: BKE_appdir.h:101
const char * BKE_tempdir_base(void)
Definition: appdir.c:1182
Blender util stuff.
void BKE_blender_userdef_data_free(struct UserDef *userdef, bool clear_fonts)
Definition: blender.c:280
void BKE_blender_atexit(void)
Definition: blender.c:425
void BKE_blender_free(void)
Definition: blender.c:75
bool BKE_blendfile_userdef_write_all(struct ReportList *reports)
Definition: blendfile.c:716
void BKE_callback_exec_null(struct Main *bmain, eCbEvent evt)
Definition: callbacks.c:46
@ BKE_CB_EVT_LOAD_FACTORY_STARTUP_POST
Definition: BKE_callbacks.h:61
@ BKE_CB_EVT_VERSION_UPDATE
Definition: BKE_callbacks.h:59
@ BKE_CB_EVT_LOAD_POST
Definition: BKE_callbacks.h:50
bool CTX_py_init_get(bContext *C)
Definition: context.c:215
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:689
void CTX_free(bContext *C)
Definition: context.c:119
void CTX_wm_window_set(bContext *C, struct wmWindow *win)
Definition: context.c:942
struct ReportList * CTX_wm_reports(const bContext *C)
Definition: context.c:751
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:699
void BKE_vfont_clipboard_free(void)
Definition: font.c:1761
@ G_FILE_NO_UI
Definition: BKE_global.h:170
@ G_FILE_COMPRESS
Definition: BKE_global.h:167
#define G_MAIN
Definition: BKE_global.h:232
@ G_DEBUG
Definition: BKE_global.h:133
@ G_FLAG_USERPREF_NO_SAVE_ON_EXIT
Definition: BKE_global.h:114
void BKE_icons_init(int first_dyn_id)
Definition: icons.cc:195
void BKE_image_free_unused_gpu_textures(void)
Definition: image_gpu.c:482
void BKE_keyconfig_pref_type_init(void)
Definition: keyconfig.c:106
void BKE_keyconfig_pref_type_free(void)
Definition: keyconfig.c:112
void BKE_library_callback_remap_editor_id_reference_set(BKE_library_remap_editor_id_reference_cb func)
Definition: lib_remap.c:61
void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func)
Definition: lib_remap.c:54
const char * BKE_main_blendfile_path_from_global(void)
Definition: main.c:439
void BKE_mask_clipboard_free(void)
Definition: mask.c:2084
General operations, lookup, etc. for materials.
void BKE_materials_exit(void)
Definition: material.c:1868
void BKE_material_copybuf_clear(void)
Definition: material.c:1655
void BKE_mball_cubeTable_free(void)
void BKE_node_clipboard_free(void)
Definition: node.cc:3899
void BKE_reports_clear(ReportList *reports)
Definition: report.c:84
void BKE_reports_init(ReportList *reports, int flag)
Definition: report.c:66
struct Depsgraph * BKE_scene_get_depsgraph(const struct Scene *scene, const struct ViewLayer *view_layer)
void BKE_spacedata_callback_id_remap_set(void(*func)(struct ScrArea *area, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id))
void BKE_region_callback_refresh_tag_gizmomap_set(void(*callback)(struct wmGizmoMap *))
Definition: screen.c:611
void BKE_region_callback_free_gizmomap_set(void(*callback)(struct wmGizmoMap *))
Definition: screen.c:636
void BKE_sound_jack_sync_callback_set(SoundJackSyncCallback callback)
void BKE_sound_lock(void)
void BKE_sound_jack_scene_update(struct Scene *scene, int mode, double time)
void BKE_sound_unlock(void)
void BKE_sound_exit(void)
void BKE_studiolight_init(void)
Definition: studiolight.c:1409
void BKE_subdiv_init(void)
Definition: subdiv.c:43
void BKE_subdiv_exit(void)
Definition: subdiv.c:48
void BKE_tracking_clipboard_free(void)
Definition: tracking.c:476
int BLF_init(void)
Definition: blf.c:81
void BLF_exit(void)
Definition: blf.c:92
#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
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:547
#define FILE_MAX
void BLI_join_dirfile(char *__restrict dst, const size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1737
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
void BLI_task_scheduler_exit(void)
void BLI_threadapi_exit(void)
Definition: threads.cc:151
void BLI_timer_free(void)
Definition: BLI_timer.c:139
#define UNUSED_VARS(...)
#define ELEM(...)
bool BLO_memfile_write_file(struct MemFile *memfile, const char *filename)
Definition: undofile.c:223
external writefile function prototypes.
bool BLO_write_file(struct Main *mainvar, const char *filepath, const int write_flags, const struct BlendFileWriteParams *params, struct ReportList *reports)
Definition: writefile.c:1128
void BLT_lang_free(void)
Definition: blt_lang.c:243
void BLT_lang_init(void)
Definition: blt_lang.c:198
void BLT_lang_set(const char *)
Definition: blt_lang.c:257
void BPY_python_reset(struct bContext *C)
void BPY_python_start(struct bContext *C, int argc, const char **argv)
void BPY_python_end(void)
bool BPY_run_string_eval(struct bContext *C, const char *imports[], const char *expr)
void CLG_exit(void)
Definition: clog.c:715
void COM_execute(RenderData *render_data, Scene *scene, bNodeTree *node_tree, int rendering, const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings, const char *viewName)
The main method that is used to execute the compositor tree. It can be executed during editing (blenk...
void COM_deinitialize(void)
Deinitialize the compositor caches and allocated memory. Use COM_clearCaches to only free the caches.
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
blenloader genfile private function prototypes
void DNA_sdna_current_free(void)
Definition: dna_genfile.c:603
#define AUDIO_SYNC
@ USER_SPLASH_DISABLE
@ USER_PREF_FLAG_SAVE
void DRW_opengl_context_create(void)
void DRW_opengl_context_disable_ex(bool restore)
void DRW_opengl_context_enable_ex(bool restore)
void DRW_opengl_context_destroy(void)
void ED_node_init_butfuncs(void)
Definition: drawnode.c:3261
void ED_preview_free_dbase(void)
void ED_render_scene_update(const struct DEGEditorUpdateContext *update_ctx, const bool updated)
void ED_render_id_flush_update(const struct DEGEditorUpdateContext *update_ctx, struct ID *id)
void ED_render_clear_mtex_copybuf(void)
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen)
Definition: screen_edit.c:625
void ED_file_exit(void)
Definition: space_file.c:1011
void ED_spacetypes_init(void)
Definition: spacetypes.c:74
void ED_spacemacros_init(void)
Definition: spacetypes.c:157
void ED_file_init(void)
Definition: space_file.c:1000
struct MemFile * ED_undosys_stack_memfile_get_active(struct UndoStack *ustack)
Definition: memfile_undo.c:304
void ED_undosys_type_free(void)
void ED_undosys_type_init(void)
void ED_editors_exit(struct Main *bmain, bool do_undo_system)
Definition: ed_util.c:181
void ED_spacedata_id_remap(struct ScrArea *area, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id)
Definition: ed_util.c:428
bool ED_editors_flush_edits(struct Main *bmain)
Definition: ed_util.c:295
GHOST C-API function and type declarations.
int GHOST_toggleConsole(int action)
GHOST_TSuccess GHOST_DisposeSystemPaths(void)
GHOST_TSuccess GHOST_CreateSystemPaths(void)
void GPU_backend_exit(void)
Definition: gpu_context.cc:183
void GPU_init(void)
Definition: gpu_init_exit.c:43
void GPU_exit(void)
Definition: gpu_init_exit.c:62
void GPU_pass_cache_free(void)
Definition: gpu_codegen.c:1101
void GPU_pass_cache_init(void)
Definition: gpu_codegen.c:1096
void IMB_thumb_clear_translations(void)
Definition: thumbs_font.c:44
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:39
void UI_init(void)
Definition: interface.c:7111
void UI_interface_tag_script_reload(void)
Definition: interface.c:7134
void UI_exit(void)
Definition: interface.c:7128
@ BIFICONID_LAST
Definition: UI_resources.h:37
struct CLG_LogRef * WM_LOG_TOOLS
struct CLG_LogRef * WM_LOG_MSGBUS_SUB
struct CLG_LogRef * WM_LOG_EVENTS
struct CLG_LogRef * WM_LOG_HANDLERS
@ WM_OP_INVOKE_DEFAULT
Definition: WM_types.h:197
struct CLG_LogRef * WM_LOG_KEYMAPS
struct CLG_LogRef * WM_LOG_MSGBUS_PUB
struct CLG_LogRef * WM_LOG_OPERATORS
#define WM_UI_HANDLER_BREAK
Definition: WM_types.h:251
unsigned int U
Definition: btGjkEpa3.h:78
void SEQ_clipboard_free(void)
Definition: clipboard.c:61
double time
Scene scene
const Depsgraph * depsgraph
void ANIM_driver_vars_copybuf_free(void)
Definition: drivers.c:737
void ANIM_drivers_copybuf_free(void)
Definition: drivers.c:607
void ED_gpencil_anim_copybuf_free(void)
void RE_engines_exit(void)
Definition: engine.c:79
void ANIM_fmodifiers_copybuf_free(void)
Definition: fmodifier_ui.c:976
void ED_gpencil_strokes_copybuf_free(void)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
void ANIM_fcurves_copybuf_free(void)
void ANIM_keyingset_infos_exit(void)
Definition: keyingsets.c:638
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void * COM_linker_hack
void RE_FreeAllRender(void)
Definition: pipeline.c:653
void RNA_exit(void)
Definition: rna_access.c:99
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
ListBase wm
Definition: BKE_main.h:175
struct AudioData audio
struct ReportList reports
struct UndoStack * undo_stack
#define G(x, y, z)
void wm_init_cursor_data(void)
Definition: wm_cursors.c:417
void wm_dropbox_free(void)
Definition: wm_dragdrop.c:121
wmEventHandler_UI * WM_event_add_ui_handler(const bContext *C, ListBase *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn, void *user_data, const char flag)
int WM_operator_name_call(bContext *C, const char *opstring, short context, PointerRNA *properties)
void WM_main_remap_editor_id_reference(ID *old_id, ID *new_id)
void WM_main_remove_notifier_reference(const void *reference)
void WM_event_remove_handlers(bContext *C, ListBase *handlers)
void WM_event_add_mousemove(wmWindow *win)
void wm_test_autorun_revert_action_set(wmOperatorType *ot, PointerRNA *ptr)
Definition: wm_files.c:3163
void wm_homefile_read(bContext *C, ReportList *reports, bool use_factory_settings, bool use_empty_data, bool use_data, bool use_userdef, const char *filepath_startup_override, const char *app_template_override, bool *r_is_factory_startup)
Definition: wm_files.c:904
void wm_autosave_delete(void)
Definition: wm_files.c:1732
const char * WM_init_state_app_template_get(void)
Definition: wm_files.c:875
void wm_file_read_report(bContext *C, Main *bmain)
Definition: wm_files.c:551
void wm_history_file_read(void)
Definition: wm_files.c:1215
void wm_gizmogrouptype_free(void)
void wm_gizmogrouptype_init(void)
void wm_gizmomaptypes_free(void)
void WM_gizmomap_tag_refresh(wmGizmoMap *gzmap)
Definition: wm_gizmo_map.c:323
void wm_gizmomap_remove(wmGizmoMap *gzmap)
Definition: wm_gizmo_map.c:204
void wm_gizmotype_init(void)
void wm_gizmotype_free(void)
static void wm_init_reports(bContext *C)
Definition: wm_init_exit.c:149
void WM_init_splash(bContext *C)
Definition: wm_init_exit.c:398
void WM_exit_ex(bContext *C, const bool do_python)
Definition: wm_init_exit.c:473
CLG_LOGREF_DECLARE_GLOBAL(WM_LOG_OPERATORS, "wm.operator")
static void wm_free_reports(wmWindowManager *wm)
Definition: wm_init_exit.c:157
static int wm_exit_handler(bContext *C, const wmEvent *event, void *userdata)
Definition: wm_init_exit.c:445
static bool opengl_is_init
Definition: wm_init_exit.c:176
void WM_exit(bContext *C)
Main exit function to close Blender ordinarily.
Definition: wm_init_exit.c:679
static void free_openrecent(void)
Definition: wm_init_exit.c:413
void WM_script_tag_reload(void)
Definition: wm_init_exit.c:700
void WM_init_opengl(void)
Definition: wm_init_exit.c:178
void WM_init(bContext *C, int argc, const char **argv)
Definition: wm_init_exit.c:225
static bool wm_start_with_console
Definition: wm_init_exit.c:162
void wm_exit_schedule_delayed(const bContext *C)
Definition: wm_init_exit.c:457
void WM_init_state_start_with_console_set(bool value)
Definition: wm_init_exit.c:164
static void sound_jack_sync_callback(Main *bmain, int mode, double time)
Definition: wm_init_exit.c:198
void WM_jobs_kill_all(wmWindowManager *wm)
Definition: wm_jobs.c:550
void WM_menutype_free(void)
Definition: wm_menu_type.c:87
void WM_menutype_init(void)
Definition: wm_menu_type.c:81
void WM_msgbus_types_init(void)
void wm_operatortype_free(void)
void wm_operatortype_init(void)
void wm_operatortypes_register(void)
void WM_paneltype_init(void)
Definition: wm_panel_type.c:73
void WM_paneltype_clear(void)
Definition: wm_panel_type.c:79
bool WM_platform_support_perform_checks()
void wm_surfaces_free(void)
Definition: wm_surface.c:115
void WM_uilisttype_free(void)
void WM_uilisttype_init(void)
void wm_ghost_exit(void)
Definition: wm_window.c:1604
bScreen * WM_window_get_active_screen(const wmWindow *win)
Definition: wm_window.c:2372
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Definition: wm_window.c:2286
void wm_ghost_init(bContext *C)
Definition: wm_window.c:1580
Scene * WM_window_get_active_scene(const wmWindow *win)
Definition: wm_window.c:2249