summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/stdclist/src/clistopts.cpp2
-rw-r--r--src/mir_app/src/clc.h21
-rw-r--r--src/mir_app/src/clistcore.cpp14
-rw-r--r--src/mir_app/src/clistevents.cpp10
-rw-r--r--src/mir_app/src/clistmod.cpp8
-rw-r--r--src/mir_app/src/clisttray.cpp139
-rw-r--r--src/mir_app/src/mir_app.def8
-rw-r--r--src/mir_app/src/mir_app64.def8
-rw-r--r--src/mir_app/src/proto_order.cpp2
9 files changed, 97 insertions, 115 deletions
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);
}