diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2012-10-03 18:30:39 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2012-10-03 18:30:39 +0000 |
commit | fdae978639989c9988f16385d4cdfb32a0467ef0 (patch) | |
tree | 2eed678ad08751613ddf34a4209e934f78a6115e /protocols/Skype/src/skype_icons.cpp | |
parent | 8cb2a99e08a3f8fadc3b39f00228efa7d2b20050 (diff) |
- added skype_menus.cpp, skype_services.cpp
- some minor changes
git-svn-id: http://svn.miranda-ng.org/main/trunk@1773 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_icons.cpp')
-rw-r--r-- | protocols/Skype/src/skype_icons.cpp | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/protocols/Skype/src/skype_icons.cpp b/protocols/Skype/src/skype_icons.cpp index db213b8197..bb8c727cb5 100644 --- a/protocols/Skype/src/skype_icons.cpp +++ b/protocols/Skype/src/skype_icons.cpp @@ -1,41 +1,47 @@ #include "skype_proto.h"
+// todo: need to move in CSkypeProto struct
struct _tag_iconList
{
- TCHAR* szDescr;
- char* szName;
- int defIconID;
- HANDLE hIconLibItem;
-}
-
-static iconList[] =
+ wchar_t* Description;
+ char* Name;
+ int IconId;
+ HANDLE Handle;
+} static iconList[] =
{
- {LPGENT("Protocol icon"), "main", IDI_ICON},
+ { LPGENT("Protocol icon"), "main", IDI_ICON },
};
-void IconsLoad()
+void CSkypeProto::InitIcons()
{
- TCHAR szFile[MAX_PATH];
- char szSettingName[100];
- TCHAR szSectionName[100];
- SKINICONDESC sid = {0};
- unsigned i;
+ wchar_t szFile[MAX_PATH];
+ ::GetModuleFileName(g_hInstance, szFile, MAX_PATH);
- GetModuleFileName(g_hInstance, szFile, MAX_PATH);
+ char szSettingName[100];
+ wchar_t szSectionName[100];
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
sid.flags = SIDF_ALL_TCHAR;
sid.ptszDefaultFile = szFile;
sid.pszName = szSettingName;
sid.ptszSection = szSectionName;
- mir_sntprintf(szSectionName, SIZEOF(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
- for (i = 0; i < SIZEOF(iconList); i++)
+ ::mir_sntprintf(szSectionName, SIZEOF(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
+ for (int i = 0; i < SIZEOF(iconList); i++)
{
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, iconList[i].szName);
+ ::mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, iconList[i].Name);
- sid.ptszDescription = iconList[i].szDescr;
- sid.iDefaultIndex = -iconList[i].defIconID;
- iconList[i].hIconLibItem = Skin_AddIcon(&sid);
+ sid.ptszDescription = iconList[i].Description;
+ sid.iDefaultIndex = -iconList[i].IconId;
+ iconList[i].Handle = ::Skin_AddIcon(&sid);
}
+}
+
+void CSkypeProto::UninitIcons()
+{
+ for (int i = 0; i < SIZEOF(iconList); i++)
+ {
+ ::Skin_RemoveIcon(iconList[i].Name);
+ }
}
\ No newline at end of file |