summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_icons.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-09-13 09:59:50 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-09-13 09:59:50 +0000
commit5d2ff1117e800b1fb31e3eafb5769c4499ec30a1 (patch)
tree389a5912b866fba5712ed4da50e659f92f686d48 /protocols/SkypeWeb/src/skype_icons.cpp
parent68ff208f0ed66fe1873c10d215f54e89ec309611 (diff)
SkypeWeb: correct icon handling
git-svn-id: http://svn.miranda-ng.org/main/trunk@15341 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_icons.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_icons.cpp47
1 files changed, 9 insertions, 38 deletions
diff --git a/protocols/SkypeWeb/src/skype_icons.cpp b/protocols/SkypeWeb/src/skype_icons.cpp
index ee5d6d904a..883a067a1a 100644
--- a/protocols/SkypeWeb/src/skype_icons.cpp
+++ b/protocols/SkypeWeb/src/skype_icons.cpp
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-IconInfo CSkypeProto::Icons[] =
+IconItemT CSkypeProto::Icons[] =
{
{ LPGENT("Protocol icon"), "main", IDI_SKYPE },
{ LPGENT("Create new chat icon"), "conference", IDI_CONFERENCE },
@@ -32,50 +32,21 @@ IconInfo CSkypeProto::Icons[] =
void CSkypeProto::InitIcons()
{
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(g_hInstance, szFile, MAX_PATH);
-
- char szSettingName[100];
- TCHAR szSectionName[100];
-
- SKINICONDESC sid = { 0 };
- sid.flags = SIDF_ALL_TCHAR;
- sid.defaultFile.t = szFile;
- sid.pszName = szSettingName;
- sid.section.t = szSectionName;
-
- mir_sntprintf(szSectionName, _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
- for (int i = 0; i < _countof(Icons); i++)
- {
- mir_snprintf(szSettingName, "%s_%s", MODULE, Icons[i].Name);
-
- sid.description.t = Icons[i].Description;
- sid.iDefaultIndex = -Icons[i].IconId;
- Icons[i].Handle = IcoLib_AddIcon(&sid);
- }
-
+ Icon_RegisterT(g_hInstance, LPGENT("Protocols") "/" LPGENT(MODULE), Icons, _countof(Icons), MODULE);
}
-HANDLE CSkypeProto::GetIconHandle(const char *name)
+HICON CSkypeProto::GetIcon(int iconId)
{
for (size_t i = 0; i < _countof(Icons); i++)
- if (mir_strcmpi(Icons[i].Name, name) == 0)
- return Icons[i].Handle;
+ if (Icons[i].defIconID == iconId)
+ return IcoLib_GetIconByHandle(Icons[i].hIcolib);
return 0;
}
-HANDLE CSkypeProto::Skin_GetIconHandle(const char *name)
-{
- char iconName[100];
- mir_snprintf(iconName, "%s_%s", MODULE, name);
- HANDLE hIcon = IcoLib_GetIconHandle(iconName);
- if (hIcon == NULL)
- hIcon = GetIconHandle(name);
- return hIcon;
-}
-
-void CSkypeProto::UninitIcons()
+HANDLE CSkypeProto::GetIconHandle(int iconId)
{
for (size_t i = 0; i < _countof(Icons); i++)
- IcoLib_RemoveIcon(Icons[i].Name);
+ if (Icons[i].defIconID == iconId)
+ return Icons[i].hIcolib;
+ return 0;
} \ No newline at end of file