Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_window.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| win->posy = posy; | win->posy = posy; | ||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| /** | /** | ||||
| * \param space_type: SPACE_VIEW3D, SPACE_INFO, ... (eSpace_Type) | * \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 dialog: whether this should be made as a dialog-style window | ||||
| * \param temp: whether this is considered a short-lived window | * \param temp: whether this is considered a short-lived window | ||||
| * \param alignment: how this window is positioned relative to its parent | * \param alignment: how this window is positioned relative to its parent | ||||
| * \return the window or NULL in case of failure. | * \return the window or NULL in case of failure. | ||||
| */ | */ | ||||
| wmWindow *WM_window_open(bContext *C, | wmWindow *WM_window_open(bContext *C, | ||||
| const char *title, | const char *title, | ||||
| int x, | int x, | ||||
| int y, | int y, | ||||
| int sizex, | int sizex, | ||||
| int sizey, | int sizey, | ||||
| int space_type, | int space_type, | ||||
| bool toplevel, | |||||
| bool dialog, | bool dialog, | ||||
| bool temp, | bool temp, | ||||
| WindowAlignment alignment) | WindowAlignment alignment) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| wmWindow *win_prev = CTX_wm_window(C); | wmWindow *win_prev = CTX_wm_window(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Show All 38 Lines | |||||
| } | } | ||||
| free(wintitle); | free(wintitle); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* add new window? */ | /* add new window? */ | ||||
| if (win == NULL) { | if (win == NULL) { | ||||
| win = wm_window_new(bmain, wm, win_prev, dialog); | win = wm_window_new(bmain, wm, toplevel ? NULL : win_prev, dialog); | ||||
| win->posx = rect.xmin; | win->posx = rect.xmin; | ||||
| win->posy = rect.ymin; | win->posy = rect.ymin; | ||||
| *win->stereo3d_format = *win_prev->stereo3d_format; | *win->stereo3d_format = *win_prev->stereo3d_format; | ||||
| } | } | ||||
| bScreen *screen = WM_window_get_active_screen(win); | bScreen *screen = WM_window_get_active_screen(win); | ||||
| win->sizex = BLI_rcti_size_x(&rect); | win->sizex = BLI_rcti_size_x(&rect); | ||||
| ▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
| IFACE_("Blender"), | IFACE_("Blender"), | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| win_src->sizex * 0.95f, | win_src->sizex * 0.95f, | ||||
| win_src->sizey * 0.9f, | win_src->sizey * 0.9f, | ||||
| area->spacetype, | area->spacetype, | ||||
| false, | false, | ||||
| false, | false, | ||||
| false, | |||||
| WIN_ALIGN_PARENT_CENTER) != NULL); | WIN_ALIGN_PARENT_CENTER) != NULL); | ||||
| return ok ? OPERATOR_FINISHED : OPERATOR_CANCELLED; | return ok ? OPERATOR_FINISHED : OPERATOR_CANCELLED; | ||||
| } | } | ||||
| int wm_window_new_main_exec(bContext *C, wmOperator *UNUSED(op)) | int wm_window_new_main_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| wmWindow *win_src = CTX_wm_window(C); | wmWindow *win_src = CTX_wm_window(C); | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||