LEFT | RIGHT |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 27 matching lines...) Expand all Loading... |
38 DWORD profileTime = 0; | 38 DWORD profileTime = 0; |
39 #endif | 39 #endif |
40 | 40 |
41 typedef HANDLE (WINAPI *OPENTHEMEDATA)(HWND, LPCWSTR); | 41 typedef HANDLE (WINAPI *OPENTHEMEDATA)(HWND, LPCWSTR); |
42 typedef HRESULT (WINAPI *DRAWTHEMEBACKGROUND)(HANDLE, HDC, INT, INT, LPRECT, LPR
ECT); | 42 typedef HRESULT (WINAPI *DRAWTHEMEBACKGROUND)(HANDLE, HDC, INT, INT, LPRECT, LPR
ECT); |
43 typedef HRESULT (WINAPI *CLOSETHEMEDATA)(HANDLE); | 43 typedef HRESULT (WINAPI *CLOSETHEMEDATA)(HANDLE); |
44 | 44 |
45 HICON CPluginClass::s_hIcons[ICON_MAX] = { NULL, NULL, NULL }; | 45 HICON CPluginClass::s_hIcons[ICON_MAX] = { NULL, NULL, NULL }; |
46 DWORD CPluginClass::s_hIconTypes[ICON_MAX] = { IDI_ICON_DISABLED, IDI_ICON_ENABL
ED, IDI_ICON_DEACTIVATED }; | 46 DWORD CPluginClass::s_hIconTypes[ICON_MAX] = { IDI_ICON_DISABLED, IDI_ICON_ENABL
ED, IDI_ICON_DEACTIVATED }; |
47 uint32_t iconHeight = 32; | 47 uint32_t iconHeight = 32; |
48 uint32_t iconWidth = 32; | 48 uint32_t iconWidth = 32; |
49 | 49 |
50 CPluginMimeFilterClient* CPluginClass::s_mimeFilter = NULL; | 50 CPluginMimeFilterClient* CPluginClass::s_mimeFilter = NULL; |
51 | 51 |
52 CLOSETHEMEDATA pfnClose = NULL; | 52 CLOSETHEMEDATA pfnClose = NULL; |
53 DRAWTHEMEBACKGROUND pfnDrawThemeBackground = NULL; | 53 DRAWTHEMEBACKGROUND pfnDrawThemeBackground = NULL; |
54 OPENTHEMEDATA pfnOpenThemeData = NULL; | 54 OPENTHEMEDATA pfnOpenThemeData = NULL; |
55 | 55 |
56 ATOM CPluginClass::s_atomPaneClass = NULL; | 56 ATOM CPluginClass::s_atomPaneClass = NULL; |
57 HINSTANCE CPluginClass::s_hUxtheme = NULL; | 57 HINSTANCE CPluginClass::s_hUxtheme = NULL; |
58 std::set<CPluginClass*> CPluginClass::s_instances; | 58 std::set<CPluginClass*> CPluginClass::s_instances; |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 // Calculate pane height | 991 // Calculate pane height |
992 AdblockPlus::Rectangle rcStatusBar; | 992 AdblockPlus::Rectangle rcStatusBar; |
993 ::GetClientRect(hWndStatusBar, &rcStatusBar); | 993 ::GetClientRect(hWndStatusBar, &rcStatusBar); |
994 | 994 |
995 if (rcStatusBar.Height() > 0) | 995 if (rcStatusBar.Height() > 0) |
996 { | 996 { |
997 if (rcStatusBar.Height() < iconWidth) | 997 if (rcStatusBar.Height() < iconWidth) |
998 { | 998 { |
999 iconWidth = 19; | 999 iconWidth = 19; |
1000 iconHeight = 19; | 1000 iconHeight = 19; |
1001 CPluginClass::s_hIconTypes[0] = IDI_ICON_DISABLED_19; | |
1002 CPluginClass::s_hIconTypes[1] = IDI_ICON_ENABLED_19; | |
1003 CPluginClass::s_hIconTypes[2] = IDI_ICON_DEACTIVATED_19; | |
1004 } | 1001 } |
1005 | 1002 |
1006 #ifdef _DEBUG | 1003 #ifdef _DEBUG |
1007 m_nPaneWidth = 70; | 1004 m_nPaneWidth = 70; |
1008 #else | 1005 #else |
1009 m_nPaneWidth = min(rcStatusBar.Height(), iconWidth); | 1006 m_nPaneWidth = min(rcStatusBar.Height(), iconWidth); |
1010 #endif | 1007 #endif |
1011 } | 1008 } |
1012 else | 1009 else |
1013 { | 1010 { |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1797 } | 1794 } |
1798 | 1795 |
1799 HICON CPluginClass::GetIcon(int type) | 1796 HICON CPluginClass::GetIcon(int type) |
1800 { | 1797 { |
1801 HICON icon = NULL; | 1798 HICON icon = NULL; |
1802 | 1799 |
1803 s_criticalSectionLocal.Lock(); | 1800 s_criticalSectionLocal.Lock(); |
1804 { | 1801 { |
1805 if (!s_hIcons[type]) | 1802 if (!s_hIcons[type]) |
1806 { | 1803 { |
1807 s_hIcons[type] = ::LoadIcon(_Module.m_hInst, MAKEINTRESOURCE(s_hIconTypes[
type])); | 1804 std::wstring imageToLoad = L"#"; |
| 1805 imageToLoad += std::to_wstring(s_hIconTypes[type]); |
| 1806 s_hIcons[type] = (HICON)::LoadImage(_Module.m_hInst, imageToLoad.c_str(),
IMAGE_ICON, iconWidth, iconHeight, LR_SHARED); |
1808 if (!s_hIcons[type]) | 1807 if (!s_hIcons[type]) |
1809 { | 1808 { |
1810 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_LOAD_
ICON, "Class::GetIcon - LoadIcon") | 1809 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_LOAD_
ICON, "Class::GetIcon - LoadIcon") |
1811 } | 1810 } |
1812 } | 1811 } |
1813 | 1812 |
1814 icon = s_hIcons[type]; | 1813 icon = s_hIcons[type]; |
1815 } | 1814 } |
1816 s_criticalSectionLocal.Unlock(); | 1815 s_criticalSectionLocal.Unlock(); |
1817 | 1816 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 } | 1884 } |
1886 } | 1885 } |
1887 } | 1886 } |
1888 | 1887 |
1889 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); | 1888 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); |
1890 } | 1889 } |
1891 | 1890 |
1892 return hTabWnd; | 1891 return hTabWnd; |
1893 | 1892 |
1894 } | 1893 } |
LEFT | RIGHT |