From 3f9882178018afbe9aaaba1f4461f3fc75493260 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 15 Jun 2015 14:23:02 +0000 Subject: 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 --- plugins/Scriver/src/chat/main.cpp | 8 ++++---- plugins/Scriver/src/chat/window.cpp | 4 ++-- plugins/Scriver/src/globals.cpp | 16 ++++++++-------- plugins/Scriver/src/msgdialog.cpp | 11 +++-------- plugins/Scriver/src/msgs.cpp | 6 +++--- 5 files changed, 20 insertions(+), 25 deletions(-) (limited to 'plugins/Scriver') diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp index e8fed79470..a96facf35f 100644 --- a/plugins/Scriver/src/chat/main.cpp +++ b/plugins/Scriver/src/chat/main.cpp @@ -34,11 +34,11 @@ void LoadModuleIcons(MODULEINFO *mi) int overlayIcon = ImageList_AddIcon(hList, GetCachedIcon("chat_overlay")); ImageList_SetOverlayImage(hList, overlayIcon, 1); - int index = ImageList_AddIcon(hList, LoadSkinnedProtoIcon(mi->pszModule, ID_STATUS_ONLINE)); + int index = ImageList_AddIcon(hList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_ONLINE)); mi->hOnlineIcon = ImageList_GetIcon(hList, index, ILD_TRANSPARENT); mi->hOnlineTalkIcon = ImageList_GetIcon(hList, index, ILD_TRANSPARENT | INDEXTOOVERLAYMASK(1)); - index = ImageList_AddIcon(hList, LoadSkinnedProtoIcon(mi->pszModule, ID_STATUS_OFFLINE)); + index = ImageList_AddIcon(hList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_OFFLINE)); mi->hOfflineIcon = ImageList_GetIcon(hList, index, ILD_TRANSPARENT); mi->hOfflineTalkIcon = ImageList_GetIcon(hList, index, ILD_TRANSPARENT | INDEXTOOVERLAYMASK(1)); @@ -124,8 +124,8 @@ static void OnFlashWindow(SESSION_INFO *si, int bInactive) static void OnCreateModule(MODULEINFO *mi) { LoadModuleIcons(mi); - mi->hOnlineIconBig = LoadSkinnedProtoIconBig(mi->pszModule, ID_STATUS_ONLINE); - mi->hOfflineIconBig = LoadSkinnedProtoIconBig(mi->pszModule, ID_STATUS_OFFLINE); + mi->hOnlineIconBig = Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_ONLINE, true); + mi->hOfflineIconBig = Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_OFFLINE, true); } static BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce) diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 60a5bf88c8..cb1655aabc 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -1400,7 +1400,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR FillRect(dis->hDC, &dis->rcItem, pci->hListBkgBrush); if (g_Settings.bShowContactStatus && g_Settings.bContactStatusFirst && ui->ContactStatus) { - hIcon = LoadSkinnedProtoIcon(si->pszModule, ui->ContactStatus); + hIcon = Skin_LoadProtoIcon(si->pszModule, ui->ContactStatus); DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 3, hIcon, 16, 16, 0, NULL, DI_NORMAL); IcoLib_ReleaseIcon(hIcon); x_offset += 18; @@ -1408,7 +1408,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset, pci->SM_GetStatusIcon(si, ui), 10, 10, 0, NULL, DI_NORMAL); x_offset += 12; if (g_Settings.bShowContactStatus && !g_Settings.bContactStatusFirst && ui->ContactStatus) { - hIcon = LoadSkinnedProtoIcon(si->pszModule, ui->ContactStatus); + hIcon = Skin_LoadProtoIcon(si->pszModule, ui->ContactStatus); DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 3, hIcon, 16, 16, 0, NULL, DI_NORMAL); IcoLib_ReleaseIcon(hIcon); x_offset += 18; diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index dde38e5739..3ef13e7fa4 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -174,7 +174,7 @@ static int ackevent(WPARAM, LPARAM lParam) int ImageList_AddIcon_Ex(HIMAGELIST hIml, int id) { - HICON hIcon = LoadSkinnedIcon(id); + HICON hIcon = Skin_LoadIcon(id); int res = ImageList_AddIcon(hIml, hIcon); IcoLib_ReleaseIcon(hIcon); return res; @@ -189,7 +189,7 @@ int ImageList_AddIcon_Ex2(HIMAGELIST hIml, HICON hIcon) int ImageList_ReplaceIcon_Ex(HIMAGELIST hIml, int nIndex, int id) { - HICON hIcon = LoadSkinnedIcon(id); + HICON hIcon = Skin_LoadIcon(id); int res = ImageList_ReplaceIcon(hIml, nIndex, hIcon); IcoLib_ReleaseIcon(hIcon); return res; @@ -197,7 +197,7 @@ int ImageList_ReplaceIcon_Ex(HIMAGELIST hIml, int nIndex, int id) int ImageList_AddIcon_ProtoEx(HIMAGELIST hIml, const char* szProto, int status) { - HICON hIcon = LoadSkinnedProtoIcon(szProto, status); + HICON hIcon = Skin_LoadProtoIcon(szProto, status); int res = ImageList_AddIcon(hIml, hIcon); IcoLib_ReleaseIcon(hIcon); return res; @@ -213,8 +213,8 @@ void ReleaseIcons() HICON GetCachedIcon(const char *name) { for (int i = 0; i < SIZEOF(iconList); i++) - if (!mir_strcmp(iconList[i].szName, name)) - return IcoLib_GetIconByHandle(iconList[i].hIcolib); + if (!mir_strcmp(iconList[i].szName, name)) + return IcoLib_GetIconByHandle(iconList[i].hIcolib); return NULL; } @@ -223,8 +223,8 @@ void LoadGlobalIcons() { int i; - g_dat.hMsgIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE); - g_dat.hMsgIconBig = LoadSkinnedIconBig(SKINICON_EVENT_MESSAGE); + g_dat.hMsgIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); + g_dat.hMsgIconBig = Skin_LoadIcon(SKINICON_EVENT_MESSAGE, true); g_dat.hIconChatBig = IcoLib_GetIcon("chat_window", true); ImageList_RemoveAll(g_dat.hButtonIconList); @@ -321,7 +321,7 @@ void FreeGlobals() if (g_dat.hSearchEngineIconList) ImageList_Destroy(g_dat.hSearchEngineIconList); mir_free(g_dat.tabIconListUsage); - + WindowList_Destroy(g_dat.hMessageWindowList); WindowList_Destroy(g_dat.hParentWindowList); diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 6c93ab2243..c0f45ade83 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -221,15 +221,10 @@ void SetStatusIcon(SrmmWindowData *dat) MCONTACT hContact = db_mc_getSrmmSub(dat->hContact); if (hContact == NULL) hContact = dat->hContact; - char *szProto = GetContactProto(hContact); - - IcoLib_ReleaseIcon(dat->statusIcon); - dat->statusIcon = LoadSkinnedProtoIcon(szProto, dat->wStatus); - IcoLib_ReleaseIcon(dat->statusIconBig); - dat->statusIconBig = LoadSkinnedProtoIconBig(szProto, dat->wStatus); - if ((int)dat->statusIconBig == CALLSERVICE_NOTFOUND) - dat->statusIconBig = NULL; + char *szProto = GetContactProto(hContact); + dat->statusIcon = Skin_LoadProtoIcon(szProto, dat->wStatus, false); + dat->statusIconBig = Skin_LoadProtoIcon(szProto, dat->wStatus, true); if (dat->statusIconOverlay != NULL) DestroyIcon(dat->statusIconOverlay); diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index e4d025badb..ba09683dd0 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -127,7 +127,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) cle.flags = CLEF_TCHAR; cle.hContact = hContact; cle.hDbEvent = hDbEvent; - cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE); + cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); cle.pszService = "SRMsg/ReadMessage"; mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), contactName); cle.ptszTooltip = toolTip; @@ -258,7 +258,7 @@ static void RestoreUnreadMessageAlerts(void) DBEVENTINFO dbei = { sizeof(dbei) }; 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; @@ -450,7 +450,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM 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); -- cgit v1.2.3