diff options
author | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
commit | 2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch) | |
tree | 95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/llwindow/llwindowwin32.cpp | |
parent | Second Life viewer sources 1.20.6 (diff) | |
download | meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2 meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz |
Second Life viewer sources 1.20.7
Diffstat (limited to 'linden/indra/llwindow/llwindowwin32.cpp')
-rw-r--r-- | linden/indra/llwindow/llwindowwin32.cpp | 133 |
1 files changed, 69 insertions, 64 deletions
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index 9963493..f2a2727 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp | |||
@@ -84,7 +84,7 @@ LLW32MsgCallback gAsyncMsgCallback = NULL; | |||
84 | 84 | ||
85 | void show_window_creation_error(const char* title) | 85 | void show_window_creation_error(const char* title) |
86 | { | 86 | { |
87 | llwarns << title << llendl; | 87 | LL_WARNS("Window") << title << LL_ENDL; |
88 | } | 88 | } |
89 | 89 | ||
90 | //static | 90 | //static |
@@ -534,7 +534,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
534 | 534 | ||
535 | if (closest_refresh == 0) | 535 | if (closest_refresh == 0) |
536 | { | 536 | { |
537 | llwarns << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << llendl; | 537 | LL_WARNS("Window") << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << LL_ENDL; |
538 | success = FALSE; | 538 | success = FALSE; |
539 | } | 539 | } |
540 | 540 | ||
@@ -557,11 +557,11 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
557 | mFullscreenBits = dev_mode.dmBitsPerPel; | 557 | mFullscreenBits = dev_mode.dmBitsPerPel; |
558 | mFullscreenRefresh = dev_mode.dmDisplayFrequency; | 558 | mFullscreenRefresh = dev_mode.dmDisplayFrequency; |
559 | 559 | ||
560 | llinfos << "Running at " << dev_mode.dmPelsWidth | 560 | LL_INFOS("Window") << "Running at " << dev_mode.dmPelsWidth |
561 | << "x" << dev_mode.dmPelsHeight | 561 | << "x" << dev_mode.dmPelsHeight |
562 | << "x" << dev_mode.dmBitsPerPel | 562 | << "x" << dev_mode.dmBitsPerPel |
563 | << " @ " << dev_mode.dmDisplayFrequency | 563 | << " @ " << dev_mode.dmDisplayFrequency |
564 | << llendl; | 564 | << LL_ENDL; |
565 | } | 565 | } |
566 | else | 566 | else |
567 | { | 567 | { |
@@ -576,7 +576,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
576 | OSMessageBox(error, "Error", OSMB_OK); | 576 | OSMessageBox(error, "Error", OSMB_OK); |
577 | } | 577 | } |
578 | } | 578 | } |
579 | 579 | ||
580 | // TODO: add this after resolving _WIN32_WINNT issue | 580 | // TODO: add this after resolving _WIN32_WINNT issue |
581 | // if (!fullscreen) | 581 | // if (!fullscreen) |
582 | // { | 582 | // { |
@@ -588,7 +588,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, | |||
588 | // TrackMouseEvent( &track_mouse_event ); | 588 | // TrackMouseEvent( &track_mouse_event ); |
589 | // } | 589 | // } |
590 | 590 | ||
591 | 591 | ||
592 | //----------------------------------------------------------------------- | 592 | //----------------------------------------------------------------------- |
593 | // Create GL drawing context | 593 | // Create GL drawing context |
594 | //----------------------------------------------------------------------- | 594 | //----------------------------------------------------------------------- |
@@ -657,7 +657,7 @@ void LLWindowWin32::restore() | |||
657 | // Usually called from LLWindowManager::destroyWindow() | 657 | // Usually called from LLWindowManager::destroyWindow() |
658 | void LLWindowWin32::close() | 658 | void LLWindowWin32::close() |
659 | { | 659 | { |
660 | llinfos << "Closing LLWindowWin32" << llendl; | 660 | LL_DEBUGS("Window") << "Closing LLWindowWin32" << LL_ENDL; |
661 | // Is window is already closed? | 661 | // Is window is already closed? |
662 | if (!mWindowHandle) | 662 | if (!mWindowHandle) |
663 | { | 663 | { |
@@ -675,20 +675,20 @@ void LLWindowWin32::close() | |||
675 | } | 675 | } |
676 | 676 | ||
677 | // Clean up remaining GL state | 677 | // Clean up remaining GL state |
678 | llinfos << "Shutting down GL" << llendl; | 678 | LL_DEBUGS("Window") << "Shutting down GL" << LL_ENDL; |
679 | gGLManager.shutdownGL(); | 679 | gGLManager.shutdownGL(); |
680 | 680 | ||
681 | llinfos << "Releasing Context" << llendl; | 681 | LL_DEBUGS("Window") << "Releasing Context" << LL_ENDL; |
682 | if (mhRC) | 682 | if (mhRC) |
683 | { | 683 | { |
684 | if (!wglMakeCurrent(NULL, NULL)) | 684 | if (!wglMakeCurrent(NULL, NULL)) |
685 | { | 685 | { |
686 | llwarns << "Release of DC and RC failed" << llendl; | 686 | LL_WARNS("Window") << "Release of DC and RC failed" << LL_ENDL; |
687 | } | 687 | } |
688 | 688 | ||
689 | if (!wglDeleteContext(mhRC)) | 689 | if (!wglDeleteContext(mhRC)) |
690 | { | 690 | { |
691 | llwarns << "Release of rendering context failed" << llendl; | 691 | LL_WARNS("Window") << "Release of rendering context failed" << LL_ENDL; |
692 | } | 692 | } |
693 | 693 | ||
694 | mhRC = NULL; | 694 | mhRC = NULL; |
@@ -699,11 +699,11 @@ void LLWindowWin32::close() | |||
699 | 699 | ||
700 | if (mhDC && !ReleaseDC(mWindowHandle, mhDC)) | 700 | if (mhDC && !ReleaseDC(mWindowHandle, mhDC)) |
701 | { | 701 | { |
702 | llwarns << "Release of ghDC failed" << llendl; | 702 | LL_WARNS("Window") << "Release of ghDC failed" << LL_ENDL; |
703 | mhDC = NULL; | 703 | mhDC = NULL; |
704 | } | 704 | } |
705 | 705 | ||
706 | llinfos << "Destroying Window" << llendl; | 706 | LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL; |
707 | 707 | ||
708 | // Don't process events in our mainWindowProc any longer. | 708 | // Don't process events in our mainWindowProc any longer. |
709 | SetWindowLong(mWindowHandle, GWL_USERDATA, NULL); | 709 | SetWindowLong(mWindowHandle, GWL_USERDATA, NULL); |
@@ -866,12 +866,12 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
866 | { | 866 | { |
867 | if (!wglMakeCurrent(NULL, NULL)) | 867 | if (!wglMakeCurrent(NULL, NULL)) |
868 | { | 868 | { |
869 | llwarns << "Release of DC and RC failed" << llendl; | 869 | LL_WARNS("Window") << "Release of DC and RC failed" << LL_ENDL; |
870 | } | 870 | } |
871 | 871 | ||
872 | if (!wglDeleteContext(mhRC)) | 872 | if (!wglDeleteContext(mhRC)) |
873 | { | 873 | { |
874 | llwarns << "Release of rendering context failed" << llendl; | 874 | LL_WARNS("Window") << "Release of rendering context failed" << LL_ENDL; |
875 | } | 875 | } |
876 | 876 | ||
877 | mhRC = NULL; | 877 | mhRC = NULL; |
@@ -905,7 +905,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
905 | 905 | ||
906 | if (closest_refresh == 0) | 906 | if (closest_refresh == 0) |
907 | { | 907 | { |
908 | llwarns << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << llendl; | 908 | LL_WARNS("Window") << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << LL_ENDL; |
909 | return FALSE; | 909 | return FALSE; |
910 | } | 910 | } |
911 | 911 | ||
@@ -927,11 +927,11 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
927 | mFullscreenBits = dev_mode.dmBitsPerPel; | 927 | mFullscreenBits = dev_mode.dmBitsPerPel; |
928 | mFullscreenRefresh = dev_mode.dmDisplayFrequency; | 928 | mFullscreenRefresh = dev_mode.dmDisplayFrequency; |
929 | 929 | ||
930 | llinfos << "Running at " << dev_mode.dmPelsWidth | 930 | LL_INFOS("Window") << "Running at " << dev_mode.dmPelsWidth |
931 | << "x" << dev_mode.dmPelsHeight | 931 | << "x" << dev_mode.dmPelsHeight |
932 | << "x" << dev_mode.dmBitsPerPel | 932 | << "x" << dev_mode.dmBitsPerPel |
933 | << " @ " << dev_mode.dmDisplayFrequency | 933 | << " @ " << dev_mode.dmDisplayFrequency |
934 | << llendl; | 934 | << LL_ENDL; |
935 | 935 | ||
936 | window_rect.left = (long) 0; | 936 | window_rect.left = (long) 0; |
937 | window_rect.right = (long) width; // Windows GDI rects don't include rightmost pixel | 937 | window_rect.right = (long) width; // Windows GDI rects don't include rightmost pixel |
@@ -952,8 +952,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
952 | mFullscreenBits = -1; | 952 | mFullscreenBits = -1; |
953 | mFullscreenRefresh = -1; | 953 | mFullscreenRefresh = -1; |
954 | 954 | ||
955 | llinfos << "Unable to run fullscreen at " << width << "x" << height << llendl; | 955 | LL_INFOS("Window") << "Unable to run fullscreen at " << width << "x" << height << LL_ENDL; |
956 | llinfos << "Running in window." << llendl; | ||
957 | return FALSE; | 956 | return FALSE; |
958 | } | 957 | } |
959 | } | 958 | } |
@@ -1146,7 +1145,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1146 | { | 1145 | { |
1147 | if (end_attrib > 0) | 1146 | if (end_attrib > 0) |
1148 | { | 1147 | { |
1149 | llinfos << "No valid pixel format for " << mFSAASamples << "x anti-aliasing." << llendl; | 1148 | LL_INFOS("Window") << "No valid pixel format for " << mFSAASamples << "x anti-aliasing." << LL_ENDL; |
1150 | attrib_list[end_attrib] = 0; | 1149 | attrib_list[end_attrib] = 0; |
1151 | 1150 | ||
1152 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); | 1151 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); |
@@ -1160,7 +1159,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1160 | 1159 | ||
1161 | if (!num_formats) | 1160 | if (!num_formats) |
1162 | { | 1161 | { |
1163 | llinfos << "No 32 bit z-buffer, trying 24 bits instead" << llendl; | 1162 | LL_INFOS("Window") << "No 32 bit z-buffer, trying 24 bits instead" << LL_ENDL; |
1164 | // Try 24-bit format | 1163 | // Try 24-bit format |
1165 | attrib_list[1] = 24; | 1164 | attrib_list[1] = 24; |
1166 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); | 1165 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); |
@@ -1173,7 +1172,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1173 | 1172 | ||
1174 | if (!num_formats) | 1173 | if (!num_formats) |
1175 | { | 1174 | { |
1176 | llwarns << "Couldn't get 24 bit z-buffer,trying 16 bits instead!" << llendl; | 1175 | LL_WARNS("Window") << "Couldn't get 24 bit z-buffer,trying 16 bits instead!" << LL_ENDL; |
1177 | attrib_list[1] = 16; | 1176 | attrib_list[1] = 16; |
1178 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); | 1177 | BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); |
1179 | if (!result || !num_formats) | 1178 | if (!result || !num_formats) |
@@ -1185,7 +1184,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1185 | } | 1184 | } |
1186 | } | 1185 | } |
1187 | 1186 | ||
1188 | llinfos << "Choosing pixel formats: " << num_formats << " pixel formats returned" << llendl; | 1187 | LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL; |
1189 | } | 1188 | } |
1190 | 1189 | ||
1191 | pixel_format = pixel_formats[0]; | 1190 | pixel_format = pixel_formats[0]; |
@@ -1241,26 +1240,26 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1241 | { | 1240 | { |
1242 | case WGL_SWAP_EXCHANGE_ARB: | 1241 | case WGL_SWAP_EXCHANGE_ARB: |
1243 | mSwapMethod = SWAP_METHOD_EXCHANGE; | 1242 | mSwapMethod = SWAP_METHOD_EXCHANGE; |
1244 | llinfos << "Swap Method: Exchange" << llendl; | 1243 | LL_DEBUGS("Window") << "Swap Method: Exchange" << LL_ENDL; |
1245 | break; | 1244 | break; |
1246 | case WGL_SWAP_COPY_ARB: | 1245 | case WGL_SWAP_COPY_ARB: |
1247 | mSwapMethod = SWAP_METHOD_COPY; | 1246 | mSwapMethod = SWAP_METHOD_COPY; |
1248 | llinfos << "Swap Method: Copy" << llendl; | 1247 | LL_DEBUGS("Window") << "Swap Method: Copy" << LL_ENDL; |
1249 | break; | 1248 | break; |
1250 | case WGL_SWAP_UNDEFINED_ARB: | 1249 | case WGL_SWAP_UNDEFINED_ARB: |
1251 | mSwapMethod = SWAP_METHOD_UNDEFINED; | 1250 | mSwapMethod = SWAP_METHOD_UNDEFINED; |
1252 | llinfos << "Swap Method: Undefined" << llendl; | 1251 | LL_DEBUGS("Window") << "Swap Method: Undefined" << LL_ENDL; |
1253 | break; | 1252 | break; |
1254 | default: | 1253 | default: |
1255 | mSwapMethod = SWAP_METHOD_UNDEFINED; | 1254 | mSwapMethod = SWAP_METHOD_UNDEFINED; |
1256 | llinfos << "Swap Method: Unknown" << llendl; | 1255 | LL_DEBUGS("Window") << "Swap Method: Unknown" << LL_ENDL; |
1257 | break; | 1256 | break; |
1258 | } | 1257 | } |
1259 | } | 1258 | } |
1260 | } | 1259 | } |
1261 | else | 1260 | else |
1262 | { | 1261 | { |
1263 | llwarns << "No wgl_ARB_pixel_format extension, using default ChoosePixelFormat!" << llendl; | 1262 | LL_WARNS("Window") << "No wgl_ARB_pixel_format extension, using default ChoosePixelFormat!" << LL_ENDL; |
1264 | } | 1263 | } |
1265 | 1264 | ||
1266 | // Verify what pixel format we actually received. | 1265 | // Verify what pixel format we actually received. |
@@ -1272,10 +1271,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1272 | return FALSE; | 1271 | return FALSE; |
1273 | } | 1272 | } |
1274 | 1273 | ||
1275 | llinfos << "GL buffer: Color Bits " << S32(pfd.cColorBits) | 1274 | LL_INFOS("Window") << "GL buffer: Color Bits " << S32(pfd.cColorBits) |
1276 | << " Alpha Bits " << S32(pfd.cAlphaBits) | 1275 | << " Alpha Bits " << S32(pfd.cAlphaBits) |
1277 | << " Depth Bits " << S32(pfd.cDepthBits) | 1276 | << " Depth Bits " << S32(pfd.cDepthBits) |
1278 | << llendl; | 1277 | << LL_ENDL; |
1279 | 1278 | ||
1280 | // make sure we have 32 bits per pixel | 1279 | // make sure we have 32 bits per pixel |
1281 | if (pfd.cColorBits < 32 || GetDeviceCaps(mhDC, BITSPIXEL) < 32) | 1280 | if (pfd.cColorBits < 32 || GetDeviceCaps(mhDC, BITSPIXEL) < 32) |
@@ -1338,12 +1337,12 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO | |||
1338 | // Disable vertical sync for swap | 1337 | // Disable vertical sync for swap |
1339 | if (disable_vsync && wglSwapIntervalEXT) | 1338 | if (disable_vsync && wglSwapIntervalEXT) |
1340 | { | 1339 | { |
1341 | llinfos << "Disabling vertical sync" << llendl; | 1340 | LL_DEBUGS("Window") << "Disabling vertical sync" << LL_ENDL; |
1342 | wglSwapIntervalEXT(0); | 1341 | wglSwapIntervalEXT(0); |
1343 | } | 1342 | } |
1344 | else | 1343 | else |
1345 | { | 1344 | { |
1346 | llinfos << "Keeping vertical sync" << llendl; | 1345 | LL_DEBUGS("Window") << "Keeping vertical sync" << LL_ENDL; |
1347 | } | 1346 | } |
1348 | 1347 | ||
1349 | SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this); | 1348 | SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this); |
@@ -1701,11 +1700,11 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1701 | 1700 | ||
1702 | if (gDebugWindowProc) | 1701 | if (gDebugWindowProc) |
1703 | { | 1702 | { |
1704 | llinfos << "WINDOWPROC ActivateApp " | 1703 | LL_INFOS("Window") << "WINDOWPROC ActivateApp " |
1705 | << " activating " << S32(activating) | 1704 | << " activating " << S32(activating) |
1706 | << " minimized " << S32(minimized) | 1705 | << " minimized " << S32(minimized) |
1707 | << " fullscreen " << S32(window_imp->mFullscreen) | 1706 | << " fullscreen " << S32(window_imp->mFullscreen) |
1708 | << llendl; | 1707 | << LL_ENDL; |
1709 | } | 1708 | } |
1710 | 1709 | ||
1711 | if (window_imp->mFullscreen) | 1710 | if (window_imp->mFullscreen) |
@@ -1746,10 +1745,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1746 | // properly when we run fullscreen. | 1745 | // properly when we run fullscreen. |
1747 | if (gDebugWindowProc) | 1746 | if (gDebugWindowProc) |
1748 | { | 1747 | { |
1749 | llinfos << "WINDOWPROC Activate " | 1748 | LL_INFOS("Window") << "WINDOWPROC Activate " |
1750 | << " activating " << S32(activating) | 1749 | << " activating " << S32(activating) |
1751 | << " minimized " << S32(minimized) | 1750 | << " minimized " << S32(minimized) |
1752 | << llendl; | 1751 | << LL_ENDL; |
1753 | } | 1752 | } |
1754 | 1753 | ||
1755 | // Don't handle this. | 1754 | // Don't handle this. |
@@ -1805,9 +1804,9 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1805 | { | 1804 | { |
1806 | if (gDebugWindowProc) | 1805 | if (gDebugWindowProc) |
1807 | { | 1806 | { |
1808 | llinfos << "Debug WindowProc WM_KEYDOWN " | 1807 | LL_INFOS("Window") << "Debug WindowProc WM_KEYDOWN " |
1809 | << " key " << S32(w_param) | 1808 | << " key " << S32(w_param) |
1810 | << llendl; | 1809 | << LL_ENDL; |
1811 | } | 1810 | } |
1812 | if(gKeyboard->handleKeyDown(w_param, mask) && eat_keystroke) | 1811 | if(gKeyboard->handleKeyDown(w_param, mask) && eat_keystroke) |
1813 | { | 1812 | { |
@@ -1824,9 +1823,9 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1824 | 1823 | ||
1825 | if (gDebugWindowProc) | 1824 | if (gDebugWindowProc) |
1826 | { | 1825 | { |
1827 | llinfos << "Debug WindowProc WM_KEYUP " | 1826 | LL_INFOS("Window") << "Debug WindowProc WM_KEYUP " |
1828 | << " key " << S32(w_param) | 1827 | << " key " << S32(w_param) |
1829 | << llendl; | 1828 | << LL_ENDL; |
1830 | } | 1829 | } |
1831 | if (gKeyboard->handleKeyUp(w_param, mask) && eat_keystroke) | 1830 | if (gKeyboard->handleKeyUp(w_param, mask) && eat_keystroke) |
1832 | { | 1831 | { |
@@ -1909,13 +1908,11 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1909 | // it is worth trying. The good old WM_CHAR works just fine even for supplementary | 1908 | // it is worth trying. The good old WM_CHAR works just fine even for supplementary |
1910 | // characters. We just need to take care of surrogate pairs sent as two WM_CHAR's | 1909 | // characters. We just need to take care of surrogate pairs sent as two WM_CHAR's |
1911 | // by ourselves. It is not that tough. -- Alissa Sabre @ SL | 1910 | // by ourselves. It is not that tough. -- Alissa Sabre @ SL |
1912 | // | ||
1913 | // llinfos << "WM_CHAR: " << w_param << llendl; | ||
1914 | if (gDebugWindowProc) | 1911 | if (gDebugWindowProc) |
1915 | { | 1912 | { |
1916 | llinfos << "Debug WindowProc WM_CHAR " | 1913 | LL_INFOS("Window") << "Debug WindowProc WM_CHAR " |
1917 | << " key " << S32(w_param) | 1914 | << " key " << S32(w_param) |
1918 | << llendl; | 1915 | << LL_ENDL; |
1919 | } | 1916 | } |
1920 | // Even if LLWindowCallbacks::handleUnicodeChar(llwchar, BOOL) returned FALSE, | 1917 | // Even if LLWindowCallbacks::handleUnicodeChar(llwchar, BOOL) returned FALSE, |
1921 | // we *did* processed the event, so I believe we should not pass it to DefWindowProc... | 1918 | // we *did* processed the event, so I believe we should not pass it to DefWindowProc... |
@@ -1985,7 +1982,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
1985 | LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER); | 1982 | LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER); |
1986 | //if (gDebugClicks) | 1983 | //if (gDebugClicks) |
1987 | //{ | 1984 | //{ |
1988 | // llinfos << "WndProc left button up" << llendl; | 1985 | // LL_INFOS("Window") << "WndProc left button up" << LL_ENDL; |
1989 | //} | 1986 | //} |
1990 | // Because we move the cursor position in the app, we need to query | 1987 | // Because we move the cursor position in the app, we need to query |
1991 | // to find out where the cursor at the time the event is handled. | 1988 | // to find out where the cursor at the time the event is handled. |
@@ -2181,12 +2178,12 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2181 | BOOL restored = ( w_param == SIZE_RESTORED ); | 2178 | BOOL restored = ( w_param == SIZE_RESTORED ); |
2182 | BOOL minimized = ( w_param == SIZE_MINIMIZED ); | 2179 | BOOL minimized = ( w_param == SIZE_MINIMIZED ); |
2183 | 2180 | ||
2184 | llinfos << "WINDOWPROC Size " | 2181 | LL_INFOS("Window") << "WINDOWPROC Size " |
2185 | << width << "x" << height | 2182 | << width << "x" << height |
2186 | << " max " << S32(maximized) | 2183 | << " max " << S32(maximized) |
2187 | << " min " << S32(minimized) | 2184 | << " min " << S32(minimized) |
2188 | << " rest " << S32(restored) | 2185 | << " rest " << S32(restored) |
2189 | << llendl; | 2186 | << LL_ENDL; |
2190 | } | 2187 | } |
2191 | 2188 | ||
2192 | // There's an odd behavior with WM_SIZE that I would call a bug. If | 2189 | // There's an odd behavior with WM_SIZE that I would call a bug. If |
@@ -2232,7 +2229,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2232 | case WM_SETFOCUS: | 2229 | case WM_SETFOCUS: |
2233 | if (gDebugWindowProc) | 2230 | if (gDebugWindowProc) |
2234 | { | 2231 | { |
2235 | llinfos << "WINDOWPROC SetFocus" << llendl; | 2232 | LL_INFOS("Window") << "WINDOWPROC SetFocus" << LL_ENDL; |
2236 | } | 2233 | } |
2237 | window_imp->mCallbacks->handleFocus(window_imp); | 2234 | window_imp->mCallbacks->handleFocus(window_imp); |
2238 | return 0; | 2235 | return 0; |
@@ -2240,7 +2237,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ | |||
2240 | case WM_KILLFOCUS: | 2237 | case WM_KILLFOCUS: |
2241 | if (gDebugWindowProc) | 2238 | if (gDebugWindowProc) |
2242 | { | 2239 | { |
2243 | llinfos << "WINDOWPROC KillFocus" << llendl; | 2240 | LL_INFOS("Window") << "WINDOWPROC KillFocus" << LL_ENDL; |
2244 | } | 2241 | } |
2245 | window_imp->mCallbacks->handleFocusLost(window_imp); | 2242 | window_imp->mCallbacks->handleFocusLost(window_imp); |
2246 | return 0; | 2243 | return 0; |
@@ -2596,7 +2593,7 @@ BOOL LLWindowWin32::setGamma(const F32 gamma) | |||
2596 | { | 2593 | { |
2597 | mCurrentGamma = gamma; | 2594 | mCurrentGamma = gamma; |
2598 | 2595 | ||
2599 | llinfos << "Setting gamma to " << gamma << llendl; | 2596 | LL_DEBUGS("Window") << "Setting gamma to " << gamma << LL_ENDL; |
2600 | 2597 | ||
2601 | for ( int i = 0; i < 256; ++i ) | 2598 | for ( int i = 0; i < 256; ++i ) |
2602 | { | 2599 | { |
@@ -2737,8 +2734,8 @@ BOOL LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 re | |||
2737 | 2734 | ||
2738 | if (!success) | 2735 | if (!success) |
2739 | { | 2736 | { |
2740 | llwarns << "setDisplayResolution failed, " | 2737 | LL_WARNS("Window") << "setDisplayResolution failed, " |
2741 | << width << "x" << height << "x" << bits << " @ " << refresh << llendl; | 2738 | << width << "x" << height << "x" << bits << " @ " << refresh << LL_ENDL; |
2742 | } | 2739 | } |
2743 | 2740 | ||
2744 | return success; | 2741 | return success; |
@@ -2760,7 +2757,7 @@ BOOL LLWindowWin32::setFullscreenResolution() | |||
2760 | // protected | 2757 | // protected |
2761 | BOOL LLWindowWin32::resetDisplayResolution() | 2758 | BOOL LLWindowWin32::resetDisplayResolution() |
2762 | { | 2759 | { |
2763 | llinfos << "resetDisplayResolution START" << llendl; | 2760 | LL_DEBUGS("Window") << "resetDisplayResolution START" << LL_ENDL; |
2764 | 2761 | ||
2765 | LONG cds_result = ChangeDisplaySettings(NULL, 0); | 2762 | LONG cds_result = ChangeDisplaySettings(NULL, 0); |
2766 | 2763 | ||
@@ -2768,10 +2765,10 @@ BOOL LLWindowWin32::resetDisplayResolution() | |||
2768 | 2765 | ||
2769 | if (!success) | 2766 | if (!success) |
2770 | { | 2767 | { |
2771 | llwarns << "resetDisplayResolution failed" << llendl; | 2768 | LL_WARNS("Window") << "resetDisplayResolution failed" << LL_ENDL; |
2772 | } | 2769 | } |
2773 | 2770 | ||
2774 | llinfos << "resetDisplayResolution END" << llendl; | 2771 | LL_DEBUGS("Window") << "resetDisplayResolution END" << LL_ENDL; |
2775 | 2772 | ||
2776 | return success; | 2773 | return success; |
2777 | } | 2774 | } |
@@ -2908,11 +2905,11 @@ void spawn_web_browser(const char* escaped_url ) | |||
2908 | 2905 | ||
2909 | if (!found) | 2906 | if (!found) |
2910 | { | 2907 | { |
2911 | llwarns << "spawn_web_browser() called for url with protocol not on whitelist: " << escaped_url << llendl; | 2908 | LL_WARNS("Window") << "spawn_web_browser() called for url with protocol not on whitelist: " << escaped_url << LL_ENDL; |
2912 | return; | 2909 | return; |
2913 | } | 2910 | } |
2914 | 2911 | ||
2915 | llinfos << "Opening URL " << escaped_url << llendl; | 2912 | LL_INFOS("Window") << "Opening URL " << escaped_url << LL_ENDL; |
2916 | 2913 | ||
2917 | // replaced ShellExecute code with ShellExecuteEx since ShellExecute doesn't work | 2914 | // replaced ShellExecute code with ShellExecuteEx since ShellExecute doesn't work |
2918 | // reliablly on Vista. | 2915 | // reliablly on Vista. |
@@ -2952,7 +2949,7 @@ void spawn_web_browser(const char* escaped_url ) | |||
2952 | 2949 | ||
2953 | if (browser_open_wstring.length() < 2) | 2950 | if (browser_open_wstring.length() < 2) |
2954 | { | 2951 | { |
2955 | llwarns << "Invalid browser executable in registry " << browser_open_wstring << llendl; | 2952 | LL_WARNS("Window") << "Invalid browser executable in registry " << browser_open_wstring << LL_ENDL; |
2956 | return; | 2953 | return; |
2957 | } | 2954 | } |
2958 | 2955 | ||
@@ -2972,8 +2969,8 @@ void spawn_web_browser(const char* escaped_url ) | |||
2972 | browser_executable = browser_open_wstring.substr(0, space_pos); | 2969 | browser_executable = browser_open_wstring.substr(0, space_pos); |
2973 | } | 2970 | } |
2974 | 2971 | ||
2975 | llinfos << "Browser reg key: " << wstring_to_utf8str(browser_open_wstring) << llendl; | 2972 | LL_DEBUGS("Window") << "Browser reg key: " << wstring_to_utf8str(browser_open_wstring) << LL_ENDL; |
2976 | llinfos << "Browser executable: " << wstring_to_utf8str(browser_executable) << llendl; | 2973 | LL_INFOS("Window") << "Browser executable: " << wstring_to_utf8str(browser_executable) << LL_ENDL; |
2977 | 2974 | ||
2978 | // Convert URL to wide string for Windows API | 2975 | // Convert URL to wide string for Windows API |
2979 | // Assume URL is UTF8, as can come from scripts | 2976 | // Assume URL is UTF8, as can come from scripts |
@@ -2995,11 +2992,11 @@ void spawn_web_browser(const char* escaped_url ) | |||
2995 | SW_SHOWNORMAL); | 2992 | SW_SHOWNORMAL); |
2996 | if (retval > 32) | 2993 | if (retval > 32) |
2997 | { | 2994 | { |
2998 | llinfos << "load_url success with " << retval << llendl; | 2995 | LL_DEBUGS("Window") << "load_url success with " << retval << LL_ENDL; |
2999 | } | 2996 | } |
3000 | else | 2997 | else |
3001 | { | 2998 | { |
3002 | llinfos << "load_url failure with " << retval << llendl; | 2999 | LL_INFOS("Window") << "load_url failure with " << retval << LL_ENDL; |
3003 | } | 3000 | } |
3004 | */ | 3001 | */ |
3005 | } | 3002 | } |
@@ -3541,7 +3538,7 @@ BOOL LLWindowWin32::handleImeRequests(U32 request, U32 param, LRESULT *result) | |||
3541 | 3538 | ||
3542 | if (!mPreeditor->getPreeditLocation(position, &caret_coord, &preedit_bounds, &text_control)) | 3539 | if (!mPreeditor->getPreeditLocation(position, &caret_coord, &preedit_bounds, &text_control)) |
3543 | { | 3540 | { |
3544 | llwarns << "*** IMR_QUERYCHARPOSITON called but getPreeditLocation failed." << llendl; | 3541 | LL_WARNS("Window") << "*** IMR_QUERYCHARPOSITON called but getPreeditLocation failed." << LL_ENDL; |
3545 | return FALSE; | 3542 | return FALSE; |
3546 | } | 3543 | } |
3547 | fillCharPosition(caret_coord, preedit_bounds, text_control, char_position); | 3544 | fillCharPosition(caret_coord, preedit_bounds, text_control, char_position); |
@@ -3628,5 +3625,13 @@ BOOL LLWindowWin32::handleImeRequests(U32 request, U32 param, LRESULT *result) | |||
3628 | return FALSE; | 3625 | return FALSE; |
3629 | } | 3626 | } |
3630 | 3627 | ||
3628 | //static | ||
3629 | std::string LLWindowWin32::getFontListSans() | ||
3630 | { | ||
3631 | // Lists Japanese, Korean, and Chinese sanserif fonts available in | ||
3632 | // Windows XP and Vista, as well as "Arial Unicode MS". | ||
3633 | return "MSGOTHIC.TTC;gulim.ttc;simhei.ttf;ArialUni.ttf"; | ||
3634 | } | ||
3635 | |||
3631 | 3636 | ||
3632 | #endif // LL_WINDOWS | 3637 | #endif // LL_WINDOWS |