From 8e6a28579846d35bc36966dfb50e2eb7f662471a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 4 Apr 2018 22:13:32 +0300 Subject: CLIST_INTERFACE::pfnReloadExtraIcons => ExtraIcon_Reload() CLIST_INTERFACE::pfnSetAllExtraIcons => ExtraIcon_SetAll() --- include/m_clistint.h | 6 ------ include/m_extraicons.h | 12 +++++++++++- libs/win32/mir_app.lib | Bin 146146 -> 146594 bytes libs/win64/mir_app.lib | Bin 141954 -> 142366 bytes plugins/Clist_modern/src/modern_clui.cpp | 6 +++--- plugins/Clist_nicer/src/clcitems.cpp | 2 +- plugins/Clist_nicer/src/clui.cpp | 6 +++--- plugins/UserInfoEx/src/psp_options.cpp | 2 +- src/mir_app/src/clcitems.cpp | 2 +- src/mir_app/src/clistcore.cpp | 4 ---- src/mir_app/src/clui.cpp | 4 ++-- src/mir_app/src/ei_services.cpp | 6 +++--- src/mir_app/src/extraicons.h | 3 --- src/mir_app/src/mir_app.def | 2 ++ src/mir_app/src/mir_app64.def | 2 ++ 15 files changed, 29 insertions(+), 28 deletions(-) diff --git a/include/m_clistint.h b/include/m_clistint.h index a9170b64e5..72fc4ab601 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -469,12 +469,6 @@ struct CLIST_INTERFACE VOID (CALLBACK *pfnTrayCycleTimerProc)(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); - /************************************************************************************* - * version 7 additions (0.11.0.x) - extra images - *************************************************************************************/ - void (*pfnReloadExtraIcons)(void); - void (*pfnSetAllExtraIcons)(MCONTACT hContact); - /************************************************************************************* * Miranda NG additions *************************************************************************************/ diff --git a/include/m_extraicons.h b/include/m_extraicons.h index 8611a02e6c..11ce000a32 100644 --- a/include/m_extraicons.h +++ b/include/m_extraicons.h @@ -123,9 +123,19 @@ EXTERN_C MIR_APP_DLL(int) ExtraIcon_SetIconByName(HANDLE hExtraIcon, MCONTACT hC EXTERN_C MIR_APP_DLL(int) ExtraIcon_Clear(HANDLE hExtraIcon, MCONTACT hContact); ///////////////////////////////////////////////////////////////////////////////////////// -// Adding icon to extra image list. +// Adds an icon to extra image list. // Used for EXTRAICON_TYPE_CALLBACK extra icons EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_AddIcon(HICON hIcon); +///////////////////////////////////////////////////////////////////////////////////////// +// Reloads all extra icons from their sources + +EXTERN_C MIR_APP_DLL(void) ExtraIcon_Reload(); + +///////////////////////////////////////////////////////////////////////////////////////// +// Sets all extra icons for the specified contact or for all contacts by default + +EXTERN_C MIR_APP_DLL(void) ExtraIcon_SetAll(MCONTACT hContact = 0); + #endif // __M_EXTRAICONS_H__ diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib index 72624bf967..b6321032a1 100644 Binary files a/libs/win32/mir_app.lib and b/libs/win32/mir_app.lib differ diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib index f3dab5e776..db1365b736 100644 Binary files a/libs/win64/mir_app.lib and b/libs/win64/mir_app.lib differ diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 04c4ecf386..8ae724f4fb 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -419,7 +419,7 @@ HRESULT CLUI::CreateCLC() CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)Frame.hWnd, (LPARAM)CLCPaint::PaintCallbackProc); CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME, hFrameContactTree), (LPARAM)Translate("My Contacts")); - pcli->pfnReloadExtraIcons(); + ExtraIcon_Reload(); nLastRequiredHeight = 0; if (g_CluiData.current_viewmode[0] == '\0') { @@ -1209,8 +1209,8 @@ int CLUI_IconsChanged(WPARAM, LPARAM) return 0; DrawMenuBar(pcli->hwndContactList); - pcli->pfnReloadExtraIcons(); - pcli->pfnSetAllExtraIcons(0); + ExtraIcon_Reload(); + ExtraIcon_SetAll(); // need to update tray cause it use combined icons pcli->pfnTrayIconIconsChanged(); // TODO: remove as soon as core will include icolib ske_RedrawCompleteWindow(); diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 45eb501421..5a8ff6e979 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -128,7 +128,7 @@ ClcContact* AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hCo LoadAvatarForContact(p); // notify other plugins to re-supply their extra images (icq for xstatus, mBirthday etc...) - pcli->pfnSetAllExtraIcons(hContact); + ExtraIcon_SetAll(hContact); } RTL_DetectAndSet(p, p->hContact); diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 340b5e8863..1eed90914d 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -175,7 +175,7 @@ static HWND PreCreateCLC(HWND parent) // create internal frames, including the last frame (actual CLC control) static int CreateCLC() { - pcli->pfnReloadExtraIcons(); + ExtraIcon_Reload(); pcli->pfnSetHideOffline(oldhideoffline); disableautoupd = 0; { @@ -333,8 +333,8 @@ void ConfigureFrame() void IcoLibReloadIcons() { CacheClientIcons(); - pcli->pfnReloadExtraIcons(); - pcli->pfnSetAllExtraIcons(NULL); + ExtraIcon_Reload(); + ExtraIcon_SetAll(); Clist_Broadcast(CLM_AUTOREBUILD, 0, 0); SendMessage(g_hwndViewModeFrame, WM_USER + 100, 0, 0); diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 64f0140126..057bc4c325 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, FlagsClistChange |= SvcGenderEnableExtraIcons(0 != IsDlgButtonChecked(hDlg, CHECK_OPT_GENDER), true); if (FlagsClistChange) - pcli->pfnSetAllExtraIcons(NULL); + ExtraIcon_SetAll(); if (FlagsMsgWndChange) UpdateStatusIcons(); diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index 15edcc8975..f0e5e596c4 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -428,7 +428,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) } cli.pfnSortCLC(hwnd, dat, 0); - cli.pfnSetAllExtraIcons(0); + ExtraIcon_SetAll(); } int fnGetGroupContentsCount(ClcGroup *group, int visibleOnly) diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index 8b08cb8757..90f7830740 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" #include "clc.h" #include "genmenu.h" -#include "extraicons.h" int LoadContactListModule2(void); int LoadCLCModule(void); @@ -176,9 +175,6 @@ void InitClistCore() cli.pfnShowHide = fnShowHide; cli.pfnGetStatusModeDescription = fnGetStatusModeDescription; - cli.pfnReloadExtraIcons = fnReloadExtraIcons; - cli.pfnSetAllExtraIcons = fnSetAllExtraIcons; - cli.pfnTrayCalcChanged = fnTrayCalcChanged; cli.pfnSetContactCheckboxes = fnSetContactCheckboxes; } diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 493ed1ce8a..34214a3c1b 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -778,11 +778,11 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case CLN_NEWCONTACT: if (nmc != nullptr) - cli.pfnSetAllExtraIcons((UINT_PTR)nmc->hItem); + ExtraIcon_SetAll((UINT_PTR)nmc->hItem); return TRUE; case CLN_LISTREBUILT: - cli.pfnSetAllExtraIcons(0); + ExtraIcon_SetAll(); return FALSE; case NM_KEYDOWN: diff --git a/src/mir_app/src/ei_services.cpp b/src/mir_app/src/ei_services.cpp index d35adfeeda..dbd905a978 100644 --- a/src/mir_app/src/ei_services.cpp +++ b/src/mir_app/src/ei_services.cpp @@ -275,7 +275,7 @@ MIR_APP_DLL(HANDLE) ExtraIcon_AddIcon(HICON hIcon) return (res > 0xFFFE) ? INVALID_HANDLE_VALUE : (HANDLE)res; } -void fnReloadExtraIcons() +MIR_APP_DLL(void) ExtraIcon_Reload() { SendMessage(cli.hwndContactTree, CLM_SETEXTRASPACE, db_get_b(0, "CLUI", "ExtraColumnSpace", 18), 0); SendMessage(cli.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, 0); @@ -291,7 +291,7 @@ void fnReloadExtraIcons() bImageCreated = true; } -void fnSetAllExtraIcons(MCONTACT hContact) +MIR_APP_DLL(void) ExtraIcon_SetAll(MCONTACT hContact) { if (cli.hwndContactTree == nullptr) return; @@ -299,7 +299,7 @@ void fnSetAllExtraIcons(MCONTACT hContact) bool hcontgiven = (hContact != 0); if (!bImageCreated) - cli.pfnReloadExtraIcons(); + ExtraIcon_Reload(); SendMessage(cli.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0); diff --git a/src/mir_app/src/extraicons.h b/src/mir_app/src/extraicons.h index 6c059ca4d7..fd896b3516 100644 --- a/src/mir_app/src/extraicons.h +++ b/src/mir_app/src/extraicons.h @@ -197,9 +197,6 @@ int Clist_SetExtraIcon(MCONTACT hContact, int slot, HANDLE hImage); void DefaultExtraIcons_Load(); -void fnReloadExtraIcons(); -void fnSetAllExtraIcons(MCONTACT hContact); - static inline BOOL IsEmpty(const char *str) { return str == nullptr || str[0] == 0; diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 8503cb7da8..d8d6ae9a11 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -540,3 +540,5 @@ Clist_GetContactIcon @559 Clist_GetAccountIndex @560 Menu_ReloadProtoMenus @561 Menu_GetProtocolMenu @562 +ExtraIcon_Reload @563 +ExtraIcon_SetAll @564 diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 1db6bfddf7..333e4fc5f8 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -540,3 +540,5 @@ Clist_GetContactIcon @559 Clist_GetAccountIndex @560 Menu_ReloadProtoMenus @561 Menu_GetProtocolMenu @562 +ExtraIcon_Reload @563 +ExtraIcon_SetAll @564 -- cgit v1.2.3