Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_window.c
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
| #include "GHOST_C-api.h" | #include "GHOST_C-api.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #if defined(WITH_IM_OVERTHESPOT) || defined(WITH_IM_ONTHESPOT) | |||||
| # include "BLT_lang.h" | |||||
| #endif | |||||
| #include "BKE_blender.h" | #include "BKE_blender.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_icons.h" | #include "BKE_icons.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| ▲ Show 20 Lines • Show All 2,204 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| bool WM_window_is_temp_screen(const wmWindow *win) | bool WM_window_is_temp_screen(const wmWindow *win) | ||||
| { | { | ||||
| const bScreen *screen = WM_window_get_active_screen(win); | const bScreen *screen = WM_window_get_active_screen(win); | ||||
| return (screen && screen->temp != 0); | return (screen && screen->temp != 0); | ||||
| } | } | ||||
| #ifdef WITH_IM_OVERTHESPOT | |||||
| bool WM_window_IM_is_spot_needed(wmWindow *win) | |||||
| { | |||||
| if (!BLT_lang_is_im_supported()) | |||||
| return false; | |||||
| BLI_assert(win); | |||||
| return GHOST_IsIMSpotNeeded(win->ghostwin); | |||||
| } | |||||
| #endif | |||||
| #if defined(WITH_IM_OVERTHESPOT) || defined(WITH_IM_ONTHESPOT) | |||||
| void WM_window_IM_modal_set(wmWindow *win) | |||||
| { | |||||
| if (!BLT_lang_is_im_supported()) | |||||
| return; | |||||
| BLI_assert(win); | |||||
| GHOST_SetIMModal(win->ghostwin); | |||||
| } | |||||
| #ifdef WITH_INPUT_IME | void WM_window_IM_modal_unset(wmWindow *win) | ||||
| /* note: keep in mind wm_window_IME_begin is also used to reposition the IME window */ | |||||
| void wm_window_IME_begin(wmWindow *win, int x, int y, int w, int h, bool complete) | |||||
| { | { | ||||
| if (!BLT_lang_is_im_supported()) | |||||
| return; | |||||
| BLI_assert(win); | BLI_assert(win); | ||||
| GHOST_BeginIME(win->ghostwin, x, win->sizey - y, w, h, complete); | GHOST_UnsetIMModal(win->ghostwin); | ||||
| } | } | ||||
| void wm_window_IME_end(wmWindow *win) | void WM_window_IM_spot_set(wmWindow *win, int x, int y, int h) | ||||
| { | { | ||||
| BLI_assert(win && win->ime_data); | if (!BLT_lang_is_im_supported()) | ||||
| return; | |||||
| BLI_assert(win); | |||||
| GHOST_EndIME(win->ghostwin); | GHOST_SetIMSpot(win->ghostwin, x, win->sizey - y, h); | ||||
| win->ime_data = NULL; | } | ||||
| void WM_window_IM_begin(wmWindow *win) | |||||
| { | |||||
| if (!BLT_lang_is_im_supported()) | |||||
| return; | |||||
| BLI_assert(win); | |||||
| #ifdef WITH_IM_OVERTHESPOT | |||||
| BLI_assert(win->im_data == NULL); | |||||
| #endif | |||||
| GHOST_BeginIM(win->ghostwin); | |||||
| } | |||||
| void WM_window_IM_end(wmWindow *win) | |||||
| { | |||||
| if (!BLT_lang_is_im_supported()) | |||||
| return; | |||||
| BLI_assert(win); | |||||
| #ifdef WITH_IM_ONTHESPOT | |||||
| if (win->im_data) | |||||
| #endif | |||||
| { | |||||
| GHOST_EndIM(win->ghostwin); | |||||
| #ifdef WITH_IM_ONTHESPOT | |||||
| win->im_data = NULL; | |||||
| #endif | |||||
| } | |||||
| } | } | ||||
| #endif /* WITH_INPUT_IME */ | #endif /* defined(WITH_IM_OVERTHESPOT) || defined(WITH_IM_ONTHESPOT) */ | ||||
| /* ****** direct opengl context management ****** */ | /* ****** direct opengl context management ****** */ | ||||
| void *WM_opengl_context_create(void) | void *WM_opengl_context_create(void) | ||||
| { | { | ||||
| /* On Windows there is a problem creating contexts that share lists | /* On Windows there is a problem creating contexts that share lists | ||||
| * from one context that is current in another thread. | * from one context that is current in another thread. | ||||
| * So we should call this function only on the main thread. | * So we should call this function only on the main thread. | ||||
| Show All 23 Lines | |||||