|
Blender
V2.93
|
#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "DNA_listBase.h"#include "DNA_screen_types.h"#include "DNA_windowmanager_types.h"#include "DNA_workspace_types.h"#include "MEM_guardedalloc.h"#include "GHOST_C-api.h"#include "BLI_blenlib.h"#include "BLI_math.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "BKE_context.h"#include "BKE_global.h"#include "BKE_icons.h"#include "BKE_layer.h"#include "BKE_main.h"#include "BKE_screen.h"#include "BKE_workspace.h"#include "RNA_access.h"#include "RNA_define.h"#include "RNA_enum_types.h"#include "WM_api.h"#include "WM_types.h"#include "wm.h"#include "wm_draw.h"#include "wm_event_system.h"#include "wm_files.h"#include "wm_platform_support.h"#include "wm_window.h"#include "wm_window_private.h"#include "ED_anim_api.h"#include "ED_fileselect.h"#include "ED_render.h"#include "ED_scene.h"#include "ED_screen.h"#include "UI_interface.h"#include "UI_interface_icons.h"#include "PIL_time.h"#include "BLF_api.h"#include "GPU_batch.h"#include "GPU_batch_presets.h"#include "GPU_context.h"#include "GPU_framebuffer.h"#include "GPU_immediate.h"#include "GPU_init_exit.h"#include "GPU_platform.h"#include "GPU_state.h"#include "GPU_texture.h"#include "UI_resources.h"#include "BLI_threads.h"Go to the source code of this file.
Classes | |
| struct | WMInitStruct |
Macros | |
| #define | GHOST_WINDOW_STATE_DEFAULT GHOST_kWindowStateMaximized |
Typedefs | |
| typedef enum eWinOverrideFlag | eWinOverrideFlag |
Enumerations | |
| enum | eWinOverrideFlag { WIN_OVERRIDE_GEOM = (1 << 0) , WIN_OVERRIDE_WINSTATE = (1 << 1) } |
| enum | modifierKeyType { SHIFT = 's' , CONTROL = 'c' , ALT = 'a' , OS = 'C' } |
Variables | |
| static GHOST_SystemHandle | g_system = NULL |
| static struct WMInitStruct | wm_init_state |
Window management, wrap GHOST.
Definition in file wm_window.c.
| #define GHOST_WINDOW_STATE_DEFAULT GHOST_kWindowStateMaximized |
Definition at line 109 of file wm_window.c.
| typedef enum eWinOverrideFlag eWinOverrideFlag |
| enum eWinOverrideFlag |
| Enumerator | |
|---|---|
| WIN_OVERRIDE_GEOM | |
| WIN_OVERRIDE_WINSTATE | |
Definition at line 104 of file wm_window.c.
| enum modifierKeyType |
| Enumerator | |
|---|---|
| SHIFT | |
| CONTROL | |
| ALT | |
| OS | |
Definition at line 997 of file wm_window.c.
|
static |
Definition at line 250 of file wm_window.c.
References id, LISTBASE_FOREACH, and wmWindowManager::windows.
Referenced by wm_window_new().
|
static |
Called by ghost, here we handle events for windows themselves or send to event system.
Mouse coordinate conversion happens here.
Definition at line 1096 of file wm_window.c.
References Freestyle::a, wmWindow::active, wmWindow::addmousemove, ALT, wmEvent::alt, GHOST_TEventKeyData::ascii, BKE_icon_changed(), BLF_cache_clear(), C, CONTROL, GHOST_TStringArray::count, wmEvent::ctrl, CTX_wm_manager(), CTX_wm_window_set(), GHOST_TEventDragnDropData::data, data, GHOST_TEventDragnDropData::dataType, wmWindowManager::drags, ED_file_extension_icon(), wmWindow::eventstate, EVT_DATA_DRAGDROP, EVT_DROP, G, G_DEBUG_EVENTS, g_system, GHOST_GetEventData(), GHOST_GetEventTime(), GHOST_GetEventType(), GHOST_GetEventWindow(), GHOST_GetWindowState(), GHOST_GetWindowUserData(), GHOST_kDragnDropTypeFilenames, GHOST_kEventButtonDown, GHOST_kEventButtonUp, GHOST_kEventCursorMove, GHOST_kEventDraggingDropDone, GHOST_kEventKeyUp, GHOST_kEventNativeResolutionChange, GHOST_kEventOpenMainFile, GHOST_kEventQuitRequest, GHOST_kEventTrackpad, GHOST_kEventWindowActivate, GHOST_kEventWindowClose, GHOST_kEventWindowDeactivate, GHOST_kEventWindowDPIHintChanged, GHOST_kEventWindowMove, GHOST_kEventWindowSize, GHOST_kEventWindowUpdate, GHOST_kKeyLeftAlt, GHOST_kKeyLeftControl, GHOST_kKeyLeftShift, GHOST_kKeyOS, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, GHOST_ValidWindow(), wmWindow::ghostwin, ID::icon_id, bScreen::id, wmWindowManager::initialized, GHOST_TEventKeyData::key, wmEvent::keymodifier, KM_ALT, KM_CTRL, KM_MOD_FIRST, KM_OSKEY, KM_RELEASE, KM_SHIFT, wmWindow::modalhandlers, MOUSEMOVE, NA_EDITED, NC_SCREEN, NC_WINDOW, NULL, OS, wmEvent::oskey, ot, wmWindow::posx, wmWindow::posy, query_qual(), RNA_boolean_set(), RNA_string_set(), SHIFT, wmEvent::shift, wmWindow::sizex, wmWindow::sizey, state, GHOST_TStringArray::strings, time, type, UI_popup_handlers_remove_all(), GHOST_TEventKeyData::utf8_buf, wmWindowManager::winactive, wmWindow::windowstate, wmWindow::winid, wm_cursor_position_from_ghost(), WM_DRAG_NOP, WM_DRAG_PATH, wm_draw_update(), wm_event_add(), wm_event_add_ghostevent(), WM_event_add_notifier(), wm_event_do_handlers(), wm_event_do_notifiers(), wm_event_init_from_window(), WM_event_start_drag(), wm_exit_schedule_delayed(), WM_main_add_notifier(), WM_OP_INVOKE_DEFAULT, WM_operator_name_call_ptr(), WM_operator_properties_create_ptr(), WM_operator_properties_free(), WM_operatortype_find(), wm_quit_with_optional_confirmation_prompt(), wm_window_close(), WM_window_get_active_screen(), WM_WINDOW_IS_INIT, wm_window_make_drawable(), WM_window_set_dpi(), wm_window_timer(), wm_window_update_eventstate(), wm_window_update_size_position(), GHOST_TEventCursorData::x, GHOST_TEventTrackpadData::x, GHOST_TEventCursorData::y, and GHOST_TEventTrackpadData::y.
Referenced by wm_ghost_init().
|
static |
Definition at line 1005 of file wm_window.c.
References ALT, CONTROL, g_system, GHOST_GetModifierKeyState(), GHOST_kModifierKeyLeftAlt, GHOST_kModifierKeyLeftControl, GHOST_kModifierKeyLeftShift, GHOST_kModifierKeyOS, GHOST_kModifierKeyRightAlt, GHOST_kModifierKeyRightControl, GHOST_kModifierKeyRightShift, left, OS, right, and SHIFT.
Referenced by ghost_event_proc().
| char* WM_clipboard_text_get | ( | bool | selection, |
| int * | r_len | ||
| ) |
Return text from the clipboard.
Definition at line 1765 of file wm_window.c.
References wm_clipboard_text_get_ex().
Referenced by console_paste_exec(), paste_text_exec(), pyrna_WindowManager_clipboard_get(), and text_paste_exec().
|
static |
Definition at line 1715 of file wm_window.c.
References ELEM, free(), G, GHOST_getClipboard(), MEM_mallocN, and NULL.
Referenced by WM_clipboard_text_get(), and WM_clipboard_text_get_firstline().
| char* WM_clipboard_text_get_firstline | ( | bool | selection, |
| int * | r_len | ||
| ) |
Convenience function for pasting to areas of Blender which don't support newlines.
Definition at line 1773 of file wm_window.c.
References wm_clipboard_text_get_ex().
Referenced by handleNumInput(), ui_but_get_pasted_text_from_clipboard(), and ui_textedit_copypaste().
| void WM_clipboard_text_set | ( | const char * | buf, |
| bool | selection | ||
| ) |
Definition at line 1778 of file wm_window.c.
References G, GHOST_putClipboard(), MEM_callocN, and MEM_freeN.
Referenced by console_copy_exec(), console_cursor_set_exit(), copy_data_path_button_exec(), copy_python_command_button_exec(), copy_selection(), handleNumInput(), pyrna_WindowManager_clipboard_set(), report_copy_exec(), text_cursor_set_exit(), txt_copy_clipboard(), ui_but_copy(), and ui_textedit_copypaste().
|
static |
Call the confirm dialog on quitting. It's displayed in the context window so caller should set it as desired.
Definition at line 348 of file wm_window.c.
References C, wmGenericCallback::exec, MEM_callocN, wm_close_file_dialog(), and wm_save_file_on_quit_dialog_callback().
Referenced by wm_quit_with_optional_confirmation_prompt().
| void WM_cursor_compatible_xy | ( | wmWindow * | win, |
| int * | x, | ||
| int * | y | ||
| ) |
Set x, y to values we can actually position the cursor to.
Definition at line 2110 of file wm_window.c.
References GHOST_GetNativePixelSize(), wmWindow::ghostwin, x, and y.
Referenced by initWalkInfo().
| void wm_cursor_position_from_ghost | ( | wmWindow * | win, |
| int * | x, | ||
| int * | y | ||
| ) |
Definition at line 964 of file wm_window.c.
References GHOST_GetNativePixelSize(), GHOST_ScreenToClient(), wmWindow::ghostwin, wmWindow::sizey, x, and y.
Referenced by ghost_event_proc(), and wm_cursor_position_get().
| void wm_cursor_position_get | ( | wmWindow * | win, |
| int * | r_x, | ||
| int * | r_y | ||
| ) |
Definition at line 986 of file wm_window.c.
References wmWindow::eventstate, G, G_FLAG_EVENT_SIMULATE, g_system, GHOST_GetCursorPosition(), UNLIKELY, wm_cursor_position_from_ghost(), wmEvent::x, and wmEvent::y.
Referenced by wm_cursor_warp_relative(), wm_handler_fileselect_do(), wm_paintcursor_draw(), and wm_window_update_eventstate().
| void wm_cursor_position_to_ghost | ( | wmWindow * | win, |
| int * | x, | ||
| int * | y | ||
| ) |
Definition at line 975 of file wm_window.c.
References GHOST_ClientToScreen(), GHOST_GetNativePixelSize(), wmWindow::ghostwin, wmWindow::sizey, x, and y.
Referenced by WM_cursor_grab_disable(), WM_cursor_grab_enable(), and WM_cursor_warp().
| void WM_cursor_warp | ( | wmWindow * | win, |
| int | x, | ||
| int | y | ||
| ) |
Definition at line 2091 of file wm_window.c.
References wmWindow::eventstate, g_system, GHOST_SetCursorPosition(), wmWindow::ghostwin, wmEvent::prevx, wmEvent::prevy, wm_cursor_position_to_ghost(), x, wmEvent::x, y, and wmEvent::y.
Referenced by initFlyInfo(), initWalkInfo(), walkEnd(), walkEvent(), wm_cursor_warp_relative(), and wm_gizmomap_modal_set().
| wmTimer* WM_event_add_timer | ( | wmWindowManager * | wm, |
| wmWindow * | win, | ||
| int | event_type, | ||
| double | timestep | ||
| ) |
Definition at line 1632 of file wm_window.c.
References BLI_addtail(), wmTimer::event_type, wmTimer::ltime, MEM_callocN, wmTimer::ntime, PIL_check_seconds_timer(), wmTimer::stime, wmWindowManager::timers, wmTimer::timestep, and wmTimer::win.
Referenced by button_activate_state(), ED_region_visibility_change_update_animated(), ED_screen_animation_timer(), ED_view3d_smooth_view_ex(), file_directory_new_exec(), gpencil_sculpt_brush_invoke(), image_view_zoom_init(), initFlyInfo(), initWalkInfo(), minimize_stretch_invoke(), node_insert_offset_invoke(), paint_stroke_modal(), panel_handle_data_ensure(), renamebutton_cb(), screen_opengl_render_invoke(), text_cursor_timer_ensure(), ui_handle_button_event(), ui_handle_menu_event(), ui_pie_handler(), UI_view2d_smooth_view(), uv_sculpt_stroke_invoke(), view_zoom_init(), view_zoomdrag_invoke(), viewzoom_invoke(), wm_autosave_timer_begin_ex(), WM_jobs_start(), WM_report_banner_show(), WM_tooltip_init(), and WM_tooltip_timer_init_ex().
| wmTimer* WM_event_add_timer_notifier | ( | wmWindowManager * | wm, |
| wmWindow * | win, | ||
| unsigned int | type, | ||
| double | timestep | ||
| ) |
Definition at line 1648 of file wm_window.c.
References BLI_addtail(), wmTimer::customdata, wmTimer::event_type, wmTimer::flags, wmTimer::ltime, MEM_callocN, wmTimer::ntime, PIL_check_seconds_timer(), POINTER_FROM_UINT, wmTimer::stime, TIMERNOTIFIER, wmWindowManager::timers, wmTimer::timestep, type, wmTimer::win, and WM_TIMER_NO_FREE_CUSTOM_DATA.
Referenced by file_draw_list().
| void WM_event_remove_timer | ( | wmWindowManager * | wm, |
| wmWindow * | UNUSEDwin, | ||
| wmTimer * | timer | ||
| ) |
Definition at line 1669 of file wm_window.c.
References BLI_remlink(), wmTimer::customdata, EVENT_NONE, wmTimer::flags, LISTBASE_FOREACH, MEM_freeN, NULL, wmWindowManager::reports, ReportList::reporttimer, wmWindowManager::timers, wmWindowManager::windows, and WM_TIMER_NO_FREE_CUSTOM_DATA.
Referenced by button_activate_state(), ED_region_exit(), ED_screen_animation_timer(), ED_screen_exit(), ED_screen_state_toggle(), ED_view3d_smooth_view_ex(), file_directory_new_exec(), file_smoothscroll_invoke(), flyEnd(), gpencil_sculpt_brush_exit(), image_view_zoom_exit(), minimize_stretch_exit(), node_insert_offset_modal(), paint_stroke_free(), panel_activate_state(), region_blend_end(), renamebutton_cb(), screen_opengl_render_end(), text_cursor_timer_remove(), UI_but_tooltip_timer_remove(), ui_handle_button_event(), ui_popup_block_remove(), UI_view2d_smooth_view(), update_reports_display_invoke(), uv_sculpt_stroke_exit(), view2d_smoothview_invoke(), view3d_smoothview_apply(), view_zoom_exit(), view_zoomdrag_exit(), viewops_data_free(), walkEnd(), wm_autosave_timer_end(), WM_event_remove_timer_notifier(), wm_jobs_kill_job(), WM_jobs_start(), wm_jobs_timer(), WM_report_banner_show(), WM_report_banners_cancel(), wm_reports_free(), WM_tooltip_timer_clear(), and wm_window_free().
| void WM_event_remove_timer_notifier | ( | wmWindowManager * | wm, |
| wmWindow * | win, | ||
| wmTimer * | timer | ||
| ) |
Definition at line 1703 of file wm_window.c.
References wmTimer::customdata, NULL, and WM_event_remove_timer().
Referenced by file_draw_list(), file_exit(), and file_refresh().
| void WM_event_timer_sleep | ( | wmWindowManager * | wm, |
| wmWindow * | UNUSEDwin, | ||
| wmTimer * | timer, | ||
| bool | do_sleep | ||
| ) |
Definition at line 1619 of file wm_window.c.
References LISTBASE_FOREACH, and wmWindowManager::timers.
Referenced by ED_screen_refresh(), and screen_change_prepare().
| void wm_get_desktopsize | ( | int * | r_width, |
| int * | r_height | ||
| ) |
Definition at line 151 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 | ||
| ) |
Definition at line 140 of file wm_window.c.
References g_system, and GHOST_GetMainDisplayDimensions().
Referenced by wm_window_check_size(), and wm_window_ghostwindows_ensure().
| void wm_ghost_exit | ( | void | ) |
Definition at line 1604 of file wm_window.c.
References g_system, GHOST_DisposeSystem(), and NULL.
Referenced by WM_exit_ex().
| void wm_ghost_init | ( | bContext * | C | ) |
Definition at line 1580 of file wm_window.c.
References C, G, G_DEBUG_GHOST, g_system, GHOST_AddEventConsumer(), GHOST_CreateEventConsumer(), GHOST_CreateSystem(), ghost_event_proc(), 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().
| void WM_ghost_show_message_box | ( | const char * | title, |
| const char * | message, | ||
| const char * | help_label, | ||
| const char * | continue_label, | ||
| const char * | link, | ||
| GHOST_DialogOptions | dialog_options | ||
| ) |
Definition at line 2455 of file wm_window.c.
References BLI_assert, g_system, and GHOST_ShowMessageBox().
Referenced by WM_platform_support_perform_checks().
|
static |
Definition at line 174 of file wm_window.c.
References g_system, GHOST_ActivateWindowDrawingContext(), GHOST_DisposeWindow(), wmWindow::ghostwin, GPU_context_active_set(), GPU_context_discard(), wmWindow::gpuctx, NULL, wmWindowManager::winactive, and wm_window_clear_drawable().
Referenced by wm_window_free().
| void WM_init_native_pixels | ( | bool | do_it | ) |
Definition at line 2061 of file wm_window.c.
References WMInitStruct::native_pixels, and wm_init_state.
Referenced by arg_handle_native_pixels_set().
| void WM_init_state_fullscreen_set | ( | void | ) |
Definition at line 2038 of file wm_window.c.
References GHOST_kWindowStateFullScreen, WMInitStruct::override_flag, WIN_OVERRIDE_WINSTATE, WMInitStruct::windowstate, and wm_init_state.
Referenced by arg_handle_without_borders().
| void WM_init_state_maximized_set | ( | void | ) |
Definition at line 2050 of file wm_window.c.
References GHOST_kWindowStateMaximized, WMInitStruct::override_flag, WIN_OVERRIDE_WINSTATE, WMInitStruct::windowstate, and wm_init_state.
Referenced by arg_handle_window_maximized().
| void WM_init_state_normal_set | ( | void | ) |
Definition at line 2044 of file wm_window.c.
References GHOST_kWindowStateNormal, WMInitStruct::override_flag, WIN_OVERRIDE_WINSTATE, WMInitStruct::windowstate, and wm_init_state.
Referenced by arg_handle_with_borders().
| void WM_init_state_size_set | ( | int | stax, |
| int | stay, | ||
| int | sizx, | ||
| int | sizy | ||
| ) |
Definition at line 2028 of file wm_window.c.
References WMInitStruct::override_flag, WMInitStruct::size_x, WMInitStruct::size_y, WMInitStruct::start_x, WMInitStruct::start_y, WIN_OVERRIDE_GEOM, and wm_init_state.
Referenced by arg_handle_window_geometry().
| void WM_init_tablet_api | ( | void | ) |
Definition at line 2072 of file wm_window.c.
References g_system, GHOST_kTabletAutomatic, GHOST_kTabletNative, GHOST_kTabletWintab, GHOST_SetTabletAPI(), USER_TABLET_AUTOMATIC, USER_TABLET_NATIVE, and USER_TABLET_WINTAB.
Referenced by wm_init_userdef().
| void WM_init_window_focus_set | ( | bool | do_it | ) |
Definition at line 2056 of file wm_window.c.
References WMInitStruct::window_focus, and wm_init_state.
Referenced by arg_handle_no_window_focus().
| void WM_opengl_context_activate | ( | void * | context | ) |
Definition at line 2443 of file wm_window.c.
References BLI_assert, context, GHOST_ActivateOpenGLContext(), GPU_framebuffer_active_get(), and GPU_framebuffer_back_get().
Referenced by drw_deferred_shader_add(), drw_deferred_shader_compilation_exec(), drw_deferred_shader_compilation_free(), DRW_opengl_context_create(), DRW_opengl_context_destroy(), DRW_opengl_context_enable_ex(), DRW_opengl_render_context_enable(), RE_gl_context_destroy(), and wm_surface_set_drawable().
| void* WM_opengl_context_create | ( | void | ) |
Definition at line 2421 of file wm_window.c.
References BLI_assert, BLI_thread_is_main(), GHOST_GLSettings::flags, G, G_DEBUG_GPU, g_system, GHOST_CreateOpenGLContext(), GHOST_glDebugContext, GPU_framebuffer_active_get(), and GPU_framebuffer_back_get().
Referenced by drw_deferred_shader_add(), DRW_opengl_context_create(), EEVEE_lightbake_job_create(), EEVEE_lightbake_job_data_alloc(), and RE_gl_context_create().
| void WM_opengl_context_dispose | ( | void * | context | ) |
Definition at line 2437 of file wm_window.c.
References BLI_assert, context, g_system, GHOST_DisposeOpenGLContext(), GPU_framebuffer_active_get(), and GPU_framebuffer_back_get().
Referenced by drw_deferred_shader_compilation_free(), DRW_opengl_context_destroy(), eevee_lightbake_delete_resources(), and RE_gl_context_destroy().
| void WM_opengl_context_release | ( | void * | context | ) |
Definition at line 2449 of file wm_window.c.
References BLI_assert, context, GHOST_ReleaseOpenGLContext(), GPU_framebuffer_active_get(), and GPU_framebuffer_back_get().
Referenced by drw_deferred_shader_compilation_exec(), DRW_opengl_context_disable_ex(), DRW_opengl_render_context_disable(), and wm_surface_clear_drawable().
| void WM_progress_clear | ( | wmWindow * | win | ) |
Definition at line 1831 of file wm_window.c.
References GHOST_EndProgressBar(), and wmWindow::ghostwin.
Referenced by wm_jobs_update_progress_bars().
Definition at line 1823 of file wm_window.c.
References GHOST_SetProgressBar(), and wmWindow::ghostwin.
Referenced by wm_jobs_update_progress_bars().
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 362 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_image_is_modified(), and wm_window_raise().
Referenced by ghost_event_proc(), wm_exit_blender_invoke(), and wm_window_close().
|
static |
Definition at line 339 of file wm_window.c.
References C, and wm_exit_schedule_delayed().
Referenced by wm_confirm_quit().
|
static |
Definition at line 162 of file wm_window.c.
References BLI_rcti_resize_x(), BLI_rcti_resize_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), height, width, and wm_get_screensize().
Referenced by WM_window_open().
| void wm_window_clear_drawable | ( | wmWindowManager * | wm | ) |
Definition at line 1047 of file wm_window.c.
References NULL, and wmWindowManager::windrawable.
Referenced by blend_file_thumb(), 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 | ||
| ) |
Definition at line 389 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, |
| wmOperator * | UNUSEDop | ||
| ) |
Definition at line 906 of file wm_window.c.
References C, CTX_wm_manager(), CTX_wm_window(), OPERATOR_FINISHED, and wm_window_close().
Referenced by WM_OT_window_close().
| wmWindow* wm_window_copy | ( | Main * | bmain, |
| wmWindowManager * | wm, | ||
| wmWindow * | win_src, | ||
| const bool | duplicate_layout, | ||
| const bool | child | ||
| ) |
Definition at line 279 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, | ||
| const bool | duplicate_layout, | ||
| const bool | child | ||
| ) |
A higher level version of copy that tests the new window can be added. (called from the operator directly)
Definition at line 313 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().
|
static |
Definition at line 1904 of file wm_window.c.
References wmWindow::posx, and wmWindow::posy.
Referenced by WM_window_find_under_cursor().
| void WM_window_ensure_active_view_layer | ( | wmWindow * | win | ) |
Definition at line 2324 of file wm_window.c.
References BKE_view_layer_default_view(), BKE_view_layer_find(), ViewLayer::name, NULL, scene, STRNCPY, wmWindow::view_layer_name, and WM_window_get_active_scene().
Referenced by ED_screen_scene_change().
|
static |
Definition at line 526 of file wm_window.c.
References wmWindow::eventstate, MEM_callocN, and wm_window_update_eventstate().
Referenced by wm_window_ghostwindow_add(), and wm_window_ghostwindow_ensure().
| bool WM_window_find_under_cursor | ( | const wmWindowManager * | wm, |
| const wmWindow * | win_ignore, | ||
| const wmWindow * | win, | ||
| const int | mval[2], | ||
| wmWindow ** | r_win, | ||
| int | r_mval[2] | ||
| ) |
Definition at line 1922 of file wm_window.c.
References copy_v2_v2_int(), GHOST_kWindowStateMinimized, LISTBASE_FOREACH, wmWindowManager::windows, wm_window_desktop_pos_get(), WM_window_pixels_x(), WM_window_pixels_y(), and wm_window_screen_pos_get().
Referenced by eyedropper_color_sample_fl(), and wm_event_cursor_other_windows().
| void wm_window_free | ( | bContext * | C, |
| wmWindowManager * | wm, | ||
| wmWindow * | win | ||
| ) |
Definition at line 202 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::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(), and wmWindow::workspace_hook.
Referenced by wm_close_and_free(), and wm_window_close().
| int wm_window_fullscreen_toggle_exec | ( | bContext * | C, |
| wmOperator * | UNUSEDop | ||
| ) |
Definition at line 943 of file wm_window.c.
References C, CTX_wm_window(), G, GHOST_GetWindowState(), GHOST_kWindowStateFullScreen, GHOST_kWindowStateNormal, GHOST_SetWindowState(), wmWindow::ghostwin, OPERATOR_CANCELLED, OPERATOR_FINISHED, and state.
Referenced by WM_OT_window_fullscreen_toggle().
| WorkSpaceLayout* WM_window_get_active_layout | ( | const wmWindow * | win | ) |
Definition at line 2359 of file wm_window.c.
References BKE_workspace_active_layout_get(), LIKELY, NULL, WM_window_get_active_workspace(), and wmWindow::workspace_hook.
Referenced by ED_screen_state_toggle(), wm_event_do_notifiers(), wm_window_copy(), wm_window_match_keep_current_wm(), and workspace_change_get_new_layout().
Definition at line 2249 of file wm_window.c.
References wmWindow::scene.
Referenced by buttons_context_path(), ED_area_newspace(), ED_editors_init_for_undo(), ED_scene_add(), ED_screen_exit(), ED_screen_scene_find_with_window(), find_area_showing_r_result(), graph_init(), nla_init(), object_delete_exec(), screen_change_update(), screen_ctx_active_annotation_layer(), screen_ctx_annotation_data(), screen_ctx_annotation_data_owner(), screen_ctx_scene(), screen_ctx_selected_editable_sequences(), screen_ctx_selected_sequences(), screen_ctx_sequences(), screen_global_area_refresh(), sound_jack_sync_callback(), toolsystem_ref_link(), tree_element_viewlayer_activate(), wm_draw_update_test_window(), wm_event_do_depsgraph(), wm_event_do_handlers(), wm_event_do_notifiers(), WM_stereo3d_enabled(), WM_toolsystem_ref_sync_from_context(), WM_window_ensure_active_view_layer(), WM_window_get_active_view_layer(), WM_window_open(), WM_window_set_active_view_layer(), WM_windows_scene_data_sync(), WM_windows_scene_get_from_screen(), and wm_xr_session_scene_and_evaluated_depsgraph_get().
Get the active screen of the active workspace in win.
Definition at line 2372 of file wm_window.c.
References BKE_workspace_active_screen_get(), LIKELY, NULL, WM_window_get_active_workspace(), and wmWindow::workspace_hook.
Referenced by actionzone_area_poll(), area_dupli_invoke(), areas_do_frame_follow(), button_activate_init(), button_tooltip_timer_reset(), compo_get_recalc_flags(), ED_area_type_hud_clear(), ED_area_update_region_sizes(), ED_clip_update_frame(), ED_fileselect_handler_area_find(), ED_object_texture_paint_mode_enter_ex(), ED_region_do_draw(), ED_render_scene_update(), ED_render_view3d_update(), ED_screen_animation_no_scrub(), ED_screen_animation_playing(), ED_screen_draw_edges(), ED_screen_refresh(), ED_screen_scene_change(), ED_screen_scene_find_with_window(), ED_screen_set_active_region(), ED_screen_state_toggle(), ED_screen_window_find(), ED_space_image_paint_update(), eyedropper_color_sample_fl(), find_area_showing_r_result(), ghost_event_proc(), gizmo_mesh_spin_redo_setup(), menu_items_from_ui_create(), redraw_timer_step(), region_cursor_set(), region_cursor_set_ex(), render_image_restore_layer(), render_image_update_pass_and_layer(), render_view_show_invoke(), screen_animation_step_invoke(), screen_cursor_set(), screen_geom_select_connected_edge(), screen_state_to_nonnormal(), SCULPT_flush_update_done(), toolsystem_refresh_screen_from_active_tool(), UI_but_tooltip_refresh(), UI_popup_block_close(), ui_popup_block_remove(), wm_draw_region_clear(), wm_draw_update(), wm_draw_update_clear_window(), wm_draw_update_test_window(), wm_draw_window(), wm_draw_window_offscreen(), wm_draw_window_onscreen(), wm_event_do_depsgraph(), wm_event_do_handlers(), wm_event_do_notifiers(), wm_event_do_refresh_wm_and_depsgraph(), wm_event_drag_and_drop_test(), WM_exit_ex(), wm_gesture_tag_redraw(), wm_handler_fileselect_do(), wm_handler_op_context(), wm_operator_winactive_normal(), WM_paint_cursor_tag_redraw(), wm_paintcursor_draw(), WM_stereo3d_enabled(), wm_stereo3d_set_exec(), WM_toolsystem_do_msg_notify_tag_refresh(), WM_toolsystem_refresh_active(), WM_toolsystem_refresh_screen_all(), WM_toolsystem_reinit_all(), WM_tooltip_clear(), WM_tooltip_immediate_init(), WM_tooltip_init(), WM_tooltip_refresh(), WM_tooltip_timer_clear(), WM_tooltip_timer_init_ex(), wm_window_close(), WM_window_cursor_keymap_status_refresh(), WM_window_is_temp_screen(), wm_window_match_init(), wm_window_match_keep_current_wm(), WM_window_open(), WM_window_set_active_workspace(), WM_window_status_area_tag_redraw(), WM_windows_scene_get_from_screen(), WM_windows_view_layer_get_from_screen(), and WM_windows_workspace_get_from_screen().
Definition at line 2286 of file wm_window.c.
References BKE_view_layer_default_view(), BKE_view_layer_find(), NULL, scene, wmWindow::view_layer_name, WM_window_get_active_scene(), and WM_window_set_active_view_layer().
Referenced by buttons_context_path(), buttons_context_path_brush(), buttons_context_path_view_layer(), buttons_shading_context(), buttons_shading_new_context(), buttons_texture_users_from_context(), clean_viewport_memory(), ED_area_init(), ED_editors_init_for_undo(), ED_screen_scene_change(), image_listener(), pose_bone_layers_exec(), screen_animation_step_invoke(), screen_ctx_active_bone(), screen_ctx_active_gpencil_frame(), screen_ctx_active_gpencil_layer(), screen_ctx_active_object(), screen_ctx_active_pose_bone(), screen_ctx_edit_object(), screen_ctx_editable_gpencil_layers(), screen_ctx_editable_gpencil_strokes(), screen_ctx_editable_objects(), screen_ctx_gpencil_data(), screen_ctx_gpencil_data_owner(), screen_ctx_image_paint_object(), screen_ctx_object(), screen_ctx_objects_in_mode(), screen_ctx_objects_in_mode_unique_data(), screen_ctx_particle_edit_object(), screen_ctx_pose_object(), screen_ctx_sculpt_object(), screen_ctx_selectable_objects(), screen_ctx_selected_bones_(), screen_ctx_selected_editable_objects(), screen_ctx_selected_objects(), screen_ctx_selected_pose_bones(), screen_ctx_selected_pose_bones_from_active_object(), screen_ctx_vertex_paint_object(), screen_ctx_visible_gpencil_layers(), screen_ctx_visible_objects(), screen_ctx_visible_or_editable_bones_(), screen_ctx_visible_pose_bones(), screen_ctx_weight_paint_object(), sound_jack_sync_callback(), toolsystem_refresh_screen_from_active_tool(), view3d_main_region_cursor(), view3d_main_region_listener(), view_layer_add_exec(), wm_draw_update_test_window(), wm_event_do_depsgraph(), wm_event_do_handlers(), WM_toolsystem_do_msg_notify_tag_refresh(), WM_toolsystem_ref_sync_from_context(), WM_toolsystem_refresh_active(), WM_toolsystem_refresh_screen_all(), WM_toolsystem_reinit_all(), WM_window_cursor_keymap_status_refresh(), WM_window_set_active_scene(), WM_windows_view_layer_get_from_screen(), and wm_xr_session_scene_and_evaluated_depsgraph_get().
Definition at line 2335 of file wm_window.c.
References BKE_workspace_active_get(), and wmWindow::workspace_hook.
Referenced by ED_area_init(), ED_screen_state_toggle(), ED_workspace_change(), ED_workspace_delete(), screen_state_to_nonnormal(), space_workspace_cycle_invoke(), toolsystem_ref_link(), toolsystem_refresh_screen_from_active_tool(), wm_event_do_handlers(), wm_event_do_notifiers(), WM_toolsystem_do_msg_notify_tag_refresh(), WM_toolsystem_ref_sync_from_context(), WM_toolsystem_refresh_active(), WM_toolsystem_refresh_screen_all(), WM_toolsystem_reinit_all(), WM_toolsystem_update_from_context_view3d(), wm_window_close(), wm_window_copy(), WM_window_cursor_keymap_status_refresh(), WM_window_get_active_layout(), WM_window_get_active_screen(), WM_window_open(), and WM_windows_workspace_get_from_screen().
| void wm_window_get_position | ( | wmWindow * | win, |
| int * | r_pos_x, | ||
| int * | r_pos_y | ||
| ) |
Definition at line 1844 of file wm_window.c.
References wmWindow::posx, and wmWindow::posy.
| bool wm_window_get_swap_interval | ( | wmWindow * | win, |
| int * | intervalOut | ||
| ) |
Definition at line 1894 of file wm_window.c.
References GHOST_GetSwapInterval(), and wmWindow::ghostwin.
|
static |
Definition at line 537 of file wm_window.c.
References bounds(), Stereo3dFormat::display_mode, GHOST_GLSettings::flags, G, G_DEBUG_GPU, g_system, GHOST_CreateWindow(), GHOST_DisposeRectangle(), GHOST_GetClientBounds(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), GHOST_GetWindowState(), GHOST_glDebugContext, GHOST_glStereoVisual, GHOST_kDrawingContextTypeOpenGL, GHOST_kWindowStateMinimized, GHOST_SetWindowState(), GHOST_SetWindowUserData(), wmWindow::ghostwin, GPU_clear_color(), GPU_context_create(), GPU_init(), wmWindow::gpuctx, NULL, wmWindow::parent, wmWindow::posx, wmWindow::posy, S3D_DISPLAY_PAGEFLIP, wmWindow::sizex, wmWindow::sizey, wmWindow::stereo3d_format, WMInitStruct::window_focus, wmWindow::windowstate, wmWindowManager::windrawable, wm_get_desktopsize(), wm_init_state, wm_window_clear_drawable(), wm_window_ensure_eventstate(), WM_window_set_dpi(), wm_window_set_drawable(), and wm_window_swap_buffers().
Referenced by wm_window_ghostwindow_ensure().
|
static |
Definition at line 618 of file wm_window.c.
References wmWindow::cursor, wmWindowManager::defaultconf, ED_screen_global_areas_refresh(), GHOST_kWindowStateNormal, GHOST_WINDOW_STATE_DEFAULT, wmWindow::ghostwin, wmWindow::handlers, wmWindow::modalhandlers, NULL, WMInitStruct::override_flag, wmWindow::posx, wmWindow::posy, WMInitStruct::size_x, WMInitStruct::size_y, wmWindow::sizex, wmWindow::sizey, WMInitStruct::start_x, WMInitStruct::start_y, WIN_OVERRIDE_GEOM, WIN_OVERRIDE_WINSTATE, wmWindow::windowstate, WMInitStruct::windowstate, WM_CURSOR_DEFAULT, WM_dropboxmap_find(), WM_event_add_dropbox_handler(), WM_event_add_keymap_handler(), wm_init_state, WM_keymap_ensure(), wm_window_ensure_eventstate(), wm_window_ghostwindow_add(), WM_window_set_dpi(), and wm_window_title().
Referenced by wm_window_ghostwindows_ensure(), and WM_window_open().
| 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 inits stuff after file read.
Definition at line 693 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 720 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().
| bool WM_window_is_fullscreen | ( | const wmWindow * | win | ) |
Definition at line 2187 of file wm_window.c.
References GHOST_kWindowStateFullScreen, and wmWindow::windowstate.
Referenced by area_azone_init(), and wm_stereo3d_set_exec().
| bool WM_window_is_maximized | ( | const wmWindow * | win | ) |
Definition at line 2192 of file wm_window.c.
References GHOST_kWindowStateMaximized, and wmWindow::windowstate.
Referenced by ED_fileselect_window_params_get().
| bool WM_window_is_temp_screen | ( | const wmWindow * | win | ) |
Definition at line 2383 of file wm_window.c.
References bScreen::temp, and WM_window_get_active_screen().
Referenced by ED_fileselect_exit(), ED_screen_exit(), render_view_cancel_exec(), render_view_show_invoke(), screen_maximize_area_poll(), space_workspace_cycle_invoke(), WM_event_add_fileselect(), wm_handler_fileselect_do(), wm_homefile_write_exec(), wm_window_close(), WM_window_open(), and wm_window_title().
| void wm_window_lower | ( | wmWindow * | win | ) |
Definition at line 1861 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 1054 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(), 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 Main * | bmain, |
| wmWindowManager * | wm, | ||
| wmWindow * | parent, | ||
| bool | dialog | ||
| ) |
Definition at line 263 of file wm_window.c.
References BKE_workspace_instance_hook_create(), BLI_addtail(), find_free_winid(), MEM_callocN, wmWindow::parent, wmWindow::stereo3d_format, wmWindowManager::windows, wmWindow::winid, and wmWindow::workspace_hook.
Referenced by wm_add_default(), wm_window_copy(), and WM_window_open().
| int wm_window_new_exec | ( | bContext * | C, |
| wmOperator * | UNUSEDop | ||
| ) |
Definition at line 914 of file wm_window.c.
References blender::compositor::area(), BKE_screen_find_big_area(), C, CTX_wm_screen(), CTX_wm_window(), IFACE_, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, 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, |
| wmOperator * | UNUSEDop | ||
| ) |
Definition at line 933 of file wm_window.c.
References C, CTX_wm_window(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, and wm_window_copy_test().
Referenced by WM_OT_window_new_main().
| wmWindow* WM_window_open | ( | bContext * | C, |
| const char * | title, | ||
| int | x, | ||
| int | y, | ||
| int | sizex, | ||
| int | sizey, | ||
| int | space_type, | ||
| bool | dialog, | ||
| bool | temp, | ||
| WindowAlignment | alignment | ||
| ) |
| space_type | SPACE_VIEW3D, SPACE_INFO, ... (eSpace_Type) |
| dialog | whether this should be made as a dialog-style window |
| temp | whether this is considered a short-lived window |
| alignment | how this window is positioned relative to its parent |
Definition at line 764 of file wm_window.c.
References blender::compositor::area(), bScreen::areabase, BKE_workspace_active_set(), BKE_workspace_layout_screen_get(), BLI_rcti_size_x(), BLI_rcti_size_y(), C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_window(), CTX_wm_window_set(), ED_area_newspace(), ED_screen_change(), ED_screen_refresh(), ED_screen_scene_change(), ED_workspace_layout_add(), ListBase::first, free(), GHOST_GetNativePixelSize(), GHOST_GetTitle(), GHOST_SetTitle(), wmWindow::ghostwin, LISTBASE_FOREACH, ViewLayer::name, NULL, wmWindow::posx, wmWindow::posy, scene, wmWindow::sizex, wmWindow::sizey, SPACE_EMPTY, wmWindow::stereo3d_format, STREQ, STRNCPY, bScreen::temp, wmWindow::view_layer_name, WIN_ALIGN_LOCATION_CENTER, WIN_ALIGN_PARENT_CENTER, wmWindowManager::windows, WM_check(), wm_window_check_size(), wm_window_close(), WM_window_get_active_scene(), WM_window_get_active_screen(), WM_window_get_active_workspace(), wm_window_ghostwindow_ensure(), WM_window_is_temp_screen(), wm_window_new(), wm_window_raise(), WM_window_set_active_layout(), wm_window_set_size(), wm_window_update_size_position(), wmWindow::workspace_hook, x, rcti::xmax, rcti::xmin, y, rcti::ymax, and rcti::ymin.
Referenced by area_dupli_invoke(), drivers_editor_show_exec(), ED_screen_temp_space_open(), info_log_show_exec(), render_view_open(), userpref_show_exec(), and wm_window_new_exec().
| void WM_window_pixel_sample_read | ( | const wmWindowManager * | wm, |
| const wmWindow * | win, | ||
| const int | pos[2], | ||
| float | r_col[3] | ||
| ) |
Definition at line 1958 of file wm_window.c.
References GHOST_ActivateWindowDrawingContext(), wmWindow::ghostwin, GPU_context_active_set(), GPU_DATA_FLOAT, GPU_frontbuffer_read_pixels(), wmWindow::gpuctx, pos, and wmWindowManager::windrawable.
Referenced by eyedropper_color_sample_fl().
| uint* WM_window_pixels_read | ( | wmWindowManager * | wm, |
| wmWindow * | win, | ||
| int | r_size[2] | ||
| ) |
Definition at line 1989 of file wm_window.c.
References GHOST_ActivateWindowDrawingContext(), wmWindow::ghostwin, GPU_context_active_set(), GPU_DATA_UBYTE, GPU_frontbuffer_read_pixels(), wmWindow::gpuctx, MEM_mallocN, wmWindowManager::windrawable, WM_window_pixels_x(), and WM_window_pixels_y().
Referenced by screenshot_data_create().
| int WM_window_pixels_x | ( | const wmWindow * | win | ) |
Support for native pixel size
Definition at line 2130 of file wm_window.c.
References float(), GHOST_GetNativePixelSize(), wmWindow::ghostwin, and wmWindow::sizex.
Referenced by area_azone_init(), ED_fileselect_window_params_get(), ED_screen_draw_edges(), screen_global_statusbar_area_refresh(), screen_global_topbar_area_refresh(), ui_block_bounds_calc_centered(), ui_block_bounds_calc_popup(), ui_popup_block_clip(), ui_popup_block_position(), ui_popup_block_refresh(), ui_searchbox_create_generic(), ui_tooltip_create_with_data(), ui_update_window_matrix(), wm_draw_window(), wm_drop_operator_options(), wm_event_cursor_other_windows(), wm_gesture_draw_cross(), wm_handler_fileselect_do(), wm_stereo3d_draw_sidebyside(), wm_stereo3d_draw_topbottom(), wm_stereo3d_mouse_offset_apply(), WM_window_find_under_cursor(), WM_window_pixels_read(), WM_window_rect_calc(), and wmWindowViewport().
| int WM_window_pixels_y | ( | const wmWindow * | win | ) |
Definition at line 2136 of file wm_window.c.
References float(), GHOST_GetNativePixelSize(), wmWindow::ghostwin, and wmWindow::sizey.
Referenced by ED_fileselect_window_params_get(), ED_screen_draw_edges(), screen_global_statusbar_area_refresh(), screen_global_topbar_area_refresh(), ui_block_bounds_calc_centered(), ui_block_bounds_calc_popup(), ui_popup_block_clip(), ui_popup_block_position(), ui_popup_block_refresh(), ui_tooltip_create_with_data(), ui_update_window_matrix(), wm_drags_draw(), wm_draw_window(), wm_drop_operator_options(), wm_event_cursor_other_windows(), wm_gesture_draw_cross(), wm_handler_fileselect_do(), wm_stereo3d_draw_sidebyside(), wm_stereo3d_draw_topbottom(), wm_stereo3d_mouse_offset_apply(), WM_window_find_under_cursor(), WM_window_pixels_read(), WM_window_rect_calc(), and wmWindowViewport().
| void wm_window_process_events | ( | const bContext * | C | ) |
Definition at line 1550 of file wm_window.c.
References BLI_assert, BLI_thread_is_main(), C, CTX_wm_manager(), g_system, GHOST_DispatchEvents(), GHOST_ProcessEvents(), PIL_sleep_ms(), wm_window_timer(), and wm_xr_events_handle().
Referenced by WM_main().
| void wm_window_raise | ( | wmWindow * | win | ) |
Definition at line 1866 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().
Get boundaries usable by all window contents, including global areas.
Definition at line 2146 of file wm_window.c.
References BLI_rcti_init(), WM_window_pixels_x(), and WM_window_pixels_y().
Referenced by area_move_set_limits(), area_split(), area_split_invoke(), ED_area_init(), ED_area_update_region_sizes(), screen_area_edge_from_cursor(), screen_geom_find_active_scredge(), screen_geom_vertices_scale(), and WM_window_screen_rect_calc().
| void wm_window_reset_drawable | ( | void | ) |
Definition at line 1074 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_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().
|
static |
Definition at line 1913 of file wm_window.c.
References wmWindow::posx, and wmWindow::posy.
Referenced by WM_window_find_under_cursor().
Get boundaries usable by screen-layouts, excluding global areas.
Definition at line 2154 of file wm_window.c.
References ScrAreaMap::areabase, BLI_assert, BLI_assert_unreachable, BLI_rcti_is_valid(), ED_area_global_size_y(), GLOBAL_AREA_ALIGN_BOTTOM, GLOBAL_AREA_ALIGN_TOP, GLOBAL_AREA_IS_HIDDEN, wmWindow::global_areas, height, LISTBASE_FOREACH, WM_window_rect_calc(), rcti::ymax, and rcti::ymin.
Referenced by actionzone_modal(), ED_workspace_layout_add(), screen_geom_find_active_scredge(), and screen_geom_vertices_scale().
| void WM_window_set_active_layout | ( | wmWindow * | win, |
| WorkSpace * | workspace, | ||
| WorkSpaceLayout * | layout | ||
| ) |
Definition at line 2364 of file wm_window.c.
References BKE_workspace_active_layout_set(), wmWindow::winid, and wmWindow::workspace_hook.
Referenced by wm_window_match_keep_current_wm(), and WM_window_open().
Definition at line 2257 of file wm_window.c.
References C, CTX_wm_manager(), ED_scene_change_update(), ED_screen_scene_change(), if(), LISTBASE_FOREACH, NC_WINDOW, NULL, wmWindow::parent, scene, wmWindow::scene, wmWindowManager::windows, WM_event_add_notifier(), and WM_window_get_active_view_layer().
Referenced by arg_handle_scene_set(), do_outliner_item_activate_tree_element(), ED_scene_add(), ED_scene_delete(), outliner_do_object_operation_ex(), outliner_object_operation_exec(), tree_element_object_activate(), and tree_element_world_activate().
Definition at line 2378 of file wm_window.c.
References BKE_workspace_active_screen_set(), wmWindow::winid, and wmWindow::workspace_hook.
Referenced by ED_screen_change(), and wm_window_match_keep_current_wm().
Definition at line 2306 of file wm_window.c.
References BKE_view_layer_find(), BKE_workspace_active_screen_get(), BLI_assert, ED_render_view_layer_changed(), ListBase::first, G_MAIN, LISTBASE_FOREACH, ViewLayer::name, NULL, wmWindow::parent, STRNCPY, wmWindowManager::windows, Main::wm, and WM_window_get_active_scene().
Referenced by tree_element_viewlayer_activate(), view_layer_add_exec(), and WM_window_get_active_view_layer().
Definition at line 2340 of file wm_window.c.
References C, CTX_wm_manager(), ED_workspace_change(), LISTBASE_FOREACH, wmWindow::parent, bScreen::temp, wmWindowManager::windows, and WM_window_get_active_screen().
Referenced by wm_event_do_notifiers().
| void WM_window_set_dpi | ( | const wmWindow * | win | ) |
Definition at line 469 of file wm_window.c.
References BLF_default_dpi(), CLAMP, float(), GHOST_GetDPIHint(), GHOST_GetNativePixelSize(), wmWindow::ghostwin, max_ff(), max_ii(), VIRTUAL_PIXEL_DOUBLE, and VIRTUAL_PIXEL_NATIVE.
Referenced by ED_fileselect_window_params_get(), ED_screen_refresh(), ghost_event_proc(), wm_window_ghostwindow_add(), wm_window_ghostwindow_ensure(), and wm_window_make_drawable().
|
static |
Definition at line 1036 of file wm_window.c.
References activate(), BLI_assert, ELEM, GHOST_ActivateWindowDrawingContext(), wmWindow::ghostwin, GPU_context_active_set(), wmWindow::gpuctx, NULL, and wmWindowManager::windrawable.
Referenced by wm_window_ghostwindow_add(), wm_window_make_drawable(), and wm_window_reset_drawable().
| void wm_window_set_size | ( | wmWindow * | win, |
| int | width, | ||
| int | height | ||
| ) |
Definition at line 1850 of file wm_window.c.
References GHOST_SetClientSize(), wmWindow::ghostwin, height, and width.
Referenced by WM_window_open().
| void wm_window_set_swap_interval | ( | wmWindow * | win, |
| int | interval | ||
| ) |
Definition at line 1889 of file wm_window.c.
References GHOST_SetSwapInterval(), and wmWindow::ghostwin.
| void wm_window_swap_buffers | ( | wmWindow * | win | ) |
Push rendered buffer to the screen.
Definition at line 1884 of file wm_window.c.
References GHOST_SwapWindowBuffers(), and wmWindow::ghostwin.
Referenced by wm_draw_update(), and wm_window_ghostwindow_add().
|
static |
This timer system only gives maximum 1 timer event per redraw cycle, to prevent queues to get overloaded. Timer handlers should check for delta to decide if they just update, or follow real time. Timer handlers can also set duration to match frames passed
Definition at line 1501 of file wm_window.c.
References C, ceil(), CTX_data_main(), CTX_wm_manager(), EVT_DATA_TIMER, KM_NOTHING, LISTBASE_FOREACH_MUTABLE, NULL, PIL_check_seconds_timer(), POINTER_AS_UINT, time, TIMERAUTOSAVE, TIMERJOBS, TIMERNOTIFIER, wmWindowManager::timers, wm_autosave_timer(), wm_event_add(), wm_event_init_from_window(), wm_jobs_timer(), and WM_main_add_notifier().
Referenced by ghost_event_proc(), and wm_window_process_events().
| void wm_window_title | ( | wmWindowManager * | wm, |
| wmWindow * | win | ||
| ) |
Definition at line 440 of file wm_window.c.
References BKE_main_blendfile_path_from_global(), BLI_snprintf(), wmWindowManager::file_saved, G, 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().
|
static |
Definition at line 520 of file wm_window.c.
References wmWindow::eventstate, wm_cursor_position_get(), wmEvent::x, and wmEvent::y.
Referenced by ghost_event_proc(), and wm_window_ensure_eventstate().
|
static |
Definition at line 732 of file wm_window.c.
References GHOST_DisposeRectangle(), GHOST_GetClientBounds(), GHOST_GetRectangle(), wmWindow::ghostwin, l, wmWindow::posx, wmWindow::posy, r, wmWindow::sizex, wmWindow::sizey, t, and wm_get_desktopsize().
Referenced by ghost_event_proc(), and WM_window_open().
Some editor data may need to be synced with scene data (3D View camera and layers). This function ensures data is synced for editors in visible workspaces and their visible layouts.
Definition at line 2208 of file wm_window.c.
References ED_workspace_scene_data_sync(), LISTBASE_FOREACH, scene, and WM_window_get_active_scene().
Referenced by tree_element_camera_activate().
| Scene* WM_windows_scene_get_from_screen | ( | const wmWindowManager * | wm, |
| const bScreen * | screen | ||
| ) |
Definition at line 2217 of file wm_window.c.
References LISTBASE_FOREACH, NULL, wmWindowManager::windows, WM_window_get_active_scene(), and WM_window_get_active_screen().
Referenced by ED_file_change_dir_ex().
| ViewLayer* WM_windows_view_layer_get_from_screen | ( | const wmWindowManager * | wm, |
| const bScreen * | screen | ||
| ) |
Definition at line 2228 of file wm_window.c.
References LISTBASE_FOREACH, NULL, wmWindowManager::windows, WM_window_get_active_screen(), and WM_window_get_active_view_layer().
| WorkSpace* WM_windows_workspace_get_from_screen | ( | const wmWindowManager * | wm, |
| const bScreen * | screen | ||
| ) |
Definition at line 2239 of file wm_window.c.
References LISTBASE_FOREACH, NULL, wmWindowManager::windows, WM_window_get_active_screen(), and WM_window_get_active_workspace().
|
static |
Definition at line 102 of file wm_window.c.
Referenced by ghost_event_proc(), query_qual(), wm_cursor_position_get(), WM_cursor_warp(), wm_get_desktopsize(), wm_get_screensize(), wm_ghost_exit(), wm_ghost_init(), WM_ghost_show_message_box(), wm_ghostwindow_destroy(), WM_init_tablet_api(), WM_opengl_context_create(), WM_opengl_context_dispose(), wm_window_ghostwindow_add(), and wm_window_process_events().
|
static |
Referenced by wm_ghost_init(), WM_init_native_pixels(), WM_init_state_fullscreen_set(), WM_init_state_maximized_set(), WM_init_state_normal_set(), WM_init_state_size_set(), WM_init_window_focus_set(), wm_window_ghostwindow_add(), wm_window_ghostwindow_ensure(), and wm_window_ghostwindows_ensure().