diff options
author | George Hazan <george.hazan@gmail.com> | 2012-12-02 18:19:49 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-12-02 18:19:49 +0000 |
commit | c4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 (patch) | |
tree | 17a8627550b202d62df8e1df76d2585d3d0cdeaa /protocols/MSN | |
parent | 5ea5feb7e052ca45af7bc9ed76e4a252bd71950d (diff) |
new easy standard way of registering icons: Icon_Register
git-svn-id: http://svn.miranda-ng.org/main/trunk@2601 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN')
-rw-r--r-- | protocols/MSN/src/msn_opts.cpp | 57 |
1 files changed, 15 insertions, 42 deletions
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index bac6553e8f..30e74d4d36 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -27,52 +27,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /////////////////////////////////////////////////////////////////////////////////////////
// Icons init
-struct _tag_iconList
+static IconItem iconList[] =
{
- const char* szDescr;
- const char* szName;
- int defIconID;
-}
-static const iconList[] =
-{
- { LPGEN("Protocol icon"), "main", IDI_MSN },
- { LPGEN("Hotmail Inbox"), "inbox", IDI_INBOX },
- { LPGEN("Profile"), "profile", IDI_PROFILE },
- { LPGEN("MSN Services"), "services", IDI_SERVICES },
- { LPGEN("Block user"), "block", IDI_MSNBLOCK },
- { LPGEN("Invite to chat"), "invite", IDI_INVITE },
- { LPGEN("Start Netmeeting"), "netmeeting", IDI_NETMEETING },
- { LPGEN("Contact list"), "list_fl", IDI_LIST_FL },
- { LPGEN("Allowed list"), "list_al", IDI_LIST_AL },
- { LPGEN("Blocked list"), "list_bl", IDI_LIST_BL },
- { LPGEN("Relative list"), "list_rl", IDI_LIST_RL },
- { LPGEN("Local list"), "list_lc", IDI_LIST_LC },
+ { LPGEN("Protocol icon"), "main", IDI_MSN },
+ { LPGEN("Hotmail Inbox"), "inbox", IDI_INBOX },
+ { LPGEN("Profile"), "profile", IDI_PROFILE },
+ { LPGEN("MSN Services"), "services", IDI_SERVICES },
+ { LPGEN("Block user"), "block", IDI_MSNBLOCK },
+ { LPGEN("Invite to chat"), "invite", IDI_INVITE },
+ { LPGEN("Start Netmeeting"), "netmeeting", IDI_NETMEETING },
+ { LPGEN("Contact list"), "list_fl", IDI_LIST_FL },
+ { LPGEN("Allowed list"), "list_al", IDI_LIST_AL },
+ { LPGEN("Blocked list"), "list_bl", IDI_LIST_BL },
+ { LPGEN("Relative list"), "list_rl", IDI_LIST_RL },
+ { LPGEN("Local list"), "list_lc", IDI_LIST_LC },
};
-HANDLE hIconLibItem[SIZEOF(iconList)];
-
-
void MsnInitIcons(void)
{
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(hInst, szFile, SIZEOF(szFile));
-
- char szSectionName[100];
- mir_snprintf(szSectionName, sizeof(szSectionName), "%s/%s", LPGEN("Protocols"), LPGEN("MSN"));
-
- SKINICONDESC sid = { sizeof(sid) };
- 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), "MSN_%s", iconList[i].szName);
- sid.pszName = szSettingName;
- sid.pszDescription = (char*)iconList[i].szDescr;
- sid.iDefaultIndex = -iconList[i].defIconID;
- hIconLibItem[i] = Skin_AddIcon(&sid);
- }
+ Icon_Register(hInst, "Protocols/MSN", iconList, SIZEOF(iconList), "MSN");
}
HICON LoadIconEx(const char* name, bool big)
@@ -86,7 +59,7 @@ HANDLE GetIconHandle(int iconId) {
for (unsigned i=0; i < SIZEOF(iconList); i++)
if (iconList[i].defIconID == iconId)
- return hIconLibItem[i];
+ return iconList[i].hIcolib;
return NULL;
}
|