Blender  V3.3
Functions
wm_window.h File Reference

Go to the source code of this file.

Functions

void wm_ghost_init (bContext *C)
 
void wm_ghost_exit (void)
 
void wm_get_screensize (int *r_width, int *r_height)
 
void wm_get_desktopsize (int *r_width, int *r_height)
 
wmWindowwm_window_new (const struct Main *bmain, wmWindowManager *wm, wmWindow *parent, bool dialog)
 
wmWindowwm_window_copy (struct Main *bmain, wmWindowManager *wm, wmWindow *win_src, bool duplicate_layout, bool child)
 
wmWindowwm_window_copy_test (bContext *C, wmWindow *win_src, bool duplicate_layout, bool child)
 
void wm_window_free (bContext *C, wmWindowManager *wm, wmWindow *win)
 
void wm_window_close (bContext *C, wmWindowManager *wm, wmWindow *win)
 
void wm_window_title (wmWindowManager *wm, wmWindow *win)
 
void wm_window_ghostwindows_ensure (wmWindowManager *wm)
 
void wm_window_ghostwindows_remove_invalid (bContext *C, wmWindowManager *wm)
 
void wm_window_process_events (const bContext *C)
 
void wm_window_clear_drawable (wmWindowManager *wm)
 
void wm_window_make_drawable (wmWindowManager *wm, wmWindow *win)
 
void wm_window_reset_drawable (void)
 
void wm_window_raise (wmWindow *win)
 
void wm_window_lower (wmWindow *win)
 
void wm_window_set_size (wmWindow *win, int width, int height)
 
void wm_window_get_position (wmWindow *win, int *r_pos_x, int *r_pos_y)
 
void wm_window_swap_buffers (wmWindow *win)
 Push rendered buffer to the screen. More...
 
void wm_window_set_swap_interval (wmWindow *win, int interval)
 
bool wm_window_get_swap_interval (wmWindow *win, int *intervalOut)
 
void wm_cursor_position_get (wmWindow *win, int *r_x, int *r_y)
 
void wm_cursor_position_from_ghost_screen_coords (wmWindow *win, int *r_x, int *r_y)
 
void wm_cursor_position_to_ghost_screen_coords (wmWindow *win, int *x, int *y)
 
void wm_cursor_position_from_ghost_client_coords (wmWindow *win, int *x, int *y)
 
void wm_cursor_position_to_ghost_client_coords (wmWindow *win, int *x, int *y)
 
void wm_window_delete_removed_timers (wmWindowManager *wm)
 
int wm_window_close_exec (bContext *C, struct wmOperator *op)
 
int wm_window_fullscreen_toggle_exec (bContext *C, struct wmOperator *op)
 
void wm_quit_with_optional_confirmation_prompt (bContext *C, wmWindow *win) ATTR_NONNULL()
 
int wm_window_new_exec (bContext *C, struct wmOperator *op)
 
int wm_window_new_main_exec (bContext *C, struct wmOperator *op)
 
void wm_test_autorun_revert_action_set (struct wmOperatorType *ot, struct PointerRNA *ptr)
 
void wm_test_autorun_warning (bContext *C)
 

Function Documentation

◆ wm_cursor_position_from_ghost_client_coords()

void wm_cursor_position_from_ghost_client_coords ( wmWindow win,
int *  x,
int *  y 
)

◆ wm_cursor_position_from_ghost_screen_coords()

void wm_cursor_position_from_ghost_screen_coords ( wmWindow win,
int *  r_x,
int *  r_y 
)

◆ wm_cursor_position_get()

void wm_cursor_position_get ( wmWindow win,
int *  r_x,
int *  r_y 
)

◆ wm_cursor_position_to_ghost_client_coords()

void wm_cursor_position_to_ghost_client_coords ( wmWindow win,
int *  x,
int *  y 
)

◆ wm_cursor_position_to_ghost_screen_coords()

void wm_cursor_position_to_ghost_screen_coords ( wmWindow win,
int *  x,
int *  y 
)

