diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-05 17:59:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-05 17:59:29 +0300 |
commit | b1ac2547316dca56f32d238d50dc2dc6c8e8aedf (patch) | |
tree | 87483cb57f6a97b1c66e8d3a7d47427731efd9ed /src | |
parent | 200566e2070f941e26ea52078bc8326d4fb76ee0 (diff) |
CLIST_INTERFACE::pfnGetStatusModeDescription => Clist_GetStatusModeDescription
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdaway/src/awaymsg.cpp | 4 | ||||
-rw-r--r-- | src/core/stdaway/src/sendmsg.cpp | 6 | ||||
-rw-r--r-- | src/core/stdidle/src/options.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/clc.h | 1 | ||||
-rw-r--r-- | src/mir_app/src/clistcore.cpp | 1 | ||||
-rw-r--r-- | src/mir_app/src/clistmod.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/clisttray.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/clui.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/cluiservices.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/menu_clist.cpp | 8 | ||||
-rw-r--r-- | src/mir_app/src/meta_services.cpp | 3 | ||||
-rw-r--r-- | src/mir_app/src/meta_utils.cpp | 3 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/skinicons.cpp | 4 |
16 files changed, 25 insertions, 21 deletions
diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp index 87a68ffb0c..62929752aa 100644 --- a/src/core/stdaway/src/awaymsg.cpp +++ b/src/core/stdaway/src/awaymsg.cpp @@ -58,7 +58,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
char *szProto = GetContactProto(dat->hContact);
WORD dwStatus = db_get_w(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
- wchar_t *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
+ wchar_t *status = Clist_GetStatusModeDescription(dwStatus, 0);
GetWindowText(hwndDlg, format, _countof(format));
mir_snwprintf(str, format, status, contactName);
@@ -140,7 +140,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)) {
wchar_t str[128];
- mir_snwprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0));
+ mir_snwprintf(str, TranslateT("Re&ad %s message"), Clist_GetStatusModeDescription(status, 0));
Menu_ModifyItem(hAwayMsgMenuItem, str, Skin_LoadProtoIcon(szProto, status), CMIF_NOTOFFLINE);
return 0;
}
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index cbdfe8e782..1ec83b0b38 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -219,7 +219,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa {
wchar_t str[256], format[128];
GetWindowText(hwndDlg, format, _countof(format));
- mir_snwprintf(str, format, pcli->pfnGetStatusModeDescription(dat->statusMode, 0));
+ mir_snwprintf(str, format, Clist_GetStatusModeDescription(dat->statusMode, 0));
SetWindowText(hwndDlg, str);
}
GetDlgItemText(hwndDlg, IDOK, dat->okButtonFormat, _countof(dat->okButtonFormat));
@@ -375,11 +375,11 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam int j;
if (hLst) {
- j = SendDlgItemMessage(hwndDlg, IDC_LST_STATUS, LB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(it, 0));
+ j = SendDlgItemMessage(hwndDlg, IDC_LST_STATUS, LB_ADDSTRING, 0, (LPARAM)Clist_GetStatusModeDescription(it, 0));
SendDlgItemMessage(hwndDlg, IDC_LST_STATUS, LB_SETITEMDATA, j, it);
}
else {
- j = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(it, 0));
+ j = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)Clist_GetStatusModeDescription(it, 0));
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, j, it);
}
diff --git a/src/core/stdidle/src/options.cpp b/src/core/stdidle/src/options.cpp index e9e670fe51..6fd0773192 100644 --- a/src/core/stdidle/src/options.cpp +++ b/src/core/stdidle/src/options.cpp @@ -95,7 +95,7 @@ public: spinIdle.SetPosition(S.iIdleTime1st); for (auto &it : aa_Status) - cmbAAStatus.AddString(pcli->pfnGetStatusModeDescription(it, 0)); + cmbAAStatus.AddString(Clist_GetStatusModeDescription(it, 0)); cmbAAStatus.SetCurSel(IdleGetStatusIndex(S.bAAStatus)); ShowHide(); diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 59bd5898a1..9706b8a49f 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1022,7 +1022,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) m_wStatus = db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE);
wchar_t *contactName = pcli->pfnGetContactDisplayName(m_hContact, 0);
- wchar_t *szStatus = pcli->pfnGetStatusModeDescription(m_szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t *szStatus = Clist_GetStatusModeDescription(m_szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE), 0);
if (g_dat.bUseStatusWinIcon)
mir_snwprintf(newtitle, L"%s - %s", contactName, TranslateT("Message session"));
else
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 7ebafd6aa4..b451b55a12 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -143,7 +143,6 @@ int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent); int fnIconFromStatusMode(const char *szProto, int status, MCONTACT hContact);
int fnShowHide(void);
HICON fnGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status);
-wchar_t* fnGetStatusModeDescription(int wParam, int lParam);
int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY);
/* clisttray.c */
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index 84322e7bd5..8a3da4abc4 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -174,7 +174,6 @@ void InitClistCore() cli.pfnGetWindowVisibleState = fnGetWindowVisibleState;
cli.pfnIconFromStatusMode = fnIconFromStatusMode;
cli.pfnShowHide = fnShowHide;
- cli.pfnGetStatusModeDescription = fnGetStatusModeDescription;
cli.pfnTrayCalcChanged = fnTrayCalcChanged;
cli.pfnSetContactCheckboxes = fnSetContactCheckboxes;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index a4d841cc82..11760fbd2b 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -52,7 +52,7 @@ struct ProtoIconIndex OBJLIST<ProtoIconIndex> protoIconIndex(5, PtrKeySortT);
-wchar_t* fnGetStatusModeDescription(int mode, int flags)
+MIR_APP_DLL(wchar_t*) Clist_GetStatusModeDescription(int mode, int flags)
{
static wchar_t szMode[64];
wchar_t* descr;
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index 9ae7938ae9..09b07d7506 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -100,7 +100,7 @@ wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto) if (!pa->IsVisible())
continue;
- wchar_t *szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(0, pa->szModuleName, PS_GETSTATUS, 0, 0), 0);
+ wchar_t *szStatus = Clist_GetStatusModeDescription(CallProtoServiceInt(0, pa->szModuleName, PS_GETSTATUS, 0, 0), 0);
if (!szStatus)
continue;
@@ -125,7 +125,7 @@ wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto) PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa != nullptr) {
ptrW ProtoXStatus(sttGetXStatus(szProto));
- wchar_t *szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(0, szProto, PS_GETSTATUS, 0, 0), 0);
+ wchar_t *szStatus = Clist_GetStatusModeDescription(CallProtoServiceInt(0, szProto, PS_GETSTATUS, 0, 0), 0);
if (szPrefix && szPrefix[0]) {
if (db_get_b(0, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
if (hasTips()) {
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 34214a3c1b..74f6341ea0 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -989,7 +989,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM x += textSize.cx;
}
if (showOpts & 4) {
- wchar_t* szStatus = cli.pfnGetStatusModeDescription(status, 0);
+ wchar_t* szStatus = Clist_GetStatusModeDescription(status, 0);
if (!szStatus)
szStatus = L"";
GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_wstrlen(szStatus), &textSize);
diff --git a/src/mir_app/src/cluiservices.cpp b/src/mir_app/src/cluiservices.cpp index 2d0f9a71f8..a38b9db7c4 100644 --- a/src/mir_app/src/cluiservices.cpp +++ b/src/mir_app/src/cluiservices.cpp @@ -125,7 +125,7 @@ void fnCluiProtocolStatusChanged(int, const char*) x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
- wchar_t* modeDescr = cli.pfnGetStatusModeDescription(CallProtoServiceInt(0, g_menuProtos[i].szProto, PS_GETSTATUS, 0, 0), 0);
+ wchar_t* modeDescr = Clist_GetStatusModeDescription(CallProtoServiceInt(0, g_menuProtos[i].szProto, PS_GETSTATUS, 0, 0), 0);
GetTextExtentPoint32(hdc, modeDescr, (int)mir_wstrlen(modeDescr), &textSize);
x += textSize.cx;
x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index cc4fde0bad..adb2decf95 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -817,7 +817,7 @@ void RebuildMenuOrder(void) mi.flags |= CMIF_CHECKED;
mi.root = rootmenu;
mi.position = pos++;
- mi.name.w = cli.pfnGetStatusModeDescription(statusModeList[j], GSMDF_UNTRANSLATED);
+ mi.name.w = Clist_GetStatusModeDescription(statusModeList[j], GSMDF_UNTRANSLATED);
mi.hIcon = Skin_LoadProtoIcon(pa->szModuleName, statusModeList[j]);
// owner data
@@ -866,7 +866,7 @@ void RebuildMenuOrder(void) wchar_t buf[256], hotkeyName[100];
WORD hotKey = GetHotkeyValue(statusHotkeys[j]);
HotkeyToName(hotkeyName, _countof(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
- mir_snwprintf(buf, L"%s\t%s", cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName);
+ mir_snwprintf(buf, L"%s\t%s", Clist_GetStatusModeDescription(statusModeList[j], 0), hotkeyName);
mi.name.w = buf;
hStatusMainMenuHandles[j] = Menu_AddItem(hStatusMenuObject, &mi, smep);
@@ -923,7 +923,7 @@ static int sttRebuildHotkeys(WPARAM, LPARAM) wchar_t buf[256], hotkeyName[100];
WORD hotKey = GetHotkeyValue(statusHotkeys[j]);
HotkeyToName(hotkeyName, _countof(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
- mir_snwprintf(buf, L"%s\t%s", cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName);
+ mir_snwprintf(buf, L"%s\t%s", Clist_GetStatusModeDescription(statusModeList[j], 0), hotkeyName);
Menu_ModifyItem(hStatusMainMenuHandles[j], buf);
hStatusMainMenuHandles[j]->hotKey = MAKELONG(HIBYTE(hotKey), LOBYTE(hotKey));
@@ -1113,7 +1113,7 @@ void InitCustomMenus(void) mir_snprintf(szName, "StatusHotKey_%d", i);
hkd.pszName = szName;
hkd.lParam = statusModeList[i];
- hkd.szDescription.w = fnGetStatusModeDescription(hkd.lParam, 0);
+ hkd.szDescription.w = Clist_GetStatusModeDescription(hkd.lParam, 0);
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, '0' + i) | HKF_MIRANDA_LOCAL;
hkd.pszService = MS_CLIST_HKSTATUS;
statusHotkeys[i] = Hotkey_Register(&hkd);
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 604b3064dc..90401e1e58 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_nudge.h>
+#include "clc.h"
#include "metacontacts.h"
extern "C" MIR_CORE_DLL(void) db_mc_notifyDefChange(WPARAM wParam, LPARAM lParam);
@@ -424,7 +425,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) db_set_w(ccMeta->contactID, META_PROTO, buffer, dcws->value.wVal);
mir_snprintf(buffer, "StatusString%d", contact_number);
- db_set_ws(ccMeta->contactID, META_PROTO, buffer, cli.pfnGetStatusModeDescription(dcws->value.wVal, 0));
+ db_set_ws(ccMeta->contactID, META_PROTO, buffer, Clist_GetStatusModeDescription(dcws->value.wVal, 0));
// set status to that of most online contact
MCONTACT hMostOnline = Meta_GetMostOnline(ccMeta);
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 7a1b8565a0..6fe1980936 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
+#include "clc.h"
#include "metacontacts.h"
HANDLE invisiGroup;
@@ -140,7 +141,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) // write status string
mir_snprintf(buffer, "StatusString%d", ccDest->nSubs);
- wchar_t *szStatus = cli.pfnGetStatusModeDescription(status, 0);
+ wchar_t *szStatus = Clist_GetStatusModeDescription(status, 0);
db_set_ws(hMeta, META_PROTO, buffer, szStatus);
// Write the link in the contact
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index d8d6ae9a11..73871eaabc 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -542,3 +542,4 @@ Menu_ReloadProtoMenus @561 Menu_GetProtocolMenu @562
ExtraIcon_Reload @563
ExtraIcon_SetAll @564
+Clist_GetStatusModeDescription @565
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 333e4fc5f8..11abf96af6 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -542,3 +542,4 @@ Menu_ReloadProtoMenus @561 Menu_GetProtocolMenu @562
ExtraIcon_Reload @563
ExtraIcon_SetAll @564
+Clist_GetStatusModeDescription @565
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index c54dea3dcd..3f289f3eb6 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
#include <io.h>
+#include "clc.h"
+
struct StandardIconDescription
{
int id;
@@ -317,7 +319,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) // format: core_%s%d
mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, i);
sid.pszName = iconName;
- sid.description.w = cli.pfnGetStatusModeDescription(statusIcons[i].id, 0);
+ sid.description.w = Clist_GetStatusModeDescription(statusIcons[i].id, 0);
sid.iDefaultIndex = statusIcons[i].resource_id;
IcoLib_AddIcon(&sid, 0);
}
|