Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_window.c
| Show First 20 Lines • Show All 801 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| wmWindow *win_prev = CTX_wm_window(C); | wmWindow *win_prev = CTX_wm_window(C); | ||||
| wmWindow *win; | wmWindow *win; | ||||
| bScreen *screen; | bScreen *screen; | ||||
| ScrArea *sa; | ScrArea *sa; | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| eSpace_Type space_type = SPACE_EMPTY; | |||||
| const char *title; | const char *title; | ||||
| /* convert to native OS window coordinates */ | /* convert to native OS window coordinates */ | ||||
| const float native_pixel_size = GHOST_GetNativePixelSize(win_prev->ghostwin); | const float native_pixel_size = GHOST_GetNativePixelSize(win_prev->ghostwin); | ||||
| x /= native_pixel_size; | x /= native_pixel_size; | ||||
| y /= native_pixel_size; | y /= native_pixel_size; | ||||
| sizex /= native_pixel_size; | sizex /= native_pixel_size; | ||||
| sizey /= native_pixel_size; | sizey /= native_pixel_size; | ||||
| ▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | wmWindow *WM_window_open_temp(bContext *C, int x, int y, int sizex, int sizey, int type) | ||||
| * to avoid having to take into account a partially-created window. | * to avoid having to take into account a partially-created window. | ||||
| */ | */ | ||||
| /* ensure it shows the right spacetype editor */ | /* ensure it shows the right spacetype editor */ | ||||
| sa = screen->areabase.first; | sa = screen->areabase.first; | ||||
| CTX_wm_area_set(C, sa); | CTX_wm_area_set(C, sa); | ||||
| if (type == WM_WINDOW_RENDER) { | if (type == WM_WINDOW_RENDER) { | ||||
| ED_area_newspace(C, sa, SPACE_IMAGE, false); | space_type = SPACE_IMAGE; | ||||
| } | } | ||||
| else if (type == WM_WINDOW_DRIVERS) { | else if (type == WM_WINDOW_DRIVERS) { | ||||
| ED_area_newspace(C, sa, SPACE_GRAPH, false); | space_type = SPACE_GRAPH; | ||||
| } | |||||
| else if (type == WM_WINDOW_USERPREFS) { | |||||
| space_type = SPACE_USERPREF; | |||||
| } | |||||
| else if (type == WM_WINDOW_FILESEL) { | |||||
| space_type = SPACE_FILE; | |||||
| } | } | ||||
| else if (type == WM_WINDOW_INFO) { | else if (type == WM_WINDOW_INFO) { | ||||
| ED_area_newspace(C, sa, SPACE_INFO, false); | ED_area_newspace(C, sa, SPACE_INFO, false); | ||||
| } | } | ||||
| else { | else { | ||||
| ED_area_newspace(C, sa, SPACE_USERPREF, false); | BLI_assert(false); | ||||
| } | } | ||||
| ED_area_newspace(C, sa, space_type, false); | |||||
| ED_screen_change(C, screen); | ED_screen_change(C, screen); | ||||
| ED_screen_refresh(CTX_wm_manager(C), win); /* test scale */ | ED_screen_refresh(CTX_wm_manager(C), win); /* test scale */ | ||||
| /* do additional setup for specific editor type */ | /* do additional setup for specific editor type */ | ||||
| if (type == WM_WINDOW_DRIVERS) { | if (type == WM_WINDOW_DRIVERS) { | ||||
| ED_drivers_editor_init(C, sa); | ED_drivers_editor_init(C, sa); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,526 Lines • Show Last 20 Lines | |||||