diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-14 08:19:21 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-14 08:19:21 +0000 |
commit | e179ffc995c96568bfdce46ac73f58d569166f05 (patch) | |
tree | ee2dfd530b75ef4ae06cb7079c923fe7e2fbafa8 /protocols/Yahoo/src/icolib.cpp | |
parent | d722261be7a0cd3aa259aa285aea7f936c0e2f0e (diff) |
Yahoo: folders restructurization
git-svn-id: http://svn.miranda-ng.org/main/trunk@1918 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo/src/icolib.cpp')
-rw-r--r-- | protocols/Yahoo/src/icolib.cpp | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/protocols/Yahoo/src/icolib.cpp b/protocols/Yahoo/src/icolib.cpp new file mode 100644 index 0000000000..09ad4853b0 --- /dev/null +++ b/protocols/Yahoo/src/icolib.cpp @@ -0,0 +1,86 @@ +/*
+ * $Id: util.c 3936 2006-10-02 06:58:19Z ghazan $
+ *
+ * myYahoo Miranda Plugin
+ *
+ * Authors: Gennady Feldman (aka Gena01)
+ * Laurent Marechal (aka Peorth)
+ *
+ * This code is under GPL and is based on AIM, MSN and Miranda source code.
+ * I want to thank Robert Rainwater and George Hazan for their code and support
+ * and for answering some of my questions during development of this plugin.
+ */
+#include "yahoo.h"
+#include <m_langpack.h>
+#include <win2k.h>
+#include "m_icolib.h"
+
+#include "resource.h"
+
+struct
+{
+ const char* szDescr;
+ const char* szName;
+ int defIconID;
+}
+static iconList[] = {
+ { LPGEN("Main"), "yahoo", IDI_YAHOO },
+ { LPGEN("Mail"), "mail", IDI_INBOX },
+ { LPGEN("Profile"), "profile", IDI_PROFILE },
+ { LPGEN("Refresh"), "refresh", IDI_REFRESH },
+ { LPGEN("Address Book"), "yab", IDI_YAB },
+ { LPGEN("Set Status"), "set_status", IDI_SET_STATUS },
+ { LPGEN("Calendar"), "calendar", IDI_CALENDAR }
+};
+
+HANDLE hIconLibItem[SIZEOF(iconList)];
+
+void CYahooProto::IconsInit( void )
+{
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(hInstance, szFile, SIZEOF(szFile));
+
+ char szSectionName[100];
+ mir_snprintf(szSectionName, sizeof(szSectionName), "%s/%s", LPGEN("Protocols"), LPGEN("YAHOO"));
+
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(SKINICONDESC);
+ sid.ptszDefaultFile = szFile;
+ sid.pszSection = szSectionName;
+ sid.flags = SIDF_PATH_TCHAR;
+
+ for ( int i = 0; i < SIZEOF(iconList); i++ ) {
+ char szSettingName[100];
+ mir_snprintf( szSettingName, sizeof( szSettingName ), "YAHOO_%s", iconList[i].szName );
+
+ sid.pszName = szSettingName;
+ sid.pszDescription = (char* )iconList[i].szDescr;
+ sid.iDefaultIndex = -iconList[i].defIconID;
+ hIconLibItem[i] = Skin_AddIcon(&sid);
+ }
+}
+
+HICON CYahooProto::LoadIconEx( const char* name, bool big )
+{
+ char szSettingName[100];
+
+ mir_snprintf( szSettingName, sizeof( szSettingName ), "YAHOO_%s", name );
+
+ return ( HICON )CallService( MS_SKIN2_GETICON, big, (LPARAM)szSettingName );
+}
+
+HANDLE CYahooProto::GetIconHandle(int iconId)
+{
+ for (unsigned i=0; i < SIZEOF(iconList); i++)
+ if (iconList[i].defIconID == iconId)
+ return hIconLibItem[i];
+
+ return NULL;
+}
+
+void CYahooProto::ReleaseIconEx(const char* name, bool big)
+{
+ char szSettingName[100];
+ mir_snprintf(szSettingName, sizeof(szSettingName), "YAHOO_%s", name);
+ CallService(big ? MS_SKIN2_RELEASEICONBIG : MS_SKIN2_RELEASEICON, 0, (LPARAM)szSettingName);
+}
|