Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_window.c')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c100
1 files changed, 6 insertions, 94 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 5f684a752d8..29c9f53f735 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -136,8 +136,6 @@ static struct WMInitStruct {
static void wm_window_set_drawable(wmWindowManager *wm, wmWindow *win, bool activate);
static bool wm_window_timer(const bContext *C);
-/* XXX this one should correctly check for apple top header...
- * done for Cocoa : returns window contents (and not frame) max size. */
void wm_get_screensize(int *r_width, int *r_height)
{
unsigned int uiwidth;
@@ -148,7 +146,6 @@ void wm_get_screensize(int *r_width, int *r_height)
*r_height = uiheight;
}
-/* size of all screens (desktop), useful since the mouse is bound by this */
void wm_get_desktopsize(int *r_width, int *r_height)
{
unsigned int uiwidth;
@@ -198,8 +195,6 @@ static void wm_ghostwindow_destroy(wmWindowManager *wm, wmWindow *win)
}
}
-/* including window itself, C can be NULL.
- * ED_screen_exit should have been called */
void wm_window_free(bContext *C, wmWindowManager *wm, wmWindow *win)
{
/* update context */
@@ -260,7 +255,6 @@ static int find_free_winid(wmWindowManager *wm)
return id;
}
-/* don't change context itself */
wmWindow *wm_window_new(const Main *bmain, wmWindowManager *wm, wmWindow *parent, bool dialog)
{
wmWindow *win = MEM_callocN(sizeof(wmWindow), "window");
@@ -276,7 +270,6 @@ wmWindow *wm_window_new(const Main *bmain, wmWindowManager *wm, wmWindow *parent
return win;
}
-/* part of wm_window.c api */
wmWindow *wm_window_copy(Main *bmain,
wmWindowManager *wm,
wmWindow *win_src,
@@ -307,10 +300,6 @@ wmWindow *wm_window_copy(Main *bmain,
return win_dst;
}
-/**
- * A higher level version of copy that tests the new window can be added.
- * (called from the operator directly)
- */
wmWindow *wm_window_copy_test(bContext *C,
wmWindow *win_src,
const bool duplicate_layout,
@@ -353,13 +342,6 @@ static void wm_confirm_quit(bContext *C)
wm_close_file_dialog(C, action);
}
-/**
- * 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.
- *
- * \param win: The window to show the confirmation popup/window in.
- */
void wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win)
{
wmWindow *win_ctx = CTX_wm_window(C);
@@ -387,7 +369,6 @@ void wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win)
/** \} */
-/* this is event from ghost, or exit-blender op */
void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
{
wmWindow *win_other;
@@ -447,13 +428,14 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win)
}
else if (win->ghostwin) {
/* this is set to 1 if you don't have startup.blend open */
- if (G.save_over && BKE_main_blendfile_path_from_global()[0]) {
- char str[sizeof(((Main *)NULL)->name) + 24];
+ const char *blendfile_path = BKE_main_blendfile_path_from_global();
+ if (blendfile_path[0] != '\0') {
+ char str[sizeof(((Main *)NULL)->filepath) + 24];
BLI_snprintf(str,
sizeof(str),
"Blender%s [%s%s]",
wm->file_saved ? "" : "*",
- BKE_main_blendfile_path_from_global(),
+ blendfile_path,
G_MAIN->recovered ? " (Recovered)" : "");
GHOST_SetTitle(win->ghostwin, str);
}
@@ -679,19 +661,6 @@ static void wm_window_ghostwindow_ensure(wmWindowManager *wm, wmWindow *win, boo
ED_screen_global_areas_refresh(win);
}
-/**
- * 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.
- *
- * \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.
- */
void wm_window_ghostwindows_ensure(wmWindowManager *wm)
{
BLI_assert(G.background == false);
@@ -715,10 +684,6 @@ void wm_window_ghostwindows_ensure(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.
- */
void wm_window_ghostwindows_remove_invalid(bContext *C, wmWindowManager *wm)
{
BLI_assert(G.background == false);
@@ -756,14 +721,6 @@ static bool wm_window_update_size_position(wmWindow *win)
return false;
}
-/**
- * \param space_type: SPACE_VIEW3D, SPACE_INFO, ... (eSpace_Type)
- * \param toplevel: Not a child owned by other windows. A peer of main window.
- * \param dialog: whether this should be made as a dialog-style window
- * \param temp: whether this is considered a short-lived window
- * \param alignment: how this window is positioned relative to its parent
- * \return the window or NULL in case of failure.
- */
wmWindow *WM_window_open(bContext *C,
const char *title,
int x,
@@ -952,7 +909,6 @@ int wm_window_new_main_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-/* fullscreen operator callback */
int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
wmWindow *window = CTX_wm_window(C);
@@ -1083,7 +1039,6 @@ void wm_window_make_drawable(wmWindowManager *wm, wmWindow *win)
}
}
-/* Reset active the current window opengl drawing context. */
void wm_window_reset_drawable(void)
{
BLI_assert(BLI_thread_is_main());
@@ -1585,10 +1540,6 @@ void wm_window_process_events(const bContext *C)
/** \name Ghost Init/Exit
* \{ */
-/**
- * \note #bContext can be null in background mode because we don't
- * need to event handling.
- */
void wm_ghost_init(bContext *C)
{
if (!g_system) {
@@ -1627,7 +1578,6 @@ void wm_ghost_exit(void)
/** \name Event Timer
* \{ */
-/* to (de)activate running timers temporary */
void WM_event_timer_sleep(wmWindowManager *wm,
wmWindow *UNUSED(win),
wmTimer *timer,
@@ -1769,19 +1719,11 @@ static char *wm_clipboard_text_get_ex(bool selection, int *r_len, bool firstline
return newbuf;
}
-/**
- * Return text from the clipboard.
- *
- * \note Caller needs to check for valid utf8 if this is a requirement.
- */
char *WM_clipboard_text_get(bool selection, int *r_len)
{
return wm_clipboard_text_get_ex(selection, r_len, false);
}
-/**
- * Convenience function for pasting to areas of Blender which don't support newlines.
- */
char *WM_clipboard_text_get_firstline(bool selection, int *r_len)
{
return wm_clipboard_text_get_ex(selection, r_len, true);
@@ -1890,9 +1832,6 @@ void wm_window_raise(wmWindow *win)
/** \name Window Buffers
* \{ */
-/**
- * \brief Push rendered buffer to the screen.
- */
void wm_window_swap_buffers(wmWindow *win)
{
GHOST_SwapWindowBuffers(win->ghostwin);
@@ -1913,6 +1852,7 @@ bool wm_window_get_swap_interval(wmWindow *win, int *intervalOut)
/* -------------------------------------------------------------------- */
/** \name Find Window Utility
* \{ */
+
static void wm_window_desktop_pos_get(const wmWindow *win,
const int screen_pos[2],
int r_desk_pos[2])
@@ -2034,7 +1974,6 @@ uint *WM_window_pixels_read(wmWindowManager *wm, wmWindow *win, int r_size[2])
/** \name Initial Window State API
* \{ */
-/* called whem no ghost system was initialized */
void WM_init_state_size_set(int stax, int stay, int sizx, int sizy)
{
wm_init_state.start_x = stax; /* left hand pos */
@@ -2044,7 +1983,6 @@ void WM_init_state_size_set(int stax, int stay, int sizx, int sizy)
wm_init_state.override_flag |= WIN_OVERRIDE_GEOM;
}
-/* for borderless and border windows set from command-line */
void WM_init_state_fullscreen_set(void)
{
wm_init_state.windowstate = GHOST_kWindowStateFullScreen;
@@ -2097,7 +2035,6 @@ void WM_init_tablet_api(void)
}
}
-/* This function requires access to the GHOST_SystemHandle (g_system) */
void WM_cursor_warp(wmWindow *win, int x, int y)
{
if (win && win->ghostwin) {
@@ -2114,9 +2051,6 @@ void WM_cursor_warp(wmWindow *win, int x, int y)
}
}
-/**
- * Set x, y to values we can actually position the cursor to.
- */
void WM_cursor_compatible_xy(wmWindow *win, int *x, int *y)
{
float f = GHOST_GetNativePixelSize(win->ghostwin);
@@ -2132,11 +2066,6 @@ void WM_cursor_compatible_xy(wmWindow *win, int *x, int *y)
/** \name Window Size (public)
* \{ */
-/**
- * Support for native pixel size
- *
- * \note macOS retina opens window in size X, but it has up to 2 x more pixels.
- */
int WM_window_pixels_x(const wmWindow *win)
{
float f = GHOST_GetNativePixelSize(win->ghostwin);
@@ -2150,17 +2079,10 @@ int WM_window_pixels_y(const wmWindow *win)
return (int)(f * (float)win->sizey);
}
-/**
- * Get boundaries usable by all window contents, including global areas.
- */
void WM_window_rect_calc(const wmWindow *win, rcti *r_rect)
{
BLI_rcti_init(r_rect, 0, WM_window_pixels_x(win), 0, WM_window_pixels_y(win));
}
-/**
- * Get boundaries usable by screen-layouts, excluding global areas.
- * \note Depends on U.dpi_fac. Should that be outdated, call #WM_window_set_dpi first.
- */
void WM_window_screen_rect_calc(const wmWindow *win, rcti *r_rect)
{
rcti window_rect, screen_rect;
@@ -2210,11 +2132,6 @@ bool WM_window_is_maximized(const wmWindow *win)
/** \name Window Screen/Scene/WorkSpaceViewLayer API
* \{ */
-/**
- * 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.
- */
void WM_windows_scene_data_sync(const ListBase *win_lb, Scene *scene)
{
LISTBASE_FOREACH (wmWindow *, win, win_lb) {
@@ -2261,9 +2178,6 @@ Scene *WM_window_get_active_scene(const wmWindow *win)
return win->scene;
}
-/**
- * \warning Only call outside of area/region loops
- */
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
{
wmWindowManager *wm = CTX_wm_manager(C);
@@ -2376,9 +2290,6 @@ void WM_window_set_active_layout(wmWindow *win, WorkSpace *workspace, WorkSpaceL
BKE_workspace_active_layout_set(win->workspace_hook, win->winid, workspace, layout);
}
-/**
- * Get the active screen of the active workspace in \a win.
- */
bScreen *WM_window_get_active_screen(const wmWindow *win)
{
const WorkSpace *workspace = WM_window_get_active_workspace(win);
@@ -2481,4 +2392,5 @@ void WM_ghost_show_message_box(const char *title,
BLI_assert(g_system);
GHOST_ShowMessageBox(g_system, title, message, help_label, continue_label, link, dialog_options);
}
+
/** \} */