Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginClass.cpp

Issue 5516878722105344: Issue #276 - replace TCHAR etc. with wide-character versions (Closed)
Patch Set: Created July 26, 2014, 2:20 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/plugin/Plugin.cpp ('k') | src/plugin/PluginFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginClass.h" 3 #include "PluginClass.h"
4 #include "COM_Value.h" 4 #include "COM_Value.h"
5 #include "PluginSettings.h" 5 #include "PluginSettings.h"
6 #include "PluginSystem.h" 6 #include "PluginSystem.h"
7 #ifdef SUPPORT_FILTER 7 #ifdef SUPPORT_FILTER
8 #include "PluginFilter.h" 8 #include "PluginFilter.h"
9 #endif 9 #endif
10 #include "PluginMimeFilterClient.h" 10 #include "PluginMimeFilterClient.h"
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 if (!settings->GetPluginEnabled()) 777 if (!settings->GetPluginEnabled())
778 { 778 {
779 s_mimeFilter->Unregister(); 779 s_mimeFilter->Unregister();
780 } 780 }
781 781
782 // Load theme module 782 // Load theme module
783 s_criticalSectionLocal.Lock(); 783 s_criticalSectionLocal.Lock();
784 { 784 {
785 if (!s_hUxtheme) 785 if (!s_hUxtheme)
786 { 786 {
787 s_hUxtheme = ::GetModuleHandle(_T("uxtheme.dll")); 787 s_hUxtheme = ::GetModuleHandle(L"uxtheme.dll");
788 if (s_hUxtheme) 788 if (s_hUxtheme)
789 { 789 {
790 pfnClose = (CLOSETHEMEDATA)::GetProcAddress(s_hUxtheme, "CloseThemeData" ); 790 pfnClose = (CLOSETHEMEDATA)::GetProcAddress(s_hUxtheme, "CloseThemeData" );
791 if (!pfnClose) 791 if (!pfnClose)
792 { 792 {
793 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_GET _UXTHEME_CLOSE, "Class::InitObject - GetProcAddress(CloseThemeData)"); 793 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_GET _UXTHEME_CLOSE, "Class::InitObject - GetProcAddress(CloseThemeData)");
794 } 794 }
795 795
796 pfnDrawThemeBackground = (DRAWTHEMEBACKGROUND)::GetProcAddress(s_hUxthem e, "DrawThemeBackground"); 796 pfnDrawThemeBackground = (DRAWTHEMEBACKGROUND)::GetProcAddress(s_hUxthem e, "DrawThemeBackground");
797 if (!pfnDrawThemeBackground) 797 if (!pfnDrawThemeBackground)
(...skipping 23 matching lines...) Expand all
821 wcex.cbSize = sizeof(WNDCLASSEX); 821 wcex.cbSize = sizeof(WNDCLASSEX);
822 wcex.style = 0; 822 wcex.style = 0;
823 wcex.lpfnWndProc = (WNDPROC)PaneWindowProc; 823 wcex.lpfnWndProc = (WNDPROC)PaneWindowProc;
824 wcex.cbClsExtra = 0; 824 wcex.cbClsExtra = 0;
825 wcex.cbWndExtra = 0; 825 wcex.cbWndExtra = 0;
826 wcex.hInstance = _Module.m_hInst; 826 wcex.hInstance = _Module.m_hInst;
827 wcex.hIcon = NULL; 827 wcex.hIcon = NULL;
828 wcex.hCursor = NULL; 828 wcex.hCursor = NULL;
829 wcex.hbrBackground = NULL; 829 wcex.hbrBackground = NULL;
830 wcex.lpszMenuName = NULL; 830 wcex.lpszMenuName = NULL;
831 wcex.lpszClassName = _T(STATUSBAR_PANE_NAME); 831 wcex.lpszClassName = STATUSBAR_PANE_NAME;
832 wcex.hIconSm = NULL; 832 wcex.hIconSm = NULL;
833 833
834 s_criticalSectionLocal.Lock(); 834 s_criticalSectionLocal.Lock();
835 { 835 {
836 s_atomPaneClass = ::RegisterClassEx(&wcex); 836 s_atomPaneClass = ::RegisterClassEx(&wcex);
837 } 837 }
838 s_criticalSectionLocal.Unlock(); 838 s_criticalSectionLocal.Unlock();
839 839
840 if (!GetAtomPaneClass()) 840 if (!GetAtomPaneClass())
841 { 841 {
(...skipping 28 matching lines...) Expand all
870 } 870 }
871 return true; 871 return true;
872 } 872 }
873 873
874 bool CPluginClass::CreateStatusBarPane() 874 bool CPluginClass::CreateStatusBarPane()
875 { 875 {
876 CriticalSection::Lock lock(m_csStatusBar); 876 CriticalSection::Lock lock(m_csStatusBar);
877 877
878 CPluginClient* client = CPluginClient::GetInstance(); 878 CPluginClient* client = CPluginClient::GetInstance();
879 879
880 TCHAR szClassName[MAX_PATH]; 880 wchar_t szClassName[MAX_PATH];
881 // Get browser window and url 881 // Get browser window and url
882 HWND hBrowserWnd = GetBrowserHWND(); 882 HWND hBrowserWnd = GetBrowserHWND();
883 if (!hBrowserWnd) 883 if (!hBrowserWnd)
884 { 884 {
885 DEBUG_ERROR_LOG(0, PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_NO_STATUSBAR_BROWSER, "C lass::CreateStatusBarPane - No status bar") 885 DEBUG_ERROR_LOG(0, PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_NO_STATUSBAR_BROWSER, "C lass::CreateStatusBarPane - No status bar")
886 return false; 886 return false;
887 } 887 }
888 888
889 // Looking for a TabWindowClass window in IE7 889 // Looking for a TabWindowClass window in IE7
890 // the last one should be parent for statusbar 890 // the last one should be parent for statusbar
891 HWND hWndStatusBar = NULL; 891 HWND hWndStatusBar = NULL;
892 892
893 HWND hTabWnd = ::GetWindow(hBrowserWnd, GW_CHILD); 893 HWND hTabWnd = ::GetWindow(hBrowserWnd, GW_CHILD);
894 UINT amoundOfNewTabs = 0; 894 UINT amoundOfNewTabs = 0;
895 HWND uniqueNewTab = NULL; 895 HWND uniqueNewTab = NULL;
896 while (hTabWnd) 896 while (hTabWnd)
897 { 897 {
898 memset(szClassName, 0, MAX_PATH); 898 memset(szClassName, 0, MAX_PATH);
899 GetClassName(hTabWnd, szClassName, MAX_PATH); 899 GetClassName(hTabWnd, szClassName, MAX_PATH);
900 900
901 if (_tcscmp(szClassName, _T("TabWindowClass")) == 0 || _tcscmp(szClassName,_ T("Frame Tab")) == 0) 901 if (wcscmp(szClassName, L"TabWindowClass") == 0 || wcscmp(szClassName,L"Fram e Tab") == 0)
902 { 902 {
903 // IE8 support 903 // IE8 support
904 HWND hTabWnd2 = hTabWnd; 904 HWND hTabWnd2 = hTabWnd;
905 if (_tcscmp(szClassName,_T("Frame Tab")) == 0) 905 if (wcscmp(szClassName,L"Frame Tab") == 0)
906 { 906 {
907 hTabWnd2 = ::FindWindowEx(hTabWnd2, NULL, _T("TabWindowClass"), NULL); 907 hTabWnd2 = ::FindWindowEx(hTabWnd2, NULL, L"TabWindowClass", NULL);
908 } 908 }
909 909
910 if (hTabWnd2) 910 if (hTabWnd2)
911 { 911 {
912 DWORD nProcessId; 912 DWORD nProcessId;
913 ::GetWindowThreadProcessId(hTabWnd2, &nProcessId); 913 ::GetWindowThreadProcessId(hTabWnd2, &nProcessId);
914 if (::GetCurrentProcessId() == nProcessId) 914 if (::GetCurrentProcessId() == nProcessId)
915 { 915 {
916 bool bExistingTab = false; 916 bool bExistingTab = false;
917 917
(...skipping 27 matching lines...) Expand all
945 945
946 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 946 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
947 } 947 }
948 948
949 HWND hWnd = ::GetWindow(hBrowserWnd, GW_CHILD); 949 HWND hWnd = ::GetWindow(hBrowserWnd, GW_CHILD);
950 while (hWnd) 950 while (hWnd)
951 { 951 {
952 memset(szClassName, 0, MAX_PATH); 952 memset(szClassName, 0, MAX_PATH);
953 ::GetClassName(hWnd, szClassName, MAX_PATH); 953 ::GetClassName(hWnd, szClassName, MAX_PATH);
954 954
955 if (_tcscmp(szClassName,_T("msctls_statusbar32")) == 0) 955 if (wcscmp(szClassName,L"msctls_statusbar32") == 0)
956 { 956 {
957 hWndStatusBar = hWnd; 957 hWndStatusBar = hWnd;
958 break; 958 break;
959 } 959 }
960 960
961 hWnd = ::GetWindow(hWnd, GW_HWNDNEXT); 961 hWnd = ::GetWindow(hWnd, GW_HWNDNEXT);
962 } 962 }
963 963
964 if (!hWndStatusBar) 964 if (!hWndStatusBar)
965 { 965 {
(...skipping 18 matching lines...) Expand all
984 #ifdef _DEBUG 984 #ifdef _DEBUG
985 m_nPaneWidth = 70; 985 m_nPaneWidth = 70;
986 #else 986 #else
987 m_nPaneWidth = 22; 987 m_nPaneWidth = 22;
988 #endif 988 #endif
989 } 989 }
990 // Create pane window 990 // Create pane window
991 HWND hWndNewPane = ::CreateWindowEx( 991 HWND hWndNewPane = ::CreateWindowEx(
992 NULL, 992 NULL,
993 MAKEINTATOM(GetAtomPaneClass()), 993 MAKEINTATOM(GetAtomPaneClass()),
994 _T(""), 994 L"",
995 WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 995 WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
996 rcStatusBar.Width() - 500,0,m_nPaneWidth,rcStatusBar.Height(), 996 rcStatusBar.Width() - 500,0,m_nPaneWidth,rcStatusBar.Height(),
997 hWndStatusBar, 997 hWndStatusBar,
998 (HMENU)3671, 998 (HMENU)3671,
999 _Module.m_hInst, 999 _Module.m_hInst,
1000 NULL); 1000 NULL);
1001 1001
1002 if (!hWndNewPane) 1002 if (!hWndNewPane)
1003 { 1003 {
1004 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_CREATE_ST ATUSBAR_PANE, "Class::CreateStatusBarPane - CreateWindowEx") 1004 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_CREATE_ST ATUSBAR_PANE, "Class::CreateStatusBarPane - CreateWindowEx")
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 void CPluginClass::DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, U INT nMenuFlags) 1262 void CPluginClass::DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, U INT nMenuFlags)
1263 { 1263 {
1264 CPluginClient* client = CPluginClient::GetInstance(); 1264 CPluginClient* client = CPluginClient::GetInstance();
1265 1265
1266 CPluginSystem* system = CPluginSystem::GetInstance(); 1266 CPluginSystem* system = CPluginSystem::GetInstance();
1267 1267
1268 // Create menu parent window 1268 // Create menu parent window
1269 HWND hMenuWnd = ::CreateWindowEx( 1269 HWND hMenuWnd = ::CreateWindowEx(
1270 NULL, 1270 NULL,
1271 MAKEINTATOM(GetAtomPaneClass()), 1271 MAKEINTATOM(GetAtomPaneClass()),
1272 _T(""), 1272 L"",
1273 0, 1273 0,
1274 0,0,0,0, 1274 0,0,0,0,
1275 NULL, 1275 NULL,
1276 NULL, 1276 NULL,
1277 _Module.m_hInst, 1277 _Module.m_hInst,
1278 NULL); 1278 NULL);
1279 1279
1280 if (!hMenuWnd) 1280 if (!hMenuWnd)
1281 { 1281 {
1282 DestroyMenu(hMenu); 1282 DestroyMenu(hMenu);
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 return icon; 1925 return icon;
1926 } 1926 }
1927 1927
1928 ATOM CPluginClass::GetAtomPaneClass() 1928 ATOM CPluginClass::GetAtomPaneClass()
1929 { 1929 {
1930 return s_atomPaneClass; 1930 return s_atomPaneClass;
1931 } 1931 }
1932 1932
1933 HWND CPluginClass::GetTabHWND() const 1933 HWND CPluginClass::GetTabHWND() const
1934 { 1934 {
1935 1935 wchar_t szClassName[MAX_PATH];
1936 TCHAR szClassName[MAX_PATH];
1937 // Get browser window and url 1936 // Get browser window and url
1938 HWND hBrowserWnd = GetBrowserHWND(); 1937 HWND hBrowserWnd = GetBrowserHWND();
1939 if (!hBrowserWnd) 1938 if (!hBrowserWnd)
1940 { 1939 {
1941 DEBUG_ERROR_LOG(0, PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_NO_STATUSBAR_BROWSER, "C lass::GetTabWindow - No tab window") 1940 DEBUG_ERROR_LOG(0, PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_NO_STATUSBAR_BROWSER, "C lass::GetTabWindow - No tab window")
1942 s_criticalSectionWindow.Unlock(); 1941 s_criticalSectionWindow.Unlock();
1943 1942
1944 return false; 1943 return false;
1945 } 1944 }
1946 1945
1947 // Looking for a TabWindowClass window in IE7 1946 // Looking for a TabWindowClass window in IE7
1948 1947
1949 HWND hTabWnd = ::GetWindow(hBrowserWnd, GW_CHILD); 1948 HWND hTabWnd = ::GetWindow(hBrowserWnd, GW_CHILD);
1950 while (hTabWnd) 1949 while (hTabWnd)
1951 { 1950 {
1952 memset(szClassName, 0, MAX_PATH); 1951 memset(szClassName, 0, MAX_PATH);
1953 GetClassName(hTabWnd, szClassName, MAX_PATH); 1952 GetClassName(hTabWnd, szClassName, MAX_PATH);
1954 1953
1955 if (_tcscmp(szClassName, _T("TabWindowClass")) == 0 || _tcscmp(szClassName,_ T("Frame Tab")) == 0) 1954 if (wcscmp(szClassName, L"TabWindowClass") == 0 || wcscmp(szClassName, L"Fra me Tab") == 0)
1956 { 1955 {
1957 // IE8 support 1956 // IE8 support
1958 HWND hTabWnd2 = hTabWnd; 1957 HWND hTabWnd2 = hTabWnd;
1959 if (_tcscmp(szClassName,_T("Frame Tab")) == 0) 1958 if (wcscmp(szClassName, L"Frame Tab") == 0)
1960 { 1959 {
1961 hTabWnd2 = ::FindWindowEx(hTabWnd2, NULL, _T("TabWindowClass"), NULL); 1960 hTabWnd2 = ::FindWindowEx(hTabWnd2, NULL, L"TabWindowClass", NULL);
1962 } 1961 }
1963 1962
1964 if (hTabWnd2) 1963 if (hTabWnd2)
1965 { 1964 {
1966 DWORD nProcessId; 1965 DWORD nProcessId;
1967 ::GetWindowThreadProcessId(hTabWnd2, &nProcessId); 1966 ::GetWindowThreadProcessId(hTabWnd2, &nProcessId);
1968 if (::GetCurrentProcessId() == nProcessId) 1967 if (::GetCurrentProcessId() == nProcessId)
1969 { 1968 {
1970 bool bExistingTab = false; 1969 bool bExistingTab = false;
1971 s_criticalSectionLocal.Lock(); 1970 s_criticalSectionLocal.Lock();
(...skipping 21 matching lines...) Expand all
1993 } 1992 }
1994 } 1993 }
1995 } 1994 }
1996 1995
1997 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1996 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1998 } 1997 }
1999 1998
2000 return hTabWnd; 1999 return hTabWnd;
2001 2000
2002 } 2001 }
OLDNEW
« no previous file with comments | « src/plugin/Plugin.cpp ('k') | src/plugin/PluginFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld