diff options
22 files changed, 150 insertions, 192 deletions
diff --git a/include/delphi/m_clistint.inc b/include/delphi/m_clistint.inc index 25107e17b2..37b83db0e3 100644 --- a/include/delphi/m_clistint.inc +++ b/include/delphi/m_clistint.inc @@ -377,7 +377,6 @@ type (* clistmod.c *)
pfnIconFromStatusMode : function (szProto:PAnsiChar; status:int; hContact:TMCONTACT):int; cdecl;
pfnShowHide : function :int; cdecl;
- blablablabla1 : procedure; cdecl;
(* clistsettings.c *)
pfnGetCacheEntry : function (hContact:TMCONTACT):PClcCacheEntry; cdecl;
@@ -389,26 +388,18 @@ type pfnInvalidateDisplayNameCacheEntry : procedure (hContact:TMCONTACT); cdecl;
(* clisttray.c *)
- pfnTrayIconUpdateWithImageList : procedure (iImage:int; szNewTip:TChar; szPreferredProto:PAnsiChar); cdecl;
- pfnTrayIconUpdateBase : procedure (szChangedProto:PAnsiChar); cdecl;
- pfnTrayIconSetToBase : procedure (szPreferredProto:PAnsiChar); cdecl;
- pfnTrayIconIconsChanged : procedure ; cdecl;
pfnTrayIconPauseAutoHide : function (wParam:WPARAM; lParam:LPARAM):int; cdecl;
pfnTrayIconProcessMessage : function (wParam:WPARAM; lParam:LPARAM):int_ptr; cdecl;
- blablabla5 : procedure; cdecl;
(* clui.c *)
pfnContactListWndProc : function(hwnd:HWND; msg:uint; wParam:WPARAM; lParam:LPARAM):int; stdcall;
pfnCluiProtocolStatusChanged : procedure (status:int; szProto:PAnsiChar); cdecl;
- blablablabla4 : procedure; cdecl;
pfnLoadCluiGlobalOpts : procedure; cdecl;
pfnInvalidateRect : function (hwnd:HWND; var lpRect:TRECT; bErase:bool):bool; cdecl;
pfnOnCreateClc : procedure ; cdecl;
(* contact.c *)
- blablablabla2 : procedure; cdecl;
- blablablabla3 : procedure; cdecl;
pfnCompareContacts : function (var contact1:TClcContact; var contact2:TClcContact):int; cdecl;
pfnSetHideOffline : function (wParam:WPARAM; lParam:LPARAM):int; cdecl;
diff --git a/include/m_clistint.h b/include/m_clistint.h index cce531b480..2cf393a059 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -258,6 +258,14 @@ EXTERN_C MIR_APP_DLL(bool) Clist_FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, EXTERN_C MIR_APP_DLL(void) Clist_InitAutoRebuild(HWND hWnd);
EXTERN_C MIR_APP_DLL(void) Clist_LoadContactTree(void);
+EXTERN_C MIR_APP_DLL(int) Clist_TrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int status);
+EXTERN_C MIR_APP_DLL(int) Clist_TrayIconDestroy(HWND hwnd);
+EXTERN_C MIR_APP_DLL(void) Clist_TrayIconIconsChanged(void);
+EXTERN_C MIR_APP_DLL(wchar_t*) Clist_TrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto);
+EXTERN_C MIR_APP_DLL(void) Clist_TrayIconRemove(HWND hwnd, const char *szProto);
+EXTERN_C MIR_APP_DLL(int) Clist_TrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto);
+EXTERN_C MIR_APP_DLL(void) Clist_TrayIconUpdateBase(const char *szChangedProto);
+EXTERN_C MIR_APP_DLL(void) Clist_TraySetTimer();
// calculates account's index by its position in status bar
EXTERN_C MIR_APP_DLL(int) Clist_GetAccountIndex(int iPos);
@@ -377,8 +385,6 @@ struct CLIST_INTERFACE int (*pfnIconFromStatusMode)(const char *szProto, int status, MCONTACT hContact);
int (*pfnShowHide)(void);
- void (*blablablabla1)(void);
-
/* clistsettings.c */
ClcCacheEntry* (*pfnGetCacheEntry)(MCONTACT hContact);
ClcCacheEntry* (*pfnCreateCacheItem)(MCONTACT hContact);
@@ -389,34 +395,26 @@ struct CLIST_INTERFACE #define GCDNF_NOCACHE 4 // will not use the cache
wchar_t* (*pfnGetContactDisplayName)(MCONTACT hContact, int mode);
- void (*pfnInvalidateDisplayNameCacheEntry)(MCONTACT hContact);
+ void (*pfnInvalidateDisplayNameCacheEntry)(MCONTACT hContact);
/* clisttray.c */
- void (*pfnTrayIconUpdateWithImageList)(int iImage, const wchar_t *szNewTip, char *szPreferredProto);
- void (*pfnTrayIconUpdateBase)(const char *szChangedProto);
- void (*pfnTrayIconSetToBase)(char *szPreferredProto);
- void (*pfnTrayIconIconsChanged)(void);
- int (*pfnTrayIconPauseAutoHide)(WPARAM wParam, LPARAM lParam);
- INT_PTR (*pfnTrayIconProcessMessage)(WPARAM wParam, LPARAM lParam);
- int (*blablabla5)();
+ int (*pfnTrayIconPauseAutoHide)(WPARAM wParam, LPARAM lParam);
+ INT_PTR (*pfnTrayIconProcessMessage)(WPARAM wParam, LPARAM lParam);
/* clui.c */
- LRESULT (CALLBACK *pfnContactListWndProc)(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+ LRESULT (CALLBACK *pfnContactListWndProc)(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
- void (*pfnCluiProtocolStatusChanged)(int status, const char *szProto);
- int (*blablabla4)();
- void (*pfnLoadCluiGlobalOpts)(void);
- BOOL (*pfnInvalidateRect)(HWND hwnd, CONST RECT* lpRect, BOOL bErase);
- void (*pfnOnCreateClc)(void);
+ void (*pfnCluiProtocolStatusChanged)(int status, const char *szProto);
+ void (*pfnLoadCluiGlobalOpts)(void);
+ BOOL (*pfnInvalidateRect)(HWND hwnd, CONST RECT* lpRect, BOOL bErase);
+ void (*pfnOnCreateClc)(void);
/* contact.c */
- int (*blablabla2)();
- int (*blablabla3)();
- int (*pfnCompareContacts)(const ClcContact *contact1, const ClcContact *contact2);
- int (*pfnSetHideOffline)(int newValue); // TRUE, FALSE or -1 to revert the current setting
+ int (*pfnCompareContacts)(const ClcContact *contact1, const ClcContact *contact2);
+ int (*pfnSetHideOffline)(int newValue); // TRUE, FALSE or -1 to revert the current setting
/* docking.c */
- int (*pfnDocking_ProcessWindowMessage)(WPARAM wParam, LPARAM lParam);
+ int (*pfnDocking_ProcessWindowMessage)(WPARAM wParam, LPARAM lParam);
/*************************************************************************************
* version 2 - events processing
@@ -451,32 +449,18 @@ struct CLIST_INTERFACE struct trayIconInfo_t* trayIcon;
int trayIconCount;
- int shellVersion;
- UINT_PTR cycleTimerId;
int cycleStep;
wchar_t* szTip;
BOOL bTrayMenuOnScreen;
HICON (*pfnGetIconFromStatusMode)(MCONTACT hContact, const char *szProto, int status);
- void (*pfnInitTray)(void);
- void (*pfnUninitTray)(void);
-
- int (*pfnTrayIconAdd)(HWND hwnd, const char *szProto, const char *szIconProto, int status);
- int (*pfnTrayIconDestroy)(HWND hwnd);
+ int (*pfnTrayCalcChanged)(const char *szChangedProto, int averageMode, int iProtoCount);
int (*pfnTrayIconInit)(HWND hwnd);
- wchar_t* (*pfnTrayIconMakeTooltip)(const wchar_t *szPrefix, const char *szProto);
- void (*pfnTrayIconRemove)(HWND hwnd, const char *szProto);
- int (*pfnTrayIconSetBaseInfo)(HICON hIcon, const char *szPreferredProto);
- void (*pfnTrayIconTaskbarCreated)(HWND hwnd);
- int (*pfnTrayIconUpdate)(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase);
-
- VOID (CALLBACK *pfnTrayCycleTimerProc)(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime);
/*************************************************************************************
* Miranda NG additions
*************************************************************************************/
- int (*pfnTrayCalcChanged)(const char *szChangedProto, int averageMode, int iProtoCount);
void (*pfnSetContactCheckboxes)(ClcContact *cc, int checked);
};
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 0e8b553f73..69153d2fd8 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex e605ec1ad7..cc9950341e 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index f5b7dfca1a..c2a35cafac 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -337,7 +337,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara }
}
- pcli->pfnTrayIconDestroy(pcli->hwndContactList);
+ Clist_TrayIconDestroy(pcli->hwndContactList);
pcli->pfnUninitTray();
if (g_wMask & OPT_TRAYICON)
diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index 040723c622..450ab84e49 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -162,7 +162,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP db_set_s(NULL, "CList", "PrimaryStatus", pa->szModuleName);
}
- pcli->pfnTrayIconIconsChanged();
+ Clist_TrayIconIconsChanged();
Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
pcli->pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID); /* force reshuffle */
return TRUE;
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 7cfbdaeddd..cbc887b625 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1647,7 +1647,7 @@ int ClcDoProtoAck(ACKDATA *ack) if (!mir_strcmp(pcli->clcProto[i].szProto, ack->szModule)) {
pcli->clcProto[i].dwStatus = (WORD)ack->lParam;
if (pcli->clcProto[i].dwStatus >= ID_STATUS_OFFLINE)
- pcli->pfnTrayIconUpdateBase(pcli->clcProto[i].szProto);
+ Clist_TrayIconUpdateBase(pcli->clcProto[i].szProto);
return 0;
}
}
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 9be0e4f3cd..911ce3553f 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -739,7 +739,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L | IsDlgButtonChecked(hwndDlg, IDC_ICON_CYCLE_V) << 2
| IsDlgButtonChecked(hwndDlg, IDC_ICON_ALL_V) << 3);
- pcli->pfnTrayIconIconsChanged();
+ Clist_TrayIconIconsChanged();
Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
Clist_InitAutoRebuild(pcli->hwndContactTree); /* force reshuffle */
ClcOptionsChanged(); // Used to force loading avatar an list height related options
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 20ae2065a3..40e25870c9 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -322,7 +322,7 @@ int cliTrayIconInit(HWND hwnd) if (!pcli->trayIconCount) {
pcli->trayIconCount = 1;
pcli->trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * pcli->trayIconCount);
- pcli->pfnTrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
+ Clist_TrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
OldMode = TRAY_ICON_MODE_GLOBAL;
return 0;
}
@@ -342,7 +342,7 @@ int cliTrayIconInit(HWND hwnd) // Добавляем иконки.
switch (Mode) {
case TRAY_ICON_MODE_GLOBAL:
- pcli->pfnTrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
+ Clist_TrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
break;
case TRAY_ICON_MODE_ACC:
@@ -353,14 +353,14 @@ int cliTrayIconInit(HWND hwnd) PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (!pa || !pa->ppro)
- pcli->pfnTrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
+ Clist_TrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
else
- pcli->pfnTrayIconAdd(hwnd, pa->szModuleName, nullptr, pa->ppro->m_iStatus);
+ Clist_TrayIconAdd(hwnd, pa->szModuleName, nullptr, pa->ppro->m_iStatus);
}
break;
case TRAY_ICON_MODE_CYCLE:
- pcli->pfnTrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
+ Clist_TrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
pcli->cycleStep = 0;
cliTrayCycleTimerProc(nullptr, 0, 0, 0); // force icon update
// Не сохраняем ID таймера в pcli, чтобы fnTrayIconUpdateBase не убивала его.
@@ -370,7 +370,7 @@ int cliTrayIconInit(HWND hwnd) case TRAY_ICON_MODE_ALL:
for (auto &pa : Accounts().rev_iter())
if (pa->IsVisible() && pa->ppro != nullptr)
- pcli->pfnTrayIconAdd(hwnd, pa->szModuleName, nullptr, pa->ppro->m_iStatus);
+ Clist_TrayIconAdd(hwnd, pa->szModuleName, nullptr, pa->ppro->m_iStatus);
break;
}
@@ -395,7 +395,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) BYTE Mode = db_get_b(0, "CList", (!bDiffers) ? "tiModeS" : "tiModeV", TRAY_ICON_MODE_GLOBAL);
if (Mode != OldMode) {
OldMode = Mode;
- pcli->pfnTrayIconIconsChanged();
+ Clist_TrayIconIconsChanged();
}
HICON hIcon = nullptr;
@@ -404,7 +404,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) switch (Mode) {
case TRAY_ICON_MODE_GLOBAL:
hIcon = pcli->pfnGetIconFromStatusMode(0, nullptr, CListTray_GetGlobalStatus(0, 0));
- pcli->pfnTrayIconMakeTooltip(nullptr, nullptr);
+ Clist_TrayIconMakeTooltip(nullptr, nullptr);
break;
case TRAY_ICON_MODE_ACC:
@@ -420,7 +420,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) else
hIcon = pcli->pfnGetIconFromStatusMode(0, szProto, CallProtoService(szProto, PS_GETSTATUS, 0, 0));
- pcli->pfnTrayIconMakeTooltip(nullptr, szProto);
+ Clist_TrayIconMakeTooltip(nullptr, szProto);
}
break;
@@ -430,7 +430,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0);
else if (!bConn)
hIcon = pcli->pfnGetIconFromStatusMode(0, szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0));
- pcli->pfnTrayIconMakeTooltip(nullptr, nullptr);
+ Clist_TrayIconMakeTooltip(nullptr, nullptr);
break;
case TRAY_ICON_MODE_ALL:
@@ -444,7 +444,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0);
else
hIcon = pcli->pfnGetIconFromStatusMode(0, szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0));
- pcli->pfnTrayIconMakeTooltip(nullptr, pcli->trayIcon[i].szProto);
+ Clist_TrayIconMakeTooltip(nullptr, pcli->trayIcon[i].szProto);
break;
}
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 8ae724f4fb..6d3c0f0027 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -1211,8 +1211,9 @@ int CLUI_IconsChanged(WPARAM, LPARAM) DrawMenuBar(pcli->hwndContactList);
ExtraIcon_Reload();
ExtraIcon_SetAll();
+
// need to update tray cause it use combined icons
- pcli->pfnTrayIconIconsChanged(); // TODO: remove as soon as core will include icolib
+ Clist_TrayIconIconsChanged(); // TODO: remove as soon as core will include icolib
ske_RedrawCompleteWindow();
return 0;
}
@@ -1961,9 +1962,9 @@ LRESULT CLUI::OnStatusBarUpdateTimer(UINT msg, WPARAM wParam, LPARAM lParam) if (IsWindowVisible(pcli->hwndStatus))
pcli->pfnInvalidateRect(pcli->hwndStatus, nullptr, 0);
if (pt->bGlobal)
- pcli->pfnTrayIconUpdateBase(g_szConnectingProto);
+ Clist_TrayIconUpdateBase(g_szConnectingProto);
else
- pcli->pfnTrayIconUpdateBase(pt->szProto);
+ Clist_TrayIconUpdateBase(pt->szProto);
pcli->pfnInvalidateRect(pcli->hwndStatus, nullptr, TRUE);
return DefCluiWndProc(msg, wParam, lParam);
@@ -2523,7 +2524,7 @@ LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM) RemoveMenu(g_hMenuMain, 0, MF_BYPOSITION);
DestroyMenu(g_hMenuMain);
- pcli->pfnTrayIconDestroy(m_hWnd);
+ Clist_TrayIconDestroy(m_hWnd);
mutex_bAnimationInProgress = 0;
CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)hFrameContactTree, 0);
TRACE("CLUI.c: WM_DESTROY - hFrameContactTree removed\n");
diff --git a/plugins/Clist_modern/src/modern_cluiservices.cpp b/plugins/Clist_modern/src/modern_cluiservices.cpp index 541a52cd78..ef14742cc7 100644 --- a/plugins/Clist_modern/src/modern_cluiservices.cpp +++ b/plugins/Clist_modern/src/modern_cluiservices.cpp @@ -36,7 +36,7 @@ void cliCluiProtocolStatusChanged(int, const char * proto) {
CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)pcli->hwndStatus, 0);
if (proto)
- pcli->pfnTrayIconUpdateBase(proto);
+ Clist_TrayIconUpdateBase(proto);
}
int CLUIServices_LoadModule(void)
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index ff94f0b4c9..92b0e48002 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -165,7 +165,7 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP else
db_set_s(NULL, "CList", "PrimaryStatus", pa->szModuleName);
}
- pcli->pfnTrayIconIconsChanged();
+ Clist_TrayIconIconsChanged();
db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
ConfigureFrame();
ConfigureCLUIGeometry(1);
diff --git a/plugins/Clist_nicer/src/clisttray.cpp b/plugins/Clist_nicer/src/clisttray.cpp index 441f7340c7..f17dcb99ba 100644 --- a/plugins/Clist_nicer/src/clisttray.cpp +++ b/plugins/Clist_nicer/src/clisttray.cpp @@ -42,39 +42,39 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou if (db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)) {
iIcon = IconFromStatusMode(szChangedProto, averageMode, 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, szChangedProto);
+ return Clist_TrayIconSetBaseInfo(hIcon, szChangedProto);
}
if (pcli->trayIcon == nullptr || pcli->trayIcon[0].szProto == nullptr) {
iIcon = IconFromStatusMode(nullptr, averageMode, 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, nullptr);
+ return Clist_TrayIconSetBaseInfo(hIcon, nullptr);
}
- pcli->pfnTrayIconDestroy(hwnd);
+ Clist_TrayIconDestroy(hwnd);
pcli->pfnTrayIconInit(hwnd);
}
else {
iIcon = IconFromStatusMode(nullptr, averageMode, 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, nullptr);
+ return Clist_TrayIconSetBaseInfo(hIcon, nullptr);
}
}
else {
switch (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT)) {
case SETTING_TRAYICON_CYCLE:
+ Clist_TraySetTimer();
iIcon = IconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), 0, &hIcon);
- pcli->cycleTimerId = SetTimer(nullptr, 0, db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, pcli->pfnTrayCycleTimerProc);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, nullptr);
+ return Clist_TrayIconSetBaseInfo(hIcon, nullptr);
case SETTING_TRAYICON_MULTI:
if (!pcli->trayIcon)
- pcli->pfnTrayIconRemove(nullptr, nullptr);
+ Clist_TrayIconRemove(nullptr, nullptr);
else if (db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)) {
iIcon = IconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, szChangedProto);
+ return Clist_TrayIconSetBaseInfo(hIcon, szChangedProto);
}
- pcli->pfnTrayIconDestroy(hwnd);
+ Clist_TrayIconDestroy(hwnd);
pcli->pfnTrayIconInit(hwnd);
break;
@@ -82,14 +82,14 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou ptrA szProto(db_get_sa(NULL, "CList", "PrimaryStatus"));
iIcon = IconFromStatusMode(szProto, szProto ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0), 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, nullptr);
+ return Clist_TrayIconSetBaseInfo(hIcon, nullptr);
}
}
}
else {
iIcon = IconFromStatusMode(nullptr, averageMode, 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, nullptr);
+ return Clist_TrayIconSetBaseInfo(hIcon, nullptr);
}
return -1;
diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp index 6263f4dbf9..32b8dafab8 100644 --- a/src/core/stdclist/src/clistopts.cpp +++ b/src/core/stdclist/src/clistopts.cpp @@ -179,7 +179,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP db_set_s(NULL, "CList", "PrimaryStatus", pa->szModuleName);
}
- pcli->pfnTrayIconIconsChanged();
+ Clist_TrayIconIconsChanged();
Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
pcli->pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID); /* force reshuffle */
return TRUE;
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 98a1f82a2c..ccc145255f 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -148,25 +148,16 @@ int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY); /* clisttray.c */
extern mir_cs trayLockCS;
-void fnInitTray(void);
-void fnUninitTray(void);
-int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int status);
-int fnTrayIconDestroy(HWND hwnd);
-void fnTrayIconIconsChanged(void);
int fnTrayIconInit(HWND hwnd);
-wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto);
int fnTrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam);
-INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
-void fnTrayIconRemove(HWND hwnd, const char *szProto);
-int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto);
-void fnTrayIconSetToBase(char *szPreferredProto);
-void fnTrayIconTaskbarCreated(HWND hwnd);
-int fnTrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase);
-void fnTrayIconUpdateBase(const char *szChangedProto);
+INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount);
-void fnTrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, char *szPreferredProto);
-VOID CALLBACK fnTrayCycleTimerProc(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime);
+void InitTray(void);
+void TrayIconSetToBase(char *szPreferredProto);
+void TrayIconTaskbarCreated(HWND hwnd);
+int TrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase);
+void TrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, char *szPreferredProto);
/* clui.c */
LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index 4b8d96c67d..e10d24234a 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -138,24 +138,10 @@ void InitClistCore() cli.pfnGetCacheEntry = fnGetCacheEntry;
cli.szTip = szTip;
- cli.pfnInitTray = fnInitTray;
- cli.pfnUninitTray = fnUninitTray;
- cli.pfnTrayCycleTimerProc = fnTrayCycleTimerProc;
- cli.pfnTrayIconAdd = fnTrayIconAdd;
- cli.pfnTrayIconDestroy = fnTrayIconDestroy;
- cli.pfnTrayIconIconsChanged = fnTrayIconIconsChanged;
cli.pfnTrayIconInit = fnTrayIconInit;
- cli.pfnTrayIconMakeTooltip = fnTrayIconMakeTooltip;
cli.pfnTrayIconPauseAutoHide = fnTrayIconPauseAutoHide;
cli.pfnTrayIconProcessMessage = fnTrayIconProcessMessage;
- cli.pfnTrayIconRemove = fnTrayIconRemove;
- cli.pfnTrayIconSetBaseInfo = fnTrayIconSetBaseInfo;
- cli.pfnTrayIconSetToBase = fnTrayIconSetToBase;
- cli.pfnTrayIconTaskbarCreated = fnTrayIconTaskbarCreated;
- cli.pfnTrayIconUpdate = fnTrayIconUpdate;
- cli.pfnTrayIconUpdateBase = fnTrayIconUpdateBase;
- cli.pfnTrayIconUpdateWithImageList = fnTrayIconUpdateWithImageList;
cli.pfnContactListWndProc = fnContactListWndProc;
cli.pfnLoadCluiGlobalOpts = fnLoadCluiGlobalOpts;
diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp index cb38afa82b..fff355e70f 100644 --- a/src/mir_app/src/clistevents.cpp +++ b/src/mir_app/src/clistevents.cpp @@ -93,7 +93,7 @@ int fnGetImlIconIndex(HICON hIcon) static void ShowOneEventInTray(int idx)
{
- cli.pfnTrayIconUpdateWithImageList((iconsOn || disableTrayFlash) ? g_cliEvents[idx].imlIconIndex : 0, g_cliEvents[idx].szTooltip.w, GetEventProtocol(idx));
+ TrayIconUpdateWithImageList((iconsOn || disableTrayFlash) ? g_cliEvents[idx].imlIconIndex : 0, g_cliEvents[idx].szTooltip.w, GetEventProtocol(idx));
}
static void ShowEventsInTray()
@@ -152,7 +152,7 @@ static VOID CALLBACK IconFlashTimer(HWND, UINT, UINT_PTR idEvent, DWORD) if (g_cliEvents.getCount() == 0) {
KillTimer(nullptr, idEvent);
- cli.pfnTrayIconSetToBase(nullptr);
+ TrayIconSetToBase(nullptr);
}
iconsOn = !iconsOn;
@@ -187,7 +187,7 @@ CListEvent* fnAddEvent(CLISTEVENT *cle) iconsOn = 1;
flashTimerId = SetTimer(nullptr, 0, db_get_w(0, "CList", "IconFlashTime", 550), IconFlashTimer);
- cli.pfnTrayIconUpdateWithImageList(p->imlIconIndex, p->szTooltip.w, szProto);
+ TrayIconUpdateWithImageList(p->imlIconIndex, p->szTooltip.w, szProto);
}
Clist_ChangeContactIcon(cle->hContact, p->imlIconIndex);
return p;
@@ -234,14 +234,14 @@ int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent) if (g_cliEvents.getCount() == 0 || nSameProto == 0) {
if (g_cliEvents.getCount() == 0)
KillTimer(nullptr, flashTimerId);
- cli.pfnTrayIconSetToBase(hContact == 0 ? nullptr : szProto);
+ TrayIconSetToBase(hContact == 0 ? nullptr : szProto);
}
else {
if (g_cliEvents[0].hContact == 0)
szProto = nullptr;
else
szProto = GetContactProto(g_cliEvents[0].hContact);
- cli.pfnTrayIconUpdateWithImageList(iconsOn ? g_cliEvents[0].imlIconIndex : 0, g_cliEvents[0].szTooltip.w, szProto);
+ TrayIconUpdateWithImageList(iconsOn ? g_cliEvents[0].imlIconIndex : 0, g_cliEvents[0].szTooltip.w, szProto);
}
return 0;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index e425e82a17..b9bb9727f9 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -129,7 +129,7 @@ static int ProtocolAck(WPARAM, LPARAM lParam) }
}
- cli.pfnTrayIconUpdateBase(ack->szModule);
+ Clist_TrayIconUpdateBase(ack->szModule);
return 0;
}
@@ -214,7 +214,7 @@ static int ContactListAccountsChanged(WPARAM eventCode, LPARAM lParam) break;
}
Menu_ReloadProtoMenus();
- cli.pfnTrayIconIconsChanged();
+ Clist_TrayIconIconsChanged();
Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0);
Clist_Broadcast(INTM_INVALIDATE, 0, 0);
return 0;
@@ -255,7 +255,7 @@ static int CListIconsChanged(WPARAM, LPARAM) for (auto &it : protoIconIndex)
for (int j = 0; j < _countof(statusModeList); j++)
ImageList_ReplaceIcon_IconLibLoaded(hCListImages, it->iIconBase + j, Skin_LoadProtoIcon(it->szProto, statusModeList[j]));
- cli.pfnTrayIconIconsChanged();
+ Clist_TrayIconIconsChanged();
cli.pfnInvalidateRect(cli.hwndContactList, nullptr, TRUE);
return 0;
}
@@ -425,7 +425,7 @@ int LoadContactListModule2(void) InitCListEvents();
InitGroupServices();
- cli.pfnInitTray();
+ InitTray();
HookEvent(ME_SKIN_ICONSCHANGED, CListIconsChanged);
return 0;
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index 09b07d7506..c57c684a1d 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -32,6 +32,7 @@ extern HIMAGELIST hCListImages; static UINT WM_TASKBARCREATED;
static UINT WM_TASKBARBUTTONCREATED;
static UINT_PTR RefreshTimerId = 0; /////by FYR
+static UINT_PTR CycleTimerId;
mir_cs trayLockCS;
@@ -67,7 +68,7 @@ static void SetTaskBarIcon(const HICON hIcon, const wchar_t *szNewTip) }
}
-wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto)
+MIR_APP_DLL(wchar_t*) Clist_TrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto)
{
initcheck nullptr;
@@ -79,7 +80,7 @@ wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto) return nullptr;
if (accounts.getCount() == 1)
- return cli.pfnTrayIconMakeTooltip(szPrefix, accounts[0]->szModuleName);
+ return Clist_TrayIconMakeTooltip(szPrefix, accounts[0]->szModuleName);
CMStringW tszTip;
@@ -153,7 +154,7 @@ wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto) return cli.szTip;
}
-int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int status)
+MIR_APP_DLL(int) Clist_TrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int status)
{
initcheck 0;
@@ -171,14 +172,11 @@ int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int s NOTIFYICONDATA nid = { NOTIFYICONDATA_V2_SIZE };
nid.hWnd = hwnd;
nid.uID = p.id;
- nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
+ nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP | NIF_INFO;
nid.uCallbackMessage = TIM_CALLBACK;
nid.hIcon = p.hBaseIcon;
- if (cli.shellVersion >= 5)
- nid.uFlags |= NIF_INFO;
-
- cli.pfnTrayIconMakeTooltip(nullptr, p.szProto);
+ Clist_TrayIconMakeTooltip(nullptr, p.szProto);
if (!hasTips())
mir_wstrncpy(nid.szTip, cli.szTip, _countof(nid.szTip));
replaceStrW(p.ptszToolTip, cli.szTip);
@@ -191,7 +189,7 @@ int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int s return i;
}
-void fnTrayIconRemove(HWND hwnd, const char *szProto)
+MIR_APP_DLL(void) Clist_TrayIconRemove(HWND hwnd, const char *szProto)
{
initcheck;
@@ -224,9 +222,9 @@ int fnTrayIconInit(HWND hwnd) int netProtoCount = 0;
int averageMode = Proto_GetAverageStatus(&netProtoCount);
- if (cli.cycleTimerId) {
- KillTimer(nullptr, cli.cycleTimerId);
- cli.cycleTimerId = 0;
+ if (CycleTimerId) {
+ KillTimer(nullptr, CycleTimerId);
+ CycleTimerId = 0;
}
cli.trayIconCount = 1;
@@ -243,7 +241,7 @@ int fnTrayIconInit(HWND hwnd) else
szProto = nullptr;
- cli.pfnTrayIconAdd(hwnd, nullptr, szProto, szProto ? CallProtoServiceInt(0, szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
+ Clist_TrayIconAdd(hwnd, nullptr, szProto, szProto ? CallProtoServiceInt(0, szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
db_free(&dbv);
}
else if (trayIconSetting == SETTING_TRAYICON_MULTI && (averageMode < 0 || db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))) {
@@ -253,26 +251,26 @@ int fnTrayIconInit(HWND hwnd) if (j >= 0) {
PROTOACCOUNT *pa = accounts[j];
if (pa->IsVisible())
- cli.pfnTrayIconAdd(hwnd, pa->szModuleName, nullptr, CallProtoServiceInt(0, pa->szModuleName, PS_GETSTATUS, 0, 0));
+ Clist_TrayIconAdd(hwnd, pa->szModuleName, nullptr, CallProtoServiceInt(0, pa->szModuleName, PS_GETSTATUS, 0, 0));
}
}
}
else {
- cli.pfnTrayIconAdd(hwnd, nullptr, nullptr, averageMode);
+ Clist_TrayIconAdd(hwnd, nullptr, nullptr, averageMode);
if (trayIconSetting == SETTING_TRAYICON_CYCLE && averageMode < 0)
- cli.cycleTimerId = SetTimer(nullptr, 0, db_get_w(0, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cli.pfnTrayCycleTimerProc);
+ Clist_TraySetTimer();
}
}
else {
cli.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t));
- cli.pfnTrayIconAdd(hwnd, nullptr, nullptr, CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
+ Clist_TrayIconAdd(hwnd, nullptr, nullptr, CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
}
return 0;
}
-int fnTrayIconDestroy(HWND hwnd)
+MIR_APP_DLL(int) Clist_TrayIconDestroy(HWND hwnd)
{
initcheck 0;
@@ -297,10 +295,10 @@ int fnTrayIconDestroy(HWND hwnd) }
// called when Explorer crashes and the taskbar is remade
-void fnTrayIconTaskbarCreated(HWND hwnd)
+void TrayIconTaskbarCreated(HWND hwnd)
{
initcheck;
- cli.pfnTrayIconDestroy(hwnd);
+ Clist_TrayIconDestroy(hwnd);
cli.pfnTrayIconInit(hwnd);
}
@@ -312,10 +310,10 @@ static VOID CALLBACK RefreshTimerProc(HWND, UINT, UINT_PTR, DWORD) }
for (auto &it : accounts)
- cli.pfnTrayIconUpdateBase(it->szModuleName);
+ Clist_TrayIconUpdateBase(it->szModuleName);
}
-int fnTrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase)
+int TrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase)
{
initcheck - 1;
mir_cslock lck(trayLockCS);
@@ -334,9 +332,8 @@ int fnTrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPref continue;
nid.uID = cli.trayIcon[i].id;
- cli.pfnTrayIconMakeTooltip(szNewTip, cli.trayIcon[i].szProto);
- mir_free(cli.trayIcon[i].ptszToolTip);
- cli.trayIcon[i].ptszToolTip = mir_wstrdup(cli.szTip);
+ Clist_TrayIconMakeTooltip(szNewTip, cli.trayIcon[i].szProto);
+ replaceStrW(cli.trayIcon[i].ptszToolTip, cli.szTip);
if (!hasTips())
mir_wstrncpy(nid.szTip, cli.szTip, _countof(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
@@ -356,9 +353,8 @@ int fnTrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPref continue;
nid.uID = cli.trayIcon[i].id;
- cli.pfnTrayIconMakeTooltip(szNewTip, cli.trayIcon[i].szProto);
- mir_free(cli.trayIcon[i].ptszToolTip);
- cli.trayIcon[i].ptszToolTip = mir_wstrdup(cli.szTip);
+ Clist_TrayIconMakeTooltip(szNewTip, cli.trayIcon[i].szProto);
+ replaceStrW(cli.trayIcon[i].ptszToolTip, cli.szTip);
if (!hasTips())
mir_wstrncpy(nid.szTip, cli.szTip, _countof(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
@@ -386,7 +382,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPref return -1;
}
-int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto)
+MIR_APP_DLL(int) Clist_TrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto)
{
if (!fTrayInited) {
LBL_Error:
@@ -427,14 +423,16 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto) goto LBL_Error;
}
-void fnTrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, char *szPreferredProto)
+void TrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, char *szPreferredProto)
{
HICON hIcon = ImageList_GetIcon(hCListImages, iImage, ILD_NORMAL);
- cli.pfnTrayIconUpdate(hIcon, szNewTip, szPreferredProto, 0);
+ TrayIconUpdate(hIcon, szNewTip, szPreferredProto, 0);
DestroyIcon(hIcon);
}
-VOID CALLBACK fnTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static VOID CALLBACK TrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD)
{
initcheck;
mir_cslock lck(trayLockCS);
@@ -451,11 +449,18 @@ VOID CALLBACK fnTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD) cli.trayIcon[0].hBaseIcon = cli.pfnGetIconFromStatusMode(0, accounts[cli.cycleStep]->szModuleName,
CallProtoServiceInt(0, accounts[cli.cycleStep]->szModuleName, PS_GETSTATUS, 0, 0));
if (cli.trayIcon[0].isBase)
- cli.pfnTrayIconUpdate(cli.trayIcon[0].hBaseIcon, nullptr, nullptr, 1);
+ TrayIconUpdate(cli.trayIcon[0].hBaseIcon, nullptr, nullptr, 1);
}
}
-void fnTrayIconUpdateBase(const char *szChangedProto)
+MIR_APP_DLL(void) Clist_TraySetTimer()
+{
+ CycleTimerId = SetTimer(nullptr, CycleTimerId, db_get_w(0, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, TrayCycleTimerProc);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_APP_DLL(void) Clist_TrayIconUpdateBase(const char *szChangedProto)
{
initcheck;
if (szChangedProto == nullptr) return;
@@ -465,9 +470,9 @@ void fnTrayIconUpdateBase(const char *szChangedProto) mir_cslock lck(trayLockCS);
int averageMode = Proto_GetAverageStatus(&netProtoCount);
- if (cli.cycleTimerId) {
- KillTimer(nullptr, cli.cycleTimerId);
- cli.cycleTimerId = 0;
+ if (CycleTimerId) {
+ KillTimer(nullptr, CycleTimerId);
+ CycleTimerId = 0;
}
for (auto &it : accounts)
@@ -476,56 +481,56 @@ void fnTrayIconUpdateBase(const char *szChangedProto) int changed = cli.pfnTrayCalcChanged(szChangedProto, averageMode, netProtoCount);
if (changed != -1 && cli.trayIcon[changed].isBase)
- cli.pfnTrayIconUpdate(cli.trayIcon[changed].hBaseIcon, nullptr, cli.trayIcon[changed].szProto, 1);
+ TrayIconUpdate(cli.trayIcon[changed].hBaseIcon, nullptr, cli.trayIcon[changed].szProto, 1);
}
int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount)
{
if (netProtoCount == 0)
- return cli.pfnTrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(nullptr, averageMode, 0), ILD_NORMAL), nullptr);
+ return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(nullptr, averageMode, 0), ILD_NORMAL), nullptr);
int trayIconSetting = db_get_b(0, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
if (averageMode > 0) {
if (trayIconSetting != SETTING_TRAYICON_MULTI)
- return cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
+ return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
if (db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
- return cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szChangedProto, CallProtoServiceInt(0, szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
+ return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szChangedProto, CallProtoServiceInt(0, szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
if (cli.trayIcon == nullptr || cli.trayIcon[0].szProto == nullptr)
- return cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
+ return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
- cli.pfnTrayIconDestroy(cli.hwndContactList);
+ Clist_TrayIconDestroy(cli.hwndContactList);
cli.pfnTrayIconInit(cli.hwndContactList);
}
else {
switch (trayIconSetting) {
case SETTING_TRAYICON_CYCLE:
- cli.cycleTimerId = SetTimer(nullptr, 0, db_get_w(0, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cli.pfnTrayCycleTimerProc);
- return cli.pfnTrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(szChangedProto, CallProtoServiceInt(0, szChangedProto, PS_GETSTATUS, 0, 0), 0), ILD_NORMAL), nullptr);
+ Clist_TraySetTimer();
+ return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(szChangedProto, CallProtoServiceInt(0, szChangedProto, PS_GETSTATUS, 0, 0), 0), ILD_NORMAL), nullptr);
case SETTING_TRAYICON_MULTI:
if (!cli.trayIcon)
- cli.pfnTrayIconRemove(nullptr, nullptr);
+ Clist_TrayIconRemove(nullptr, nullptr);
else if ((cli.trayIconCount > 1 || netProtoCount == 1) || db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
- return cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szChangedProto, CallProtoServiceInt(0, szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
+ return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szChangedProto, CallProtoServiceInt(0, szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
else {
- cli.pfnTrayIconDestroy(cli.hwndContactList);
+ Clist_TrayIconDestroy(cli.hwndContactList);
cli.pfnTrayIconInit(cli.hwndContactList);
}
break;
case SETTING_TRAYICON_SINGLE:
ptrA szProto(db_get_sa(0, "CList", "PrimaryStatus"));
- return cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szProto, szProto ? CallProtoServiceInt(0, szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto);
+ return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szProto, szProto ? CallProtoServiceInt(0, szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto);
}
}
return -1;
}
-void fnTrayIconSetToBase(char *szPreferredProto)
+void TrayIconSetToBase(char *szPreferredProto)
{
int i;
initcheck;
@@ -536,7 +541,7 @@ void fnTrayIconSetToBase(char *szPreferredProto) continue;
if (mir_strcmp(cli.trayIcon[i].szProto, szPreferredProto))
continue;
- cli.pfnTrayIconUpdate(cli.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
+ TrayIconUpdate(cli.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
return;
}
@@ -544,17 +549,17 @@ void fnTrayIconSetToBase(char *szPreferredProto) for (i = 0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
- cli.pfnTrayIconUpdate(cli.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
+ TrayIconUpdate(cli.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
return;
}
}
-void fnTrayIconIconsChanged(void)
+MIR_APP_DLL(void) Clist_TrayIconIconsChanged()
{
initcheck;
mir_cslock lck(trayLockCS);
- cli.pfnTrayIconDestroy(cli.hwndContactList);
+ Clist_TrayIconDestroy(cli.hwndContactList);
cli.pfnTrayIconInit(cli.hwndContactList);
}
@@ -661,8 +666,8 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) break;
case WM_DESTROY:
- cli.pfnTrayIconDestroy(msg->hwnd);
- cli.pfnUninitTray();
+ Clist_TrayIconDestroy(msg->hwnd);
+ fTrayInited = false;
break;
case TIM_CALLBACK:
@@ -744,7 +749,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) default:
if (msg->message == WM_TASKBARCREATED) {
- cli.pfnTrayIconTaskbarCreated(msg->hwnd);
+ TrayIconTaskbarCreated(msg->hwnd);
*((LRESULT*)lParam) = 0;
return TRUE;
}
@@ -826,23 +831,7 @@ MIR_APP_DLL(int) Clist_TrayNotifyW(const char *szProto, const wchar_t *wszInfoTi /////////////////////////////////////////////////////////////////////////////////////////
-static DLLVERSIONINFO dviShell = { sizeof(dviShell) };
-
-void fnInitTray(void)
+void InitTray(void)
{
- if (HMODULE hLib = GetModuleHandleA("shell32")) {
- if (DLLGETVERSIONPROC proc = (DLLGETVERSIONPROC)GetProcAddress(hLib, "DllGetVersion")) {
- if (proc(&dviShell) == S_OK)
- cli.shellVersion = dviShell.dwMajorVersion;
- }
- }
-
- fTrayInited = TRUE;
+ fTrayInited = true;
}
-
-void fnUninitTray(void)
-{
- fTrayInited = false;
-}
-
-#undef initcheck
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index c69ba57442..0ea6489984 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -546,3 +546,11 @@ Clist_GetStatusModeDescription @565 Clist_LoadContactTree @566
Clist_ChangeContactIcon @567
Clist_DrawMenuItem @568
+Clist_TrayIconUpdateBase @569
+Clist_TrayIconSetBaseInfo @570
+Clist_TrayIconRemove @571
+Clist_TrayIconMakeTooltip @572
+Clist_TrayIconIconsChanged @573
+Clist_TrayIconDestroy @574
+Clist_TrayIconAdd @575
+Clist_TraySetTimer @576
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 2e76e5745a..6a43423a98 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -546,3 +546,11 @@ Clist_GetStatusModeDescription @565 Clist_LoadContactTree @566
Clist_ChangeContactIcon @567
Clist_DrawMenuItem @568
+Clist_TrayIconUpdateBase @569
+Clist_TrayIconSetBaseInfo @570
+Clist_TrayIconRemove @571
+Clist_TrayIconMakeTooltip @572
+Clist_TrayIconIconsChanged @573
+Clist_TrayIconDestroy @574
+Clist_TrayIconAdd @575
+Clist_TraySetTimer @576
diff --git a/src/mir_app/src/proto_order.cpp b/src/mir_app/src/proto_order.cpp index 4abd40804f..afa44d91cf 100644 --- a/src/mir_app/src/proto_order.cpp +++ b/src/mir_app/src/proto_order.cpp @@ -198,7 +198,7 @@ public: WriteDbAccounts();
Menu_ReloadProtoMenus();
- cli.pfnTrayIconIconsChanged();
+ Clist_TrayIconIconsChanged();
Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0);
Clist_Broadcast(INTM_INVALIDATE, 0, 0);
}
|