< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp

Print this page

        

*** 303,312 **** --- 303,316 ---- m_vmSignalled = FALSE; m_isDynamicLayoutSet = FALSE; m_areExtraMouseButtonsEnabled = TRUE; + m_isWin8OrLater = FALSE; + m_pEnableMouseInPointerHandle = NULL; + m_pGetPointerInfoHandle = NULL; + m_verifyComponents = FALSE; m_breakOnError = FALSE; m_breakMessageLoop = FALSE; m_messageLoopResult = 0;
*** 515,524 **** --- 519,543 ---- (HOOKPROC)GetMessageFilter, 0, tk.m_mainThreadId); awt_dnd_initialize(); + /* + * Initialization of the touch related variables. + */ + tk.m_isWin8OrLater = IS_WIN8; + + if (tk.m_isWin8OrLater) { + HMODULE hUser32Dll = ::LoadLibrary(_T("user32.dll")); + if (hUser32Dll != NULL) { + tk.m_pEnableMouseInPointerHandle = (EnableMouseInPointerHandleFunc) + ::GetProcAddress(hUser32Dll, "EnableMouseInPointer"); + tk.m_pGetPointerInfoHandle = (GetPointerInfoHandleFunc) + ::GetProcAddress(hUser32Dll, "GetPointerInfo"); + } + } + return TRUE; } BOOL AwtToolkit::Dispose() { DTRACE_PRINTLN("In AwtToolkit::Dispose()");
*** 539,548 **** --- 558,570 ---- AwtObjectList::Cleanup(); awt_dnd_uninitialize(); awt_clipboard_uninitialize((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2)); + m_pEnableMouseInPointerHandle = NULL; + m_pGetPointerInfoHandle = NULL; + if (tk.m_inputMethodHWnd != NULL) { ::SendMessage(tk.m_inputMethodHWnd, WM_IME_CONTROL, IMC_OPENSTATUSWINDOW, 0); } tk.m_inputMethodHWnd = NULL;
*** 2822,2826 **** --- 2844,2869 ---- } UINT AwtToolkit::GetNumberOfButtons() { return MOUSE_BUTTONS_WINDOWS_SUPPORTED; } + + bool AwtToolkit::IsWin8OrLater() { + return m_isWin8OrLater; + } + + BOOL AwtToolkit::TIEnableMouseInPointer(BOOL enable) { + if (m_pEnableMouseInPointerHandle == NULL) { + return FALSE; + } + + return m_pEnableMouseInPointerHandle(enable); + } + + BOOL AwtToolkit::TIGetPointerInfo(UINT32 pointerID, POINTER_INFO *pointerInfo) + { + if (m_pGetPointerInfoHandle == NULL) { + return FALSE; + } + + return m_pGetPointerInfoHandle(pointerID, pointerInfo); + }
< prev index next >