20#ifdef WITH_OPENGL_BACKEND
23#ifdef WITH_VULKAN_BACKEND
36#include <propvarutil.h>
38#include <shellscalingapi.h>
42#ifndef GET_POINTERID_WPARAM
43# define GET_POINTERID_WPARAM(wParam) (LOWORD(wParam))
46const wchar_t *GHOST_WindowWin32::s_windowClassName =
L"GHOST_WindowClass";
47const int GHOST_WindowWin32::s_maxTitleLength = 128;
51__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
62 bool wantStereoVisual,
75 m_preferred_device(preferred_device),
76 m_hasMouseCaptured(
false),
77 m_hasGrabMouse(
false),
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;
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 &&
139 strstr(
BLI_getenv(
"PROCESSOR_IDENTIFIER"),
"Qualcomm") != NULL)
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);
181 if (!m_system->m_windowFocus) {
183 ::SetWindowPos(m_hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
197 nCmdShow = SW_SHOWMAXIMIZED;
200 nCmdShow = (m_system->m_windowFocus) ? SW_SHOWMINIMIZED : SW_SHOWMINNOACTIVE;
204 nCmdShow = (m_system->m_windowFocus) ? SW_SHOWNORMAL : SW_SHOWNOACTIVATE;
210 ::ShowWindow(m_hWnd, nCmdShow);
219 CLSID_TaskbarList,
nullptr, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (LPVOID *)&m_Bar);
227 if (!m_directManipulationHelper) {
231 m_directManipulationHelper->update();
238 if (!m_directManipulationHelper) {
243 POINTER_INPUT_TYPE pointerType;
244 if (GetPointerType(pointerId, &pointerType) && pointerType == PT_TOUCHPAD) {
245 m_directManipulationHelper->onPointerHitTest(pointerId);
251 if (!m_directManipulationHelper) {
255 return m_directManipulationHelper->getTrackpadInfo();
261 unregisterWindowAppUserModelProperties();
273 FreeLibrary(m_user32);
277 if (m_customCursor) {
278 DestroyCursor(m_customCursor);
279 m_customCursor =
nullptr;
283 ::ReleaseDC(m_hWnd, m_hDC);
290 for (
GHOST_IWindow *iter_win : m_system->getWindowManager()->getWindows()) {
292 if (iter_winwin->m_parentWindowHwnd == m_hWnd) {
293 ::SetWindowLongPtr(iter_winwin->m_hWnd, GWLP_HWNDPARENT, 0);
294 iter_winwin->m_parentWindowHwnd = 0;
300 RevokeDragDrop(m_hWnd);
302 m_dropTarget->Release();
303 m_dropTarget =
nullptr;
305 ::SetWindowLongPtr(m_hWnd, GWLP_USERDATA, 0);
306 ::DestroyWindow(m_hWnd);
310 delete m_directManipulationHelper;
311 m_directManipulationHelper =
nullptr;
319 HMONITOR hmonitor = MonitorFromRect(win_rect, MONITOR_DEFAULTTONEAREST);
320 MONITORINFOEX monitor;
321 monitor.cbSize =
sizeof(MONITORINFOEX);
323 GetMonitorInfo(hmonitor, &monitor);
326 LONG width =
min(monitor.rcWork.right - monitor.rcWork.left, win_rect->right - win_rect->left);
327 LONG height =
min(monitor.rcWork.bottom - monitor.rcWork.top, win_rect->bottom - win_rect->top);
328 win_rect->left =
min(
max(monitor.rcWork.left, win_rect->left), monitor.rcWork.right - width);
329 win_rect->right = win_rect->left + width;
330 win_rect->top =
min(
max(monitor.rcWork.top, win_rect->top), monitor.rcWork.bottom - height);
331 win_rect->bottom = win_rect->top + height;
337 m_user32,
"AdjustWindowRectExForDpi");
342 if (fpAdjustWindowRectExForDpi) {
344 GetDpiForMonitor(hmonitor, MDT_EFFECTIVE_DPI, &dpiX, &dpiY);
345 fpAdjustWindowRectExForDpi(win_rect, dwStyle & ~WS_OVERLAPPED,
FALSE, dwExStyle, dpiX);
348 AdjustWindowRectEx(win_rect, dwStyle & ~WS_OVERLAPPED,
FALSE, dwExStyle);
352 win_rect->top =
max(monitor.rcWork.top, win_rect->top);
367 return (
void *)m_hWnd;
373 ::SetWindowTextW(m_hWnd, (
wchar_t *)title_16);
379 std::wstring wtitle(::GetWindowTextLengthW(m_hWnd) + 1,
L'\0');
380 ::GetWindowTextW(m_hWnd, &wtitle[0], wtitle.capacity());
391 constexpr DWORD caption_color_attr = 35;
395 const COLORREF colorref = RGB(
396 char(color[0] * 255.0f),
char(color[1] * 255.0f),
char(color[2] * 255.0f));
397 if (!SUCCEEDED(DwmSetWindowAttribute(m_hWnd, caption_color_attr, &colorref,
sizeof(colorref))))
408 ::GetWindowRect(m_hWnd, &rect);
419 if (!IsIconic(m_hWnd)) {
420 ::GetClientRect(m_hWnd, &rect);
424 ::ClientToScreen(m_hWnd, &coord);
429 coord.x = rect.right;
430 coord.y = rect.bottom;
431 ::ClientToScreen(m_hWnd, &coord);
453 success = ::SetWindowPos(m_hWnd, HWND_TOP, 0, 0, cx, cy, SWP_NOMOVE | SWP_NOZORDER) ?
472 success = ::SetWindowPos(m_hWnd, HWND_TOP, 0, 0, cx, cy, SWP_NOMOVE | SWP_NOZORDER) ?
491 success = ::SetWindowPos(m_hWnd, HWND_TOP, 0, 0, cx, cy, SWP_NOMOVE | SWP_NOZORDER) ?
503 if (::IsIconic(m_hWnd)) {
506 else if (::IsZoomed(m_hWnd)) {
507 LONG_PTR
result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE);
518 POINT point = {inX, inY};
519 ::ScreenToClient(m_hWnd, &point);
529 POINT point = {inX, inY};
530 ::ClientToScreen(m_hWnd, &point);
538 LONG_PTR style = GetWindowLongPtr(m_hWnd, GWL_STYLE) | WS_CAPTION;
540 wp.length =
sizeof(WINDOWPLACEMENT);
541 ::GetWindowPlacement(m_hWnd, &wp);
545 wp.showCmd = SW_MINIMIZE;
548 wp.showCmd = SW_SHOWMAXIMIZED;
552 m_normal_state = curstate;
554 wp.showCmd = SW_SHOWMAXIMIZED;
555 wp.ptMaxPosition.x = 0;
556 wp.ptMaxPosition.y = 0;
557 style &= ~(WS_CAPTION | WS_MAXIMIZE);
564 wp.showCmd = SW_SHOWMAXIMIZED;
568 wp.showCmd = SW_SHOWNORMAL;
572 ::SetWindowLongPtr(m_hWnd, GWL_STYLE, style);
575 ::SetWindowPos(m_hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
581 HWND hWndInsertAfter, hWndToRaise;
584 hWndInsertAfter = HWND_BOTTOM;
585 hWndToRaise = ::GetWindow(m_hWnd, GW_HWNDNEXT);
591 hWndInsertAfter = HWND_TOP;
592 hWndToRaise =
nullptr;
595 if (::SetWindowPos(m_hWnd, hWndInsertAfter, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) ==
FALSE) {
600 ::SetWindowPos(hWndToRaise, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) ==
FALSE)
622#ifdef WITH_VULKAN_BACKEND
623 case GHOST_kDrawingContextTypeVulkan: {
625 false, m_hWnd, 1, 2, m_debug_context, m_preferred_device);
626 if (context->initializeDrawingContext()) {
634#ifdef WITH_OPENGL_BACKEND
635 case GHOST_kDrawingContextTypeOpenGL: {
636 for (
int minor = 6; minor >= 3; --minor) {
637 GHOST_Context *
context =
new GHOST_ContextWGL(
642 WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
645 (m_debug_context ? WGL_CONTEXT_DEBUG_BIT_ARB : 0),
648 if (
context->initializeDrawingContext()) {
657 case GHOST_kDrawingContextTypeD3D: {
658 GHOST_Context *
context =
new GHOST_ContextD3D(
false, m_hWnd);
660 if (
context->initializeDrawingContext()) {
675 if (m_hasMouseCaptured) {
676 m_hasGrabMouse =
false;
677 m_nPressedButtons = 0;
678 m_hasMouseCaptured =
false;
694 if (m_nPressedButtons) {
699 m_hasGrabMouse =
true;
702 m_hasGrabMouse =
false;
706 if (!m_nPressedButtons && !m_hasGrabMouse && m_hasMouseCaptured) {
708 m_hasMouseCaptured =
false;
710 else if ((m_nPressedButtons || m_hasGrabMouse) && !m_hasMouseCaptured) {
711 ::SetCapture(m_hWnd);
712 m_hasMouseCaptured =
true;
719 HANDLE cursor =
nullptr;
720 HMODULE
module = ::GetModuleHandle(0);
721 uint32_t flags = LR_SHARED | LR_DEFAULTSIZE;
726 if (m_customCursor) {
727 return m_customCursor;
733 cursor = ::LoadImage(
module,
"arrowright_cursor", IMAGE_CURSOR, cx, cy, flags);
736 cursor = ::LoadImage(
module,
"arrowleft_cursor", IMAGE_CURSOR, cx, cy, flags);
739 cursor = ::LoadImage(
module,
"arrowup_cursor", IMAGE_CURSOR, cx, cy, flags);
742 cursor = ::LoadImage(
module,
"arrowdown_cursor", IMAGE_CURSOR, cx, cy, flags);
745 cursor = ::LoadImage(
module,
"splitv_cursor", IMAGE_CURSOR, cx, cy, flags);
748 cursor = ::LoadImage(
module,
"splith_cursor", IMAGE_CURSOR, cx, cy, flags);
751 cursor = ::LoadImage(
module,
"knife_cursor", IMAGE_CURSOR, cx, cy, flags);
754 cursor = ::LoadImage(
module,
"eyedropper_cursor", IMAGE_CURSOR, cx, cy, flags);
757 cursor = ::LoadImage(
module,
"zoomin_cursor", IMAGE_CURSOR, cx, cy, flags);
760 cursor = ::LoadImage(
module,
"zoomout_cursor", IMAGE_CURSOR, cx, cy, flags);
763 cursor = ::LoadImage(
nullptr, IDC_SIZEALL, IMAGE_CURSOR, cx, cy, flags);
766 cursor = ::LoadImage(
module,
"handopen_cursor", IMAGE_CURSOR, cx, cy, flags);
769 cursor = ::LoadImage(
module,
"handclosed_cursor", IMAGE_CURSOR, cx, cy, flags);
772 cursor = ::LoadImage(
module,
"handpoint_cursor", IMAGE_CURSOR, cx, cy, flags);
775 cursor = ::LoadImage(
module,
"scrollnsew_cursor", IMAGE_CURSOR, cx, cy, flags);
778 cursor = ::LoadImage(
module,
"scrollns_cursor", IMAGE_CURSOR, cx, cy, flags);
781 cursor = ::LoadImage(
module,
"scrollew_cursor", IMAGE_CURSOR, cx, cy, flags);
784 cursor = ::LoadImage(
nullptr, IDC_HELP, IMAGE_CURSOR, cx, cy, flags);
787 cursor = ::LoadImage(
nullptr, IDC_WAIT, IMAGE_CURSOR, cx, cy, flags);
790 cursor = ::LoadImage(
nullptr, IDC_IBEAM, IMAGE_CURSOR, cx, cy, flags);
793 cursor = ::LoadImage(
module,
"cross_cursor", IMAGE_CURSOR, cx, cy, flags);
796 cursor = ::LoadImage(
module,
"crossA_cursor", IMAGE_CURSOR, cx, cy, flags);
799 cursor = ::LoadImage(
module,
"crossB_cursor", IMAGE_CURSOR, cx, cy, flags);
802 cursor = ::LoadImage(
module,
"crossC_cursor", IMAGE_CURSOR, cx, cy, flags);
806 cursor = ::LoadImage(
module,
"movens_cursor", IMAGE_CURSOR, cx, cy, flags);
810 cursor = ::LoadImage(
module,
"moveew_cursor", IMAGE_CURSOR, cx, cy, flags);
813 cursor = ::LoadImage(
nullptr, IDC_UPARROW, IMAGE_CURSOR, cx, cy, flags);
816 cursor = ::LoadImage(
nullptr, IDC_SIZENWSE, IMAGE_CURSOR, cx, cy, flags);
819 cursor = ::LoadImage(
nullptr, IDC_SIZENESW, IMAGE_CURSOR, cx, cy, flags);
822 cursor = ::LoadImage(
nullptr, IDC_SIZENWSE, IMAGE_CURSOR, cx, cy, flags);
825 cursor = ::LoadImage(
nullptr, IDC_SIZENESW, IMAGE_CURSOR, cx, cy, flags);
828 cursor = ::LoadImage(
module,
"pencil_cursor", IMAGE_CURSOR, cx, cy, flags);
831 cursor = ::LoadImage(
module,
"eraser_cursor", IMAGE_CURSOR, cx, cy, flags);
835 cursor = ::LoadImage(
module,
"forbidden_cursor", IMAGE_CURSOR, cx, cy, flags);
838 cursor = ::LoadImage(
module,
"handle_left_cursor", IMAGE_CURSOR, cx, cy, flags);
841 cursor = ::LoadImage(
module,
"handle_right_cursor", IMAGE_CURSOR, cx, cy, flags);
844 cursor = ::LoadImage(
module,
"handle_both_cursor", IMAGE_CURSOR, cx, cy, flags);
854 if (cursor ==
nullptr) {
855 cursor = ::LoadImage(
nullptr, IDC_ARROW, IMAGE_CURSOR, cx, cy, flags);
858 return (HCURSOR)cursor;
864 while (::ShowCursor(
FALSE) >= 0) {
869 while (::ShowCursor(TRUE) < 0) {
875 if (cursor ==
nullptr) {
881GHOST_TSuccess GHOST_WindowWin32::setWindowCursorVisibility(
bool visible)
883 if (::GetForegroundWindow() == m_hWnd) {
898 setWindowCursorVisibility(
false);
906 setWindowCursorVisibility(
true);
913 m_system->getCursorPosition(
pos[0],
pos[1]);
914 m_system->setCursorPosition(
pos[0],
pos[1]);
929 if (::GetForegroundWindow() == m_hWnd) {
942 std::vector<GHOST_PointerInfoWin32> &outPointerInfo, WPARAM wParam, LPARAM )
945 int32_t isPrimary = IS_POINTER_PRIMARY_WPARAM(wParam);
947 uint32_t outCount = 0;
949 if (!(GetPointerPenInfoHistory(pointerId, &outCount,
nullptr))) {
953 std::vector<POINTER_PEN_INFO> pointerPenInfo(outCount);
954 outPointerInfo.resize(outCount);
956 if (!(GetPointerPenInfoHistory(pointerId, &outCount, pointerPenInfo.data()))) {
960 for (uint32_t
i = 0;
i < outCount;
i++) {
961 POINTER_INFO pointerApiInfo = pointerPenInfo[
i].pointerInfo;
963 outPointerInfo[
i].pointerId = pointerId;
964 outPointerInfo[
i].isPrimary = isPrimary;
966 switch (pointerApiInfo.ButtonChangeType) {
967 case POINTER_CHANGE_FIRSTBUTTON_DOWN:
968 case POINTER_CHANGE_FIRSTBUTTON_UP:
971 case POINTER_CHANGE_SECONDBUTTON_DOWN:
972 case POINTER_CHANGE_SECONDBUTTON_UP:
975 case POINTER_CHANGE_THIRDBUTTON_DOWN:
976 case POINTER_CHANGE_THIRDBUTTON_UP:
979 case POINTER_CHANGE_FOURTHBUTTON_DOWN:
980 case POINTER_CHANGE_FOURTHBUTTON_UP:
983 case POINTER_CHANGE_FIFTHBUTTON_DOWN:
984 case POINTER_CHANGE_FIFTHBUTTON_UP:
991 outPointerInfo[
i].pixelLocation = pointerApiInfo.ptPixelLocation;
993 outPointerInfo[
i].tabletData.Pressure = 1.0f;
994 outPointerInfo[
i].tabletData.Xtilt = 0.0f;
995 outPointerInfo[
i].tabletData.Ytilt = 0.0f;
998 if (pointerPenInfo[
i].penMask & PEN_MASK_PRESSURE) {
999 outPointerInfo[
i].tabletData.Pressure = pointerPenInfo[
i].pressure / 1024.0f;
1002 if (pointerPenInfo[
i].penFlags & PEN_FLAG_ERASER) {
1006 if (pointerPenInfo[
i].penMask & PEN_MASK_TILT_X) {
1010 outPointerInfo[
i].tabletData.Xtilt = std::clamp(
1011 pointerPenInfo[
i].tiltX / 90.0f, -1.0f, 1.0f);
1014 if (pointerPenInfo[
i].penMask & PEN_MASK_TILT_Y) {
1018 outPointerInfo[
i].tabletData.Ytilt = std::clamp(
1019 pointerPenInfo[
i].tiltY / 90.0f, -1.0f, 1.0f);
1023 if (!outPointerInfo.empty()) {
1024 m_lastPointerTabletData = outPointerInfo.back().tabletData;
1051 if (m_system->getCursorPosition(
x,
y)) {
1056 m_wintab->gainFocus();
1073 if (m_system->getTabletAPI() == api) {
1077 if (m_wintab && m_wintab->devicesPresent()) {
1095 return m_lastPointerTabletData;
1102 DWORD pcbData =
sizeof(lightMode);
1103 if (RegGetValueW(HKEY_CURRENT_USER,
1104 L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize\\",
1105 L"AppsUseLightTheme",
1109 &pcbData) == ERROR_SUCCESS)
1111 BOOL DarkMode = !lightMode;
1116 DwmSetWindowAttribute(this->m_hWnd, 20, &DarkMode,
sizeof(DarkMode));
1122 if (m_directManipulationHelper) {
1123 m_directManipulationHelper->setDPI(
getDPIHint());
1131 m_user32,
"GetDpiForWindow");
1133 if (fpGetDpiForWindow) {
1134 return fpGetDpiForWindow(this->m_hWnd);
1138 return USER_DEFAULT_SCREEN_DPI;
1144 ch = ((ch >> 1) & 0x55) | ((ch << 1) & 0xAA);
1145 ch = ((ch >> 2) & 0x33) | ((ch << 2) & 0xCC);
1146 ch = ((ch >> 4) & 0x0F) | ((ch << 4) & 0xF0);
1154 shrt = ((shrt >> 1) & 0x5555) | ((shrt << 1) & 0xAAAA);
1155 shrt = ((shrt >> 2) & 0x3333) | ((shrt << 2) & 0xCCCC);
1156 shrt = ((shrt >> 4) & 0x0F0F) | ((shrt << 4) & 0xF0F0);
1157 shrt = ((shrt >> 8) & 0x00FF) | ((shrt << 8) & 0xFF00);
1162GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(uint8_t *bitmap,
1180 if (m_customCursor) {
1181 DestroyCursor(m_customCursor);
1182 m_customCursor =
nullptr;
1185 memset(&andData, 0xFF,
sizeof(andData));
1186 memset(&xorData, 0,
sizeof(xorData));
1188 for (
y = 0;
y < sizeY;
y++) {
1191 for (
x = cols - 1;
x >= 0;
x--) {
1197 xorData[
y] = fullBitRow & fullMaskRow;
1198 andData[
y] = ~fullMaskRow;
1201 m_customCursor = ::CreateCursor(::GetModuleHandle(0), hotX, hotY, 32, 32, andData, xorData);
1202 if (!m_customCursor) {
1206 if (::GetForegroundWindow() == m_hWnd) {
1216 if (m_Bar && S_OK == m_Bar->SetProgressValue(m_hWnd, 10000 *
progress, 10000)) {
1225 if (m_Bar && S_OK == m_Bar->SetProgressState(m_hWnd,
TBPF_NOPROGRESS)) {
1232#ifdef WITH_INPUT_IME
1235 m_imeInput.BeginIME(m_hWnd,
GHOST_Rect(
x,
y - h,
x,
y), completed);
1238void GHOST_WindowWin32::endIME()
1240 m_imeInput.EndIME(m_hWnd);
1244void GHOST_WindowWin32::registerWindowAppUserModelProperties()
1246 IPropertyStore *pstore;
1247 char blender_path[MAX_PATH];
1248 wchar_t shell_command[MAX_PATH];
1251 GetModuleFileName(0, blender_path,
sizeof(blender_path));
1252 char *blender_app = strstr(blender_path,
"blender.exe");
1257 HRESULT hr = SHGetPropertyStoreForWindow(m_hWnd, IID_PPV_ARGS(&pstore));
1258 if (!SUCCEEDED(hr)) {
1264 strcpy(blender_app,
"blender-launcher.exe");
1265 wsprintfW(shell_command,
L"\"%S\"", blender_path);
1268 PROPVARIANT propvar;
1269 hr = InitPropVariantFromString(BLENDER_WIN_APPID_16, &propvar);
1270 hr = pstore->SetValue(PKEY_AppUserModel_ID, propvar);
1271 hr = InitPropVariantFromString(shell_command, &propvar);
1272 hr = pstore->SetValue(PKEY_AppUserModel_RelaunchCommand, propvar);
1273 hr = InitPropVariantFromString(BLENDER_WIN_APPID_FRIENDLY_NAME_16, &propvar);
1274 hr = pstore->SetValue(PKEY_AppUserModel_RelaunchDisplayNameResource, propvar);
1282void GHOST_WindowWin32::unregisterWindowAppUserModelProperties()
1284 IPropertyStore *pstore;
1285 HRESULT hr = SHGetPropertyStoreForWindow(m_hWnd, IID_PPV_ARGS(&pstore));
1286 if (SUCCEEDED(hr)) {
1288 PropVariantInit(&value);
1289 pstore->SetValue(PKEY_AppUserModel_ID, value);
1290 pstore->SetValue(PKEY_AppUserModel_RelaunchCommand, value);
1291 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
@ GHOST_kDecorationColoredTitleBar
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)
static GHOST_DirectManipulationHelper * create(HWND hWnd, uint16_t dpi)
static GHOST_ISystem * getSystem()
virtual bool isInside(int32_t x, int32_t y) const
virtual int32_t getHeight() const
virtual int32_t getWidth() const
uint64_t performanceCounterToMillis(__int64 perf_ticks) const
GHOST_TTabletAPI getTabletAPI()
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)
GHOST_TSuccess applyWindowDecorationStyle() override
void setTitle(const char *title)
std::string getTitle() 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, GHOST_WindowWin32 *parentWindow, bool is_debug, bool dialog, const GHOST_GPUDevice &preferred_device)
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
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_TWindowDecorationStyleFlags m_windowDecorationStyleFlags
GHOST_Rect m_cursorGrabBounds
GHOST_WindowDecorationStyleSettings m_windowDecorationStyleSettings
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 getValid() const override
bool getCursorVisibility() const override
GHOST_Window(uint32_t width, uint32_t height, GHOST_TWindowState state, const bool wantStereoVisual=false, const bool exclusive=false)
static GHOST_Wintab * loadWintab(HWND hwnd)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
int context(const bContext *C, const char *member, bContextDataResult *result)
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)