diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-15 14:23:02 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-15 14:23:02 +0000 |
commit | 3f9882178018afbe9aaaba1f4461f3fc75493260 (patch) | |
tree | 50554bd4a21472624c94a859bfdc5e8758becd45 /src | |
parent | 547ec570deb26f93fa4ab974a76c0e964a635586 (diff) |
MS_SKIN_LOADICON & MS_SKIN_LOADPROTOICON replaced with direct function calls
git-svn-id: http://svn.miranda-ng.org/main/trunk@14176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
59 files changed, 217 insertions, 238 deletions
diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp index 3a1a1d43eb..e2a4148e67 100644 --- a/src/core/stdauth/src/auth.cpp +++ b/src/core/stdauth/src/auth.cpp @@ -92,7 +92,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) else
mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("%u requests authorization"), *(PDWORD)dbei.pBlob);
- cli.hIcon = LoadSkinIcon(SKINICON_AUTH_REQUEST);
+ cli.hIcon = Skin_LoadIcon(SKINICON_AUTH_REQUEST);
cli.pszService = MS_AUTH_SHOWREQUEST;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cli);
}
@@ -103,7 +103,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) else
mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("%u added you to their contact list"), *(PDWORD)dbei.pBlob);
- cli.hIcon = LoadSkinIcon(SKINICON_AUTH_ADD);
+ cli.hIcon = Skin_LoadIcon(SKINICON_AUTH_ADD);
cli.pszService = MS_AUTH_SHOWADDED;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cli);
}
diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp index 80f775ff8f..7cee287dd1 100644 --- a/src/core/stdaway/src/awaymsg.cpp +++ b/src/core/stdaway/src/awaymsg.cpp @@ -148,7 +148,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(status)) {
mi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_NOTOFFLINE | CMIM_ICON | CMIF_TCHAR;
- mi.hIcon = LoadSkinProtoIcon(szProto, status);
+ mi.hIcon = Skin_LoadProtoIcon(szProto, status);
}
}
}
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index 5f5246dde4..1347036dd4 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -445,7 +445,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam }
RECT rc = dis->rcItem;
- DrawIconEx(dis->hDC, 3, (rc.top + rc.bottom - 16) / 2, LoadSkinnedProtoIcon(NULL, dis->itemData), 16, 16, 0, NULL, DI_NORMAL);
+ DrawIconEx(dis->hDC, 3, (rc.top + rc.bottom - 16) / 2, Skin_LoadProtoIcon(NULL, dis->itemData), 16, 16, 0, NULL, DI_NORMAL);
rc.left += 25;
SetBkMode(dis->hDC, TRANSPARENT);
DrawText(dis->hDC, buf, -1, &rc, DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX);
diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 48b31036a2..0528908ae0 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -79,12 +79,12 @@ int OnShutdown(WPARAM, LPARAM) static void OnCreateModule(MODULEINFO *mi)
{
- mi->OnlineIconIndex = ImageList_AddIcon(hIconsList, LoadSkinnedProtoIcon(mi->pszModule, ID_STATUS_ONLINE));
+ mi->OnlineIconIndex = ImageList_AddIcon(hIconsList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_ONLINE));
mi->hOnlineIcon = ImageList_GetIcon(hIconsList, mi->OnlineIconIndex, ILD_TRANSPARENT);
mi->hOnlineTalkIcon = ImageList_GetIcon(hIconsList, mi->OnlineIconIndex, ILD_TRANSPARENT | INDEXTOOVERLAYMASK(1));
ImageList_AddIcon(hIconsList, mi->hOnlineTalkIcon);
- mi->OfflineIconIndex = ImageList_AddIcon(hIconsList, LoadSkinnedProtoIcon(mi->pszModule, ID_STATUS_OFFLINE));
+ mi->OfflineIconIndex = ImageList_AddIcon(hIconsList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_OFFLINE));
mi->hOfflineIcon = ImageList_GetIcon(hIconsList, mi->OfflineIconIndex, ILD_TRANSPARENT);
mi->hOfflineTalkIcon = ImageList_GetIcon(hIconsList, mi->OfflineIconIndex, ILD_TRANSPARENT | INDEXTOOVERLAYMASK(1));
ImageList_AddIcon(hIconsList, mi->hOfflineTalkIcon);
@@ -398,7 +398,7 @@ extern "C" __declspec(dllexport) int Unload(void) void LoadIcons(void)
{
hIconsList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 0, 100);
- ImageList_AddIcon(hIconsList, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE));
+ ImageList_AddIcon(hIconsList, Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
ImageList_AddIcon(hIconsList, LoadIconEx("overlay", FALSE));
ImageList_SetOverlayImage(hIconsList, 1, 1);
}
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index a710d2be23..3e8edd8030 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -1835,14 +1835,14 @@ END_REMOVETAB: FillRect(dis->hDC, &dis->rcItem, pci->hListBkgBrush);
if (g_Settings.bShowContactStatus && g_Settings.bContactStatusFirst && ui->ContactStatus) {
- HICON hIcon = LoadSkinnedProtoIcon(si->pszModule, ui->ContactStatus);
+ HICON hIcon = Skin_LoadProtoIcon(si->pszModule, ui->ContactStatus);
DrawIconEx(dis->hDC, x_offset, dis->rcItem.top+offset-3,hIcon,16,16,0,NULL, DI_NORMAL);
x_offset += 18;
}
DrawIconEx(dis->hDC,x_offset, dis->rcItem.top + offset,hIcon,10,10,0,NULL, DI_NORMAL);
x_offset += 12;
if (g_Settings.bShowContactStatus && !g_Settings.bContactStatusFirst && ui->ContactStatus) {
- HICON hIcon = LoadSkinnedProtoIcon(si->pszModule, ui->ContactStatus);
+ HICON hIcon = Skin_LoadProtoIcon(si->pszModule, ui->ContactStatus);
DrawIconEx(dis->hDC, x_offset, dis->rcItem.top+offset-3,hIcon,16,16,0,NULL, DI_NORMAL);
x_offset += 18;
}
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index bbd013a7af..3312357c5b 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -449,7 +449,7 @@ int ClcModernOptInit(WPARAM wParam, LPARAM lParam) obj.cbSize = sizeof(obj);
obj.dwFlags = MODEROPT_FLG_TCHAR;
- obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ obj.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
obj.hInstance = g_hInst;
obj.iSection = MODERNOPT_PAGE_SKINS;
obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE;
diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp index c39709e9ee..aad1364110 100644 --- a/src/core/stdclist/src/clistopts.cpp +++ b/src/core/stdclist/src/clistopts.cpp @@ -259,7 +259,7 @@ int CListModernOptInit(WPARAM wParam, LPARAM lParam) MODERNOPTOBJECT obj = { 0 };
obj.cbSize = sizeof(obj);
obj.dwFlags = MODEROPT_FLG_TCHAR | MODEROPT_FLG_NORESIZE;
- obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ obj.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
obj.hInstance = g_hInst;
obj.iSection = MODERNOPT_PAGE_CLIST;
obj.iType = MODERNOPT_TYPE_SECTIONPAGE;
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp index 50b947abf1..af5fe02bee 100644 --- a/src/core/stdclist/src/cluiopts.cpp +++ b/src/core/stdclist/src/cluiopts.cpp @@ -350,7 +350,7 @@ int CluiModernOptInit(WPARAM wParam, LPARAM lParam) obj.cbSize = sizeof(obj);
obj.dwFlags = MODEROPT_FLG_TCHAR|MODEROPT_FLG_NORESIZE;
- obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ obj.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
obj.hInstance = g_hInst;
obj.iSection = MODERNOPT_PAGE_CLIST;
obj.iType = MODERNOPT_TYPE_SECTIONPAGE;
diff --git a/src/core/stdemail/src/email.cpp b/src/core/stdemail/src/email.cpp index fa025cfd1b..270e818e1b 100644 --- a/src/core/stdemail/src/email.cpp +++ b/src/core/stdemail/src/email.cpp @@ -68,7 +68,7 @@ int LoadSendRecvEMailModule(void) {
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000010000;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_SENDEMAIL);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_SENDEMAIL);
mi.pszName = LPGEN("&E-mail");
mi.pszService = MS_EMAIL_SENDEMAIL;
hEMailMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 58db4a89e9..d6a28d2072 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -127,7 +127,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) cle.ptszTooltip = szTooltip;
cle.flags |= CLEF_TCHAR;
- cle.hIcon = LoadSkinIcon(SKINICON_EVENT_FILE);
+ cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_FILE);
cle.pszService = "SRFile/RecvFile";
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
@@ -338,7 +338,7 @@ static int SRFileModulesLoaded(WPARAM, LPARAM) {
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000020000;
- mi.icolibItem = GetSkinIconHandle(SKINICON_EVENT_FILE);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_FILE);
mi.pszName = LPGEN("&File");
mi.pszService = MS_FILE_SENDFILE;
hSRFileMenuItem = Menu_AddContactMenuItem(&mi);
@@ -435,7 +435,7 @@ int LoadSendRecvFileModule(void) CreateServiceFunction("FtMgr/Show", FtMgrShowCommand);
CLISTMENUITEM mi = { sizeof(mi) };
- mi.icolibItem = GetSkinIconHandle(SKINICON_EVENT_FILE);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_FILE);
mi.position = 1900000000;
mi.pszName = LPGEN("File &transfers...");
mi.pszService = "FtMgr/Show"; //MS_PROTO_SHOWFTMGR;
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index 137f80f23b..ac01125118 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -154,7 +154,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE } else { mir_tstrncpy(msg, pcli->pfnGetContactDisplayName(fts->hContact, 0), SIZEOF(msg)); - HICON hIcon = LoadSkinIcon(SKINICON_OTHER_DOWNARROW); + HICON hIcon = Skin_LoadIcon(SKINICON_OTHER_DOWNARROW); dat->hIcon = CopyIcon(hIcon); IcoLib_ReleaseIcon(hIcon, NULL); } @@ -274,7 +274,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR { char *szProto = GetContactProto(dat->hContact); WORD status = db_get_w(dat->hContact, szProto, "Status", ID_STATUS_ONLINE); - SendDlgItemMessage(hwndDlg, IDC_CONTACT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedProtoIcon(szProto, status)); + SendDlgItemMessage(hwndDlg, IDC_CONTACT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadProtoIcon(szProto, status)); } SendDlgItemMessage(hwndDlg, IDC_CONTACT, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Contact menu"), 0); diff --git a/src/core/stdhelp/src/help.cpp b/src/core/stdhelp/src/help.cpp index 81281c6888..af276a413d 100644 --- a/src/core/stdhelp/src/help.cpp +++ b/src/core/stdhelp/src/help.cpp @@ -74,7 +74,7 @@ int LoadHelpModule(void) CreateServiceFunction("Help/BugCommand", BugCommand);
CLISTMENUITEM mi = { sizeof(mi) };
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_MIRANDA);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.pszPopupName = LPGEN("&Help");
mi.popupPosition = 2000090000;
mi.position = 2000090000;
@@ -82,19 +82,19 @@ int LoadHelpModule(void) mi.pszService = "Help/AboutCommand";
Menu_AddMainMenuItem(&mi);
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_HELP);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_HELP);
mi.position = -500050000;
mi.pszName = LPGEN("&Support");
mi.pszService = "Help/IndexCommand";
Menu_AddMainMenuItem(&mi);
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_MIRANDAWEB);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDAWEB);
mi.position = 2000050000;
mi.pszName = LPGEN("&Miranda NG homepage");
mi.pszService = "Help/WebsiteCommand";
Menu_AddMainMenuItem(&mi);
- mi.icolibItem = GetSkinIconHandle(SKINICON_EVENT_URL);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_URL);
mi.position = 2000040000;
mi.pszName = LPGEN("&Report bug");
mi.pszService = "Help/BugCommand";
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index fe5f689eb2..775a202f20 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -912,13 +912,13 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->szProto) {
WORD wStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE);
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedProtoIconBig(dat->szProto, wStatus));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinnedProtoIcon(dat->szProto, wStatus));
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadProtoIcon(dat->szProto, wStatus, true));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadProtoIcon(dat->szProto, wStatus));
break;
}
}
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIconBig(SKINICON_EVENT_MESSAGE));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinnedIcon(SKINICON_EVENT_MESSAGE));
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadIcon(SKINICON_EVENT_MESSAGE, true));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
break;
case DM_USERNAMETOCLIP:
@@ -1304,7 +1304,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->nTypeSecs) {
TCHAR szBuf[256];
TCHAR* szContactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
- HICON hTyping = LoadSkinnedIcon(SKINICON_OTHER_TYPING);
+ HICON hTyping = Skin_LoadIcon(SKINICON_OTHER_TYPING);
mir_sntprintf(szBuf, SIZEOF(szBuf), TranslateT("%s is typing a message..."), szContactName);
dat->nTypeSecs--;
@@ -1342,7 +1342,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dis->CtlID == IDC_PROTOCOL) {
if (dat->szProto) {
int dwStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE);
- HICON hIcon = LoadSkinnedProtoIcon(dat->szProto, dwStatus);
+ HICON hIcon = Skin_LoadProtoIcon(dat->szProto, dwStatus);
if (hIcon) {
if (db_get_dw(dat->hContact, dat->szProto, "IdleTS", 0)) {
HIMAGELIST hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 1, 0);
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index d2a22249e3..a5d8c93c2a 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -589,7 +589,7 @@ static int ModernOptInitialise(WPARAM wParam, LPARAM lParam) MODERNOPTOBJECT obj = { sizeof(obj) };
obj.dwFlags = MODEROPT_FLG_TCHAR | MODEROPT_FLG_NORESIZE;
- obj.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
+ obj.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
obj.hInstance = g_hInst;
obj.iSection = MODERNOPT_PAGE_MSGS;
obj.iType = MODERNOPT_TYPE_SECTIONPAGE;
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index b152ed7bb7..9d8a6befd8 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -91,7 +91,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) cle.hContact = hContact;
cle.hDbEvent = lParam;
cle.flags = CLEF_TCHAR;
- cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
+ cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
TCHAR toolTip[256];
mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
@@ -181,7 +181,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) cle.hContact = hContact;
cle.hDbEvent = 1;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
- cle.hIcon = LoadSkinnedIcon(SKINICON_OTHER_TYPING);
+ cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_TYPING);
cle.pszService = "SRMsg/ReadMessage";
cle.ptszTooltip = szTip;
CallServiceSync(MS_CLIST_REMOVEEVENT, hContact, 1);
@@ -227,7 +227,7 @@ static void RestoreUnreadMessageAlerts(void) TCHAR toolTip[256];
CLISTEVENT cle = { sizeof(cle) };
- cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
+ cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
cle.flags = CLEF_TCHAR;
cle.ptszTooltip = toolTip;
@@ -281,7 +281,7 @@ static int SplitmsgModulesLoaded(WPARAM, LPARAM) CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000090000;
mi.flags = CMIF_DEFAULT;
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_EVENT_MESSAGE);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_MESSAGE);
mi.pszName = LPGEN("&Message");
mi.pszService = MS_MSG_SENDMESSAGE;
hMsgMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index 8f38b2d02f..0297875807 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -412,7 +412,7 @@ int LoadHistoryModule(void) {
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1000090000;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_HISTORY);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_HISTORY);
mi.pszName = LPGEN("View &history");
mi.pszService = MS_HISTORY_SHOWCONTACTHISTORY;
hContactMenu = Menu_AddContactMenuItem(&mi);
diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp index 5c1b3c50b3..1dfdfa894b 100644 --- a/src/core/stdurl/url.cpp +++ b/src/core/stdurl/url.cpp @@ -55,7 +55,7 @@ static int UrlEventAdded(WPARAM hContact, LPARAM lParam) cle.flags = CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = lParam;
- cle.hIcon = LoadSkinIcon(SKINICON_EVENT_URL);
+ cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_URL);
cle.pszService = "SRUrl/ReadUrl";
cle.ptszTooltip = szTooltip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
@@ -71,7 +71,7 @@ static INT_PTR SendUrlCommand(WPARAM wParam, LPARAM) static void RestoreUnreadUrlAlerts(void)
{
CLISTEVENT cle = { sizeof(cle) };
- cle.hIcon = LoadSkinIcon(SKINICON_EVENT_URL);
+ cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_URL);
cle.pszService = "SRUrl/ReadUrl";
cle.flags = CLEF_TCHAR;
@@ -121,7 +121,7 @@ static int SRUrlModulesLoaded(WPARAM, LPARAM) {
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000040000;
- mi.icolibItem = GetSkinIconHandle(SKINICON_EVENT_URL);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_URL);
mi.pszName = LPGEN("Web page address (&URL)");
mi.pszService = MS_URL_SENDURL;
hSRUrlMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index b06a8c795d..7636f6b231 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -411,15 +411,15 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP HICON hIcon = NULL;
if (nm->nmcd.lItemlParam == -2 && nm->iSubItem-3 == (nm->nmcd.hdr.idFrom == IDC_PHONES))
- hIcon = LoadSkinIcon(SKINICON_OTHER_ADDCONTACT);
+ hIcon = Skin_LoadIcon(SKINICON_OTHER_ADDCONTACT);
else if (nm->iSubItem>1 && nm->nmcd.lItemlParam != -1 && nm->nmcd.lItemlParam != -2) {
static int iconResources[3] = {SKINICON_OTHER_RENAME, SKINICON_OTHER_DELETE};
if (nm->iSubItem == 2 && nm->nmcd.hdr.idFrom == IDC_PHONES) {
TCHAR szText[2];
ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, SIZEOF(szText));
- if (szText[0]) hIcon = LoadSkinIcon(SKINICON_OTHER_SMS);
+ if (szText[0]) hIcon = Skin_LoadIcon(SKINICON_OTHER_SMS);
}
- else hIcon = LoadSkinIcon(iconResources[nm->iSubItem-3+(nm->nmcd.hdr.idFrom == IDC_EMAILS)]);
+ else hIcon = Skin_LoadIcon(iconResources[nm->iSubItem-3+(nm->nmcd.hdr.idFrom == IDC_EMAILS)]);
}
else break;
DrawIconEx(nm->nmcd.hdc, (rc.left+rc.right-GetSystemMetrics(SM_CXSMICON))/2, (rc.top+rc.bottom-GetSystemMetrics(SM_CYSMICON))/2, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index db234f29cb..b195b5bb05 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -630,7 +630,7 @@ int LoadUserInfoModule(void) CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1000050000;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_USERDETAILS);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS);
mi.pszName = LPGEN("User &details");
mi.pszService = MS_USERINFO_SHOWDIALOG;
Menu_AddContactMenuItem(&mi);
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index ece6fa3028..e2cb2cc85b 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -65,7 +65,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = uniqueEventId++;
- cle.hIcon = LoadSkinIcon(SKINICON_OTHER_USERONLINE, false);
+ cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_USERONLINE, false);
cle.pszService = "UserOnline/Description";
mir_sntprintf(tooltip, SIZEOF(tooltip), TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = tooltip;
diff --git a/src/mir_app/src/DefaultExtraIcons.cpp b/src/mir_app/src/DefaultExtraIcons.cpp index 38b19bc5d1..09ff82aa72 100644 --- a/src/mir_app/src/DefaultExtraIcons.cpp +++ b/src/mir_app/src/DefaultExtraIcons.cpp @@ -57,9 +57,9 @@ static void SetVisibility(MCONTACT hContact, int apparentMode, bool clear) // Not chat
hExtraIcon = hExtraVisibility;
if (apparentMode == ID_STATUS_OFFLINE)
- hIcolib = LoadSkinnedIconHandle(SKINICON_OTHER_INVISIBLE_ALL);
+ hIcolib = Skin_GetIconHandle(SKINICON_OTHER_INVISIBLE_ALL);
else if (apparentMode == ID_STATUS_ONLINE)
- hIcolib = LoadSkinnedIconHandle(SKINICON_OTHER_VISIBLE_ALL);
+ hIcolib = Skin_GetIconHandle(SKINICON_OTHER_VISIBLE_ALL);
}
if (hIcolib != NULL || clear) {
@@ -262,7 +262,7 @@ static ProtoInfo* FindProto(const char *proto) if (p)
return p;
- HICON hIcon = LoadSkinnedProtoIcon(proto, ID_STATUS_ONLINE);
+ HICON hIcon = Skin_LoadProtoIcon(proto, ID_STATUS_ONLINE);
if (hIcon == NULL)
return NULL;
@@ -302,18 +302,18 @@ static int ProtocolOnClick(WPARAM wParam, LPARAM, LPARAM) void DefaultExtraIcons_Load()
{
hExtraChat = ExtraIcon_Register("chat_activity", LPGEN("Chat activity"), "ChatActivity");
- hExtraVisibility = ExtraIcon_Register("visibility", "Visibility", LoadSkinnedIconName(SKINICON_OTHER_VISIBLE_ALL));
+ hExtraVisibility = ExtraIcon_Register("visibility", "Visibility", Skin_GetIconName(SKINICON_OTHER_VISIBLE_ALL));
hExtraGender = ExtraIcon_Register("gender", "Gender", "gender_male");
- hExtraProto = ExtraIcon_Register("protocol", "Account", LoadSkinnedIconName(SKINICON_OTHER_ACCMGR),
+ hExtraProto = ExtraIcon_Register("protocol", "Account", Skin_GetIconName(SKINICON_OTHER_ACCMGR),
&ProtocolRebuildIcons, &ProtocolApplyIcon, &ProtocolOnClick);
for (int i = 0; i < SIZEOF(infos); i++) {
Info &p = infos[i];
- p.hIcolib = LoadSkinnedIconHandle(p.iSkinIcon);
+ p.hIcolib = Skin_GetIconHandle(p.iSkinIcon);
if (p.OnClick)
- p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, LoadSkinnedIconName(p.iSkinIcon), DefaultOnClick, (LPARAM)&p);
+ p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, Skin_GetIconName(p.iSkinIcon), DefaultOnClick, (LPARAM)&p);
else
- p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, LoadSkinnedIconName(p.iSkinIcon));
+ p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, Skin_GetIconName(p.iSkinIcon));
}
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 982fb25e2e..32d76d2db8 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -1353,7 +1353,7 @@ int FontsModernOptInit(WPARAM wParam, LPARAM) MODERNOPTOBJECT obj = {0};
obj.cbSize = sizeof(obj);
obj.dwFlags = MODEROPT_FLG_TCHAR|MODEROPT_FLG_NORESIZE;
- obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ obj.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
obj.hInstance = g_hInst;
obj.iSection = MODERNOPT_PAGE_SKINS;
obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE;
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h index 2253ec963e..02667beba2 100644 --- a/src/mir_app/src/IcoLib.h +++ b/src/mir_app/src/IcoLib.h @@ -86,9 +86,9 @@ UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HIC void __fastcall SAFE_FREE(void** p);
void __fastcall SafeDestroyIcon(HICON* icon);
-int IconSourceItem_Release(IconSourceItem** pitem);
-int IconSourceItem_ReleaseIcon(IconSourceItem* item);
-HICON IconSourceItem_GetIcon(IconSourceItem* item);
+int IconSourceItem_Release(IconSourceItem* &pitem);
+int IconSourceItem_ReleaseIcon(IconSourceItem *item);
+HICON IconSourceItem_GetIcon(IconSourceItem *item);
IconSourceItem* GetIconSourceItem(const TCHAR* file, int indx, int cxIcon, int cyIcon);
IcolibItem* IcoLib_FindHIcon(HICON hIcon, bool &big);
diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp index 0c8648f485..b17e29d751 100644 --- a/src/mir_app/src/button.cpp +++ b/src/mir_app/src/button.cpp @@ -169,19 +169,17 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) int textLen = GetWindowTextLength(ctl->hwnd);
if (ctl->hIcon) {
- LONG g_cxsmIcon = GetSystemMetrics(SM_CXSMICON);
- LONG g_cysmIcon = GetSystemMetrics(SM_CYSMICON);
- int ix = (rcClient.right-rcClient.left)/2 - (g_cxsmIcon/2);
- int iy = (rcClient.bottom-rcClient.top)/2 - (g_cysmIcon/2);
+ int ix = (rcClient.right-rcClient.left)/2 - (g_iIconSX/2);
+ int iy = (rcClient.bottom-rcClient.top)/2 - (g_iIconSY/2);
if (ctl->stateId == PBS_PRESSED) {
ix++;
iy++;
}
- HIMAGELIST hImageList = ImageList_Create(g_cxsmIcon, g_cysmIcon, ILC_MASK | ILC_COLOR32, 1, 0);
+ HIMAGELIST hImageList = ImageList_Create(g_iIconSX, g_iIconSY, ILC_MASK | ILC_COLOR32, 1, 0);
ImageList_AddIcon(hImageList, ctl->hIcon);
HICON hIconNew = ImageList_GetIcon(hImageList, 0, ILD_NORMAL);
- DrawState(hdcMem, NULL, NULL, (LPARAM) hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, DST_ICON | (IsWindowEnabled(ctl->hwnd) ? DSS_NORMAL : DSS_DISABLED));
+ DrawState(hdcMem, NULL, NULL, (LPARAM) hIconNew, 0, ix, iy, g_iIconSX, g_iIconSY, DST_ICON | (IsWindowEnabled(ctl->hwnd) ? DSS_NORMAL : DSS_DISABLED));
ImageList_RemoveAll(hImageList);
ImageList_Destroy(hImageList);
DestroyIcon(hIconNew);
@@ -220,7 +218,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) sz.cx -= szHot.cx;
}
if (ctl->arrow)
- DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right-rcClient.left-5-GetSystemMetrics(SM_CXSMICON)+(!ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), (rcClient.bottom-rcClient.top)/2-GetSystemMetrics(SM_CYSMICON)/2+(!ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), IsWindowEnabled(ctl->hwnd)?DST_ICON:DST_ICON|DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right-rcClient.left-5-g_iIconSX+(!ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), (rcClient.bottom-rcClient.top)/2-g_iIconSY/2+(!ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), g_iIconSX, g_iIconSY, IsWindowEnabled(ctl->hwnd)?DST_ICON:DST_ICON|DSS_DISABLED);
SelectObject(hdcMem, ctl->hFont);
DrawState(hdcMem, NULL, NULL, (LPARAM)szText, 0,
@@ -425,7 +423,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case BUTTONSETARROW: // turn arrow on/off
if (wParam) {
if (!bct->arrow) {
- bct->arrow = LoadSkinIcon(SKINICON_OTHER_DOWNARROW);
+ bct->arrow = Skin_LoadIcon(SKINICON_OTHER_DOWNARROW);
SetHwndPropInt(bct, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_ROLE, ROLE_SYSTEM_BUTTONDROPDOWN);
}
}
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index 5d56b3729b..8aee7e22cc 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -563,13 +563,13 @@ static int ModulesLoaded(WPARAM, LPARAM) CLISTMENUITEM mi = { sizeof(mi) }; mi.position = -2000090001; mi.flags = CMIF_DEFAULT; - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN); + mi.icolibItem = Skin_GetIconHandle(SKINICON_CHAT_JOIN); mi.pszName = LPGEN("&Join chat"); mi.pszService = "GChat/JoinChat"; hJoinMenuItem = Menu_AddContactMenuItem(&mi); mi.position = -2000090000; - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_LEAVE); + mi.icolibItem = Skin_GetIconHandle(SKINICON_CHAT_LEAVE); mi.flags = CMIF_NOTOFFLINE; mi.pszName = LPGEN("&Leave chat"); mi.pszService = "GChat/LeaveChat"; diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index a19bff68d9..9d7936f926 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -85,7 +85,7 @@ BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce) switch (gce->pDest->iType) {
case GC_EVENT_MESSAGE | GC_EVENT_HIGHLIGHT:
case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT:
- ci.AddEvent(si->hContact, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE), GC_FAKE_EVENT, 0, TranslateT("%s wants your attention in %s"), gce->ptszNick, si->ptszName);
+ ci.AddEvent(si->hContact, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), GC_FAKE_EVENT, 0, TranslateT("%s wants your attention in %s"), gce->ptszNick, si->ptszName);
break;
case GC_EVENT_MESSAGE:
ci.AddEvent(si->hContact, ci.hIcons[ICON_MESSAGE], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s speaks in %s"), gce->ptszNick, si->ptszName);
@@ -213,10 +213,10 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce) {
switch (gce->pDest->iType) {
case GC_EVENT_MESSAGE | GC_EVENT_HIGHLIGHT:
- ci.ShowPopup(si->hContact, si, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, ci.aFonts[16].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ ci.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, ci.aFonts[16].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT:
- ci.ShowPopup(si->hContact, si, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, ci.aFonts[16].color, _T("%s %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ ci.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, ci.aFonts[16].color, _T("%s %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_MESSAGE:
ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_MESSAGE], si->pszModule, si->ptszName, ci.aFonts[9].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index e677c7c6e3..75e0496fce 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -218,8 +218,8 @@ int LoadCLCModule(void) {
bModuleInitialized = true;
- g_IconWidth = GetSystemMetrics(SM_CXSMICON);
- g_IconHeight = GetSystemMetrics(SM_CYSMICON);
+ g_IconWidth = g_iIconSX;
+ g_IconHeight = g_iIconSY;
hClcWindowList = WindowList_Create();
hShowInfoTipEvent = CreateHookableEvent(ME_CLC_SHOWINFOTIP);
diff --git a/src/mir_app/src/clistmenus.cpp b/src/mir_app/src/clistmenus.cpp index 9581c128c3..a69c594fdf 100644 --- a/src/mir_app/src/clistmenus.cpp +++ b/src/mir_app/src/clistmenus.cpp @@ -502,7 +502,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) curProtoStatus = 0;
if (curProtoStatus >= ID_STATUS_OFFLINE && curProtoStatus < ID_STATUS_IDLE)
- timi->mi.hIcon = LoadSkinProtoIcon(prot, curProtoStatus);
+ timi->mi.hIcon = Skin_LoadProtoIcon(prot, curProtoStatus);
else {
timi->mi.hIcon = (HICON)CallProtoServiceInt(NULL, prot, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
if (timi->mi.hIcon == (HICON)CALLSERVICE_NOTFOUND)
@@ -921,7 +921,7 @@ void RebuildMenuOrder(void) tmi.root = rootmenu;
tmi.position = pos++;
tmi.ptszName = cli.pfnGetStatusModeDescription(statusModeList[j], GSMDF_UNTRANSLATED);
- tmi.hIcon = LoadSkinProtoIcon(pa->szModuleName, statusModeList[j]);
+ tmi.hIcon = Skin_LoadProtoIcon(pa->szModuleName, statusModeList[j]);
// owner data
StatusMenuExecParam *smep = (StatusMenuExecParam*)mir_calloc(sizeof(StatusMenuExecParam));
@@ -962,7 +962,7 @@ void RebuildMenuOrder(void) if (statusModeList[j] == ID_STATUS_OFFLINE)
tmi.flags |= CMIF_CHECKED;
- tmi.hIcon = LoadSkinIcon(skinIconStatusList[j]);
+ tmi.hIcon = Skin_LoadIcon(skinIconStatusList[j]);
tmi.position = pos++;
tmi.hotKey = MAKELPARAM(MOD_CONTROL, '0' + j);
@@ -1323,7 +1323,7 @@ void InitCustomMenus(void) mi.position = 0x7fffffff;
mi.pszService = "CloseAction";
mi.pszName = LPGEN("E&xit");
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_EXIT);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
AddMainMenuItem(0, (LPARAM)&mi);
cli.currentStatusMenuItem = ID_STATUS_OFFLINE;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index a2c1aae495..b124fffe8f 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -269,12 +269,12 @@ static int CListIconsChanged(WPARAM, LPARAM) int i, j;
for (i=0; i < SIZEOF(statusModeList); i++)
- ImageList_ReplaceIcon_IconLibLoaded(hCListImages, i + 1, LoadSkinIcon(skinIconStatusList[i]));
- ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPOPEN, LoadSkinIcon(SKINICON_OTHER_GROUPOPEN));
- ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPSHUT, LoadSkinIcon(SKINICON_OTHER_GROUPSHUT));
+ ImageList_ReplaceIcon_IconLibLoaded(hCListImages, i + 1, Skin_LoadIcon(skinIconStatusList[i]));
+ ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPOPEN, Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN));
+ ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPSHUT, Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT));
for (i=0; i < protoIconIndex.getCount(); i++)
for (j = 0; j < SIZEOF(statusModeList); j++)
- ImageList_ReplaceIcon_IconLibLoaded(hCListImages, protoIconIndex[i].iIconBase + j, LoadSkinProtoIcon(protoIconIndex[i].szProto, statusModeList[j]));
+ ImageList_ReplaceIcon_IconLibLoaded(hCListImages, protoIconIndex[i].iIconBase + j, Skin_LoadProtoIcon(protoIconIndex[i].szProto, statusModeList[j]));
cli.pfnTrayIconIconsChanged();
cli.pfnInvalidateRect(cli.hwndContactList, NULL, TRUE);
return 0;
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 42f231e425..0ee56992a9 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -270,12 +270,12 @@ int LoadCLUIModule(void) wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = cli.hInst;
- wndclass.hIcon = LoadSkinIcon(SKINICON_OTHER_MIRANDA, true);
+ wndclass.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA, true);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH) (COLOR_3DFACE + 1);
wndclass.lpszMenuName = MAKEINTRESOURCE(IDR_CLISTMENU);
wndclass.lpszClassName = _T(MIRANDACLASS);
- wndclass.hIconSm = LoadSkinIcon(SKINICON_OTHER_MIRANDA);
+ wndclass.hIconSm = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
RegisterClassEx(&wndclass);
if (db_get_ts(NULL, "CList", "TitleText", &dbv))
@@ -329,14 +329,14 @@ int LoadCLUIModule(void) CreateServiceFunction("CList/DeleteContactCommand", MenuItem_DeleteContact);
mi.position = 2000070000;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_DELETE);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
mi.pszName = LPGEN("De&lete");
mi.pszService = "CList/DeleteContactCommand";
Menu_AddContactMenuItem(&mi);
CreateServiceFunction("CList/RenameContactCommand", MenuItem_RenameContact);
mi.position = 2000050000;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_RENAME);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME);
mi.pszName = LPGEN("&Rename");
mi.pszService = "CList/RenameContactCommand";
hRenameMenuItem = Menu_AddContactMenuItem(&mi);
@@ -344,7 +344,7 @@ int LoadCLUIModule(void) CreateServiceFunction("CList/AddToListContactCommand", MenuItem_AddContactToList);
mi.position = -2050000000;
mi.flags |= CMIF_NOTONLIST;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_ADDCONTACT);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_ADDCONTACT);
mi.pszName = LPGEN("&Add permanently to list");
mi.pszService = "CList/AddToListContactCommand";
Menu_AddContactMenuItem(&mi);
@@ -982,12 +982,12 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SetBkMode(dis->hDC, TRANSPARENT);
x = dis->rcItem.left;
if (showOpts & 1) {
- HICON hIcon = LoadSkinProtoIcon(szProto, status);
+ HICON hIcon = Skin_LoadProtoIcon(szProto, status);
DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL);
IcoLib_ReleaseIcon(hIcon);
if (Proto_IsAccountLocked(Proto_GetAccount(szProto))) {
- hIcon = LoadSkinnedIcon(SKINICON_OTHER_STATUS_LOCKED);
+ hIcon = Skin_LoadIcon(SKINICON_OTHER_STATUS_LOCKED);
if (hIcon != NULL) {
DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL);
@@ -1021,7 +1021,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
else if (dis->CtlType == ODT_MENU) {
if (dis->itemData == MENU_MIRANDAMENU) {
- HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MAINMENU);
+ HICON hIcon = Skin_LoadIcon(SKINICON_OTHER_MAINMENU);
fnDrawMenuItem(dis, CopyIcon(hIcon), NULL);
IcoLib_ReleaseIcon(hIcon);
return TRUE;
diff --git a/src/mir_app/src/dbutils.cpp b/src/mir_app/src/dbutils.cpp index 02a6821b7d..18e6bac54f 100644 --- a/src/mir_app/src/dbutils.cpp +++ b/src/mir_app/src/dbutils.cpp @@ -223,15 +223,15 @@ static INT_PTR DbEventGetIcon(WPARAM wParam, LPARAM lParam) if (!icon) {
switch(dbei->eventType) {
case EVENTTYPE_URL:
- icon = LoadSkinIcon(SKINICON_EVENT_URL);
+ icon = Skin_LoadIcon(SKINICON_EVENT_URL);
break;
case EVENTTYPE_FILE:
- icon = LoadSkinIcon(SKINICON_EVENT_FILE);
+ icon = Skin_LoadIcon(SKINICON_EVENT_FILE);
break;
default: // EVENTTYPE_MESSAGE and unknown types
- icon = LoadSkinIcon(SKINICON_EVENT_MESSAGE);
+ icon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
break;
}
}
diff --git a/src/mir_app/src/enterstring.cpp b/src/mir_app/src/enterstring.cpp index 4e76e94a6e..4179741bbb 100644 --- a/src/mir_app/src/enterstring.cpp +++ b/src/mir_app/src/enterstring.cpp @@ -94,8 +94,8 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIconBig(SKINICON_OTHER_RENAME));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_RENAME));
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_RENAME, true));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_RENAME, false));
params = (EnterStringFormParam *)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)params);
SetWindowText(hwndDlg, params->caption);
diff --git a/src/mir_app/src/extracticon.cpp b/src/mir_app/src/extracticon.cpp index cfd2ed22db..3d9ccfcb29 100644 --- a/src/mir_app/src/extracticon.cpp +++ b/src/mir_app/src/extracticon.cpp @@ -236,25 +236,24 @@ UINT _ExtractFromICO(LPCTSTR pFileName, int iconIndex, int cxIcon, int cyIcon, H UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HICON *phicon, UINT flags)
{
- HANDLE hFile;
- WORD magic[6];
- DWORD read = 0;
UINT res = 0;
-
- if (cxIcon == GetSystemMetrics(SM_CXICON) && cyIcon == GetSystemMetrics(SM_CYICON))
+ if (cxIcon == g_iIconX && cyIcon == g_iIconY)
res = ExtractIconEx(lpszFile, iconIndex, phicon, NULL, 1);
- else if (cxIcon == GetSystemMetrics(SM_CXSMICON) && cyIcon == GetSystemMetrics(SM_CYSMICON))
+ else if (cxIcon == g_iIconSX && cyIcon == g_iIconSY)
res = ExtractIconEx(lpszFile, iconIndex, NULL, phicon, 1);
else if (cxIcon == 0 || cyIcon == 0)
res = ExtractIconEx(lpszFile, iconIndex, NULL, phicon, 1);
// check if the api succeded, if not try our method too
- if (res) return res;
+ if (res)
+ return res;
- hFile = CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ HANDLE hFile = CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hFile == INVALID_HANDLE_VALUE)
return 0;
// failed to read file signature
+ DWORD read = 0;
+ WORD magic[6];
if (!ReadFile(hFile, &magic, sizeof(magic), &read, NULL) || (read != sizeof(magic))) {
CloseHandle(hFile);
return 0;
@@ -273,7 +272,6 @@ UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HIC case MAGIC_ICON:
if ((magic[1] == MAGIC_ICO1 || magic[1] == MAGIC_CUR) && magic[2] >= 1)
res = _ExtractFromICO(lpszFile, iconIndex, cxIcon, cyIcon, phicon, flags);
-
break;
}
diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp index 32008087ef..820ee03900 100644 --- a/src/mir_app/src/extraicons.cpp +++ b/src/mir_app/src/extraicons.cpp @@ -303,7 +303,7 @@ void fnReloadExtraIcons() if (hExtraImageList)
ImageList_Destroy(hExtraImageList);
- hExtraImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 1, 256);
+ hExtraImageList = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 1, 256);
SendMessage(cli.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hExtraImageList);
SendMessage(cli.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0);
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index e1fa64a9b5..b1d470eacd 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -379,7 +379,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (caps & PF1_ANYSEARCH) netProtoCount++; } - dat->himlComboIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, netProtoCount + 1, netProtoCount + 1); + dat->himlComboIcons = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, netProtoCount + 1, netProtoCount + 1); SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_SETIMAGELIST, 0, (LPARAM)dat->himlComboIcons); COMBOBOXEXITEM cbei; @@ -1037,7 +1037,7 @@ int LoadFindAddModule(void) CLISTMENUITEM mi = { sizeof(mi) }; mi.position = 500020000; - mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_FINDUSER); + mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER); mi.pszName = LPGEN("&Find/add contacts..."); mi.pszService = MS_FINDADD_FINDADD; hMainMenuItem = Menu_AddMainMenuItem(&mi); diff --git a/src/mir_app/src/genmenu.cpp b/src/mir_app/src/genmenu.cpp index 41ecec5c04..3246544f40 100644 --- a/src/mir_app/src/genmenu.cpp +++ b/src/mir_app/src/genmenu.cpp @@ -131,8 +131,8 @@ int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis) if (pimi->iconId == -1)
return FALSE;
- mis->itemWidth = max(0, GetSystemMetrics(SM_CXSMICON) - GetSystemMetrics(SM_CXMENUCHECK) + 4);
- mis->itemHeight = GetSystemMetrics(SM_CYSMICON) + 2;
+ mis->itemWidth = max(0, g_iIconSX - GetSystemMetrics(SM_CXMENUCHECK) + 4);
+ mis->itemHeight = g_iIconSY + 2;
return TRUE;
}
@@ -154,12 +154,12 @@ int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis) if (pimi == NULL || pimi->iconId == -1)
return FALSE;
- int y = (dis->rcItem.bottom - dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2 + 1;
+ int y = (dis->rcItem.bottom - dis->rcItem.top - g_iIconSY) / 2 + 1;
if (dis->itemState & ODS_SELECTED) {
if (dis->itemState & ODS_CHECKED) {
RECT rc;
- rc.left = 2; rc.right = GetSystemMetrics(SM_CXSMICON) + 2;
- rc.top = y; rc.bottom = rc.top + GetSystemMetrics(SM_CYSMICON) + 2;
+ rc.left = 2; rc.right = g_iIconSX + 2;
+ rc.top = y; rc.bottom = rc.top + g_iIconSY + 2;
FillRect(dis->hDC, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
ImageList_DrawEx(pimi->parent->m_hMenuIcons, pimi->iconId, dis->hDC, 2, y, 0, 0, CLR_NONE, CLR_DEFAULT, ILD_SELECTED);
}
@@ -168,8 +168,8 @@ int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis) else {
if (dis->itemState & ODS_CHECKED) {
RECT rc;
- rc.left = 0; rc.right = GetSystemMetrics(SM_CXSMICON) + 4;
- rc.top = y - 2; rc.bottom = rc.top + GetSystemMetrics(SM_CYSMICON) + 4;
+ rc.left = 0; rc.right = g_iIconSX + 4;
+ rc.top = y - 2; rc.bottom = rc.top + g_iIconSY + 4;
DrawEdge(dis->hDC, &rc, BDR_SUNKENOUTER, BF_RECT);
InflateRect(&rc, -1, -1);
COLORREF menuCol = GetSysColor(COLOR_MENU);
@@ -525,7 +525,7 @@ INT_PTR MO_CreateNewMenuObject(WPARAM wParam, LPARAM lParam) p->ptszDisplayName = mir_a2t(LPCSTR(wParam));
p->CheckService = mir_strdup(pmp->CheckService);
p->ExecService = mir_strdup(pmp->ExecService);
- p->m_hMenuIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 15, 100);
+ p->m_hMenuIcons = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 15, 100);
g_menus.insert(p);
return p->id;
}
diff --git a/src/mir_app/src/genmenuopt.cpp b/src/mir_app/src/genmenuopt.cpp index 8a1cbf497c..424488d4ea 100644 --- a/src/mir_app/src/genmenuopt.cpp +++ b/src/mir_app/src/genmenuopt.cpp @@ -296,7 +296,7 @@ public: { iInitMenuValue = db_get_b(NULL, "CList", "MoveProtoMenus", TRUE); - HIMAGELIST himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2); + HIMAGELIST himlCheckBoxes = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 2, 2); ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK); ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_TICK); m_menuItems.SetImageList(himlCheckBoxes, TVSIL_NORMAL); diff --git a/src/mir_app/src/headerbar.cpp b/src/mir_app/src/headerbar.cpp index b321a7853b..316f085ca0 100644 --- a/src/mir_app/src/headerbar.cpp +++ b/src/mir_app/src/headerbar.cpp @@ -197,7 +197,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit) textRect.left = 50;
textRect.right = mit->width;
textRect.top = 2 + iTopSpace;
- textRect.bottom = GetSystemMetrics(SM_CYICON) - 2 + iTopSpace;
+ textRect.bottom = g_iIconY - 2 + iTopSpace;
if (IsAeroMode()) {
DTTOPTS dto = { 0 };
diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp index 8224fd7ee0..cd7d542a7e 100644 --- a/src/mir_app/src/hotkey_opts.cpp +++ b/src/mir_app/src/hotkey_opts.cpp @@ -487,19 +487,19 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, { RECT rc; GetClientRect(hwndHotkey, &rc); - colWidth = rc.right - GetSystemMetrics(SM_CXHTHUMB) - 3 * GetSystemMetrics(SM_CXSMICON) - 5; + colWidth = rc.right - GetSystemMetrics(SM_CXHTHUMB) - 3 * g_iIconSX - 5; LVCOLUMN lvc; lvc.mask = LVCF_WIDTH; lvc.cx = colWidth * 2 / 3; ListView_InsertColumn(hwndHotkey, COL_NAME, &lvc); - lvc.cx = GetSystemMetrics(SM_CXSMICON); + lvc.cx = g_iIconSX; ListView_InsertColumn(hwndHotkey, COL_TYPE, &lvc); lvc.cx = colWidth / 3; ListView_InsertColumn(hwndHotkey, COL_KEY, &lvc); - lvc.cx = GetSystemMetrics(SM_CXSMICON); + lvc.cx = g_iIconSX; ListView_InsertColumn(hwndHotkey, COL_RESET, &lvc); - lvc.cx = GetSystemMetrics(SM_CXSMICON); + lvc.cx = g_iIconSX; ListView_InsertColumn(hwndHotkey, COL_ADDREMOVE, &lvc); for (int i = 0; i < hotkeys.getCount(); i++) { diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index eb85a2ebd9..ad35eb3509 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -382,25 +382,24 @@ IconSourceItem* CreateStaticIconSourceItem(int cxIcon, int cyIcon) return newItem;
}
-int IconSourceItem_Release(IconSourceItem** pitem)
+int IconSourceItem_Release(IconSourceItem* &pitem)
{
- if (pitem && *pitem && (*pitem)->ref_count) {
- IconSourceItem* item = *pitem;
- item->ref_count--;
- if (!item->ref_count) {
- int indx;
- if ((indx = iconSourceList.getIndex(item)) != -1) {
- IconSourceFile_Release(&item->file);
- SafeDestroyIcon(&item->icon);
- SAFE_FREE((void**)&item->icon_data);
- iconSourceList.remove(indx);
- SAFE_FREE((void**)&item);
- }
+ if (pitem == NULL || pitem->ref_count == 0)
+ return 1;
+
+ pitem->ref_count--;
+ if (!pitem->ref_count) {
+ int indx;
+ if ((indx = iconSourceList.getIndex(pitem)) != -1) {
+ IconSourceFile_Release(&pitem->file);
+ SafeDestroyIcon(&pitem->icon);
+ SAFE_FREE((void**)&pitem->icon_data);
+ iconSourceList.remove(indx);
+ SAFE_FREE((void**)&pitem);
}
- *pitem = NULL;
- return 0;
}
- return 1;
+ pitem = NULL;
+ return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -485,9 +484,9 @@ static void IcoLib_FreeIcon(IcolibItem* icon) IcoLib_RemoveSection(icon->section);
icon->section = NULL;
}
- IconSourceItem_Release(&icon->source_small);
- IconSourceItem_Release(&icon->source_big);
- IconSourceItem_Release(&icon->default_icon);
+ IconSourceItem_Release(icon->source_small);
+ IconSourceItem_Release(icon->source_big);
+ IconSourceItem_Release(icon->default_icon);
SafeDestroyIcon(&icon->temp_icon);
}
@@ -549,11 +548,11 @@ MIR_APP_DLL(HANDLE) IcoLib_AddIcon(SKINICONDESC *sid, int hLangpack) item->default_icon->ref_count++;
}
else {
- int cx = item->cx ? item->cx : GetSystemMetrics(SM_CXSMICON);
- int cy = item->cy ? item->cy : GetSystemMetrics(SM_CYSMICON);
+ int cx = item->cx ? item->cx : g_iIconSX;
+ int cy = item->cy ? item->cy : g_iIconSY;
item->default_icon = CreateStaticIconSourceItem(cx, cy);
if (GetIconData(sid->hDefaultIcon, &item->default_icon->icon_data, &item->default_icon->icon_size))
- IconSourceItem_Release(&item->default_icon);
+ IconSourceItem_Release(item->default_icon);
}
}
@@ -655,41 +654,39 @@ HICON IconItem_GetDefaultIcon(IcolibItem* item, bool big) HICON hIcon = NULL;
if (item->default_icon && !big) {
- IconSourceItem_Release(&item->source_small);
+ IconSourceItem_Release(item->source_small);
item->source_small = item->default_icon;
item->source_small->ref_count++;
hIcon = IconSourceItem_GetIcon(item->source_small);
}
if (!hIcon && item->default_file) {
- int cx = item->cx ? item->cx : GetSystemMetrics(big ? SM_CXICON : SM_CXSMICON);
- int cy = item->cy ? item->cy : GetSystemMetrics(big ? SM_CYICON : SM_CYSMICON);
- IconSourceItem* def_icon = GetIconSourceItem(item->default_file, item->default_indx, cx, cy);
+ int cx = item->cx ? item->cx : (big ? g_iIconX : g_iIconSX);
+ int cy = item->cy ? item->cy : (big ? g_iIconY : g_iIconSY);
+ IconSourceItem *def_icon = GetIconSourceItem(item->default_file, item->default_indx, cx, cy);
if (big) {
if (def_icon != item->source_big) {
- IconSourceItem_Release(&item->source_big);
+ IconSourceItem_Release(item->source_big);
item->source_big = def_icon;
if (def_icon) {
def_icon->ref_count++;
hIcon = IconSourceItem_GetIcon(def_icon);
}
}
- else
- IconSourceItem_Release(&def_icon);
+ else IconSourceItem_Release(def_icon);
}
else {
if (def_icon != item->default_icon) {
- IconSourceItem_Release(&item->default_icon);
+ IconSourceItem_Release(item->default_icon);
item->default_icon = def_icon;
if (def_icon) {
- IconSourceItem_Release(&item->source_small);
+ IconSourceItem_Release(item->source_small);
item->source_small = def_icon;
def_icon->ref_count++;
hIcon = IconSourceItem_GetIcon(def_icon);
}
}
- else
- IconSourceItem_Release(&def_icon);
+ else IconSourceItem_Release(def_icon);
}
}
return hIcon;
@@ -711,8 +708,8 @@ HICON IconItem_GetIcon(HANDLE hIcoLib, bool big) if (!source && !db_get_ts(NULL, "SkinIcons", item->name, &dbv)) {
TCHAR tszFullPath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, tszFullPath);
- int cx = item->cx ? item->cx : GetSystemMetrics(big ? SM_CXICON : SM_CXSMICON);
- int cy = item->cy ? item->cy : GetSystemMetrics(big ? SM_CYICON : SM_CYSMICON);
+ int cx = item->cx ? item->cx : (big ? g_iIconX : g_iIconSX);
+ int cy = item->cy ? item->cy : (big ? g_iIconY : g_iIconSY);
source = GetIconSourceItemFromPath(tszFullPath, cx, cy);
db_free(&dbv);
}
@@ -753,7 +750,7 @@ MIR_APP_DLL(HICON) IcoLib_GetIcon(const char* pszIconName, bool big) // IcoLib_GetIconHandle
// lParam: pszIconName
-MIR_APP_DLL(HANDLE) IcoLib_GetIconHandle(const char* pszIconName)
+MIR_APP_DLL(HANDLE) IcoLib_GetIconHandle(const char *pszIconName)
{
if (!pszIconName)
return NULL;
diff --git a/src/mir_app/src/ignore.cpp b/src/mir_app/src/ignore.cpp index fc5fa575b5..b8c1af1b1b 100644 --- a/src/mir_app/src/ignore.cpp +++ b/src/mir_app/src/ignore.cpp @@ -187,7 +187,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3 + IGNOREEVENT_MAX, 3 + IGNOREEVENT_MAX);
+ HIMAGELIST hIml = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 3 + IGNOREEVENT_MAX, 3 + IGNOREEVENT_MAX);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_FILLEDBLOB);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_EMPTYBLOB);
diff --git a/src/mir_app/src/imgconv.cpp b/src/mir_app/src/imgconv.cpp index 75974fc541..bf1486b226 100644 --- a/src/mir_app/src/imgconv.cpp +++ b/src/mir_app/src/imgconv.cpp @@ -103,8 +103,8 @@ void ConvertBufferToPARGB32(HANDLE hPaintBuffer, HDC hdc, HICON hIcon, SIZE& siz HBITMAP ConvertIconToBitmap(HICON hicon, HIMAGELIST hIml, int iconId)
{
SIZE sizIcon;
- sizIcon.cx = GetSystemMetrics(SM_CXSMICON);
- sizIcon.cy = GetSystemMetrics(SM_CYSMICON);
+ sizIcon.cx = g_iIconSX;
+ sizIcon.cy = g_iIconSY;
RECT rcIcon = { 0, 0, sizIcon.cx, sizIcon.cy };
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index e4e40b2891..0721e6640e 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -114,8 +114,8 @@ INT_PTR Meta_LoadIcon(WPARAM wParam, LPARAM) }
return (INT_PTR)LoadImage(g_hInst, MAKEINTRESOURCE(id), IMAGE_ICON,
- GetSystemMetrics(wParam & PLIF_SMALL ? SM_CXSMICON : SM_CXICON),
- GetSystemMetrics(wParam & PLIF_SMALL ? SM_CYSMICON : SM_CYICON), 0);
+ (wParam & PLIF_SMALL) ? g_iIconX : g_iIconSX,
+ (wParam & PLIF_SMALL) ? g_iIconY : g_iIconSY, 0);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -651,7 +651,7 @@ int Meta_ModulesLoaded(WPARAM, LPARAM) sid.szModule = META_PROTO;
sid.flags = MBF_TCHAR;
sid.tszTooltip = LPGENT("Select metacontact");
- sid.hIcon = LoadSkinnedProtoIcon(META_PROTO, ID_STATUS_ONLINE);
+ sid.hIcon = Skin_LoadProtoIcon(META_PROTO, ID_STATUS_ONLINE);
Srmm_AddIcon(&sid);
return 0;
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index b23236d6d4..a6a49fd7be 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -3,11 +3,11 @@ EXPORTS CallContactService @1
CallProtoService @2
RecalculateTime @3
-LoadSkinProtoIcon @4
-LoadSkinIcon @5
+Skin_LoadProtoIcon @4
+Skin_LoadIcon @5
Button_FreeIcon_IcoLib @6
Button_SetIcon_IcoLib @7
-GetSkinIconHandle @8
+Skin_GetIconHandle @8
IcoLib_AddIcon @9
IcoLib_GetIcon @10
IcoLib_GetIconByHandle @11
@@ -23,3 +23,4 @@ IcoLib_RemoveIcon @20 IcoLib_RemoveIconByHandle @21
IcoLib_Release @22
IcoLib_AddRef @23
+Skin_GetIconName @24
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index 15acd9e720..4bd366be54 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -54,10 +54,17 @@ HINSTANCE g_hInst; DWORD hMainThreadId;
int hLangpack = 0;
bool bModulesLoadedFired = false;
+int g_iIconX, g_iIconY, g_iIconSX, g_iIconSY;
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID)
{
- g_hInst = hinstDLL;
+ if (dwReason == DLL_PROCESS_ATTACH) {
+ g_hInst = hinstDLL;
+ g_iIconX = g_iIconX;
+ g_iIconY = g_iIconY;
+ g_iIconSX = g_iIconSX;
+ g_iIconSY = g_iIconSY;
+ }
return TRUE;
}
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index 8ceb3d308d..eceac3e7c0 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -109,6 +109,8 @@ void KillModuleIcons(int hLangpack); /**** skinicons.cpp ********************************************************************/
+extern int g_iIconX, g_iIconY, g_iIconSX, g_iIconSY;
+
HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared);
int ImageList_AddIcon_NotShared(HIMAGELIST hIml, LPCTSTR szResource);
int ImageList_ReplaceIcon_NotShared(HIMAGELIST hIml, int iIndex, HINSTANCE hInstance, LPCTSTR szResource);
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index cfc7bee71e..dabc638ad3 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -92,7 +92,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) mi.position = 100000;
mi.pszName = LPGEN("&Move to group");
mi.flags = CMIF_ROOTHANDLE;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_GROUP);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_GROUP);
hMoveToGroupItem = Menu_AddContactMenuItem(&mi);
}
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 4bdec9d37f..cce95cfe23 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -1294,7 +1294,7 @@ static INT_PTR AddOptionsPage(WPARAM wParam, LPARAM lParam) static int OptModulesLoaded(WPARAM, LPARAM)
{
CLISTMENUITEM mi = { sizeof(mi) };
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_OPTIONS);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
mi.position = 1900000000;
mi.pszName = LPGEN("&Options...");
mi.pszService = "Options/OptionsCommand";
diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp index 54c2d4fb25..403f76d297 100644 --- a/src/mir_app/src/options_ei.cpp +++ b/src/mir_app/src/options_ei.cpp @@ -258,7 +258,7 @@ public: ShowWindow(label, SW_SHOW);
}
- int cx = GetSystemMetrics(SM_CXSMICON);
+ int cx = g_iIconSX;
HIMAGELIST hImageList = ImageList_Create(cx, cx, ILC_COLOR32 | ILC_MASK, 2, 2);
HICON hBlankIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, cx, cx, 0);
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index 7f7138be2f..e2ffc37f79 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -593,8 +593,8 @@ public: virtual void OnInitDialog() { - SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)); - SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0)); + SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, g_iIconSX, g_iIconSY, 0)); + SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, g_iIconX, g_iIconY, 0)); if (m_pd->noProfiles || shouldAutoCreate(m_pd->ptszProfile)) m_tab.ActivatePage(1); diff --git a/src/mir_app/src/protocolorder.cpp b/src/mir_app/src/protocolorder.cpp index 3f6af51b04..5f8cc25601 100644 --- a/src/mir_app/src/protocolorder.cpp +++ b/src/mir_app/src/protocolorder.cpp @@ -155,7 +155,7 @@ public: virtual void OnInitDialog()
{
- HIMAGELIST himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
+ HIMAGELIST himlCheckBoxes = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 2, 2);
ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK);
ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_TICK);
m_order.SetImageList(himlCheckBoxes, TVSIL_NORMAL);
diff --git a/src/mir_app/src/protoopts.cpp b/src/mir_app/src/protoopts.cpp index 8a5d0e7a15..6d042b30cc 100644 --- a/src/mir_app/src/protoopts.cpp +++ b/src/mir_app/src/protoopts.cpp @@ -302,8 +302,8 @@ static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA int iItem = LOWORD(SendMessage(hwnd, LB_ITEMFROMPOINT, 0, lParam));
ListBox_GetItemRect(hwnd, iItem, &dat->rcCheck);
- dat->rcCheck.right = dat->rcCheck.left + GetSystemMetrics(SM_CXSMICON) + 4;
- dat->rcCheck.bottom = dat->rcCheck.top + GetSystemMetrics(SM_CYSMICON) + 4;
+ dat->rcCheck.right = dat->rcCheck.left + g_iIconSX + 4;
+ dat->rcCheck.bottom = dat->rcCheck.top + g_iIconSY + 4;
if (PtInRect(&dat->rcCheck, pt))
dat->iItem = iItem;
else
@@ -347,8 +347,8 @@ static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA return 0;
ListBox_GetItemRect(hwnd, ListBox_GetCurSel(hwnd), &rc);
- rc.left += 2 * GetSystemMetrics(SM_CXSMICON) + 4;
- rc.bottom = rc.top + max(GetSystemMetrics(SM_CXSMICON), parentDat->titleHeight) + 4 - 1;
+ rc.left += 2 * g_iIconSX + 4;
+ rc.bottom = rc.top + max(g_iIconSX, parentDat->titleHeight) + 4 - 1;
++rc.top; --rc.right;
dat->hwndEdit = CreateWindow(_T("EDIT"), pa->tszAccountName, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, hwnd, NULL, g_hInst, NULL);
@@ -518,7 +518,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM SelectObject(hdc, hfnt);
ReleaseDC(hwndDlg, hdc);
- dat->normalHeight = 4 + max(dat->titleHeight, GetSystemMetrics(SM_CYSMICON));
+ dat->normalHeight = 4 + max(dat->titleHeight, g_iIconSY);
dat->selectedHeight = dat->normalHeight + 4 + 2 * dat->textHeight;
}
@@ -559,8 +559,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM HBRUSH hbrBack;
SIZE sz;
{
- int cxIcon = GetSystemMetrics(SM_CXSMICON);
- int cyIcon = GetSystemMetrics(SM_CYSMICON);
+ int cxIcon = g_iIconSX;
+ int cyIcon = g_iIconSY;
LPDRAWITEMSTRUCT lps = (LPDRAWITEMSTRUCT)lParam;
PROTOACCOUNT *acc = (PROTOACCOUNT *)lps->itemData;
@@ -590,7 +590,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM else
tmp = acc->bIsEnabled ? SKINICON_OTHER_TICK : SKINICON_OTHER_NOTICK;
- HICON hIcon = LoadSkinnedIcon(tmp);
+ HICON hIcon = Skin_LoadIcon(tmp);
DrawIconEx(lps->hDC, lps->rcItem.left, lps->rcItem.top, hIcon, cxIcon, cyIcon, 0, hbrBack, DI_NORMAL);
IcoLib_ReleaseIcon(hIcon);
@@ -695,8 +695,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM if (iItem != LB_ERR) {
RECT rc;
ListBox_GetItemRect(hwndList, iItem, &rc);
- pt.x = rc.left + GetSystemMetrics(SM_CXSMICON) + 4;
- pt.y = rc.top + 4 + max(GetSystemMetrics(SM_CXSMICON), dat->titleHeight);
+ pt.x = rc.left + g_iIconSX + 4;
+ pt.y = rc.top + 4 + max(g_iIconSX, dat->titleHeight);
ClientToScreen(hwndList, &pt);
}
}
@@ -1019,7 +1019,7 @@ static INT_PTR OptProtosShow(WPARAM, LPARAM) int OptProtosLoaded(WPARAM, LPARAM)
{
CLISTMENUITEM mi = { sizeof(mi) };
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_ACCMGR);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_ACCMGR);
mi.position = 1900000000;
mi.pszName = LPGEN("&Accounts...");
mi.pszService = MS_PROTO_SHOWACCMGR;
diff --git a/src/mir_app/src/searchresults.cpp b/src/mir_app/src/searchresults.cpp index af1bf873b6..8a8ae3ea8f 100644 --- a/src/mir_app/src/searchresults.cpp +++ b/src/mir_app/src/searchresults.cpp @@ -64,7 +64,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) char szSetting[32];
bool colOrdersValid;
- defaultColumnSizes[COLUMNID_PROTO] = GetSystemMetrics(SM_CXSMICON) + 4;
+ defaultColumnSizes[COLUMNID_PROTO] = g_iIconSX + 4;
FindAddDlgData *dat = (FindAddDlgData*)GetWindowLongPtr(GetParent(hwndResults), GWLP_USERDATA);
columnCount = NUM_COLUMNID;
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index ace1b18781..7805550d34 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -89,7 +89,7 @@ HICON IconItem_GetIcon_Preview(IcolibItem* item) }
if (!hIcon && item->default_file) {
- IconSourceItem_Release(&item->default_icon);
+ IconSourceItem_Release(item->default_icon);
item->default_icon = GetIconSourceItem(item->default_file, item->default_indx, item->cx, item->cy);
if (item->default_icon) {
HICON hRefIcon = IconSourceItem_GetIcon(item->default_icon);
@@ -364,7 +364,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM hwndParent = (HWND)lParam;
hPreview = GetDlgItem(hwndDlg, IDC_PREVIEW);
dragging = dragItem = 0;
- ListView_SetImageList(hPreview, ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 0, 100), LVSIL_NORMAL);
+ ListView_SetImageList(hPreview, ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 0, 100), LVSIL_NORMAL);
ListView_SetIconSpacing(hPreview, 56, 67);
{
RECT rcThis, rcParent;
@@ -536,7 +536,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM dragging = 1;
dragItem = ((LPNMLISTVIEW)lParam)->iItem;
dropHiLite = -1;
- ImageList_BeginDrag(ListView_GetImageList(hPreview, LVSIL_NORMAL), dragItem, GetSystemMetrics(SM_CXICON) / 2, GetSystemMetrics(SM_CYICON) / 2);
+ ImageList_BeginDrag(ListView_GetImageList(hPreview, LVSIL_NORMAL), dragItem, g_iIconX / 2, g_iIconY / 2);
{
POINT pt;
RECT rc;
@@ -653,7 +653,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //
ListView_SetUnicodeFormat(hPreview, TRUE);
ListView_SetExtendedListViewStyleEx(hPreview, LVS_EX_INFOTIP, LVS_EX_INFOTIP);
- ListView_SetImageList(hPreview, ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 0, 30), LVSIL_NORMAL);
+ ListView_SetImageList(hPreview, ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 0, 30), LVSIL_NORMAL);
ListView_SetIconSpacing(hPreview, 56, 67);
SendMessage(hwndDlg, DM_REBUILD_CTREE, 0, 0);
@@ -911,12 +911,12 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (item->temp_reset) {
db_unset(NULL, "SkinIcons", item->name);
if (item->source_small != item->default_icon) {
- IconSourceItem_Release(&item->source_small);
+ IconSourceItem_Release(item->source_small);
}
}
else if (item->temp_file) {
db_set_ts(NULL, "SkinIcons", item->name, item->temp_file);
- IconSourceItem_Release(&item->source_small);
+ IconSourceItem_Release(item->source_small);
SafeDestroyIcon(&item->temp_icon);
}
}
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index 63ba1b81d3..410b30a1d9 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -121,7 +121,7 @@ const char protoIconsFmt[] = LPGEN("%s icons"); // load small icon (shared) it's not need to be destroyed
static HICON LoadSmallIconShared(HINSTANCE hInstance, LPCTSTR lpIconName)
{
- int cx = GetSystemMetrics(SM_CXSMICON);
+ int cx = g_iIconSX;
return (HICON)LoadImage(hInstance, lpIconName, IMAGE_ICON, cx, cx, LR_DEFAULTCOLOR | LR_SHARED);
}
@@ -158,7 +158,7 @@ int ImageList_AddIcon_NotShared(HIMAGELIST hIml, LPCTSTR szResource) int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId)
{
- HICON hIcon = LoadSkinIcon(iconId);
+ HICON hIcon = Skin_LoadIcon(iconId);
int res = ImageList_AddIcon(hIml, hIcon);
IcoLib_ReleaseIcon(hIcon);
return res;
@@ -166,7 +166,7 @@ int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId) int ImageList_AddIcon_ProtoIconLibLoaded(HIMAGELIST hIml, const char *szProto, int iconId)
{
- HICON hIcon = LoadSkinProtoIcon(szProto, iconId);
+ HICON hIcon = Skin_LoadProtoIcon(szProto, iconId);
int res = ImageList_AddIcon(hIml, hIcon);
IcoLib_ReleaseIcon(hIcon);
return res;
@@ -189,14 +189,14 @@ int ImageList_ReplaceIcon_IconLibLoaded(HIMAGELIST hIml, int nIndex, HICON hIcon MIR_APP_DLL(void) Window_SetIcon_IcoLib(HWND hWnd, int iconId)
{
- SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinIcon(iconId, true));
- SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinIcon(iconId));
+ SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadIcon(iconId, true));
+ SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadIcon(iconId));
}
MIR_APP_DLL(void) Window_SetProtoIcon_IcoLib(HWND hWnd, const char *szProto, int iconId)
{
- SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinProtoIcon(szProto, iconId, true));
- SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinProtoIcon(szProto, iconId));
+ SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadProtoIcon(szProto, iconId, true));
+ SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadProtoIcon(szProto, iconId));
}
MIR_APP_DLL(void) Window_FreeIcon_IcoLib(HWND hWnd)
@@ -208,7 +208,7 @@ MIR_APP_DLL(void) Window_FreeIcon_IcoLib(HWND hWnd) MIR_APP_DLL(void) Button_SetIcon_IcoLib(HWND hwndDlg, int itemId, int iconId, const char *tooltip)
{
HWND hWnd = GetDlgItem(hwndDlg, itemId);
- SendMessage(hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinIcon(iconId));
+ SendMessage(hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(iconId));
SendMessage(hWnd, BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(hWnd, BUTTONADDTOOLTIP, (WPARAM)tooltip, 0);
}
@@ -219,7 +219,7 @@ MIR_APP_DLL(void) Button_FreeIcon_IcoLib(HWND hwndDlg, int itemId) IcoLib_ReleaseIcon(hIcon);
}
-MIR_APP_DLL(HICON) LoadSkinProtoIcon(const char *szProto, int status, bool big)
+MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big)
{
char iconName[MAX_PATH];
INT_PTR caps2;
@@ -336,7 +336,7 @@ MIR_APP_DLL(HICON) LoadSkinProtoIcon(const char *szProto, int status, bool big) return hIcon;
}
-MIR_APP_DLL(HANDLE) GetSkinIconHandle(int idx)
+MIR_APP_DLL(HANDLE) Skin_GetIconHandle(int idx)
{
for (int i = 0; i < SIZEOF(mainIcons); i++)
if (idx == mainIcons[i].id)
@@ -345,7 +345,7 @@ MIR_APP_DLL(HANDLE) GetSkinIconHandle(int idx) return NULL;
}
-char* GetSkinIconName(int idx)
+MIR_APP_DLL(char*) Skin_GetIconName(int idx)
{
static char szIconName[100];
@@ -358,50 +358,24 @@ char* GetSkinIconName(int idx) return NULL;
}
-MIR_APP_DLL(HICON) LoadSkinIcon(int idx, bool big)
+MIR_APP_DLL(HICON) Skin_LoadIcon(int idx, bool big)
{
// Query for global status icons
if (idx < SKINICON_EVENT_MESSAGE) {
if (idx >= SIZEOF(statusIcons))
return NULL;
- return LoadSkinProtoIcon(NULL, statusIcons[idx].id, big);
+ return Skin_LoadProtoIcon(NULL, statusIcons[idx].id, big);
}
- return IcoLib_GetIconByHandle(GetSkinIconHandle(idx), big);
+ return IcoLib_GetIconByHandle(Skin_GetIconHandle(idx), big);
}
/////////////////////////////////////////////////////////////////////////////////////////
// Initializes the icon skin module
-static INT_PTR sttLoadSkinIcon(WPARAM wParam, LPARAM lParam)
-{
- switch (lParam) {
- case 0: return (INT_PTR)LoadSkinIcon(wParam);
- case 1: return (INT_PTR)GetSkinIconHandle(wParam);
- case 2: return (INT_PTR)LoadSkinIcon(wParam, true);
- case 3: return (INT_PTR)GetSkinIconName(wParam);
- }
-
- return 0;
-}
-
-static INT_PTR sttLoadSkinProtoIcon(WPARAM wParam, LPARAM lParam)
-{
- return (INT_PTR)LoadSkinProtoIcon((char*)wParam, (int)lParam, false);
-}
-
-static INT_PTR sttLoadSkinProtoIconBig(WPARAM wParam, LPARAM lParam)
-{
- return (INT_PTR)LoadSkinProtoIcon((char*)wParam, (int)lParam, true);
-}
-
int LoadSkinIcons(void)
{
- CreateServiceFunction(MS_SKIN_LOADICON, sttLoadSkinIcon);
- CreateServiceFunction(MS_SKIN_LOADPROTOICON, sttLoadSkinProtoIcon);
- CreateServiceFunction(MS_SKIN_LOADPROTOICONBIG, sttLoadSkinProtoIconBig);
-
TCHAR modulePath[MAX_PATH];
GetModuleFileName(g_hInst, modulePath, SIZEOF(modulePath));
diff --git a/src/mir_app/src/visibility.cpp b/src/mir_app/src/visibility.cpp index 5c5f85f84e..447bac6beb 100644 --- a/src/mir_app/src/visibility.cpp +++ b/src/mir_app/src/visibility.cpp @@ -138,7 +138,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3, 3);
+ hIml = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 3, 3);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_VISIBLE_ALL);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_INVISIBLE_ALL);
diff --git a/src/mir_core/src/modules.cpp b/src/mir_core/src/modules.cpp index 51a953e934..d2c21ad90f 100644 --- a/src/mir_core/src/modules.cpp +++ b/src/mir_core/src/modules.cpp @@ -299,13 +299,15 @@ static HANDLE HookEventInt(int type, const char *name, MIRANDAHOOK hookProc, voi if ((idx = hooks.getIndex((THook*)name)) == -1) return NULL; - THook* p = hooks[ idx ]; - p->subscriber = (THookSubscriber*)mir_realloc(p->subscriber, sizeof(THookSubscriber)*(p->subscriberCount+1)); - p->subscriber[ p->subscriberCount ].type = type; - p->subscriber[ p->subscriberCount ].pfnHook = hookProc; - p->subscriber[ p->subscriberCount ].object = object; - p->subscriber[ p->subscriberCount ].lParam = lParam; - p->subscriber[ p->subscriberCount ].hOwner = GetInstByAddress(hookProc); + THook *p = hooks[idx]; + p->subscriber = (THookSubscriber*)mir_realloc(p->subscriber, sizeof(THookSubscriber)*(p->subscriberCount + 1)); + + THookSubscriber &s = p->subscriber[p->subscriberCount]; + s.type = type; + s.pfnHook = hookProc; + s.object = object; + s.lParam = lParam; + s.hOwner = GetInstByAddress(hookProc); p->subscriberCount++; return (HANDLE)((p->id << 16) | p->subscriberCount); diff --git a/src/mir_core/src/protos.cpp b/src/mir_core/src/protos.cpp index d643a811f4..2b408e7acb 100644 --- a/src/mir_core/src/protos.cpp +++ b/src/mir_core/src/protos.cpp @@ -104,7 +104,7 @@ MIR_CORE_DLL(void) ProtoConstructor(PROTO_INTERFACE *pThis, LPCSTR pszModuleName pThis->m_iVersion = 2;
pThis->m_iStatus = pThis->m_iDesiredStatus = ID_STATUS_OFFLINE;
pThis->m_szModuleName = mir_strdup(pszModuleName);
- pThis->m_hProtoIcon = IcoLib_IsManaged(LoadSkinnedProtoIcon(pszModuleName, ID_STATUS_ONLINE));
+ pThis->m_hProtoIcon = IcoLib_IsManaged(Skin_LoadProtoIcon(pszModuleName, ID_STATUS_ONLINE));
pThis->m_tszUserName = mir_tstrdup(ptszUserName);
}
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index fae4fb3f3e..3800ca318d 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -642,7 +642,7 @@ CCtrlMButton::CCtrlMButton(CDlgBase* dlg, int ctrlId, HICON hIcon, const char* t CCtrlMButton::CCtrlMButton(CDlgBase* dlg, int ctrlId, int iCoreIcon, const char* tooltip)
: CCtrlButton(dlg, ctrlId),
- m_hIcon(::LoadSkinnedIcon(iCoreIcon)),
+ m_hIcon(::Skin_LoadIcon(iCoreIcon)),
m_toolTip(tooltip)
{}
@@ -2648,6 +2648,6 @@ void CProtoIntDlgBase::UpdateStatusBar() RECT rcStatus; GetWindowRect(m_hwndStatus, &rcStatus);
int parts[] = { rcStatus.right - rcStatus.left - sz.cx, -1 };
SendMessage(m_hwndStatus, SB_SETPARTS, 2, (LPARAM)parts);
- SendMessage(m_hwndStatus, SB_SETICON, 1, (LPARAM)LoadSkinnedProtoIcon(m_proto_interface->m_szModuleName, m_proto_interface->m_iStatus));
+ SendMessage(m_hwndStatus, SB_SETICON, 1, (LPARAM)Skin_LoadProtoIcon(m_proto_interface->m_szModuleName, m_proto_interface->m_iStatus));
SendMessage(m_hwndStatus, SB_SETTEXT, 1, (LPARAM)m_proto_interface->m_tszUserName);
}
|