diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-09-13 09:25:50 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-09-13 09:25:50 +0000 |
commit | 437b5d6ab1333635cf5ba38e2d9e639448ab34bc (patch) | |
tree | 797b0149e6906fa8872ec6eb13884de5481ee79c /protocols/Tox/src/tox_icons.cpp | |
parent | f5584d8ae977f278ae9735f53ab868c8574c2451 (diff) |
Tox: removed useless own bicycle
git-svn-id: http://svn.miranda-ng.org/main/trunk@15339 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_icons.cpp')
-rw-r--r-- | protocols/Tox/src/tox_icons.cpp | 56 |
1 files changed, 5 insertions, 51 deletions
diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp index 756fc13bad..d049880361 100644 --- a/protocols/Tox/src/tox_icons.cpp +++ b/protocols/Tox/src/tox_icons.cpp @@ -1,6 +1,6 @@ #include "stdafx.h"
-IconInfo CToxProto::Icons[] =
+IconItemT CToxProto::Icons[] =
{
{ LPGENT("Protocol icon"), "main", IDI_TOX },
{ LPGENT("Audio call"), "audio_call", IDI_AUDIO_CALL },
@@ -11,60 +11,14 @@ IconInfo CToxProto::Icons[] = void CToxProto::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);
- }
-}
-
-HICON CToxProto::GetIcon(const char *name, bool size)
-{
- for (size_t i = 0; i < _countof(Icons); i++)
- if (mir_strcmpi(Icons[i].Name, name) == 0)
- return IcoLib_GetIconByHandle(Icons[i].Handle, size);
-
- return NULL;
+ Icon_RegisterT(g_hInstance, LPGENT("Protocols") "/" LPGENT(MODULE), Icons, _countof(Icons), MODULE);
}
-HANDLE CToxProto::GetIconHandle(const char *name)
+HANDLE CToxProto::GetIconHandle(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 Icons[i].hIcolib;
return NULL;
-}
-
-HANDLE CToxProto::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 CToxProto::UninitIcons()
-{
- for (size_t i = 0; i < _countof(Icons); i++)
- IcoLib_RemoveIcon(Icons[i].Name);
}
\ No newline at end of file |