Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 | 2 |
3 #include "PluginClass.h" | 3 #include "PluginClass.h" |
4 #include "PluginSettings.h" | 4 #include "PluginSettings.h" |
5 #include "PluginSystem.h" | 5 #include "PluginSystem.h" |
6 #ifdef SUPPORT_FILTER | 6 #ifdef SUPPORT_FILTER |
7 #include "PluginFilter.h" | 7 #include "PluginFilter.h" |
8 #endif | 8 #endif |
9 #include "PluginMimeFilterClient.h" | 9 #include "PluginMimeFilterClient.h" |
10 #include "PluginClient.h" | 10 #include "PluginClient.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 CComAutoCriticalSection CPluginClass::s_criticalSectionLocal; | 42 CComAutoCriticalSection CPluginClass::s_criticalSectionLocal; |
43 CComAutoCriticalSection CPluginClass::s_criticalSectionBrowser; | 43 CComAutoCriticalSection CPluginClass::s_criticalSectionBrowser; |
44 CComAutoCriticalSection CPluginClass::s_criticalSectionWindow; | 44 CComAutoCriticalSection CPluginClass::s_criticalSectionWindow; |
45 | 45 |
46 CComQIPtr<IWebBrowser2> CPluginClass::s_asyncWebBrowser2; | 46 CComQIPtr<IWebBrowser2> CPluginClass::s_asyncWebBrowser2; |
47 | 47 |
48 #ifdef SUPPORT_WHITELIST | 48 #ifdef SUPPORT_WHITELIST |
49 std::map<UINT,CString> CPluginClass::s_menuDomains; | 49 std::map<UINT,CString> CPluginClass::s_menuDomains; |
50 #endif | 50 #endif |
51 | 51 |
52 namespace | 52 /* |
53 { | 53 * Without namespace declaration, the identifier "Rectangle" is ambiguous |
54 // Without an extra namespace within the anonymous one, the identifier "Rectan gle" is ambiguous | 54 * See http://msdn.microsoft.com/en-us/library/windows/desktop/dd162898(v=vs.85) .aspx |
55 // See http://msdn.microsoft.com/en-us/library/windows/desktop/dd162898(v=vs.8 5).aspx | 55 */ |
56 namespace AdblockPlus | 56 namespace AdblockPlus |
Felix Dahlke
2014/07/24 07:24:17
This would normally be an anonymous namespace, so
| |
57 { | 57 { |
58 /** | 58 /** |
59 * Replacement for ATL type CRect. | 59 * Replacement for ATL type CRect. |
60 */ | 60 */ |
61 class Rectangle | 61 class Rectangle |
62 : public RECT | 62 : public RECT |
63 { | 63 { |
64 public: | 64 public: |
65 // C++11 noexcept | 65 int Height() const |
66 int Height() const | 66 { |
67 { | 67 return bottom - top; |
68 return bottom - top; | 68 } |
69 } | 69 |
70 | 70 int Width() const |
71 // C++11 noexcept | 71 { |
72 int Width() const | 72 return right - left; |
73 { | 73 } |
74 return right - left; | 74 }; |
75 } | |
76 }; | |
77 } | |
78 } | 75 } |
79 | 76 |
80 CPluginClass::CPluginClass() | 77 CPluginClass::CPluginClass() |
81 { | 78 { |
82 //Use this line to debug memory leaks | 79 //Use this line to debug memory leaks |
83 // _CrtDumpMemoryLeaks(); | 80 // _CrtDumpMemoryLeaks(); |
84 | 81 |
85 m_isAdviced = false; | 82 m_isAdviced = false; |
86 m_nConnectionID = 0; | 83 m_nConnectionID = 0; |
87 m_hTabWnd = NULL; | 84 m_hTabWnd = NULL; |
(...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1747 if (hIcon) | 1744 if (hIcon) |
1748 { | 1745 { |
1749 ::DrawIconEx(hDC, offx, (rcClient.Height() - 16)/2 + 2, hIcon, 16, 16, NULL, NULL, DI_NORMAL); | 1746 ::DrawIconEx(hDC, offx, (rcClient.Height() - 16)/2 + 2, hIcon, 16, 16, NULL, NULL, DI_NORMAL); |
1750 offx += 22; | 1747 offx += 22; |
1751 } | 1748 } |
1752 #ifdef _DEBUG | 1749 #ifdef _DEBUG |
1753 // Display version | 1750 // Display version |
1754 HFONT hFont = (HFONT)::SendMessage(pClass->m_hStatusBarWnd, WM_GETFONT, 0, 0); | 1751 HFONT hFont = (HFONT)::SendMessage(pClass->m_hStatusBarWnd, WM_GETFONT, 0, 0); |
1755 HGDIOBJ hOldFont = ::SelectObject(hDC,hFont); | 1752 HGDIOBJ hOldFont = ::SelectObject(hDC,hFont); |
1756 | 1753 |
1757 Local::Rectangle rcText = rcClient; | 1754 AdblockPlus::Rectangle rcText = rcClient; |
sergei
2014/07/23 13:34:49
Should Local be renamed to AdblockPlus?
Eric
2014/07/23 16:34:14
That's what I get for compiling in Release configu
| |
1758 rcText.left += offx; | 1755 rcText.left += offx; |
1759 ::SetBkMode(hDC, TRANSPARENT); | 1756 ::SetBkMode(hDC, TRANSPARENT); |
1760 ::DrawTextW(hDC, IEPLUGIN_VERSION, -1, &rcText, DT_WORD_ELLIPSIS|DT_LEFT |DT_SINGLELINE|DT_VCENTER); | 1757 ::DrawTextW(hDC, IEPLUGIN_VERSION, -1, &rcText, DT_WORD_ELLIPSIS|DT_LEFT |DT_SINGLELINE|DT_VCENTER); |
1761 | 1758 |
1762 ::SelectObject(hDC, hOldFont); | 1759 ::SelectObject(hDC, hOldFont); |
1763 #endif // _DEBUG | 1760 #endif // _DEBUG |
1764 } | 1761 } |
1765 | 1762 |
1766 // Done! | 1763 // Done! |
1767 EndPaint(hWnd, &ps); | 1764 EndPaint(hWnd, &ps); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1997 } | 1994 } |
1998 } | 1995 } |
1999 } | 1996 } |
2000 | 1997 |
2001 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); | 1998 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); |
2002 } | 1999 } |
2003 | 2000 |
2004 return hTabWnd; | 2001 return hTabWnd; |
2005 | 2002 |
2006 } | 2003 } |
LEFT | RIGHT |