summaryrefslogtreecommitdiff
path: root/plugins/NewsAggregator/Src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
commitc4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 (patch)
tree17a8627550b202d62df8e1df76d2585d3d0cdeaa /plugins/NewsAggregator/Src
parent5ea5feb7e052ca45af7bc9ed76e4a252bd71950d (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 'plugins/NewsAggregator/Src')
-rw-r--r--plugins/NewsAggregator/Src/Icons.cpp36
1 files changed, 6 insertions, 30 deletions
diff --git a/plugins/NewsAggregator/Src/Icons.cpp b/plugins/NewsAggregator/Src/Icons.cpp
index 9ba2b0c79b..4d10a52955 100644
--- a/plugins/NewsAggregator/Src/Icons.cpp
+++ b/plugins/NewsAggregator/Src/Icons.cpp
@@ -19,15 +19,7 @@ Boston, MA 02111-1307, USA.
#include "common.h"
-struct _tag_iconList
-{
- char* szDescr;
- char* szName;
- int defIconID;
- HANDLE hIconLibItem;
-}
-
-static iconList[] =
+static IconItem iconList[] =
{
{ LPGEN("Protocol icon"), "main", IDI_ICON },
{ LPGEN("Check All Feeds"), "checkall", IDI_CHECKALL },
@@ -39,23 +31,7 @@ static iconList[] =
VOID InitIcons()
{
- char szSettingName[100];
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(hInst, szFile, MAX_PATH);
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.flags = SIDF_ALL_TCHAR;
- sid.ptszDefaultFile = szFile;
- sid.pszName = szSettingName;
- sid.ptszSection = _T("News Aggregator");
-
- for (int i = 0; i < SIZEOF(iconList); i++) {
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, iconList[i].szName);
-
- sid.pszDescription = iconList[i].szDescr;
- sid.iDefaultIndex = -iconList[i].defIconID;
- iconList[i].hIconLibItem = Skin_AddIcon(&sid);
- }
+ Icon_Register(hInst, LPGEN("News Aggregator"), iconList, SIZEOF(iconList), MODULE);
}
HICON LoadIconEx(const char* name, BOOL big)
@@ -65,11 +41,11 @@ HICON LoadIconEx(const char* name, BOOL big)
return Skin_GetIcon(szSettingName, big);
}
-HANDLE GetIconHandle(const char* name)
+HANDLE GetIconHandle(const char* name)
{
- unsigned i;
- for (i=0; i < SIZEOF(iconList); i++)
+ for (int i=0; i < SIZEOF(iconList); i++)
if (strcmp(iconList[i].szName, name) == 0)
- return iconList[i].hIconLibItem;
+ return iconList[i].hIcolib;
+
return NULL;
} \ No newline at end of file