summaryrefslogtreecommitdiff
path: root/plugins/!Deprecated/Skype/src/skype_icons.cpp
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2014-09-05 12:08:52 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2014-09-05 12:08:52 +0000
commitf82091b2af907fb1d120c305da75c57b09cb0e7b (patch)
treef76f25019d39f634696021d2d391669fec633f9c /plugins/!Deprecated/Skype/src/skype_icons.cpp
parent387bba529b2a8878a6c66661c09fc02622fe32ea (diff)
SkypeKit based Skype plugin is moved to deprecated and will be deleted from Plugins folder by PluginUpdater
git-svn-id: http://svn.miranda-ng.org/main/trunk@10372 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/!Deprecated/Skype/src/skype_icons.cpp')
-rw-r--r--plugins/!Deprecated/Skype/src/skype_icons.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/plugins/!Deprecated/Skype/src/skype_icons.cpp b/plugins/!Deprecated/Skype/src/skype_icons.cpp
new file mode 100644
index 0000000000..5822cf2b37
--- /dev/null
+++ b/plugins/!Deprecated/Skype/src/skype_icons.cpp
@@ -0,0 +1,66 @@
+#include "skype.h"
+
+_tag_iconList CSkypeProto::IconList[] =
+{
+ { LPGENT("Protocol icon"), "main", IDI_SKYPE },
+
+ { LPGENT("Call"), "call", IDI_CALL },
+ { LPGENT("Invite to conference"), "addContacts", IDI_ADD_CONTACTS },
+ { LPGENT("Conference"), "conference", IDI_CONFERENCE },
+ { LPGENT("Send contact"), "sendContacts", IDI_SEND_CONTACTS },
+ { LPGENT("Contact"), "contact", IDI_CONTACT },
+ { LPGENT("Delete"), "delete", IDI_DELETE },
+ { LPGENT("Block"), "block", IDI_BLOCK },
+};
+
+void CSkypeProto::InitIcons()
+{
+ wchar_t 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 (int i = 0; i < SIZEOF(CSkypeProto::IconList); i++)
+ {
+ ::mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, CSkypeProto::IconList[i].Name);
+
+ sid.ptszDescription = CSkypeProto::IconList[i].Description;
+ sid.iDefaultIndex = -CSkypeProto::IconList[i].IconId;
+ CSkypeProto::IconList[i].Handle = ::Skin_AddIcon(&sid);
+ }
+}
+
+HANDLE CSkypeProto::GetIconHandle(const char* name)
+{
+ for (size_t i = 0; i < SIZEOF(CSkypeProto::IconList); i++)
+ {
+ if (::stricmp(CSkypeProto::IconList[i].Name, name) == 0)
+ return CSkypeProto::IconList[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)
+ hIcon = CSkypeProto::GetIconHandle(name);
+ return hIcon;
+}
+
+void CSkypeProto::UninitIcons()
+{
+ for (size_t i = 0; i < SIZEOF(CSkypeProto::IconList); i++)
+ ::Skin_RemoveIcon(CSkypeProto::IconList[i].Name);
+} \ No newline at end of file