Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_window.c
| Show All 30 Lines | |||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_icons.h" | #include "BKE_icons.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "IMB_imbuf.h" | |||||
| #include "IMB_imbuf_types.h" | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "wm.h" | #include "wm.h" | ||||
| #include "wm_draw.h" | #include "wm_draw.h" | ||||
| ▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | |||||
| /* timer removing, need to call this api function */ | /* timer removing, need to call this api function */ | ||||
| LISTBASE_FOREACH_MUTABLE (wmTimer *, wt, &wm->timers) { | LISTBASE_FOREACH_MUTABLE (wmTimer *, wt, &wm->timers) { | ||||
| if (wt->win == win) { | if (wt->win == win) { | ||||
| WM_event_remove_timer(wm, win, wt); | WM_event_remove_timer(wm, win, wt); | ||||
| } | } | ||||
| } | } | ||||
| if (win->scrim) { | |||||
| IMB_freeImBuf(win->scrim); | |||||
| } | |||||
| if (win->eventstate) { | if (win->eventstate) { | ||||
| MEM_freeN(win->eventstate); | MEM_freeN(win->eventstate); | ||||
| } | } | ||||
| if (win->event_last_handled) { | if (win->event_last_handled) { | ||||
| MEM_freeN(win->event_last_handled); | MEM_freeN(win->event_last_handled); | ||||
| } | } | ||||
| if (win->cursor_keymap_status) { | if (win->cursor_keymap_status) { | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| const char *continue_label, | const char *continue_label, | ||||
| const char *link, | const char *link, | ||||
| GHOST_DialogOptions dialog_options) | GHOST_DialogOptions dialog_options) | ||||
| { | { | ||||
| BLI_assert(g_system); | BLI_assert(g_system); | ||||
| GHOST_ShowMessageBox(g_system, title, message, help_label, continue_label, link, dialog_options); | GHOST_ShowMessageBox(g_system, title, message, help_label, continue_label, link, dialog_options); | ||||
| } | } | ||||
| void WM_add_scrim(bContext *C, wmWindow *win) | |||||
| { | |||||
| if (!G.background && BLI_thread_is_main()) { | |||||
| WM_redraw_windows(C); | |||||
| } | |||||
| int win_size[2]; | |||||
| uint *buffer = WM_window_pixels_read(CTX_wm_manager(C), win, win_size); | |||||
| ImBuf *capture = IMB_allocFromBufferOwn(buffer, NULL, win_size[0], win_size[1], 24); | |||||
| win->scrim = IMB_allocImBuf(capture->x, capture->y, capture->planes, capture->flags); | |||||
| IMB_filter_gaussian(capture, win->scrim, 2.5f); | |||||
| IMB_freeImBuf(capture); | |||||
| } | |||||
| /** \} */ | /** \} */ | ||||
| Context not available. | |||||