Blender
V3.3
|
Go to the source code of this file.
Definition at line 930 of file wm_window.c.
References GHOST_GetNativePixelSize(), wmWindow::ghostwin, wmWindow::sizey, x, and y.
Referenced by wm_cursor_position_from_ghost_screen_coords(), and wm_cursor_position_get().
Definition at line 948 of file wm_window.c.
References GHOST_ScreenToClient(), wmWindow::ghostwin, wm_cursor_position_from_ghost_client_coords(), x, and y.
Referenced by ghost_event_proc(), and WM_window_find_under_cursor().
Definition at line 960 of file wm_window.c.
References wmWindow::eventstate, G, G_FLAG_EVENT_SIMULATE, g_system, GHOST_GetCursorPosition(), wmWindow::ghostwin, UNLIKELY, wm_cursor_position_from_ghost_client_coords(), and wmEvent::xy.
Referenced by wm_cursor_warp_relative(), wm_drags_draw(), wm_handler_fileselect_do(), wm_paintcursor_draw(), and wm_window_update_eventstate().
Definition at line 939 of file wm_window.c.
References GHOST_GetNativePixelSize(), wmWindow::ghostwin, wmWindow::sizey, x, and y.
Referenced by wm_cursor_position_to_ghost_screen_coords(), and WM_cursor_warp().
Definition at line 954 of file wm_window.c.
References GHOST_ClientToScreen(), wmWindow::ghostwin, wm_cursor_position_to_ghost_client_coords(), x, and y.
Referenced by WM_cursor_grab_disable(), WM_cursor_grab_enable(), and WM_window_find_under_cursor().
void wm_get_desktopsize | ( | int * | r_width, |
int * | r_height | ||
) |
Size of all screens (desktop), useful since the mouse is bound by this.
Definition at line 133 of file wm_window.c.
References g_system, and GHOST_GetAllDisplayDimensions().
Referenced by wm_window_ghostwindow_add(), and wm_window_update_size_position().
void wm_get_screensize | ( | int * | r_width, |
int * | r_height | ||
) |
This one should correctly check for apple top header... done for Cocoa: returns window contents (and not frame) max size.
Definition at line 123 of file wm_window.c.
References g_system, and GHOST_GetMainDisplayDimensions().
Referenced by wm_window_check_size(), and wm_window_ghostwindows_ensure().
Definition at line 1600 of file wm_window.c.
References g_system, GHOST_DisposeSystem(), and NULL.
Referenced by WM_exit_ex().
Definition at line 1566 of file wm_window.c.
References BLI_system_backtrace(), C, GHOST_Debug::flags, G, G_DEBUG_GHOST, G_DEBUG_WINTAB, g_system, GHOST_AddEventConsumer(), GHOST_CreateEventConsumer(), GHOST_CreateSystem(), ghost_event_proc(), GHOST_kDebugDefault, GHOST_kDebugWintab, GHOST_SetBacktraceHandler(), GHOST_SystemInitDebug(), GHOST_UseNativePixels(), GHOST_UseWindowFocus(), WMInitStruct::native_pixels, NULL, WMInitStruct::window_focus, and wm_init_state.
Referenced by WM_init(), and WM_init_opengl().
Call the quit confirmation prompt or exit directly if needed. The use can still cancel via the confirmation popup. Also, this may not quit Blender immediately, but rather schedule the closing.
win | The window to show the confirmation popup/window in. |
Definition at line 339 of file wm_window.c.
References C, CTX_data_main(), CTX_wm_manager(), CTX_wm_window(), CTX_wm_window_set(), G, USER_SAVE_PROMPT, wm_confirm_quit(), wm_exit_schedule_delayed(), wm_file_or_session_data_has_unsaved_changes(), and wm_window_raise().
Referenced by ghost_event_proc(), wm_exit_blender_invoke(), and wm_window_close().
void wm_test_autorun_revert_action_set | ( | struct wmOperatorType * | ot, |
struct PointerRNA * | ptr | ||
) |
Definition at line 3486 of file wm_files.c.
References BLI_assert, G, MEM_freeN, NULL, ot, ptr, WM_operator_properties_free(), and wm_test_autorun_revert_action_data.
Referenced by wm_block_autorun_warning_ignore(), WM_exit_ex(), wm_file_read_post(), wm_recover_auto_save_exec(), wm_recover_last_session_exec(), and wm_test_autorun_revert_action_exec().
Definition at line 3519 of file wm_files.c.
References block_create_autorun_warning(), C, CTX_wm_manager(), CTX_wm_window(), CTX_wm_window_set(), ListBase::first, G, G_FLAG_SCRIPT_AUTOEXEC_FAIL, G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET, if(), NULL, UI_popup_block_invoke(), wmWindowManager::winactive, and wmWindowManager::windows.
Referenced by wm_event_do_notifiers().
void wm_window_clear_drawable | ( | wmWindowManager * | wm | ) |
Definition at line 1021 of file wm_window.c.
References NULL, and wmWindowManager::windrawable.
Referenced by blend_file_thumb_from_camera(), wm_draw_surface(), wm_ghostwindow_destroy(), wm_userpref_read_exec(), wm_window_ghostwindow_add(), wm_window_make_drawable(), wm_window_match_replace_by_file_wm(), and wm_window_reset_drawable().
void wm_window_close | ( | bContext * | C, |
wmWindowManager * | wm, | ||
wmWindow * | win | ||
) |
This is event from ghost, or exit-Blender operator.
Definition at line 366 of file wm_window.c.
References BKE_workspace_active_layout_get(), BKE_workspace_layout_remove(), BKE_workspace_layout_screen_get(), BLI_assert, BLI_remlink(), C, CTX_data_main(), CTX_wm_window_set(), ED_screen_exit(), ListBase::first, wmWindow::handlers, LISTBASE_FOREACH_MUTABLE, wmWindow::modalhandlers, NC_SCREEN, ND_LAYOUTDELETE, wmWindow::next, NULL, wmWindow::parent, bScreen::temp, wmWindowManager::windows, WM_event_add_notifier(), WM_event_remove_handlers(), wm_quit_with_optional_confirmation_prompt(), wm_window_free(), WM_window_get_active_screen(), WM_window_get_active_workspace(), WM_window_is_temp_screen(), and wmWindow::workspace_hook.
Referenced by ghost_event_proc(), render_view_cancel_exec(), wm_handler_fileselect_do(), wm_homefile_write_exec(), wm_stereo3d_set_exec(), wm_window_close_exec(), wm_window_copy_test(), wm_window_ghostwindows_remove_invalid(), and WM_window_open().
int wm_window_close_exec | ( | bContext * | C, |
struct wmOperator * | op | ||
) |
wmWindow* wm_window_copy | ( | struct Main * | bmain, |
wmWindowManager * | wm, | ||
wmWindow * | win_src, | ||
bool | duplicate_layout, | ||
bool | child | ||
) |
Part of wm_window.c
API.
Definition at line 267 of file wm_window.c.
References BKE_workspace_active_layout_set(), BKE_workspace_active_set(), ED_workspace_layout_duplicate(), GHOST_IsDialogWindow(), wmWindow::ghostwin, wmWindow::parent, wmWindow::posx, wmWindow::posy, wmWindow::scene, wmWindow::sizex, wmWindow::sizey, wmWindow::stereo3d_format, STRNCPY, wmWindow::view_layer_name, WM_window_get_active_layout(), WM_window_get_active_workspace(), and wm_window_new().
Referenced by wm_window_copy_test().
wmWindow* wm_window_copy_test | ( | bContext * | C, |
wmWindow * | win_src, | ||
bool | duplicate_layout, | ||
bool | child | ||
) |
A higher level version of copy that tests the new window can be added. (called from the operator directly).
Definition at line 297 of file wm_window.c.
References C, CTX_data_main(), CTX_wm_manager(), CTX_wm_window(), wmWindow::ghostwin, NA_ADDED, NC_WINDOW, NULL, WM_check(), WM_event_add_notifier_ex(), wm_window_close(), and wm_window_copy().
Referenced by wm_stereo3d_set_exec(), and wm_window_new_main_exec().
void wm_window_delete_removed_timers | ( | wmWindowManager * | wm | ) |
Effectively remove timers from the list and delete them. Calling this should only be done by internal WM management code, from specific, safe places.
Definition at line 1669 of file wm_window.c.
References BLI_remlink(), LISTBASE_FOREACH_MUTABLE, MEM_freeN, wmWindowManager::timers, and WM_TIMER_TAGGED_FOR_REMOVAL.
Referenced by wm_window_free(), and wm_window_timer().
void wm_window_free | ( | bContext * | C, |
wmWindowManager * | wm, | ||
wmWindow * | win | ||
) |
Including window itself.
C | can be NULL. |
Definition at line 182 of file wm_window.c.
References BKE_screen_area_map_free(), BKE_workspace_instance_hook_free(), C, CTX_wm_window(), CTX_wm_window_set(), wmWindow::cursor_keymap_status, wmWindow::event_last_handled, wmWindow::eventstate, G_MAIN, wmWindow::global_areas, wmWindow::handlers, LISTBASE_FOREACH_MUTABLE, MEM_freeN, wmWindow::modalhandlers, NULL, wmWindow::stereo3d_format, TIMERJOBS, wmWindowManager::timers, wm_event_free_all(), WM_event_remove_handlers(), WM_event_remove_timer(), WM_gestures_free_all(), wm_ghostwindow_destroy(), wm_jobs_timer_end(), WM_TIMER_TAGGED_FOR_REMOVAL, wm_window_delete_removed_timers(), and wmWindow::workspace_hook.
Referenced by wm_close_and_free(), and wm_window_close().
int wm_window_fullscreen_toggle_exec | ( | bContext * | C, |
struct wmOperator * | op | ||
) |
Full-screen operator callback.
Definition at line 1846 of file wm_window.c.
References wmWindow::posx, and wmWindow::posy.
Definition at line 1893 of file wm_window.c.
References GHOST_GetSwapInterval(), and wmWindow::ghostwin.
void wm_window_ghostwindows_ensure | ( | wmWindowManager * | wm | ) |
Initialize wmWindow without ghostwin
, open these and clear.
Window size is read from window, if 0 it uses prefsize called in WM_check, also initialize stuff after file read.
win->ghostwin
can be NULL in rare cases (where OpenGL driver fails to create a context for eg). We could remove them with wm_window_ghostwindows_remove_invalid but better not since caller may continue to use. Instead, caller needs to handle the error case and cleanup. Definition at line 661 of file wm_window.c.
References BLI_assert, G, LISTBASE_FOREACH, WMInitStruct::size_x, WMInitStruct::size_y, WMInitStruct::start_x, WMInitStruct::start_y, wmWindowManager::windows, wm_get_screensize(), wm_init_state, and wm_window_ghostwindow_ensure().
Referenced by WM_check().
void wm_window_ghostwindows_remove_invalid | ( | bContext * | C, |
wmWindowManager * | wm | ||
) |
Call after wm_window_ghostwindows_ensure or WM_check (after loading a new file) in the unlikely event a window couldn't be created.
Definition at line 684 of file wm_window.c.
References BLI_assert, C, G, LISTBASE_FOREACH_MUTABLE, NULL, wmWindowManager::windows, and wm_window_close().
Referenced by wm_file_read_post().
Definition at line 1863 of file wm_window.c.
References GHOST_kWindowOrderBottom, GHOST_SetWindowOrder(), and wmWindow::ghostwin.
Referenced by render_view_show_invoke().
void wm_window_make_drawable | ( | wmWindowManager * | wm, |
wmWindow * | win | ||
) |
Definition at line 1028 of file wm_window.c.
References BLI_assert, G, G_DEBUG_EVENTS, wmWindow::ghostwin, GPU_framebuffer_active_get(), GPU_framebuffer_back_get(), wmWindowManager::windrawable, wmWindow::winid, wm_window_clear_drawable(), WM_window_set_dpi(), and wm_window_set_drawable().
Referenced by blend_file_thumb_from_camera(), ghost_event_proc(), redraw_timer_exec(), wm_add_default(), wm_draw_update(), wm_event_do_handlers(), and wm_handler_fileselect_do().
wmWindow* wm_window_new | ( | const struct Main * | bmain, |
wmWindowManager * | wm, | ||
wmWindow * | parent, | ||
bool | dialog | ||
) |
Don't change context itself.
int wm_window_new_exec | ( | bContext * | C, |
struct wmOperator * | op | ||
) |
Definition at line 873 of file wm_window.c.
References blender::compositor::area(), BKE_report(), BKE_screen_find_big_area(), C, CTX_wm_screen(), CTX_wm_window(), IFACE_, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, wmWindow::sizex, wmWindow::sizey, SPACE_TYPE_ANY, WIN_ALIGN_PARENT_CENTER, and WM_window_open().
Referenced by WM_OT_window_new().
int wm_window_new_main_exec | ( | bContext * | C, |
struct wmOperator * | op | ||
) |
Definition at line 897 of file wm_window.c.
References BKE_report(), C, CTX_wm_window(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, and wm_window_copy_test().
Referenced by WM_OT_window_new_main().
Definition at line 1537 of file wm_window.c.
References BLI_assert, BLI_thread_is_main(), C, CTX_wm_manager(), G, G_FLAG_EVENT_SIMULATE, g_system, GHOST_DispatchEvents(), GHOST_ProcessEvents(), PIL_sleep_ms(), wm_window_timer(), and wm_xr_events_handle().
Referenced by WM_main().
Definition at line 1868 of file wm_window.c.
References GHOST_GetWindowState(), GHOST_kWindowOrderTop, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, GHOST_SetWindowOrder(), GHOST_SetWindowState(), and wmWindow::ghostwin.
Referenced by render_view_open(), render_view_show_invoke(), wm_quit_with_optional_confirmation_prompt(), and WM_window_open().
Reset active the current window opengl drawing context.
Definition at line 1049 of file wm_window.c.
References BLI_assert, BLI_thread_is_main(), G_MAIN, wmWindow::ghostwin, GPU_framebuffer_active_get(), GPU_framebuffer_back_get(), NULL, wmWindowManager::windrawable, wm_window_clear_drawable(), and wm_window_set_drawable().
Referenced by drw_deferred_shader_compilation_free(), DRW_opengl_context_activate(), DRW_opengl_context_create(), DRW_opengl_context_disable_ex(), EEVEE_lightbake_job_create(), EEVEE_lightbake_job_data_alloc(), RE_gl_context_create(), and wm_xr_session_gpu_binding_context_destroy().
Definition at line 1852 of file wm_window.c.
References GHOST_SetClientSize(), wmWindow::ghostwin, height, and width.
Referenced by WM_window_open().
Definition at line 1888 of file wm_window.c.
References GHOST_SetSwapInterval(), and wmWindow::ghostwin.
Push rendered buffer to the screen.
Definition at line 1883 of file wm_window.c.
References GHOST_SwapWindowBuffers(), and wmWindow::ghostwin.
Referenced by wm_draw_update(), and wm_window_ghostwindow_add().
void wm_window_title | ( | wmWindowManager * | wm, |
wmWindow * | win | ||
) |
Definition at line 417 of file wm_window.c.
References BKE_main_blendfile_path_from_global(), BLI_snprintf(), wmWindowManager::file_saved, G_MAIN, GHOST_SetTitle(), GHOST_SetWindowModifiedState(), wmWindow::ghostwin, NULL, str, and WM_window_is_temp_screen().
Referenced by wm_event_do_notifiers(), and wm_window_ghostwindow_ensure().