1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/*
* $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"
static IconItem 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 }
};
void CYahooProto::IconsInit( void )
{
Icon_Register(hInstance, "Protocols/YAHOO", iconList, SIZEOF(iconList), "YAHOO");
}
HICON CYahooProto::LoadIconEx( const char* name, bool big )
{
char szSettingName[100];
mir_snprintf(szSettingName, sizeof(szSettingName), "YAHOO_%s", name);
return Skin_GetIcon(szSettingName, big);
}
HANDLE CYahooProto::GetIconHandle(int iconId)
{
for (unsigned i=0; i < SIZEOF(iconList); i++)
if (iconList[i].defIconID == iconId)
return iconList[i].hIcolib;
return NULL;
}
void CYahooProto::ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
mir_snprintf(szSettingName, sizeof(szSettingName), "YAHOO_%s", name);
Skin_ReleaseIcon(szSettingName, big);
}
|