summaryrefslogtreecommitdiff
path: root/plugins/Weather
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/Weather
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/Weather')
-rw-r--r--plugins/Weather/src/weather_icons.cpp34
1 files changed, 6 insertions, 28 deletions
diff --git a/plugins/Weather/src/weather_icons.cpp b/plugins/Weather/src/weather_icons.cpp
index 119d826859..5cc7f5b907 100644
--- a/plugins/Weather/src/weather_icons.cpp
+++ b/plugins/Weather/src/weather_icons.cpp
@@ -22,14 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
HANDLE hIcoLibIconsChanged = NULL;
-struct _tag_iconList
-{
- char* szDescr;
- char* szName;
- int defIconID;
- HANDLE hIconLibItem;
-}
-static iconList[] =
+static IconItem iconList[] =
{
{ LPGEN("Protocol icon"), "main", IDI_ICON },
{ LPGEN("Update Disabled"), "disabled", IDI_DISABLED },
@@ -46,23 +39,8 @@ static iconList[] =
void InitIcons(void)
{
- char szSettingName[100];
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(hInst, szFile, MAX_PATH);
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.ptszDefaultFile = szFile;
- sid.pszName = szSettingName;
- sid.pszSection = WEATHERPROTONAME;
- sid.flags = SIDF_PATH_TCHAR;
-
- for (int i = 0; i < SIZEOF(iconList); i++) {
- mir_snprintf(szSettingName, SIZEOF( szSettingName ), "%s_%s", WEATHERPROTONAME, iconList[i].szName);
-
- sid.pszDescription = iconList[i].szDescr;
- sid.iDefaultIndex = -iconList[i].defIconID;
- iconList[i].hIconLibItem = Skin_AddIcon(&sid);
-} }
+ Icon_Register(hInst, WEATHERPROTONAME, iconList, SIZEOF(iconList), WEATHERPROTONAME);
+}
HICON LoadIconEx(const char* name, BOOL big)
{
@@ -73,10 +51,10 @@ HICON LoadIconEx(const char* name, BOOL big)
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;
}