diff options
author | George Hazan <george.hazan@gmail.com> | 2012-12-01 13:25:11 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-12-01 13:25:11 +0000 |
commit | 854959cbc0a1bad2c086214be4d1a829b17a61f3 (patch) | |
tree | ee3de50f4b4e57f54ae20d139f97fa469ff90d34 /protocols | |
parent | 73ddc73d92675399e4619758d4b0881418de0a6d (diff) |
icolib: icon creation quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@2588 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/JabberG/src/jabber_icolib.cpp | 8 | ||||
-rw-r--r-- | protocols/MRA/res/resource.rc | 1 | ||||
-rw-r--r-- | protocols/MRA/src/MraIcons.cpp | 30 | ||||
-rw-r--r-- | protocols/MRA/src/resource.h | 1 |
4 files changed, 17 insertions, 23 deletions
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 2df794d300..3abf457b1b 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -347,7 +347,6 @@ static HICON LoadTransportIcon(char *filename,int i,char *IconName,TCHAR *SectNa {
char szPath[MAX_PATH],szMyPath[MAX_PATH], szFullPath[MAX_PATH],*str;
BOOL has_proto_icon=FALSE;
- SKINICONDESC sid={0};
if (needFree) *needFree=FALSE;
GetModuleFileNameA(NULL, szPath, MAX_PATH);
str=strrchr(szPath,'\\');
@@ -359,8 +358,8 @@ static HICON LoadTransportIcon(char *filename,int i,char *IconName,TCHAR *SectNa if (hi) has_proto_icon=TRUE;
if (hi && nf) DestroyIcon(hi);
if (IconName != NULL && SectName != NULL) {
- sid.cbSize = sizeof(sid);
- sid.hDefaultIcon = (has_proto_icon)?NULL:(HICON)CallService(MS_SKIN_LOADPROTOICON,0,(LPARAM)(-internalidx));
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.hDefaultIcon = (has_proto_icon) ? NULL : LoadSkinnedProtoIcon(0, -internalidx);
sid.ptszSection = SectName;
sid.pszName = IconName;
sid.ptszDescription = Description;
@@ -384,7 +383,6 @@ static HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName) int CJabberProto::LoadAdvancedIcons(int iID)
{
- int i;
char *proto = TransportProtoTable[iID].proto;
char defFile[MAX_PATH] = {0};
TCHAR Group[255];
@@ -398,7 +396,7 @@ int CJabberProto::LoadAdvancedIcons(int iID) hAdvancedStatusIcon=(HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
EnterCriticalSection(&m_csModeMsgMutex);
- for (i=0; i<ID_STATUS_ONTHEPHONE-ID_STATUS_OFFLINE; i++) {
+ for (int i=0; i < ID_STATUS_ONTHEPHONE-ID_STATUS_OFFLINE; i++) {
HICON hicon;
BOOL needFree;
int n=skinStatusToJabberStatus[i];
diff --git a/protocols/MRA/res/resource.rc b/protocols/MRA/res/resource.rc index ccc0d19ec0..3fcb6713ec 100644 --- a/protocols/MRA/res/resource.rc +++ b/protocols/MRA/res/resource.rc @@ -31,6 +31,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDI_MRA ICON "Magent.ico"
IDI_INBOX ICON "Mail.ico"
IDI_PROFILE ICON "Info.ico"
+IDI_DELETED ICON "Deleted.ico"
IDI_AUTHRUGUEST ICON "AuthReguest.ico"
IDI_AUTHGRANT ICON "AuthGrant.ico"
IDI_MAIL_NOTIFY ICON "MailNotify.ico"
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index be4790745f..a7bf1d446b 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -38,7 +38,7 @@ GUI_DISPLAY_ITEM gdiContactMenuItems[] = GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] =
{
- { ADV_ICON_DELETED_ID, ADV_ICON_DELETED_STR, (INT_PTR)IDI_ERROR, NULL },
+ { ADV_ICON_DELETED_ID, ADV_ICON_DELETED_STR, IDI_DELETED, NULL },
{ ADV_ICON_NOT_ON_SERVER_ID, ADV_ICON_NOT_ON_SERVER_STR, IDI_AUTHGRANT, NULL },
{ ADV_ICON_NOT_AUTHORIZED_ID, ADV_ICON_NOT_AUTHORIZED_STR, IDI_AUTHRUGUEST, NULL },
{ ADV_ICON_PHONE_ID, ADV_ICON_PHONE_STR, IDI_MRA_PHONE, NULL },
@@ -47,30 +47,28 @@ GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] = //////////////////////////////////////////////////////////////////////////////////////
-static void AddIcoLibItems(LPWSTR lpwszSubSectionName, GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount)
+static void AddIcoLibItems(LPWSTR lptszSubSectionName, GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount)
{
- char szBuff[MAX_PATH];
- WCHAR wszSection[MAX_PATH], wszPath[MAX_FILEPATH];
+ TCHAR tszSection[MAX_PATH], tszPath[MAX_FILEPATH];
+ GetModuleFileName(masMraSettings.hInstance, tszPath, SIZEOF(tszPath));
+ mir_sntprintf(tszSection, SIZEOF(tszSection), L"Protocols/MRA/%s", lptszSubSectionName);
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
- sid.pwszSection = wszSection;
- sid.pwszDefaultFile = wszPath;
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.ptszSection = tszSection;
+ sid.ptszDefaultFile = tszPath;
sid.cx = sid.cy = 16;
sid.flags = SIDF_ALL_UNICODE;
- if (lpwszSubSectionName == NULL) lpwszSubSectionName = L"";
- GetModuleFileName(masMraSettings.hInstance, wszPath, SIZEOF(wszPath));
- mir_sntprintf(wszSection, SIZEOF(wszSection), L"Protocols/MRA/%s", lpwszSubSectionName);
+ if (lptszSubSectionName == NULL)
+ lptszSubSectionName = _T("");
for (size_t i = 0;i<dwCount;i++) {
+ char szBuff[MAX_PATH];
mir_snprintf(szBuff, SIZEOF(szBuff), "MRA_%s", pgdiItems[i].lpszName);
+
sid.pszName = szBuff;
sid.pwszDescription = pgdiItems[i].lpwszDescr;
sid.iDefaultIndex = -pgdiItems[i].defIcon;
- sid.hDefaultIcon = (HICON)LoadImage(masMraSettings.hInstance, MAKEINTRESOURCE(pgdiItems[i].defIcon), IMAGE_ICON, 0, 0, LR_SHARED);
- if (sid.hDefaultIcon == NULL)
- sid.hDefaultIcon = (HICON)LoadImage(NULL, MAKEINTRESOURCE(pgdiItems[i].defIcon), IMAGE_ICON, 0, 0, LR_SHARED);
pgdiItems[i].hIconHandle = Skin_AddIcon(&sid);
}
}
@@ -125,10 +123,6 @@ void InitXStatusIcons() int iCurIndex = i+IDI_XSTATUS1-1;
sid.pwszDescription = lpcszXStatusNameDef[i];
sid.iDefaultIndex = -iCurIndex;
- if (masMraSettings.hDLLXStatusIcons)
- sid.hDefaultIcon = (HICON)LoadImage(masMraSettings.hDLLXStatusIcons, MAKEINTRESOURCE(iCurIndex), IMAGE_ICON, 0, 0, LR_SHARED);
- else
- sid.hDefaultIcon = NULL;
hXStatusAdvancedStatusIcons[i] = Skin_AddIcon(&sid);
}
diff --git a/protocols/MRA/src/resource.h b/protocols/MRA/src/resource.h index da661ea9be..103ca8e88b 100644 --- a/protocols/MRA/src/resource.h +++ b/protocols/MRA/src/resource.h @@ -19,6 +19,7 @@ #define IDI_MRA_POSTCARD 114
#define IDI_MRA_ZHUKI 115
#define IDI_MRA_PHOTO 117
+#define IDI_DELETED 118
#define IDI_MRA_CHAT 120
#define IDI_MRA_PHONE 122
#define IDD_OPT_FILES 126
|