◆ wm_get_desktopsize()

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().

◆ wm_get_screensize()

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().

◆ wm_ghost_exit()

void wm_ghost_exit ( void  )

Definition at line 1600 of file wm_window.c.

References g_system, GHOST_DisposeSystem(), and NULL.

Referenced by WM_exit_ex().

◆ wm_ghost_init()

void wm_ghost_init ( bContext C)

◆ wm_quit_with_optional_confirmation_prompt()

void wm_quit_with_optional_confirmation_prompt ( bContext C,
wmWindow win 
)

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.

Parameters
winThe 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().

◆ wm_test_autorun_revert_action_set()

void wm_test_autorun_revert_action_set ( struct wmOperatorType ot,
struct PointerRNA ptr 
)

◆ wm_test_autorun_warning()

void wm_test_autorun_warning ( bContext C)

◆ wm_window_clear_drawable()

void wm_window_clear_drawable ( wmWindowManager wm)

◆ wm_window_close()

void wm_window_close ( bContext C,
wmWindowManager wm,
wmWindow win 
)

◆ wm_window_close_exec()

int wm_window_close_exec ( bContext C,
struct wmOperator op 
)

◆ wm_window_copy()

wmWindow* wm_window_copy ( struct Main bmain,
wmWindowManager wm,
wmWindow win_src,
bool  duplicate_layout,
bool  child 
)

◆ 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().

◆ wm_window_delete_removed_timers()

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().

◆ wm_window_free()

void wm_window_free ( bContext C,
wmWindowManager wm,
wmWindow win 
)

◆ wm_window_fullscreen_toggle_exec()

int wm_window_fullscreen_toggle_exec ( bContext C,
struct wmOperator op 
)

Full-screen operator callback.

◆ wm_window_get_position()

void wm_window_get_position ( wmWindow win,
int *  r_pos_x,
int *  r_pos_y 
)

Definition at line 1846 of file wm_window.c.

References wmWindow::posx, and wmWindow::posy.

◆ wm_window_get_swap_interval()

bool wm_window_get_swap_interval ( wmWindow win,
int *  intervalOut 
)

Definition at line 1893 of file wm_window.c.

References GHOST_GetSwapInterval(), and wmWindow::ghostwin.

◆ wm_window_ghostwindows_ensure()

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.

Warning
After running, 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().

◆ wm_window_ghostwindows_remove_invalid()

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().

◆ wm_window_lower()

void wm_window_lower ( wmWindow win)

◆ wm_window_make_drawable()

void wm_window_make_drawable ( wmWindowManager wm,
wmWindow win 
)

◆ wm_window_new()

wmWindow* wm_window_new ( const struct Main bmain,
wmWindowManager wm,
wmWindow parent,
bool  dialog 
)

Don't change context itself.

◆ wm_window_new_exec()

int wm_window_new_exec ( bContext C,
struct wmOperator op 
)

◆ wm_window_new_main_exec()

int wm_window_new_main_exec ( bContext C,
struct wmOperator op 
)

◆ wm_window_process_events()

void wm_window_process_events ( const bContext C)

◆ wm_window_raise()

void wm_window_raise ( wmWindow win)

◆ wm_window_reset_drawable()

void wm_window_reset_drawable ( void  )

◆ wm_window_set_size()

void wm_window_set_size ( wmWindow win,
int  width,
int  height 
)

Definition at line 1852 of file wm_window.c.

References GHOST_SetClientSize(), wmWindow::ghostwin, height, and width.

Referenced by WM_window_open().

◆ wm_window_set_swap_interval()

void wm_window_set_swap_interval ( wmWindow win,
int  interval 
)

Definition at line 1888 of file wm_window.c.

References GHOST_SetSwapInterval(), and wmWindow::ghostwin.

◆ wm_window_swap_buffers()

void wm_window_swap_buffers ( wmWindow win)

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().

◆ wm_window_title()

void wm_window_title ( wmWindowManager wm,
wmWindow win 
)