diff options
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 |