18#ifdef WITH_OPENGL_BACKEND
21#ifdef WITH_VULKAN_BACKEND
34#include <propvarutil.h>
36#include <shellscalingapi.h>
40#ifndef GET_POINTERID_WPARAM
41# define GET_POINTERID_WPARAM(wParam) (LOWORD(wParam))
44const wchar_t *GHOST_WindowWin32::s_windowClassName =
L"GHOST_WindowClass";
45const int GHOST_WindowWin32::s_maxTitleLength = 128;
49__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
60 bool wantStereoVisual,
67 m_mousePresent(
false),
68 m_inLiveResize(
false),
70 m_dropTarget(nullptr),
74 m_preferred_device(preferred_device),
75 m_hasMouseCaptured(
false),
76 m_hasGrabMouse(
false),
79 m_wantAlphaBackground(alphaBackground),
84 m_user32(::LoadLibrary(
"user32.dll")),
85 m_parentWindowHwnd(parentwindow ? parentwindow->m_hWnd : HWND_DESKTOP),
86 m_directManipulationHelper(nullptr),
87 m_debug_context(is_debug)
89 DWORD style = parentwindow ?
90 WS_POPUPWINDOW | WS_CAPTION | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX :
98 DWORD extended_style = parentwindow ? WS_EX_APPWINDOW : 0;
107 RECT win_rect = {
left,
top, long(left + width), long(top + height)};
111 m_hWnd = ::CreateWindowExW(extended_style,
117 win_rect.right - win_rect.left,
118 win_rect.bottom - win_rect.top,
121 ::GetModuleHandle(0),
125 if (m_hWnd ==
nullptr) {
129 registerWindowAppUserModelProperties();
132 m_hDC = ::GetDC(m_hWnd);
135 const char *title =
"Blender - Unsupported Graphics Card Configuration";
136 const char *text =
"";
138 if (strncmp(
BLI_getenv(
"PROCESSOR_IDENTIFIER"),
"ARM", 3) == 0 &&
142 "A driver with support for OpenGL 4.3 or higher is required.\n\n"
143 "Qualcomm devices require the \"OpenCL™, OpenGL®, and Vulkan® Compatibility Pack\" "
144 "from the Microsoft Store.\n\n"
145 "Devices using processors older than a Qualcomm Snapdragon 8cx Gen3 are incompatible, "
146 "but may be able to run an emulated x64 copy of Blender, such as a 3.x LTS release.";
152 "A graphics card and driver with support for OpenGL 4.3 or higher is "
153 "required.\n\nInstalling the latest driver for your graphics card might resolve the "
155 if (GetSystemMetrics(SM_CMONITORS) > 1) {
157 "A graphics card and driver with support for OpenGL 4.3 or higher is "
158 "required.\n\nPlugging all monitors into your primary graphics card might resolve "
159 "this issue. Installing the latest driver for your graphics card could also help.";
162 MessageBox(m_hWnd, text, title, MB_OK | MB_ICONERROR);
163 ::ReleaseDC(m_hWnd, m_hDC);
164 ::DestroyWindow(m_hWnd);
172 RegisterTouchWindow(m_hWnd, 0);
176 ::RegisterDragDrop(m_hWnd, m_dropTarget);
179 ::SetWindowLongPtr(m_hWnd, GWLP_USERDATA, (LONG_PTR)
this);
183 ::SetWindowPos(m_hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
196 nCmdShow = SW_SHOWMAXIMIZED;
199 nCmdShow = (m_system->
m_windowFocus) ? SW_SHOWMINIMIZED : SW_SHOWMINNOACTIVE;
203 nCmdShow = (m_system->
m_windowFocus) ? SW_SHOWNORMAL : SW_SHOWNOACTIVATE;
209 ::ShowWindow(m_hWnd, nCmdShow);
211#ifdef WIN32_COMPOSITING
212 if (alphaBackground && parentwindowhwnd == 0) {
217 DWM_BLURBEHIND bb = {0};
220 bb.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION;
222 bb.hRgnBlur = CreateRectRgn(0, 0, -1, -1);
225 hr = DwmEnableBlurBehindWindow(m_hWnd, &bb);
226 DeleteObject(bb.hRgnBlur);
237 CLSID_TaskbarList,
nullptr, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (LPVOID *)&m_Bar);
245 if (!m_directManipulationHelper) {
249 m_directManipulationHelper->
update();
256 if (!m_directManipulationHelper) {
261 POINTER_INPUT_TYPE pointerType;
262 if (GetPointerType(pointerId, &pointerType) && pointerType == PT_TOUCHPAD) {
269 if (!m_directManipulationHelper) {
279 unregisterWindowAppUserModelProperties();
291 FreeLibrary(m_user32);
295 if (m_customCursor) {
296 DestroyCursor(m_customCursor);
297 m_customCursor =
nullptr;
301 ::ReleaseDC(m_hWnd, m_hDC);
310 if (iter_winwin->m_parentWindowHwnd == m_hWnd) {
311 ::SetWindowLongPtr(iter_winwin->m_hWnd, GWLP_HWNDPARENT, 0);
312 iter_winwin->m_parentWindowHwnd = 0;
318 RevokeDragDrop(m_hWnd);
321 m_dropTarget =
nullptr;
323 ::SetWindowLongPtr(m_hWnd, GWLP_USERDATA, 0);
324 ::DestroyWindow(m_hWnd);
328 delete m_directManipulationHelper;
329 m_directManipulationHelper =
nullptr;
337 HMONITOR hmonitor = MonitorFromRect(win_rect, MONITOR_DEFAULTTONEAREST);
338 MONITORINFOEX monitor;
339 monitor.cbSize =
sizeof(MONITORINFOEX);
341 GetMonitorInfo(hmonitor, &monitor);
344 LONG width =
min(monitor.rcWork.right - monitor.rcWork.left, win_rect->right - win_rect->left);
345 LONG height =
min(monitor.rcWork.bottom - monitor.rcWork.top, win_rect->bottom - win_rect->top);
346 win_rect->left =
min(
max(monitor.rcWork.left, win_rect->left), monitor.rcWork.right - width);
347 win_rect->right = win_rect->left + width;
348 win_rect->top =
min(
max(monitor.rcWork.top, win_rect->top), monitor.rcWork.bottom - height);
349 win_rect->bottom = win_rect->top + height;
355 m_user32,
"AdjustWindowRectExForDpi");
360 if (fpAdjustWindowRectExForDpi) {
362 GetDpiForMonitor(hmonitor, MDT_EFFECTIVE_DPI, &dpiX, &dpiY);
363 fpAdjustWindowRectExForDpi(win_rect, dwStyle & ~WS_OVERLAPPED,
FALSE, dwExStyle, dpiX);
366 AdjustWindowRectEx(win_rect, dwStyle & ~WS_OVERLAPPED,
FALSE, dwExStyle);
370 win_rect->top =
max(monitor.rcWork.top, win_rect->top);
385 return (
void *)m_hWnd;
391 ::SetWindowTextW(m_hWnd, (
wchar_t *)title_16);
397 std::wstring wtitle(::GetWindowTextLengthW(m_hWnd) + 1,
L'\0');
398 ::GetWindowTextW(m_hWnd, &wtitle[0], wtitle.capacity());
409 ::GetWindowRect(m_hWnd, &rect);
420 if (!IsIconic(m_hWnd)) {
421 ::GetClientRect(m_hWnd, &rect);
425 ::ClientToScreen(m_hWnd, &coord);
430 coord.x = rect.right;
431 coord.y = rect.bottom;
432 ::ClientToScreen(m_hWnd, &coord);
454 success = ::SetWindowPos(m_hWnd, HWND_TOP, 0, 0, cx, cy, SWP_NOMOVE | SWP_NOZORDER) ?
473 success = ::SetWindowPos(m_hWnd, HWND_TOP, 0, 0, cx, cy, SWP_NOMOVE | SWP_NOZORDER) ?
492 success = ::SetWindowPos(m_hWnd, HWND_TOP, 0, 0, cx, cy, SWP_NOMOVE | SWP_NOZORDER) ?
504 if (::IsIconic(m_hWnd)) {
507 else if (::IsZoomed(m_hWnd)) {
508 LONG_PTR result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE);
519 POINT point = {inX, inY};
520 ::ScreenToClient(m_hWnd, &point);
530 POINT point = {inX, inY};
531 ::ClientToScreen(m_hWnd, &point);
539 LONG_PTR style = GetWindowLongPtr(m_hWnd, GWL_STYLE) | WS_CAPTION;
541 wp.length =
sizeof(WINDOWPLACEMENT);
542 ::GetWindowPlacement(m_hWnd, &wp);
546 wp.showCmd = SW_MINIMIZE;
549 wp.showCmd = SW_SHOWMAXIMIZED;
553 m_normal_state = curstate;
555 wp.showCmd = SW_SHOWMAXIMIZED;
556 wp.ptMaxPosition.x = 0;
557 wp.ptMaxPosition.y = 0;
558 style &= ~(WS_CAPTION | WS_MAXIMIZE);
565 wp.showCmd = SW_SHOWMAXIMIZED;
569 wp.showCmd = SW_SHOWNORMAL;
573 ::SetWindowLongPtr(m_hWnd, GWL_STYLE, style);
576 ::SetWindowPos(m_hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
582 HWND hWndInsertAfter, hWndToRaise;
585 hWndInsertAfter = HWND_BOTTOM;
586 hWndToRaise = ::GetWindow(m_hWnd, GW_HWNDNEXT);
592 hWndInsertAfter = HWND_TOP;
593 hWndToRaise =
nullptr;
596 if (::SetWindowPos(m_hWnd, hWndInsertAfter, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) ==
FALSE) {
601 ::SetWindowPos(hWndToRaise, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) ==
FALSE)
623#ifdef WITH_VULKAN_BACKEND
624 case GHOST_kDrawingContextTypeVulkan: {
626 false, m_hWnd, 1, 2, m_debug_context, m_preferred_device);
627 if (context->initializeDrawingContext()) {
635#ifdef WITH_OPENGL_BACKEND
636 case GHOST_kDrawingContextTypeOpenGL: {
637 for (
int minor = 6; minor >= 3; --minor) {
640 m_wantAlphaBackground,
643 WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
646 (m_debug_context ? WGL_CONTEXT_DEBUG_BIT_ARB : 0),
649 if (context->initializeDrawingContext()) {
658 case GHOST_kDrawingContextTypeD3D: {
661 if (context->initializeDrawingContext()) {
676 if (m_hasMouseCaptured) {
677 m_hasGrabMouse =
false;
678 m_nPressedButtons = 0;
679 m_hasMouseCaptured =
false;
695 if (m_nPressedButtons) {
700 m_hasGrabMouse =
true;
703 m_hasGrabMouse =
false;
707 if (!m_nPressedButtons && !m_hasGrabMouse && m_hasMouseCaptured) {
709 m_hasMouseCaptured =
false;
711 else if ((m_nPressedButtons || m_hasGrabMouse) && !m_hasMouseCaptured) {
712 ::SetCapture(m_hWnd);
713 m_hasMouseCaptured =
true;
720 HANDLE cursor =
nullptr;
721 HMODULE
module = ::GetModuleHandle(0);
722 uint32_t flags = LR_SHARED | LR_DEFAULTSIZE;
727 if (m_customCursor) {
728 return m_customCursor;
734 cursor = ::LoadImage(
module,
"arrowright_cursor", IMAGE_CURSOR, cx, cy, flags);
737 cursor = ::LoadImage(
module,
"arrowleft_cursor", IMAGE_CURSOR, cx, cy, flags);
740 cursor = ::LoadImage(
module,
"arrowup_cursor", IMAGE_CURSOR, cx, cy, flags);
743 cursor = ::LoadImage(
module,
"arrowdown_cursor", IMAGE_CURSOR, cx, cy, flags);
746 cursor = ::LoadImage(
module,
"splitv_cursor", IMAGE_CURSOR, cx, cy, flags);
749 cursor = ::LoadImage(
module,
"splith_cursor", IMAGE_CURSOR, cx, cy, flags);
752 cursor = ::LoadImage(
module,
"knife_cursor", IMAGE_CURSOR, cx, cy, flags);
755 cursor = ::LoadImage(
module,
"eyedropper_cursor", IMAGE_CURSOR, cx, cy, flags);
758 cursor = ::LoadImage(
module,
"zoomin_cursor", IMAGE_CURSOR, cx, cy, flags);
761 cursor = ::LoadImage(
module,
"zoomout_cursor", IMAGE_CURSOR, cx, cy, flags);
764 cursor = ::LoadImage(
nullptr, IDC_SIZEALL, IMAGE_CURSOR, cx, cy, flags);
767 cursor = ::LoadImage(
module,
"handopen_cursor", IMAGE_CURSOR, cx, cy, flags);
770 cursor = ::LoadImage(
module,
"handclosed_cursor", IMAGE_CURSOR, cx, cy, flags);
773 cursor = ::LoadImage(
module,
"handpoint_cursor", IMAGE_CURSOR, cx, cy, flags);
776 cursor = ::LoadImage(
module,
"scrollnsew_cursor", IMAGE_CURSOR, cx, cy, flags);
779 cursor = ::LoadImage(
module,
"scrollns_cursor", IMAGE_CURSOR, cx, cy, flags);
782 cursor = ::LoadImage(
module,
"scrollew_cursor", IMAGE_CURSOR, cx, cy, flags);
785 cursor = ::LoadImage(
nullptr, IDC_HELP, IMAGE_CURSOR, cx, cy, flags);
788 cursor = ::LoadImage(
nullptr, IDC_WAIT, IMAGE_CURSOR, cx, cy, flags);
791 cursor = ::LoadImage(
nullptr, IDC_IBEAM, IMAGE_CURSOR, cx, cy, flags);
794 cursor = ::LoadImage(
module,
"cross_cursor", IMAGE_CURSOR, cx, cy, flags);
797 cursor = ::LoadImage(
module,
"crossA_cursor", IMAGE_CURSOR, cx, cy, flags);
800 cursor = ::LoadImage(
module,
"crossB_cursor", IMAGE_CURSOR, cx, cy, flags);
803 cursor = ::LoadImage(
module,
"crossC_cursor", IMAGE_CURSOR, cx, cy, flags);
807 cursor = ::LoadImage(
module,
"movens_cursor", IMAGE_CURSOR, cx, cy, flags);
811 cursor = ::LoadImage(
module,
"moveew_cursor", IMAGE_CURSOR, cx, cy, flags);
814 cursor = ::LoadImage(
nullptr, IDC_UPARROW, IMAGE_CURSOR, cx, cy, flags);
817 cursor = ::LoadImage(
nullptr, IDC_SIZENWSE, IMAGE_CURSOR, cx, cy, flags);
820 cursor = ::LoadImage(
nullptr, IDC_SIZENESW, IMAGE_CURSOR, cx, cy, flags);
823 cursor = ::LoadImage(
nullptr, IDC_SIZENWSE, IMAGE_CURSOR, cx, cy, flags);
826 cursor = ::LoadImage(
nullptr, IDC_SIZENESW, IMAGE_CURSOR, cx, cy, flags);
829 cursor = ::LoadImage(
module,
"pencil_cursor", IMAGE_CURSOR, cx, cy, flags);
832 cursor = ::LoadImage(
module,
"eraser_cursor", IMAGE_CURSOR, cx, cy, flags);
836 cursor = ::LoadImage(
module,
"forbidden_cursor", IMAGE_CURSOR, cx, cy, flags);
839 cursor = ::LoadImage(
module,
"handle_left_cursor", IMAGE_CURSOR, cx, cy, flags);
842 cursor = ::LoadImage(
module,
"handle_right_cursor", IMAGE_CURSOR, cx, cy, flags);
845 cursor = ::LoadImage(
module,
"handle_both_cursor", IMAGE_CURSOR, cx, cy, flags);
855 if (cursor ==
nullptr) {
856 cursor = ::LoadImage(
nullptr, IDC_ARROW, IMAGE_CURSOR, cx, cy, flags);
859 return (HCURSOR)cursor;
865 while (::ShowCursor(
FALSE) >= 0) {
870 while (::ShowCursor(TRUE) < 0) {
876 if (cursor ==
nullptr) {
882GHOST_TSuccess GHOST_WindowWin32::setWindowCursorVisibility(
bool visible)
884 if (::GetForegroundWindow() == m_hWnd) {
899 setWindowCursorVisibility(
false);
907 setWindowCursorVisibility(
true);
930 if (::GetForegroundWindow() == m_hWnd) {
943 std::vector<GHOST_PointerInfoWin32> &outPointerInfo, WPARAM wParam, LPARAM )
946 int32_t isPrimary = IS_POINTER_PRIMARY_WPARAM(wParam);
950 if (!(GetPointerPenInfoHistory(pointerId, &outCount,
nullptr))) {
954 std::vector<POINTER_PEN_INFO> pointerPenInfo(outCount);
955 outPointerInfo.resize(outCount);
957 if (!(GetPointerPenInfoHistory(pointerId, &outCount, pointerPenInfo.data()))) {
961 for (
uint32_t i = 0; i < outCount; i++) {
962 POINTER_INFO pointerApiInfo = pointerPenInfo[i].pointerInfo;
964 outPointerInfo[i].pointerId = pointerId;
965 outPointerInfo[i].isPrimary = isPrimary;
967 switch (pointerApiInfo.ButtonChangeType) {
968 case POINTER_CHANGE_FIRSTBUTTON_DOWN:
969 case POINTER_CHANGE_FIRSTBUTTON_UP:
972 case POINTER_CHANGE_SECONDBUTTON_DOWN:
973 case POINTER_CHANGE_SECONDBUTTON_UP:
976 case POINTER_CHANGE_THIRDBUTTON_DOWN:
977 case POINTER_CHANGE_THIRDBUTTON_UP:
980 case POINTER_CHANGE_FOURTHBUTTON_DOWN:
981 case POINTER_CHANGE_FOURTHBUTTON_UP:
984 case POINTER_CHANGE_FIFTHBUTTON_DOWN:
985 case POINTER_CHANGE_FIFTHBUTTON_UP:
992 outPointerInfo[i].pixelLocation = pointerApiInfo.ptPixelLocation;
994 outPointerInfo[i].tabletData.Pressure = 1.0f;
995 outPointerInfo[i].tabletData.Xtilt = 0.0f;
996 outPointerInfo[i].tabletData.Ytilt = 0.0f;
999 if (pointerPenInfo[i].penMask & PEN_MASK_PRESSURE) {
1000 outPointerInfo[i].tabletData.Pressure = pointerPenInfo[i].pressure / 1024.0f;
1003 if (pointerPenInfo[i].penFlags & PEN_FLAG_ERASER) {
1007 if (pointerPenInfo[i].penMask & PEN_MASK_TILT_X) {
1008 outPointerInfo[i].tabletData.Xtilt = fmin(
fabs(pointerPenInfo[i].tiltX / 90.0f), 1.0f);
1011 if (pointerPenInfo[i].penMask & PEN_MASK_TILT_Y) {
1012 outPointerInfo[i].tabletData.Ytilt = fmin(
fabs(pointerPenInfo[i].tiltY / 90.0f), 1.0f);
1016 if (!outPointerInfo.empty()) {
1017 m_lastPointerTabletData = outPointerInfo.back().tabletData;
1088 return m_lastPointerTabletData;
1095 DWORD pcbData =
sizeof(lightMode);
1096 if (RegGetValueW(HKEY_CURRENT_USER,
1097 L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize\\",
1098 L"AppsUseLightTheme",
1102 &pcbData) == ERROR_SUCCESS)
1104 BOOL DarkMode = !lightMode;
1109 DwmSetWindowAttribute(this->m_hWnd, 20, &DarkMode,
sizeof(DarkMode));
1115 if (m_directManipulationHelper) {
1124 m_user32,
"GetDpiForWindow");
1126 if (fpGetDpiForWindow) {
1127 return fpGetDpiForWindow(this->m_hWnd);
1131 return USER_DEFAULT_SCREEN_DPI;
1137 ch = ((ch >> 1) & 0x55) | ((ch << 1) & 0xAA);
1138 ch = ((ch >> 2) & 0x33) | ((ch << 2) & 0xCC);
1139 ch = ((ch >> 4) & 0x0F) | ((ch << 4) & 0xF0);
1147 shrt = ((shrt >> 1) & 0x5555) | ((shrt << 1) & 0xAAAA);
1148 shrt = ((shrt >> 2) & 0x3333) | ((shrt << 2) & 0xCCCC);
1149 shrt = ((shrt >> 4) & 0x0F0F) | ((shrt << 4) & 0xF0F0);
1150 shrt = ((shrt >> 8) & 0x00FF) | ((shrt << 8) & 0xFF00);
1173 if (m_customCursor) {
1174 DestroyCursor(m_customCursor);
1175 m_customCursor =
nullptr;
1178 memset(&andData, 0xFF,
sizeof(andData));
1179 memset(&xorData, 0,
sizeof(xorData));
1181 for (y = 0; y < sizeY; y++) {
1184 for (x = cols - 1; x >= 0; x--) {
1190 xorData[
y] = fullBitRow & fullMaskRow;
1191 andData[
y] = ~fullMaskRow;
1194 m_customCursor = ::CreateCursor(::GetModuleHandle(0), hotX, hotY, 32, 32, andData, xorData);
1195 if (!m_customCursor) {
1199 if (::GetForegroundWindow() == m_hWnd) {
1209 if (m_Bar && S_OK == m_Bar->
SetProgressValue(m_hWnd, 10000 * progress, 10000)) {
1225#ifdef WITH_INPUT_IME
1228 m_imeInput.BeginIME(m_hWnd,
GHOST_Rect(x, y - h, x, y), completed);
1231void GHOST_WindowWin32::endIME()
1233 m_imeInput.EndIME(m_hWnd);
1237void GHOST_WindowWin32::registerWindowAppUserModelProperties()
1239 IPropertyStore *pstore;
1240 char blender_path[MAX_PATH];
1241 wchar_t shell_command[MAX_PATH];
1244 GetModuleFileName(0, blender_path,
sizeof(blender_path));
1245 char *blender_app = strstr(blender_path,
"blender.exe");
1250 HRESULT hr = SHGetPropertyStoreForWindow(m_hWnd, IID_PPV_ARGS(&pstore));
1251 if (!SUCCEEDED(hr)) {
1257 strcpy(blender_app,
"blender-launcher.exe");
1258 wsprintfW(shell_command,
L"\"%S\"", blender_path);
1261 PROPVARIANT propvar;
1262 hr = InitPropVariantFromString(BLENDER_WIN_APPID_16, &propvar);
1263 hr = pstore->SetValue(PKEY_AppUserModel_ID, propvar);
1264 hr = InitPropVariantFromString(shell_command, &propvar);
1265 hr = pstore->SetValue(PKEY_AppUserModel_RelaunchCommand, propvar);
1266 hr = InitPropVariantFromString(BLENDER_WIN_APPID_FRIENDLY_NAME_16, &propvar);
1267 hr = pstore->SetValue(PKEY_AppUserModel_RelaunchDisplayNameResource, propvar);
1275void GHOST_WindowWin32::unregisterWindowAppUserModelProperties()
1277 IPropertyStore *pstore;
1278 HRESULT hr = SHGetPropertyStoreForWindow(m_hWnd, IID_PPV_ARGS(&pstore));
1279 if (SUCCEEDED(hr)) {
1281 PropVariantInit(&value);
1282 pstore->SetValue(PKEY_AppUserModel_ID, value);
1283 pstore->SetValue(PKEY_AppUserModel_RelaunchCommand, value);
1284 pstore->SetValue(PKEY_AppUserModel_RelaunchDisplayNameResource, value);
void BLI_kdtree_nd_ free(KDTree *tree)
const char * BLI_getenv(const char *env) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
#define GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY
const GUID CLSID_TaskbarList
@ GHOST_kWindowStateMinimized
@ GHOST_kWindowStateMaximized
@ GHOST_kWindowStateNormal
@ GHOST_kWindowStateFullScreen
@ GHOST_kStandardCursorLeftHandle
@ GHOST_kStandardCursorHandClosed
@ GHOST_kStandardCursorHandOpen
@ GHOST_kStandardCursorBottomLeftCorner
@ GHOST_kStandardCursorZoomIn
@ GHOST_kStandardCursorVerticalSplit
@ GHOST_kStandardCursorHelp
@ GHOST_kStandardCursorWait
@ GHOST_kStandardCursorRightHandle
@ GHOST_kStandardCursorHorizontalSplit
@ GHOST_kStandardCursorTopSide
@ GHOST_kStandardCursorStop
@ GHOST_kStandardCursorCrosshair
@ GHOST_kStandardCursorCustom
@ GHOST_kStandardCursorNSEWScroll
@ GHOST_kStandardCursorLeftRight
@ GHOST_kStandardCursorPencil
@ GHOST_kStandardCursorNSScroll
@ GHOST_kStandardCursorCrosshairA
@ GHOST_kStandardCursorUpDown
@ GHOST_kStandardCursorUpArrow
@ GHOST_kStandardCursorHandPoint
@ GHOST_kStandardCursorBottomSide
@ GHOST_kStandardCursorBothHandles
@ GHOST_kStandardCursorTopLeftCorner
@ GHOST_kStandardCursorEyedropper
@ GHOST_kStandardCursorKnife
@ GHOST_kStandardCursorMove
@ GHOST_kStandardCursorCrosshairB
@ GHOST_kStandardCursorBottomRightCorner
@ GHOST_kStandardCursorDownArrow
@ GHOST_kStandardCursorEraser
@ GHOST_kStandardCursorDefault
@ GHOST_kStandardCursorEWScroll
@ GHOST_kStandardCursorRightArrow
@ GHOST_kStandardCursorTopRightCorner
@ GHOST_kStandardCursorDestroy
@ GHOST_kStandardCursorCrosshairC
@ GHOST_kStandardCursorZoomOut
@ GHOST_kStandardCursorLeftSide
@ GHOST_kStandardCursorText
@ GHOST_kStandardCursorLeftArrow
static const GHOST_TabletData GHOST_TABLET_DATA_NONE
@ GHOST_kTabletModeEraser
@ GHOST_kTabletModeStylus
GHOST_TDrawingContextType
@ GHOST_kWindowOrderBottom
@ GHOST_kButtonMaskButton4
@ GHOST_kButtonMaskButton5
@ GHOST_kButtonMaskMiddle
@ GHOST_kTabletWinPointer
static uint16_t uns16ReverseBits(uint16_t shrt)
#define GET_POINTERID_WPARAM(wParam)
static uint8_t uns8ReverseBits(uint8_t ch)
__declspec(dllexport) DWORD NvOptimusEnablement=0x00000001
UINT(API * GHOST_WIN32_GetDpiForWindow)(HWND)
BOOL(API * GHOST_WIN32_AdjustWindowRectExForDpi)(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle, UINT dpi)
GHOST_MouseCaptureEventWin32
#define WINTAB_PRINTF(x,...)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
void setDPI(uint16_t dpi)
void onPointerHitTest(UINT32 pointerId)
static GHOST_DirectManipulationHelper * create(HWND hWnd, uint16_t dpi)
GHOST_TTrackpadInfo getTrackpadInfo()
ULONG __stdcall Release()
static GHOST_ISystem * getSystem()
virtual bool isInside(int32_t x, int32_t y) const
virtual int32_t getHeight() const
virtual int32_t getWidth() const
GHOST_TSuccess setCursorPosition(int32_t x, int32_t y)
GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const
uint64_t performanceCounterToMillis(__int64 perf_ticks) const
GHOST_TTabletAPI getTabletAPI()
GHOST_WindowManager * getWindowManager() const
const std::vector< GHOST_IWindow * > & getWindows() const
GHOST_TSuccess invalidate()
void resetPointerPenInfo()
GHOST_TSuccess setOrder(GHOST_TWindowOrder order)
uint16_t getDPIHint() override
GHOST_TTrackpadInfo getTrackpadInfo()
void updateDirectManipulation()
GHOST_TSuccess setProgressBar(float progress)
void setTitle(const char *title)
std::string getTitle() const
GHOST_TSuccess setClientSize(uint32_t width, uint32_t height)
void loadCursor(bool visible, GHOST_TStandardCursor cursorShape) const
bool usingTabletAPI(GHOST_TTabletAPI api) const
GHOST_TSuccess getPointerInfo(std::vector< GHOST_PointerInfoWin32 > &outPointerInfo, WPARAM wParam, LPARAM lParam)
GHOST_TSuccess setClientHeight(uint32_t height)
void loadWintab(bool enable)
GHOST_TabletData getTabletData()
GHOST_Wintab * getWintab() const
HCURSOR getStandardCursor(GHOST_TStandardCursor shape) const
void updateMouseCapture(GHOST_MouseCaptureEventWin32 event)
GHOST_TSuccess setClientWidth(uint32_t width)
GHOST_TSuccess setState(GHOST_TWindowState state)
void getWindowBounds(GHOST_Rect &bounds) const
void getClientBounds(GHOST_Rect &bounds) const
GHOST_WindowWin32(GHOST_SystemWin32 *system, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_TDrawingContextType type, bool wantStereoVisual, bool alphaBackground, GHOST_WindowWin32 *parentWindow, bool is_debug, bool dialog, const GHOST_GPUDevice &preferred_device)
void onPointerHitTest(WPARAM wParam)
void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
GHOST_TSuccess endProgressBar()
GHOST_TWindowState getState() const
void * getOSWindow() const
void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
void adjustWindowRectForClosestMonitor(LPRECT win_rect, DWORD dwStyle, DWORD dwExStyle)
GHOST_Rect m_cursorGrabBounds
void setCursorGrabAccum(int32_t x, int32_t y)
GHOST_TGrabCursorMode m_cursorGrab
int32_t m_cursorGrabInitPos[2]
GHOST_TStandardCursor getCursorShape() const override
GHOST_TSuccess setDrawingContextType(GHOST_TDrawingContextType type) override
GHOST_TSuccess releaseNativeHandles()
bool getCursorVisibility() const override
virtual bool getValid() const override
GHOST_TabletData getLastTabletData()
static GHOST_Wintab * loadWintab(HWND hwnd)
virtual HRESULT STDMETHODCALLTYPE SetProgressState(HWND hwnd, TBPFLAG tbpFlags)=0
virtual HRESULT STDMETHODCALLTYPE SetProgressValue(HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal)=0
ccl_device_inline float2 fabs(const float2 a)
static struct PyModuleDef module
wchar_t * alloc_utf16_from_8(const char *in8, size_t add)
size_t count_utf_8_from_16(const wchar_t *string16)
int conv_utf_16_to_8(const wchar_t *in16, char *out8, size_t size8)
#define UTF16_ENCODE(in8str)
#define UTF16_UN_ENCODE(in8str)