diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-03-17 20:33:47 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-03-17 20:33:47 +0000 |
commit | dd3d0e59dcd34beb222fcf612a51d3fee82c0e43 (patch) | |
tree | 0ae5a6e0a83399036d1452256ee3f89dc6da8872 /protocols/SkypeWeb/src/skype_icons.cpp | |
parent | 076fa9b3142f55fc736fbf58b20bfa45973acd68 (diff) |
SkypeWeb: initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@12424 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_icons.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_icons.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/skype_icons.cpp b/protocols/SkypeWeb/src/skype_icons.cpp new file mode 100644 index 0000000000..8f5fc273e1 --- /dev/null +++ b/protocols/SkypeWeb/src/skype_icons.cpp @@ -0,0 +1,63 @@ +#include "common.h"
+
+IconInfo CSkypeProto::Icons[] =
+{
+ { LPGENT("Protocol icon"), "main", IDI_SKYPE },
+};
+
+void CSkypeProto::InitIcons()
+{
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(g_hInstance, szFile, MAX_PATH);
+
+ char szSettingName[100];
+ TCHAR szSectionName[100];
+
+ SKINICONDESC sid = { 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 (int i = 0; i < SIZEOF(Icons); i++)
+ {
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, Icons[i].Name);
+
+ sid.ptszDescription = Icons[i].Description;
+ sid.iDefaultIndex = -Icons[i].IconId;
+ Icons[i].Handle = Skin_AddIcon(&sid);
+ }
+}
+
+HANDLE CSkypeProto::GetIconHandle(const char *name)
+{
+ for (size_t i = 0; i < SIZEOF(Icons); i++)
+ {
+ if (mir_strcmpi(Icons[i].Name, name) == 0)
+ {
+ return Icons[i].Handle;
+ }
+ }
+ return 0;
+}
+
+HANDLE CSkypeProto::GetSkinIconHandle(const char *name)
+{
+ char iconName[100];
+ mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, name);
+ HANDLE hIcon = Skin_GetIconHandle(iconName);
+ if (hIcon == NULL)
+ {
+ hIcon = GetIconHandle(name);
+ }
+ return hIcon;
+}
+
+void CSkypeProto::UninitIcons()
+{
+ for (size_t i = 0; i < SIZEOF(Icons); i++)
+ {
+ Skin_RemoveIcon(Icons[i].Name);
+ }
+}
\ No newline at end of file |