diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-23 23:29:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-23 23:29:25 +0300 |
commit | 176e52e14fd0358a7f26ca8d7b0205244dfde2e7 (patch) | |
tree | 10da2f8951d20103af0215c38d07ea96ba61c191 | |
parent | 91b13500b47a51f3a284d9f409b7b8dac167a06d (diff) |
no need to initialize pcli variable in each plugin (only in Clist_*)
224 files changed, 1661 insertions, 1852 deletions
diff --git a/include/m_clistint.h b/include/m_clistint.h index 5b98e79ca8..207c5e14f3 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -441,7 +441,6 @@ struct CLIST_INTERFACE EXTERN_C MIR_APP_DLL(CLIST_INTERFACE*) Clist_GetInterface(void);
-#ifndef MIR_APP_EXPORTS
- extern CLIST_INTERFACE *pcli;
-#endif
+extern MIR_APP_EXPORT CLIST_INTERFACE g_CLI;
+
#endif // M_CLISTINT_H__
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex a72867ee63..7de33447fd 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 bfd5549310..abf7ac5050 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index 476adcf49d..b1418ee47c 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -21,8 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "stdafx.h"
-CLIST_INTERFACE *pcli;
-
CMPlugin g_plugin;
static HANDLE hToolBarItem = nullptr;
static HGENMENU hMainMenuItem = nullptr;
@@ -133,8 +131,6 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
INITCOMMONCONTROLSEX icex = { sizeof(icex), ICC_USEREX_CLASSES };
InitCommonControlsEx(&icex);
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index 485a02d6e8..91085be269 100755 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -684,7 +684,7 @@ void DoAlarm(ALARM *alarm) cle.hIcon = hIconSystray;
cle.szTooltip.w = alarm->szTitle;
cle.flags = CLEF_ONLYAFEW | CLEF_UNICODE;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
}
}
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp index 729b1ec001..55cc434915 100644 --- a/plugins/Alarms/src/alarms.cpp +++ b/plugins/Alarms/src/alarms.cpp @@ -17,7 +17,6 @@ There is no warranty. wchar_t szGamePrefix[] = COMMANDPREFIX;
-CLIST_INTERFACE *pcli;
CMPlugin g_plugin;
HANDLE hTopToolbarButton;
@@ -146,8 +145,6 @@ static int MainDeInit(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
// ensure datetime picker is loaded
INITCOMMONCONTROLSEX ccx;
ccx.dwSize = sizeof(ccx);
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index e756521f6d..686cbdd5c9 100755 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -264,7 +264,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar }
else if (!IsWindowVisible(hwnd) && count > 0) {
// we have reminders - show if not linked to clist or if clist is visible
- if ((!options.hide_with_clist && FrameIsFloating()) || IsWindowVisible(pcli->hwndContactList)) {
+ if ((!options.hide_with_clist && FrameIsFloating()) || IsWindowVisible(g_CLI.hwndContactList)) {
CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)frame_id, 0);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, FU_FMREDRAW | FU_FMPOS);
}
@@ -275,7 +275,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetReminderFrameVisible(false);
else if (!IsWindowVisible(hwnd) && count > 0)
// we have reminders - show if not linked to clist or if clist is visible
- if (!options.hide_with_clist || IsWindowVisible(pcli->hwndContactList))
+ if (!options.hide_with_clist || IsWindowVisible(g_CLI.hwndContactList))
SetReminderFrameVisible(true);
}
}
@@ -320,14 +320,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SendMessage(hwnd, WMU_FILL_LIST, 0, 0);
else if (wParam == ID_FRAME_SHOWHIDE_TIMER && options.hide_with_clist) { // link show/hide with clist
// hide if we're visible and clist isn't (possible only when floating if frames are present)
- if (!IsWindowVisible(pcli->hwndContactList) && IsWindowVisible(hwnd)) {
+ if (!IsWindowVisible(g_CLI.hwndContactList) && IsWindowVisible(hwnd)) {
if (ServiceExists(MS_CLIST_FRAMES_SHFRAME))
CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)frame_id, 0);
else
SetReminderFrameVisible(false);
}
// we're not visible but clist is - show depending on hide_with_clist and auto_showhide options
- if (!IsWindowVisible(hwnd) && IsWindowVisible(pcli->hwndContactList)) {
+ if (!IsWindowVisible(hwnd) && IsWindowVisible(g_CLI.hwndContactList)) {
// if not auto show/hide, show (reminders or not) if we're not visible and the clist is
// otherwise, show only if there are reminders
int count = SendMessage(hwnd_list, LB_GETCOUNT, 0, 0);
@@ -489,7 +489,7 @@ int CreateFrame() if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
hwnd_plugin = CreateWindow(L"AlarmsFrame", TranslateT("Alarms"),
WS_CHILD | WS_CLIPCHILDREN,
- 0, 0, 10, 10, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ 0, 0, 10, 10, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
CLISTFrame Frame = { sizeof(CLISTFrame) };
Frame.tname = TranslateT("Alarms");
@@ -509,7 +509,7 @@ int CreateFrame() hwnd_frame = CreateWindowEx(WS_EX_TOOLWINDOW, L"AlarmsFrameContainer", TranslateT("Alarms"),
(WS_POPUPWINDOW | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN) & ~WS_VISIBLE,
- 0, 0, 200, 100, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ 0, 0, 200, 100, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
hwnd_plugin = CreateWindow(L"AlarmsFrame", TranslateT("Alarms"),
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
@@ -535,7 +535,7 @@ int CreateFrame() if (!options.auto_showhide) {
if (options.hide_with_clist) {
- if (IsWindowVisible(pcli->hwndContactList)) {
+ if (IsWindowVisible(g_CLI.hwndContactList)) {
ShowWindow(hwnd_frame, SW_SHOW);
RefreshReminderFrame();
}
diff --git a/plugins/AsSingleWindow/src/AsSingleWindow.cpp b/plugins/AsSingleWindow/src/AsSingleWindow.cpp index 2c3fab8b98..4c0a8a1cce 100644 --- a/plugins/AsSingleWindow/src/AsSingleWindow.cpp +++ b/plugins/AsSingleWindow/src/AsSingleWindow.cpp @@ -7,7 +7,6 @@ sPluginVars pluginVars; CMPlugin g_plugin; -CLIST_INTERFACE *pcli; ///////////////////////////////////////////////////////////////////////////////////////// @@ -49,7 +48,7 @@ static int MsgWindowEvent(WPARAM, LPARAM lParam) static int OnModulesLoaded(WPARAM, LPARAM) { - windowAdd(pcli->hwndContactList, true); + windowAdd(g_CLI.hwndContactList, true); HookEvent(ME_MSG_WINDOWEVENT, MsgWindowEvent); @@ -66,8 +65,6 @@ static int OnShutdown(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void) { - pcli = Clist_GetInterface(); - ::InitializeCriticalSection(&pluginVars.m_CS); pluginVars.IsUpdateInProgress = false; HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index ab4baad2b9..78b11eb92d 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -487,7 +487,7 @@ void ShowCountdownFrame(WORD fTimeFlags) 0, 0,
GetSystemMetrics(SM_CXICON) + 103,
GetSystemMetrics(SM_CYICON) + 2,
- pcli->hwndContactList,
+ g_CLI.hwndContactList,
nullptr,
g_plugin.getInst(),
&fTimeFlags);
@@ -509,7 +509,7 @@ void ShowCountdownFrame(WORD fTimeFlags) /* HACKS TO FIX CLUI FRAMES:
* *** why is CLUIFrames is horribly buggy??! *** date: sept 2005, nothing changed until sept 2006
* workaround #1: MS_CLIST_FRAMES_REMOVEFRAME does not finish with destroy cycle (clist_modern, clist_nicer crashes) */
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
/* workaround #2: drawing glitch after adding a frame (frame positioned wrongly when hidden) */
CallService(MS_CLIST_FRAMES_UPDATEFRAME, hFrame, FU_FMPOS | FU_FMREDRAW);
/* workaround #3: MS_CLIST_FRAMES_SETFRAMEOPTIONS does cause redrawing problems */
diff --git a/plugins/AutoShutdown/src/main.cpp b/plugins/AutoShutdown/src/main.cpp index a6b359a6b0..0f0dcfc0da 100644 --- a/plugins/AutoShutdown/src/main.cpp +++ b/plugins/AutoShutdown/src/main.cpp @@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-CLIST_INTERFACE *pcli;
CMPlugin g_plugin;
IconItem iconList[] =
@@ -62,8 +61,6 @@ static int ShutdownModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- pcli = Clist_GetInterface();
-
INITCOMMONCONTROLSEX icc;
icc.dwSize = sizeof(icc);
icc.dwICC = ICC_DATE_CLASSES | ICC_UPDOWN_CLASS | ICC_PROGRESS_CLASS;
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index b120727a7a..d1ebc110a7 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -147,7 +147,7 @@ static DWORD ShutdownNow(BYTE shutdownType) OutputDebugStringA("Not ready to exit. Waiting...\n"); /* tell others, all ascii */
}
/* shutdown service must be called from main thread anyway */
- if (!DestroyWindow(pcli->hwndContactList))
+ if (!DestroyWindow(g_CLI.hwndContactList))
dwErrCode = GetLastError();
}
break;
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index d1a3f3411d..84123087bc 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -31,7 +31,6 @@ FARPROC WINAPI delayHook(unsigned dliNotify, PDelayLoadInfo dli) extern "C" PfnDliHook __pfnDliNotifyHook2 = delayHook;
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -445,7 +444,7 @@ void CreateFrame() RegisterClass(&wndclass);
hwnd_plugin = CreateWindow(L"BassInterfaceFrame", TranslateT("BASS Interface"),
- WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
CLISTFrame Frame = { sizeof(CLISTFrame) };
Frame.tname = TranslateT("BASS Interface");
@@ -507,7 +506,7 @@ void LoadBassLibrary(const wchar_t *ptszPath) EnPreview = db_get_b(NULL, MODULENAME, OPT_PREVIEW, 0);
StatMask = db_get_w(NULL, MODULENAME, OPT_STATUS, 0x3ff);
- BASS_Init(device, 44100, 0, pcli->hwndContactList, nullptr);
+ BASS_Init(device, 44100, 0, g_CLI.hwndContactList, nullptr);
Volume = db_get_b(NULL, MODULENAME, OPT_VOLUME, 33);
BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume * 100);
@@ -594,8 +593,6 @@ static IconItem iconList[] = extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnSettingChanged);
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 3f4b0a82eb..dad6b89086 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -36,7 +36,6 @@ wchar_t **oldStatusMsg; BYTE g_bOldSetting;
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
PFNDwmIsCompositionEnabled dwmIsCompositionEnabled;
@@ -335,7 +334,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara }
}
- Clist_TrayIconDestroy(pcli->hwndContactList);
+ Clist_TrayIconDestroy(g_CLI.hwndContactList);
if (g_wMask & OPT_TRAYICON)
CreateTrayIcon(true);
@@ -411,12 +410,12 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara if (g_TrayIcon) CreateTrayIcon(false);
- pcli->pfnTrayIconInit(pcli->hwndContactList);
+ g_CLI.pfnTrayIconInit(g_CLI.hwndContactList);
// force a redraw
// should prevent drawing problems
- InvalidateRect(pcli->hwndContactList, nullptr, true);
- UpdateWindow(pcli->hwndContactList);
+ InvalidateRect(g_CLI.hwndContactList, nullptr, true);
+ UpdateWindow(g_CLI.hwndContactList);
PostMessage(hWnd, WM_MOUSEMOVE, 0, (LPARAM)MAKELONG(2, 2)); // reset core's IDLE
g_bWindowHidden = false;
@@ -439,7 +438,7 @@ VOID CALLBACK WinEventProc(HWINEVENTHOOK, DWORD event, HWND hwnd, LONG idObject, {
if (g_bWindowHidden && idObject == OBJID_WINDOW && (event == EVENT_OBJECT_CREATE || event == EVENT_OBJECT_SHOW) && (IsWindowVisible(hwnd)))
{
- if (hwnd == pcli->hwndContactList)
+ if (hwnd == g_CLI.hwndContactList)
ShowWindow(hwnd, SW_HIDE);
else
EnumWindows(EnumWindowsProc, 0);
@@ -632,7 +631,7 @@ static int MirandaLoaded(WPARAM, LPARAM) HookTemporaryEvent(ME_MSG_TOOLBARLOADED, TabsrmmButtonsInit);
- GetWindowThreadProcessId(pcli->hwndContactList, &g_dwMirandaPID);
+ GetWindowThreadProcessId(g_CLI.hwndContactList, &g_dwMirandaPID);
WNDCLASS winclass = { 0 };
winclass.lpfnWndProc = ListenWndProc;
@@ -642,7 +641,7 @@ static int MirandaLoaded(WPARAM, LPARAM) if (RegisterClass(&winclass))
{
- g_hListenWindow = CreateWindow(BOSSKEY_LISTEN_INFO, BOSSKEY_LISTEN_INFO, WS_POPUP, 0, 0, 5, 5, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ g_hListenWindow = CreateWindow(BOSSKEY_LISTEN_INFO, BOSSKEY_LISTEN_INFO, WS_POPUP, 0, 0, 5, 5, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
WTSRegisterSessionNotification(g_hListenWindow, 0);
}
@@ -683,8 +682,6 @@ static int MirandaLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
g_wMaskAdv = db_get_w(NULL, MOD_NAME, "optsmaskadv", 0);
g_bOldSetting = db_get_b(NULL, MOD_NAME, "OldSetting", 0);
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 4b76e9e252..00f1e38127 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -21,7 +21,6 @@ #include "stdafx.h"
-CLIST_INTERFACE *pcli;
CMPlugin g_plugin;
DWORD timer_id = 0;
@@ -165,14 +164,14 @@ LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa switch (message) {
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
- pcli->pfnRemoveEvent(PUGetContact(hWnd), 0);
+ g_CLI.pfnRemoveEvent(PUGetContact(hWnd), 0);
CallServiceSync("BuddyExpectator/actionReturned", PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
}
break;
case WM_CONTEXTMENU:
- pcli->pfnRemoveEvent(PUGetContact(hWnd), 0);
+ g_CLI.pfnRemoveEvent(PUGetContact(hWnd), 0);
setLastSeen(PUGetContact(hWnd));
PUDeletePopup(hWnd);
break;
@@ -190,14 +189,14 @@ LRESULT CALLBACK PopupDlgProcNoSet(HWND hWnd, UINT message, WPARAM wParam, LPARA switch (message) {
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
- pcli->pfnRemoveEvent(PUGetContact(hWnd), 0);
+ g_CLI.pfnRemoveEvent(PUGetContact(hWnd), 0);
CallServiceSync("BuddyExpectator/actionStillAbsent", (WPARAM)PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
}
break;
case WM_CONTEXTMENU:
- pcli->pfnRemoveEvent(PUGetContact(hWnd), 0);
+ g_CLI.pfnRemoveEvent(PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
break;
@@ -287,7 +286,7 @@ void ReturnNotify(MCONTACT hContact, wchar_t *message) wchar_t tmpMsg[512];
mir_snwprintf(tmpMsg, L"%s %s", nick, message);
cle.szTooltip.w = tmpMsg;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
}
@@ -325,7 +324,7 @@ void GoneNotify(MCONTACT hContact, wchar_t *message) mir_snwprintf(tmpMsg, L"%s %s", nick, message);
cle.szTooltip.w = tmpMsg;
cle.flags = CLEF_UNICODE;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
}
@@ -648,8 +647,6 @@ int onShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
InitOptions();
CreateServiceFunction("BuddyExpectator/actionReturned", ContactReturnedAction);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index a65a9ffbf7..25f0f84cff 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" #include "strpos.h" -CLIST_INTERFACE *pcli; CMPlugin g_plugin; static LIST<CSWindow> arWindows(3, HandleKeySortT); @@ -99,8 +98,6 @@ static int OnPreshutdown(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load() { - pcli = Clist_GetInterface(); - // support for ComboBoxEx INITCOMMONCONTROLSEX icc; icc.dwSize = sizeof(icc); @@ -949,7 +946,7 @@ INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa INT_PTR CALLBACK CSAMWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { - CSAMWindow* csamw = (CSAMWindow*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + CSAMWindow *csamw = (CSAMWindow*)GetWindowLongPtr(hwnd, GWLP_USERDATA); switch (message) { case WM_INITDIALOG: diff --git a/plugins/Clist_blind/src/clistmenus.cpp b/plugins/Clist_blind/src/clistmenus.cpp index f8b98f49e8..a9278b4009 100644 --- a/plugins/Clist_blind/src/clistmenus.cpp +++ b/plugins/Clist_blind/src/clistmenus.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. INT_PTR CloseAction(WPARAM, LPARAM)
{
if (Miranda_OkToExit())
- DestroyWindow(pcli->hwndContactList);
+ DestroyWindow(g_CLI.hwndContactList);
return 0;
}
diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index 69e6a904af..142d70fb8d 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -164,7 +164,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP 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 */
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID); /* force reshuffle */
return TRUE;
}
break;
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index aba4a28ad1..a3828746f9 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -170,52 +170,52 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ws(NULL, "CList", "TitleText", title);
- SetWindowText(pcli->hwndContactList, title);
+ SetWindowText(g_CLI.hwndContactList, title);
}
- pcli->pfnLoadCluiGlobalOpts();
- SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0,
+ g_CLI.pfnLoadCluiGlobalOpts();
+ SetWindowPos(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE);
if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) {
// Window must be hidden to dynamically remove the taskbar button.
// See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp
WINDOWPLACEMENT p;
p.length = sizeof(p);
- GetWindowPlacement(pcli->hwndContactList, &p);
- ShowWindow(pcli->hwndContactList, SW_HIDE);
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE,
- GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
- SetWindowPlacement(pcli->hwndContactList, &p);
+ GetWindowPlacement(g_CLI.hwndContactList, &p);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE,
+ GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
+ SetWindowPlacement(g_CLI.hwndContactList, &p);
}
- else SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW);
+ else SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW);
if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
HWND hProgMan = FindWindowA("Progman", nullptr);
if (IsWindow(hProgMan))
- SetParent(pcli->hwndContactList, hProgMan);
+ SetParent(g_CLI.hwndContactList, hProgMan);
}
- else SetParent(pcli->hwndContactList, nullptr);
+ else SetParent(g_CLI.hwndContactList, nullptr);
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION))
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE,
- GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE,
+ GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX);
else
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE,
- GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE,
+ GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
- SetMenu(pcli->hwndContactList, nullptr);
+ SetMenu(g_CLI.hwndContactList, nullptr);
else
- SetMenu(pcli->hwndContactList, pcli->hMenuMain);
- SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
- RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
- if (IsIconic(pcli->hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
- ShowWindow(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
+ SetMenu(g_CLI.hwndContactList, g_CLI.hMenuMain);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
+ if (IsIconic(g_CLI.hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
+ ShowWindow(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_CLI.hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
- else SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ else SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
return TRUE;
}
break;
@@ -274,22 +274,22 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L db_set_b(NULL, "CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA));
db_set_b(NULL, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
db_set_b(NULL, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL));
- pcli->pfnLoadCluiGlobalOpts();
+ g_CLI.pfnLoadCluiGlobalOpts();
if (db_get_b(NULL, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
- HWND parent = GetParent(pcli->hwndStatus);
+ HWND parent = GetParent(g_CLI.hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
db_set_b(NULL, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
- ShowWindow(pcli->hwndStatus, SW_HIDE);
- DestroyWindow(pcli->hwndStatus);
+ ShowWindow(g_CLI.hwndStatus, SW_HIDE);
+ DestroyWindow(g_CLI.hwndStatus);
flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
- pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
+ g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR))
- ShowWindow(pcli->hwndStatus, SW_SHOW);
+ ShowWindow(g_CLI.hwndStatus, SW_SHOW);
else
- ShowWindow(pcli->hwndStatus, SW_HIDE);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ ShowWindow(g_CLI.hwndStatus, SW_HIDE);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
return TRUE;
}
break;
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 7d48f3402f..676be214fb 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -25,7 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli = nullptr, coreCli;
+CLIST_INTERFACE coreCli;
+
HIMAGELIST himlCListClc = nullptr;
LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -108,7 +109,7 @@ static int OnOptsInit(WPARAM wParam, LPARAM lParam) static INT_PTR GetStatusMode(WPARAM, LPARAM)
{
- return pcli->currentDesiredStatusMode;
+ return g_CLI.currentDesiredStatusMode;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -116,24 +117,23 @@ static INT_PTR GetStatusMode(WPARAM, LPARAM) extern "C" int __declspec(dllexport) CListInitialise()
{
- pcli = Clist_GetInterface();
g_bSortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
g_bSortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
- coreCli = *pcli;
-
- pcli->hInst = g_plugin.getInst();
- pcli->pfnPaintClc = PaintClc;
- pcli->pfnContactListWndProc = ContactListWndProc;
- pcli->pfnContactListControlWndProc = ContactListControlWndProc;
- pcli->pfnRebuildEntireList = RebuildEntireList;
- pcli->pfnSetGroupExpand = SetGroupExpand;
- pcli->pfnRecalcScrollBar = RecalcScrollBar;
- pcli->pfnScrollTo = ScrollTo;
- pcli->pfnLoadClcOptions = LoadClcOptions;
- pcli->pfnGetRowHeight = GetRowHeight;
- pcli->pfnSortCLC = SortCLC;
- pcli->pfnCompareContacts = CompareContacts;
+ Clist_GetInterface();
+ coreCli = g_CLI;
+ g_CLI.hInst = g_plugin.getInst();
+ g_CLI.pfnPaintClc = PaintClc;
+ g_CLI.pfnContactListWndProc = ContactListWndProc;
+ g_CLI.pfnContactListControlWndProc = ContactListControlWndProc;
+ g_CLI.pfnRebuildEntireList = RebuildEntireList;
+ g_CLI.pfnSetGroupExpand = SetGroupExpand;
+ g_CLI.pfnRecalcScrollBar = RecalcScrollBar;
+ g_CLI.pfnScrollTo = ScrollTo;
+ g_CLI.pfnLoadClcOptions = LoadClcOptions;
+ g_CLI.pfnGetRowHeight = GetRowHeight;
+ g_CLI.pfnSortCLC = SortCLC;
+ g_CLI.pfnCompareContacts = CompareContacts;
CreateServiceFunction(MS_CLIST_GETSTATUSMODE, GetStatusMode);
@@ -383,7 +383,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L KillTimer(hwnd, TIMERID_INFOTIP);
KillTimer(hwnd, TIMERID_RENAME);
dat->szQuickSearch[0] = 0;
- pcli->pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
Clist_EnsureVisible(hwnd, (ClcData*)dat, dat->selection, 0);
UpdateWindow(hwnd);
break;
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index 96d90a67d0..990e8f1215 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -187,7 +187,7 @@ int CLUIFrames_ActivateSubContainers(BOOL active) int CLUIFrames_SetParentForContainers(HWND parent)
{
- g_CluiData.fOnDesktop = (parent && parent != pcli->hwndContactList);
+ g_CluiData.fOnDesktop = (parent && parent != g_CLI.hwndContactList);
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
@@ -227,7 +227,7 @@ int CLUIFrames_OnShowHide(int mode) }
if (mode != SW_HIDE)
- SetForegroundWindow(pcli->hwndContactList);
+ SetForegroundWindow(g_CLI.hwndContactList);
AniAva_RedrawAllAvatars(TRUE);
return 0;
}
@@ -391,7 +391,7 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) }
memset(&fakeMainWindow, 0, sizeof(fakeMainWindow));
- fakeMainWindow.ContainerWnd = pcli->hwndContactList;
+ fakeMainWindow.ContainerWnd = g_CLI.hwndContactList;
fakeMainWindow.floating = TRUE;
memset(&fakeTaskBarWindow, 0, sizeof(fakeTaskBarWindow));
@@ -1014,7 +1014,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam) SetWindowLongPtr(fw.TitleBar.hwnd, GWL_STYLE, style& ~(WS_VSCROLL | WS_HSCROLL));
}
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
SetWindowPos(fw.TitleBar.hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE);
return 0;
@@ -1079,7 +1079,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam) if (!CLUIFramesFitInSize()) fw.height = retval;
retval = fw.height;
if (fw.height != oldHeight && !fw.floating)
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
}
else {
retval = fw.HeightWhenCollapsed;
@@ -1117,7 +1117,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam) return 0;
}
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
return -1;
}
@@ -1128,7 +1128,7 @@ static int _us_DoShowAllFrames(WPARAM, LPARAM) for (int i = 0; i < g_nFramesCount; i++)
g_pfwFrames[i].visible = TRUE;
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
return 0;
}
@@ -1139,7 +1139,7 @@ static int _us_DoShowTitles(WPARAM, LPARAM) for (int i = 0; i < g_nFramesCount; i++)
g_pfwFrames[i].TitleBar.ShowTitleBar = TRUE;
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
return 0;
}
@@ -1150,7 +1150,7 @@ static int _us_DoHideTitles(WPARAM, LPARAM) for (int i = 0; i < g_nFramesCount; i++)
g_pfwFrames[i].TitleBar.ShowTitleBar = FALSE;
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
return 0;
}
@@ -1167,11 +1167,11 @@ static int _us_DoShowHideFrame(WPARAM wParam, LPARAM lParam) if (g_pfwFrames[pos].OwnerWindow != (HWND)-2) {
if (g_pfwFrames[pos].OwnerWindow)
- CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(pcli->hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
+ CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(g_CLI.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
else if (g_pfwFrames[pos].visible) {
- g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(pcli->hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
+ g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(g_CLI.hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
SetParent(g_pfwFrames[pos].hWnd, g_pfwFrames[pos].OwnerWindow);
- CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(pcli->hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
+ CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(g_CLI.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
}
}
@@ -1179,7 +1179,7 @@ static int _us_DoShowHideFrame(WPARAM wParam, LPARAM lParam) CLUIFrameResizeFloatingFrame(pos);
if (!g_pfwFrames[pos].floating)
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
}
return 0;
}
@@ -1194,7 +1194,7 @@ static int _us_DoShowHideFrameTitle(WPARAM wParam, LPARAM lParam) if (pos >= 0 && (int)pos < g_nFramesCount)
g_pfwFrames[pos].TitleBar.ShowTitleBar = !g_pfwFrames[pos].TitleBar.ShowTitleBar;
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
return 0;
}
@@ -1251,7 +1251,7 @@ static int _us_DoMoveFrame(WPARAM wParam, LPARAM lParam) free(sd);
CLUIFramesStoreFrameSettings(pos);
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
}
return 0;
@@ -1274,7 +1274,7 @@ static int _us_DoSetFrameAlign(WPARAM wParam, LPARAM lParam) if (_fCluiFramesModuleNotStarted) return -1;
CLUIFrames_SetFrameOptions(MAKEWPARAM(FO_ALIGN, wParam), lParam);
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
return 0;
}
@@ -1359,7 +1359,7 @@ static int _us_DoCollapseFrame(WPARAM wParam, LPARAM lParam) RECT rc;
if (Clist_IsDocked()) { return 0; };
if (!g_CluiData.fDocked && g_CluiData.fAutoSize) { return 0; };
- GetWindowRect(pcli->hwndContactList, &rc);
+ GetWindowRect(g_CLI.hwndContactList, &rc);
if (g_pfwFrames[FrameId].collapsed == TRUE) {
rc.bottom -= rc.top;
@@ -1373,7 +1373,7 @@ static int _us_DoCollapseFrame(WPARAM wParam, LPARAM lParam) g_pfwFrames[FrameId].collapsed = TRUE;
}
- SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);
CLUIFramesStoreAllFrames();
@@ -1440,9 +1440,9 @@ static int _us_DoCollapseFrame(WPARAM wParam, LPARAM lParam) }
};//floating test
- //CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
+ //CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList,0);
if (!g_pfwFrames[FrameId].floating) {
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
}
else {
//SetWindowPos(Frames[FrameId].hWnd,HWND_TOP, 0, 0, Frames[FrameId].wndSize.right-Frames[FrameId].wndSize.left,Frames[FrameId].height,SWP_SHOWWINDOW|SWP_NOMOVE);
@@ -1512,7 +1512,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) //char * CustomName = nullptr;
CLISTFrame *clfrm = (CLISTFrame *)wParam;
- if (pcli->hwndContactList == nullptr) return -1;
+ if (g_CLI.hwndContactList == nullptr) return -1;
if (_fCluiFramesModuleNotStarted) return -1;
if (clfrm->cbSize != sizeof(CLISTFrame)) return -1;
if (!(_hTitleBarFont)) _hTitleBarFont = CLUILoadTitleBarFont();
@@ -1565,14 +1565,14 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) | WS_CHILD | WS_CLIPCHILDREN |
(F.TitleBar.ShowTitleBar ? WS_VISIBLE : 0) |
WS_CLIPCHILDREN,
- 0, 0, 0, 0, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ 0, 0, 0, 0, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
SetWindowLongPtr(F.TitleBar.hwnd, GWLP_USERDATA, F.id);
F.TitleBar.hwndTip = CreateWindowEx(0, TOOLTIPS_CLASS, nullptr,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
- pcli->hwndContactList, nullptr, g_plugin.getInst(),
+ g_CLI.hwndContactList, nullptr, g_plugin.getInst(),
nullptr);
SetWindowPos(F.TitleBar.hwndTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
@@ -1613,7 +1613,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) // need to enlarge parent
RECT mainRect;
int mainHeight, minHeight;
- GetWindowRect(pcli->hwndContactList, &mainRect);
+ GetWindowRect(g_CLI.hwndContactList, &mainRect);
mainHeight = mainRect.bottom - mainRect.top;
minHeight = CLUIFrames_GetTotalHeight();
if (mainHeight < minHeight) {
@@ -1622,13 +1622,13 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) mainRect.top = mainRect.bottom - minHeight;
else
mainRect.bottom = mainRect.top + minHeight;
- SetWindowPos(pcli->hwndContactList, nullptr, mainRect.left, mainRect.top, mainRect.right - mainRect.left, mainRect.bottom - mainRect.top, SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, mainRect.left, mainRect.top, mainRect.right - mainRect.left, mainRect.bottom - mainRect.top, SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
}
- GetWindowRect(pcli->hwndContactList, &mainRect);
+ GetWindowRect(g_CLI.hwndContactList, &mainRect);
mainHeight = mainRect.bottom - mainRect.top;
_nClientFrameId = eUnknownId; // recalc it
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
if (F.floating) {
F.floating = false;
@@ -1670,9 +1670,9 @@ static int _us_DoRemoveFrame(WPARAM wParam, LPARAM) F.OwnerWindow = nullptr;
RemoveItemFromList(pos, &g_pfwFrames, &g_nFramesCount);
- cliInvalidateRect(pcli->hwndContactList, nullptr, TRUE);
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
- cliInvalidateRect(pcli->hwndContactList, nullptr, TRUE);
+ cliInvalidateRect(g_CLI.hwndContactList, nullptr, TRUE);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ cliInvalidateRect(g_CLI.hwndContactList, nullptr, TRUE);
return 0;
};
@@ -1721,8 +1721,8 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame) RECT pr;
POINT Off = { 0 };
- ClientToScreen(pcli->hwndContactList, &Off);
- GetWindowRect(pcli->hwndContactList, &pr);
+ ClientToScreen(g_CLI.hwndContactList, &Off);
+ GetWindowRect(g_CLI.hwndContactList, &pr);
if (Frame->visible && (!Frame->collapsed || Frame->wndSize.bottom - Frame->wndSize.top == 0)) {
ShowWindowAsync(Frame->OwnerWindow, SW_HIDE);
@@ -1744,7 +1744,7 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame) Frame->wndSize.right - Frame->wndSize.left,
g_nTitleBarHeight, SWP_NOZORDER | SWP_NOACTIVATE);
}
- if (Frame->visible && IsWindowVisible(pcli->hwndContactList) && Frame->collapsed && Frame->wndSize.bottom - Frame->wndSize.top != 0) {
+ if (Frame->visible && IsWindowVisible(g_CLI.hwndContactList) && Frame->collapsed && Frame->wndSize.bottom - Frame->wndSize.top != 0) {
ShowWindow(Frame->OwnerWindow, SW_SHOW);
ShowWindow(Frame->hWnd, SW_SHOW);
}
@@ -1793,20 +1793,20 @@ static BOOL CLUIFramesFitInSize(void) int CLUIFrames_GetTotalHeight()
{
- if (pcli->hwndContactList == nullptr) return 0;
+ if (g_CLI.hwndContactList == nullptr) return 0;
int sumheight = 0;
RECT border;
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
- if ((F.visible) && (!F.needhide) && (!F.floating) && (pcli->hwndContactTree) && (F.hWnd != pcli->hwndContactTree))
+ if ((F.visible) && (!F.needhide) && (!F.floating) && (g_CLI.hwndContactTree) && (F.hWnd != g_CLI.hwndContactTree))
sumheight += (F.height) + (g_nTitleBarHeight*btoint(F.TitleBar.ShowTitleBar));
}
- GetBorderSize(pcli->hwndContactList, &border);
+ GetBorderSize(g_CLI.hwndContactList, &border);
- //GetWindowRect(pcli->hwndContactList,&winrect);
- //GetClientRect(pcli->hwndContactList,&clirect);
+ //GetWindowRect(g_CLI.hwndContactList,&winrect);
+ //GetClientRect(g_CLI.hwndContactList,&clirect);
// clirect.bottom -= clirect.top;
// clirect.bottom += border.top+border.bottom;
//allbord = (winrect.bottom-winrect.top)-(clirect.bottom-clirect.top);
@@ -1823,7 +1823,7 @@ int CLUIFramesGetMinHeight() int tbh = 0, sumheight = 0;
RECT border;
int allbord = 0;
- if (pcli->hwndContactList == nullptr) return 0;
+ if (g_CLI.hwndContactList == nullptr) return 0;
// search for alClient frame and get the titlebar's height
@@ -1841,10 +1841,10 @@ int CLUIFramesGetMinHeight() }
}
- GetBorderSize(pcli->hwndContactList, &border);
+ GetBorderSize(g_CLI.hwndContactList, &border);
- //GetWindowRect(pcli->hwndContactList,&winrect);
- //GetClientRect(pcli->hwndContactList,&clirect);
+ //GetWindowRect(g_CLI.hwndContactList,&winrect);
+ //GetClientRect(g_CLI.hwndContactList,&clirect);
// clirect.bottom -= clirect.top;
// clirect.bottom += border.top+border.bottom;
//allbord = (winrect.bottom-winrect.top)-(clirect.bottom-clirect.top);
@@ -2040,7 +2040,7 @@ int CLUIFrames_ApplyNewSizes(int mode) CLUIFrameMoveResize(&g_pfwFrames[i]);
};
}
- if (IsWindowVisible(pcli->hwndContactList)) {
+ if (IsWindowVisible(g_CLI.hwndContactList)) {
ske_DrawNonFramedObjects(1, nullptr);
CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, 0, 0);
}
@@ -2054,12 +2054,12 @@ static int _us_DoUpdateFrame(WPARAM wParam, LPARAM lParam) return -1;
if (wParam == -1) {
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
return 0;
}
if (lParam & FU_FMPOS)
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 1);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 1);
int pos = id2pos(wParam);
if (pos < 0 || pos >= g_nFramesCount)
@@ -2079,7 +2079,7 @@ int CLUIFrames_OnClistResize_mod(WPARAM, LPARAM mode) if (_fCluiFramesModuleNotStarted) return -1;
RECT nRect;
- GetClientRect(pcli->hwndContactList, &nRect);
+ GetClientRect(g_CLI.hwndContactList, &nRect);
nRect.left += g_CluiData.LeftClientMargin;
nRect.right -= g_CluiData.RightClientMargin;
@@ -2219,7 +2219,7 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) {
RECT mainRect;
int mainHeight, minHeight;
- GetWindowRect(pcli->hwndContactList, &mainRect);
+ GetWindowRect(g_CLI.hwndContactList, &mainRect);
mainHeight = mainRect.bottom - mainRect.top;
minHeight = CLUIFrames_GetTotalHeight();
if (mainHeight < minHeight) {
@@ -2230,12 +2230,12 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) mainRect.top = mainRect.bottom - minHeight;
else
mainRect.bottom = mainRect.top + minHeight;
- SetWindowPos(pcli->hwndContactList, nullptr, mainRect.left, mainRect.top, mainRect.right - mainRect.left, mainRect.bottom - mainRect.top, SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, mainRect.left, mainRect.top, mainRect.right - mainRect.left, mainRect.bottom - mainRect.top, SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
}
- GetWindowRect(pcli->hwndContactList, &mainRect);
+ GetWindowRect(g_CLI.hwndContactList, &mainRect);
mainHeight = mainRect.bottom - mainRect.top;
}
- GetClientRect(pcli->hwndContactList, &nRect);
+ GetClientRect(g_CLI.hwndContactList, &nRect);
//$$$ Fixed borders
if (lParam && lParam != 1 && lParam != 2) {
RECT oldRect;
@@ -2245,7 +2245,7 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) GetWindowRect((HWND)wParam, &oldRect);
pt.x = nRect.left;
pt.y = nRect.top;
- ClientToScreen(pcli->hwndContactList, &pt);
+ ClientToScreen(g_CLI.hwndContactList, &pt);
dl = pt.x - oldRect.left;
dt = pt.y - oldRect.top;
dr = (oldRect.right - oldRect.left) - (nRect.right - nRect.left) - dl;
@@ -2274,10 +2274,10 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) tick = GetTickCount() - tick;
- if (pcli->hwndContactList != nullptr) cliInvalidateRect(pcli->hwndContactList, nullptr, TRUE);
- if (pcli->hwndContactList != nullptr) UpdateWindow(pcli->hwndContactList);
+ if (g_CLI.hwndContactList != nullptr) cliInvalidateRect(g_CLI.hwndContactList, nullptr, TRUE);
+ if (g_CLI.hwndContactList != nullptr) UpdateWindow(g_CLI.hwndContactList);
- if (lParam == 2) RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE);
+ if (lParam == 2) RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE);
Sleep(0);
@@ -2314,9 +2314,9 @@ int OnFrameTitleBarBackgroundChange(WPARAM, LPARAM) sttBackgroundBmpUse = db_get_w(0, "FrameTitleBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- cliInvalidateRect(pcli->hwndContactList, nullptr, 0);
+ cliInvalidateRect(g_CLI.hwndContactList, nullptr, 0);
- RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE);
+ RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE);
return 0;
}
@@ -2458,7 +2458,7 @@ int DrawTitleBar(HDC hdcMem2, RECT *rect, int Frameid) if (g_CluiData.fDisableSkinEngine) {
if (!sttBmpBackground && sttBkUseWinColours && xpt_IsThemed(_hFrameTitleTheme)) {
int state = CS_ACTIVE;
- // if (GetForegroundWindow() != pcli->hwndContactList) state = CS_INACTIVE;
+ // if (GetForegroundWindow() != g_CLI.hwndContactList) state = CS_INACTIVE;
xpt_DrawThemeBackground(_hFrameTitleTheme, hdcMem, WP_SMALLCAPTION, state, &rc, &rc);
bThemed = true;
}
@@ -2574,7 +2574,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam CLUIFrames_SetFrameFloat(Frameid, 0);
break;
}
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
}
break;
@@ -2707,10 +2707,10 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam rcwnd.left = curpt.x;
rcwnd.right = curpt.x + 5;
- GetWindowRect(pcli->hwndContactList, &rcMiranda);
+ GetWindowRect(g_CLI.hwndContactList, &rcMiranda);
//GetWindowRect( Frames[pos].ContainerWnd, &rcwnd );
//IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )
- if (IsWindowVisible(pcli->hwndContactList) && IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) {
+ if (IsWindowVisible(g_CLI.hwndContactList) && IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) {
int id = g_pfwFrames[pos].id;
@@ -2741,7 +2741,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam rcwnd.left = curpt.x;
rcwnd.right = curpt.x + 5;
- GetWindowRect(pcli->hwndContactList, &rcMiranda);
+ GetWindowRect(g_CLI.hwndContactList, &rcMiranda);
//GetWindowRect( Frames[pos].ContainerWnd, &rcwnd );
//IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )
@@ -2873,7 +2873,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam }
if (newh > 0)
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
break;
}
s_nCurDragBar = -1; s_nLastByPos = -1; s_nOldFrameHeight = -1; ReleaseCapture();
@@ -2969,7 +2969,7 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP case WM_NOTIFY:
case WM_PARENTNOTIFY:
case WM_SYSCOMMAND:
- return SendMessage(pcli->hwndContactList, msg, wParam, lParam);
+ return SendMessage(g_CLI.hwndContactList, msg, wParam, lParam);
case WM_MOVE:
if (g_CluiData.fDocked)
@@ -3085,7 +3085,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP rcwnd.left = curpt.x;
rcwnd.right = curpt.x + 5;
- GetWindowRect(pcli->hwndContactList, &rcMiranda);
+ GetWindowRect(g_CLI.hwndContactList, &rcMiranda);
if (IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) {
GetCursorPos(&curpt);
GetWindowRect(g_pfwFrames[framepos].hWnd, &rcwnd);
@@ -3169,10 +3169,10 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam) if (g_pfwFrames[pos].floating || (lParam & 2)) {
if (g_pfwFrames[pos].OwnerWindow != (HWND)-2 && g_pfwFrames[pos].visible) {
- if (g_pfwFrames[pos].OwnerWindow == nullptr) g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(pcli->hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
- CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(pcli->hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
+ if (g_pfwFrames[pos].OwnerWindow == nullptr) g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(g_CLI.hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
+ CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(g_CLI.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
SetParent(g_pfwFrames[pos].hWnd, g_pfwFrames[pos].OwnerWindow);
- SetParent(g_pfwFrames[pos].TitleBar.hwnd, pcli->hwndContactList);
+ SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_CLI.hwndContactList);
SetWindowLongPtr(g_pfwFrames[pos].OwnerWindow, GWLP_USERDATA, g_pfwFrames[pos].id);
g_pfwFrames[pos].floating = FALSE;
if (!(lParam & 2)) {
@@ -3181,8 +3181,8 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam) }
}
else {
- SetParent(g_pfwFrames[pos].hWnd, pcli->hwndContactList);
- SetParent(g_pfwFrames[pos].TitleBar.hwnd, pcli->hwndContactList);
+ SetParent(g_pfwFrames[pos].hWnd, g_CLI.hwndContactList);
+ SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_CLI.hwndContactList);
g_pfwFrames[pos].floating = FALSE;
if (g_pfwFrames[pos].ContainerWnd) DestroyWindow(g_pfwFrames[pos].ContainerWnd);
g_pfwFrames[pos].ContainerWnd = nullptr;
@@ -3204,7 +3204,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam) if (!g_pfwFrames[pos].TitleBar.ShowTitleBar)
recttb.top = recttb.bottom = recttb.left = recttb.right = 0;
- g_pfwFrames[pos].ContainerWnd = CreateContainerWindow(pcli->hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
+ g_pfwFrames[pos].ContainerWnd = CreateContainerWindow(g_CLI.hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
SetParent(g_pfwFrames[pos].hWnd, g_pfwFrames[pos].ContainerWnd);
SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_pfwFrames[pos].ContainerWnd);
@@ -3249,7 +3249,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam) hwndtmp = g_pfwFrames[pos].ContainerWnd;
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
if (hwndtmp)
SendMessage(hwndtmp, WM_SIZE, 0, 0);
@@ -3367,7 +3367,7 @@ int UnLoadCLUIFramesModule(void) DeleteObject(sttBmpBackground);
sttBmpBackground = nullptr;
}
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
CLUIFramesStoreAllFrames();
CLUIFrameOnModulesUnload(0, 0);
@@ -3378,7 +3378,7 @@ int UnLoadCLUIFramesModule(void) for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
- if (F.hWnd != pcli->hwndContactTree)
+ if (F.hWnd != g_CLI.hwndContactTree)
DestroyWindow(F.hWnd);
F.hWnd = (HWND)-1;
@@ -3429,9 +3429,9 @@ int CLUIFrames_SetLayeredMode(BOOL fLayeredMode, HWND hwnd) for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
if (fLayeredMode) {
- if (F.visible && GetParent(F.hWnd) == pcli->hwndContactList && F.PaintCallbackProc == nullptr) {
+ if (F.visible && GetParent(F.hWnd) == g_CLI.hwndContactList && F.PaintCallbackProc == nullptr) {
//create owner window
- F.OwnerWindow = CreateSubContainerWindow(pcli->hwndContactList, F.FloatingPos.x, F.FloatingPos.y, 10, 10);
+ F.OwnerWindow = CreateSubContainerWindow(g_CLI.hwndContactList, F.FloatingPos.x, F.FloatingPos.y, 10, 10);
SetParent(F.hWnd, F.OwnerWindow);
}
}
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp index 6d77c35ea6..40aa1ad468 100644 --- a/plugins/Clist_modern/src/init.cpp +++ b/plugins/Clist_modern/src/init.cpp @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. CMPlugin g_plugin;
HINSTANCE g_hMirApp = nullptr;
-CLIST_INTERFACE *pcli = nullptr;
+
CLIST_INTERFACE corecli = { 0 };
CLUIDATA g_CluiData = {};
@@ -101,9 +101,9 @@ extern "C" __declspec(dllexport) int Unload(void) {
TRACE("Unloading Clist Modern\r\n");
- if (IsWindow(pcli->hwndContactList))
- DestroyWindow(pcli->hwndContactList);
- pcli->hwndContactList = nullptr;
+ if (IsWindow(g_CLI.hwndContactList))
+ DestroyWindow(g_CLI.hwndContactList);
+ g_CLI.hwndContactList = nullptr;
ToolbarButtonUnloadModule();
BackgroundsUnloadModule();
@@ -131,63 +131,63 @@ static HRESULT SubclassClistInterface() // 'save*' - pointer to stored default parent handle
// 'cli_*' - new handler with default core service calling
- pcli = Clist_GetInterface();
- corecli = *pcli;
-
- pcli->hInst = g_plugin.getInst();
-
- pcli->pfnCreateCacheItem = cliCreateCacheItem;
- pcli->pfnCheckCacheItem = cliCheckCacheItem;
- pcli->pfnFreeCacheItem = cliFreeCacheItem;
- pcli->pfnInvalidateDisplayNameCacheEntry = cliInvalidateDisplayNameCacheEntry;
-
- pcli->pfnTrayIconPauseAutoHide = cliTrayIconPauseAutoHide;
- pcli->pfnTrayIconInit = cliTrayIconInit;
- pcli->pfnTrayCalcChanged = cliTrayCalcChanged;
-
- pcli->pfnCluiProtocolStatusChanged = cliCluiProtocolStatusChanged;
-
- pcli->pfnBeginRenameSelection = cliBeginRenameSelection;
- pcli->pfnCreateClcContact = cliCreateClcContact;
- pcli->pfnGetRowBottomY = cliGetRowBottomY;
- pcli->pfnGetRowHeight = cliGetRowHeight;
- pcli->pfnGetRowTopY = cliGetRowTopY;
- pcli->pfnGetRowTotalHeight = cliGetRowTotalHeight;
- pcli->pfnInvalidateRect = cliInvalidateRect;
- pcli->pfnOnCreateClc = CLUI::cliOnCreateClc;
- pcli->pfnPaintClc = CLCPaint::cliPaintClc;
- pcli->pfnRebuildEntireList = cliRebuildEntireList;
- pcli->pfnIsVisibleContact = cliIsVisibleContact;
- pcli->pfnRecalcScrollBar = cliRecalcScrollBar;
- pcli->pfnRowHitTest = cliRowHitTest;
- pcli->pfnScrollTo = cliScrollTo;
- pcli->pfnShowHide = cliShowHideStub;
- pcli->pfnHitTest = cliHitTest;
- pcli->pfnCompareContacts = cliCompareContacts;
- pcli->pfnGetIconFromStatusMode = cliGetIconFromStatusMode;
- pcli->pfnFindItem = cliFindItem;
- pcli->pfnGetRowByIndex = cliGetRowByIndex;
- pcli->pfnGetRowsPriorTo = cliGetRowsPriorTo;
- pcli->pfnGetGroupContentsCount = cliGetGroupContentsCount;
- pcli->pfnFindRowByText = cliFindRowByText;
- pcli->pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
+ Clist_GetInterface();
+ corecli = g_CLI;
+
+ g_CLI.hInst = g_plugin.getInst();
+
+ g_CLI.pfnCreateCacheItem = cliCreateCacheItem;
+ g_CLI.pfnCheckCacheItem = cliCheckCacheItem;
+ g_CLI.pfnFreeCacheItem = cliFreeCacheItem;
+ g_CLI.pfnInvalidateDisplayNameCacheEntry = cliInvalidateDisplayNameCacheEntry;
+
+ g_CLI.pfnTrayIconPauseAutoHide = cliTrayIconPauseAutoHide;
+ g_CLI.pfnTrayIconInit = cliTrayIconInit;
+ g_CLI.pfnTrayCalcChanged = cliTrayCalcChanged;
+
+ g_CLI.pfnCluiProtocolStatusChanged = cliCluiProtocolStatusChanged;
+
+ g_CLI.pfnBeginRenameSelection = cliBeginRenameSelection;
+ g_CLI.pfnCreateClcContact = cliCreateClcContact;
+ g_CLI.pfnGetRowBottomY = cliGetRowBottomY;
+ g_CLI.pfnGetRowHeight = cliGetRowHeight;
+ g_CLI.pfnGetRowTopY = cliGetRowTopY;
+ g_CLI.pfnGetRowTotalHeight = cliGetRowTotalHeight;
+ g_CLI.pfnInvalidateRect = cliInvalidateRect;
+ g_CLI.pfnOnCreateClc = CLUI::cliOnCreateClc;
+ g_CLI.pfnPaintClc = CLCPaint::cliPaintClc;
+ g_CLI.pfnRebuildEntireList = cliRebuildEntireList;
+ g_CLI.pfnIsVisibleContact = cliIsVisibleContact;
+ g_CLI.pfnRecalcScrollBar = cliRecalcScrollBar;
+ g_CLI.pfnRowHitTest = cliRowHitTest;
+ g_CLI.pfnScrollTo = cliScrollTo;
+ g_CLI.pfnShowHide = cliShowHideStub;
+ g_CLI.pfnHitTest = cliHitTest;
+ g_CLI.pfnCompareContacts = cliCompareContacts;
+ g_CLI.pfnGetIconFromStatusMode = cliGetIconFromStatusMode;
+ g_CLI.pfnFindItem = cliFindItem;
+ g_CLI.pfnGetRowByIndex = cliGetRowByIndex;
+ g_CLI.pfnGetRowsPriorTo = cliGetRowsPriorTo;
+ g_CLI.pfnGetGroupContentsCount = cliGetGroupContentsCount;
+ g_CLI.pfnFindRowByText = cliFindRowByText;
+ g_CLI.pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
// partialy overloaded - call default handlers from inside
- pcli->pfnIconFromStatusMode = cli_IconFromStatusMode;
- pcli->pfnLoadCluiGlobalOpts = CLUI_cli_LoadCluiGlobalOpts;
- pcli->pfnLoadClcOptions = cli_LoadCLCOptions;
- pcli->pfnSortCLC = cli_SortCLC;
- pcli->pfnAddContactToGroup = cli_AddContactToGroup;
- pcli->pfnAddContactToTree = cli_AddContactToTree;
- pcli->pfnContactListWndProc = CLUI::cli_ContactListWndProc;
- pcli->pfnFreeContact = cli_FreeContact;
- pcli->pfnSetContactCheckboxes = cli_SetContactCheckboxes;
- pcli->pfnTrayIconProcessMessage = cli_TrayIconProcessMessage;
- pcli->pfnContactListControlWndProc = cli_ContactListControlWndProc;
- pcli->pfnProcessExternalMessages = cli_ProcessExternalMessages;
- pcli->pfnAddEvent = cli_AddEvent;
- pcli->pfnRemoveEvent = cli_RemoveEvent;
- pcli->pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
+ g_CLI.pfnIconFromStatusMode = cli_IconFromStatusMode;
+ g_CLI.pfnLoadCluiGlobalOpts = CLUI_cli_LoadCluiGlobalOpts;
+ g_CLI.pfnLoadClcOptions = cli_LoadCLCOptions;
+ g_CLI.pfnSortCLC = cli_SortCLC;
+ g_CLI.pfnAddContactToGroup = cli_AddContactToGroup;
+ g_CLI.pfnAddContactToTree = cli_AddContactToTree;
+ g_CLI.pfnContactListWndProc = CLUI::cli_ContactListWndProc;
+ g_CLI.pfnFreeContact = cli_FreeContact;
+ g_CLI.pfnSetContactCheckboxes = cli_SetContactCheckboxes;
+ g_CLI.pfnTrayIconProcessMessage = cli_TrayIconProcessMessage;
+ g_CLI.pfnContactListControlWndProc = cli_ContactListControlWndProc;
+ g_CLI.pfnProcessExternalMessages = cli_ProcessExternalMessages;
+ g_CLI.pfnAddEvent = cli_AddEvent;
+ g_CLI.pfnRemoveEvent = cli_RemoveEvent;
+ g_CLI.pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
return S_OK;
}
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index b9e2d04ab6..7cfd68746a 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -229,7 +229,7 @@ static void CALLBACK _AniAva_SyncCallerUserAPCProc(DWORD_PTR dwParam) static INT_PTR _AniAva_CreateAvatarWindowSync_Worker(WPARAM tszName, LPARAM)
{
HWND hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_NOPARENTNOTIFY, ANIAVAWINDOWCLASS,
- (wchar_t*)tszName, WS_POPUP, 0, 0, 1, 1, pcli->hwndContactList, nullptr, pcli->hInst, nullptr);
+ (wchar_t*)tszName, WS_POPUP, 0, 0, 1, 1, g_CLI.hwndContactList, nullptr, g_CLI.hInst, nullptr);
return (INT_PTR)hwnd;
}
@@ -474,9 +474,9 @@ static void _AniAva_LoadOptions() static void _AniAva_InvalidateParent(ANIAVA_WINDOWINFO * dat)
{
if (!IMMEDIATE_DRAW) return;
- HWND hwndParent = pcli->hwndContactTree;
+ HWND hwndParent = g_CLI.hwndContactTree;
RECT rcPos = dat->rcPos;
- pcli->pfnInvalidateRect(hwndParent, &rcPos, FALSE);
+ g_CLI.pfnInvalidateRect(hwndParent, &rcPos, FALSE);
}
static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent = nullptr, RECT *rcInParent = nullptr)
@@ -571,7 +571,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent = nullpt // intersect visible area
// update layered window
- GetWindowRect(pcli->hwndContactTree, &clistRect);
+ GetWindowRect(g_CLI.hwndContactTree, &clistRect);
if (dat->rcPos.top < 0) {
pt_from.y += -dat->rcPos.top;
szWnd.cy += dat->rcPos.top;
@@ -596,7 +596,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent = nullpt exStyle |= WS_EX_LAYERED;
SetWindowLongPtr(dat->hWindow, GWL_EXSTYLE, exStyle);
if (!IMMEDIATE_DRAW)
- SetWindowPos(pcli->hwndContactTree, dat->hWindow, 0, 0, 0, 0, SWP_ASYNCWINDOWPOS | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
+ SetWindowPos(g_CLI.hwndContactTree, dat->hWindow, 0, 0, 0, 0, SWP_ASYNCWINDOWPOS | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA);
}
@@ -695,10 +695,10 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if (dat->bOrderTop)
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_ASYNCWINDOWPOS);
else {
- LONG exStyle = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
- SetWindowPos(pcli->hwndContactList, hwnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ LONG exStyle = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
+ SetWindowPos(g_CLI.hwndContactList, hwnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
if (!(exStyle & WS_EX_TOPMOST))
- SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
}
return 0;
@@ -710,10 +710,10 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if (dat->bOrderTop)
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_ASYNCWINDOWPOS);
else {
- LONG exStyle = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
- SetWindowPos(pcli->hwndContactList, hwnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ LONG exStyle = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
+ SetWindowPos(g_CLI.hwndContactList, hwnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
if (!(exStyle&WS_EX_TOPMOST))
- SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
}
}
@@ -915,7 +915,7 @@ int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha _itoa((int)hContact, szName + 10, 16);
HWND hwnd = _AniAva_CreateAvatarWindowSync(_A2T(szName));
- HWND parent = GetAncestor(pcli->hwndContactList, GA_PARENT);
+ HWND parent = GetAncestor(g_CLI.hwndContactList, GA_PARENT);
pai->hWindow = hwnd;
SendMessage(hwnd, AAM_SETPARENT, (WPARAM)parent, 0);
@@ -957,7 +957,7 @@ int AniAva_UpdateOptions() }
if (bReloadAvatars)
- PostMessage(pcli->hwndContactTree, INTM_AVATARCHANGED, 0, 0);
+ PostMessage(g_CLI.hwndContactTree, INTM_AVATARCHANGED, 0, 0);
else
AniAva_RedrawAllAvatars(TRUE);
return 0;
@@ -970,7 +970,7 @@ void AniAva_UpdateParent() {
aacheck;
mir_cslock lck(s_CS);
- HWND parent = GetAncestor(pcli->hwndContactList, GA_PARENT);
+ HWND parent = GetAncestor(g_CLI.hwndContactList, GA_PARENT);
for (auto &it : s_Objects)
SendMessage(it->hWindow, AAM_SETPARENT, (WPARAM)parent, 0);
}
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 52f3ec176e..65a350be88 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -47,10 +47,10 @@ static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFun void Cache_GetTimezone(ClcData *dat, MCONTACT hContact) { ClcCacheEntry *pdnce = Clist_GetCacheEntry(hContact); - if (dat == nullptr && pcli->hwndContactTree) - dat = (ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0); + if (dat == nullptr && g_CLI.hwndContactTree) + dat = (ClcData *)GetWindowLongPtr(g_CLI.hwndContactTree, 0); - if (dat && dat->hWnd == pcli->hwndContactTree) { + if (dat && dat->hWnd == g_CLI.hwndContactTree) { DWORD flags = dat->contact_time_show_only_if_different ? TZF_DIFONLY : 0; pdnce->hTimeZone = TimeZone_CreateByContact(hContact, nullptr, flags); } diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index e980177c96..923e67fda5 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -119,7 +119,7 @@ static int clcHookSettingChanged(WPARAM hContact, LPARAM lParam) cliCluiProtocolStatusChanged(0, cws->szModule);
else if (!strcmp(cws->szModule, "CList")) {
if (!strcmp(cws->szSetting, "OnTop"))
- SetWindowPos(pcli->hwndContactList, cws->value.bVal ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ SetWindowPos(g_CLI.hwndContactList, cws->value.bVal ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
}
else {
@@ -145,7 +145,7 @@ static int clcHookSettingChanged(WPARAM hContact, LPARAM lParam) else if (!strcmp(cws->szSetting, "ListeningTo"))
Clist_Broadcast(INTM_STATUSMSGCHANGED, hContact, 0);
else if (!strcmp(cws->szSetting, "Transport") || !strcmp(cws->szSetting, "IsTransported")) {
- pcli->pfnInvalidateDisplayNameCacheEntry(hContact);
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(hContact);
Clist_Broadcast(CLM_AUTOREBUILD, hContact, 0);
}
}
@@ -236,8 +236,8 @@ static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const wchar_ int contactScanIndex = group->scanIndex;
int foundindex;
for (; group; group = group->parent)
- pcli->pfnSetGroupExpand(hwnd, dat, group, 1);
- foundindex = pcli->pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, group, 1);
+ foundindex = g_CLI.pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
if (fReturnAsFound)
return foundindex;
else if (nLastFound != -1 && fSearchUp && foundindex == index)
@@ -313,7 +313,7 @@ static LRESULT clcOnHitTest(ClcData *, HWND hwnd, UINT, WPARAM wParam, LPARAM lP static LRESULT clcOnCommand(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact;
- int hit = pcli->pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
+ int hit = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
if (hit != -1 && contact->type == CLCIT_GROUP) {
switch (LOWORD(wParam)) {
case POPUP_GROUPSHOWOFFLINE:
@@ -384,7 +384,7 @@ static LRESULT clcOnChar(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARA static LRESULT clcOnPaint(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (IsWindowVisible(hwnd)) {
- if (!g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList) {
+ if (!g_CluiData.fLayered || GetParent(hwnd) != g_CLI.hwndContactList) {
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
g_clcPainter.cliPaintClc(hwnd, dat, hdc, &ps.rcPaint);
@@ -430,7 +430,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM }
dat->selection = index;
- pcli->pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
return 0;
}
@@ -443,7 +443,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM case VK_PRIOR: dat->selection -= pageSize; selMoved = 1; break;
case VK_NEXT: dat->selection += pageSize; selMoved = 1; break;
case VK_HOME: dat->selection = 0; selMoved = 1; break;
- case VK_END: dat->selection = pcli->pfnGetGroupContentsCount(&dat->list, 1) - 1; selMoved = 1; break;
+ case VK_END: dat->selection = g_CLI.pfnGetGroupContentsCount(&dat->list, 1) - 1; selMoved = 1; break;
case VK_LEFT: changeGroupExpand = 1; break;
case VK_RIGHT: changeGroupExpand = 2; break;
case VK_RETURN:
@@ -510,7 +510,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM db_set_b(contact->hContact, "CList", "Expanded", 0);
ht = contact;
dat->bNeedsResort = true;
- pcli->pfnSortCLC(hwnd, dat, 1);
+ g_CLI.pfnSortCLC(hwnd, dat, 1);
cliRecalcScrollBar(hwnd, dat);
hitcontact = nullptr;
}
@@ -525,7 +525,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM db_set_b(contact->hContact, "CList", "Expanded", 1);
ht = contact;
dat->bNeedsResort = true;
- pcli->pfnSortCLC(hwnd, dat, 1);
+ g_CLI.pfnSortCLC(hwnd, dat, 1);
cliRecalcScrollBar(hwnd, dat);
if (ht) {
ClcContact *contact2;
@@ -552,10 +552,10 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM dat->selection--;
selMoved = 1;
}
- else pcli->pfnSetGroupExpand(hwnd, dat, contact->group, 0);
+ else g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, 0);
}
else if (changeGroupExpand == 2) {
- pcli->pfnSetGroupExpand(hwnd, dat, contact->group, 1);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, 1);
dat->selection++;
selMoved = 1;
}
@@ -565,8 +565,8 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM }
}
if (selMoved) {
- if (dat->selection >= pcli->pfnGetGroupContentsCount(&dat->list, 1))
- dat->selection = pcli->pfnGetGroupContentsCount(&dat->list, 1) - 1;
+ if (dat->selection >= g_CLI.pfnGetGroupContentsCount(&dat->list, 1))
+ dat->selection = g_CLI.pfnGetGroupContentsCount(&dat->list, 1) - 1;
if (dat->selection < 0) dat->selection = 0;
if (dat->bCompactMode)
SendMessage(hwnd, WM_SIZE, 0, 0);
@@ -618,7 +618,7 @@ static LRESULT clcOnTimer(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR }
dat->bNeedsResort = true;
- pcli->pfnSortCLC(hwnd, dat, 1);
+ g_CLI.pfnSortCLC(hwnd, dat, 1);
cliRecalcScrollBar(hwnd, dat);
if (ht) {
int i = 0;
@@ -636,13 +636,13 @@ static LRESULT clcOnTimer(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR case TIMERID_DELAYEDRESORTCLC:
TRACE("Do sort on Timer\n");
KillTimer(hwnd, TIMERID_DELAYEDRESORTCLC);
- pcli->pfnSortCLC(hwnd, dat, 1);
- pcli->pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnSortCLC(hwnd, dat, 1);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
return 0;
case TIMERID_RECALCSCROLLBAR:
KillTimer(hwnd, TIMERID_RECALCSCROLLBAR);
- pcli->pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
return 0;
default:
@@ -745,7 +745,7 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT, WPARAM, LPARAM lP ClcGroup *selgroup;
ClcContact *selcontact;
dat->selection = cliGetRowByIndex(dat, dat->selection, &selcontact, &selgroup);
- pcli->pfnSetGroupExpand(hwnd, dat, contact->group, -1);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
if (dat->selection != -1) {
dat->selection = cliGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
if (dat->selection == -1)
@@ -767,7 +767,7 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT, WPARAM, LPARAM lP if (contact->type == CLCIT_GROUP)
Clist_SetGroupChildCheckboxes(contact->group, bNewState);
else
- pcli->pfnSetContactCheckboxes(contact, bNewState);
+ g_CLI.pfnSetContactCheckboxes(contact, bNewState);
Clist_RecalculateGroupCheckboxes(dat);
cliInvalidateRect(hwnd, nullptr, FALSE);
@@ -1203,8 +1203,8 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, {
BOOL NeedRename = FALSE;
wchar_t newName[128] = { 0 };
- pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
- int i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
+ g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
+ int i = g_CLI.pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
if (i != -1 && group->groupId != destgroup->groupId) {
wchar_t *groupName = mir_wstrdup(Clist_GroupGetName(contact->groupId, nullptr));
wchar_t *shortGroup = nullptr;
@@ -1303,7 +1303,7 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wPara Clist_DeleteItemFromTree(hwnd, wParam);
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b(wParam, "CList", "Hidden", 0)) {
NMCLISTCONTROL nm;
- pcli->pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
@@ -1350,9 +1350,9 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam ClcContact *contact = nullptr;
if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr)) {
if (shouldShow && db_is_contact(wParam)) {
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
- pcli->pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
+ g_CLI.pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
needRepaint = TRUE;
Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr);
if (contact) {
@@ -1372,7 +1372,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam shouldShow = TRUE;
if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline || g_CluiData.bFilterEffective)) { // CLVM changed
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
Clist_RemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
needRepaint = TRUE;
@@ -1396,7 +1396,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam if (hSelItem) {
if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr))
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
}
@@ -1501,7 +1501,7 @@ static LRESULT clcOnIntmScrollBarChanged(ClcData *dat, HWND hwnd, UINT, WPARAM, if (dat->bNoVScrollbar)
ShowScrollBar(hwnd, SB_VERT, FALSE);
else
- pcli->pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
}
return 0;
}
@@ -1538,11 +1538,11 @@ static LRESULT clcOnIntmStatusChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM static LRESULT clcOnIntmReloadOptions(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- pcli->pfnLoadClcOptions(hwnd, dat, FALSE);
+ g_CLI.pfnLoadClcOptions(hwnd, dat, FALSE);
Clist_SaveStateAndRebuildList(hwnd, dat);
- pcli->pfnSortCLC(hwnd, dat, 1);
+ g_CLI.pfnSortCLC(hwnd, dat, 1);
if (IsWindowVisible(hwnd))
- pcli->pfnInvalidateRect(GetParent(hwnd), nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(GetParent(hwnd), nullptr, FALSE);
return TRUE;
}
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index cbf89f1cfe..be79fcb714 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -208,7 +208,7 @@ bool CLCItems_IsShowOfflineGroup(ClcGroup *group) MCONTACT SaveSelection(ClcData *dat)
{
ClcContact *selcontact = nullptr;
- if (pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) == -1)
+ if (g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) == -1)
return 0;
return Clist_ContactToHItem(selcontact);
@@ -224,9 +224,9 @@ int RestoreSelection(ClcData *dat, MCONTACT hSelected) }
if (!selcontact->iSubNumber)
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else {
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact->subcontacts));
+ dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact->subcontacts));
if (dat->selection != -1)
dat->selection += selcontact->iSubNumber;
}
@@ -247,7 +247,7 @@ int cliIsVisibleContact(ClcCacheEntry *pce, ClcGroup *group) void cliRebuildEntireList(HWND hwnd, ClcData *dat)
{
KillTimer(hwnd, TIMERID_REBUILDAFTER);
- pcli->bAutoRebuild = false;
+ g_CLI.bAutoRebuild = false;
ImageArray_Clear(&dat->avatar_cache);
RowHeights_Clear(dat);
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index 42c709ac6d..fead72d234 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -35,14 +35,14 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP switch (msg) {
case CLM_DELETEITEM:
Clist_DeleteItemFromTree(hwnd, wParam);
- clcSetDelayTimer(TIMERID_DELAYEDRESORTCLC, hwnd, 1); //pcli->pfnSortCLC(hwnd, dat, 1);
- clcSetDelayTimer(TIMERID_RECALCSCROLLBAR, hwnd, 2); //pcli->pfnRecalcScrollBar(hwnd, dat);
+ clcSetDelayTimer(TIMERID_DELAYEDRESORTCLC, hwnd, 1); //g_CLI.pfnSortCLC(hwnd, dat, 1);
+ clcSetDelayTimer(TIMERID_RECALCSCROLLBAR, hwnd, 2); //g_CLI.pfnRecalcScrollBar(hwnd, dat);
return 0;
case CLM_AUTOREBUILD:
if (dat->bForceInDialog) {
Clist_SaveStateAndRebuildList(hwnd, dat);
- pcli->bAutoRebuild = false;
+ g_CLI.bAutoRebuild = false;
}
else clcSetDelayTimer(TIMERID_REBUILDAFTER, hwnd);
return 0;
@@ -190,7 +190,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
- pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
if (!contact->iSubNumber) {
index = group->cl.indexOf(contact);
@@ -211,7 +211,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP }
}
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, group, index);
+ dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, group, index);
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
}
return 0;
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index ea10ddea87..229c8f1e53 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -358,7 +358,7 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA db_set_b(0, "CLC", "SubIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SUBINDENTSPIN, UDM_GETPOS, 0, 0));
ClcOptionsChanged();
CLUI_ReloadCLUIOptions();
- PostMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
return TRUE;
}
}
@@ -562,7 +562,7 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, db_set_b(0, "CList", "PlaceOfflineToRoot", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_OFFLINETOROOT));
Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
- Clist_InitAutoRebuild(pcli->hwndContactTree); /* force reshuffle */
+ Clist_InitAutoRebuild(g_CLI.hwndContactTree); /* force reshuffle */
ClcOptionsChanged(); // Used to force loading avatar an list height related options
return TRUE;
}
@@ -741,7 +741,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L Clist_TrayIconIconsChanged();
Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
- Clist_InitAutoRebuild(pcli->hwndContactTree); /* force reshuffle */
+ Clist_InitAutoRebuild(g_CLI.hwndContactTree); /* force reshuffle */
ClcOptionsChanged(); // Used to force loading avatar an list height related options
return TRUE;
}
@@ -905,7 +905,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM db_set_b(0, "CList", "AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
db_set_w(0, "CList", "HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
CLUI_ChangeWindowMode();
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
CLUI_ReloadCLUIOptions();
EventArea_ConfigureEventArea();
cliShowHide(true);
@@ -1126,7 +1126,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP g_CluiData.dwKeyColor = db_get_dw(0, "ModernSettings", "KeyColor", (DWORD)SETTING_KEYCOLOR_DEFAULT);
db_set_b(0, "CList", "OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
db_set_b(0, "CList", "OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
- SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ SetWindowPos(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
db_set_b(0, "CLUI", "DragToScroll", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
{ //====== Non-Layered Mode ======
@@ -1149,14 +1149,14 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
HWND hProgMan = FindWindow(L"Progman", nullptr);
if (IsWindow(hProgMan)) {
- SetParent(pcli->hwndContactList, hProgMan);
+ SetParent(g_CLI.hwndContactList, hProgMan);
Sync(CLUIFrames_SetParentForContainers, (HWND)hProgMan);
g_CluiData.fOnDesktop = true;
}
}
else {
- if (GetParent(pcli->hwndContactList)) {
- SetParent(pcli->hwndContactList, nullptr);
+ if (GetParent(g_CLI.hwndContactList)) {
+ SetParent(g_CLI.hwndContactList, nullptr);
Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
}
g_CluiData.fOnDesktop = false;
@@ -1170,7 +1170,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP db_set_dw(0, "CLUIFrames", "GapBetweenFrames", (DWORD)i1);
db_set_dw(0, "CLUIFrames", "GapBetweenTitleBar", (DWORD)i2);
- Sync(CLUIFramesOnClistResize, (WPARAM)pcli->hwndContactList, 0);
+ Sync(CLUIFramesOnClistResize, (WPARAM)g_CLI.hwndContactList, 0);
}
db_set_b(0, "CList", "Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
db_set_b(0, "CList", "Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
@@ -1180,7 +1180,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP ske_LoadSkinFromDB();
CLUI_UpdateLayeredMode();
CLUI_ChangeWindowMode();
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
CLUI_ReloadCLUIOptions();
cliShowHide(true);
g_mutex_bChangingMode = FALSE;
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index 5038cfe1f0..8cdf7221c4 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -125,7 +125,7 @@ BOOL CLCPaint::IsForegroundWindow(HWND hWnd) HFONT CLCPaint::ChangeToFont(HDC hdc, ClcData *dat, int id, int *fontHeight)
{
if (!dat)
- dat = (ClcData*)GetWindowLongPtr(pcli->hwndContactTree, 0);
+ dat = (ClcData*)GetWindowLongPtr(g_CLI.hwndContactTree, 0);
if (!dat)
return nullptr;
@@ -137,7 +137,7 @@ HFONT CLCPaint::ChangeToFont(HDC hdc, ClcData *dat, int id, int *fontHeight) *fontHeight = dat->fontModernInfo[id].fontHeight;
ske_ResetTextEffect(hdc);
- if (dat->hWnd == pcli->hwndContactTree && dat->fontModernInfo[id].effect != 0)
+ if (dat->hWnd == g_CLI.hwndContactTree && dat->fontModernInfo[id].effect != 0)
ske_SelectTextEffect(hdc, dat->fontModernInfo[id].effect - 1, dat->fontModernInfo[id].effectColour1, dat->fontModernInfo[id].effectColour2);
else
ske_ResetTextEffect(hdc);
@@ -605,7 +605,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R // Let calc placeholder
int minheight = dat->row_min_heigh;
int mode2 = -1;
- BOOL InClistWindow = (dat->hWnd == pcli->hwndContactTree);
+ BOOL InClistWindow = (dat->hWnd == g_CLI.hwndContactTree);
int height = RowHeight_CalcRowHeight(dat, Drawing, -1);
ClcCacheEntry *pdnce = Drawing->pce;
@@ -1233,7 +1233,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R break;
case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL:
{
- int item = pcli->pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
+ int item = g_CLI.pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
if (item != -1)
_DrawStatusIcon(Drawing, dat, item, hdcMem,
p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT,
@@ -2471,7 +2471,7 @@ void CLCPaint::_DrawContactAvatar(HDC hdcMem, ClcData *dat, ClcContact *Drawing, overlayIdx = g_pAvatarOverlayIcons[GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE].listID;
break;
case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL:
- overlayIdx = pcli->pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
+ overlayIdx = g_CLI.pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
break;
case SETTING_AVATAR_OVERLAY_TYPE_CONTACT:
overlayIdx = Drawing->iImage;
@@ -2545,7 +2545,7 @@ void CLCPaint::_DrawContactAvatar(HDC hdcMem, ClcData *dat, ClcContact *Drawing, break;
case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL:
{
- int item = pcli->pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
+ int item = g_CLI.pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
if (item != -1)
_DrawStatusIcon(Drawing, dat, item, hdcMem,
ptOverlay.x, ptOverlay.y, ICON_HEIGHT, ICON_HEIGHT,
@@ -2790,7 +2790,7 @@ void CLCPaint::_DrawContactItems(HDC hdcMem, ClcData *dat, ClcContact *Drawing, void CLCPaint::_PaintRowItems(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint)
{
// Extended LAYOUT
- if (gl_RowRoot && (dat->hWnd == pcli->hwndContactTree)) {
+ if (gl_RowRoot && (dat->hWnd == g_CLI.hwndContactTree)) {
_PaintRowItemsEx(hdcMem, dat, Drawing, row_rc, free_row_rc, selected, hottrack);
ske_ResetTextEffect(hdcMem);
return;
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 16b65bfae2..5406a0e693 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -234,7 +234,7 @@ static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wPar case WM_KILLFOCUS:
Clist_EndRename((ClcData*)GetWindowLongPtr(hwnd, GWLP_USERDATA), 1);
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
return 0;
}
return mir_callNextSubclass(hwnd, RenameEditSubclassProc, uMsg, wParam, lParam);
@@ -464,7 +464,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) // Row
dat->row_min_heigh = db_get_w(0, "CList", "MinRowHeight", CLCDEFAULT_ROWHEIGHT);
dat->row_border = db_get_w(0, "CList", "RowBorder", SETTING_ROWBORDER_DEFAULT);
- dat->row_before_group_space = ((hwnd != pcli->hwndContactTree && pcli->hwndContactTree != nullptr)
+ dat->row_before_group_space = ((hwnd != g_CLI.hwndContactTree && g_CLI.hwndContactTree != nullptr)
|| !db_get_b(0, "ModernData", "UseAdvancedRowLayout", SETTING_ROW_ADVANCEDLAYOUT_DEFAULT)) ? 0 : db_get_w(0, "ModernSkin", "SpaceBeforeGroup", SKIN_SPACEBEFOREGROUP_DEFAULT);
dat->row_variable_height = db_get_b(0, "CList", "VariableRowHeight", SETTING_VARIABLEROWHEIGHT_DEFAULT);
dat->row_align_left_items_to_left = db_get_b(0, "CList", "AlignLeftItemsToLeft", SETTING_ALIGNLEFTTOLEFT_DEFAULT);
@@ -472,7 +472,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->row_align_right_items_to_right = db_get_b(0, "CList", "AlignRightItemsToRight", SETTING_ALIGNRIGHTORIGHT_DEFAULT);
//TODO: Add to settings
dat->row_align_group_mode = db_get_b(0, "CList", "AlignGroupCaptions", SETTING_ALIGNGROPCAPTION_DEFAULT);
- if (pcli->hwndContactTree == nullptr || dat->hWnd == pcli->hwndContactTree) {
+ if (g_CLI.hwndContactTree == nullptr || dat->hWnd == g_CLI.hwndContactTree) {
int defItemsOrder[NUM_ITEM_TYPE] = SETTINS_ROWITEMORDER_DEFAULT;
for (int i = 0; i < NUM_ITEM_TYPE; i++) {
@@ -488,7 +488,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) }
// Avatar
- if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree == nullptr) {
+ if (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr) {
dat->avatars_show = ServiceExists(MS_AV_GETAVATARBITMAP) && db_get_b(0, "CList", "AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT);
dat->avatars_draw_border = db_get_b(0, "CList", "AvatarsDrawBorders", SETTINGS_AVATARDRAWBORDER_DEFAULT);
dat->avatars_border_color = (COLORREF)db_get_dw(0, "CList", "AvatarsBorderColor", SETTINGS_AVATARBORDERCOLOR_DEFAULT);
@@ -516,7 +516,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) }
// Icon
- if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree == nullptr) {
+ if (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr) {
dat->icon_hide_on_avatar = db_get_b(0, "CList", "IconHideOnAvatar", SETTING_HIDEICONONAVATAR_DEFAULT);
dat->icon_draw_on_avatar_space = db_get_b(0, "CList", "IconDrawOnAvatarSpace", SETTING_ICONONAVATARPLACE_DEFAULT);
dat->icon_ignore_size_for_row_height = db_get_b(0, "CList", "IconIgnoreSizeForRownHeight", SETTING_ICONIGNORESIZE_DEFAULT);
@@ -528,7 +528,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) }
// Contact time
- if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree == nullptr) {
+ if (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr) {
dat->contact_time_show = db_get_b(0, "CList", "ContactTimeShow", SETTING_SHOWTIME_DEFAULT);
dat->contact_time_show_only_if_different = db_get_b(0, "CList", "ContactTimeShowOnlyIfDifferent", SETTING_SHOWTIMEIFDIFF_DEFAULT);
}
@@ -545,7 +545,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->text_smiley_height = 0;
dat->text_use_protocol_smileys = db_get_b(0, "CList", "TextUseProtocolSmileys", SETTING_TEXT_PROTOSMILEY_DEFAULT);
- if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree == nullptr)
+ if (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr)
dat->text_ignore_size_for_row_height = db_get_b(0, "CList", "TextIgnoreSizeForRownHeight", SETTING_TEXT_IGNORESIZE_DEFAULT);
else
dat->text_ignore_size_for_row_height = 0;
@@ -556,7 +556,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) gl_TrimText = db_get_b(0, "CList", "TrimText", SETTING_FIRSTLINE_TRIMTEXT_DEFAULT);
// Second line
- if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree == nullptr) {
+ if (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr) {
dat->secondLine.show = db_get_b(0, "CList", "SecondLineShow", SETTING_SECONDLINE_SHOW_DEFAULT);
dat->secondLine.top_space = db_get_w(0, "CList", "SecondLineTopSpace", SETTING_SECONDLINE_TOPSPACE_DEFAULT);
dat->secondLine.draw_smileys = db_get_b(0, "CList", "SecondLineDrawSmileys", SETTING_SECONDLINE_SMILEYS_DEFAULT);
@@ -576,7 +576,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) else memset(&dat->secondLine, 0, sizeof(dat->secondLine));
// Third line
- if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree == nullptr) {
+ if (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr) {
dat->thirdLine.show = db_get_b(0, "CList", "ThirdLineShow", SETTING_THIRDLINE_SHOW_DEFAULT);
dat->thirdLine.top_space = db_get_w(0, "CList", "ThirdLineTopSpace", SETTING_THIRDLINE_TOPSPACE_DEFAULT);
dat->thirdLine.draw_smileys = db_get_b(0, "CList", "ThirdLineDrawSmileys", SETTING_THIRDLINE_SMILEYS_DEFAULT);
@@ -596,7 +596,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) else memset(&dat->thirdLine, 0, sizeof(dat->thirdLine));
dat->rightMargin = db_get_b(0, "CLC", "RightMargin", CLCDEFAULT_RIGHTMARGIN);
- dat->bForceInDialog = (pcli->hwndContactTree) ? (hwnd != pcli->hwndContactTree) : 0;
+ dat->bForceInDialog = (g_CLI.hwndContactTree) ? (hwnd != g_CLI.hwndContactTree) : 0;
dat->subIndent = db_get_b(0, "CLC", "SubIndent", CLCDEFAULT_GROUPINDENT);
if (dat->hBmpBackground) { DeleteObject(dat->hBmpBackground); dat->hBmpBackground = nullptr; }
@@ -619,7 +619,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd, GWL_STYLE)&CLS_MANUALUPDATE)) && db_get_b(0, META_PROTO, "Enabled", 1);
- if (pcli->hwndContactTree == nullptr || dat->hWnd == pcli->hwndContactTree)
+ if (g_CLI.hwndContactTree == nullptr || dat->hWnd == g_CLI.hwndContactTree)
dat->bMetaIgnoreEmptyExtra = db_get_b(0, "CLC", "MetaIgnoreEmptyExtra", SETTING_METAIGNOREEMPTYEXTRA_DEFAULT) != 0;
else
dat->bMetaIgnoreEmptyExtra = false;
@@ -651,7 +651,7 @@ int ExpandMetaContact(HWND hwnd, ClcContact *contact, ClcData *dat) contact->bSubExpanded = true;
db_set_b(contact->hContact, "CList", "Expanded", contact->bSubExpanded);
dat->bNeedsResort = true;
- pcli->pfnSortCLC(hwnd, dat, 1);
+ g_CLI.pfnSortCLC(hwnd, dat, 1);
cliRecalcScrollBar(hwnd, dat);
return contact->bSubExpanded;
}
@@ -685,8 +685,8 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk) ClcGroup *ccGroup = group;
int ccScanIndex = group->scanIndex;
for (; group; group = group->parent)
- pcli->pfnSetGroupExpand(hwnd, dat, group, 1);
- return pcli->pfnGetRowsPriorTo(&dat->list, ccGroup, ccScanIndex + SubCount);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, group, 1);
+ return g_CLI.pfnGetRowsPriorTo(&dat->list, ccGroup, ccScanIndex + SubCount);
}
if (cc->type == CLCIT_GROUP) {
@@ -716,10 +716,10 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk) ClcGroup *ccGroup = group;
int ccScanIndex = group->scanIndex;
for (; group; group = group->parent)
- pcli->pfnSetGroupExpand(hwnd, dat, group, 1);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, group, 1);
if (!cc->bSubExpanded)
ExpandMetaContact(hwnd, cc, dat);
- return pcli->pfnGetRowsPriorTo(&dat->list, ccGroup, ccScanIndex + SubCount + i + 1);
+ return g_CLI.pfnGetRowsPriorTo(&dat->list, ccGroup, ccScanIndex + SubCount + i + 1);
}
}
}
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 0a1e379e9f..45c2c6db07 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -56,7 +56,7 @@ struct NotifyMenuItemExData static CLISTEVENT* MyGetEvent(int iSelection)
{
- for (auto &it : *pcli->events)
+ for (auto &it : *g_CLI.events)
if (it->menuId == iSelection)
return it;
@@ -142,7 +142,7 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) g_CluiData.hUpdateContact = p->hContact;
}
- if (pcli->events->getCount() > 0) {
+ if (g_CLI.events->getCount() > 0) {
g_CluiData.bEventAreaEnabled = true;
if (g_CluiData.bNotifyActive == false) {
g_CluiData.bNotifyActive = true;
@@ -159,7 +159,7 @@ int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) {
// Find the event that should be removed
CListEvent *pEvent = nullptr;
- for (auto &it : *pcli->events)
+ for (auto &it : *g_CLI.events)
if (it->hContact == hContact && it->hDbEvent == hDbEvent) {
pEvent = it;
break;
@@ -186,7 +186,7 @@ int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) int res = corecli.pfnRemoveEvent(hContact, hDbEvent);
- if (pcli->events->getCount() == 0) {
+ if (g_CLI.events->getCount() == 0) {
g_CluiData.bNotifyActive = false;
EventArea_HideShowNotifyFrame();
}
@@ -212,7 +212,7 @@ static event_area_t event_area; static BOOL sttDrawEventAreaBackground(HWND hwnd, HDC hdc, RECT *rect)
{
- BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != g_CLI.hwndContactList);
if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat) {
RECT rc;
if (rect)
@@ -247,13 +247,13 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM, LPARAM) event_area.useWinColors = db_get_b(0, "EventArea", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
event_area.backgroundBmpUse = db_get_w(0, "EventArea", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- PostMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
return 0;
}
void EventArea_ConfigureEventArea()
{
- int iCount = pcli->events->getCount();
+ int iCount = g_CLI.events->getCount();
g_CluiData.dwFlags &= ~(CLUI_FRAME_AUTOHIDENOTIFY | CLUI_FRAME_SHOWALWAYS);
if (db_get_b(0, "CLUI", "EventArea", SETTING_EVENTAREAMODE_DEFAULT) == 1) g_CluiData.dwFlags |= CLUI_FRAME_AUTOHIDENOTIFY;
@@ -325,7 +325,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC) static int EventArea_Draw(HWND hwnd, HDC hDC)
{
if (hwnd == (HWND)-1) return 0;
- if (GetParent(hwnd) == pcli->hwndContactList)
+ if (GetParent(hwnd) == g_CLI.hwndContactList)
return EventArea_DrawWorker(hwnd, hDC);
cliInvalidateRect(hwnd, nullptr, FALSE);
@@ -407,7 +407,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP // event we're interested in was removed by the service (nasty one...)
cle1 = MyGetEvent(iSelection);
if (cle1 != nullptr)
- pcli->pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ g_CLI.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
}
}
}
@@ -424,9 +424,9 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP return 1;
case WM_PAINT:
- if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered)
+ if (GetParent(hwnd) == g_CLI.hwndContactList && g_CluiData.fLayered)
CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)hwnd, 0);
- else if (GetParent(hwnd) == pcli->hwndContactList && !g_CluiData.fLayered) {
+ else if (GetParent(hwnd) == g_CLI.hwndContactList && !g_CluiData.fLayered) {
RECT rc = { 0 };
GetClientRect(hwnd, &rc);
rc.right++;
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 6690aadc85..8c30001324 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -136,7 +136,7 @@ static INT_PTR CloseAction(WPARAM, LPARAM) } while (!k);
if (k)
- DestroyWindow(pcli->hwndContactList);
+ DestroyWindow(g_CLI.hwndContactList);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index a1cae8871d..2aae35ea02 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -65,7 +65,7 @@ HICON cliGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int statu }
}
- return ske_ImageList_GetIcon(g_himlCListClc, pcli->pfnIconFromStatusMode(szProto, status, hContact));
+ return ske_ImageList_GetIcon(g_himlCListClc, g_CLI.pfnIconFromStatusMode(szProto, status, hContact));
}
int cli_IconFromStatusMode(const char *szProto, int nStatus, MCONTACT hContact)
@@ -107,7 +107,7 @@ int cli_IconFromStatusMode(const char *szProto, int nStatus, MCONTACT hContact) int GetContactIconC(ClcCacheEntry *p)
{
- return pcli->pfnIconFromStatusMode(p->szProto, p->szProto == nullptr ? ID_STATUS_OFFLINE : p->m_iStatus, p->hContact);
+ return g_CLI.pfnIconFromStatusMode(p->szProto, p->szProto == nullptr ? ID_STATUS_OFFLINE : p->m_iStatus, p->hContact);
}
//lParam
@@ -193,7 +193,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) return GWVS_VISIBLE;
HWND hwndFocused = GetFocus();
- if (hwndFocused == pcli->hwndContactList || GetParent(hwndFocused) == pcli->hwndContactList)
+ if (hwndFocused == g_CLI.hwndContactList || GetParent(hwndFocused) == g_CLI.hwndContactList)
return GWVS_VISIBLE;
// Some defaults now. The routine is designed for thin and tall windows.
@@ -307,7 +307,7 @@ int cliShowHide(bool bAlwaysShow) {
BOOL bShow = FALSE;
- int iVisibleState = GetWindowVisibleState(pcli->hwndContactList, 0, 0);
+ int iVisibleState = GetWindowVisibleState(g_CLI.hwndContactList, 0, 0);
int method = db_get_b(0, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT); //(0-none, 1-leftedge, 2-rightedge);
if (method) {
if (db_get_b(0, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT) == 0 && !bAlwaysShow)
@@ -337,46 +337,46 @@ int cliShowHide(bool bAlwaysShow) bShow = TRUE; break;
case GWVS_VISIBLE: //This is not needed, but goes for readability.
bShow = FALSE; break;
- case -1: //We can't get here, both pcli->hwndContactList and iStepX and iStepY are right.
+ case -1: //We can't get here, both g_CLI.hwndContactList and iStepX and iStepY are right.
return 0;
}
if (bShow || bAlwaysShow) {
Sync(CLUIFrames_ActivateSubContainers, TRUE);
- CLUI_ShowWindowMod(pcli->hwndContactList, SW_RESTORE);
+ CLUI_ShowWindowMod(g_CLI.hwndContactList, SW_RESTORE);
if (!db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
Sync(CLUIFrames_OnShowHide, 1); //TO BE PROXIED
- SetWindowPos(pcli->hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ SetWindowPos(g_CLI.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
g_bCalledFromShowHide = 1;
if (!db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
- SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
g_bCalledFromShowHide = 0;
}
else {
- SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
Sync(CLUIFrames_OnShowHide, 1);
- SetForegroundWindow(pcli->hwndContactList);
+ SetForegroundWindow(g_CLI.hwndContactList);
}
db_set_b(0, "CList", "State", SETTING_STATE_NORMAL);
RECT rcWindow;
- GetWindowRect(pcli->hwndContactList, &rcWindow);
+ GetWindowRect(g_CLI.hwndContactList, &rcWindow);
if (Utils_AssertInsideScreen(&rcWindow) == 1)
- MoveWindow(pcli->hwndContactList, rcWindow.left, rcWindow.top,
+ MoveWindow(g_CLI.hwndContactList, rcWindow.left, rcWindow.top,
rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE);
}
else { // It needs to be hidden
- if (GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) {
+ if (GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) {
CListMod_HideWindow();
db_set_b(0, "CList", "State", SETTING_STATE_HIDDEN);
}
else if (db_get_b(0, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
- CLUI_ShowWindowMod(pcli->hwndContactList, SW_HIDE);
+ CLUI_ShowWindowMod(g_CLI.hwndContactList, SW_HIDE);
db_set_b(0, "CList", "State", SETTING_STATE_HIDDEN);
}
else {
- CLUI_ShowWindowMod(pcli->hwndContactList, SW_MINIMIZE);
+ CLUI_ShowWindowMod(g_CLI.hwndContactList, SW_MINIMIZE);
db_set_b(0, "CList", "State", SETTING_STATE_MINIMIZED);
}
@@ -387,9 +387,9 @@ int cliShowHide(bool bAlwaysShow) int CListMod_HideWindow()
{
- KillTimer(pcli->hwndContactList, 1);
+ KillTimer(g_CLI.hwndContactList, 1);
if (!CLUI_HideBehindEdge())
- return CLUI_SmoothAlphaTransition(pcli->hwndContactList, 0, 1);
+ return CLUI_SmoothAlphaTransition(g_CLI.hwndContactList, 0, 1);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index 5d5cc8d7cf..ccaf1c54d7 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -95,7 +95,7 @@ int GetContactCachedStatus(MCONTACT hContact) int ContactAdded(WPARAM hContact, LPARAM)
{
if (!MirandaExiting())
- Clist_ChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(GetContactProto(hContact), ID_STATUS_OFFLINE, hContact));
+ Clist_ChangeContactIcon(hContact, g_CLI.pfnIconFromStatusMode(GetContactProto(hContact), ID_STATUS_OFFLINE, hContact));
return 0;
}
@@ -111,7 +111,7 @@ int MetaStatusChanged(WPARAM hMeta, LPARAM) int ContactSettingChanged(WPARAM hContact, LPARAM lParam)
{
- if (MirandaExiting() || !pcli || !hContact)
+ if (MirandaExiting() || !hContact)
return 0;
ClcCacheEntry *pdnce = Clist_GetCacheEntry(hContact);
@@ -140,8 +140,8 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) Clist_Broadcast(INTM_STATUSCHANGED, hContact, 0);
}
else if (!strcmp(cws->szModule, META_PROTO) && !memcmp(cws->szSetting, "Status", 6)) { // Status0..N for metacontacts
- if (pcli->hwndContactTree && g_flag_bOnModulesLoadedCalled)
- Clist_InitAutoRebuild(pcli->hwndContactTree);
+ if (g_CLI.hwndContactTree && g_flag_bOnModulesLoadedCalled)
+ Clist_InitAutoRebuild(g_CLI.hwndContactTree);
if ((db_get_w(0, "CList", "SecondLineType", SETTING_SECONDLINE_TYPE_DEFAULT) == TEXT_STATUS_MESSAGE || db_get_w(0, "CList", "ThirdLineType", SETTING_THIRDLINE_TYPE_DEFAULT) == TEXT_STATUS_MESSAGE) && pdnce->hContact && pdnce->szProto)
amRequestAwayMsg(hContact);
@@ -152,7 +152,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) pdnce->IdleTS = cws->value.dVal;
else if (!strcmp(cws->szSetting, "IsSubcontact")) {
pdnce->m_bIsSub = (cws->value.type == DBVT_DELETED) ? false : cws->value.bVal != 0;
- Clist_InitAutoRebuild(pcli->hwndContactTree);
+ Clist_InitAutoRebuild(g_CLI.hwndContactTree);
}
}
@@ -170,7 +170,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) else if (!strcmp(cws->szSetting, "Hidden")) {
pdnce->bIsHidden = cws->value.bVal;
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0)
- Clist_ChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(pdnce->szProto, pdnce->getStatus(), hContact));
+ Clist_ChangeContactIcon(hContact, g_CLI.pfnIconFromStatusMode(pdnce->szProto, pdnce->getStatus(), hContact));
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
}
@@ -183,7 +183,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (!strcmp(cws->szSetting, "p")) {
pdnce->szProto = GetContactProto(hContact);
char *szProto = (cws->value.type == DBVT_DELETED) ? nullptr : cws->value.pszVal;
- Clist_ChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(szProto, pdnce->getStatus(), hContact));
+ Clist_ChangeContactIcon(hContact, g_CLI.pfnIconFromStatusMode(szProto, pdnce->getStatus(), hContact));
}
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 3f6800fbfb..450e3462c3 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -109,7 +109,7 @@ static UINT_PTR autoHideTimerId; static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd, UINT, UINT_PTR idEvent, DWORD)
{
KillTimer(hwnd, idEvent);
- HWND hwndClui = pcli->hwndContactList;
+ HWND hwndClui = g_CLI.hwndContactList;
HWND ActiveWindow = GetActiveWindow();
if (ActiveWindow == hwndClui) return;
if (CLUI_CheckOwnedByClui(ActiveWindow)) return;
@@ -121,7 +121,7 @@ static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd, UINT, UINT_PTR idEvent, DW int cliTrayIconPauseAutoHide(WPARAM, LPARAM)
{
if (db_get_b(0, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
- if (GetActiveWindow() != pcli->hwndContactList && GetWindow(GetParent(GetActiveWindow()), GW_OWNER) != pcli->hwndContactList) {
+ if (GetActiveWindow() != g_CLI.hwndContactList && GetWindow(GetParent(GetActiveWindow()), GW_OWNER) != g_CLI.hwndContactList) {
KillTimer(nullptr, autoHideTimerId);
autoHideTimerId = CLUI_SafeSetTimer(nullptr, 0, 1000 * db_get_w(0, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
}
@@ -138,8 +138,8 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam) MSG *msg = (MSG*)wParam;
switch (msg->message) {
case WM_EXITMENULOOP:
- if (pcli->bTrayMenuOnScreen)
- pcli->bTrayMenuOnScreen = FALSE;
+ if (g_CLI.bTrayMenuOnScreen)
+ g_CLI.bTrayMenuOnScreen = FALSE;
break;
case TIM_CALLBACK:
@@ -151,7 +151,7 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam) SetForegroundWindow(msg->hwnd);
SetFocus(msg->hwnd);
GetCursorPos(&pt);
- pcli->bTrayMenuOnScreen = TRUE;
+ g_CLI.bTrayMenuOnScreen = TRUE;
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, nullptr);
PostMessage(msg->hwnd, WM_NULL, 0, 0);
g_mutex_bOnTrayRightClick = 0;
@@ -170,7 +170,7 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam) HWND h1 = (HWND)msg->lParam;
HWND h2 = h1 ? GetParent(h1) : nullptr;
if (db_get_b(0, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
- if (LOWORD(msg->wParam) == WA_INACTIVE && h2 != pcli->hwndContactList)
+ if (LOWORD(msg->wParam) == WA_INACTIVE && h2 != g_CLI.hwndContactList)
autoHideTimerId = CLUI_SafeSetTimer(nullptr, 0, 1000 * db_get_w(0, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
else {
KillTimer(nullptr, autoHideTimerId);
@@ -192,7 +192,7 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam) VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD)
{
- if (!pcli->trayIconCount)
+ if (!g_CLI.trayIconCount)
return;
PROTOACCOUNT **acc;
@@ -200,14 +200,14 @@ VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD) Proto_EnumAccounts(&AccNum, &acc);
// looking for the appropriate account to show its icon
- int t = pcli->cycleStep;
+ int t = g_CLI.cycleStep;
do {
- pcli->cycleStep = (pcli->cycleStep + 1) % AccNum;
- if (pcli->cycleStep == t)
+ g_CLI.cycleStep = (g_CLI.cycleStep + 1) % AccNum;
+ if (g_CLI.cycleStep == t)
return;
- } while (acc[pcli->cycleStep]->bIsVirtual || !acc[pcli->cycleStep]->bIsVisible);
+ } while (acc[g_CLI.cycleStep]->bIsVirtual || !acc[g_CLI.cycleStep]->bIsVisible);
- cliTrayCalcChanged(acc[pcli->cycleStep]->szModuleName, 0, 0);
+ cliTrayCalcChanged(acc[g_CLI.cycleStep]->szModuleName, 0, 0);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -294,7 +294,7 @@ UINT_PTR TimerID = 0; int cliTrayIconInit(HWND hwnd)
{
- if (pcli->trayIconCount != 0)
+ if (g_CLI.trayIconCount != 0)
return 0;
if (TimerID) {
@@ -308,11 +308,11 @@ int cliTrayIconInit(HWND hwnd) // Нужно узнать количество годных аккаунтов и неодинаковость их статусов.
bool bDiffers;
- pcli->trayIconCount = GetGoodAccNum(&bDiffers);
+ g_CLI.trayIconCount = GetGoodAccNum(&bDiffers);
// Если таковых аккаунтов не нашлось вообще, то будем показывать основную иконку Миранды.
- if (!pcli->trayIconCount) {
- pcli->trayIconCount = 1;
- pcli->trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * pcli->trayIconCount);
+ if (!g_CLI.trayIconCount) {
+ g_CLI.trayIconCount = 1;
+ g_CLI.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * g_CLI.trayIconCount);
Clist_TrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
OldMode = TRAY_ICON_MODE_GLOBAL;
return 0;
@@ -326,9 +326,9 @@ int cliTrayIconInit(HWND hwnd) // Некоторые режимы всегда показывают единственную иконку.
if (Mode < 8)
- pcli->trayIconCount = 1;
+ g_CLI.trayIconCount = 1;
- pcli->trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * pcli->trayIconCount);
+ g_CLI.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * g_CLI.trayIconCount);
// Добавляем иконки.
switch (Mode) {
@@ -352,8 +352,9 @@ int cliTrayIconInit(HWND hwnd) case TRAY_ICON_MODE_CYCLE:
Clist_TrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
- pcli->cycleStep = 0;
+ g_CLI.cycleStep = 0;
cliTrayCycleTimerProc(nullptr, 0, 0, 0); // force icon update
+
// Не сохраняем ID таймера в pcli, чтобы fnTrayIconUpdateBase не убивала его.
TimerID = CLUI_SafeSetTimer(nullptr, 0, db_get_w(0, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cliTrayCycleTimerProc);
break;
@@ -373,7 +374,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) if (!szChangedProto)
return -1;
- if (!pcli->trayIconCount)
+ if (!g_CLI.trayIconCount)
return -1;
if (!Clist_GetProtocolVisibility(szChangedProto))
@@ -394,7 +395,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) switch (Mode) {
case TRAY_ICON_MODE_GLOBAL:
- hIcon = pcli->pfnGetIconFromStatusMode(0, nullptr, CListTray_GetGlobalStatus(0, 0));
+ hIcon = g_CLI.pfnGetIconFromStatusMode(0, nullptr, CListTray_GetGlobalStatus(0, 0));
Clist_TrayIconMakeTooltip(nullptr, nullptr);
break;
@@ -409,7 +410,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) if (g_StatusBarData.bConnectingIcon && IsStatusConnecting(iStatus))
hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szProto, 0);
else
- hIcon = pcli->pfnGetIconFromStatusMode(0, szProto, Proto_GetStatus(szProto));
+ hIcon = g_CLI.pfnGetIconFromStatusMode(0, szProto, Proto_GetStatus(szProto));
Clist_TrayIconMakeTooltip(nullptr, szProto);
}
@@ -420,39 +421,39 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) if (g_StatusBarData.bConnectingIcon && IsStatusConnecting(iStatus))
hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0);
else if (!bConn)
- hIcon = pcli->pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto));
+ hIcon = g_CLI.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto));
Clist_TrayIconMakeTooltip(nullptr, nullptr);
break;
case TRAY_ICON_MODE_ALL:
// Какой индекс у аккаунта, который будем апдейтить?
- for (; i < pcli->trayIconCount; i++)
- if (!mir_strcmp(pcli->trayIcon[i].szProto, szChangedProto))
+ for (; i < g_CLI.trayIconCount; i++)
+ if (!mir_strcmp(g_CLI.trayIcon[i].szProto, szChangedProto))
break;
iStatus = Proto_GetStatus(szChangedProto);
if (g_StatusBarData.bConnectingIcon && IsStatusConnecting(iStatus))
hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0);
else
- hIcon = pcli->pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto));
- Clist_TrayIconMakeTooltip(nullptr, pcli->trayIcon[i].szProto);
+ hIcon = g_CLI.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto));
+ Clist_TrayIconMakeTooltip(nullptr, g_CLI.trayIcon[i].szProto);
break;
}
- trayIconInfo_t &p = pcli->trayIcon[i];
+ trayIconInfo_t &p = g_CLI.trayIcon[i];
DestroyIcon(p.hBaseIcon);
p.hBaseIcon = hIcon;
- replaceStrW(p.ptszToolTip, pcli->szTip);
+ replaceStrW(p.ptszToolTip, g_CLI.szTip);
NOTIFYICONDATA nid = { sizeof(NOTIFYICONDATA) };
- nid.hWnd = pcli->hwndContactList;
+ nid.hWnd = g_CLI.hwndContactList;
nid.uID = p.id;
nid.hIcon = p.hBaseIcon;
nid.uFlags = NIF_ICON | NIF_TIP;
// if Tipper is missing or turned off for tray, use system tooltips
if (!ServiceExists("mToolTip/ShowTip") || !db_get_b(0, "Tipper", "TrayTip", 1))
- mir_wstrncpy(nid.szTip, pcli->szTip, _countof(nid.szTip));
+ mir_wstrncpy(nid.szTip, g_CLI.szTip, _countof(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index c498208b64..745ca9a62b 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -161,7 +161,7 @@ int CLUI::OnEvent_ModulesLoaded(WPARAM, LPARAM) SleepEx(0, TRUE);
g_flag_bOnModulesLoadedCalled = TRUE;
- SendMessage(pcli->hwndContactList, UM_CREATECLC, 0, 0); // $$$
+ SendMessage(g_CLI.hwndContactList, UM_CREATECLC, 0, 0); // $$$
InitSkinHotKeys();
g_CluiData.bSTATE = STATE_NORMAL;
ske_RedrawCompleteWindow();
@@ -174,7 +174,7 @@ int CLUI::OnEvent_FontReload(WPARAM wParam, LPARAM lParam) g_CluiData.dwKeyColor = db_get_dw(0, "ModernSettings", "KeyColor", (DWORD)SETTING_KEYCOLOR_DEFAULT);
- cliInvalidateRect(pcli->hwndContactList, nullptr, 0);
+ cliInvalidateRect(g_CLI.hwndContactList, nullptr, 0);
return 0;
}
@@ -187,7 +187,7 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM, LPARAM) wchar_t cls[128];
GetClassName(hwndClist, cls, _countof(cls));
if (mir_wstrcmp(CLISTCONTROL_CLASSW, cls))
- hwndClist = pcli->hwndContactList;
+ hwndClist = g_CLI.hwndContactList;
MCONTACT hItem = (MCONTACT)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
Menu_ShowItem(hRenameMenuItem, hItem != 0);
@@ -209,7 +209,7 @@ INT_PTR CLUI::Service_ShowMainMenu(WPARAM, LPARAM) {
POINT pt;
GetCursorPos(&pt);
- TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
return 0;
}
@@ -217,7 +217,7 @@ INT_PTR CLUI::Service_ShowStatusMenu(WPARAM, LPARAM) {
POINT pt;
GetCursorPos(&pt);
- TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
return 0;
}
@@ -239,7 +239,7 @@ INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM hContact, LPARAM) HRESULT CLUI::CreateCluiFrames()
{
- g_hMenuMain = GetMenu(pcli->hwndContactList);
+ g_hMenuMain = GetMenu(g_CLI.hwndContactList);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -250,7 +250,7 @@ HRESULT CLUI::CreateCluiFrames() mii.hSubMenu = Menu_GetStatusMenu();
SetMenuItemInfo(g_hMenuMain, 1, TRUE, &mii);
- CreateCLCWindow(pcli->hwndContactList);
+ CreateCLCWindow(g_CLI.hwndContactList);
CLUI_ChangeWindowMode();
@@ -348,7 +348,7 @@ HRESULT CLUI::RegisterAvatarMenu() HRESULT CLUI::CreateCLCWindow(const HWND hwndClui)
{
- pcli->hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
+ g_CLI.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
WS_CHILD | WS_CLIPCHILDREN | CLS_CONTACTLIST
| (db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
| (db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
@@ -361,9 +361,9 @@ HRESULT CLUI::CreateCLCWindow(const HWND hwndClui) HRESULT CLUI::CreateUIFrames()
{
- EventArea_Create(pcli->hwndContactList);
+ EventArea_Create(g_CLI.hwndContactList);
CreateViewModeFrame();
- pcli->hwndStatus = StatusBar_Create(pcli->hwndContactList);
+ g_CLI.hwndStatus = StatusBar_Create(g_CLI.hwndContactList);
return S_OK;
}
@@ -408,7 +408,7 @@ HRESULT CLUI::FillAlphaChannel(HDC hDC, RECT *prcParent) HRESULT CLUI::CreateCLC()
{
CLISTFrame Frame = { sizeof(Frame) };
- Frame.hWnd = pcli->hwndContactTree;
+ Frame.hWnd = g_CLI.hwndContactTree;
Frame.align = alClient;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
Frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NO_SUBCONTAINER | F_UNICODE;
@@ -423,7 +423,7 @@ HRESULT CLUI::CreateCLC() nLastRequiredHeight = 0;
if (g_CluiData.current_viewmode[0] == '\0') {
- pcli->pfnSetHideOffline((bOldHideOffline == -1) ? false : bOldHideOffline);
+ g_CLI.pfnSetHideOffline((bOldHideOffline == -1) ? false : bOldHideOffline);
CallService(MS_CLIST_SETUSEGROUPS, (bOldUseGroups == -1) ? false : bOldUseGroups, 0);
}
nLastRequiredHeight = 0;
@@ -486,7 +486,7 @@ BOOL CLUI_CheckOwnedByClui(HWND hWnd) if (!hWnd)
return FALSE;
- HWND hWndClui = pcli->hwndContactList;
+ HWND hWndClui = g_CLI.hwndContactList;
HWND hWndMid = GetAncestor(hWnd, GA_ROOTOWNER);
if (hWndMid == hWndClui)
return TRUE;
@@ -501,7 +501,7 @@ BOOL CLUI_CheckOwnedByClui(HWND hWnd) int CLUI_ShowWindowMod(HWND hWnd, int nCmd)
{
- if (hWnd == pcli->hwndContactList) {
+ if (hWnd == g_CLI.hwndContactList) {
if (nCmd == SW_HIDE || nCmd == SW_MINIMIZE) {
AniAva_InvalidateAvatarPositions(0);
AniAva_RemoveInvalidatedAvatars();
@@ -553,25 +553,25 @@ void CLUI_UpdateLayeredMode() bool tLayeredFlag = db_get_b(0, "ModernData", "EnableLayering", SETTING_ENABLELAYERING_DEFAULT) != 0 && !g_CluiData.fDisableSkinEngine;
if (g_CluiData.fLayered != tLayeredFlag) {
- BOOL fWasVisible = IsWindowVisible(pcli->hwndContactList);
+ BOOL fWasVisible = IsWindowVisible(g_CLI.hwndContactList);
if (fWasVisible)
- ShowWindow(pcli->hwndContactList, SW_HIDE);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
//change layered mode
- LONG_PTR exStyle = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
+ LONG_PTR exStyle = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
if (tLayeredFlag)
exStyle |= WS_EX_LAYERED;
else
exStyle &= ~WS_EX_LAYERED;
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, exStyle&~WS_EX_LAYERED);
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, exStyle);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, exStyle&~WS_EX_LAYERED);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, exStyle);
g_CluiData.fLayered = tLayeredFlag;
- Sync(CLUIFrames_SetLayeredMode, tLayeredFlag, pcli->hwndContactList);
+ Sync(CLUIFrames_SetLayeredMode, tLayeredFlag, g_CLI.hwndContactList);
CLUI_ChangeWindowMode();
Sync(CLUIFrames_OnClistResize_mod, 0, 0);
if (fWasVisible)
- ShowWindow(pcli->hwndContactList, SW_SHOW);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOW);
}
}
@@ -594,7 +594,7 @@ void CLUI_UpdateAeroGlass() bb.dwFlags |= DWM_BB_BLURREGION;
}
- g_proc_DWMEnableBlurBehindWindow(pcli->hwndContactList, &bb);
+ g_proc_DWMEnableBlurBehindWindow(g_CLI.hwndContactList, &bb);
g_CluiData.fAeroGlass = tAeroGlass;
}
}
@@ -609,7 +609,7 @@ void CLUI_ChangeWindowMode() LONG_PTR styleMask = WS_CLIPCHILDREN | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_CLIPCHILDREN | WS_THICKFRAME | WS_SYSMENU;
LONG_PTR styleMaskEx = WS_EX_TOOLWINDOW | WS_EX_LAYERED;
LONG_PTR curStyle, curStyleEx;
- if (!pcli->hwndContactList) return;
+ if (!g_CLI.hwndContactList) return;
g_mutex_bChangingMode = TRUE;
g_bTransparentFlag = db_get_b(0, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT);
@@ -658,40 +658,40 @@ void CLUI_ChangeWindowMode() mir_wstrncpy(titleText, dbv.ptszVal, _countof(titleText));
db_free(&dbv);
}
- SetWindowText(pcli->hwndContactList, titleText);
+ SetWindowText(g_CLI.hwndContactList, titleText);
// < ->
// 1 - If visible store it and hide
if (g_CluiData.fLayered && (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT))) {
- SetParent(pcli->hwndContactList, nullptr);
+ SetParent(g_CLI.hwndContactList, nullptr);
Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
- UpdateWindow(pcli->hwndContactList);
+ UpdateWindow(g_CLI.hwndContactList);
g_CluiData.fOnDesktop = false;
}
// 5 - TODO Apply Style
- oldStyleEx = curStyleEx = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
- oldStyle = curStyle = GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE);
+ oldStyleEx = curStyleEx = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
+ oldStyle = curStyle = GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE);
curStyleEx = (curStyleEx & ~styleMaskEx) | styleEx;
curStyle = (curStyle & ~styleMask) | style;
if (oldStyleEx != curStyleEx || oldStyle != curStyle) {
- if (IsWindowVisible(pcli->hwndContactList)) {
+ if (IsWindowVisible(g_CLI.hwndContactList)) {
storedVisMode = TRUE;
mutex_bShowHideCalledFromAnimation = TRUE;
- ShowWindow(pcli->hwndContactList, SW_HIDE);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
Sync(CLUIFrames_OnShowHide, 0);
}
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, curStyleEx);
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, curStyle);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, curStyleEx);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, curStyle);
}
CLUI_UpdateAeroGlass();
if (g_CluiData.fLayered || !db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT)) {
- SetMenu(pcli->hwndContactList, nullptr);
+ SetMenu(g_CLI.hwndContactList, nullptr);
}
- else SetMenu(pcli->hwndContactList, g_hMenuMain);
+ else SetMenu(g_CLI.hwndContactList, g_hMenuMain);
if (g_CluiData.fLayered && (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)))
ske_UpdateWindowImage();
@@ -700,20 +700,20 @@ void CLUI_ChangeWindowMode() if (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
HWND hProgMan = FindWindow(L"Progman", nullptr);
if (IsWindow(hProgMan)) {
- SetParent(pcli->hwndContactList, hProgMan);
+ SetParent(g_CLI.hwndContactList, hProgMan);
Sync(CLUIFrames_SetParentForContainers, (HWND)hProgMan);
g_CluiData.fOnDesktop = true;
}
}
else {
- SetParent(pcli->hwndContactList, nullptr);
+ SetParent(g_CLI.hwndContactList, nullptr);
Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
g_CluiData.fOnDesktop = false;
}
// 7 - if it was visible - show
if (storedVisMode) {
- ShowWindow(pcli->hwndContactList, SW_SHOW);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOW);
Sync(CLUIFrames_OnShowHide, 1);
}
mutex_bShowHideCalledFromAnimation = FALSE;
@@ -723,19 +723,19 @@ void CLUI_ChangeWindowMode() if (!g_CluiData.fLayered) {
RECT r;
int w = 10;
- GetWindowRect(pcli->hwndContactList, &r);
+ GetWindowRect(g_CLI.hwndContactList, &r);
int h = (r.right - r.left) > (w * 2) ? w : (r.right - r.left);
int v = (r.bottom - r.top) > (w * 2) ? w : (r.bottom - r.top);
h = (h < v) ? h : v;
HRGN hRgn1 = CreateRoundRectRgn(0, 0, (r.right - r.left + 1), (r.bottom - r.top + 1), h, h);
if (db_get_b(0, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT) && !Clist_IsDocked())
- SetWindowRgn(pcli->hwndContactList, hRgn1, 1);
+ SetWindowRgn(g_CLI.hwndContactList, hRgn1, 1);
else {
DeleteObject(hRgn1);
- SetWindowRgn(pcli->hwndContactList, nullptr, 1);
+ SetWindowRgn(g_CLI.hwndContactList, nullptr, 1);
}
- RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
g_mutex_bChangingMode = FALSE;
flag_bFirstTimeCall = TRUE;
@@ -765,13 +765,13 @@ UINT_PTR CLUI_SafeSetTimer(HWND hwnd, int ID, int Timeout, TIMERPROC proc) int CLUI_UpdateTimer()
{
if (g_CluiData.nBehindEdgeState == 0) {
- KillTimer(pcli->hwndContactList, TM_BRINGOUTTIMEOUT);
- CLUI_SafeSetTimer(pcli->hwndContactList, TM_BRINGOUTTIMEOUT, wBehindEdgeHideDelay * 100, nullptr);
+ KillTimer(g_CLI.hwndContactList, TM_BRINGOUTTIMEOUT);
+ CLUI_SafeSetTimer(g_CLI.hwndContactList, TM_BRINGOUTTIMEOUT, wBehindEdgeHideDelay * 100, nullptr);
}
if (bShowEventStarted == 0 && g_CluiData.nBehindEdgeState > 0) {
- KillTimer(pcli->hwndContactList, TM_BRINGINTIMEOUT);
- bShowEventStarted = (BOOL)CLUI_SafeSetTimer(pcli->hwndContactList, TM_BRINGINTIMEOUT, wBehindEdgeShowDelay * 100, nullptr);
+ KillTimer(g_CLI.hwndContactList, TM_BRINGINTIMEOUT);
+ bShowEventStarted = (BOOL)CLUI_SafeSetTimer(g_CLI.hwndContactList, TM_BRINGINTIMEOUT, wBehindEdgeShowDelay * 100, nullptr);
}
return 0;
}
@@ -785,11 +785,11 @@ int CLUI_HideBehindEdge() //Need to be moved out of screen
bShowEventStarted = 0;
//1. get work area rectangle
- Docking_GetMonitorRectFromWindow(pcli->hwndContactList, &rcScreen);
+ Docking_GetMonitorRectFromWindow(g_CLI.hwndContactList, &rcScreen);
//SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen,FALSE);
//2. move out
int bordersize = wBehindEdgeBorderSize;
- GetWindowRect(pcli->hwndContactList, &rcWindow);
+ GetWindowRect(g_CLI.hwndContactList, &rcWindow);
switch (method) {
case 1: // left
rcWindow.left = rcScreen.left - (rcWindow.right - rcWindow.left) + bordersize;
@@ -799,8 +799,8 @@ int CLUI_HideBehindEdge() break;
}
g_CluiData.mutexPreventDockMoving = 0;
- SetWindowPos(pcli->hwndContactList, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
- Sync(CLUIFrames_OnMoving, pcli->hwndContactList, &rcWindow);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
+ Sync(CLUIFrames_OnMoving, g_CLI.hwndContactList, &rcWindow);
g_CluiData.mutexPreventDockMoving = 1;
//3. store setting
@@ -825,11 +825,11 @@ int CLUI_ShowFromBehindEdge() // Need to be moved out of screen
// 1. get work area rectangle
RECT rcScreen;
- Docking_GetMonitorRectFromWindow(pcli->hwndContactList, &rcScreen);
+ Docking_GetMonitorRectFromWindow(g_CLI.hwndContactList, &rcScreen);
// 2. move out
RECT rcWindow;
- GetWindowRect(pcli->hwndContactList, &rcWindow);
+ GetWindowRect(g_CLI.hwndContactList, &rcWindow);
switch (method) {
case 1: // left
rcWindow.left = rcScreen.left;
@@ -839,8 +839,8 @@ int CLUI_ShowFromBehindEdge() break;
}
g_CluiData.mutexPreventDockMoving = 0;
- SetWindowPos(pcli->hwndContactList, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
- Sync(CLUIFrames_OnMoving, pcli->hwndContactList, &rcWindow);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
+ Sync(CLUIFrames_OnMoving, g_CLI.hwndContactList, &rcWindow);
g_CluiData.mutexPreventDockMoving = 1;
// 3. store setting
@@ -852,8 +852,8 @@ int CLUI_ShowFromBehindEdge() int CLUI_IsInMainWindow(HWND hwnd)
{
- if (hwnd == pcli->hwndContactList) return 1;
- if (GetParent(hwnd) == pcli->hwndContactList) return 2;
+ if (hwnd == g_CLI.hwndContactList) return 1;
+ if (GetParent(hwnd) == g_CLI.hwndContactList) return 2;
return 0;
}
@@ -975,7 +975,7 @@ static bool StartTicksTimer(PROTOTICKS *pt) DestroyIcon(ic);
}
}
- CLUI_SafeSetTimer(pcli->hwndContactList, TM_STATUSBARUPDATE + pt->nIndex, nAnimatedIconStep, nullptr);
+ CLUI_SafeSetTimer(g_CLI.hwndContactList, TM_STATUSBARUPDATE + pt->nIndex, nAnimatedIconStep, nullptr);
pt->bTimerCreated = 1;
pt->nCycleStartTick = GetTickCount();
return true;
@@ -1021,7 +1021,7 @@ static LRESULT BroadCastMessageToChild(HWND hwnd, int message, WPARAM wParam, LP int CLUI_ReloadCLUIOptions()
{
- KillTimer(pcli->hwndContactList, TM_UPDATEBRINGTIMER);
+ KillTimer(g_CLI.hwndContactList, TM_UPDATEBRINGTIMER);
g_CluiData.bBehindEdgeSettings = db_get_b(0, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT);
wBehindEdgeShowDelay = db_get_w(0, "ModernData", "ShowDelay", SETTING_SHOWDELAY_DEFAULT);
wBehindEdgeHideDelay = db_get_w(0, "ModernData", "HideDelay", SETTING_HIDEDELAY_DEFAULT);
@@ -1045,7 +1045,7 @@ int CLUI_ReloadCLUIOptions() g_CluiData.TopClientMargin = db_get_b(0, "CLUI", "TopClientMargin", SETTING_TOPCLIENTMARIGN_DEFAULT);
g_CluiData.BottomClientMargin = db_get_b(0, "CLUI", "BottomClientMargin", SETTING_BOTTOMCLIENTMARIGN_DEFAULT);
}
- BroadCastMessageToChild(pcli->hwndContactList, WM_THEMECHANGED, 0, 0);
+ BroadCastMessageToChild(g_CLI.hwndContactList, WM_THEMECHANGED, 0, 0);
NotifyEventHooks(g_CluiData.hEventBkgrChanged, 0, 0);
return 0;
@@ -1063,7 +1063,7 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) RECT ra, r1;
HRGN treg, treg2;
- ClcData *dat = (ClcData*)GetWindowLongPtr(pcli->hwndContactTree, 0);
+ ClcData *dat = (ClcData*)GetWindowLongPtr(g_CLI.hwndContactTree, 0);
if (!dat)
return 1;
@@ -1101,7 +1101,7 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) DeleteObject(treg);
RECT rc;
- GetWindowRect(pcli->hwndContactList, &rc);
+ GetWindowRect(g_CLI.hwndContactList, &rc);
OffsetRect(&rc, -rc.left, -rc.top);
FillRect(hdc, &r1, GetSysColorBrush(COLOR_MENU));
ske_SetRectOpaque(hdc, &r1);
@@ -1195,7 +1195,7 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) int CLUI_SizingGetWindowRect(HWND hwnd, RECT *rc)
{
- if (mutex_bDuringSizing && hwnd == pcli->hwndContactList)
+ if (mutex_bDuringSizing && hwnd == g_CLI.hwndContactList)
*rc = rcSizingRect;
else
GetWindowRect(hwnd, rc);
@@ -1208,7 +1208,7 @@ int CLUI_IconsChanged(WPARAM, LPARAM) if (MirandaExiting())
return 0;
- DrawMenuBar(pcli->hwndContactList);
+ DrawMenuBar(g_CLI.hwndContactList);
ExtraIcon_Reload();
ExtraIcon_SetAll();
@@ -1236,7 +1236,7 @@ void CLUI_cli_LoadCluiGlobalOpts() int CLUI_TestCursorOnBorders()
{
- HWND hwnd = pcli->hwndContactList;
+ HWND hwnd = g_CLI.hwndContactList;
HCURSOR hCurs1 = nullptr;
POINT pt;
int k = 0, fx, fy;
@@ -1307,7 +1307,7 @@ int CLUI_SizingOnBorder(POINT pt, int PerformSize) {
if (!(db_get_b(0, "CLUI", "LockSize", SETTING_LOCKSIZE_DEFAULT))) {
RECT r;
- HWND hwnd = pcli->hwndContactList;
+ HWND hwnd = g_CLI.hwndContactList;
int sizeOnBorderFlag = 0;
GetWindowRect(hwnd, &r);
@@ -1380,11 +1380,11 @@ static int CLUI_SmoothAlphaThreadTransition() g_CluiData.bCurrentAlpha = 1;
ske_JustUpdateWindowImage();
mutex_bShowHideCalledFromAnimation = 1;
- CLUI_ShowWindowMod(pcli->hwndContactList, 0);
+ CLUI_ShowWindowMod(g_CLI.hwndContactList, 0);
Sync(CLUIFrames_OnShowHide, 0);
mutex_bShowHideCalledFromAnimation = 0;
g_CluiData.bCurrentAlpha = 0;
- if (!g_CluiData.fLayered) RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_ERASE | RDW_FRAME);
+ if (!g_CluiData.fLayered) RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_ERASE | RDW_FRAME);
return 0;
}
}
@@ -1399,7 +1399,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) if (GoalAlpha > 0 && wParam != 2) {
if (!IsWindowVisible(hwnd)) {
mutex_bShowHideCalledFromAnimation = 1;
- CLUI_ShowWindowMod(pcli->hwndContactList, SW_RESTORE);
+ CLUI_ShowWindowMod(g_CLI.hwndContactList, SW_RESTORE);
Sync(CLUIFrames_OnShowHide, 1);
mutex_bShowHideCalledFromAnimation = 0;
g_CluiData.bCurrentAlpha = GoalAlpha;
@@ -1410,7 +1410,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) else if (GoalAlpha == 0 && wParam != 2) {
if (IsWindowVisible(hwnd)) {
mutex_bShowHideCalledFromAnimation = 1;
- CLUI_ShowWindowMod(pcli->hwndContactList, 0);
+ CLUI_ShowWindowMod(g_CLI.hwndContactList, 0);
Sync(CLUIFrames_OnShowHide, 0);
g_CluiData.bCurrentAlpha = GoalAlpha;
mutex_bShowHideCalledFromAnimation = 0;
@@ -1427,7 +1427,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) if (!mutex_bAnimationInProgress) {
if ((!IsWindowVisible(hwnd) || g_CluiData.bCurrentAlpha == 0) && bAlphaEnd > 0) {
mutex_bShowHideCalledFromAnimation = 1;
- CLUI_ShowWindowMod(pcli->hwndContactList, SW_SHOWNA);
+ CLUI_ShowWindowMod(g_CLI.hwndContactList, SW_SHOWNA);
Sync(CLUIFrames_OnShowHide, SW_SHOW);
mutex_bShowHideCalledFromAnimation = 0;
g_CluiData.bCurrentAlpha = 1;
@@ -1436,7 +1436,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) if (IsWindowVisible(hwnd) && !g_hSmoothAnimationThread) {
mutex_bAnimationInProgress = 1;
if (g_CluiData.fSmoothAnimation)
- g_hSmoothAnimationThread = mir_forkthread(CLUI_SmoothAnimationThreadProc, pcli->hwndContactList);
+ g_hSmoothAnimationThread = mir_forkthread(CLUI_SmoothAnimationThreadProc, g_CLI.hwndContactList);
}
}
}
@@ -1450,7 +1450,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) g_CluiData.bCurrentAlpha = 1;
ske_UpdateWindowImage();
mutex_bShowHideCalledFromAnimation = 1;
- CLUI_ShowWindowMod(pcli->hwndContactList, 0);
+ CLUI_ShowWindowMod(g_CLI.hwndContactList, 0);
Sync(CLUIFrames_OnShowHide, 0);
mutex_bShowHideCalledFromAnimation = 0;
g_CluiData.bCurrentAlpha = 0;
@@ -1645,7 +1645,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) }
switch (msg) {
case WM_DISPLAYCHANGE:
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
return TRUE;
case WM_EXITSIZEMOVE:
@@ -1682,7 +1682,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) case WM_SIZE:
if (g_mutex_bSizing) return 0;
if (wParam != SIZE_MINIMIZED /* && IsWindowVisible(m_hWnd)*/) {
- if (pcli->hwndContactList == nullptr)
+ if (g_CLI.hwndContactList == nullptr)
return 0;
if (!g_CluiData.fLayered && !g_CluiData.fDisableSkinEngine)
@@ -1895,7 +1895,7 @@ LRESULT CLUI::OnCreateClc(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/) CreateCLC();
if (db_get_b(0, "CList", "ShowOnStart", SETTING_SHOWONSTART_DEFAULT))
cliShowHide(true);
- Clist_InitAutoRebuild(pcli->hwndContactTree);
+ Clist_InitAutoRebuild(g_CLI.hwndContactTree);
return FALSE;
}
@@ -1931,7 +1931,7 @@ LRESULT CLUI::OnParentNotify(UINT msg, WPARAM wParam, LPARAM lParam) LRESULT CLUI::OnSetFocus(UINT, WPARAM, LPARAM)
{
if (hFrameContactTree && (!CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLOATING, hFrameContactTree), 0)))
- SetFocus(pcli->hwndContactTree);
+ SetFocus(g_CLI.hwndContactTree);
return FALSE;
}
@@ -1959,14 +1959,14 @@ LRESULT CLUI::OnStatusBarUpdateTimer(UINT msg, WPARAM wParam, LPARAM lParam) PROTOTICKS *pt = &arTicks[wParam - TM_STATUSBARUPDATE];
- if (IsWindowVisible(pcli->hwndStatus))
- pcli->pfnInvalidateRect(pcli->hwndStatus, nullptr, 0);
+ if (IsWindowVisible(g_CLI.hwndStatus))
+ g_CLI.pfnInvalidateRect(g_CLI.hwndStatus, nullptr, 0);
if (pt->bGlobal)
Clist_TrayIconUpdateBase(g_szConnectingProto);
else
Clist_TrayIconUpdateBase(pt->szProto);
- pcli->pfnInvalidateRect(pcli->hwndStatus, nullptr, TRUE);
+ g_CLI.pfnInvalidateRect(g_CLI.hwndStatus, nullptr, TRUE);
return DefCluiWndProc(msg, wParam, lParam);
}
@@ -1984,7 +1984,7 @@ LRESULT CLUI::OnAutoAlphaTimer(UINT, WPARAM, LPARAM) inwnd = CLUI_CheckOwnedByClui(hwndPt);
if (!inwnd)
- inwnd = (GetCapture() == pcli->hwndContactList);
+ inwnd = (GetCapture() == g_CLI.hwndContactList);
}
if (inwnd != bTransparentFocus) {
@@ -2063,7 +2063,7 @@ LRESULT CLUI::OnTimer(UINT msg, WPARAM wParam, LPARAM lParam) return FALSE;
if (wParam >= TM_STATUSBARUPDATE && wParam <= TM_STATUSBARUPDATE + 64) {
- if (!pcli->hwndStatus)
+ if (!g_CLI.hwndStatus)
return FALSE;
return OnStatusBarUpdateTimer(msg, wParam, lParam);
}
@@ -2083,7 +2083,7 @@ LRESULT CLUI::OnTimer(UINT msg, WPARAM wParam, LPARAM lParam) LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam)
{
SetCursor(LoadCursor(nullptr, IDC_ARROW));
- SendMessage(pcli->hwndContactTree, WM_ACTIVATE, wParam, lParam);
+ SendMessage(g_CLI.hwndContactTree, WM_ACTIVATE, wParam, lParam);
if (db_get_b(0, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT)) {
if (wParam == WA_INACTIVE && ((HWND)lParam != m_hWnd) && GetParent((HWND)lParam) != m_hWnd) {
if (!g_bCalledFromShowHide) CLUI_UpdateTimer();
@@ -2165,7 +2165,7 @@ LRESULT CLUI::OnNcLButtonDblClk(UINT msg, WPARAM wParam, LPARAM lParam) POINT pt = UNPACK_POINT(lParam);
if (pt.x > rc.right - 16 && pt.x < rc.right)
- return pcli->pfnShowHide();
+ return g_CLI.pfnShowHide();
}
return DefCluiWndProc(msg, wParam, lParam);
}
@@ -2232,7 +2232,7 @@ LRESULT CLUI::OnSysCommand(UINT msg, WPARAM wParam, LPARAM lParam) LRESULT CLUI::OnKeyDown(UINT msg, WPARAM wParam, LPARAM lParam)
{
if (wParam == VK_F5)
- Clist_InitAutoRebuild(pcli->hwndContactTree);
+ Clist_InitAutoRebuild(g_CLI.hwndContactTree);
return DefCluiWndProc(msg, wParam, lParam);
}
@@ -2267,24 +2267,24 @@ LRESULT CLUI::OnListSizeChangeNotify(NMCLISTCONTROL * pnmc) rcWindow = rcSizingRect;
else
GetWindowRect(m_hWnd, &rcWindow);
- if (!g_CluiData.fAutoSize || pcli->hwndContactTree == nullptr || Clist_IsDocked())
+ if (!g_CluiData.fAutoSize || g_CLI.hwndContactTree == nullptr || Clist_IsDocked())
return FALSE;
maxHeight = db_get_b(0, "CLUI", "MaxSizeHeight", SETTING_MAXSIZEHEIGHT_DEFAULT);
minHeight = db_get_b(0, "CLUI", "MinSizeHeight", SETTING_MINSIZEHEIGHT_DEFAULT);
rcOld = rcWindow;
- GetWindowRect(pcli->hwndContactTree, &rcTree);
+ GetWindowRect(g_CLI.hwndContactTree, &rcTree);
- FRAMEWND *frm = FindFrameByItsHWND(pcli->hwndContactTree);
+ FRAMEWND *frm = FindFrameByItsHWND(g_CLI.hwndContactTree);
if (frm)
rcTree2 = frm->wndSize;
else
SetRect(&rcTree2, 0, 0, 0, 0);
- winstyle = GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE);
+ winstyle = GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE);
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
- HMONITOR hMon = MonitorFromWindow(pcli->hwndContactTree, MONITOR_DEFAULTTONEAREST);
+ HMONITOR hMon = MonitorFromWindow(g_CLI.hwndContactTree, MONITOR_DEFAULTTONEAREST);
MONITORINFO mi = { 0 };
if (GetMonitorInfo(hMon, &mi))
rcWorkArea = mi.rcWork;
@@ -2332,7 +2332,7 @@ LRESULT CLUI::OnListSizeChangeNotify(NMCLISTCONTROL * pnmc) LRESULT CLUI::OnClickNotify(NMCLISTCONTROL * pnmc)
{
DWORD hitFlags;
- HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(pnmc->pt.x, pnmc->pt.y));
+ HANDLE hItem = (HANDLE)SendMessage(g_CLI.hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(pnmc->pt.x, pnmc->pt.y));
if (hItem && !(hitFlags & CLCHT_NOWHERE))
return DefCluiWndProc(WM_NOTIFY, 0, (LPARAM)pnmc);
@@ -2343,13 +2343,13 @@ LRESULT CLUI::OnClickNotify(NMCLISTCONTROL * pnmc) POINT pt;
int res;
pt = pnmc->pt;
- ClientToScreen(pcli->hwndContactTree, &pt);
+ ClientToScreen(g_CLI.hwndContactTree, &pt);
res = PostMessage(m_hWnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
return res;
}
if (db_get_b(0, "CLUI", "DragToScroll", SETTING_DRAGTOSCROLL_DEFAULT) && !db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT))
- return ClcEnterDragToScroll(pcli->hwndContactTree, pnmc->pt.y);
+ return ClcEnterDragToScroll(g_CLI.hwndContactTree, pnmc->pt.y);
return 0;
}
@@ -2357,7 +2357,7 @@ LRESULT CLUI::OnClickNotify(NMCLISTCONTROL * pnmc) LRESULT CLUI::OnNotify(UINT msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR pnmhdr = (LPNMHDR)lParam;
- if (pnmhdr->hwndFrom != pcli->hwndContactTree)
+ if (pnmhdr->hwndFrom != g_CLI.hwndContactTree)
return DefCluiWndProc(msg, wParam, lParam);
switch (pnmhdr->code) {
@@ -2372,7 +2372,7 @@ LRESULT CLUI::OnContextMenu(UINT, WPARAM, LPARAM lParam) POINT pt = UNPACK_POINT(lParam);
// x/y might be -1 if it was generated by a kb click
RECT rc;
- GetWindowRect(pcli->hwndContactTree, &rc);
+ GetWindowRect(g_CLI.hwndContactTree, &rc);
if (pt.x == -1 && pt.y == -1) {
// all this is done in screen-coords!
GetCursorPos(&pt);
@@ -2414,7 +2414,7 @@ LRESULT CLUI::OnMeasureItem(UINT, WPARAM, LPARAM lParam) LRESULT CLUI::OnDrawItem(UINT, WPARAM, LPARAM lParam)
{
- ClcData *dat = (ClcData*)GetWindowLongPtr(pcli->hwndContactTree, 0);
+ ClcData *dat = (ClcData*)GetWindowLongPtr(g_CLI.hwndContactTree, 0);
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (!dat || dis->CtlType != ODT_MENU)
return 0;
@@ -2441,7 +2441,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM, LPARAM lParam) }
else {
nMirMenuState = dis->itemState;
- pcli->pfnInvalidateRect(m_hWnd, nullptr, 0);
+ g_CLI.pfnInvalidateRect(m_hWnd, nullptr, 0);
}
return TRUE;
}
@@ -2469,7 +2469,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM, LPARAM lParam) }
else {
nStatusMenuState = dis->itemState;
- pcli->pfnInvalidateRect(m_hWnd, nullptr, 0);
+ g_CLI.pfnInvalidateRect(m_hWnd, nullptr, 0);
}
return TRUE;
}
@@ -2528,12 +2528,12 @@ LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM) mutex_bAnimationInProgress = 0;
CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)hFrameContactTree, 0);
TRACE("CLUI.c: WM_DESTROY - hFrameContactTree removed\n");
- pcli->hwndContactTree = nullptr;
- pcli->hwndStatus = nullptr;
+ g_CLI.hwndContactTree = nullptr;
+ g_CLI.hwndStatus = nullptr;
if (g_CluiData.fAutoSize && !g_CluiData.fDocked) {
RECT r;
- GetWindowRect(pcli->hwndContactList, &r);
+ GetWindowRect(g_CLI.hwndContactList, &r);
if (db_get_b(0, "CLUI", "AutoSizeUpward", SETTING_AUTOSIZEUPWARD_DEFAULT))
r.top = r.bottom - CLUIFrames_GetTotalHeight();
else
@@ -2550,8 +2550,8 @@ LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM) delete m_pCLUI;
- pcli->hwndContactList = nullptr;
- pcli->hwndStatus = nullptr;
+ g_CLI.hwndContactList = nullptr;
+ g_CLI.hwndStatus = nullptr;
PostQuitMessage(0);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_cluiservices.cpp b/plugins/Clist_modern/src/modern_cluiservices.cpp index ef14742cc7..ee7f240b9a 100644 --- a/plugins/Clist_modern/src/modern_cluiservices.cpp +++ b/plugins/Clist_modern/src/modern_cluiservices.cpp @@ -34,7 +34,7 @@ int CLUIUnreadEmailCountChanged(WPARAM, LPARAM) void cliCluiProtocolStatusChanged(int, const char * proto)
{
- CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)pcli->hwndStatus, 0);
+ CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)g_CLI.hwndStatus, 0);
if (proto)
Clist_TrayIconUpdateBase(proto);
}
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index c56b9622f9..f917ed3470 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -148,19 +148,19 @@ int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2) INT_PTR ToggleHideOffline(WPARAM, LPARAM)
{
- return pcli->pfnSetHideOffline(-1);
+ return g_CLI.pfnSetHideOffline(-1);
}
INT_PTR SetUseGroups(WPARAM wParam, LPARAM)
{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_USEGROUPS);
+ int newVal = !(GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE)&CLS_USEGROUPS);
if (wParam != -1)
{
if (!newVal == (int)wParam) return 0;
newVal = wParam;
}
db_set_b(0, "CList", "UseGroups", (BYTE)newVal);
- SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index 4c259c58e1..890609c861 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -61,11 +61,11 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item) if (!RowHeights_Alloc(dat, item + 1))
return -1;
- if (!pcli->hwndContactTree)
+ if (!g_CLI.hwndContactTree)
return 0;
ClcCacheEntry *pdnce = contact->pce;
- if (dat->hWnd != pcli->hwndContactTree || !gl_RowRoot || contact->type == CLCIT_GROUP) {
+ if (dat->hWnd != g_CLI.hwndContactTree || !gl_RowRoot || contact->type == CLCIT_GROUP) {
int tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index 8c446b526c..77b9eeab7c 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -588,7 +588,7 @@ static int ModernSkinButtonErase(int l, int t, int r, int b) if (!g_pCachedWindow->hImageDC || !g_pCachedWindow->hBackDC) return 0; if (!(l || r || t || b)) { for (i = 0; i < ButtonsCount; i++) { - if (pcli->hwndContactList && Buttons[i].hwnd != nullptr) { + if (g_CLI.hwndContactList && Buttons[i].hwnd != nullptr) { //TODO: Erase button BitBlt(g_pCachedWindow->hImageDC, Buttons[i].bct->Left, Buttons[i].bct->Top, Buttons[i].bct->Right - Buttons[i].bct->Left, Buttons[i].bct->Bottom - Buttons[i].bct->Top, g_pCachedWindow->hBackDC, Buttons[i].bct->Left, Buttons[i].bct->Top, SRCCOPY); @@ -623,8 +623,8 @@ int ModernSkinButtonRedrawAll() if (!ModernSkinButtonModuleIsLoaded) return 0; g_mutex_bLockUpdating++; for (DWORD i = 0; i < ButtonsCount; i++) { - if (pcli->hwndContactList && Buttons[i].hwnd == nullptr) - Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct, pcli->hwndContactList); + if (g_CLI.hwndContactList && Buttons[i].hwnd == nullptr) + Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct, g_CLI.hwndContactList); ModernSkinButtonPaintWorker(Buttons[i].hwnd, nullptr); } g_mutex_bLockUpdating--; diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 2eea47fe2c..ae772c97eb 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -2708,7 +2708,7 @@ int ske_RedrawCompleteWindow() ske_DrawNonFramedObjects(TRUE, nullptr); CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, 0, 0); } - else RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME); + else RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME); return 0; } @@ -2727,7 +2727,7 @@ static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM) // bool NoCancelPost = false; bool IsAnyQueued = false; if (!g_CluiData.mutexOnEdgeSizing) - GetWindowRect(pcli->hwndContactList, &wnd); + GetWindowRect(g_CLI.hwndContactList, &wnd); else wnd = g_rcEdgeSizingRect; @@ -2815,7 +2815,7 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) else Sync(QueueAllFramesUpdating, true); if (!flag_bUpdateQueued || g_flag_bPostWasCanceled) - if (PostMessage(pcli->hwndContactList, UM_UPDATE, 0, 0)) { + if (PostMessage(g_CLI.hwndContactList, UM_UPDATE, 0, 0)) { flag_bUpdateQueued = 1; g_flag_bPostWasCanceled = 0; } @@ -2832,7 +2832,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) RECT ru = { 0 }; int w1, h1, x1, y1; - CLUI_SizingGetWindowRect(pcli->hwndContactList, &wnd); + CLUI_SizingGetWindowRect(g_CLI.hwndContactList, &wnd); rcPaint = Frame->wndSize; { int dx, dy, bx, by; @@ -2984,7 +2984,7 @@ int ske_BltBackImage(HWND destHWND, HDC destDC, RECT *BltClientRect) ptChildWnd.x = w.left; ptChildWnd.y = w.top; ClientToScreen(destHWND, &ptChildWnd); - ClientToScreen(pcli->hwndContactList, &ptMainWnd); + ClientToScreen(g_CLI.hwndContactList, &ptMainWnd); //TODO if main not relative to client area return BitBlt(destDC, w.left, w.top, (w.right - w.left), (w.bottom - w.top), g_pCachedWindow->hBackDC, (ptChildWnd.x - ptMainWnd.x), (ptChildWnd.y - ptMainWnd.y), SRCCOPY); @@ -2995,7 +2995,7 @@ int ske_ReCreateBackImage(BOOL Erase, RECT *w) RECT wnd = { 0 }; BOOL IsNewCache = 0; if (g_CluiData.fDisableSkinEngine) return 0; - GetClientRect(pcli->hwndContactList, &wnd); + GetClientRect(g_CLI.hwndContactList, &wnd); if (w) wnd = *w; //-- Check cached. if (g_pCachedWindow == nullptr) { @@ -3052,7 +3052,7 @@ int ske_DrawNonFramedObjects(BOOL Erase, RECT *r) { RECT w, wnd; if (r) w = *r; - else CLUI_SizingGetWindowRect(pcli->hwndContactList, &w); + else CLUI_SizingGetWindowRect(g_CLI.hwndContactList, &w); if (!g_CluiData.fLayered) return ske_ReCreateBackImage(FALSE, nullptr); if (g_pCachedWindow == nullptr) return ske_ValidateFrameImageProc(&w); @@ -3090,7 +3090,7 @@ int ske_ValidateFrameImageProc(RECT *r) BOOL IsNewCache = 0; BOOL IsForceAllPainting = 0; if (r) wnd = *r; - else GetWindowRect(pcli->hwndContactList, &wnd); + else GetWindowRect(g_CLI.hwndContactList, &wnd); if (wnd.right - wnd.left == 0 || wnd.bottom - wnd.top == 0) return 0; @@ -3163,7 +3163,7 @@ int ske_UpdateWindowImage() if (g_CluiData.fLayered) { RECT r; - GetWindowRect(pcli->hwndContactList, &r); + GetWindowRect(g_CLI.hwndContactList, &r); return ske_UpdateWindowImageRect(&r); } else ske_ReCreateBackImage(FALSE, nullptr); @@ -3191,7 +3191,7 @@ int ske_UpdateWindowImageRect(RECT *r) // Up void ske_ApplyTranslucency() { int IsTransparancy; - HWND hwnd = pcli->hwndContactList; + HWND hwnd = g_CLI.hwndContactList; BOOL layered = (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) ? TRUE : FALSE; IsTransparancy = g_CluiData.fSmoothAnimation || g_bTransparentFlag; @@ -3215,7 +3215,7 @@ int ske_JustUpdateWindowImage() ske_ApplyTranslucency(); return 0; } - GetWindowRect(pcli->hwndContactList, &r); + GetWindowRect(g_CLI.hwndContactList, &r); return ske_JustUpdateWindowImageRect(&r); } @@ -3226,7 +3226,7 @@ int ske_JustUpdateWindowImageRect(RECT *rty) ske_ApplyTranslucency(); return 0; } - if (!pcli->hwndContactList) + if (!g_CLI.hwndContactList) return 0; RECT wnd = *rty; @@ -3236,16 +3236,16 @@ int ske_JustUpdateWindowImageRect(RECT *rty) dest.y = rect.top; SIZE sz = { rect.right - rect.left, rect.bottom - rect.top }; if (g_CluiData.fLayered) { - if (!(GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE)&WS_EX_LAYERED)) - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED); + if (!(GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE)&WS_EX_LAYERED)) + SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED); Sync(SetAlpha, g_CluiData.bCurrentAlpha); BLENDFUNCTION bf = { AC_SRC_OVER, 0, g_CluiData.bCurrentAlpha, AC_SRC_ALPHA }; - UpdateLayeredWindow(pcli->hwndContactList, g_pCachedWindow->hScreenDC, &dest, &sz, g_pCachedWindow->hImageDC, &src, RGB(1, 1, 1), &bf, ULW_ALPHA); + UpdateLayeredWindow(g_CLI.hwndContactList, g_pCachedWindow->hScreenDC, &dest, &sz, g_pCachedWindow->hImageDC, &src, RGB(1, 1, 1), &bf, ULW_ALPHA); g_CluiData.fAeroGlass = false; CLUI_UpdateAeroGlass(); } - else InvalidateRect(pcli->hwndContactList, nullptr, TRUE); + else InvalidateRect(g_CLI.hwndContactList, nullptr, TRUE); return 0; } diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 785408f3a6..2d8c4e6e61 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -145,8 +145,8 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara Sync(CLUIFrames_OnClistResize_mod, 0, 0); RECT rc = {}; - GetWindowRect(pcli->hwndContactList, &rc); - Sync(CLUIFrames_OnMoving, pcli->hwndContactList, &rc); + GetWindowRect(g_CLI.hwndContactList, &rc); + Sync(CLUIFrames_OnMoving, g_CLI.hwndContactList, &rc); if (g_hCLUIOptionsWnd) { SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0, db_get_b(0, "CLUI", "LeftClientMargin", SETTING_LEFTCLIENTMARIGN_DEFAULT)); @@ -226,7 +226,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0); NotifyEventHooks(g_CluiData.hEventBkgrChanged, 0, 0); Clist_Broadcast(INTM_INVALIDATE, 0, 0); - RedrawWindow(GetParent(pcli->hwndContactTree), nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN); + RedrawWindow(GetParent(g_CLI.hwndContactTree), nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN); } break; @@ -476,7 +476,7 @@ INT_PTR SvcApplySkin(WPARAM, LPARAM lParam) ske_RedrawCompleteWindow(); Sync(CLUIFrames_OnClistResize_mod, 0, 0); - HWND hwnd = pcli->hwndContactList; + HWND hwnd = g_CLI.hwndContactList; RECT rc = { 0 }; GetWindowRect(hwnd, &rc); Sync(CLUIFrames_OnMoving, hwnd, &rc); @@ -484,7 +484,7 @@ INT_PTR SvcApplySkin(WPARAM, LPARAM lParam) g_mutex_bChangingMode = TRUE; CLUI_UpdateLayeredMode(); CLUI_ChangeWindowMode(); - SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged + SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged CLUI_ReloadCLUIOptions(); cliShowHide(true); g_mutex_bChangingMode = FALSE; diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp index 90c2ec94ff..1fb12dc80e 100644 --- a/plugins/Clist_modern/src/modern_skinselector.cpp +++ b/plugins/Clist_modern/src/modern_skinselector.cpp @@ -469,8 +469,8 @@ int RegisterButtonByParce(char * ObjectName, char * Params) + ((TL[3] == 'C') ? SBF_ALIGN_BR_VCENTER : 0)
+ ((TL[4] == 'I') ? SBF_CALL_ON_PRESS : 0);
if (a)
- return ModernSkinButton_AddButton(pcli->hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateW(Hint), Section, Type, MinWidth, MinHeight);
- return ModernSkinButton_AddButton(pcli->hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateW(Hint), nullptr, nullptr, MinWidth, MinHeight);
+ return ModernSkinButton_AddButton(g_CLI.hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateW(Hint), Section, Type, MinWidth, MinHeight);
+ return ModernSkinButton_AddButton(g_CLI.hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateW(Hint), nullptr, nullptr, MinWidth, MinHeight);
}
//Parse DB string and add object
diff --git a/plugins/Clist_modern/src/modern_static_cluiframes_service.h b/plugins/Clist_modern/src/modern_static_cluiframes_service.h index da8f5b8b89..2927dbf7cc 100644 --- a/plugins/Clist_modern/src/modern_static_cluiframes_service.h +++ b/plugins/Clist_modern/src/modern_static_cluiframes_service.h @@ -96,112 +96,112 @@ BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND, UINT msg, WPARAM wParam, LPARAM static INT_PTR CLUIFrames_SetFramePaintProc(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SETFRAMEPAINTPROC, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SETFRAMEPAINTPROC, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_AddFrame(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_ADDFRAME, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_ADDFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_RemoveFrame(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_REMOVEFRAME, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_REMOVEFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_SetFrameOptions(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SETFRAMEOPTIONS, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SETFRAMEOPTIONS, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_GetFrameOptions(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_GETFRAMEOPTIONS, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_GETFRAMEOPTIONS, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_UpdateFrame(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_UPDATEFRAME, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_UPDATEFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_ShowHideFrameTitle(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SHOWHIDEFRAMETITLE, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SHOWHIDEFRAMETITLE, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_ShowTitles(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SHOWTITLES, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SHOWTITLES, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_HideTitles(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_HIDETITLES, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_HIDETITLES, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_ShowHideFrame(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SHOWHIDEFRAME, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SHOWHIDEFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_ShowAllFrames(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SHOWALL, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SHOWALL, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_LockFrame(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_LOCKFRAME, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_LOCKFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_CollapseFrame(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_COLLAPSEFRAME, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_COLLAPSEFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_SetFrameBorder(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SETFRAMEBORDER, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SETFRAMEBORDER, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_SetFrameAlign(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SETFRAMEALIGN, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SETFRAMEALIGN, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_MoveFrame(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_MOVEFRAME, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_MOVEFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_MoveFrameUp(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_MOVEFRAMEUP, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_MOVEFRAMEUP, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_MoveFrameDown(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_MOVEFRAMEDOWN, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_MOVEFRAMEDOWN, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_AlignFrameTop(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_ALIGNFRAMETOP, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_ALIGNFRAMETOP, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_AlignFrameClient(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_ALIGNFRAMEBOTTOM, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_ALIGNFRAMEBOTTOM, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_AlignFrameBottom(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_ALIGNFRAMECLIENT, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_ALIGNFRAMECLIENT, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_SetFrameFloat(WPARAM wParam, LPARAM lParam)
{
- return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SETFRAMEFLOAT, wParam, lParam) : 0;
+ return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SETFRAMEFLOAT, wParam, lParam) : 0;
}
static void CreateCluiFramesServices()
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 1cf10dc67a..8c710bb358 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -114,7 +114,7 @@ int LoadStatusBarData() g_StatusBarData.backgroundBmpUse = db_get_w(0, "StatusBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
return 1;
}
@@ -135,7 +135,7 @@ int NewStatusPaintCallbackProc(HWND hWnd, HDC hDC, RECT *, HRGN, DWORD, void *) int ModernDrawStatusBar(HWND hwnd, HDC hDC)
{
if (hwnd == (HWND)-1) return 0;
- if (GetParent(hwnd) == pcli->hwndContactList)
+ if (GetParent(hwnd) == g_CLI.hwndContactList)
return ModernDrawStatusBarWorker(hwnd, hDC);
cliInvalidateRect(hwnd, nullptr, FALSE);
@@ -586,7 +586,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa break;
case WM_SIZE:
- if (!g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList)
+ if (!g_CluiData.fLayered || GetParent(hwnd) != g_CLI.hwndContactList)
InvalidateRect(hwnd, nullptr, FALSE);
return DefWindowProc(hwnd, msg, wParam, lParam);
@@ -594,9 +594,9 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa return 1;
case WM_PAINT:
- if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered)
+ if (GetParent(hwnd) == g_CLI.hwndContactList && g_CluiData.fLayered)
CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)hwnd, 0);
- else if (GetParent(hwnd) == pcli->hwndContactList && !g_CluiData.fLayered) {
+ else if (GetParent(hwnd) == g_CLI.hwndContactList && !g_CluiData.fLayered) {
RECT rc = { 0 };
GetClientRect(hwnd, &rc);
rc.right++;
@@ -837,7 +837,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa ClientToScreen(hwnd, &pt);
HWND parent = GetParent(hwnd);
- if (parent != pcli->hwndContactList) parent = GetParent(parent);
+ if (parent != g_CLI.hwndContactList) parent = GetParent(parent);
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, parent, nullptr);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp index 9e6df49d3b..c7177719cb 100644 --- a/plugins/Clist_modern/src/modern_tbbutton.cpp +++ b/plugins/Clist_modern/src/modern_tbbutton.cpp @@ -433,7 +433,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam else
bct->hIcon = nullptr;
InvalidateRect(hwndDlg, nullptr, TRUE);
- pcli->pfnInvalidateRect(GetParent(GetParent(hwndDlg)), nullptr, TRUE);
+ g_CLI.pfnInvalidateRect(GetParent(GetParent(hwndDlg)), nullptr, TRUE);
return 1;
case MBM_UPDATETRANSPARENTFLAG:
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 6df8c36016..be5af7037b 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -145,13 +145,13 @@ static int ehhToolBarBackgroundSettingsChanged(WPARAM, LPARAM) tbdat.mtb_useWinColors = db_get_b(0, "ToolBar", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
tbdat.mtb_backgroundBmpUse = db_get_b(0, "ToolBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- PostMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
return 0;
}
static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT *rect, ModernToolbarCtrl* pMTBInfo)
{
- BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != g_CLI.hwndContactList);
if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat) {
HBRUSH hbr;
@@ -190,7 +190,7 @@ static void sttDrawNonLayeredSkinedBar(HWND hwnd, HDC hdc) HDC hdc2 = CreateCompatibleDC(hdc);
HBITMAP hbmp = ske_CreateDIB32(rc.right, rc.bottom);
HBITMAP hbmpo = (HBITMAP)SelectObject(hdc2, hbmp);
- if (GetParent(hwnd) != pcli->hwndContactList) {
+ if (GetParent(hwnd) != g_CLI.hwndContactList) {
HBRUSH br = GetSysColorBrush(COLOR_3DFACE);
FillRect(hdc2, &rc, br);
}
@@ -218,7 +218,7 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA case WM_PAINT:
{
PAINTSTRUCT ps;
- BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != g_CLI.hwndContactList);
if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat) {
BeginPaint(hwnd, &ps);
if ((!g_CluiData.fLayered || bFloat) && !g_CluiData.fDisableSkinEngine)
@@ -232,7 +232,7 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == BUTTONNEEDREDRAW)
- pcli->pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
return 0;
case MTBM_LAYEREDPAINT:
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 96f3dce17f..2f3567f6f8 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -991,10 +991,10 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_NCPAINT:
case WM_PAINT:
- if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered)
+ if (GetParent(hwnd) == g_CLI.hwndContactList && g_CluiData.fLayered)
ValidateRect(hwnd, nullptr);
- else if (GetParent(hwnd) != pcli->hwndContactList || !g_CluiData.fLayered) {
+ else if (GetParent(hwnd) != g_CLI.hwndContactList || !g_CluiData.fLayered) {
RECT rc = { 0 };
GetClientRect(hwnd, &rc);
rc.right++;
@@ -1007,7 +1007,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (g_CluiData.fDisableSkinEngine)
sttDrawViewModeBackground(hwnd, hdc2, &rc);
else {
- if (GetParent(hwnd) != pcli->hwndContactList) {
+ if (GetParent(hwnd) != g_CLI.hwndContactList) {
HBRUSH br = GetSysColorBrush(COLOR_3DFACE);
FillRect(hdc2, &rc, br);
}
@@ -1041,13 +1041,13 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == BUTTONNEEDREDRAW)
- pcli->pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
return 0;
case WM_TIMER:
if (wParam == TIMERID_VIEWMODEEXPIRE) {
RECT rcCLUI;
- GetWindowRect(pcli->hwndContactList, &rcCLUI);
+ GetWindowRect(g_CLI.hwndContactList, &rcCLUI);
POINT pt;
GetCursorPos(&pt);
@@ -1131,7 +1131,7 @@ static view_mode_t view_mode; static BOOL sttDrawViewModeBackground(HWND hwnd, HDC hdc, RECT *rect)
{
- BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != g_CLI.hwndContactList);
if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat) {
RECT rc;
if (rect)
@@ -1166,7 +1166,7 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM, LPARAM) view_mode.useWinColors = db_get_b(0, "ViewMode", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
view_mode.backgroundBmpUse = db_get_w(0, "ViewMode", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- PostMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
return 0;
}
@@ -1196,7 +1196,7 @@ void CreateViewModeFrame() frame.TBtname = TranslateT("View modes");
frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_NO_SUBCONTAINER | F_UNICODE;
frame.align = alBottom;
- frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", _A2W(CLVM_MODULE), WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr);
+ frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", _A2W(CLVM_MODULE), WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, g_CLI.hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr);
g_hwndViewModeFrame = frame.hWnd;
hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
@@ -1238,7 +1238,7 @@ void ApplyViewMode(const char *Name, bool onlySelector) KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
SetDlgItemText(g_hwndViewModeFrame, IDC_SELECTMODE, TranslateT("All contacts"));
if (g_CluiData.boldHideOffline != (BYTE)-1)
- pcli->pfnSetHideOffline(g_CluiData.boldHideOffline);
+ g_CLI.pfnSetHideOffline(g_CluiData.boldHideOffline);
if (g_CluiData.bOldUseGroups != (BYTE)-1)
CallService(MS_CLIST_SETUSEGROUPS, (WPARAM)g_CluiData.bOldUseGroups, 0);
g_CluiData.boldHideOffline = (BYTE)-1;
@@ -1326,10 +1326,10 @@ void ApplyViewMode(const char *Name, bool onlySelector) if (g_CluiData.boldHideOffline == (BYTE)-1)
g_CluiData.boldHideOffline = db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
- pcli->pfnSetHideOffline(false);
+ g_CLI.pfnSetHideOffline(false);
}
else if (g_CluiData.boldHideOffline != (BYTE)-1) {
- pcli->pfnSetHideOffline(g_CluiData.boldHideOffline);
+ g_CLI.pfnSetHideOffline(g_CluiData.boldHideOffline);
g_CluiData.boldHideOffline = -1;
}
@@ -1355,7 +1355,7 @@ void ApplyViewMode(const char *Name, bool onlySelector) SetWindowText(hwndSelector, ptrW(mir_utf8decodeW((Name[0] == 13) ? Name + 1 : Name)));
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
- cliInvalidateRect(pcli->hwndStatus, nullptr, FALSE);
+ cliInvalidateRect(g_CLI.hwndStatus, nullptr, FALSE);
}
static int SkinSetViewMode(WPARAM wParam /*char * name*/, LPARAM lParam /*int index*/)
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index e49c935939..ea251eda52 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -190,7 +190,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) pt.x = rcParent.left;
pt.y = rcParent.top;
- ScreenToClient(pcli->hwndContactList, &pt);
+ ScreenToClient(g_CLI.hwndContactList, &pt);
BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
if (imgItem)
@@ -212,7 +212,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) pt.x = rcParent.left;
pt.y = rcParent.top;
- ScreenToClient(pcli->hwndContactList, &pt);
+ ScreenToClient(g_CLI.hwndContactList, &pt);
if (ctl->bIsTTButton)
item_id = ctl->stateId == PBS_HOT ? ID_EXTBKTBBUTTONMOUSEOVER : (ctl->stateId == PBS_PRESSED ? ID_EXTBKTBBUTTONSPRESSED : ID_EXTBKTBBUTTONSNPRESSED);
@@ -281,7 +281,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) GetWindowRect(ctl->hwnd, &rcParent);
pt.x = rcParent.left;
pt.y = rcParent.top;
- ScreenToClient(pcli->hwndContactList, &pt);
+ ScreenToClient(g_CLI.hwndContactList, &pt);
BitBlt(hdcMem, 0, 0, rcClient.right, rcClient.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
if (ctl->bIsTTButton) {
@@ -466,7 +466,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR break;
case WM_NCHITTEST:
- switch (SendMessage(pcli->hwndContactList, WM_NCHITTEST, wParam, lParam)) {
+ switch (SendMessage(g_CLI.hwndContactList, WM_NCHITTEST, wParam, lParam)) {
case HTLEFT:
case HTRIGHT:
case HTBOTTOM:
@@ -536,7 +536,7 @@ static LRESULT CALLBACK ToolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA int iCtrlId = ClcGetButtonId((HWND)lParam);
// standard buttons are processed in the main window
if (iCtrlId) {
- SendMessage(pcli->hwndContactList, msg, MAKELONG(iCtrlId, BN_CLICKED), lParam);
+ SendMessage(g_CLI.hwndContactList, msg, MAKELONG(iCtrlId, BN_CLICKED), lParam);
return 0;
}
}
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 8cab4be93d..74a71b83a0 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -109,7 +109,7 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) if (hContact) {
if (!__strcmp(cws->szModule, "CList")) {
if (!__strcmp(cws->szSetting, "StatusMsg"))
- SendMessage(pcli->hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
+ SendMessage(g_CLI.hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
}
else if (!__strcmp(cws->szModule, "UserInfo")) {
if (!__strcmp(cws->szSetting, "ANSIcodepage"))
@@ -136,14 +136,14 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) if (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
return 0;
- SendMessage(pcli->hwndContactTree, INTM_STATUSCHANGED, hContact, lParam);
+ SendMessage(g_CLI.hwndContactTree, INTM_STATUSCHANGED, hContact, lParam);
return 0;
}
if (strstr("YMsg|StatusDescr|XStatusMsg", cws->szSetting))
- SendMessage(pcli->hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
+ SendMessage(g_CLI.hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
else if (strstr(cws->szSetting, "XStatus"))
- SendMessage(pcli->hwndContactTree, INTM_XSTATUSCHANGED, hContact, lParam);
+ SendMessage(g_CLI.hwndContactTree, INTM_XSTATUSCHANGED, hContact, lParam);
else if (!__strcmp(cws->szSetting, "Timezone") || !__strcmp(cws->szSetting, "TzName"))
ReloadExtraInfo(hContact);
@@ -259,7 +259,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L Clist_EndRename(dat, 1);
KillTimer(hwnd, TIMERID_INFOTIP);
KillTimer(hwnd, TIMERID_RENAME);
- pcli->pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_NCCALCSIZE:
@@ -283,7 +283,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
Clist_DeleteItemFromTree(hwnd, wParam);
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(wParam, nullptr, dat)) {
- pcli->pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
@@ -324,9 +324,9 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (!Clist_FindItem(hwnd, dat, hContact, &contact, &group, nullptr)) {
if (shouldShow && db_is_contact(wParam)) {
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
- pcli->pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
+ g_CLI.pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
recalcScrollBar = 1;
Clist_FindItem(hwnd, dat, hContact, &contact, nullptr, nullptr);
if (contact) {
@@ -341,7 +341,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (contact->iImage == (WORD)lParam)
break;
if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline || cfg::dat.bFilterEffective)) { // CLVM changed
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
Clist_RemoveItemFromGroup(hwnd, group, contact, 0);
contactRemoved = TRUE;
@@ -358,7 +358,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (hSelItem) {
ClcGroup *selgroup;
if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr))
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
}
@@ -366,7 +366,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L PostMessage(hwnd, INTM_SORTCLC, 0, recalcScrollBar);
PostMessage(hwnd, INTM_INVALIDATE, 0, contactRemoved ? 0 : wParam);
if (recalcScrollBar)
- pcli->pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
}
return DefWindowProc(hwnd, msg, wParam, lParam);
@@ -489,7 +489,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L break;
contact->proto = GetContactProto(wParam);
- pcli->pfnInvalidateDisplayNameCacheEntry(wParam);
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(wParam);
mir_wstrncpy(contact->szText, Clist_GetContactDisplayName(wParam), _countof(contact->szText));
RTL_DetectAndSet(contact, 0);
@@ -512,11 +512,11 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_SORTCLC:
if (dat->bNeedsResort) {
- pcli->pfnSortCLC(hwnd, dat, TRUE);
+ g_CLI.pfnSortCLC(hwnd, dat, TRUE);
dat->bNeedsResort = false;
}
if (lParam)
- pcli->pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_IDLECHANGED:
@@ -643,7 +643,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L {
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
if (pt.x == -1 && pt.y == -1) {
- dat->selection = pcli->pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
+ dat->selection = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
if (dat->selection != -1)
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
pt.x = dat->iconXSpace + 15;
@@ -664,7 +664,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (contact->type == CLCIT_GROUP) {
hMenu = Menu_BuildSubGroupMenu(contact->group);
ClientToScreen(hwnd, &pt);
- TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
CheckMenuItem(hMenu, POPUP_GROUPHIDEOFFLINE, contact->group->hideOffline ? MF_CHECKED : MF_UNCHECKED);
DestroyMenu(hMenu);
return 0;
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 906568a206..24c4429dee 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -246,11 +246,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) void ReloadExtraInfo(MCONTACT hContact)
{
- if (hContact && pcli->hwndContactTree) {
+ if (hContact && g_CLI.hwndContactTree) {
TExtraCache *p = cfg::getCache(hContact, nullptr);
if (p) {
TZ_LoadTimeZone(hContact, p);
- InvalidateRect(pcli->hwndContactTree, nullptr, FALSE);
+ InvalidateRect(g_CLI.hwndContactTree, nullptr, FALSE);
}
}
}
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 01a94b2df5..ed44db113f 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -455,9 +455,9 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam cfg::dat.bShowLocalTimeSelective = IsDlgButtonChecked(hwndDlg, IDC_SHOWLOCALTIMEONLYWHENDIFFERENT) ? 1 : 0;
db_set_b(NULL, "CLC", "SelectiveLocalTime", (BYTE)cfg::dat.bShowLocalTimeSelective);
- KillTimer(pcli->hwndContactTree, TIMERID_REFRESH);
+ KillTimer(g_CLI.hwndContactTree, TIMERID_REFRESH);
if (cfg::dat.bShowLocalTime)
- SetTimer(pcli->hwndContactTree, TIMERID_REFRESH, 65000, nullptr);
+ SetTimer(g_CLI.hwndContactTree, TIMERID_REFRESH, 65000, nullptr);
cfg::dat.dualRowMode = (BYTE)SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_GETCURSEL, 0, 0);
if (cfg::dat.dualRowMode == CB_ERR)
@@ -685,7 +685,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam Clist_ClcOptionsChanged();
CoolSB_SetupScrollBar();
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
opt_clc_main_changed = 0;
return TRUE;
}
@@ -810,7 +810,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, db_set_b(NULL, "CLUI", "UseBkSkin", (BYTE)cfg::dat.bWallpaperMode);
Clist_ClcOptionsChanged();
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
opt_clc_bkg_changed = 0;
return TRUE;
}
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 0e4b9795cc..2872e69e22 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -229,7 +229,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c }
int hit = RowHeight::hitTest(dat, dat->yScroll + testy);
if (hit != -1)
- hit = pcli->pfnGetRowByIndex(dat, hit, &hitcontact, &hitgroup);
+ hit = g_CLI.pfnGetRowByIndex(dat, hit, &hitcontact, &hitgroup);
if (hit == -1) {
if (flags)
@@ -409,7 +409,7 @@ void RecalcScrollBar(HWND hwnd, struct ClcData *dat) si.cbSize = sizeof(si);
si.fMask = SIF_ALL;
si.nMin = 0;
- si.nMax = pcli->pfnGetRowTotalHeight(dat) - 1;
+ si.nMax = g_CLI.pfnGetRowTotalHeight(dat) - 1;
si.nPage = clRect.bottom;
si.nPos = dat->yScroll;
@@ -454,11 +454,11 @@ void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newStat group->expanded = newState != 0;
}
InvalidateRect(hwnd, nullptr, FALSE);
- contentCount = pcli->pfnGetGroupContentsCount(group, 1);
+ contentCount = g_CLI.pfnGetGroupContentsCount(group, 1);
- groupy = pcli->pfnGetRowsPriorTo(&dat->list, group, -1);
+ groupy = g_CLI.pfnGetRowsPriorTo(&dat->list, group, -1);
if (dat->selection > groupy && dat->selection < groupy + contentCount) dat->selection = groupy;
- pcli->pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
GetClientRect(hwnd, &clRect);
newy = dat->yScroll;
@@ -518,7 +518,7 @@ void BeginRenameSelection(HWND hwnd, struct ClcData *dat) KillTimer(hwnd, TIMERID_RENAME);
ReleaseCapture();
dat->iHotTrack = -1;
- dat->selection = pcli->pfnGetRowByIndex(dat, dat->selection, &contact, &group);
+ dat->selection = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, &group);
if (dat->selection == -1)
return;
if (contact->type != CLCIT_CONTACT && contact->type != CLCIT_GROUP)
@@ -608,11 +608,11 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst) cfg::dat.bmpBackground = dat->hBmpBackground;
if (cfg::dat.bmpBackground) {
- HDC hdcThis = GetDC(pcli->hwndContactList);
+ HDC hdcThis = GetDC(g_CLI.hwndContactList);
GetObject(cfg::dat.bmpBackground, sizeof(cfg::dat.bminfoBg), &(cfg::dat.bminfoBg));
cfg::dat.hdcPic = CreateCompatibleDC(hdcThis);
cfg::dat.hbmPicOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcPic, cfg::dat.bmpBackground));
- ReleaseDC(pcli->hwndContactList, hdcThis);
+ ReleaseDC(g_CLI.hwndContactList, hdcThis);
}
}
@@ -631,11 +631,11 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst) cfg::dat.bmpBackground = dat->hBmpBackground;
if (cfg::dat.bmpBackground) {
- HDC hdcThis = GetDC(pcli->hwndContactList);
+ HDC hdcThis = GetDC(g_CLI.hwndContactList);
GetObject(cfg::dat.bmpBackground, sizeof(cfg::dat.bminfoBg), &(cfg::dat.bminfoBg));
cfg::dat.hdcPic = CreateCompatibleDC(hdcThis);
cfg::dat.hbmPicOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcPic, cfg::dat.bmpBackground));
- ReleaseDC(pcli->hwndContactList, hdcThis);
+ ReleaseDC(g_CLI.hwndContactList, hdcThis);
}
}
}
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index d697cb6728..9dce2f7897 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -66,7 +66,7 @@ void HideShowNotifyFrame() static CLISTEVENT* MyGetEvent(int iSelection)
{
- for (auto &p : *pcli->events)
+ for (auto &p : *g_CLI.events)
if (p->menuId == iSelection)
return p;
@@ -161,7 +161,7 @@ LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa // event we're interested in was removed by the service (nasty one...)
cle1 = MyGetEvent(iSelection);
if (cle1 != nullptr)
- pcli->pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ g_CLI.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
}
}
}
@@ -289,14 +289,14 @@ CListEvent* AddEvent(CLISTEVENT *cle) }
if (cfg::dat.dwFlags & CLUI_STICKYEVENTS) {
- HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_FINDCONTACT, (WPARAM)p->hContact, 0);
+ HANDLE hItem = (HANDLE)SendMessage(g_CLI.hwndContactTree, CLM_FINDCONTACT, (WPARAM)p->hContact, 0);
if (hItem) {
- SendMessage(pcli->hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 1);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 1);
Clist_Broadcast(INTM_PROTOCHANGED, (WPARAM)p->hContact, 0);
}
}
- if (pcli->events->getCount() > 0) {
+ if (g_CLI.events->getCount() > 0) {
cfg::dat.bEventAreaEnabled = TRUE;
if (cfg::dat.notifyActive == 0) {
cfg::dat.notifyActive = 1;
@@ -316,7 +316,7 @@ int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) {
// Find the event that should be removed
CListEvent *e = nullptr;
- for (auto &it : *pcli->events)
+ for (auto &it : *g_CLI.events)
if (it->hContact == hContact && it->hDbEvent == hDbEvent) {
e = it;
break;
@@ -343,7 +343,7 @@ int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) int res = coreCli.pfnRemoveEvent(hContact, hDbEvent);
- if (pcli->events->getCount() == 0) {
+ if (g_CLI.events->getCount() == 0) {
cfg::dat.bEventAreaEnabled = FALSE;
if (cfg::dat.dwFlags & CLUI_FRAME_AUTOHIDENOTIFY) {
cfg::dat.notifyActive = 0;
@@ -352,9 +352,9 @@ int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) }
// clear "sticky" (sort) status
- HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_FINDCONTACT, hContact, 0);
+ HANDLE hItem = (HANDLE)SendMessage(g_CLI.hwndContactTree, CLM_FINDCONTACT, hContact, 0);
if (hItem) {
- SendMessage(pcli->hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 0);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 0);
Clist_Broadcast(INTM_PROTOCHANGED, hContact, 0);
}
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 6d49d47549..c934abf440 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -37,7 +37,7 @@ INT_PTR CloseAction(WPARAM, LPARAM) cfg::shutDown = 1;
if (Miranda_OkToExit()) {
- DestroyWindow(pcli->hwndContactList);
+ DestroyWindow(g_CLI.hwndContactList);
PostQuitMessage(0);
Sleep(0);
}
@@ -91,7 +91,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("When needed by status message"));
if (cfg::clcdat) {
- Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
+ Clist_FindItem(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
if (contact && contact->type != CLCIT_CONTACT) {
DestroyWindow(hWnd);
return FALSE;
@@ -147,7 +147,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_IGN_PRIORITY:
- SendMessage(pcli->hwndContactTree, CLM_TOGGLEPRIORITYCONTACT, hContact, 0);
+ SendMessage(g_CLI.hwndContactTree, CLM_TOGGLEPRIORITYCONTACT, hContact, 0);
return 0;
case IDC_IGN_ALL:
@@ -198,7 +198,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0), dwXMask = 0;
LRESULT checked = 0;
- Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
+ Clist_FindItem(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
if (iSel != CB_ERR) {
dwFlags &= ~(ECF_FORCEAVATAR | ECF_HIDEAVATAR);
@@ -285,7 +285,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case WM_USER + 120: // set visibility status
{
ClcContact *contact = nullptr;
- if (Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
if (contact) {
WORD wApparentMode = db_get_w(contact->hContact, contact->proto, "ApparentMode", 0);
@@ -300,7 +300,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA {
ClcContact *contact = nullptr;
- if (Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
if (contact) {
WORD wApparentMode = 0;
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp index 03933ec48c..409a88fbfc 100644 --- a/plugins/Clist_nicer/src/clistmod.cpp +++ b/plugins/Clist_nicer/src/clistmod.cpp @@ -35,7 +35,7 @@ extern ImageItem *g_CLUIImageItem; static INT_PTR GetStatusMode(WPARAM, LPARAM)
{
- return(g_maxStatus == ID_STATUS_OFFLINE ? pcli->currentDesiredStatusMode : g_maxStatus);
+ return(g_maxStatus == ID_STATUS_OFFLINE ? g_CLI.currentDesiredStatusMode : g_maxStatus);
}
int IconFromStatusMode(const char *szProto, int status, MCONTACT hContact)
@@ -166,10 +166,10 @@ int ShowHide() {
BOOL bShow = FALSE;
- int iVisibleState = pcli->pfnGetWindowVisibleState(pcli->hwndContactList, 0, 0);
+ int iVisibleState = g_CLI.pfnGetWindowVisibleState(g_CLI.hwndContactList, 0, 0);
- if (IsIconic(pcli->hwndContactList)) {
- SendMessage(pcli->hwndContactList, WM_SYSCOMMAND, SC_RESTORE, 0);
+ if (IsIconic(g_CLI.hwndContactList)) {
+ SendMessage(g_CLI.hwndContactList, WM_SYSCOMMAND, SC_RESTORE, 0);
bShow = TRUE;
}
else {
@@ -193,22 +193,22 @@ int ShowHide() if (bShow == TRUE) {
RECT rcWindow;
- SetWindowPos(pcli->hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
+ SetWindowPos(g_CLI.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
if (!db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
- SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
- SetForegroundWindow(pcli->hwndContactList);
- //SetActiveWindow(pcli->hwndContactList);
- ShowWindow(pcli->hwndContactList, SW_SHOW);
+ SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
+ SetForegroundWindow(g_CLI.hwndContactList);
+ //SetActiveWindow(g_CLI.hwndContactList);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOW);
db_set_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
- GetWindowRect(pcli->hwndContactList, &rcWindow);
+ GetWindowRect(g_CLI.hwndContactList, &rcWindow);
if (Utils_AssertInsideScreen(&rcWindow) == 1) {
- MoveWindow(pcli->hwndContactList, rcWindow.left, rcWindow.top,
+ MoveWindow(g_CLI.hwndContactList, rcWindow.left, rcWindow.top,
rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE);
}
}
else { //It needs to be hidden
- ShowWindow(pcli->hwndContactList, SW_HIDE);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
db_set_b(NULL, "CList", "State", SETTING_STATE_HIDDEN);
if (db_get_b(NULL, "CList", "DisableWorkingSet", 1))
SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index 92b0e48002..2c8ffaab60 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -171,11 +171,11 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ConfigureCLUIGeometry(1);
ConfigureEventArea();
HideShowNotifyFrame();
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
opt_gen_opts_changed = 0;
return TRUE;
diff --git a/plugins/Clist_nicer/src/clistsettings.cpp b/plugins/Clist_nicer/src/clistsettings.cpp index de3ffa6c26..7b2c55bac8 100644 --- a/plugins/Clist_nicer/src/clistsettings.cpp +++ b/plugins/Clist_nicer/src/clistsettings.cpp @@ -27,6 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. INT_PTR GetContactStatusMessage(WPARAM wParam, LPARAM lParam)
{
if (!cfg::shutDown)
- return SendMessage(pcli->hwndContactTree, CLM_GETSTATUSMSG, wParam, lParam);
+ return SendMessage(g_CLI.hwndContactTree, CLM_GETSTATUSMSG, wParam, lParam);
return 0;
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 93ef355b69..e5ec38b3c6 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -105,8 +105,8 @@ HWND hTbMenu, hTbGlobalStatus; static void Tweak_It(COLORREF clr) { - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED); - SetLayeredWindowAttributes(pcli->hwndContactList, clr, 0, LWA_COLORKEY); + SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED); + SetLayeredWindowAttributes(g_CLI.hwndContactList, clr, 0, LWA_COLORKEY); cfg::dat.colorkey = clr; } @@ -152,7 +152,7 @@ static int FS_FontsChanged(WPARAM, LPARAM) g_hPenCLUIFrames = CreatePen(PS_SOLID, 1, clr_cluiframes); Clist_ClcOptionsChanged(); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -160,7 +160,7 @@ static int FS_FontsChanged(WPARAM, LPARAM) // last frame of all. static HWND PreCreateCLC(HWND parent) { - pcli->hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"", + g_CLI.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"", WS_CHILD | CLS_CONTACTLIST | (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0) | (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0) @@ -168,15 +168,15 @@ static HWND PreCreateCLC(HWND parent) | CLS_MULTICOLUMN, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), (LPVOID)0xff00ff00); - cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0); - return pcli->hwndContactTree; + cfg::clcdat = (struct ClcData *)GetWindowLongPtr(g_CLI.hwndContactTree, 0); + return g_CLI.hwndContactTree; } // create internal frames, including the last frame (actual CLC control) static int CreateCLC() { ExtraIcon_Reload(); - pcli->pfnSetHideOffline(oldhideoffline); + g_CLI.pfnSetHideOffline(oldhideoffline); disableautoupd = 0; { CLISTFrame frame = { 0 }; @@ -187,7 +187,7 @@ static int CreateCLC() frame.height = 20; frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_UNICODE; frame.align = alBottom; - frame.hWnd = CreateWindowExA(0, "EventAreaClass", "evt", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr); + frame.hWnd = CreateWindowExA(0, "EventAreaClass", "evt", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, g_CLI.hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr); g_hwndEventArea = frame.hWnd; hNotifyFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0); CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hNotifyFrame, FU_FMPOS); @@ -197,7 +197,7 @@ static int CreateCLC() { CLISTFrame Frame = { 0 }; Frame.cbSize = sizeof(CLISTFrame); - Frame.hWnd = pcli->hwndContactTree; + Frame.hWnd = g_CLI.hwndContactTree; Frame.align = alClient; Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME); Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_UNICODE; @@ -352,8 +352,8 @@ void ConfigureCLUIGeometry(int mode) if (mode) { if (cfg::dat.dwFlags & CLUI_FRAME_SBARSHOW) { - SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0); - GetWindowRect(pcli->hwndStatus, &rcStatus); + SendMessage(g_CLI.hwndStatus, WM_SIZE, 0, 0); + GetWindowRect(g_CLI.hwndStatus, &rcStatus); cfg::dat.statusBarHeight = (rcStatus.bottom - rcStatus.top); } else cfg::dat.statusBarHeight = 0; @@ -379,7 +379,7 @@ void SetDBButtonStates(MCONTACT hPassedContact) ClcContact *contact = nullptr; if (cfg::clcdat && hPassedContact == 0) { - pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr); + g_CLI.pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr); if (contact && contact->type == CLCIT_CONTACT) { hContact = contact->hContact; } @@ -590,8 +590,8 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc) rcOld = rcWindow; GetWindowRect(hwnd, &rcWindow); - GetWindowRect(pcli->hwndContactTree, &rcTree); - winstyle = GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE); + GetWindowRect(g_CLI.hwndContactTree, &rcTree); + winstyle = GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE); SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE); HMONITOR hMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); @@ -656,12 +656,12 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) HRGN rgn = nullptr; RECT rc; - GetWindowRect(pcli->hwndContactTree, &rc); + GetWindowRect(g_CLI.hwndContactTree, &rc); POINT pt; pt.x = rc.left; pt.y = rc.top; - ScreenToClient(pcli->hwndContactList, &pt); + ScreenToClient(g_CLI.hwndContactList, &pt); hdcScroll = hdc; BitBlt(hdcScroll, nmcsbcd->rect.left, nmcsbcd->rect.top, nmcsbcd->rect.right - nmcsbcd->rect.left, nmcsbcd->rect.bottom - nmcsbcd->rect.top, cfg::dat.hdcBg, pt.x + nmcsbcd->rect.left, pt.y + nmcsbcd->rect.top, SRCCOPY); @@ -735,25 +735,25 @@ static void ShowCLUI(HWND hwnd) SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE); if (!db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT)) - SetMenu(pcli->hwndContactList, nullptr); + SetMenu(g_CLI.hwndContactList, nullptr); if (state == SETTING_STATE_NORMAL) { - SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0); - ShowWindow(pcli->hwndContactList, SW_SHOWNORMAL); - SendMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0); + SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0); + ShowWindow(g_CLI.hwndContactList, SW_SHOWNORMAL); + SendMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0); } else if (state == SETTING_STATE_MINIMIZED) { cfg::dat.forceResize = TRUE; - ShowWindow(pcli->hwndContactList, SW_HIDE); + ShowWindow(g_CLI.hwndContactList, SW_HIDE); } else if (state == SETTING_STATE_HIDDEN) { cfg::dat.forceResize = TRUE; - ShowWindow(pcli->hwndContactList, SW_HIDE); + ShowWindow(g_CLI.hwndContactList, SW_HIDE); } - SetWindowPos(pcli->hwndContactList, onTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOSENDCHANGING); + SetWindowPos(g_CLI.hwndContactList, onTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOSENDCHANGING); DrawMenuBar(hwnd); if (cfg::dat.autosize) { - SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0); - SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); + SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0); + SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); } } @@ -779,13 +779,13 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l int flags = WS_CHILD | CCS_BOTTOM; flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0; flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0; - pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, g_plugin.getInst(), nullptr); + g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, g_plugin.getInst(), nullptr); if (flags & WS_VISIBLE) { - ShowWindow(pcli->hwndStatus, SW_SHOW); - SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0); + ShowWindow(g_CLI.hwndStatus, SW_SHOW); + SendMessage(g_CLI.hwndStatus, WM_SIZE, 0, 0); } - mir_subclassWindow(pcli->hwndStatus, NewStatusBarWndProc); - SetClassLong(pcli->hwndStatus, GCL_STYLE, GetClassLong(pcli->hwndStatus, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW)); + mir_subclassWindow(g_CLI.hwndStatus, NewStatusBarWndProc); + SetClassLong(g_CLI.hwndStatus, GCL_STYLE, GetClassLong(g_CLI.hwndStatus, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW)); } g_oldSize.cx = g_oldSize.cy = 0; old_cliststate = db_get_b(NULL, "CList", "State", SETTING_STATE_NORMAL); @@ -831,8 +831,8 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l { LONG style; BYTE windowStyle = db_get_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW); - ShowWindow(pcli->hwndContactList, SW_HIDE); - style = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE); + ShowWindow(g_CLI.hwndContactList, SW_HIDE); + style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE); if (windowStyle != SETTING_WINDOWSTYLE_DEFAULT) { style |= WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE; style &= ~WS_EX_APPWINDOW; @@ -845,10 +845,10 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l style |= WS_EX_APPWINDOW; } - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, style); + SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, style); ApplyCLUIBorderStyle(); - SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE); + SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE); } if (cfg::dat.bSkinnedButtonMode) @@ -857,7 +857,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l SetButtonStates(); CreateCLC(); - cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0); + cfg::clcdat = (struct ClcData *)GetWindowLongPtr(g_CLI.hwndContactTree, 0); if (cfg::dat.bFullTransparent) { if (g_CLUISkinnedBkColorRGB) @@ -884,7 +884,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l ShowCLUI(hwnd); else { show_on_first_autosize = TRUE; - RecalcScrollBar(pcli->hwndContactTree, cfg::clcdat); + RecalcScrollBar(g_CLI.hwndContactTree, cfg::clcdat); } return 0; } @@ -1044,7 +1044,7 @@ skipbg: break; case WM_WINDOWPOSCHANGING: - if (pcli->hwndContactList != nullptr) { + if (g_CLI.hwndContactList != nullptr) { WINDOWPOS *wp = (WINDOWPOS *)lParam; if (!wp || (wp->flags & SWP_NOSIZE)) return FALSE; @@ -1059,12 +1059,12 @@ skipbg: if (cfg::dat.dwFlags & CLUI_FRAME_SBARSHOW) { RECT rcStatus; - SetWindowPos(pcli->hwndStatus, nullptr, 0, new_window_rect.bottom - 20, new_window_rect.right, 20, SWP_NOZORDER); - GetWindowRect(pcli->hwndStatus, &rcStatus); + SetWindowPos(g_CLI.hwndStatus, nullptr, 0, new_window_rect.bottom - 20, new_window_rect.right, 20, SWP_NOZORDER); + GetWindowRect(g_CLI.hwndStatus, &rcStatus); cfg::dat.statusBarHeight = (rcStatus.bottom - rcStatus.top); if (wp->cx != g_oldSize.cx) SendMessage(hwnd, CLUIINTM_STATUSBARUPDATE, 0, 0); - RedrawWindow(pcli->hwndStatus, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW); + RedrawWindow(g_CLI.hwndStatus, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW); } else cfg::dat.statusBarHeight = 0; @@ -1088,7 +1088,7 @@ skipbg: if (IsZoomed(hwnd)) ShowWindow(hwnd, SW_SHOWNORMAL); - if (pcli->hwndContactList != nullptr) { + if (g_CLI.hwndContactList != nullptr) { SendMessage(hwnd, WM_ENTERSIZEMOVE, 0, 0); GetWindowRect(hwnd, &rc); WINDOWPOS wp = {}; @@ -1127,7 +1127,7 @@ skipbg: return TRUE; case WM_SETFOCUS: - SetFocus(pcli->hwndContactTree); + SetFocus(g_CLI.hwndContactTree); return 0; case CLUIINTM_REMOVEFROMTASKBAR: { @@ -1154,7 +1154,7 @@ skipbg: SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0)); transparentFocus = 1; } - SetWindowPos(pcli->hwndContactList, db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING); + SetWindowPos(g_CLI.hwndContactList, db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING); } PostMessage(hwnd, CLUIINTM_REMOVEFROMTASKBAR, 0, 0); return DefWindowProc(hwnd, msg, wParam, lParam); @@ -1308,11 +1308,11 @@ skipbg: db_set_b(NULL, "CList", "State", SETTING_STATE_MINIMIZED); break; } - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); return 0; } if (wParam == SC_RESTORE) { - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); return 0; } } @@ -1334,7 +1334,7 @@ skipbg: int serviceFailure = FALSE; if (cfg::clcdat) { - pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr); + g_CLI.pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr); if (contact && contact->type == CLCIT_CONTACT) hContact = contact->hContact; } @@ -1483,17 +1483,17 @@ buttons_done: case ID_TRAY_HIDE: case IDC_TBMINIMIZE: case IDC_STBMINIMIZE: - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); break; case POPUP_NEWGROUP: - SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0); - SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, 1, 0); + SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0); + SendMessage(g_CLI.hwndContactTree, CLM_SETUSEGROUPS, 1, 0); Clist_GroupCreate(NULL, nullptr); break; case POPUP_HIDEOFFLINE: case IDC_TBHIDEOFFLINE: case IDC_STBHIDEOFFLINE: - pcli->pfnSetHideOffline(-1); + g_CLI.pfnSetHideOffline(-1); break; case POPUP_HIDEOFFLINEROOT: CallService(MS_CLIST_TOGGLEHIDEOFFLINEROOT, 0, 0); @@ -1508,11 +1508,11 @@ buttons_done: SetButtonStates(); break; case POPUP_HIDEMIRANDA: - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); break; case POPUP_SHOWMETAICONS: cfg::dat.dwFlags ^= CLUI_USEMETAICONS; - Clist_InitAutoRebuild(pcli->hwndContactTree); + Clist_InitAutoRebuild(g_CLI.hwndContactTree); break; case POPUP_FRAME: cfg::dat.dwFlags ^= CLUI_FRAME_CLISTSUNKEN; @@ -1525,15 +1525,15 @@ buttons_done: break; } if (dwOldFlags != cfg::dat.dwFlags) { - InvalidateRect(pcli->hwndContactTree, nullptr, FALSE); + InvalidateRect(g_CLI.hwndContactTree, nullptr, FALSE); db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags); if ((dwOldFlags & (CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_CLISTSUNKEN)) != (cfg::dat.dwFlags & (CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_CLISTSUNKEN))) { ConfigureFrame(); ConfigureCLUIGeometry(1); } ConfigureEventArea(); - PostMessage(pcli->hwndContactList, WM_SIZE, 0, 0); - PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0); + PostMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0); + PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0); } } return FALSE; @@ -1547,11 +1547,11 @@ buttons_done: break; case WM_DISPLAYCHANGE: - SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged + SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged break; case WM_NOTIFY: - if (((LPNMHDR)lParam)->hwndFrom == pcli->hwndContactTree) { + if (((LPNMHDR)lParam)->hwndFrom == g_CLI.hwndContactTree) { switch (((LPNMHDR)lParam)->code) { case CLN_LISTSIZECHANGE: sttProcessResize(hwnd, (NMCLISTCONTROL *)lParam); @@ -1561,14 +1561,14 @@ buttons_done: { NMCLISTCONTROL *nm = (NMCLISTCONTROL *)lParam; DWORD hitFlags; - SendMessage(pcli->hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y)); + SendMessage(g_CLI.hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y)); if ((hitFlags & (CLCHT_NOWHERE | CLCHT_INLEFTMARGIN | CLCHT_BELOWITEMS)) == 0) break; if (db_get_b(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) { POINT pt; pt = nm->pt; - ClientToScreen(pcli->hwndContactTree, &pt); + ClientToScreen(g_CLI.hwndContactTree, &pt); return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y)); } } @@ -1578,7 +1578,7 @@ buttons_done: break; case WM_CONTEXTMENU: - GetWindowRect(pcli->hwndContactTree, &rc); + GetWindowRect(g_CLI.hwndContactTree, &rc); { // x/y might be -1 if it was generated by a kb click POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; @@ -1597,7 +1597,7 @@ buttons_done: Menu_DestroyNestedMenu(hMenu); return 0; } - GetWindowRect(pcli->hwndStatus, &rc); + GetWindowRect(g_CLI.hwndStatus, &rc); if (PtInRect(&rc, pt)) { HMENU hMenu; if (db_get_b(NULL, "CLUI", "SBarRightClk", 0)) @@ -1627,7 +1627,7 @@ buttons_done: hbmLockedPoint = CreateCompatibleBitmap(dis->hDC, 5, 5); hbmOldLockedPoint = reinterpret_cast<HBITMAP>(SelectObject(hdcLockedPoint, hbmLockedPoint)); } - if (dis->hwndItem == pcli->hwndStatus) { + if (dis->hwndItem == g_CLI.hwndStatus) { ProtocolData *pd = (ProtocolData *)dis->itemData; if (IsBadCodePtr((FARPROC)pd)) return TRUE; @@ -1639,7 +1639,7 @@ buttons_done: if (pa == nullptr) return TRUE; - int nParts = SendMessage(pcli->hwndStatus, SB_GETPARTS, 0, 0); + int nParts = SendMessage(g_CLI.hwndStatus, SB_GETPARTS, 0, 0); SIZE textSize; BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1); @@ -1723,7 +1723,7 @@ buttons_done: PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); return 0; } - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); return 0; case CLUIINTM_REDRAW: @@ -1787,7 +1787,7 @@ static INT_PTR CLN_ShowMainMenu(WPARAM, LPARAM) { POINT pt; GetCursorPos(&pt); - TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr); + TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr); return 0; } @@ -1795,7 +1795,7 @@ static INT_PTR CLN_ShowStatusMenu(WPARAM, LPARAM) { POINT pt; GetCursorPos(&pt); - TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr); + TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr); return 0; } @@ -1848,7 +1848,7 @@ void OnCreateClc() InitGroupMenus(); LoadExtBkSettingsFromDB(); - PreCreateCLC(pcli->hwndContactList); + PreCreateCLC(g_CLI.hwndContactList); } struct diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index 245206e3e9..2c50952b3a 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -214,7 +214,7 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) } memset(&fakeMainWindow, 0, sizeof(fakeMainWindow)); - fakeMainWindow.ContainerWnd = pcli->hwndContactList; + fakeMainWindow.ContainerWnd = g_CLI.hwndContactList; fakeMainWindow.floating = TRUE; memset(&fakeTaskBarWindow, 0, sizeof(fakeTaskBarWindow)); @@ -840,7 +840,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) SetWindowLongPtr(Frames[pos].TitleBar.hwnd, GWL_STYLE, (LONG_PTR)style & ~(WS_VSCROLL | WS_HSCROLL)); lck.unlock(); - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); SetWindowPos(Frames[pos].TitleBar.hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); } return 0; @@ -903,7 +903,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) retval = Frames[pos].height; if (Frames[pos].height != oldHeight) { - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); if (Frames[pos].Skinned) RedrawWindow(Frames[pos].hWnd, nullptr, nullptr, RDW_FRAME | RDW_UPDATENOW | RDW_INVALIDATE); } @@ -942,7 +942,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) } lck.unlock(); - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); return -1; } @@ -954,7 +954,7 @@ static INT_PTR CLUIFramesShowAll(WPARAM, LPARAM) for (int i = 0; i < nFramescount; i++) Frames[i].visible = TRUE; - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); return 0; } @@ -968,8 +968,8 @@ INT_PTR CLUIFramesShowAllTitleBars(WPARAM, LPARAM) F.TitleBar.ShowTitleBar = TRUE; SetWindowPos(F.hWnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); } - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -983,8 +983,8 @@ INT_PTR CLUIFramesHideAllTitleBars(WPARAM, LPARAM) F.TitleBar.ShowTitleBar = FALSE; SetWindowPos(F.hWnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); } - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1008,8 +1008,8 @@ INT_PTR CLUIFramesShowHideFrame(WPARAM frameId, LPARAM) } if (!Frames[pos].floating) - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1027,8 +1027,8 @@ INT_PTR CLUIFramesShowHideFrameTitleBar(WPARAM frameId, LPARAM) } } - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1081,8 +1081,8 @@ INT_PTR CLUIFramesMoveUpDown(WPARAM frameId, LPARAM lParam) lck.unlock(); CLUIFramesReSort(); - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0); return 0; } @@ -1102,8 +1102,8 @@ INT_PTR CLUIFramesSetAlign(WPARAM frameId, LPARAM lParam) if (FramesSysNotStarted) return -1; CLUIFramesSetFrameOptions(MAKEWPARAM(FO_ALIGN, frameId), lParam); - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1223,7 +1223,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM) if (db_get_b(NULL, "CLUI", "AutoSize", 0)) return 0; - GetWindowRect(pcli->hwndContactList, &rc); + GetWindowRect(g_CLI.hwndContactList, &rc); if (Frames[FrameId].collapsed == TRUE) { rc.bottom -= rc.top; @@ -1237,11 +1237,11 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM) Frames[FrameId].collapsed = TRUE; } - SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE); + SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE); CLUIFramesStoreAllFrames(); lck.unlock(); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1298,7 +1298,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM) } lck.unlock(); if (!Frames[FrameId].floating) - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); else { RECT contwnd; GetWindowRect(Frames[FrameId].ContainerWnd, &contwnd); @@ -1308,7 +1308,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM) contwnd.top -= (oldHeight - Frames[FrameId].height);//newheight SetWindowPos(Frames[FrameId].ContainerWnd, HWND_TOP, 0, 0, contwnd.left, contwnd.top, SWP_SHOWWINDOW | SWP_NOMOVE); } - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); CLUIFramesStoreAllFrames(); return 0; } @@ -1373,11 +1373,9 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO HWND hwndParent = GetParent(hwnd); LRESULT result = 0; - if (pcli == nullptr) - return 0; - if (hwndParent != pcli->hwndContactList || !cfg::dat.bSkinnedScrollbar) + if (hwndParent != g_CLI.hwndContactList || !cfg::dat.bSkinnedScrollbar) result = CallWindowProc(oldWndProc, hwnd, WM_NCPAINT, wParam, lParam); - if (!pcli->hwndContactList || hwndParent != pcli->hwndContactList) + if (!g_CLI.hwndContactList || hwndParent != g_CLI.hwndContactList) return result; if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SKINNEDFRAME) { @@ -1391,7 +1389,7 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO rc.bottom = rcWindow.bottom - rcWindow.top; HDC hdc = GetWindowDC(hwnd); - if (hwnd == pcli->hwndContactTree) { + if (hwnd == g_CLI.hwndContactTree) { HDC realDC = CreateCompatibleDC(hdc); HBITMAP hbmDraw = CreateCompatibleBitmap(hdc, rc.right, rc.bottom); HBITMAP hbmOld = reinterpret_cast<HBITMAP>(SelectObject(realDC, hbmDraw)); @@ -1440,10 +1438,10 @@ int FrameNCCalcSize(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, NCCALCSIZE_PARAMS *nccp = (NCCALCSIZE_PARAMS *)lParam; DWORD dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE); - if (item == nullptr || pcli == nullptr) + if (item == nullptr) return orig; - if (item->IGNORED || !(dwStyle & CLS_SKINNEDFRAME) || GetParent(hwnd) != pcli->hwndContactList) + if (item->IGNORED || !(dwStyle & CLS_SKINNEDFRAME) || GetParent(hwnd) != g_CLI.hwndContactList) return orig; nccp->rgrc[0].left += item->MARGIN_LEFT; @@ -1533,7 +1531,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) int style; CLISTFrame *clfrm = (CLISTFrame *)wParam; - if (pcli->hwndContactList == nullptr) return -1; + if (g_CLI.hwndContactList == nullptr) return -1; if (FramesSysNotStarted) return -1; if (clfrm->cbSize != sizeof(CLISTFrame)) return -1; @@ -1558,13 +1556,13 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) if (clfrm->Flags & F_NO_SUBCONTAINER) Frames[nFramescount].OwnerWindow = (HWND)-2; else - Frames[nFramescount].OwnerWindow = pcli->hwndContactList; + Frames[nFramescount].OwnerWindow = g_CLI.hwndContactList; SetClassLong(clfrm->hWnd, GCL_STYLE, GetClassLong(clfrm->hWnd, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW)); SetWindowLongPtr(clfrm->hWnd, GWL_STYLE, GetWindowLongPtr(clfrm->hWnd, GWL_STYLE) | WS_CLIPCHILDREN); if (GetCurrentThreadId() == GetWindowThreadProcessId(clfrm->hWnd, nullptr)) { - if (clfrm->hWnd != pcli->hwndContactTree && clfrm->hWnd != g_hwndViewModeFrame && clfrm->hWnd != g_hwndEventArea) { + if (clfrm->hWnd != g_CLI.hwndContactTree && clfrm->hWnd != g_hwndViewModeFrame && clfrm->hWnd != g_hwndEventArea) { Frames[nFramescount].wndProc = (WNDPROC)GetWindowLongPtr(clfrm->hWnd, GWLP_WNDPROC); SetWindowLongPtr(clfrm->hWnd, GWLP_WNDPROC, (LONG_PTR)FramesSubClassProc); } @@ -1572,7 +1570,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) if (clfrm->hWnd == g_hwndEventArea) wndFrameEventArea = &Frames[nFramescount]; - else if (clfrm->hWnd == pcli->hwndContactTree) + else if (clfrm->hWnd == g_CLI.hwndContactTree) wndFrameCLC = &Frames[nFramescount]; else if (clfrm->hWnd == g_hwndViewModeFrame) wndFrameViewMode = &Frames[nFramescount]; @@ -1607,13 +1605,13 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) CreateWindow(CLUIFrameTitleBarClassName, Frames[nFramescount].name, (db_get_b(NULL, CLUIFrameModule, "RemoveAllTitleBarBorders", 1) ? 0 : WS_BORDER) | WS_CHILD | WS_CLIPCHILDREN | (Frames[nFramescount].TitleBar.ShowTitleBar ? WS_VISIBLE : 0) | - WS_CLIPCHILDREN, 0, 0, 0, 0, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr); + WS_CLIPCHILDREN, 0, 0, 0, 0, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr); SetWindowLongPtr(Frames[nFramescount].TitleBar.hwnd, GWLP_USERDATA, Frames[nFramescount].id); Frames[nFramescount].TitleBar.hwndTip = CreateWindowExA(0, TOOLTIPS_CLASSA, nullptr, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr); + g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr); SetWindowPos(Frames[nFramescount].TitleBar.hwndTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); { @@ -1651,13 +1649,13 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) lck.unlock(); alclientFrame = -1;//recalc it - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); if (Frames[nFramescount - 1].floating) { Frames[nFramescount - 1].floating = FALSE; CLUIFrameSetFloat(retval, 1);//lparam=1 use stored width and height } - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return retval; } @@ -1675,7 +1673,7 @@ static INT_PTR CLUIFramesRemoveFrame(WPARAM wParam, LPARAM) FRAMEWND* F = &Frames[pos]; if (F->hWnd == g_hwndEventArea) wndFrameEventArea = nullptr; - else if (F->hWnd == pcli->hwndContactTree) + else if (F->hWnd == g_CLI.hwndContactTree) wndFrameCLC = nullptr; else if (F->hWnd == g_hwndViewModeFrame) wndFrameViewMode = nullptr; @@ -1696,9 +1694,9 @@ static INT_PTR CLUIFramesRemoveFrame(WPARAM wParam, LPARAM) } if (!cfg::shutDown) { - InvalidateRect(pcli->hwndContactList, nullptr, TRUE); - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + InvalidateRect(g_CLI.hwndContactList, nullptr, TRUE); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); } return 0; } @@ -1771,7 +1769,7 @@ bool CLUIFramesFitInSize(void) int CLUIFramesGetMinHeight() { - if (pcli->hwndContactList == nullptr) + if (g_CLI.hwndContactList == nullptr) return 0; int i, tbh, clientfrm, sumheight = 0; @@ -1798,7 +1796,7 @@ int CLUIFramesGetMinHeight() } } - GetBorderSize(pcli->hwndContactList, &border); + GetBorderSize(g_CLI.hwndContactList, &border); return(sumheight + border.top + border.bottom + allbord + tbh + 3); } @@ -1958,12 +1956,12 @@ INT_PTR CLUIFramesUpdateFrame(WPARAM wParam, LPARAM lParam) return -1; if (wParam == -1) { - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); return 0; } if (lParam & FU_FMPOS) - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 1); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 1); mir_cslock lck(csFrameHook); int pos = id2pos(wParam); @@ -2070,7 +2068,7 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) { mir_cslock lck(csFrameHook); - GetClientRect(pcli->hwndContactList, &nRect); + GetClientRect(g_CLI.hwndContactList, &nRect); if (lParam && lParam != 1) { RECT oldRect; POINT pt; @@ -2079,7 +2077,7 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) GetWindowRect((HWND)wParam, &oldRect); pt.x = nRect.left; pt.y = nRect.top; - ClientToScreen(pcli->hwndContactList, &pt); + ClientToScreen(g_CLI.hwndContactList, &pt); dl = pt.x - oldRect.left; dt = pt.y - oldRect.top; dr = (oldRect.right - oldRect.left) - (nRect.right - nRect.left) - dl; @@ -2106,10 +2104,10 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) tick = GetTickCount() - tick; - if (pcli->hwndContactList != nullptr) - InvalidateRect(pcli->hwndContactList, nullptr, TRUE); - if (pcli->hwndContactList != nullptr) - UpdateWindow(pcli->hwndContactList); + if (g_CLI.hwndContactList != nullptr) + InvalidateRect(g_CLI.hwndContactList, nullptr, TRUE); + if (g_CLI.hwndContactList != nullptr) + UpdateWindow(g_CLI.hwndContactList); Sleep(0); @@ -2283,7 +2281,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA CLUIFrameSetFloat(Frameid, 0); break; } - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); } break; @@ -2354,7 +2352,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA lbypos = -1; oldframeheight = -1; ReleaseCapture(); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); break; case WM_LBUTTONDOWN: @@ -2421,8 +2419,8 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA rcwnd.left = curpt.x; rcwnd.right = curpt.x + 5; - GetWindowRect(pcli->hwndContactList, &rcMiranda); - if (IsWindowVisible(pcli->hwndContactList) && IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) { + GetWindowRect(g_CLI.hwndContactList, &rcMiranda); + if (IsWindowVisible(g_CLI.hwndContactList) && IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) { int id = Frames[pos].id; lck.unlock(); @@ -2453,7 +2451,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA rcwnd.left = curpt.x; rcwnd.right = curpt.x + 5; - GetWindowRect(pcli->hwndContactList, &rcMiranda); + GetWindowRect(g_CLI.hwndContactList, &rcMiranda); if (!IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) { lck.unlock(); @@ -2576,7 +2574,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA lck.unlock(); if (newh > 0) - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); break; } curdragbar = -1; @@ -2794,8 +2792,8 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam) wParam = id2pos(wParam); if ((int)wParam >= 0 && (int)wParam < nFramescount) { if (Frames[wParam].floating) { - SetParent(Frames[wParam].hWnd, pcli->hwndContactList); - SetParent(Frames[wParam].TitleBar.hwnd, pcli->hwndContactList); + SetParent(Frames[wParam].hWnd, g_CLI.hwndContactList); + SetParent(Frames[wParam].TitleBar.hwnd, g_CLI.hwndContactList); Frames[wParam].floating = FALSE; DestroyWindow(Frames[wParam].ContainerWnd); Frames[wParam].ContainerWnd = nullptr; @@ -2816,7 +2814,7 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam) if (!Frames[wParam].TitleBar.ShowTitleBar) recttb.top = recttb.bottom = recttb.left = recttb.right = 0; - Frames[wParam].ContainerWnd = CreateContainerWindow(pcli->hwndContactList, Frames[wParam].FloatingPos.x, Frames[wParam].FloatingPos.y, 10, 10); + Frames[wParam].ContainerWnd = CreateContainerWindow(g_CLI.hwndContactList, Frames[wParam].FloatingPos.x, Frames[wParam].FloatingPos.y, 10, 10); SetParent(Frames[wParam].hWnd, Frames[wParam].ContainerWnd); SetParent(Frames[wParam].TitleBar.hwnd, Frames[wParam].ContainerWnd); @@ -2869,7 +2867,7 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam) hwndtmp = Frames[wParam].ContainerWnd; } - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); SendMessage(hwndtmp, WM_SIZE, 0, 0); SetWindowPos(hwndtooltiptmp, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); return 0; @@ -3022,7 +3020,7 @@ void LoadExtraIconModule() int UnLoadCLUIFramesModule(void) { - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); CLUIFramesStoreAllFrames(); DeleteObject(g_hPenCLUIFrames); diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index e291388d67..9e6a279af3 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -176,7 +176,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_dw(NULL, "CLUIFrames", "GapBetweenFrames", cfg::dat.gapBetweenFrames);
db_set_b(NULL, "CList", "OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
- SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ SetWindowPos(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
cfg::dat.bCLeft = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLEFTSPIN, UDM_GETPOS, 0, 0);
cfg::dat.bCRight = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CRIGHTSPIN, UDM_GETPOS, 0, 0);
@@ -184,7 +184,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l cfg::dat.bCBottom = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CBOTTOMSPIN, UDM_GETPOS, 0, 0);
db_set_dw(NULL, "CLUI", "clmargins", MAKELONG(MAKEWORD(cfg::dat.bCLeft, cfg::dat.bCRight), MAKEWORD(cfg::dat.bCTop, cfg::dat.bCBottom)));
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
db_set_b(NULL, "CList", "BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
db_set_b(NULL, "CList", "AlwaysHideOnTB", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSHIDEONTASKBAR));
@@ -195,28 +195,28 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l // See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp
WINDOWPLACEMENT p;
p.length = sizeof(p);
- GetWindowPlacement(pcli->hwndContactList, &p);
- ShowWindow(pcli->hwndContactList, SW_HIDE);
+ GetWindowPlacement(g_CLI.hwndContactList, &p);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
- style = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
+ style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
style |= WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE;
style &= ~WS_EX_APPWINDOW;
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, style);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, style);
- SetWindowPlacement(pcli->hwndContactList, &p);
- ShowWindow(pcli->hwndContactList, SW_SHOW);
+ SetWindowPlacement(g_CLI.hwndContactList, &p);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOW);
}
else {
LONG style;
- style = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
+ style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
style &= ~(WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
if (db_get_b(NULL, "CList", "AlwaysHideOnTB", 1))
style &= ~WS_EX_APPWINDOW;
else {
style |= WS_EX_APPWINDOW;
- AddToTaskBar(pcli->hwndContactList);
+ AddToTaskBar(g_CLI.hwndContactList);
}
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, style);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, style);
}
cfg::dat.bClipBorder = (BYTE)GetDlgItemInt(hwndDlg, IDC_CLIPBORDER, &translated, FALSE);
@@ -229,21 +229,21 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ApplyCLUIBorderStyle();
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
- SetMenu(pcli->hwndContactList, nullptr);
+ SetMenu(g_CLI.hwndContactList, nullptr);
else
- SetMenu(pcli->hwndContactList, pcli->hMenuMain);
+ SetMenu(g_CLI.hwndContactList, g_CLI.hMenuMain);
wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ws(NULL, "CList", "TitleText", title);
- SetWindowText(pcli->hwndContactList, title);
+ SetWindowText(g_CLI.hwndContactList, title);
cfg::dat.dwFlags = IsDlgButtonChecked(hwndDlg, IDC_ROUNDEDBORDER) ? cfg::dat.dwFlags | CLUI_FRAME_ROUNDEDFRAME : cfg::dat.dwFlags & ~CLUI_FRAME_ROUNDEDFRAME;
db_set_b(NULL, "CLUI", "AutoSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
if ((cfg::dat.autosize = IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE) ? 1 : 0)) {
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
}
db_set_b(NULL, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
@@ -264,36 +264,36 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_b(NULL, "CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
if (cfg::dat.bLayeredHack)
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
if (g_CLUISkinnedBkColorRGB)
cfg::dat.colorkey = g_CLUISkinnedBkColorRGB;
else if (cfg::dat.bClipBorder == 0 && !(cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME))
cfg::dat.colorkey = db_get_dw(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
else {
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
cfg::dat.colorkey = RGB(255, 0, 255);
}
if (cfg::dat.isTransparent || cfg::dat.bFullTransparent) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(pcli->hwndContactList, 0, 255, LWA_ALPHA | LWA_COLORKEY);
- SetLayeredWindowAttributes(pcli->hwndContactList,
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_CLI.hwndContactList, 0, 255, LWA_ALPHA | LWA_COLORKEY);
+ SetLayeredWindowAttributes(g_CLI.hwndContactList,
(COLORREF)(cfg::dat.bFullTransparent ? cfg::dat.colorkey : 0),
(BYTE)(cfg::dat.isTransparent ? cfg::dat.autoalpha : 255),
(DWORD)((cfg::dat.isTransparent ? LWA_ALPHA : 0L) | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0L)));
}
else {
- SetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0), (BYTE)255, LWA_ALPHA);
+ SetLayeredWindowAttributes(g_CLI.hwndContactList, RGB(0, 0, 0), (BYTE)255, LWA_ALPHA);
if (!cfg::dat.bLayeredHack)
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
}
ConfigureCLUIGeometry(1);
- ShowWindow(pcli->hwndContactList, SW_SHOW);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
- RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOW);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
cfg::dat.fadeinout = oldFading;
opt_clui_changed = 0;
@@ -377,33 +377,33 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_b(NULL, "CLUI", "xstatus_sbar", (BYTE)cfg::dat.bShowXStatusOnSbar);
db_set_b(NULL, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL));
if (db_get_b(NULL, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
- HWND parent = GetParent(pcli->hwndStatus);
+ HWND parent = GetParent(g_CLI.hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
db_set_b(NULL, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
- ShowWindow(pcli->hwndStatus, SW_HIDE);
- mir_unsubclassWindow(pcli->hwndStatus, NewStatusBarWndProc);
- DestroyWindow(pcli->hwndStatus);
+ ShowWindow(g_CLI.hwndStatus, SW_HIDE);
+ mir_unsubclassWindow(g_CLI.hwndStatus, NewStatusBarWndProc);
+ DestroyWindow(g_CLI.hwndStatus);
flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
- pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
- mir_subclassWindow(pcli->hwndStatus, NewStatusBarWndProc);
+ g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
+ mir_subclassWindow(g_CLI.hwndStatus, NewStatusBarWndProc);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) {
- ShowWindow(pcli->hwndStatus, SW_SHOW);
- SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0);
+ ShowWindow(g_CLI.hwndStatus, SW_SHOW);
+ SendMessage(g_CLI.hwndStatus, WM_SIZE, 0, 0);
cfg::dat.dwFlags |= CLUI_FRAME_SBARSHOW;
}
else {
- ShowWindow(pcli->hwndStatus, SW_HIDE);
+ ShowWindow(g_CLI.hwndStatus, SW_HIDE);
cfg::dat.dwFlags &= ~CLUI_FRAME_SBARSHOW;
}
db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
ConfigureCLUIGeometry(1);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
CluiProtocolStatusChanged(0, nullptr);
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
opt_sbar_changed = 0;
return TRUE;
}
@@ -433,26 +433,26 @@ void ApplyCLUIBorderStyle() bool minToTray = TRUE;
p.length = sizeof(p);
- GetWindowPlacement(pcli->hwndContactList, &p);
- ShowWindow(pcli->hwndContactList, SW_HIDE);
+ GetWindowPlacement(g_CLI.hwndContactList, &p);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT || windowStyle == SETTING_WINDOWSTYLE_TOOLWINDOW) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME);
if (SETTING_WINDOWSTYLE_DEFAULT == windowStyle) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_MAXIMIZEBOX/* | WS_MINIMIZEBOX*/));
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_MAXIMIZEBOX/* | WS_MINIMIZEBOX*/));
minToTray = FALSE;
}
}
else if (windowStyle == SETTING_WINDOWSTYLE_THINBORDER) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME));
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_BORDER | WS_CLIPCHILDREN);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME));
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_BORDER | WS_CLIPCHILDREN);
}
else {
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME));
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_CLIPCHILDREN);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME));
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_CLIPCHILDREN);
}
p.showCmd = SW_HIDE;
- SetWindowPlacement(pcli->hwndContactList, &p);
+ SetWindowPlacement(g_CLI.hwndContactList, &p);
db_set_b(0, "CList", "Min2Tray", minToTray);
}
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 9f83842bac..9e64b242d2 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -30,11 +30,11 @@ extern ButtonItem *g_ButtonItems; void FreeProtocolData(void)
{
// free protocol data
- int nParts = SendMessage(pcli->hwndStatus, SB_GETPARTS, 0, 0);
+ int nParts = SendMessage(g_CLI.hwndStatus, SB_GETPARTS, 0, 0);
for (int nPanel = 0; nPanel < nParts; nPanel++) {
- ProtocolData *PD = (ProtocolData *)SendMessage(pcli->hwndStatus, SB_GETTEXT, nPanel, 0);
+ ProtocolData *PD = (ProtocolData *)SendMessage(g_CLI.hwndStatus, SB_GETTEXT, nPanel, 0);
if (PD != nullptr && !IsBadCodePtr((FARPROC)PD)) {
- SendMessage(pcli->hwndStatus, SB_SETTEXT, (WPARAM)nPanel | SBT_OWNERDRAW, 0);
+ SendMessage(g_CLI.hwndStatus, SB_SETTEXT, (WPARAM)nPanel | SBT_OWNERDRAW, 0);
if (PD->RealName) mir_free(PD->RealName);
if (PD) mir_free(PD);
}
@@ -45,7 +45,7 @@ int g_maxStatus = ID_STATUS_OFFLINE; void CluiProtocolStatusChanged(int, const char*)
{
- if (pcli->hwndStatus == nullptr || cfg::shutDown)
+ if (g_CLI.hwndStatus == nullptr || cfg::shutDown)
return;
auto &accs = Accounts();
@@ -56,7 +56,7 @@ void CluiProtocolStatusChanged(int, const char*) g_maxStatus = ID_STATUS_OFFLINE;
int borders[3];
- SendMessage(pcli->hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
+ SendMessage(g_CLI.hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
int *partWidths = (int*)_alloca((accs.getCount() + 1)*sizeof(int));
@@ -64,7 +64,7 @@ void CluiProtocolStatusChanged(int, const char*) int partCount;
if (cfg::dat.bEqualSections) {
RECT rc;
- GetClientRect(pcli->hwndStatus, &rc);
+ GetClientRect(g_CLI.hwndStatus, &rc);
rc.right -= borders[0] * 2;
int toshow = 0;
for (auto &pa : accs)
@@ -91,7 +91,7 @@ void CluiProtocolStatusChanged(int, const char*) wchar_t szName[32];
HDC hdc = GetDC(nullptr);
- HFONT hofont = reinterpret_cast<HFONT>(SelectObject(hdc, (HFONT)SendMessage(pcli->hwndStatus, WM_GETFONT, 0, 0)));
+ HFONT hofont = reinterpret_cast<HFONT>(SelectObject(hdc, (HFONT)SendMessage(g_CLI.hwndStatus, WM_GETFONT, 0, 0)));
// count down since built in ones tend to go at the end
partCount = 0;
@@ -128,15 +128,15 @@ void CluiProtocolStatusChanged(int, const char*) ReleaseDC(nullptr, hdc);
}
if (partCount == 0) {
- SendMessage(pcli->hwndStatus, SB_SIMPLE, TRUE, 0);
+ SendMessage(g_CLI.hwndStatus, SB_SIMPLE, TRUE, 0);
return;
}
- SendMessage(pcli->hwndStatus, SB_SIMPLE, FALSE, 0);
+ SendMessage(g_CLI.hwndStatus, SB_SIMPLE, FALSE, 0);
partWidths[partCount - 1] = -1;
BYTE windowStyle = db_get_b(NULL, "CLUI", "WindowStyle", 0);
- SendMessage(pcli->hwndStatus, SB_SETMINHEIGHT, 18 + cfg::dat.bClipBorder + ((windowStyle == SETTING_WINDOWSTYLE_THINBORDER || windowStyle == SETTING_WINDOWSTYLE_NOBORDER) ? 3 : 0), 0);
- SendMessage(pcli->hwndStatus, SB_SETPARTS, partCount, (LPARAM)partWidths);
+ SendMessage(g_CLI.hwndStatus, SB_SETMINHEIGHT, 18 + cfg::dat.bClipBorder + ((windowStyle == SETTING_WINDOWSTYLE_THINBORDER || windowStyle == SETTING_WINDOWSTYLE_NOBORDER) ? 3 : 0), 0);
+ SendMessage(g_CLI.hwndStatus, SB_SETPARTS, partCount, (LPARAM)partWidths);
// count down since built in ones tend to go at the end
partCount = 0;
@@ -156,7 +156,7 @@ void CluiProtocolStatusChanged(int, const char*) int flags = SBT_OWNERDRAW;
if (db_get_b(NULL, "CLUI", "SBarBevel", 1) == 0)
flags |= SBT_NOBORDERS;
- SendMessageA(pcli->hwndStatus, SB_SETTEXTA, partCount | flags, (LPARAM)PD);
+ SendMessageA(g_CLI.hwndStatus, SB_SETTEXTA, partCount | flags, (LPARAM)PD);
partCount++;
}
@@ -188,8 +188,8 @@ void CluiProtocolStatusChanged(int, const char*) * set the global status icon and display the global (most online) status mode on the
* status mode button
*/
- if (szStatus && pcli->hwndContactList) {
- HWND hwndClistBtn = GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS);
+ if (szStatus && g_CLI.hwndContactList) {
+ HWND hwndClistBtn = GetDlgItem(g_CLI.hwndContactList, IDC_TBGLOBALSTATUS);
if (IsWindow(hwndClistBtn)) {
SetWindowText(hwndClistBtn, szStatus);
SendMessage(hwndClistBtn, BUTTONSETIMLICON, (WPARAM)hCListImages, (LPARAM)iIcon);
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index d3e0ac5fda..0aa41471b7 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -387,8 +387,8 @@ void SetButtonToSkinned() CustomizeButton(BTNS[i].hwndButton, bSkinned, !bSkinned, bFlat, true);
}
- CustomizeButton(GetDlgItem(pcli->hwndContactList, IDC_TBMENU), bSkinned, !bSkinned, bSkinned);
- CustomizeButton(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), bSkinned, !bSkinned, bSkinned);
+ CustomizeButton(GetDlgItem(g_CLI.hwndContactList, IDC_TBMENU), bSkinned, !bSkinned, bSkinned);
+ CustomizeButton(GetDlgItem(g_CLI.hwndContactList, IDC_TBGLOBALSTATUS), bSkinned, !bSkinned, bSkinned);
SendMessage(g_hwndViewModeFrame, WM_USER + 100, 0, 0);
}
@@ -769,7 +769,7 @@ void IMG_ReadItem(const char *itemname, const char *szFileName) ImageItem tmpItem, *newItem = nullptr;
char buffer[512], szItemNr[30];
char szFinalName[MAX_PATH];
- HDC hdc = GetDC(pcli->hwndContactList);
+ HDC hdc = GetDC(g_CLI.hwndContactList);
int n;
BOOL alloced = FALSE;
char szDrive[MAX_PATH], szPath[MAX_PATH];
@@ -817,7 +817,7 @@ done_with_glyph: tmpItem.dwFlags |= IMAGE_PERPIXEL_ALPHA;
tmpItem.bf.AlphaFormat = AC_SRC_ALPHA;
if (tmpItem.inner_height <= 0 || tmpItem.inner_width <= 0) {
- ReleaseDC(pcli->hwndContactList, hdc);
+ ReleaseDC(g_CLI.hwndContactList, hdc);
return;
}
}
@@ -929,7 +929,7 @@ done_with_glyph: }
}
imgread_done:
- ReleaseDC(pcli->hwndContactList, hdc);
+ ReleaseDC(g_CLI.hwndContactList, hdc);
}
void IMG_DeleteItems()
@@ -1170,7 +1170,7 @@ static void BTN_ReadItem(char *itemName, char *file) newItem->nextItem = nullptr;
curItem->nextItem = newItem;
}
- newItem->hWnd = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 5, 5, pcli->hwndContactList, (HMENU)newItem->uId, g_plugin.getInst(), nullptr);
+ newItem->hWnd = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 5, 5, g_CLI.hwndContactList, (HMENU)newItem->uId, g_plugin.getInst(), nullptr);
CustomizeButton(newItem->hWnd, false, false, true);
SendMessage(newItem->hWnd, BUTTONSETBTNITEM, 0, (LPARAM)newItem);
if (newItem->dwFlags & BUTTON_ISTOGGLE)
@@ -1219,7 +1219,7 @@ void IMG_LoadItems() BTN_ReadItem(p, szFileName);
p += (mir_strlen(p) + 1);
}
- if (pcli && pcli->hwndContactList)
+ if (g_CLI.hwndContactList)
SetButtonStates();
free(szSections);
@@ -1233,8 +1233,8 @@ void IMG_LoadItems() db_set_b(NULL, "CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
db_set_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_NOBORDER);
ApplyCLUIBorderStyle();
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(pcli->hwndContactList, cfg::dat.colorkey, 0, LWA_COLORKEY);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_CLI.hwndContactList, cfg::dat.colorkey, 0, LWA_COLORKEY);
}
CoolSB_SetupScrollBar();
}
@@ -1451,8 +1451,8 @@ void extbk_import(char *file, HWND hwndDlg) CallService(MS_CLNSE_FILLBYCURRENTSEL, (WPARAM)hwndDlg, 0);
Clist_ClcOptionsChanged();
ConfigureCLUIGeometry(1);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
static void ApplyCLUISkin()
@@ -1471,10 +1471,10 @@ static void ApplyCLUISkin() db_set_b(NULL, "CLUI", "skin_changed", 0);
}
IMG_LoadItems();
- ShowWindow(pcli->hwndContactList, SW_SHOWNORMAL);
- SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOWNORMAL);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE);
db_free(&dbv);
}
}
@@ -1534,8 +1534,8 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L IMG_DeleteItems();
ConfigureFrame();
SetButtonStates();
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
break;
case IDC_GETSKINS:
@@ -1609,7 +1609,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case PSN_APPLY:
SaveNonStatusItemsSettings(hwndDlg);
Clist_ClcOptionsChanged();
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
return TRUE;
}
break;
@@ -1654,7 +1654,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara sd.lastItem = ID_STATUS_OFFLINE + arStatusItems.getCount();
sd.firstItem = ID_STATUS_OFFLINE;
sd.pfnClcOptionsChanged = &Clist_ClcOptionsChanged;
- sd.hwndCLUI = pcli->hwndContactList;
+ sd.hwndCLUI = g_CLI.hwndContactList;
hwndSkinEdit = (HWND)CallService(MS_CLNSE_INVOKE, 0, (LPARAM)&sd);
}
@@ -1788,14 +1788,14 @@ int CoolSB_SetupScrollBar() cfg::dat.bSkinnedScrollbar = FALSE;
if (db_get_b(NULL, "CLC", "NoVScrollBar", 0)) {
- UninitializeCoolSB(pcli->hwndContactTree);
+ UninitializeCoolSB(g_CLI.hwndContactTree);
return 0;
}
if (cfg::dat.bSkinnedScrollbar) {
- InitializeCoolSB(pcli->hwndContactTree);
- CoolSB_SetStyle(pcli->hwndContactTree, SB_VERT, CSBS_HOTTRACKED);
+ InitializeCoolSB(g_CLI.hwndContactTree);
+ CoolSB_SetStyle(g_CLI.hwndContactTree, SB_VERT, CSBS_HOTTRACKED);
}
- else UninitializeCoolSB(pcli->hwndContactTree);
+ else UninitializeCoolSB(g_CLI.hwndContactTree);
return 0;
}
diff --git a/plugins/Clist_nicer/src/groupmenu.cpp b/plugins/Clist_nicer/src/groupmenu.cpp index 11fef9cd61..e1e34d2131 100644 --- a/plugins/Clist_nicer/src/groupmenu.cpp +++ b/plugins/Clist_nicer/src/groupmenu.cpp @@ -68,7 +68,7 @@ static INT_PTR GroupMenu_OnAddService(WPARAM wParam, LPARAM lParam) static INT_PTR CommandHelper(WPARAM wParam, LPARAM)
{
- SendMessage(pcli->hwndContactList, WM_COMMAND, MAKELONG(wParam, BN_CLICKED), 1);
+ SendMessage(g_CLI.hwndContactList, WM_COMMAND, MAKELONG(wParam, BN_CLICKED), 1);
return 0;
}
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 5c8d4348d3..5acbf75006 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma comment(lib, "shlwapi.lib")
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli, coreCli;
+CLIST_INTERFACE coreCli;
#define DEFAULT_TB_VISIBILITY (1 | 2 | 4 | 8 | 16 | 32 | 64 | 8192)
@@ -109,8 +109,8 @@ static int systemModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) CListInitialise()
{
- pcli = Clist_GetInterface();
- coreCli = *pcli;
+ Clist_GetInterface();
+ coreCli = g_CLI;
API::onInit();
@@ -172,41 +172,41 @@ extern "C" int __declspec(dllexport) CListInitialise() wcslwr(cfg::dat.tszProfilePath);
// get the clist interface
- pcli->hInst = g_plugin.getInst();
- pcli->pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged;
- pcli->pfnCompareContacts = CompareContacts;
- pcli->pfnCreateClcContact = CreateClcContact;
- pcli->pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
- pcli->pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
- pcli->pfnGetDefaultFontSetting = GetDefaultFontSetting;
- pcli->pfnGetRowBottomY = RowHeight::getItemBottomY;
- pcli->pfnGetRowHeight = RowHeight::getHeight;
- pcli->pfnGetRowTopY = RowHeight::getItemTopY;
- pcli->pfnGetRowTotalHeight = RowHeight::getTotalHeight;
- pcli->pfnGetWindowVisibleState = GetWindowVisibleState;
- pcli->pfnHitTest = HitTest;
- pcli->pfnOnCreateClc = OnCreateClc;
- pcli->pfnPaintClc = PaintClc;
- pcli->pfnRebuildEntireList = RebuildEntireList;
- pcli->pfnRowHitTest = RowHeight::hitTest;
- pcli->pfnScrollTo = ScrollTo;
- pcli->pfnSetHideOffline = SetHideOffline;
- pcli->pfnShowHide = ShowHide;
-
- pcli->pfnAddContactToGroup = AddContactToGroup;
-
- pcli->pfnAddEvent = AddEvent;
- pcli->pfnRemoveEvent = RemoveEvent;
-
- pcli->pfnAddGroup = AddGroup;
- pcli->pfnAddInfoItemToGroup = AddInfoItemToGroup;
- pcli->pfnContactListControlWndProc = ContactListControlWndProc;
- pcli->pfnContactListWndProc = ContactListWndProc;
- pcli->pfnIconFromStatusMode = IconFromStatusMode;
- pcli->pfnLoadClcOptions = LoadClcOptions;
- pcli->pfnProcessExternalMessages = ProcessExternalMessages;
- pcli->pfnRecalcScrollBar = RecalcScrollBar;
- pcli->pfnTrayIconProcessMessage = TrayIconProcessMessage;
+ g_CLI.hInst = g_plugin.getInst();
+ g_CLI.pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged;
+ g_CLI.pfnCompareContacts = CompareContacts;
+ g_CLI.pfnCreateClcContact = CreateClcContact;
+ g_CLI.pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
+ g_CLI.pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
+ g_CLI.pfnGetDefaultFontSetting = GetDefaultFontSetting;
+ g_CLI.pfnGetRowBottomY = RowHeight::getItemBottomY;
+ g_CLI.pfnGetRowHeight = RowHeight::getHeight;
+ g_CLI.pfnGetRowTopY = RowHeight::getItemTopY;
+ g_CLI.pfnGetRowTotalHeight = RowHeight::getTotalHeight;
+ g_CLI.pfnGetWindowVisibleState = GetWindowVisibleState;
+ g_CLI.pfnHitTest = HitTest;
+ g_CLI.pfnOnCreateClc = OnCreateClc;
+ g_CLI.pfnPaintClc = PaintClc;
+ g_CLI.pfnRebuildEntireList = RebuildEntireList;
+ g_CLI.pfnRowHitTest = RowHeight::hitTest;
+ g_CLI.pfnScrollTo = ScrollTo;
+ g_CLI.pfnSetHideOffline = SetHideOffline;
+ g_CLI.pfnShowHide = ShowHide;
+
+ g_CLI.pfnAddContactToGroup = AddContactToGroup;
+
+ g_CLI.pfnAddEvent = AddEvent;
+ g_CLI.pfnRemoveEvent = RemoveEvent;
+
+ g_CLI.pfnAddGroup = AddGroup;
+ g_CLI.pfnAddInfoItemToGroup = AddInfoItemToGroup;
+ g_CLI.pfnContactListControlWndProc = ContactListControlWndProc;
+ g_CLI.pfnContactListWndProc = ContactListWndProc;
+ g_CLI.pfnIconFromStatusMode = IconFromStatusMode;
+ g_CLI.pfnLoadClcOptions = LoadClcOptions;
+ g_CLI.pfnProcessExternalMessages = ProcessExternalMessages;
+ g_CLI.pfnRecalcScrollBar = RecalcScrollBar;
+ g_CLI.pfnTrayIconProcessMessage = TrayIconProcessMessage;
int rc = LoadContactListModule();
if (rc == 0)
@@ -230,8 +230,8 @@ extern "C" int __declspec(dllexport) Load(void) extern "C" int __declspec(dllexport) Unload(void)
{
- if (IsWindow(pcli->hwndContactList))
- DestroyWindow(pcli->hwndContactList);
+ if (IsWindow(g_CLI.hwndContactList))
+ DestroyWindow(g_CLI.hwndContactList);
ClcShutdown(0, 0);
UnLoadCLUIFramesModule();
return 0;
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index 47ddaf4948..62cef006e7 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -94,7 +94,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM GetWindowRect(hwnd, &rcWindow);
pt.x = rcWindow.left;
pt.y = rcWindow.top;
- ScreenToClient(pcli->hwndContactList, &pt);
+ ScreenToClient(g_CLI.hwndContactList, &pt);
HBITMAP hbmMem = CreateCompatibleBitmap(hdc, rcClient.right, rcClient.bottom);
HBITMAP hbmOld = reinterpret_cast<HBITMAP>(SelectObject(hdcMem, hbmMem));
@@ -123,7 +123,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendMessage(hwnd, SB_GETRECT, i, (LPARAM)&dis.rcItem);
OffsetRect(&dis.rcItem, 0, -b_offset);
dis.itemData = SendMessage(hwnd, SB_GETTEXTA, i, 0);
- SendMessage(pcli->hwndContactList, WM_DRAWITEM, 0, (LPARAM)&dis);
+ SendMessage(g_CLI.hwndContactList, WM_DRAWITEM, 0, (LPARAM)&dis);
}
BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, hdcMem, 0, 0, SRCCOPY);
if (hOldFont)
@@ -163,7 +163,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM mir_snwprintf(szTipText, L"<b>%s</b>: %s%s", PD->RealName, Clist_GetStatusModeDescription(pa->iRealStatus, 0), pa->bIsLocked ? L" (LOCKED)" : L"");
CLCINFOTIP ti = { sizeof(ti) };
- ti.isTreeFocused = (GetFocus() == pcli->hwndContactList);
+ ti.isTreeFocused = (GetFocus() == g_CLI.hwndContactList);
CallService("mToolTip/ShowTipW", (WPARAM)szTipText, (LPARAM)&ti);
}
break;
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 6770ce9cd3..1e9e674432 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -912,7 +912,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM POINT pt;
RECT rcCLUI;
- GetWindowRect(pcli->hwndContactList, &rcCLUI);
+ GetWindowRect(g_CLI.hwndContactList, &rcCLUI);
GetCursorPos(&pt);
if (PtInRect(&rcCLUI, pt))
break;
@@ -962,7 +962,7 @@ clvm_reset_command: cfg::dat.bFilterEffective = 0;
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
SetDlgItemText(hwnd, IDC_SELECTMODE, TranslateT("No view mode"));
- pcli->pfnSetHideOffline(cfg::dat.boldHideOffline);
+ g_CLI.pfnSetHideOffline(cfg::dat.boldHideOffline);
cfg::dat.boldHideOffline = (BYTE)-1;
SetButtonStates();
cfg::dat.current_viewmode[0] = 0;
@@ -1012,7 +1012,7 @@ void CreateViewModeFrame() frame.height = 22;
frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_UNICODE;
frame.align = alBottom;
- frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", L"CLVM", WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr);
+ frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", L"CLVM", WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, g_CLI.hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr);
g_hwndViewModeFrame = frame.hWnd;
hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
@@ -1101,7 +1101,7 @@ void ApplyViewMode(const char *name) if (cfg::dat.boldHideOffline == (BYTE)-1)
cfg::dat.boldHideOffline = db_get_b(NULL, "CList", "HideOffline", 0);
- pcli->pfnSetHideOffline(false);
+ g_CLI.pfnSetHideOffline(false);
SetWindowTextA(hwndSelector, name);
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
SetButtonStates();
diff --git a/plugins/CmdLine/src/CmdLine.cpp b/plugins/CmdLine/src/CmdLine.cpp index 47a34c6052..d42ba87727 100644 --- a/plugins/CmdLine/src/CmdLine.cpp +++ b/plugins/CmdLine/src/CmdLine.cpp @@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -46,8 +45,6 @@ CMPlugin::CMPlugin() : extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
if (InitServer())
MessageBox(nullptr, TranslateT("Could not initialize CmdLine plugin property"), TranslateT("Error"), MB_ICONEXCLAMATION | MB_OK);
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index abbec32e84..f7ed632c9d 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -483,7 +483,7 @@ void HandleClistCommand(PCommand command, TArgument *argv, int argc, PReply repl switch (argc) {
case 2:
{
- int state = IsWindowVisible(pcli->hwndContactList);
+ int state = IsWindowVisible(g_CLI.hwndContactList);
Set2StateReply(reply, state, 0, LPGENW("Contact list is currently shown."), L"", LPGENW("Contact list is currently hidden."), L"");
return;
@@ -495,18 +495,18 @@ void HandleClistCommand(PCommand command, TArgument *argv, int argc, PReply repl switch (Get2StateValue(argv[2])) {
case STATE_ON:
- ShowWindow(pcli->hwndContactList, SW_SHOW);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOW);
state = TRUE;
break;
case STATE_OFF:
- ShowWindow(pcli->hwndContactList, SW_HIDE);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
state = FALSE;
break;
case STATE_TOGGLE:
- state = !IsWindowVisible(pcli->hwndContactList);
- ShowWindow(pcli->hwndContactList, (state) ? SW_SHOW : SW_HIDE);
+ state = !IsWindowVisible(g_CLI.hwndContactList);
+ ShowWindow(g_CLI.hwndContactList, (state) ? SW_SHOW : SW_HIDE);
break;
default:
@@ -531,7 +531,7 @@ void HandleQuitCommand(PCommand command, TArgument *argv, int argc, PReply reply CallService("CloseAction", 0, 0);
// try another quit method
- PostMessage(pcli->hwndContactList, WM_COMMAND, ID_ICQ_EXIT, 0);
+ PostMessage(g_CLI.hwndContactList, WM_COMMAND, ID_ICQ_EXIT, 0);
reply->code = MIMRES_SUCCESS;
mir_snwprintf(reply->message, TranslateT("Issued a quit command."));
@@ -548,7 +548,7 @@ void HandleQuitCommand(PCommand command, TArgument *argv, int argc, PReply reply CallService("CloseAction", 0, 0);
//try another quit method
- PostMessage(pcli->hwndContactList, WM_COMMAND, ID_ICQ_EXIT, 0);
+ PostMessage(g_CLI.hwndContactList, WM_COMMAND, ID_ICQ_EXIT, 0);
reply->code = MIMRES_SUCCESS;
mir_snwprintf(reply->message, TranslateT("Issued a quit and wait command."));
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index a829e38cce..a56c3179a2 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -1,7 +1,6 @@ #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
//PLUGINLINK *pluginLink=NULL;
HANDLE hOptInit = nullptr;
@@ -846,8 +845,6 @@ extern "C" int __declspec(dllexport) Load(void) _OutputDebugString(L"Entering Load dll");
#endif
- pcli = Clist_GetInterface();
-
hExceptionsMutex = CreateMutex(nullptr, FALSE, L"ExceptionsMutex");
LoadSettings();
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 26f21e9449..f733a32177 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -23,8 +23,6 @@ #include "stdafx.h"
-CLIST_INTERFACE *pcli;
-
CMPlugin g_plugin;
int g_Utf8EventsSupported = TRUE;
@@ -82,7 +80,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent) cle.pszService = MS_CONTACTS_RECEIVE;
cle.szTooltip.w = caToolTip;
cle.flags |= CLEF_UNICODE;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
return 0; //continue processing by other hooks
}
@@ -194,8 +192,6 @@ static INT_PTR ServiceReceiveCommand(WPARAM, LPARAM lParam) extern "C" __declspec(dllexport) int Load(void)
{
- pcli = Clist_GetInterface();
-
InitCommonControls();
g_hSendWindowList = WindowList_Create();
diff --git a/plugins/ExternalAPI/m_skin_eng.h b/plugins/ExternalAPI/m_skin_eng.h index af1f8fe347..83d4801690 100644 --- a/plugins/ExternalAPI/m_skin_eng.h +++ b/plugins/ExternalAPI/m_skin_eng.h @@ -171,7 +171,7 @@ int __inline SkinDrawWindowBack(HWND hwndIn, HDC hdc, RECT * rcClip, char * obje GetWindowRect(hwndIn,&r1);
pt.x=r1.left;
pt.y=r1.top;
- GetWindowRect(pcli->hwndContactList, &rc);
+ GetWindowRect(g_CLI.hwndContactList, &rc);
OffsetRect(&rc,-pt.x ,-pt.y);
rq.hDC=hdc;
rq.rcDestRect=rc;
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index 8f426f9fb6..48ef4a9c79 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -67,7 +67,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case WM_COMMAND:
{
PUDeletePopup(hWnd);
- pcli->pfnRemoveEvent(hContact, 0);
+ g_CLI.pfnRemoveEvent(hContact, 0);
if (IsWindow(hDlg)) {
ShowWindow(hDlg, SW_SHOWNORMAL);
@@ -420,7 +420,7 @@ void FILEECHO::incomeRequest(char *param) cle.flags = CLEF_URGENT;
cle.hDbEvent = 0;
cle.pszService = MODULENAME "/FERecvFile";
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
MakePopupMsg(hDlg, hContact, L"Incoming file...");
}
@@ -488,7 +488,7 @@ void FILEECHO::onRecvTimer() setState(STATE_FINISHED);
if (db_get_b(NULL, "SRFile", "AutoClose", 0)) {
PostMessage(hDlg, WM_CLOSE, 0, 0);
- pcli->pfnRemoveEvent(hContact, 0);
+ g_CLI.pfnRemoveEvent(hContact, 0);
}
Skin_PlaySound("FileDone");
destroyTransfer();
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index c709181372..f6ffd068d2 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -1,9 +1,9 @@ #include "stdafx.h"
-CLIST_INTERFACE *pcli;
-MWindowList hFileList;
CMPlugin g_plugin;
+MWindowList hFileList;
+
char *szServiceTitle = SERVICE_TITLE;
char *szServicePrefix = SERVICE_PREFIX;
HANDLE hHookDbSettingChange, hHookContactAdded, hHookSkinIconsChanged;
@@ -185,8 +185,6 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- pcli = Clist_GetInterface();
-
InitCRC32();
g_plugin.registerIcon("fileAsMessage", iconList);
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 18cb1d9a7d..03a65a43d1 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -64,7 +64,6 @@ BOOL bIsCListShow; HGENMENU hMenuItemRemove, hMenuItemHideAll, hMainMenuItemHideAll;
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
/////////////////////////////////////////////////////////////////////////////
@@ -868,10 +867,10 @@ static int OnModulesLoded(WPARAM, LPARAM) HookEvent(ME_CLIST_STATUSMODECHANGE, OnStatusModeChange);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildContactMenu);
- hwndMiranda = pcli->hwndContactList;
+ hwndMiranda = g_CLI.hwndContactList;
mir_subclassWindow(hwndMiranda, newMirandaWndProc);
- UINT_PTR dwStyle = SendMessageW(pcli->hwndContactTree, CLM_GETEXSTYLE, 0, 0);
+ UINT_PTR dwStyle = SendMessageW(g_CLI.hwndContactTree, CLM_GETEXSTYLE, 0, 0);
if (dwStyle & CLS_EX_DISABLEDRAGDROP)
MessageBox(hwndMiranda,
TranslateT("Floating contacts plugin won't work until you uncheck the \"Disable drag and drop of items\" option in Options - Contact list"),
@@ -904,8 +903,6 @@ static int OnPreshutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load()
{
- pcli = Clist_GetInterface();
-
g_plugin.registerIconW(_A2W(MODULE), g_iconList);
LoadMenus();
InitOptions();
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp index dd116e5f08..af7dfa44ec 100644 --- a/plugins/GmailNotifier/src/main.cpp +++ b/plugins/GmailNotifier/src/main.cpp @@ -11,7 +11,6 @@ There is no warranty. #include "version.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
UINT hTimer;
HANDLE hMirandaStarted, hOptionsInitial;
@@ -87,8 +86,6 @@ static int OnMirandaStart(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load()
{
- pcli = Clist_GetInterface();
-
g_plugin.addSound("Gmail", LPGENW("Other"), LPGENW("Gmail: New thread(s)"));
HookEvent(ME_CLIST_DOUBLECLICKED, OpenBrowser);
diff --git a/plugins/GmailNotifier/src/notify.cpp b/plugins/GmailNotifier/src/notify.cpp index 359b39e926..dc34a05c23 100644 --- a/plugins/GmailNotifier/src/notify.cpp +++ b/plugins/GmailNotifier/src/notify.cpp @@ -77,7 +77,7 @@ int OpenBrowser(WPARAM hContact, LPARAM) if (proto && !mir_strcmp(proto, MODULENAME)) {
Account *curAcc = GetAccountByContact(hContact);
PUDeletePopup(curAcc->popUpHwnd);
- pcli->pfnRemoveEvent(curAcc->hContact, 1);
+ g_CLI.pfnRemoveEvent(curAcc->hContact, 1);
if (GetKeyState(VK_SHIFT) >> 8 || optionWindowIsOpen)
return FALSE;
@@ -118,7 +118,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case WM_CONTEXTMENU:
PUDeletePopup(hWnd);
curAcc->popUpHwnd = nullptr;
- pcli->pfnRemoveEvent(hContact, 1);
+ g_CLI.pfnRemoveEvent(hContact, 1);
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
@@ -132,7 +132,7 @@ void NotifyUser(Account *curAcc) switch (curAcc->results_num) {
case 0:
PUDeletePopup(curAcc->popUpHwnd);
- pcli->pfnRemoveEvent(curAcc->hContact, 1);
+ g_CLI.pfnRemoveEvent(curAcc->hContact, 1);
if (curAcc->oldResults_num != 0)
db_set_w(curAcc->hContact, MODULENAME, "Status", ID_STATUS_NONEW);
break;
@@ -160,7 +160,7 @@ void NotifyUser(Account *curAcc) }
}
if (opt.notifierOnTray&&newMails > 0) {
- pcli->pfnRemoveEvent(curAcc->hContact, 1);
+ g_CLI.pfnRemoveEvent(curAcc->hContact, 1);
CLISTEVENT cle = {};
cle.hContact = curAcc->hContact;
@@ -169,7 +169,7 @@ void NotifyUser(Account *curAcc) cle.hIcon = Skin_LoadProtoIcon(MODULENAME, ID_STATUS_OCCUPIED);
cle.pszService = "GmailMNotifier/Notifying";
cle.szTooltip.a = curAcc->results.next->content;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
if (opt.notifierOnPop&&newMails > 0) {
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 831a3ea9a8..db1770221b 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -1054,7 +1054,7 @@ static INT_PTR nShareNewFile(WPARAM hContact, LPARAM lParam) stNewShare.dwAllowedMask = 0;
}
- if (!bShowShareNewFileDlg((lParam ? HWND(lParam) : pcli->hwndContactList), &stNewShare))
+ if (!bShowShareNewFileDlg((lParam ? HWND(lParam) : g_CLI.hwndContactList), &stNewShare))
return 0;
if (stNewShare.dwAllowedIP)
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 41b87e78f9..6adf9893b3 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -48,8 +48,6 @@ int PreShutdown(WPARAM /*wparam*/, LPARAM /*lparam*/); HNETLIBUSER hNetlibUser;
HANDLE hDirectBoundPort;
-CLIST_INTERFACE *pcli;
-
string sLogFilePath;
// static so they can not be used from other modules ( sourcefiles )
@@ -815,8 +813,6 @@ int nSystemShutdown(WPARAM /*wparam*/, LPARAM /*lparam*/) extern "C" __declspec(dllexport) int Load()
{
- pcli = Clist_GetInterface();
-
hHttpAcceptConnectionsService = CreateServiceFunction(MS_HTTP_ACCEPT_CONNECTIONS, nToggelAcceptConnections);
if (!hHttpAcceptConnectionsService) {
MessageBox(nullptr, "Failed to CreateServiceFunction MS_HTTP_ACCEPT_CONNECTIONS", MSG_BOX_TITEL, MB_OK);
diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp index 4cbe88a23f..17ceb61f9a 100644 --- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp +++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp @@ -25,7 +25,6 @@ CMPlugin g_plugin; HWND hDialogWnd = nullptr; // хэндл окна настроек, он глобально используется для вывода туда в реалтайме сканкодов клавы из хука
HHOOK hHook;
-CLIST_INTERFACE *pcli;
// там хранятся настройки - сканкоды кнопок для закрытия/показа/чтения, на которые должны реагировать соответствующие действия
DWORD code_Close = 0;
@@ -93,9 +92,6 @@ extern "C" __declspec(dllexport) int Load(void) code_HideShow = db_get_dw(0, MODULENAME, "HideShow", 0);
code_ReadMsg = db_get_dw(0, MODULENAME, "ReadMsg", 0);
- // Интерфейс контактлиста - макрос заполняет CLIST_INTERFACE *pcli;
- pcli = Clist_GetInterface();
-
// регистрация диалога опций
HookEvent(ME_OPT_INITIALISE, initializeOptions);
diff --git a/plugins/HwHotKeys/src/HwHotKeys_KbdHook.cpp b/plugins/HwHotKeys/src/HwHotKeys_KbdHook.cpp index 0908375dc8..1dfa18bd81 100644 --- a/plugins/HwHotKeys/src/HwHotKeys_KbdHook.cpp +++ b/plugins/HwHotKeys/src/HwHotKeys_KbdHook.cpp @@ -95,7 +95,7 @@ LRESULT CALLBACK key_hook(int nCode, WPARAM wParam, LPARAM lParam) // https://m if (HwHotKeys_CompareCurrentScancode(code_HideShow)) { // хоткей сворачивания/разворачивания главного окна Miranda
// Beep(700, 200);
- pcli->pfnShowHide(); // есть варианты
+ g_CLI.pfnShowHide(); // есть варианты
return 1;
}
@@ -103,8 +103,8 @@ LRESULT CALLBACK key_hook(int nCode, WPARAM wParam, LPARAM lParam) // https://m // Beep(1500, 200);
if (Clist_EventsProcessTrayDoubleClick(0) != 0) { // клик по трею для стандартного открытия сообщения
// иначе - окно чата уже открыто и надо его вытащить наверх...
- SetForegroundWindow(pcli->hwndContactList);
- SetFocus(pcli->hwndContactList);
+ SetForegroundWindow(g_CLI.hwndContactList);
+ SetFocus(g_CLI.hwndContactList);
// хотя всЄ равно это не очень работает в новой винде
// надо http://www.rsdn.ru/article/qna/ui/wndsetfg.xml
// но пока незнаю где тут взять хэндл окна чата(причём именно для
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 331f640f8e..e9480ded24 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -255,7 +255,7 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & DBEF_SENT) && (dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_URL)) {
db_event_markRead(event->hContact, hDbEvent);
- pcli->pfnRemoveEvent(event->hContact, hDbEvent);
+ g_CLI.pfnRemoveEvent(event->hContact, hDbEvent);
}
if (!isDbEventShown(&dbei)) {
diff --git a/plugins/IEView/src/ieview_main.cpp b/plugins/IEView/src/ieview_main.cpp index c3b71b298a..885ab13e6b 100644 --- a/plugins/IEView/src/ieview_main.cpp +++ b/plugins/IEView/src/ieview_main.cpp @@ -20,8 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "stdafx.h"
-CLIST_INTERFACE *pcli;
-
char *workingDirUtf8;
CMPlugin g_plugin;
@@ -69,8 +67,6 @@ extern "C" int __declspec(dllexport) Load(void) workingDirUtf8 = mir_utf8encodeW(workingDir);
delete[] workingDir;
- pcli = Clist_GetInterface();
-
HookEvent(ME_OPT_INITIALISE, IEViewOptInit);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 14db0f8852..01566bb6d1 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -26,7 +26,6 @@ #define NCONVERS_BLINKID ((MEVENT)123456) //nconvers' random identifier used to flash an icon for "incoming message" on contact list
-CLIST_INTERFACE *pcli;
CMPlugin g_plugin;
DWORD IDThread = 0;
@@ -248,7 +247,7 @@ BOOL checkUnopenEvents() if (nExternCount && bFlashOnOther)
return TRUE;
- for (nIndex = 0; pCLEvent = pcli->pfnGetEvent(-1, nIndex); nIndex++) {
+ for (nIndex = 0; pCLEvent = g_CLI.pfnGetEvent(-1, nIndex); nIndex++) {
DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg) ||
@@ -424,7 +423,7 @@ static VOID CALLBACK ReminderTimer(HWND, UINT, UINT_PTR, DWORD) return;
}
- for (nIndex = 0; !bReminderDisabled && (pCLEvent = pcli->pfnGetEvent(-1, nIndex)); nIndex++) {
+ for (nIndex = 0; !bReminderDisabled && (pCLEvent = g_CLI.pfnGetEvent(-1, nIndex)); nIndex++) {
DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg) ||
@@ -854,7 +853,7 @@ void countUnopenEvents(int *msgCount, int *fileCount, int *urlCount, int *otherC int nIndex;
CLISTEVENT *pCLEvent;
- for (nIndex = 0; pCLEvent = pcli->pfnGetEvent(-1, nIndex); nIndex++) {
+ for (nIndex = 0; pCLEvent = g_CLI.pfnGetEvent(-1, nIndex); nIndex++) {
DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if (metaCheckProtocol(einfo.szModule, pCLEvent->hContact, einfo.eventType)) {
@@ -927,8 +926,6 @@ static int ModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- pcli = Clist_GetInterface();
-
GetWindowsVersion();
OpenKeyboardDevice();
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index dfe9a1e7f3..025323949c 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -23,7 +23,6 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam); char MODULENAME[64] = {0}; //init at init_pluginname();
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
HINSTANCE hLotusDll;
HEMREGISTRATION hLotusRegister = 0;
@@ -1674,8 +1673,6 @@ static int preshutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
Plugin_Terminated = false;
//if(pluginLink)//strange, but this function is called by Lotus API Extension Manager (instead of MainEntryPoint) probably always with parameter poiter =1
diff --git a/plugins/MagneticWindows/src/MagneticWindows.cpp b/plugins/MagneticWindows/src/MagneticWindows.cpp index ddb16b00b9..c8b23c3615 100644 --- a/plugins/MagneticWindows/src/MagneticWindows.cpp +++ b/plugins/MagneticWindows/src/MagneticWindows.cpp @@ -13,7 +13,6 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// CMPlugin g_plugin; -CLIST_INTERFACE *pcli; /////////////////////////////////////////////////////////////////////////////////////////////////// // Variables @@ -92,7 +91,7 @@ int SnapPluginStart(WPARAM, LPARAM) HookEvent(ME_MSG_WINDOWEVENT, PluginMessageWindowEvent); - WindowOpen(pcli->hwndContactList); + WindowOpen(g_CLI.hwndContactList); return 0; } @@ -109,8 +108,6 @@ int SnapPluginShutDown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load() { - pcli = Clist_GetInterface(); - HookEvent(ME_SYSTEM_MODULESLOADED, SnapPluginStart); HookEvent(ME_SYSTEM_PRESHUTDOWN, SnapPluginShutDown); HookEvent(ME_OPT_INITIALISE, InitOptions); diff --git a/plugins/MagneticWindows/src/SnapToListService.cpp b/plugins/MagneticWindows/src/SnapToListService.cpp index 779e733827..143daf12df 100644 --- a/plugins/MagneticWindows/src/SnapToListService.cpp +++ b/plugins/MagneticWindows/src/SnapToListService.cpp @@ -3,7 +3,7 @@ INT_PTR SnapToList(WPARAM wParam, LPARAM Align) { HWND hWnd = (HWND)wParam; - HWND hWndList = pcli->hwndContactList; + HWND hWndList = g_CLI.hwndContactList; RECT WndRect, ListRect; GetWindowRect(hWnd, &WndRect); diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 644b5fe3bc..700cbebb99 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -16,7 +16,6 @@ const int vf_default = VF_VS | VF_HFL | VF_IGN | VF_CID | VF_SHOWID | VF_RECV | VF_STAT | VF_SMNAME | VF_CIDN | VF_CIP;
-CLIST_INTERFACE *pcli;
HGENMENU hmenuVis, hmenuOff, hmenuHide, hmenuIgnore, hmenuProto, hmenuAdded, hmenuAuthReq;
HGENMENU hmenuCopyID, hmenuRecvFiles, hmenuStatusMsg, hmenuCopyIP, hmenuCopyMirVer;
static HGENMENU hIgnoreItem[9], hProtoItem[MAX_PROTOS];
@@ -426,7 +425,7 @@ static INT_PTR onSendAuthRequest(WPARAM wparam, LPARAM) if (flags&PF4_NOCUSTOMAUTH)
ProtoChainSend(hContact, PSS_AUTHREQUEST, 0, (LPARAM)L"");
else
- CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_AUTHREQ), pcli->hwndContactList, AuthReqWndProc, (LPARAM)hContact);
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_AUTHREQ), g_CLI.hwndContactList, AuthReqWndProc, (LPARAM)hContact);
return 0;
}
@@ -1052,8 +1051,6 @@ static int PluginInit(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- pcli = Clist_GetInterface();
-
g_plugin.registerIcon(LPGEN("MenuItemEx"), iconList);
g_plugin.registerIcon(LPGEN("MenuItemEx"), overlayIconList);
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 92b1fe1170..5580aa8c92 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -796,7 +796,7 @@ bool CAppletManager::IsMessageWindowOpen(MCONTACT hContact) void CAppletManager::MarkMessageAsRead(MCONTACT hContact, MEVENT hEvent) { db_event_markRead(hContact, hEvent); - pcli->pfnRemoveEvent(hContact, hEvent); + g_CLI.pfnRemoveEvent(hContact, hEvent); } //************************************************************************ diff --git a/plugins/MirandaG15/src/Miranda.cpp b/plugins/MirandaG15/src/Miranda.cpp index 6333d41c53..90cd6fcede 100644 --- a/plugins/MirandaG15/src/Miranda.cpp +++ b/plugins/MirandaG15/src/Miranda.cpp @@ -59,7 +59,6 @@ bool g_bInitialized; // Plugin Information
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
// Function Prototypes
int Init(WPARAM, LPARAM);
@@ -92,8 +91,6 @@ CMPlugin::CMPlugin() : EXTERN_C int __declspec(dllexport) Load()
{
- pcli = Clist_GetInterface();
-
g_bInitialized = false;
InitDebug();
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 42a2565445..2ea67d87d2 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -272,7 +272,7 @@ int CreateFrame() if (g_bFramesExist) {
hwnd_frame = CreateWindow(WINDOW_CLASS_NAME, TranslateT("My details"), WS_CHILD | WS_VISIBLE,
- 0, 0, 10, 10, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ 0, 0, 10, 10, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
CLISTFrame Frame = { 0 };
@@ -317,7 +317,7 @@ int CreateFrame() hwnd_container = CreateWindowEx(WS_EX_TOOLWINDOW, CONTAINER_CLASS_NAME, TranslateT("My details"),
(WS_THICKFRAME | WS_CAPTION | WS_SYSMENU) & ~WS_VISIBLE,
- 0, 0, 200, 130, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ 0, 0, 200, 130, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
hwnd_frame = CreateWindow(WINDOW_CLASS_NAME, TranslateT("My details"), WS_CHILD | WS_VISIBLE,
0, 0, 10, 10, hwnd_container, nullptr, g_plugin.getInst(), nullptr);
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp index 88a07681a4..ef5f5c2482 100644 --- a/plugins/MyDetails/src/mydetails.cpp +++ b/plugins/MyDetails/src/mydetails.cpp @@ -20,7 +20,6 @@ Boston, MA 02111-1307, USA. #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
bool g_bAvsExist;
@@ -132,8 +131,6 @@ static int MainUninit(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load()
{
- pcli = Clist_GetInterface();
-
// Hook event to load messages and show first one
HookEvent(ME_SYSTEM_MODULESLOADED, MainInit);
HookEvent(ME_SYSTEM_PRESHUTDOWN, MainUninit);
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp index ec4acf3996..08e6141ce4 100644 --- a/plugins/NewEventNotify/src/main.cpp +++ b/plugins/NewEventNotify/src/main.cpp @@ -31,7 +31,6 @@ PLUGIN_OPTIONS pluginOptions; //---------------------------
//---Some global variables for the plugin
-CLIST_INTERFACE *pcli;
CMPlugin g_plugin;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -136,8 +135,6 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_MODULESLOADED, HookedInit);
HookEvent(ME_OPT_INITIALISE, HookedOptions);
- pcli = Clist_GetInterface();
-
OptionsInit(&pluginOptions);
return 0;
}
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index b0d7d859c2..9ce4dd2a41 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -85,7 +85,7 @@ int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA* pdata) return 0;
for (int idx = 0;; idx++) {
- CLISTEVENT *cle = pcli->pfnGetEvent(pdata->hContact, idx);
+ CLISTEVENT *cle = g_CLI.pfnGetEvent(pdata->hContact, idx);
if (cle == nullptr)
break;
@@ -104,7 +104,7 @@ int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA* pdata) EVENT_DATA_EX *eventData = pdata->firstEventData;
pdata->iLock = 1;
while (eventData) {
- pcli->pfnRemoveEvent(pdata->hContact, eventData->hEvent);
+ g_CLI.pfnRemoveEvent(pdata->hContact, eventData->hEvent);
db_event_markRead(pdata->hContact, eventData->hEvent);
eventData = eventData->next;
}
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index ee5564be32..1a89ea51bb 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -21,7 +21,6 @@ #include "stdafx.h"
-CLIST_INTERFACE *pcli;
CMPlugin g_plugin;
LIST<DBEVENT> eventListXStatus(10, PtrKeySortT);
@@ -331,7 +330,7 @@ void BlinkIcon(MCONTACT hContact, HICON hIcon, wchar_t *stzText) cle.hIcon = hIcon;
cle.pszService = "UserOnline/Description";
cle.szTooltip.w = stzText;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
void PlayChangeSound(MCONTACT hContact, const char *name)
@@ -1147,8 +1146,6 @@ static int OnShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
g_plugin.registerIcon(LPGEN("New Status Notify"), iconList, MODULE);
//"Service" Hook, used when the DB settings change: we'll monitor the "status" setting.
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp index 84381ae945..0718d35605 100644 --- a/plugins/Non-IM Contact/src/main.cpp +++ b/plugins/Non-IM Contact/src/main.cpp @@ -6,7 +6,6 @@ #include "Version.h"
-CLIST_INTERFACE *pcli;
CMPlugin g_plugin;
INT_PTR doubleClick(WPARAM wParam, LPARAM)
@@ -114,8 +113,6 @@ IconItem iconList[] = extern "C" __declspec(dllexport) int Load()
{
- pcli = Clist_GetInterface();
-
g_plugin.registerIcon(LPGEN("Non-IM Contact"), iconList);
HookEvent(ME_CLIST_DOUBLECLICKED, (MIRANDAHOOK)doubleClick);
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index d705e5776e..92e83ed312 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -1,6 +1,5 @@ #include "globals.h"
-CLIST_INTERFACE *pcli;
CMPlugin g_plugin;
HINSTANCE hmiranda = nullptr;
@@ -269,7 +268,6 @@ int OnModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- pcli = Clist_GetInterface();
hmiranda = GetModuleHandle(nullptr);
INITCOMMONCONTROLSEX ctrls = { 0 };
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index e15415e8c4..32adf4521e 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -140,12 +140,12 @@ static void RemoveReminderSystemEvent(REMINDERDATA *p) {
if (p->SystemEventQueued) {
for (int i = 0;; i++) {
- CLISTEVENT *pev = pcli->pfnGetEvent(-1, i);
+ CLISTEVENT *pev = g_CLI.pfnGetEvent(-1, i);
if (!pev)
break;
if ((ULONG)pev->lParam == p->uid && !pev->hContact && pev->pszService && !mir_strcmp(pev->pszService, MODULENAME"/OpenTriggeredReminder")) {
- if (!pcli->pfnRemoveEvent(pev->hContact, pev->hDbEvent)) {
+ if (!g_CLI.pfnRemoveEvent(pev->hContact, pev->hDbEvent)) {
p->SystemEventQueued = FALSE;
if (QueuedReminderCount)
QueuedReminderCount--;
@@ -529,7 +529,7 @@ static void FireReminder(REMINDERDATA *pReminder, BOOL *pHasPlayedSound) ev.lParam = (LPARAM)pReminder->uid;
ev.pszService = MODULENAME"/OpenTriggeredReminder";
ev.szTooltip.a = Translate("Reminder");
- pcli->pfnAddEvent(&ev);
+ g_CLI.pfnAddEvent(&ev);
}
pReminder->SystemEventQueued = TRUE;
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index aacea0f23c..e4eaf555c9 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -10,7 +10,6 @@ CShake shake; CNudge GlobalNudge;
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
static IconItem iconList[] =
{
@@ -86,7 +85,7 @@ static INT_PTR NudgeSend(WPARAM hContact, LPARAM lParam) void OpenContactList()
{
- HWND hWnd = pcli->hwndContactList;
+ HWND hWnd = g_CLI.hwndContactList;
ShowWindow(hWnd, SW_RESTORE);
ShowWindow(hWnd, SW_SHOW);
}
@@ -476,8 +475,6 @@ static int AccListChanged(WPARAM wParam, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
LoadIcons();
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
diff --git a/plugins/Nudge/src/shake.cpp b/plugins/Nudge/src/shake.cpp index d66d7ad6be..afcb4181f8 100644 --- a/plugins/Nudge/src/shake.cpp +++ b/plugins/Nudge/src/shake.cpp @@ -31,7 +31,7 @@ void __cdecl ShakeClistWindow(void *Param) INT_PTR ShakeClist(WPARAM, LPARAM)
{
- mir_forkthread(ShakeClistWindow, (void*)pcli->hwndContactList);
+ mir_forkthread(ShakeClistWindow, (void*)g_CLI.hwndContactList);
return 0;
}
diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index 88b3c2b0a4..99cc6b67e3 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -1,6 +1,5 @@ #include "stdafx.h"
-CLIST_INTERFACE *pcli;
CMPlugin g_plugin;
HNETLIBUSER hNetlibUser = nullptr;
@@ -119,8 +118,6 @@ static IconItem iconList[] = extern "C" __declspec(dllexport) int Load(void)
{
- pcli = Clist_GetInterface();
-
use_raw_ping = false;
db_set_b(0, MODULENAME, "UsingRawSockets", (BYTE)use_raw_ping);
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index b994f24d1a..0abd6c1025 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -842,7 +842,7 @@ void AttachToClist(bool attach) void InitList()
{
- hwnd_clist = pcli->hwndContactList;
+ hwnd_clist = g_CLI.hwndContactList;
WNDCLASS wndclass;
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 9e4361538e..2e813cd598 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -181,7 +181,7 @@ INT_PTR ToggleEnabled(WPARAM wParam, LPARAM) { INT_PTR EditContact(WPARAM wParam, LPARAM)
{
PINGLIST pl;
- HWND hwndList = pcli->hwndContactList;
+ HWND hwndList = g_CLI.hwndContactList;
CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index f0f0fe2ee0..51f7891dce 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -36,7 +36,7 @@ void UpgradeDb(); //===== Initializations =================================================================
static int OkToExit(WPARAM, LPARAM);
bool OptionLoaded = false;
-CLIST_INTERFACE *pcli;
+
CMPlugin g_plugin;
//===== Global variables ================================================================
@@ -321,8 +321,6 @@ static int OnShutdown(WPARAM, LPARAM) MIRAPI int Load(void)
{
- pcli = Clist_GetInterface();
-
CreateServiceFunction(MS_POPUP_GETSTATUS, GetStatus);
#if defined(_DEBUG)
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 3aa0a05167..2037f2d46f 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -69,7 +69,7 @@ bool UpdatePopupPosition(PopupWnd2 *prev, PopupWnd2 *wnd) else { // Multimonitor stuff (we have more then 1)
HWND hWnd;
if (PopupOptions.Monitor == MN_MIRANDA)
- hWnd = pcli->hwndContactList;
+ hWnd = g_CLI.hwndContactList;
else // PopupOptions.Monitor == MN_ACTIVE
hWnd = GetForegroundWindow();
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index d3b0dcc47a..750249de5e 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -10,7 +10,7 @@ char *szProto; CMPlugin g_plugin;
CHAT_MANAGER *pci;
-CLIST_INTERFACE *pcli;
+
HANDLE hTopToolbarButtonShowList;
HANDLE hMsgWndEvent;
HGENMENU hMenuItemRemove;
@@ -255,7 +255,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM if (!restorePos) {
RECT rect;
- if (GetWindowRect(pcli->hwndContactList, &rect)) {
+ if (GetWindowRect(g_CLI.hwndContactList, &rect)) {
WINDOWPLACEMENT wp;
wp.length = sizeof(wp);
@@ -266,7 +266,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM int width = db_get_dw(NULL, MODULENAME, szSettingName, -1);
int right = rect.left - 6;
- if (!IsWindowVisible(pcli->hwndContactList)) right = rect.right;
+ if (!IsWindowVisible(g_CLI.hwndContactList)) right = rect.right;
wp.rcNormalPosition.left = right - width;
wp.rcNormalPosition.top = rect.top;
@@ -546,7 +546,6 @@ static INT_PTR ToggleIgnore(WPARAM hContact, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- pcli = Clist_GetInterface();
pci = Chat_GetInterface();
CoInitialize(nullptr);
diff --git a/plugins/SMS/src/main.cpp b/plugins/SMS/src/main.cpp index cbff1d1ed4..f2f23f7e68 100644 --- a/plugins/SMS/src/main.cpp +++ b/plugins/SMS/src/main.cpp @@ -28,7 +28,6 @@ Enjoy the code and use it smartly! #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
SMS_SETTINGS ssSMSSettings;
@@ -115,8 +114,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
HookEvent(ME_SYSTEM_MODULESLOADED,OnModulesLoaded);
HookEvent(ME_SYSTEM_PRESHUTDOWN,OnPreShutdown);
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index b446b1b437..60d9eab6f6 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -240,7 +240,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_SMS);
cle.pszService = szServiceFunction;
cle.szTooltip.w = szToolTip;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
}
}
@@ -263,7 +263,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) cle.hIcon = (HICON)LoadImage(ssSMSSettings.hInstance, MAKEINTRESOURCE(iIcon), IMAGE_ICON, 0, 0, LR_SHARED);
cle.pszService = szServiceFunction;
cle.szTooltip.w = szToolTip;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
}
}
diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index 1e15a44cb4..cf8ab79cda 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -922,8 +922,8 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (m_si->wState & GC_EVENT_HIGHLIGHT) {
m_si->wState &= ~GC_EVENT_HIGHLIGHT;
- if (pcli->pfnGetEvent(m_hContact, 0))
- pcli->pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
+ if (g_CLI.pfnGetEvent(m_hContact, 0))
+ g_CLI.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
}
FixTabIcons();
@@ -1017,8 +1017,8 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode", 0) != 0)
db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0);
- if (pcli->pfnGetEvent(m_hContact, 0))
- pcli->pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
+ if (g_CLI.pfnGetEvent(m_hContact, 0))
+ g_CLI.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
break;
case WM_NOTIFY:
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index dfe96a95af..76b691b2c9 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1308,7 +1308,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & DBEF_SENT) && (DbEventIsMessageOrCustom(&dbei) || dbei.eventType == EVENTTYPE_URL))
- pcli->pfnRemoveEvent(m_hContact, hDbEvent);
+ g_CLI.pfnRemoveEvent(m_hContact, hDbEvent);
hDbEvent = db_event_next(m_hContact, hDbEvent);
}
}
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index f594b637c1..15de2e0439 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -128,7 +128,7 @@ EventData* getEventFromDB(CSrmmWindow *dat, MCONTACT hContact, MEVENT hDbEvent) evt->custom = DbEventIsCustomForMsgWindow(&dbei);
if (!(dbei.flags & DBEF_SENT) && (dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_URL || evt->custom)) {
db_event_markRead(hContact, hDbEvent);
- pcli->pfnRemoveEvent(hContact, hDbEvent);
+ g_CLI.pfnRemoveEvent(hContact, hDbEvent);
}
else if (dbei.eventType == EVENTTYPE_JABBER_CHATSTATES || dbei.eventType == EVENTTYPE_JABBER_PRESENCE)
db_event_markRead(hContact, hDbEvent);
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 9f92022b07..fcd32c8d2e 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -102,7 +102,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) if (dbei.flags & DBEF_SENT || !DbEventIsMessageOrCustom(&dbei))
return 0;
- pcli->pfnRemoveEvent(hContact, 1);
+ g_CLI.pfnRemoveEvent(hContact, 1);
/* does a window for the contact exist? */
if (hwnd == nullptr) {
/* new message */
@@ -123,7 +123,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = MS_MSG_READMESSAGE;
cle.szTooltip.w = toolTip;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
return 0;
}
@@ -197,7 +197,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) wchar_t szTip[256];
mir_snwprintf(szTip, TranslateT("%s is typing a message"), Clist_GetContactDisplayName(hContact));
if (g_dat.flags2 & SMF2_SHOWTYPINGCLIST) {
- pcli->pfnRemoveEvent(hContact, 1);
+ g_CLI.pfnRemoveEvent(hContact, 1);
CLISTEVENT cle = {};
cle.hContact = hContact;
@@ -206,7 +206,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) cle.hIcon = GetCachedIcon("scriver_TYPING");
cle.pszService = MS_MSG_TYPINGMESSAGE;
cle.szTooltip.w = szTip;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
else Clist_TrayNotifyW(nullptr, TranslateT("Typing notification"), szTip, NIIF_INFO, 1000 * 4);
}
@@ -280,7 +280,7 @@ static void RestoreUnreadMessageAlerts(void) mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(e->hContact));
cle.hContact = e->hContact;
cle.hDbEvent = e->hEvent;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
}
diff --git a/plugins/Scriver/src/srmm.cpp b/plugins/Scriver/src/srmm.cpp index 3fe63d5923..5987790e72 100644 --- a/plugins/Scriver/src/srmm.cpp +++ b/plugins/Scriver/src/srmm.cpp @@ -27,7 +27,6 @@ int OnLoadModule(void); int OnUnloadModule(void);
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
ITaskbarList3 *pTaskbarInterface;
@@ -58,9 +57,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRMM, extern "C" __declspec(dllexport) int Load(void)
{
- // set the memory manager
- pcli = Clist_GetInterface();
-
if (IsWinVer7Plus())
CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_ITaskbarList3, (void**)&pTaskbarInterface);
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 709e650bfd..5e3d38d1be 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -17,7 +17,6 @@ Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
HGENMENU hToggle, hEnableMenu;
BOOL gbVarsServiceExist = FALSE;
@@ -244,8 +243,6 @@ IconItem iconList[] = extern "C" int __declspec(dllexport)Load(void)
{
- pcli = Clist_GetInterface();
-
CreateServiceFunction(MODULENAME"/ToggleEnable", ToggleEnable);
CreateServiceFunction(MODULENAME"/ToggleAutoanswer", Toggle);
diff --git a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp index a4e67e1b31..7f4463a93e 100644 --- a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp +++ b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp @@ -268,13 +268,13 @@ static int OnShutdown(WPARAM, LPARAM) // set windowstate and docked for next startup if (db_get_b(0, SSMODULENAME, SETTING_SETWINSTATE, 0)) { int state = db_get_b(0, SSMODULENAME, SETTING_WINSTATE, SETTING_STATE_NORMAL); - HWND hClist = pcli->hwndContactList; + HWND hClist = g_CLI.hwndContactList; BOOL isHidden = !IsWindowVisible(hClist); switch (state) { case SETTING_STATE_HIDDEN: // try to use services where possible if (!isHidden) - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); break; case SETTING_STATE_MINIMIZED: @@ -285,7 +285,7 @@ static int OnShutdown(WPARAM, LPARAM) case SETTING_STATE_NORMAL: // try to use services where possible (that's what they're for) if (isHidden) - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); break; } } @@ -366,7 +366,7 @@ int SSModuleLoaded(WPARAM, LPARAM) // win size and location if (db_get_b(0, SSMODULENAME, SETTING_SETWINLOCATION, 0) || db_get_b(0, SSMODULENAME, SETTING_SETWINSIZE, 0)) { - HWND hClist = pcli->hwndContactList; + HWND hClist = g_CLI.hwndContactList; // store in db if (db_get_b(0, SSMODULENAME, SETTING_SETWINLOCATION, 0)) { diff --git a/plugins/StatusManager/src/main.cpp b/plugins/StatusManager/src/main.cpp index d5f1aa39a5..7bf1f1f69a 100644 --- a/plugins/StatusManager/src/main.cpp +++ b/plugins/StatusManager/src/main.cpp @@ -20,7 +20,6 @@ #include "stdafx.h" CMPlugin g_plugin; -CLIST_INTERFACE *pcli; ///////////////////////////////////////////////////////////////////////////////////////// // returns plugin's extended information @@ -95,8 +94,6 @@ int OnAccChanged(WPARAM wParam, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged); diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp index c46d86c32a..ad0d30d992 100644 --- a/plugins/StopSpamPlus/src/stopspam.cpp +++ b/plugins/StopSpamPlus/src/stopspam.cpp @@ -1,7 +1,6 @@ #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
/////////////////////////////////////////////////////////////////////////////////////////
// returns plugin's extended information
@@ -27,8 +26,6 @@ CMPlugin::CMPlugin() : extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
CreateServiceFunction(MS_STOPSPAM_CONTACTPASSED, IsContactPassed);
HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded);
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp index 79bc186c61..180fa5d386 100644 --- a/plugins/TabSRMM/src/chat_tools.cpp +++ b/plugins/TabSRMM/src/chat_tools.cpp @@ -38,8 +38,8 @@ static void __stdcall Chat_DismissPopup(void *pi) {
SESSION_INFO *si = (SESSION_INFO*)pi;
if (si->hContact)
- if (pcli->pfnGetEvent(si->hContact, 0))
- pcli->pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ if (g_CLI.pfnGetEvent(si->hContact, 0))
+ g_CLI.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
if (si->pDlg && KillTimer(si->pDlg->GetHwnd(), TIMERID_FLASHWND))
FlashWindow(si->pDlg->GetHwnd(), FALSE);
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index 88f561d7be..49100fe14c 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -183,8 +183,8 @@ void CChatRoomDlg::UpdateWindowState(UINT msg) if (m_iTabID >= 0) { if (db_get_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0) != 0) db_set_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0); - if (pcli->pfnGetEvent(m_si->hContact, 0)) - pcli->pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT); + if (g_CLI.pfnGetEvent(m_si->hContact, 0)) + g_CLI.pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT); UpdateTitle(); m_hTabIcon = m_hTabStatusIcon; @@ -581,8 +581,8 @@ void CChatRoomDlg::OnDestroy() if (m_nTypeMode == PROTOTYPE_SELFTYPING_ON) DM_NotifyTyping(PROTOTYPE_SELFTYPING_OFF); - if (pcli->pfnGetEvent(m_si->hContact, 0)) - pcli->pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT); + if (g_CLI.pfnGetEvent(m_si->hContact, 0)) + g_CLI.pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT); m_si->wState &= ~STATE_TALK; m_si->pDlg = nullptr; m_si = nullptr; diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index b581b21121..0799699983 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -111,7 +111,7 @@ void CGlobals::reloadSystemModulesChanged() }
else db_set_b(0, SRMSGMOD_T, "ieview_installed", 0);
- m_hwndClist = pcli->hwndContactList;
+ m_hwndClist = g_CLI.hwndContactList;
g_bPopupAvail = ServiceExists(MS_POPUP_ADDPOPUPT) != 0;
@@ -528,7 +528,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(e->hContact));
cle.hContact = e->hContact;
cle.hDbEvent = e->hEvent;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
}
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 89d3f904ad..4df021f7a5 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -143,7 +143,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_HOTKEY:
{
- CLISTEVENT *cli = pcli->pfnGetEvent(-1, 0);
+ CLISTEVENT *cli = g_CLI.pfnGetEvent(-1, 0);
if (cli != nullptr) {
if (strncmp(cli->pszService, MS_MSG_TYPINGMESSAGE, mir_strlen(cli->pszService))) {
CallService(cli->pszService, 0, (LPARAM)cli);
@@ -337,11 +337,11 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (lParam == 0)
HandleMenuEntryFromhContact(wParam);
else {
- CLISTEVENT *cle = pcli->pfnGetEvent(wParam, 0);
+ CLISTEVENT *cle = g_CLI.pfnGetEvent(wParam, 0);
if (cle) {
if (ServiceExists(cle->pszService)) {
CallService(cle->pszService, 0, (LPARAM)cle);
- pcli->pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ g_CLI.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
}
}
// still, we got that message posted.. the event may be waiting in tabSRMMs tray...
@@ -380,7 +380,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case DM_REMOVECLISTEVENT:
// sent from the popup to "dismiss" the event. we should do this in the main thread
- pcli->pfnRemoveEvent(wParam, lParam);
+ g_CLI.pfnRemoveEvent(wParam, lParam);
db_event_markRead(wParam, lParam);
return 0;
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index e7ca3940e3..d64e729331 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -276,7 +276,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) Clist_TrayNotifyW(nullptr, TranslateT("Typing notification"), szTip, NIIF_INFO, 1000 * 4); if (fShowOnClist) { - pcli->pfnRemoveEvent(hContact, 1); + g_CLI.pfnRemoveEvent(hContact, 1); CLISTEVENT cle = {}; cle.hContact = hContact; @@ -285,7 +285,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) cle.hIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]; cle.pszService = MS_MSG_TYPINGMESSAGE; cle.szTooltip.w = szTip; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } } return 0; @@ -390,7 +390,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) if (dbei.markedRead() || (isCustomEvent && !isShownCustomEvent)) return 0; - pcli->pfnRemoveEvent(hContact, 1); + g_CLI.pfnRemoveEvent(hContact, 1); bool bAllowAutoCreate = false; bool bAutoPopup = M.GetBool(SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP); @@ -518,7 +518,7 @@ nowindowcreate: contactName = Clist_GetContactDisplayName(hContact); mir_snwprintf(toolTip, TranslateT("Message from %s"), contactName); cle.szTooltip.w = toolTip; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, nullptr, nullptr, dbei.szModule); } diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 58b24b432f..725632bf14 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -277,7 +277,7 @@ void CSrmmWindow::MsgWindowUpdateState(UINT msg) if (m_dwFlagsEx & MWF_SHOW_FLASHCLIST) {
m_dwFlagsEx &= ~MWF_SHOW_FLASHCLIST;
if (m_hFlashingEvent != 0)
- pcli->pfnRemoveEvent(m_hContact, m_hFlashingEvent);
+ g_CLI.pfnRemoveEvent(m_hContact, m_hFlashingEvent);
m_hFlashingEvent = 0;
}
m_pContainer->dwFlags &= ~CNT_NEED_UPDATETITLE;
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index a72e879343..39ef10892e 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -778,7 +778,7 @@ void CTabBaseDlg::FlashOnClist(MEVENT hEvent, DBEVENTINFO *dbei) cle.hDbEvent = hEvent;
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = MS_MSG_READMESSAGE;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
m_dwFlagsEx |= MWF_SHOW_FLASHCLIST;
m_hFlashingEvent = hEvent;
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index e083b545fd..d275d001c1 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -482,7 +482,7 @@ static char* Template_CreateRTFFromDbEvent(CTabBaseDlg *dat, MCONTACT hContact, if (!isSent && (bIsStatusChangeEvent || dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) {
db_event_markRead(hContact, hDbEvent);
- pcli->pfnRemoveEvent(hContact, hDbEvent);
+ g_CLI.pfnRemoveEvent(hContact, hDbEvent);
}
g_groupBreak = TRUE;
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 2c4e0acfe3..22d4ace74c 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -35,7 +35,6 @@ LOGFONT lfDefault = { 0 }; */ CMPlugin g_plugin; -CLIST_INTERFACE *pcli; ///////////////////////////////////////////////////////////////////////////////////////// @@ -69,8 +68,6 @@ extern "C" int __declspec(dllexport) Load(void) return 1; } - pcli = Clist_GetInterface(); - SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfDefault), &lfDefault, FALSE); Chat_Load(); diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index ac94a7b7f8..caee65d88e 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -237,7 +237,7 @@ void DeinitMessagePump() INT_PTR ShowTip(WPARAM wParam, LPARAM lParam)
{
CLCINFOTIP *clcit = (CLCINFOTIP *)lParam;
- HWND clist = pcli->hwndContactTree;
+ HWND clist = g_CLI.hwndContactTree;
if (clcit->isGroup) return 0; // no group tips (since they're pretty useless)
if (clcit->isTreeFocused == 0 && !opt.bShowNoFocus && clist == WindowFromPoint(clcit->ptCursor)) return 0;
@@ -269,7 +269,7 @@ int ShowTipHook(WPARAM wParam, LPARAM lParam) INT_PTR ShowTipW(WPARAM wParam, LPARAM lParam)
{
CLCINFOTIP *clcit = (CLCINFOTIP *)lParam;
- HWND clist = pcli->hwndContactTree;
+ HWND clist = g_CLI.hwndContactTree;
if (clcit->isGroup) return 0; // no group tips (since they're pretty useless)
if (clcit->isTreeFocused == 0 && !opt.bShowNoFocus && clist == WindowFromPoint(clcit->ptCursor)) return 0;
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 5cee51d439..2e64843f24 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -21,7 +21,6 @@ Boston, MA 02111-1307, USA. #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
FontIDW fontTitle, fontLabels, fontValues, fontTrayTitle;
ColourIDW colourBg, colourBorder, colourAvatarBorder, colourDivider, colourSidebar;
@@ -316,8 +315,6 @@ IconItem iconList[] = extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
iCodePage = Langpack_GetDefaultCodePage();
g_plugin.registerIcon(MODULENAME, iconList, MODULENAME);
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index a70a3d5c85..3644de47d4 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -837,7 +837,7 @@ void CTooltipNotify::OnTooltipDblClicked(CTooltip *pTooltip) {
switch (m_sOptions.bLDblClick) {
case SHOW_HIDE_CLIST:
- pcli->pfnShowHide();
+ g_CLI.pfnShowHide();
break;
case OPEN_MSGDLG:
@@ -851,7 +851,7 @@ void CTooltipNotify::OnTooltipDblClicked(CTooltip *pTooltip) }
default:
- pcli->pfnShowHide();
+ g_CLI.pfnShowHide();
break;
}
}
diff --git a/plugins/TooltipNotify/src/main.cpp b/plugins/TooltipNotify/src/main.cpp index 618e1adf9e..05fbbbe7ee 100644 --- a/plugins/TooltipNotify/src/main.cpp +++ b/plugins/TooltipNotify/src/main.cpp @@ -12,7 +12,7 @@ static HANDLE g_hProtoContactIsTyping = nullptr; // Main global object
static CTooltipNotify *g_pTooltipNotify = nullptr;
-CLIST_INTERFACE *pcli;
+
CMPlugin g_plugin;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -69,8 +69,6 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
g_pTooltipNotify = new CTooltipNotify();
assert(g_pTooltipNotify!=nullptr);
diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp index 56c3714919..b1e2613b0a 100644 --- a/plugins/TopToolBar/src/InternalButtons.cpp +++ b/plugins/TopToolBar/src/InternalButtons.cpp @@ -38,7 +38,7 @@ INT_PTR TTBInternalMainMenuButt(WPARAM, LPARAM) {
POINT pt;
GetCursorPos(&pt);
- TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
return 0;
}
@@ -46,7 +46,7 @@ INT_PTR TTBInternalStatusMenuButt(WPARAM, LPARAM) {
POINT pt;
GetCursorPos(&pt);
- TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
return 0;
}
@@ -61,7 +61,7 @@ INT_PTR TTBInternalSoundsOnOff(WPARAM, LPARAM) void InitInternalButtons()
{
- hwndContactTree = pcli->hwndContactTree;
+ hwndContactTree = g_CLI.hwndContactTree;
CreateServiceFunction(TTBI_SOUNDSONOFF, TTBInternalSoundsOnOff);
CreateServiceFunction(TTBI_MAINMENUBUTT, TTBInternalMainMenuButt);
diff --git a/plugins/TopToolBar/src/main.cpp b/plugins/TopToolBar/src/main.cpp index 2715332a7a..e83a59dd08 100644 --- a/plugins/TopToolBar/src/main.cpp +++ b/plugins/TopToolBar/src/main.cpp @@ -2,7 +2,6 @@ #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
IconItem iconList[] =
{
@@ -42,8 +41,6 @@ CMPlugin::CMPlugin() : extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
g_plugin.registerIcon(TTB_OPTDIR, iconList, TTB_OPTDIR);
LoadToolbarModule();
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index cef033447d..cd5dcf1900 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -240,7 +240,7 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara void CALLBACK OnEventFire() { - HWND parent = pcli->hwndContactList; + HWND parent = g_CLI.hwndContactList; if (parent == nullptr) // no clist, no buttons return; diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index f0d3703806..a49d09d34d 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -29,7 +29,6 @@ int NumberOfAccounts; HWND TrafficHwnd;
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
BOOL bPopupExists = FALSE, bVariablesExists = FALSE, bTooltipExists = FALSE;
@@ -225,7 +224,7 @@ int TrafficCounter_PaintCallbackProc(HWND hWnd, HDC hDC, RECT*, HRGN, DWORD, voi int TrafficCounter_Draw(HWND hwnd, HDC hDC)
{
if (hwnd == (HWND)-1) return 0;
- if (GetParent(hwnd) == pcli->hwndContactList)
+ if (GetParent(hwnd) == g_CLI.hwndContactList)
return PaintTrafficCounterWindow(hwnd, hDC);
else
InvalidateRect(hwnd, nullptr, FALSE);
@@ -1142,15 +1141,13 @@ static int TrafficCounterModulesLoaded(WPARAM, LPARAM) HookEvent(ME_NETLIB_FASTRECV, TrafficRecv);
HookEvent(ME_NETLIB_FASTSEND, TrafficSend);
- CreateTrafficWindow(pcli->hwndContactList);
+ CreateTrafficWindow(g_CLI.hwndContactList);
UpdateFonts(0, 0); //Load and create fonts here
return 0;
}
extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
HookEvent(ME_OPT_INITIALISE, TrafficCounterOptInitialise);
HookEvent(ME_SYSTEM_MODULESLOADED, TrafficCounterModulesLoaded);
HookEvent(ME_PROTO_ACK, ProtocolAckHook);
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 2bc8a85ab3..30832b7889 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -1514,7 +1514,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar pPs->dwFlags &= ~PSF_CHANGED;
EnableWindow(GetDlgItem(hDlg, IDAPPLY), FALSE);
- pcli->pfnInvalidateDisplayNameCacheEntry(pPs->hContact);
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(pPs->hContact);
// need to upload owners settings
if (!pPs->hContact && myGlobals.CanChangeDetails && db_get_b(NULL, MODULENAME, SET_PROPSHEET_CHANGEMYDETAILS, FALSE)) {
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index b7ddb5b4a7..458a9ea3de 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -266,7 +266,7 @@ INT_PTR svcExIm_Group_Service(WPARAM wParam, LPARAM) LPTSTR ptszGroup = tszGroup;
LPTSTR ptszItem = tszItem;
- HWND hClist = pcli->hwndContactTree;
+ HWND hClist = g_CLI.hwndContactTree;
// get clist selection
hItem = SendMessage(hClist,CLM_GETSELECTION,0,0);
hRoot = SendMessage(hClist,CLM_GETNEXTITEM, (WPARAM)CLGN_ROOT, (LPARAM)hItem);
@@ -325,7 +325,7 @@ INT_PTR svcExIm_Account_Service(WPARAM, LPARAM lParam) {
ExImParam ExIm;
memset(&ExIm, 0, sizeof(ExIm));
- HWND hClist = pcli->hwndContactTree;
+ HWND hClist = g_CLI.hwndContactTree;
lpStatusMenuExecParam smep = (lpStatusMenuExecParam)Menu_GetItemData((HGENMENU)lParam);
ExIm.pszName = mir_strdup(smep->proto);
ExIm.Typ = EXIM_ACCOUNT;
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp index 25334f92f6..ce0260655c 100644 --- a/plugins/UserInfoEx/src/init.cpp +++ b/plugins/UserInfoEx/src/init.cpp @@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-CLIST_INTERFACE *pcli;
CMPlugin g_plugin;
HMODULE hDwmApi;
@@ -160,9 +159,6 @@ extern "C" int __declspec(dllexport) Load(void) memset(&myGlobals, 0, sizeof(MGLOBAL));
- // init clist interface
- pcli = Clist_GetInterface();
-
if (IsWinVerVistaPlus()) {
hDwmApi = LoadLibraryA("dwmapi.dll");
if (hDwmApi)
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index dd84444186..ea97bdaa89 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -489,14 +489,14 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) // on call by hook or first start
if (!lParam || !hMenuItemAccount) {
- size_t sizeNew = mItems * pcli->menuProtos->getCount() * sizeof(HGENMENU);
+ size_t sizeNew = mItems * g_CLI.menuProtos->getCount() * sizeof(HGENMENU);
hMenuItemAccount = (HGENMENU*)mir_realloc(hMenuItemAccount, sizeNew);
// set all bytes 0 to avoid problems
memset(hMenuItemAccount, 0, sizeNew);
}
// on options change
else // delete all MenuItems backward (first item second group)
- RemoveMenuItems(hMenuItemAccount, mItems * pcli->menuProtos->getCount());
+ RemoveMenuItems(hMenuItemAccount, mItems * g_CLI.menuProtos->getCount());
// load options
int flag = db_get_b(NULL, MODULENAME, SET_MI_ACCOUNT, MCAS_NOTINITIATED);
@@ -506,7 +506,7 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) }
// loop for all account names
- for (auto &it : *pcli->menuProtos) {
+ for (auto &it : *g_CLI.menuProtos) {
// set all bytes 0 to avoid problems
item = 0;
@@ -527,7 +527,7 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) // support new genmenu style
mi.root = mhRoot;
- int i = pcli->menuProtos->indexOf(&it);
+ int i = g_CLI.menuProtos->indexOf(&it);
switch (flag) {
case 3:
// cascade off
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 9b1b7a9f8b..4c4cc084a6 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -335,7 +335,7 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) // pszService = "dummy" get 'service not fount' and continue;
cle.pszService = "dummy";
cle.lParam = NULL;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
/**
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index 17894a55e8..ae7244b902 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -46,7 +46,6 @@ unsigned old_status; UINT_PTR timerId;
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
MYOPTIONS opt;
@@ -157,8 +156,6 @@ void InitVar() extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
// initialize global variables
InitVar();
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 84d652670b..3658fcb89d 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -238,7 +238,7 @@ static void addWindow(MCONTACT hContact) db_free(&dbv);
HWND hWnd = CreateWindow(L"WeatherFrame", L"", WS_CHILD | WS_VISIBLE,
- 0, 0, 10, 10, pcli->hwndContactList, nullptr, g_plugin.getInst(), (void*)hContact);
+ 0, 0, 10, 10, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), (void*)hContact);
WindowList_Add(hMwinWindowList, hWnd, hContact);
CLISTFrame Frame = { 0 };
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index b5ffce0881..627ea22e04 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -645,7 +645,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D evt.lParam = ActualAccount->hContact; evt.pszService = MS_YAMN_CLISTDBLCLICK; evt.szTooltip.w = tszMsg; - pcli->pfnAddEvent(&evt); + g_CLI.pfnAddEvent(&evt); } db_set_ws(ActualAccount->hContact, "CList", "StatusMsg", tszMsg); @@ -684,7 +684,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D // and remove the event if ((nflags & YAMN_ACC_CONT) && (!(nflags & YAMN_ACC_CONTNOEVENT)) && (MN->Real.UnSeen + MN->Virtual.UnSeen == 0)) - pcli->pfnRemoveEvent(ActualAccount->hContact, ActualAccount->hContact); + g_CLI.pfnRemoveEvent(ActualAccount->hContact, ActualAccount->hContact); if ((MN->Real.BrowserUC + MN->Virtual.BrowserUC == 0) && (hDlg != nullptr)) { if (!IsWindowVisible(hDlg) && !(nflags & YAMN_ACC_MSG)) @@ -843,7 +843,7 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa #endif } if ((Account->NewMailN.Flags & YAMN_ACC_CONT) && !(Account->NewMailN.Flags & YAMN_ACC_CONTNOEVENT)) - pcli->pfnRemoveEvent(hContact, hContact); + g_CLI.pfnRemoveEvent(hContact, hContact); } __fallthrough; @@ -1683,7 +1683,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR SetTimer(hDlg, TIMER_FLASHING, 500, nullptr); if (ActualAccount->hContact != NULL) - pcli->pfnRemoveEvent(ActualAccount->hContact, (LPARAM)"yamn new mail message"); + g_CLI.pfnRemoveEvent(ActualAccount->hContact, (LPARAM)"yamn new mail message"); mir_subclassWindow(GetDlgItem(hDlg, IDC_LISTMAILS), ListViewSubclassProc); } diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index 763bbe0492..4cd7b8dd43 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -30,7 +30,6 @@ static int iDllPlugins = 0; YAMN_VARIABLES YAMNVar; CMPlugin g_plugin; -CLIST_INTERFACE *pcli; HANDLE hNewMailHook; HANDLE NoWriterEV; @@ -235,8 +234,6 @@ static void LoadPlugins() extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - YAMN_STATUS = ID_STATUS_OFFLINE; // we get the Miranda Root Path diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp index ee8a674678..274dfb2cc7 100644 --- a/plugins/YAPP/src/popwin.cpp +++ b/plugins/YAPP/src/popwin.cpp @@ -81,7 +81,7 @@ void AddWindowToStack(HWND hwnd) { SystemParametersInfo(SPI_GETWORKAREA, 0, &wa_rect, 0);
if (options.use_mim_monitor) {
RECT clr;
- GetWindowRect(pcli->hwndContactList, &clr);
+ GetWindowRect(g_CLI.hwndContactList, &clr);
HMONITOR hMonitor = MonitorFromRect(&clr, MONITOR_DEFAULTTONEAREST);
if (hMonitor) {
MONITORINFO mi;
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index 803f3c446a..6696c73895 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -19,8 +19,6 @@ HFONT hFontFirstLine = nullptr, hFontSecondLine = nullptr, hFontTime = nullptr; COLORREF colFirstLine = RGB(255, 0, 0), colSecondLine = 0, colTime = RGB(0, 0, 255), colBorder = RGB(0, 0, 0),
colSidebar = RGB(128, 128, 128), colTitleUnderline = GetSysColor(COLOR_3DSHADOW);
-CLIST_INTERFACE *pcli;
-
// toptoolbar button
HANDLE hTTButton;
@@ -211,8 +209,6 @@ static int PreShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
InitMessagePump();
InitOptions();
InitNotify();
diff --git a/plugins/ZeroSwitch/src/ZeroSwitch.cpp b/plugins/ZeroSwitch/src/ZeroSwitch.cpp index 6d89d004d4..7b55436f59 100644 --- a/plugins/ZeroSwitch/src/ZeroSwitch.cpp +++ b/plugins/ZeroSwitch/src/ZeroSwitch.cpp @@ -11,7 +11,6 @@ g_plugin; HHOOK hHook;
HWND hDummyWnd = nullptr, hHelperWnd = nullptr, hMirandaWnd = nullptr;
-CLIST_INTERFACE *pcli;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -114,7 +113,7 @@ LRESULT CALLBACK CallWndRetProc(int nCode, WPARAM wParam, LPARAM lParam) {
pMes = (PCWPRETSTRUCT)lParam; // Get message details
if (!hMirandaWnd)
- hMirandaWnd = pcli->hwndContactList;
+ hMirandaWnd = g_CLI.hwndContactList;
if (pMes->hwnd == hMirandaWnd)
{
@@ -134,8 +133,6 @@ LRESULT CALLBACK CallWndRetProc(int nCode, WPARAM wParam, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
if (IsWinVerVistaPlus()) {
MessageBox(nullptr, TranslateT("Plugin works under Windows XP only"), TranslateT("ZeroSwitch plugin failed"), MB_ICONSTOP);
return 1;
diff --git a/protocols/Dummy/src/main.cpp b/protocols/Dummy/src/main.cpp index 79a8bedbdd..999d3f8b41 100644 --- a/protocols/Dummy/src/main.cpp +++ b/protocols/Dummy/src/main.cpp @@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "version.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
PLUGININFOEX pluginInfoEx =
{
@@ -62,8 +61,6 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load()
{
- pcli = Clist_GetInterface();
-
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
return 0;
}
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 56d81d38fe..10a3436df4 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1000,7 +1000,7 @@ retry: cle.lParam = (LPARAM)img;
cle.pszService = service;
cle.szTooltip.a = Translate("Incoming image");
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
ReleaseIconEx("image", FALSE);
}
}
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index c6230db354..aaf4e792b8 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -26,7 +26,6 @@ // Other variables
SSL_API sslApi;
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
static unsigned long crc_table[256];
@@ -298,8 +297,6 @@ void GaduProto::OnBuildProtoMenu() //
extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
HookEvent(ME_SYSTEM_MODULESLOADED, gg_modulesloaded);
gg_links_instancemenu_init();
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index 115fa9f799..67cc001e43 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -257,7 +257,6 @@ struct GGGETAVATARDATA struct GaduProto;
-extern CLIST_INTERFACE *pcli;
extern PLUGININFOEX pluginInfoEx;
extern IconItem iconList[];
extern SSL_API sslApi;
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp index 8bd6d0c438..95aeb08146 100644 --- a/protocols/Gadu-Gadu/src/links.cpp +++ b/protocols/Gadu-Gadu/src/links.cpp @@ -75,7 +75,7 @@ static INT_PTR gg_parselink(WPARAM, LPARAM lParam) HMENU hMenu = CreatePopupMenu();
Menu_Build(hMenu, hInstanceMenu);
- int cmd = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ int cmd = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
DestroyMenu(hMenu);
if (cmd)
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 2c0c9b0860..ff43d197c8 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -73,9 +73,9 @@ BOOL CIrcProto::CList_AddDCCChat(const CMStringW& name, const CMStringW& hostmas cle.szTooltip.w = szNick;
cle.lParam = (LPARAM)pdci;
- if (pcli->pfnGetEvent(hContact, 0))
- pcli->pfnRemoveEvent(hContact, -100);
- pcli->pfnAddEvent(&cle);
+ if (g_CLI.pfnGetEvent(hContact, 0))
+ g_CLI.pfnRemoveEvent(hContact, -100);
+ g_CLI.pfnAddEvent(&cle);
}
return TRUE;
}
diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp index e8b9724a67..d2b9722c68 100644 --- a/protocols/IRCG/src/main.cpp +++ b/protocols/IRCG/src/main.cpp @@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. CMPlugin g_plugin;
CHAT_MANAGER *pci;
-CLIST_INTERFACE *pcli;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -69,7 +68,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load()
{
pci = Chat_GetInterface();
- pcli = Clist_GetInterface();
InitIcons();
InitServers();
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 21900ab114..369f2c5f76 100755 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -46,8 +46,6 @@ CountryListEntry *g_countries; unsigned int g_nTempFileId;
wchar_t szCoreVersion[100];
-CLIST_INTERFACE* pcli;
-
HANDLE hExtraActivity = nullptr;
HANDLE hExtraMood = nullptr;
HANDLE hExtListInit, hDiscoInfoResult;
@@ -155,7 +153,6 @@ extern "C" int __declspec(dllexport) Load() {
// set the memory, lists & utf8 managers
pci = Chat_GetInterface();
- pcli = Clist_GetInterface();
char mirVer[100];
Miranda_GetVersionText(mirVer, _countof(mirVer));
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index df81e4cd9f..63f729f9b5 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -1172,17 +1172,17 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* break;
case IDM_CPY_NICK:
- JabberCopyText(pcli->hwndContactList, him->m_tszResourceName);
+ JabberCopyText(g_CLI.hwndContactList, him->m_tszResourceName);
break;
case IDM_RJID_COPY:
case IDM_CPY_RJID:
- JabberCopyText(pcli->hwndContactList, him->m_tszRealJid);
+ JabberCopyText(g_CLI.hwndContactList, him->m_tszRealJid);
break;
case IDM_CPY_INROOMJID:
szBuffer.Format(L"%s/%s", item->jid, him->m_tszResourceName);
- JabberCopyText(pcli->hwndContactList, szBuffer);
+ JabberCopyText(g_CLI.hwndContactList, szBuffer);
break;
case IDM_RJID_VCARD:
@@ -1208,7 +1208,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if (wchar_t *tmp = wcschr(psr.id.w, '/'))
*tmp = 0;
psr.nick.w = psr.id.w;
- Contact_AddBySearch(ppro->m_szModuleName, &psr, pcli->hwndContactList);
+ Contact_AddBySearch(ppro->m_szModuleName, &psr, g_CLI.hwndContactList);
}
break;
}
@@ -1329,11 +1329,11 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g break;
case IDM_CPY_RJID:
- JabberCopyText(pcli->hwndContactList, item->jid);
+ JabberCopyText(g_CLI.hwndContactList, item->jid);
break;
case IDM_CPY_TOPIC:
- JabberCopyText(pcli->hwndContactList, item->getTemp()->m_tszStatusMessage);
+ JabberCopyText(g_CLI.hwndContactList, item->getTemp()->m_tszStatusMessage);
break;
}
}
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp index aff1bd2720..7a0e1a947b 100644 --- a/protocols/JabberG/src/jabber_frame.cpp +++ b/protocols/JabberG/src/jabber_frame.cpp @@ -78,7 +78,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto): InitClass();
CLISTFrame frame = { sizeof(frame) };
- HWND hwndClist = pcli->hwndContactList;
+ HWND hwndClist = g_CLI.hwndContactList;
frame.hWnd = CreateWindowEx(0, L"JabberInfoFrameClass", nullptr, WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, hwndClist, nullptr, g_plugin.getInst(), this);
frame.align = alBottom;
frame.height = 2 * SZ_FRAMEPADDING + GetSystemMetrics(SM_CYSMICON) + SZ_LINEPADDING; // compact height by default
@@ -182,7 +182,7 @@ LRESULT CJabberInfoFrame::WndProc(UINT msg, WPARAM wParam, LPARAM lParam) POINT pt = { LOWORD(lParam), HIWORD(lParam) };
MapWindowPoints(m_hwnd, nullptr, &pt, 1);
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDFRAMECONTEXT, m_frameId, 0);
- int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
Clist_MenuProcessCommand(res, 0, m_frameId);
return 0;
}
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 942e257746..f7dd1d1764 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -452,7 +452,7 @@ BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams) cle.lParam = (LPARAM)pParams;
cle.pszService = szService;
cle.szTooltip.w = TranslateT("Http authentication request received");
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 308c215d20..439d091e0d 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -1081,7 +1081,7 @@ CJabberProto* JabberChooseInstance(bool bIsLink) HMENU hMenu = CreatePopupMenu();
Menu_Build(hMenu, hChooserMenu);
- int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
DestroyMenu(hMenu);
if (res) {
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 07784b7ad7..b787622f2a 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -785,7 +785,7 @@ bool CJabberProto::OnIncomingNote(const wchar_t *szFrom, HXML hXml) cle.lParam = (LPARAM)pItem;
cle.pszService = szService;
cle.szTooltip.w = TranslateT("Incoming note");
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
return true;
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 80dcec55f5..11a6144b76 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -1316,7 +1316,7 @@ void CJabberProto::InfoFrame_OnTransport(CJabberInfoFrame_Event *evt) HMENU hContactMenu = Menu_BuildContactMenu(hContact);
POINT pt;
GetCursorPos(&pt);
- int res = TrackPopupMenu(hContactMenu, TPM_RETURNCMD, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ int res = TrackPopupMenu(hContactMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
Clist_MenuProcessCommand(res, MPCF_CONTACTMENU, hContact);
}
}
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 6bdefc5412..2fe625e4f8 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -603,7 +603,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe db_event_markRead(hContact, hDbEvent);
if (bRemoveCListEvents)
- pcli->pfnRemoveEvent(hContact, hDbEvent);
+ g_CLI.pfnRemoveEvent(hContact, hDbEvent);
}
}
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp index cc50b71add..afc0564e7b 100644 --- a/protocols/MRA/src/Mra.cpp +++ b/protocols/MRA/src/Mra.cpp @@ -1,7 +1,6 @@ #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
HMODULE g_hDLLXStatusIcons;
HICON g_hMainIcon;
@@ -42,8 +41,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" __declspec(dllexport) int Load(void)
{
- pcli = Clist_GetInterface();
-
IconsLoad();
InitXStatusIcons();
return 0;
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 91dd706532..6bf5697249 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -662,7 +662,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & memcpy(pszServiceFunctionName, MRA_GOTO_INBOX, sizeof(MRA_GOTO_INBOX));
cle.pszService = szServiceFunction;
}
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
Skin_PlaySound(szNewMailSound);
@@ -675,7 +675,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & else {
if (!force_display && getByte("IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY)) {
if (bTrayIconNewMailNotify)
- pcli->pfnRemoveEvent(0, (LPARAM)m_szModuleName);
+ g_CLI.pfnRemoveEvent(0, (LPARAM)m_szModuleName);
PUDeletePopup(hWndEMailPopupStatus);
hWndEMailPopupStatus = nullptr;
}
diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp index 5b39364a1d..2dc0977d74 100644 --- a/protocols/MSN/src/msn.cpp +++ b/protocols/MSN/src/msn.cpp @@ -25,7 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "version.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
/////////////////////////////////////////////////////////////////////////////////////////
// Initialization routines
@@ -83,8 +82,6 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
MsnInitIcons();
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 30262e49c5..fc003304bd 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -282,7 +282,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) MCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail);
if (hContact) {
- pcli->pfnRemoveEvent(hContact, 1);
+ g_CLI.pfnRemoveEvent(hContact, 1);
displayEmailCount(hContact);
if (ShowPopup && !getByte("DisableHotmailTray", 1)) {
@@ -296,7 +296,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_SENDEMAIL);
cle.szTooltip.w = tBuffer2;
cle.pszService = buf;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
}
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index 3cf8a94b84..00b0d3384c 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -47,7 +47,7 @@ INT_PTR CMsnProto::MsnGotoInbox(WPARAM, LPARAM) {
MCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail);
if (hContact)
- pcli->pfnRemoveEvent(hContact, 1);
+ g_CLI.pfnRemoveEvent(hContact, 1);
MsnInvokeMyURL(true, "http://mail.live.com?rru=inbox");
return 0;
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 8912cc133a..b7a800b6ee 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -742,7 +742,7 @@ void HandlePopupData(PopupData *tData) { if (tData->flags & MSN_HOTMAIL_POPUP) {
MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, nullptr);
if (hContact)
- pcli->pfnRemoveEvent(hContact, 1);
+ g_CLI.pfnRemoveEvent(hContact, 1);
if (tData->flags & MSN_ALLOW_ENTER)
tData->proto->MsnInvokeMyURL(true, tData->url);
}
@@ -755,7 +755,7 @@ void RemovePopupData(PopupData *tData) { if (tData != nullptr && (tData->flags & MSN_HOTMAIL_POPUP)) {
MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, nullptr);
if (hContact)
- pcli->pfnRemoveEvent(hContact, 1);
+ g_CLI.pfnRemoveEvent(hContact, 1);
}
}
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index 70ec17fc56..919f92bafc 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -260,7 +260,7 @@ void CMsnProto::OnContactDeleted(MCONTACT hContact) else {
char szEmail[MSN_MAX_EMAIL_LEN];
if (MSN_IsMeByContact(hContact, szEmail))
- pcli->pfnRemoveEvent(hContact, 1);
+ g_CLI.pfnRemoveEvent(hContact, 1);
if (szEmail[0]) {
debugLogA("Deleted Handler Email");
diff --git a/protocols/MinecraftDynmap/src/main.cpp b/protocols/MinecraftDynmap/src/main.cpp index d65a46fed8..268c8c1734 100644 --- a/protocols/MinecraftDynmap/src/main.cpp +++ b/protocols/MinecraftDynmap/src/main.cpp @@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h" CMPlugin g_plugin; -CLIST_INTERFACE* pcli; std::string g_strUserAgent; @@ -58,8 +57,6 @@ static HANDLE g_hEvents[1]; extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - InitIcons(); // Init native User-Agent diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp index 8f1e9a35d5..51e4a2800a 100644 --- a/protocols/Omegle/src/main.cpp +++ b/protocols/Omegle/src/main.cpp @@ -25,7 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // TODO: Make following as "globals" structure?
CMPlugin g_plugin;
-CLIST_INTERFACE* pcli;
std::string g_strUserAgent;
DWORD g_mirandaVersion;
@@ -61,8 +60,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
InitIcons();
// Init native User-Agent
diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp index 394126f175..1f280d8763 100644 --- a/protocols/SkypeWeb/src/main.cpp +++ b/protocols/SkypeWeb/src/main.cpp @@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. CMPlugin g_plugin;
CHAT_MANAGER *pci;
-CLIST_INTERFACE *pcli;
char g_szMirVer[100];
HANDLE g_hCallEvent;
@@ -63,7 +62,6 @@ int CSkypeProto::OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
pci = Chat_GetInterface();
Miranda_GetVersionText(g_szMirVer, sizeof(g_szMirVer));
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp index 65e4108808..0b39aeea58 100644 --- a/protocols/SkypeWeb/src/skype_trouter.cpp +++ b/protocols/SkypeWeb/src/skype_trouter.cpp @@ -201,7 +201,7 @@ void CSkypeProto::OnTrouterEvent(const JSONNode &body, const JSONNode &) CMStringW tooltip(FORMAT, TranslateT("Incoming call from %s"), Clist_GetContactDisplayName(hContact));
cle.szTooltip.w = tooltip.GetBuffer();
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
ShowNotification(Clist_GetContactDisplayName(hContact), TranslateT("Incoming call"), hContact, SKYPE_DB_EVENT_TYPE_INCOMING_CALL);
}
@@ -224,9 +224,9 @@ INT_PTR CSkypeProto::OnIncomingCallCLE(WPARAM, LPARAM lParam) INT_PTR CSkypeProto::OnIncomingCallPP(WPARAM wParam, LPARAM hContact)
{
- while (CLISTEVENT *cle = pcli->pfnGetEvent(hContact, 0)) {
+ while (CLISTEVENT *cle = g_CLI.pfnGetEvent(hContact, 0)) {
if (cle->lParam == SKYPE_DB_EVENT_TYPE_INCOMING_CALL) {
- pcli->pfnRemoveEvent(hContact, cle->hDbEvent);
+ g_CLI.pfnRemoveEvent(hContact, cle->hDbEvent);
break;
}
}
diff --git a/protocols/Tox/src/main.cpp b/protocols/Tox/src/main.cpp index 0d128b5d65..a4d2df911a 100644 --- a/protocols/Tox/src/main.cpp +++ b/protocols/Tox/src/main.cpp @@ -2,7 +2,6 @@ CMPlugin g_plugin; CHAT_MANAGER *pci; -CLIST_INTERFACE *pcli; HANDLE hProfileFolderPath; @@ -51,7 +50,6 @@ int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void) { pci = Chat_GetInterface(); - pcli = Clist_GetInterface(); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); diff --git a/protocols/Twitter/src/main.cpp b/protocols/Twitter/src/main.cpp index 16a00f0ac9..7069d21bd3 100644 --- a/protocols/Twitter/src/main.cpp +++ b/protocols/Twitter/src/main.cpp @@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "theme.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -55,8 +54,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
InitIcons();
InitContactMenus();
TwitterInitSounds();
diff --git a/protocols/VKontakte/src/main.cpp b/protocols/VKontakte/src/main.cpp index 493c01411a..d267ede49a 100644 --- a/protocols/VKontakte/src/main.cpp +++ b/protocols/VKontakte/src/main.cpp @@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "version.h"
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -52,8 +51,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load()
{
- pcli = Clist_GetInterface();
-
InitIcons();
return 0;
}
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 43ff4a5c0d..1aa0f98c15 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -773,9 +773,9 @@ void CVkProto::MarkDialogAsRead(MCONTACT hContact) DBEVENTINFO dbei = {};
if (!db_event_get(hDBEvent, &dbei) && !mir_strcmp(m_szModuleName, dbei.szModule)) {
db_event_markRead(hContact, hDBEvent);
- pcli->pfnRemoveEvent(hMContact, hDBEvent);
+ g_CLI.pfnRemoveEvent(hMContact, hDBEvent);
if (hContact != hMContact)
- pcli->pfnRemoveEvent(hContact, hDBEvent);
+ g_CLI.pfnRemoveEvent(hContact, hDBEvent);
}
hDBEvent = db_event_next(hContact, hDBEvent);
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 87fea21168..20e2bdfbe6 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -87,7 +87,7 @@ void CVkProto::AddCListEvent(bool bNews) wchar_t toolTip[255];
mir_snwprintf(toolTip, bNews ? TranslateT("New news") : TranslateT("New notifications"));
cle.szTooltip.w = toolTip;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdclist/src/clistmenus.cpp b/src/core/stdclist/src/clistmenus.cpp index afdb4c8da7..9ac72f36e2 100644 --- a/src/core/stdclist/src/clistmenus.cpp +++ b/src/core/stdclist/src/clistmenus.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static INT_PTR CloseAction(WPARAM, LPARAM)
{
if (Miranda_OkToExit())
- DestroyWindow(pcli->hwndContactList);
+ DestroyWindow(g_CLI.hwndContactList);
return(0);
}
diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp index 623787e931..65e6f790fb 100644 --- a/src/core/stdclist/src/clistopts.cpp +++ b/src/core/stdclist/src/clistopts.cpp @@ -178,7 +178,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP 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 */
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID); /* force reshuffle */
return TRUE;
}
break;
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp index f4607ada42..6d1f00ddd3 100644 --- a/src/core/stdclist/src/cluiopts.cpp +++ b/src/core/stdclist/src/cluiopts.cpp @@ -168,11 +168,11 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ws(NULL, "CList", "TitleText", title);
- SetWindowText(pcli->hwndContactList, title);
+ SetWindowText(g_CLI.hwndContactList, title);
}
- pcli->pfnLoadCluiGlobalOpts();
- SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST,
+ g_CLI.pfnLoadCluiGlobalOpts();
+ SetWindowPos(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) {
@@ -180,50 +180,50 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L // See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp
WINDOWPLACEMENT p;
p.length = sizeof(p);
- GetWindowPlacement(pcli->hwndContactList, &p);
- ShowWindow(pcli->hwndContactList, SW_HIDE);
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE,
- GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_APPWINDOW | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
- SetWindowPlacement(pcli->hwndContactList, &p);
+ GetWindowPlacement(g_CLI.hwndContactList, &p);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE,
+ GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_APPWINDOW | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
+ SetWindowPlacement(g_CLI.hwndContactList, &p);
}
else
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW);
if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
HWND hProgMan = FindWindow(L"Progman", nullptr);
if (hProgMan)
- SetParent(pcli->hwndContactList, hProgMan);
+ SetParent(g_CLI.hwndContactList, hProgMan);
}
else
- SetParent(pcli->hwndContactList, nullptr);
+ SetParent(g_CLI.hwndContactList, nullptr);
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) {
- int style = GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, style);
+ int style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, style);
}
else {
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE,
- GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE,
+ GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
}
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
- SetMenu(pcli->hwndContactList, nullptr);
+ SetMenu(g_CLI.hwndContactList, nullptr);
else
- SetMenu(pcli->hwndContactList, pcli->hMenuMain);
+ SetMenu(g_CLI.hwndContactList, g_CLI.hMenuMain);
- SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
- RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
- if (IsIconic(pcli->hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
- ShowWindow(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
+ if (IsIconic(g_CLI.hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
+ ShowWindow(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_CLI.hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
else
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
return TRUE;
}
@@ -283,22 +283,22 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L db_set_b(NULL, "CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA));
db_set_b(NULL, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
db_set_b(NULL, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL));
- pcli->pfnLoadCluiGlobalOpts();
+ g_CLI.pfnLoadCluiGlobalOpts();
if (db_get_b(NULL, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
- HWND parent = GetParent(pcli->hwndStatus);
+ HWND parent = GetParent(g_CLI.hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
db_set_b(NULL, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
- ShowWindow(pcli->hwndStatus, SW_HIDE);
- DestroyWindow(pcli->hwndStatus);
+ ShowWindow(g_CLI.hwndStatus, SW_HIDE);
+ DestroyWindow(g_CLI.hwndStatus);
flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
- pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
+ g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR))
- ShowWindow(pcli->hwndStatus, SW_SHOW);
+ ShowWindow(g_CLI.hwndStatus, SW_SHOW);
else
- ShowWindow(pcli->hwndStatus, SW_HIDE);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ ShowWindow(g_CLI.hwndStatus, SW_HIDE);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
return TRUE;
}
break;
diff --git a/src/core/stdclist/src/init.cpp b/src/core/stdclist/src/init.cpp index 94d4517491..fc49caac7a 100644 --- a/src/core/stdclist/src/init.cpp +++ b/src/core/stdclist/src/init.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
CMPlugin g_plugin;
-CLIST_INTERFACE* pcli = nullptr, coreCli;
+CLIST_INTERFACE coreCli;
HIMAGELIST himlCListClc = nullptr;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -99,7 +99,7 @@ static int OnOptsInit(WPARAM wParam, LPARAM lParam) static INT_PTR GetStatusMode(WPARAM, LPARAM)
{
- return pcli->currentDesiredStatusMode;
+ return g_CLI.currentDesiredStatusMode;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -107,16 +107,15 @@ static INT_PTR GetStatusMode(WPARAM, LPARAM) extern "C" __declspec(dllexport) int CListInitialise()
{
- pcli = Clist_GetInterface();
-
g_bSortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
g_bSortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
- coreCli = *pcli;
- pcli->hInst = g_plugin.getInst();
- pcli->pfnPaintClc = PaintClc;
- pcli->pfnLoadClcOptions = LoadClcOptions;
- pcli->pfnCompareContacts = CompareContacts;
+ Clist_GetInterface();
+ coreCli = g_CLI;
+ g_CLI.hInst = g_plugin.getInst();
+ g_CLI.pfnPaintClc = PaintClc;
+ g_CLI.pfnLoadClcOptions = LoadClcOptions;
+ g_CLI.pfnCompareContacts = CompareContacts;
CreateServiceFunction(MS_CLIST_GETSTATUSMODE, GetStatusMode);
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 9ce90ca28a..fa85763130 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -114,7 +114,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) cle.flags |= CLEF_UNICODE;
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_FILE);
cle.pszService = "SRFile/RecvFile";
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
}
@@ -306,9 +306,9 @@ static int SRFileProtoAck(WPARAM, LPARAM lParam) ACKDATA *ack = (ACKDATA*)lParam;
if (ack->type == ACKTYPE_FILE) {
int iEvent = 0;
- while (CLISTEVENT *cle = pcli->pfnGetEvent(ack->hContact, iEvent++))
+ while (CLISTEVENT *cle = g_CLI.pfnGetEvent(ack->hContact, iEvent++))
if (cle->lParam == (LPARAM)ack->hProcess)
- pcli->pfnRemoveEvent(ack->hContact, cle->hDbEvent);
+ g_CLI.pfnRemoveEvent(ack->hContact, cle->hDbEvent);
}
return 0;
}
diff --git a/src/core/stdfile/src/main.cpp b/src/core/stdfile/src/main.cpp index 27a00db40a..b4b4146518 100644 --- a/src/core/stdfile/src/main.cpp +++ b/src/core/stdfile/src/main.cpp @@ -25,8 +25,6 @@ int LoadSendRecvFileModule(void); CMPlugin g_plugin;
-CLIST_INTERFACE* pcli;
-
ITaskbarList3 * pTaskbarInterface;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -56,8 +54,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRFILE extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
if ( IsWinVer7Plus())
CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_ITaskbarList3, (void**)&pTaskbarInterface);
diff --git a/src/core/stdidle/src/main.cpp b/src/core/stdidle/src/main.cpp index 89268caadf..747808bb8e 100644 --- a/src/core/stdidle/src/main.cpp +++ b/src/core/stdidle/src/main.cpp @@ -25,7 +25,6 @@ int LoadIdleModule(void); void UnloadIdleModule(void);
CMPlugin g_plugin;
-CLIST_INTERFACE* pcli;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -54,8 +53,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_IDLE, extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
LoadIdleModule();
return 0;
}
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index 9a3885baa6..26b834617e 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -75,10 +75,10 @@ static void OnCreateModule(MODULEINFO *mi) { OnDestroyModule(mi); - mi->OnlineIconIndex = pcli->pfnIconFromStatusMode(mi->pszModule, ID_STATUS_ONLINE, 0); + mi->OnlineIconIndex = g_CLI.pfnIconFromStatusMode(mi->pszModule, ID_STATUS_ONLINE, 0); mi->hOnlineIcon = ImageList_GetIcon(Clist_GetImageList(), mi->OnlineIconIndex, ILD_TRANSPARENT); - mi->OfflineIconIndex = pcli->pfnIconFromStatusMode(mi->pszModule, ID_STATUS_OFFLINE, 0); + mi->OfflineIconIndex = g_CLI.pfnIconFromStatusMode(mi->pszModule, ID_STATUS_OFFLINE, 0); mi->hOfflineIcon = ImageList_GetIcon(Clist_GetImageList(), mi->OfflineIconIndex, ILD_TRANSPARENT); } diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index f6e101eb5f..66be4aaba6 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -104,8 +104,8 @@ void CChatRoomDlg::OnActivate() FlashWindow(m_pOwner->GetHwnd(), FALSE); if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode", 0) != 0) db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0); - if (pcli->pfnGetEvent(m_hContact, 0)) - pcli->pfnRemoveEvent(m_hContact, GC_FAKE_EVENT); + if (g_CLI.pfnGetEvent(m_hContact, 0)) + g_CLI.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT); } void CChatRoomDlg::onClick_Filter(CCtrlButton *pButton) diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index e65ea3f177..5bfcb1f191 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -455,7 +455,7 @@ void CSrmmWindow::OnSplitterMoved(CSplitter *pSplitter) int CSrmmWindow::GetImageId() const
{
- return (WORD)pcli->pfnIconFromStatusMode(m_szProto, m_wStatus, m_hContact);
+ return (WORD)g_CLI.pfnIconFromStatusMode(m_szProto, m_wStatus, m_hContact);
}
void CSrmmWindow::NotifyTyping(int mode)
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index b06bdb9b64..029d72a8e2 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -215,7 +215,7 @@ static bool CreateRTFFromDbEvent(LogStreamData *dat) if (!(dbei.flags & DBEF_SENT) && (dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) {
db_event_markRead(dat->hContact, dat->hDbEvent);
- pcli->pfnRemoveEvent(dat->hContact, dat->hDbEvent);
+ g_CLI.pfnRemoveEvent(dat->hContact, dat->hDbEvent);
}
else if (dbei.eventType == EVENTTYPE_JABBER_CHATSTATES || dbei.eventType == EVENTTYPE_JABBER_PRESENCE) {
db_event_markRead(dat->hContact, dat->hDbEvent);
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index c141710293..9f4532041b 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -90,7 +90,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) if (dbei.flags & (DBEF_SENT | DBEF_READ) || !(dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)))
return 0;
- pcli->pfnRemoveEvent(hContact, 1);
+ g_CLI.pfnRemoveEvent(hContact, 1);
/* does a window for the contact exist? */
HWND hwnd = Srmm_FindWindow(hContact);
if (hwnd) {
@@ -127,7 +127,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = MS_MSG_READMESSAGE;
cle.szTooltip.w = toolTip;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
return 0;
}
@@ -200,7 +200,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) mir_snwprintf(szTip, TranslateT("%s is typing a message"), Clist_GetContactDisplayName(hContact));
if (g_dat.bShowTypingClist) {
- pcli->pfnRemoveEvent(hContact, 1);
+ g_CLI.pfnRemoveEvent(hContact, 1);
CLISTEVENT cle = {};
cle.hContact = hContact;
@@ -209,7 +209,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_TYPING);
cle.pszService = MS_MSG_READMESSAGE;
cle.szTooltip.w = szTip;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
IcoLib_ReleaseIcon(cle.hIcon);
}
@@ -304,7 +304,7 @@ static void RestoreUnreadMessageAlerts(void) mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(e->hContact));
cle.hContact = e->hContact;
cle.hDbEvent = e->hEvent;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
}
}
diff --git a/src/core/stdmsg/src/srmm.cpp b/src/core/stdmsg/src/srmm.cpp index 2cdff71f91..d5004f291b 100644 --- a/src/core/stdmsg/src/srmm.cpp +++ b/src/core/stdmsg/src/srmm.cpp @@ -26,8 +26,6 @@ void SplitmsgShutdown(void); CMPlugin g_plugin;
-CLIST_INTERFACE *pcli;
-
/////////////////////////////////////////////////////////////////////////////////////////
PLUGININFOEX pluginInfoEx = {
@@ -54,8 +52,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRMM, extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
Load_ChatModule();
return LoadSendRecvMessageModule();
}
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp index b7cfae1650..8aa3608d1b 100644 --- a/src/core/stdmsg/src/tabs.cpp +++ b/src/core/stdmsg/src/tabs.cpp @@ -408,8 +408,8 @@ void CTabbedWindow::TabClicked() if (s->wState & GC_EVENT_HIGHLIGHT) { s->wState &= ~GC_EVENT_HIGHLIGHT; - if (pcli->pfnGetEvent(s->hContact, 0)) - pcli->pfnRemoveEvent(s->hContact, GC_FAKE_EVENT); + if (g_CLI.pfnGetEvent(s->hContact, 0)) + g_CLI.pfnRemoveEvent(s->hContact, GC_FAKE_EVENT); } FixTabIcons(pDlg); diff --git a/src/core/stduseronline/src/main.cpp b/src/core/stduseronline/src/main.cpp index 248bf8077e..4794c2dc21 100644 --- a/src/core/stduseronline/src/main.cpp +++ b/src/core/stduseronline/src/main.cpp @@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadUserOnlineModule(void);
CMPlugin g_plugin;
-CLIST_INTERFACE* pcli;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -53,8 +52,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_USERON extern "C" int __declspec(dllexport) Load(void)
{
- pcli = Clist_GetInterface();
-
LoadUserOnlineModule();
return 0;
}
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index 163b705835..8a0980bbae 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -42,7 +42,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) int lastEvent = (int)db_get_dw(hContact, MODULENAME, "LastEvent", 0);
if (lastEvent) {
- pcli->pfnRemoveEvent(hContact, lastEvent);
+ g_CLI.pfnRemoveEvent(hContact, lastEvent);
db_set_dw(hContact, MODULENAME, "LastEvent", 0);
}
}
@@ -62,7 +62,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_USERONLINE, false);
cle.pszService = "UserOnline/Description";
cle.szTooltip.w = tooltip;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
IcoLib_ReleaseIcon(cle.hIcon, 0);
db_set_dw(cle.hContact, MODULENAME, "LastEvent", (DWORD)cle.hDbEvent);
Skin_PlaySound(MODULENAME);
diff --git a/src/mir_app/src/auth.cpp b/src/mir_app/src/auth.cpp index 2a13dfc960..7eb89bc2b0 100644 --- a/src/mir_app/src/auth.cpp +++ b/src/mir_app/src/auth.cpp @@ -329,7 +329,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_AUTH_REQUEST); cle.pszService = MS_AUTH_SHOWREQUEST; - cli.pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } else if (dbei.eventType == EVENTTYPE_ADDED) { Skin_PlaySound("AddedEvent"); @@ -340,7 +340,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_AUTH_ADD); cle.pszService = MS_AUTH_SHOWADDED; - cli.pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } return 0; } diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index b78094d782..8fac7d27f1 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -114,7 +114,7 @@ int RoomDoubleclicked(WPARAM hContact, LPARAM) SESSION_INFO *si = SM_FindSession(roomid, szProto);
if (si) {
- if (si->pDlg != nullptr && !cli.pfnGetEvent(hContact, 0) && IsWindowVisible(si->pDlg->GetHwnd()) && !IsIconic(si->pDlg->GetHwnd())) {
+ if (si->pDlg != nullptr && !g_CLI.pfnGetEvent(hContact, 0) && IsWindowVisible(si->pDlg->GetHwnd()) && !IsIconic(si->pDlg->GetHwnd())) {
si->pDlg->CloseTab();
return 1;
}
@@ -209,13 +209,13 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, wchar_t* CreateServiceFunction(cle.pszService, &EventDoubleclicked);
if (type) {
- if (!cli.pfnGetEvent(hContact, 0))
- cli.pfnAddEvent(&cle);
+ if (!g_CLI.pfnGetEvent(hContact, 0))
+ g_CLI.pfnAddEvent(&cle);
}
else {
- if (cli.pfnGetEvent(hContact, 0))
- cli.pfnRemoveEvent(hContact, GC_FAKE_EVENT);
- cli.pfnAddEvent(&cle);
+ if (g_CLI.pfnGetEvent(hContact, 0))
+ g_CLI.pfnRemoveEvent(hContact, GC_FAKE_EVENT);
+ g_CLI.pfnAddEvent(&cle);
}
return TRUE;
}
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 36a871e7ff..10bdf56d93 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -76,8 +76,8 @@ static SESSION_INFO* GetActiveSession(void) static void SM_FreeSession(SESSION_INFO *si, bool bRemoveContact = false)
{
- if (cli.pfnGetEvent(si->hContact, 0))
- cli.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ if (g_CLI.pfnGetEvent(si->hContact, 0))
+ g_CLI.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
si->wState &= ~STATE_TALK;
db_set_w(si->hContact, si->pszModule, "ApparentMode", 0);
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 71d0a830ea..ee89291d70 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -151,8 +151,8 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case WM_CONTEXTMENU:
SESSION_INFO *si = (SESSION_INFO*)PUGetPluginData(hWnd);
if (si->hContact)
- if (cli.pfnGetEvent(si->hContact, 0))
- cli.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ if (g_CLI.pfnGetEvent(si->hContact, 0))
+ g_CLI.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
if (si->pDlg && KillTimer(si->pDlg->GetHwnd(), TIMERID_FLASHWND))
FlashWindow(si->pDlg->GetHwnd(), FALSE);
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index a7ebcd0bb9..3eb5bebf8e 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -42,8 +42,8 @@ void FreeDisplayNameCache(void); MIR_APP_DLL(void) Clist_InitAutoRebuild(HWND hWnd)
{
- if (!cli.bAutoRebuild && hWnd) {
- cli.bAutoRebuild = true;
+ if (!g_CLI.bAutoRebuild && hWnd) {
+ g_CLI.bAutoRebuild = true;
PostMessage(hWnd, CLM_AUTOREBUILD, 0, 0);
}
}
@@ -83,7 +83,7 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) if (!strcmp(cws->szModule, "CList")) {
if (!strcmp(cws->szSetting, "MyHandle")) {
- cli.pfnInvalidateDisplayNameCacheEntry(hContact);
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(hContact);
Clist_Broadcast(INTM_NAMECHANGED, hContact, lParam);
}
else if (!strcmp(cws->szSetting, "Group"))
@@ -142,7 +142,7 @@ static int ClcProtoAck(WPARAM, LPARAM lParam) }
}
- cli.pfnCluiProtocolStatusChanged(lParam, ack->szModule);
+ g_CLI.pfnCluiProtocolStatusChanged(lParam, ack->szModule);
if ((INT_PTR)ack->hProcess < ID_STATUS_ONLINE && ack->lParam >= ID_STATUS_ONLINE) {
// if we're going offline, kill all contacts scheduled for deletion
@@ -239,7 +239,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam ClcData *dat = (ClcData *)GetWindowLongPtr(hwnd, 0);
if (uMsg >= CLM_FIRST && uMsg < CLM_LAST)
- return cli.pfnProcessExternalMessages(hwnd, dat, uMsg, wParam, lParam);
+ return g_CLI.pfnProcessExternalMessages(hwnd, dat, uMsg, wParam, lParam);
switch (uMsg) {
case WM_CREATE:
@@ -264,11 +264,11 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam dat->infoTipTimeout = db_get_w(0, "CLC", "InfoTipHoverTime", 750);
dat->extraColumnSpacing = 20;
dat->bNeedsResort = true;
- cli.pfnLoadClcOptions(hwnd, dat, TRUE);
+ g_CLI.pfnLoadClcOptions(hwnd, dat, TRUE);
if (!IsWindowVisible(hwnd))
SetTimer(hwnd, TIMERID_REBUILDAFTER, 10, nullptr);
else {
- cli.pfnRebuildEntireList(hwnd, dat);
+ g_CLI.pfnRebuildEntireList(hwnd, dat);
NMCLISTCONTROL nm;
nm.hdr.code = CLN_LISTREBUILT;
nm.hdr.hwndFrom = hwnd;
@@ -282,24 +282,24 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (dat->bNoVScrollbar)
ShowScrollBar(hwnd, SB_VERT, FALSE);
else
- cli.pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
}
break;
case INTM_RELOADOPTIONS:
- cli.pfnLoadClcOptions(hwnd, dat, FALSE);
+ g_CLI.pfnLoadClcOptions(hwnd, dat, FALSE);
Clist_SaveStateAndRebuildList(hwnd, dat);
break;
case WM_THEMECHANGED:
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case WM_SIZE:
Clist_EndRename(dat, 1);
KillTimer(hwnd, TIMERID_INFOTIP);
KillTimer(hwnd, TIMERID_RENAME);
- cli.pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
{
// creating imagelist containing blue line for highlight
RECT rc;
@@ -362,7 +362,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam KillTimer(hwnd, TIMERID_RENAME);
case WM_SETFOCUS:
case WM_ENABLE:
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case WM_GETFONT:
@@ -412,7 +412,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
case INTM_CONTACTADDED:
- cli.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
Clist_NotifyNewContact(hwnd, wParam);
SortClcByTimer(hwnd);
break;
@@ -430,7 +430,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (dbcws->value.type == DBVT_DELETED || dbcws->value.bVal == 0) {
if (Clist_FindItem(hwnd, dat, wParam, nullptr, nullptr, nullptr))
break;
- cli.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
Clist_NotifyNewContact(hwnd, wParam);
}
else Clist_DeleteItemFromTree(hwnd, wParam);
@@ -453,7 +453,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam Clist_DeleteItemFromTree(hwnd, wParam);
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b(wParam, "CList", "Hidden", 0)) {
NMCLISTCONTROL nm;
- cli.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
@@ -492,9 +492,9 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam group = nullptr;
if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr)) {
if (shouldShow && db_is_contact(wParam)) {
- if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
- cli.pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
+ g_CLI.pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr);
if (contact) {
contact->iImage = (WORD)lParam;
@@ -507,7 +507,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (contact->iImage == (WORD)lParam)
break;
if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
- if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
Clist_RemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
}
@@ -523,7 +523,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (hSelItem) {
ClcGroup *selgroup;
if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr))
- dat->selection = cli.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
}
@@ -545,7 +545,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
contact->proto = GetContactProto(wParam);
- cli.pfnInvalidateDisplayNameCacheEntry(wParam);
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(wParam);
mir_wstrncpy(contact->szText, Clist_GetContactDisplayName(wParam), _countof(contact->szText));
SortClcByTimer(hwnd);
break;
@@ -560,12 +560,12 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam contact->flags &= ~CONTACTF_NOTONLIST;
else
contact->flags |= CONTACTF_NOTONLIST;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
}
break;
case INTM_INVALIDATE:
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case INTM_APPARENTMODECHANGED:
@@ -582,7 +582,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam contact->flags |= CONTACTF_VISTO;
else if (apparentMode)
contact->flags |= CONTACTF_VISTO | CONTACTF_INVISTO;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
}
break;
@@ -599,12 +599,12 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (db_get_dw(wParam, szProto, "IdleTS", 0))
contact->flags |= CONTACTF_IDLE;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
}
break;
case WM_PRINTCLIENT:
- cli.pfnPaintClc(hwnd, dat, (HDC)wParam, nullptr);
+ g_CLI.pfnPaintClc(hwnd, dat, (HDC)wParam, nullptr);
break;
case WM_NCPAINT:
@@ -625,11 +625,11 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam {
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
- /* we get so many cli.pfnInvalidateRect()'s that there is no point painting,
+ /* we get so many g_CLI.pfnInvalidateRect()'s that there is no point painting,
Windows in theory shouldn't queue up WM_PAINTs in this case but it does so
we'll just ignore them */
if (IsWindowVisible(hwnd))
- cli.pfnPaintClc(hwnd, dat, hdc, &ps.rcPaint);
+ g_CLI.pfnPaintClc(hwnd, dat, hdc, &ps.rcPaint);
EndPaint(hwnd, &ps);
}
break;
@@ -654,7 +654,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case SB_THUMBTRACK: desty = HIWORD(wParam); noSmooth = 1; break; //noone has more than 4000 contacts, right?
default: return 0;
}
- cli.pfnScrollTo(hwnd, dat, desty, noSmooth);
+ g_CLI.pfnScrollTo(hwnd, dat, desty, noSmooth);
}
break;
@@ -667,7 +667,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam UINT scrollLines;
if (!SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scrollLines, FALSE))
scrollLines = 3;
- cli.pfnScrollTo(hwnd, dat, dat->yScroll - (short)HIWORD(wParam) * dat->rowHeight * (signed)scrollLines / WHEEL_DELTA, 0);
+ g_CLI.pfnScrollTo(hwnd, dat, dat->yScroll - (short)HIWORD(wParam) * dat->rowHeight * (signed)scrollLines / WHEEL_DELTA, 0);
return 0;
case WM_KEYDOWN:
@@ -686,7 +686,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case VK_PRIOR: dat->selection -= pageSize; selMoved = 1; break;
case VK_NEXT: dat->selection += pageSize; selMoved = 1; break;
case VK_HOME: dat->selection = 0; selMoved = 1; break;
- case VK_END: dat->selection = cli.pfnGetGroupContentsCount(&dat->list, 1) - 1; selMoved = 1; break;
+ case VK_END: dat->selection = g_CLI.pfnGetGroupContentsCount(&dat->list, 1) - 1; selMoved = 1; break;
case VK_LEFT: changeGroupExpand = 1; break;
case VK_RIGHT: changeGroupExpand = 2; break;
@@ -694,7 +694,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam Clist_DoSelectionDefaultAction(hwnd, dat);
return 0;
- case VK_F2: cli.pfnBeginRenameSelection(hwnd, dat); return 0;
+ case VK_F2: g_CLI.pfnBeginRenameSelection(hwnd, dat); return 0;
case VK_DELETE: Clist_DeleteFromContactList(hwnd, dat); return 0;
default:
@@ -710,30 +710,30 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (changeGroupExpand) {
if (!dat->bFilterSearch)
dat->szQuickSearch[0] = 0;
- hit = cli.pfnGetRowByIndex(dat, dat->selection, &contact, &group);
+ hit = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, &group);
if (hit == -1)
return 0;
if (changeGroupExpand == 1 && contact->type == CLCIT_CONTACT) {
if (group == &dat->list)
return 0;
- dat->selection = cli.pfnGetRowsPriorTo(&dat->list, group, -1);
+ dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, group, -1);
selMoved = 1;
}
else {
if (contact->type == CLCIT_GROUP)
- cli.pfnSetGroupExpand(hwnd, dat, contact->group, changeGroupExpand == 2);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, changeGroupExpand == 2);
return 0;
}
}
if (selMoved) {
if (!dat->bFilterSearch)
dat->szQuickSearch[0] = 0;
- if (dat->selection >= cli.pfnGetGroupContentsCount(&dat->list, 1))
- dat->selection = cli.pfnGetGroupContentsCount(&dat->list, 1) - 1;
+ if (dat->selection >= g_CLI.pfnGetGroupContentsCount(&dat->list, 1))
+ dat->selection = g_CLI.pfnGetGroupContentsCount(&dat->list, 1) - 1;
if (dat->selection < 0)
dat->selection = 0;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
UpdateWindow(hwnd);
return 0;
@@ -753,13 +753,13 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
else if (wParam == ' ' && dat->szQuickSearch[0] == '\0' && GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_CHECKBOXES) {
NMCLISTCONTROL nm;
- if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
+ if (g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
break;
if (contact->type != CLCIT_CONTACT)
break;
contact->flags ^= CONTACTF_CHECKED;
Clist_RecalculateGroupCheckboxes(dat);
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
nm.hdr.code = CLN_CHECKCHANGED;
nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
@@ -783,7 +783,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (dat->szQuickSearch[0]) {
int index;
- index = cli.pfnFindRowByText(hwnd, dat, dat->szQuickSearch, 1);
+ index = g_CLI.pfnFindRowByText(hwnd, dat, dat->szQuickSearch, 1);
if (index != -1)
dat->selection = index;
else {
@@ -791,11 +791,11 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam dat->szQuickSearch[mir_wstrlen(dat->szQuickSearch) - 1] = '\0';
Clist_SaveStateAndRebuildList(hwnd, dat);
}
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
}
else
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case WM_SYSKEYDOWN:
@@ -804,7 +804,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam KillTimer(hwnd, TIMERID_INFOTIP);
KillTimer(hwnd, TIMERID_RENAME);
dat->iHotTrack = -1;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
ReleaseCapture();
if (wParam == VK_F10 && GetKeyState(VK_SHIFT) & 0x8000)
break;
@@ -814,11 +814,11 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case WM_TIMER:
switch (wParam) {
case TIMERID_RENAME:
- cli.pfnBeginRenameSelection(hwnd, dat);
+ g_CLI.pfnBeginRenameSelection(hwnd, dat);
break;
case TIMERID_DRAGAUTOSCROLL:
- cli.pfnScrollTo(hwnd, dat, dat->yScroll + dat->dragAutoScrolling * dat->rowHeight * 2, 0);
+ g_CLI.pfnScrollTo(hwnd, dat, dat->yScroll + dat->dragAutoScrolling * dat->rowHeight * 2, 0);
break;
case TIMERID_INFOTIP:
@@ -836,7 +836,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam it.rcItem.left = 0;
it.rcItem.right = clRect.right;
- hit = cli.pfnHitTest(hwnd, dat, it.ptCursor.x, it.ptCursor.y, &contact, nullptr, nullptr);
+ hit = g_CLI.pfnHitTest(hwnd, dat, it.ptCursor.x, it.ptCursor.y, &contact, nullptr, nullptr);
if (hit == -1)
break;
if (contact->type != CLCIT_GROUP && contact->type != CLCIT_CONTACT)
@@ -847,8 +847,8 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam POINT ptClientOffset = { 0 };
ClientToScreen(hwnd, &ptClientOffset);
it.isTreeFocused = GetFocus() == hwnd;
- it.rcItem.top = cli.pfnGetRowTopY(dat, hit) - dat->yScroll;
- it.rcItem.bottom = it.rcItem.top + cli.pfnGetRowHeight(dat, hit);
+ it.rcItem.top = g_CLI.pfnGetRowTopY(dat, hit) - dat->yScroll;
+ it.rcItem.bottom = it.rcItem.top + g_CLI.pfnGetRowHeight(dat, hit);
OffsetRect(&it.rcItem, ptClientOffset.x, ptClientOffset.y);
it.isGroup = contact->type == CLCIT_GROUP;
it.hItem = (contact->type == CLCIT_GROUP) ? (HANDLE)contact->groupId : (HANDLE)contact->hContact;
@@ -860,16 +860,16 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case TIMERID_REBUILDAFTER:
KillTimer(hwnd, TIMERID_REBUILDAFTER);
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
Clist_SaveStateAndRebuildList(hwnd, dat);
- cli.bAutoRebuild = false;
+ g_CLI.bAutoRebuild = false;
break;
case TIMERID_DELAYEDRESORTCLC:
KillTimer(hwnd, TIMERID_DELAYEDRESORTCLC);
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
- cli.pfnSortCLC(hwnd, dat, 1);
- cli.pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnSortCLC(hwnd, dat, 1);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
break;
}
break;
@@ -888,7 +888,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (!dat->bFilterSearch)
dat->szQuickSearch[0] = 0;
- hit = cli.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, &group, &hitFlags);
+ hit = g_CLI.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, &group, &hitFlags);
if (hit != -1) {
if (hit == dat->selection && hitFlags & CLCHT_ONITEMLABEL && dat->exStyle & CLS_EX_EDITLABELS) {
SetCapture(hwnd);
@@ -903,15 +903,15 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (hitFlags & CLCHT_ONITEMICON) {
ClcGroup *selgroup;
ClcContact *selcontact;
- dat->selection = cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, &selgroup);
- cli.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
+ dat->selection = g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, &selgroup);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
if (dat->selection != -1) {
dat->selection =
- cli.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
if (dat->selection == -1)
- dat->selection = cli.pfnGetRowsPriorTo(&dat->list, contact->group, -1);
+ dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, contact->group, -1);
}
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
UpdateWindow(hwnd);
break;
}
@@ -922,7 +922,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (contact->type == CLCIT_GROUP)
Clist_SetGroupChildCheckboxes(contact->group, contact->flags & CONTACTF_CHECKED);
Clist_RecalculateGroupCheckboxes(dat);
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
nm.hdr.code = CLN_CHECKCHANGED;
nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
@@ -947,7 +947,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (hitFlags & (CLCHT_ONITEMCHECK | CLCHT_ONITEMEXTRA))
break;
dat->selection = hit;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
if (dat->selection != -1)
Clist_EnsureVisible(hwnd, dat, hit, 0);
UpdateWindow(hwnd);
@@ -966,7 +966,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
if (GetKeyState(VK_MENU) & 0x8000 || GetKeyState(VK_F10) & 0x8000)
break;
- dat->iHotTrack = cli.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), nullptr, nullptr, nullptr);
+ dat->iHotTrack = g_CLI.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), nullptr, nullptr, nullptr);
if (iOldHotTrack != dat->iHotTrack) {
if (iOldHotTrack == -1)
SetCapture(hwnd);
@@ -1000,14 +1000,14 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam pt.y = (short)HIWORD(lParam);
HCURSOR hNewCursor = LoadCursor(nullptr, IDC_NO);
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
if (dat->dragAutoScrolling) {
KillTimer(hwnd, TIMERID_DRAGAUTOSCROLL);
dat->dragAutoScrolling = 0;
}
int target = GetDropTargetInformation(hwnd, dat, pt);
if (dat->dragStage & DRAGSTAGEF_OUTSIDE && target != DROPTARGET_OUTSIDE) {
- cli.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
+ g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
NMCLISTCONTROL nm;
nm.hdr.code = CLN_DRAGSTOP;
@@ -1024,10 +1024,10 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case DROPTARGET_ONCONTACT:
break;
case DROPTARGET_ONGROUP:
- hNewCursor = LoadCursor(cli.hInst, MAKEINTRESOURCE(IDC_DROPUSER));
+ hNewCursor = LoadCursor(g_CLI.hInst, MAKEINTRESOURCE(IDC_DROPUSER));
break;
case DROPTARGET_INSERTION:
- hNewCursor = LoadCursor(cli.hInst, MAKEINTRESOURCE(IDC_DROPUSER));
+ hNewCursor = LoadCursor(g_CLI.hInst, MAKEINTRESOURCE(IDC_DROPUSER));
break;
case DROPTARGET_OUTSIDE:
if (pt.x >= 0 && pt.x < clRect.right
@@ -1044,7 +1044,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam }
dat->dragStage |= DRAGSTAGEF_OUTSIDE;
- cli.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
+ g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
NMCLISTCONTROL nm;
nm.hdr.code = CLN_DRAGGING;
@@ -1058,9 +1058,9 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
default:
- cli.pfnGetRowByIndex(dat, dat->iDragItem, nullptr, &group);
+ g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, nullptr, &group);
if (group->parent)
- hNewCursor = LoadCursor(cli.hInst, MAKEINTRESOURCE(IDC_DROPUSER));
+ hNewCursor = LoadCursor(g_CLI.hInst, MAKEINTRESOURCE(IDC_DROPUSER));
break;
}
SetCursor(hNewCursor);
@@ -1073,7 +1073,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam SetCursor((HCURSOR)GetClassLongPtr(hwnd, GCLP_HCURSOR));
if (dat->exStyle & CLS_EX_TRACKSELECT) {
- dat->iHotTrack = cli.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), nullptr, nullptr, nullptr);
+ dat->iHotTrack = g_CLI.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), nullptr, nullptr, nullptr);
if (dat->iHotTrack == -1)
ReleaseCapture();
}
@@ -1092,8 +1092,8 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case DROPTARGET_ONGROUP:
{
ClcContact *contactn, *contacto;
- cli.pfnGetRowByIndex(dat, dat->selection, &contactn, nullptr);
- cli.pfnGetRowByIndex(dat, dat->iDragItem, &contacto, nullptr);
+ g_CLI.pfnGetRowByIndex(dat, dat->selection, &contactn, nullptr);
+ g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contacto, nullptr);
if (contacto->type == CLCIT_CONTACT) //dropee is a contact
Clist_ContactChangeGroup(contacto->hContact, contactn->groupId);
else if (contacto->type == CLCIT_GROUP) { //dropee is a group
@@ -1105,11 +1105,11 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
case DROPTARGET_INSERTION:
- cli.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
+ g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
{
ClcContact *destcontact;
ClcGroup *destgroup;
- if (cli.pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup) == -1 || destgroup != contact->group->parent)
+ if (g_CLI.pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup) == -1 || destgroup != contact->group->parent)
Clist_GroupMoveBefore(contact->groupId, 0);
else {
if (destcontact->type == CLCIT_GROUP)
@@ -1119,7 +1119,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam }
break;
case DROPTARGET_OUTSIDE:
- cli.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
+ g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
{
NMCLISTCONTROL nm;
nm.hdr.code = CLN_DROPPED;
@@ -1132,7 +1132,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam }
break;
default:
- cli.pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
+ g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
if (!group->parent)
break;
if (contact->type == CLCIT_GROUP) { //dropee is a group
@@ -1145,7 +1145,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam }
}
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
dat->iDragItem = -1;
dat->iInsertionMark = -1;
break;
@@ -1157,8 +1157,8 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam KillTimer(hwnd, TIMERID_RENAME);
KillTimer(hwnd, TIMERID_INFOTIP);
- dat->selection = cli.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, nullptr, &hitFlags);
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ dat->selection = g_CLI.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, nullptr, &hitFlags);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
if (dat->selection != -1)
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
@@ -1181,18 +1181,18 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam {
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
if (pt.x == -1 && pt.y == -1) {
- dat->selection = cli.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
+ dat->selection = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
if (dat->selection != -1)
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
pt.x = dat->iconXSpace + 15;
- pt.y = cli.pfnGetRowTopY(dat, dat->selection) - dat->yScroll + (int)(cli.pfnGetRowHeight(dat, dat->selection) * .7);
+ pt.y = g_CLI.pfnGetRowTopY(dat, dat->selection) - dat->yScroll + (int)(g_CLI.pfnGetRowHeight(dat, dat->selection) * .7);
hitFlags = (dat->selection == -1) ? CLCHT_NOWHERE : CLCHT_ONITEMLABEL;
}
else {
ScreenToClient(hwnd, &pt);
- dat->selection = cli.pfnHitTest(hwnd, dat, pt.x, pt.y, &contact, nullptr, &hitFlags);
+ dat->selection = g_CLI.pfnHitTest(hwnd, dat, pt.x, pt.y, &contact, nullptr, &hitFlags);
}
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
if (dat->selection != -1)
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
UpdateWindow(hwnd);
@@ -1222,7 +1222,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam return Menu_DrawItem(lParam);
case WM_COMMAND:
- hit = cli.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
+ hit = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
if (hit == -1)
break;
@@ -1238,7 +1238,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam Clist_GroupCreate(contact->groupId, nullptr);
break;
case POPUP_RENAMEGROUP:
- cli.pfnBeginRenameSelection(hwnd, dat);
+ g_CLI.pfnBeginRenameSelection(hwnd, dat);
break;
case POPUP_DELETEGROUP:
Clist_GroupDelete(contact->groupId);
diff --git a/src/mir_app/src/clcfiledrop.cpp b/src/mir_app/src/clcfiledrop.cpp index 1065de73de..572bdf1305 100644 --- a/src/mir_app/src/clcfiledrop.cpp +++ b/src/mir_app/src/clcfiledrop.cpp @@ -74,7 +74,7 @@ static MCONTACT HContactFromPoint(HWND hwnd, ClcData *dat, int x, int y, int *hi {
DWORD hitFlags;
ClcContact *contact;
- int hit = cli.pfnHitTest(hwnd, dat, x, y, &contact, nullptr, &hitFlags);
+ int hit = g_CLI.pfnHitTest(hwnd, dat, x, y, &contact, nullptr, &hitFlags);
if (hit == -1 || !(hitFlags & (CLCHT_ONITEMLABEL | CLCHT_ONITEMICON)) || contact->type != CLCIT_CONTACT)
return 0;
@@ -107,7 +107,7 @@ HRESULT CDropTarget::DragOver(DWORD /*grfKeyState*/, POINTL pt, DWORD * pdwEffec *pdwEffect = DROPEFFECT_NONE;
return S_OK;
}
- cli.pfnTrayIconPauseAutoHide(0, 0);
+ g_CLI.pfnTrayIconPauseAutoHide(0, 0);
ClcData *dat = (ClcData*)GetWindowLongPtr(hwndCurrentDrag, 0);
shortPt.x = pt.x;
shortPt.y = pt.y;
@@ -116,7 +116,7 @@ HRESULT CDropTarget::DragOver(DWORD /*grfKeyState*/, POINTL pt, DWORD * pdwEffec if (shortPt.y < dat->dragAutoScrollHeight || shortPt.y >= clRect.bottom - dat->dragAutoScrollHeight) {
*pdwEffect |= DROPEFFECT_SCROLL;
- cli.pfnScrollTo(hwndCurrentDrag, dat, dat->yScroll + (shortPt.y < dat->dragAutoScrollHeight ? -1 : 1) * dat->rowHeight * 2, 0);
+ g_CLI.pfnScrollTo(hwndCurrentDrag, dat, dat->yScroll + (shortPt.y < dat->dragAutoScrollHeight ? -1 : 1) * dat->rowHeight * 2, 0);
}
hContact = HContactFromPoint(hwndCurrentDrag, dat, shortPt.x, shortPt.y, &hit);
if (hContact == 0) {
@@ -128,7 +128,7 @@ HRESULT CDropTarget::DragOver(DWORD /*grfKeyState*/, POINTL pt, DWORD * pdwEffec if (dat->selection != hit) {
dat->selection = hit;
- cli.pfnInvalidateRect(hwndCurrentDrag, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwndCurrentDrag, nullptr, FALSE);
if (pDropTargetHelper) pDropTargetHelper->Show(FALSE);
UpdateWindow(hwndCurrentDrag);
if (pDropTargetHelper) pDropTargetHelper->Show(TRUE);
@@ -166,7 +166,7 @@ HRESULT CDropTarget::DragLeave(void) ClcData *dat = (ClcData *) GetWindowLongPtr(hwndCurrentDrag, 0);
dat->bShowSelAlways = false;
dat->selection = originalSelection;
- cli.pfnInvalidateRect(hwndCurrentDrag, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwndCurrentDrag, nullptr, FALSE);
}
hwndCurrentDrag = nullptr;
return S_OK;
diff --git a/src/mir_app/src/clcidents.cpp b/src/mir_app/src/clcidents.cpp index 0a56e15131..e624598861 100644 --- a/src/mir_app/src/clcidents.cpp +++ b/src/mir_app/src/clcidents.cpp @@ -112,13 +112,13 @@ MIR_APP_DLL(bool) Clist_FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcConta index++;
ClcContact *cc = group->cl[group->scanIndex];
- ClcContact *res = cli.pfnFindItem(dwItem, cc);
+ ClcContact *res = g_CLI.pfnFindItem(dwItem, cc);
if (res != nullptr) {
if (isVisible) {
if (!nowVisible)
*isVisible = 0;
else {
- int posY = cli.pfnGetRowTopY(dat, index+1);
+ int posY = g_CLI.pfnGetRowTopY(dat, index+1);
if (posY < dat->yScroll)
*isVisible = 0;
else {
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index ad290a31eb..2d11498bb0 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ClcContact* fnAddItemToGroup(ClcGroup *group, int iAboveItem) { - ClcContact* newItem = cli.pfnCreateClcContact(); + ClcContact* newItem = g_CLI.pfnCreateClcContact(); newItem->type = CLCIT_DIVIDER; newItem->flags = 0; newItem->szText[0] = '\0'; @@ -85,7 +85,7 @@ ClcGroup* fnAddGroup(HWND hwnd, ClcData *dat, const wchar_t *szName, DWORD flags if (groupId == 0) return nullptr; - ClcContact *cc = cli.pfnAddItemToGroup(group, i); + ClcContact *cc = g_CLI.pfnAddItemToGroup(group, i); cc->type = CLCIT_GROUP; mir_wstrncpy(cc->szText, pThisField, _countof(cc->szText)); cc->groupId = (WORD)(pNextField ? 0 : groupId); @@ -130,7 +130,7 @@ void FreeGroup(ClcGroup *group) return; for (auto &it : group->cl) { - cli.pfnFreeContact(it); + g_CLI.pfnFreeContact(it); mir_free(it); } group->cl.destroy(); @@ -153,7 +153,7 @@ ClcContact* fnAddInfoItemToGroup(ClcGroup *group, int flags, const wchar_t *pszT if (group->cl[i]->type != CLCIT_INFO) break; - ClcContact *cc = cli.pfnAddItemToGroup(group, i); + ClcContact *cc = g_CLI.pfnAddItemToGroup(group, i); iInfoItemUniqueHandle = LOWORD(iInfoItemUniqueHandle + 1); if (iInfoItemUniqueHandle == 0) ++iInfoItemUniqueHandle; @@ -184,7 +184,7 @@ ClcContact* fnAddContactToGroup(ClcData *dat, ClcGroup *group, MCONTACT hContact ClcCacheEntry *pce = Clist_GetCacheEntry(hContact); replaceStrW(pce->tszGroup, nullptr); - ClcContact *cc = cli.pfnAddItemToGroup(group, index + 1); + ClcContact *cc = g_CLI.pfnAddItemToGroup(group, index + 1); cc->type = CLCIT_CONTACT; cc->iImage = Clist_GetContactIcon(hContact); cc->hContact = hContact; @@ -228,7 +228,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo if (tszGroup == nullptr) group = &dat->list; else { - group = cli.pfnAddGroup(hwnd, dat, tszGroup, (DWORD)-1, 0, 0); + group = g_CLI.pfnAddGroup(hwnd, dat, tszGroup, (DWORD)-1, 0, 0); if (group == nullptr) { if (!(style & CLS_HIDEEMPTYGROUPS)) return; @@ -255,9 +255,9 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo size_t len = mir_wstrlen(szGroupName); if (!wcsncmp(szGroupName, tszGroup, len) && tszGroup[len] == '\\') - cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 1); + g_CLI.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 1); } - group = cli.pfnAddGroup(hwnd, dat, tszGroup, groupFlags, i, 1); + group = g_CLI.pfnAddGroup(hwnd, dat, tszGroup, groupFlags, i, 1); } } @@ -268,7 +268,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo return; } } - cli.pfnAddContactToGroup(dat, group, hContact); + g_CLI.pfnAddContactToGroup(dat, group, hContact); if (updateTotalCount) group->totalMembers++; } @@ -283,10 +283,10 @@ MIR_APP_DLL(ClcGroup*) Clist_RemoveItemFromGroup(HWND hwnd, ClcGroup *group, Clc if (updateTotalCount) group->totalMembers--; - cli.pfnInvalidateDisplayNameCacheEntry(contact->hContact); + g_CLI.pfnInvalidateDisplayNameCacheEntry(contact->hContact); } - cli.pfnFreeContact(group->cl[iContact]); + g_CLI.pfnFreeContact(group->cl[iContact]); mir_free(group->cl[iContact]); group->cl.remove(iContact); @@ -356,11 +356,11 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) wchar_t *szGroupName = Clist_GroupGetName(i, &groupFlags); if (szGroupName == nullptr) break; - cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 0); + g_CLI.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 0); } for (auto &hContact : Contacts()) { - int nHiddenStatus = cli.pfnGetContactHiddenStatus(hContact, nullptr, dat); + int nHiddenStatus = g_CLI.pfnGetContactHiddenStatus(hContact, nullptr, dat); if (((style & CLS_SHOWHIDDEN) && nHiddenStatus != -1) || !nHiddenStatus) { ClcCacheEntry *pce = Clist_GetCacheEntry(hContact); if (pce->szProto == nullptr) @@ -371,7 +371,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) if (tszGroupName == nullptr) group = &dat->list; else { - group = cli.pfnAddGroup(hwnd, dat, tszGroupName, (DWORD)-1, 0, 0); + group = g_CLI.pfnAddGroup(hwnd, dat, tszGroupName, (DWORD)-1, 0, 0); if (group == nullptr && style & CLS_SHOWHIDDEN) group = &dat->list; } @@ -385,18 +385,18 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch)); if (wcsstr(lowered_name, lowered_search)) - cli.pfnAddContactToGroup(dat, group, hContact); + g_CLI.pfnAddContactToGroup(dat, group, hContact); } else if (!(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) { char *szProto = GetContactProto(hContact); if (szProto == nullptr) { - if (!Clist_IsHiddenMode(dat, ID_STATUS_OFFLINE) || cli.pfnIsVisibleContact(pce, group)) - cli.pfnAddContactToGroup(dat, group, hContact); + if (!Clist_IsHiddenMode(dat, ID_STATUS_OFFLINE) || g_CLI.pfnIsVisibleContact(pce, group)) + g_CLI.pfnAddContactToGroup(dat, group, hContact); } - else if (!Clist_IsHiddenMode(dat, db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)) || cli.pfnIsVisibleContact(pce, group)) - cli.pfnAddContactToGroup(dat, group, hContact); + else if (!Clist_IsHiddenMode(dat, db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)) || g_CLI.pfnIsVisibleContact(pce, group)) + g_CLI.pfnAddContactToGroup(dat, group, hContact); } - else cli.pfnAddContactToGroup(dat, group, hContact); + else g_CLI.pfnAddContactToGroup(dat, group, hContact); } } } @@ -427,7 +427,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) } } - cli.pfnSortCLC(hwnd, dat, 0); + g_CLI.pfnSortCLC(hwnd, dat, 0); ExtraIcon_SetAll(); } @@ -469,7 +469,7 @@ static int __cdecl ContactSortProc(const void* p1, const void* p2) { ClcContact **contact1 = (ClcContact**)p1, **contact2 = (ClcContact**)p2; - int result = cli.pfnCompareContacts(contact1[0], contact2[0]); + int result = g_CLI.pfnCompareContacts(contact1[0], contact2[0]); if (result) return result; //nothing to distinguish them, so make sure they stay in the same order @@ -540,7 +540,7 @@ static void SortGroup(ClcData *dat, ClcGroup *group, int useInsertionSort) prevContactOnline = 1; else { if (prevContactOnline) { - ClcContact *cc = cli.pfnAddItemToGroup(group, i); + ClcContact *cc = g_CLI.pfnAddItemToGroup(group, i); cc->type = CLCIT_DIVIDER; mir_wstrcpy(cc->szText, TranslateT("Offline")); } @@ -557,7 +557,7 @@ void fnSortCLC(HWND hwnd, ClcData *dat, int useInsertionSort) if (dat->bNeedsResort) { MCONTACT hSelItem; ClcContact *selcontact; - if (cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) == -1) + if (g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) == -1) hSelItem = 0; else hSelItem = Clist_ContactToHItem(selcontact); @@ -584,13 +584,13 @@ void fnSortCLC(HWND hwnd, ClcData *dat, int useInsertionSort) if (hSelItem) { ClcGroup *selgroup; if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr)) - dat->selection = cli.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact)); + dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact)); } - cli.pfnRecalcScrollBar(hwnd, dat); + g_CLI.pfnRecalcScrollBar(hwnd, dat); } dat->bNeedsResort = false; - cli.pfnInvalidateRect(hwnd, nullptr, FALSE); + g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE); } struct SavedContactState_t @@ -663,7 +663,7 @@ MIR_APP_DLL(void) Clist_SaveStateAndRebuildList(HWND hwnd, ClcData *dat) } FreeGroup(&dat->list); - cli.pfnRebuildEntireList(hwnd, dat); + g_CLI.pfnRebuildEntireList(hwnd, dat); group = &dat->list; group->scanIndex = 0; @@ -709,14 +709,14 @@ MIR_APP_DLL(void) Clist_SaveStateAndRebuildList(HWND hwnd, ClcData *dat) group = contact->group; } - ClcContact *cc = cli.pfnAddInfoItemToGroup(group, it->contact.flags, L""); + ClcContact *cc = g_CLI.pfnAddInfoItemToGroup(group, it->contact.flags, L""); *cc = it->contact; } dat->bLockScrollbar = false; Clist_RecalculateGroupCheckboxes(dat); - cli.pfnRecalcScrollBar(hwnd, dat); + g_CLI.pfnRecalcScrollBar(hwnd, dat); NMCLISTCONTROL nm; nm.hdr.code = CLN_LISTREBUILT; diff --git a/src/mir_app/src/clcmsgs.cpp b/src/mir_app/src/clcmsgs.cpp index c8b9f0a493..427f352e10 100644 --- a/src/mir_app/src/clcmsgs.cpp +++ b/src/mir_app/src/clcmsgs.cpp @@ -35,9 +35,9 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar switch (msg) {
case CLM_ADDCONTACT:
- cli.pfnAddContactToTree(hwnd, dat, wParam, 1, 0);
- cli.pfnRecalcScrollBar(hwnd, dat);
- cli.pfnSortCLC(hwnd, dat, 1);
+ g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 0);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnSortCLC(hwnd, dat, 1);
break;
case CLM_ADDGROUP:
@@ -46,8 +46,8 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar wchar_t *szName = Clist_GroupGetName(wParam, &groupFlags);
if (szName == nullptr)
break;
- cli.pfnAddGroup(hwnd, dat, szName, groupFlags, wParam, 0);
- cli.pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnAddGroup(hwnd, dat, szName, groupFlags, wParam, 0);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
}
break;
@@ -68,11 +68,11 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar ClcContact *cc;
if (msg == CLM_ADDINFOITEMA) {
WCHAR* wszText = mir_a2u((char*)cii->pszText);
- cc = cli.pfnAddInfoItemToGroup(group, cii->flags, wszText);
+ cc = g_CLI.pfnAddInfoItemToGroup(group, cii->flags, wszText);
mir_free(wszText);
}
- else cc = cli.pfnAddInfoItemToGroup(group, cii->flags, cii->pszText);
- cli.pfnRecalcScrollBar(hwnd, dat);
+ else cc = g_CLI.pfnAddInfoItemToGroup(group, cii->flags, cii->pszText);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
return (LRESULT)cc->hContact | HCONTACT_ISINFO;
}
@@ -82,13 +82,13 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar case CLM_DELETEITEM:
Clist_DeleteItemFromTree(hwnd, wParam);
- cli.pfnSortCLC(hwnd, dat, 1);
- cli.pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnSortCLC(hwnd, dat, 1);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
break;
case CLM_EDITLABEL:
SendMessage(hwnd, CLM_SELECTITEM, wParam, 0);
- cli.pfnBeginRenameSelection(hwnd, dat);
+ g_CLI.pfnBeginRenameSelection(hwnd, dat);
break;
case CLM_ENDEDITLABELNOW:
@@ -100,14 +100,14 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar break;
for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
- cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
- Clist_EnsureVisible(hwnd, dat, cli.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact)), 0);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
+ Clist_EnsureVisible(hwnd, dat, g_CLI.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact)), 0);
break;
case CLM_EXPAND:
if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
if (contact->type == CLCIT_GROUP)
- cli.pfnSetGroupExpand(hwnd, dat, contact->group, lParam);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, lParam);
break;
case CLM_FINDCONTACT:
@@ -129,7 +129,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar return (contact->flags & CONTACTF_CHECKED) != 0;
case CLM_GETCOUNT:
- return cli.pfnGetGroupContentsCount(&dat->list, 0);
+ return g_CLI.pfnGetGroupContentsCount(&dat->list, 0);
case CLM_GETEDITCONTROL:
return (LRESULT)dat->hwndRenameEdit;
@@ -143,7 +143,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar case CLM_SETEXTRASPACE:
dat->extraColumnSpacing = (int)wParam;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
return 0;
case CLM_GETEXTRACOLUMNS:
@@ -274,7 +274,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar return dat->scrollTime;
case CLM_GETSELECTION:
- if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
+ if (g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
return 0;
return Clist_ContactToHItem(contact);
@@ -286,7 +286,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar case CLM_HITTEST:
DWORD hitFlags;
{
- int hit = cli.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, nullptr, &hitFlags);
+ int hit = g_CLI.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, nullptr, &hitFlags);
if (wParam)
*(PDWORD)wParam = hitFlags;
if (hit == -1)
@@ -299,8 +299,8 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar break;
for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
- cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
- dat->selection = cli.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact));
+ g_CLI.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
+ dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact));
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
break;
@@ -312,7 +312,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar dat->hBmpBackground = (HBITMAP)lParam;
dat->backgroundBmpUse = wParam;
dat->bkChanged = 1;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case CLM_SETBKCOLOR:
@@ -322,7 +322,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar }
dat->bkColour = wParam;
dat->bkChanged = 1;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case CLM_SETCHECKMARK:
@@ -333,7 +333,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar else
contact->flags &= ~CONTACTF_CHECKED;
Clist_RecalculateGroupCheckboxes(dat);
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case CLM_SETEXTRACOLUMNS:
@@ -341,7 +341,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar return 0;
dat->extraColumnsCount = wParam;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case CLM_SETEXTRAIMAGE:
@@ -350,14 +350,14 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, &bVisible)) {
contact->iExtraImage[LOWORD(lParam)] = HIWORD(lParam);
if (bVisible)
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
}
}
break;
case CLM_SETEXTRAIMAGELIST:
dat->himlExtraColumns = (HIMAGELIST)lParam;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case CLM_SETFONT:
@@ -377,7 +377,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar ReleaseDC(hwnd, hdc);
}
if (LOWORD(lParam))
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case CLM_SETGREYOUTFLAGS:
@@ -406,13 +406,13 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
break;
mir_wstrncpy(contact->szText, (wchar_t*)lParam, _countof(contact->szText));
- cli.pfnSortCLC(hwnd, dat, 1);
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnSortCLC(hwnd, dat, 1);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case CLM_SETLEFTMARGIN:
dat->leftMargin = wParam;
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case CLM_SETOFFLINEMODES:
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index c8ce0a8b68..00e920c3aa 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -115,9 +115,9 @@ int fnHitTest(HWND hwnd, ClcData *dat, int testx, int testy, ClcContact **contac *flags |= CLCHT_INLEFTMARGIN | CLCHT_NOWHERE;
return -1;
}
- int hit = cli.pfnRowHitTest(dat, dat->yScroll + testy);
+ int hit = g_CLI.pfnRowHitTest(dat, dat->yScroll + testy);
if (hit != -1)
- hit = cli.pfnGetRowByIndex(dat, hit, &hitcontact, &hitgroup);
+ hit = g_CLI.pfnGetRowByIndex(dat, hit, &hitcontact, &hitgroup);
if (hit == -1) {
if (flags)
*flags |= CLCHT_NOWHERE | CLCHT_BELOWITEMS;
@@ -205,7 +205,7 @@ void fnScrollTo(HWND hwnd, ClcData *dat, int desty, int noSmooth) RECT clRect;
GetClientRect(hwnd, &clRect);
- int maxy = cli.pfnGetRowTotalHeight(dat) - clRect.bottom;
+ int maxy = g_CLI.pfnGetRowTotalHeight(dat) - clRect.bottom;
if (desty > maxy)
desty = maxy;
if (desty < 0)
@@ -227,7 +227,7 @@ void fnScrollTo(HWND hwnd, ClcData *dat, int desty, int noSmooth) if (dat->backgroundBmpUse & CLBF_SCROLL || dat->hBmpBackground == nullptr)
ScrollWindowEx(hwnd, 0, previousy - dat->yScroll, nullptr, nullptr, nullptr, nullptr, SW_INVALIDATE);
else
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
previousy = dat->yScroll;
SetScrollPos(hwnd, SB_VERT, dat->yScroll, TRUE);
UpdateWindow(hwnd);
@@ -238,13 +238,13 @@ void fnScrollTo(HWND hwnd, ClcData *dat, int desty, int noSmooth) if (dat->backgroundBmpUse & CLBF_SCROLL || dat->hBmpBackground == nullptr)
ScrollWindowEx(hwnd, 0, previousy - dat->yScroll, nullptr, nullptr, nullptr, nullptr, SW_INVALIDATE);
else
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
SetScrollPos(hwnd, SB_VERT, dat->yScroll, TRUE);
}
MIR_APP_DLL(void) Clist_EnsureVisible(HWND hwnd, ClcData *dat, int iItem, int partialOk)
{
- int itemy = cli.pfnGetRowTopY(dat, iItem), itemh = cli.pfnGetRowHeight(dat, iItem), newY = 0;
+ int itemy = g_CLI.pfnGetRowTopY(dat, iItem), itemh = g_CLI.pfnGetRowHeight(dat, iItem), newY = 0;
int moved = 0;
RECT clRect;
@@ -270,7 +270,7 @@ MIR_APP_DLL(void) Clist_EnsureVisible(HWND hwnd, ClcData *dat, int iItem, int pa }
}
if (moved)
- cli.pfnScrollTo(hwnd, dat, newY, 0);
+ g_CLI.pfnScrollTo(hwnd, dat, newY, 0);
}
void fnRecalcScrollBar(HWND hwnd, ClcData *dat)
@@ -285,7 +285,7 @@ void fnRecalcScrollBar(HWND hwnd, ClcData *dat) si.cbSize = sizeof(si);
si.fMask = SIF_ALL;
si.nMin = 0;
- si.nMax = cli.pfnGetRowTotalHeight(dat)-1;
+ si.nMax = g_CLI.pfnGetRowTotalHeight(dat)-1;
si.nPage = clRect.bottom;
si.nPos = dat->yScroll;
@@ -295,7 +295,7 @@ void fnRecalcScrollBar(HWND hwnd, ClcData *dat) }
else SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
- cli.pfnScrollTo(hwnd, dat, dat->yScroll, 1);
+ g_CLI.pfnScrollTo(hwnd, dat, dat->yScroll, 1);
NMCLISTCONTROL nm;
nm.hdr.code = CLN_LISTSIZECHANGE;
@@ -320,22 +320,22 @@ void fnSetGroupExpand(HWND hwnd, ClcData *dat, ClcGroup *group, int newState) return;
group->expanded = newState != 0;
}
- cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
- contentCount = cli.pfnGetGroupContentsCount(group, 1);
- groupy = cli.pfnGetRowsPriorTo(&dat->list, group, -1);
+ g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ contentCount = g_CLI.pfnGetGroupContentsCount(group, 1);
+ groupy = g_CLI.pfnGetRowsPriorTo(&dat->list, group, -1);
if (dat->selection > groupy && dat->selection < groupy + contentCount)
dat->selection = groupy;
GetClientRect(hwnd, &clRect);
newY = dat->yScroll;
- posY = cli.pfnGetRowBottomY(dat, groupy + contentCount);
+ posY = g_CLI.pfnGetRowBottomY(dat, groupy + contentCount);
if (posY >= newY + clRect.bottom)
newY = posY - clRect.bottom;
- posY = cli.pfnGetRowTopY(dat, groupy);
+ posY = g_CLI.pfnGetRowTopY(dat, groupy);
if (newY > posY)
newY = posY;
- cli.pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
if (group->expanded)
- cli.pfnScrollTo(hwnd, dat, newY, 0);
+ g_CLI.pfnScrollTo(hwnd, dat, newY, 0);
nm.hdr.code = CLN_EXPANDED;
nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
@@ -353,11 +353,11 @@ MIR_APP_DLL(void) Clist_DoSelectionDefaultAction(HWND hwnd, ClcData *dat) dat->szQuickSearch[0] = 0;
ClcContact *contact;
- if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
+ if (g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
return;
if (contact->type == CLCIT_GROUP)
- cli.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
if (contact->type == CLCIT_CONTACT)
Clist_ContactDoubleClicked(contact->hContact);
@@ -393,8 +393,8 @@ int fnFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk) ClcGroup *contactGroup = group;
int contactScanIndex = group->scanIndex;
for (; group; group = group->parent)
- cli.pfnSetGroupExpand(hwnd, dat, group, 1);
- return cli.pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
+ g_CLI.pfnSetGroupExpand(hwnd, dat, group, 1);
+ return g_CLI.pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
}
if (cc->type == CLCIT_GROUP) {
if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || cc->group->expanded) {
@@ -421,7 +421,7 @@ MIR_APP_DLL(void) Clist_EndRename(ClcData *dat, int save) GetWindowText(hwndEdit, text, _countof(text));
ClcContact *contact;
- if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) != -1) {
+ if (g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) != -1) {
if (mir_wstrcmp(contact->szText, text) && !wcsstr(text, L"\\")) {
if (contact->type == CLCIT_GROUP) {
if (contact->group->parent && contact->group->parent->parent) {
@@ -434,7 +434,7 @@ MIR_APP_DLL(void) Clist_EndRename(ClcData *dat, int save) Clist_GroupRename(contact->groupId, text);
}
else if (contact->type == CLCIT_CONTACT) {
- cli.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
wchar_t* otherName = Clist_GetContactDisplayName(contact->hContact, GCDNF_NOMYHANDLE);
if (!text[0] || !mir_wstrcmp(otherName, text))
db_unset(contact->hContact, "CList", "MyHandle");
@@ -455,7 +455,7 @@ MIR_APP_DLL(void) Clist_DeleteFromContactList(HWND hwnd, ClcData *dat) return;
dat->szQuickSearch[0] = 0;
- if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
+ if (g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
return;
switch (contact->type) {
@@ -507,7 +507,7 @@ void fnBeginRenameSelection(HWND hwnd, ClcData *dat) ClcGroup *group;
ClcContact *contact;
- dat->selection = cli.pfnGetRowByIndex(dat, dat->selection, &contact, &group);
+ dat->selection = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, &group);
if (dat->selection == -1 || (contact->type != CLCIT_CONTACT && contact->type != CLCIT_GROUP))
return;
@@ -516,8 +516,8 @@ void fnBeginRenameSelection(HWND hwnd, ClcData *dat) POINT pt;
Clist_CalcEipPosition(dat, contact, group, &pt);
- int h = cli.pfnGetRowHeight(dat, dat->selection);
- dat->hwndRenameEdit = CreateWindow(L"EDIT", contact->szText, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, pt.x, pt.y, clRect.right - pt.x, h, hwnd, nullptr, cli.hInst, nullptr);
+ int h = g_CLI.pfnGetRowHeight(dat, dat->selection);
+ dat->hwndRenameEdit = CreateWindow(L"EDIT", contact->szText, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, pt.x, pt.y, clRect.right - pt.x, h, hwnd, nullptr, g_CLI.hInst, nullptr);
mir_subclassWindow(dat->hwndRenameEdit, RenameEditSubclassProc);
SendMessage(dat->hwndRenameEdit, WM_SETFONT, (WPARAM)(contact->type == CLCIT_GROUP ? dat->fontInfo[FONTID_GROUPS].hFont : dat->fontInfo[FONTID_CONTACTS].hFont), 0);
SendMessage(dat->hwndRenameEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN | EC_USEFONTINFO, 0);
@@ -531,7 +531,7 @@ MIR_APP_DLL(void) Clist_CalcEipPosition(ClcData *dat, ClcContact *, ClcGroup *gr int indent;
for (indent = 0; group->parent; indent++, group = group->parent);
result->x = indent * dat->groupIndent + dat->iconXSpace - 2;
- result->y = cli.pfnGetRowTopY(dat, dat->selection) - dat->yScroll;
+ result->y = g_CLI.pfnGetRowTopY(dat, dat->selection) - dat->yScroll;
}
int GetDropTargetInformation(HWND hwnd, ClcData *dat, POINT pt)
@@ -546,8 +546,8 @@ int GetDropTargetInformation(HWND hwnd, ClcData *dat, POINT pt) ClcContact *contact, *movecontact;
ClcGroup *group, *movegroup;
DWORD hitFlags;
- int hit = cli.pfnHitTest(hwnd, dat, pt.x, pt.y, &contact, &group, &hitFlags);
- cli.pfnGetRowByIndex(dat, dat->iDragItem, &movecontact, &movegroup);
+ int hit = g_CLI.pfnHitTest(hwnd, dat, pt.x, pt.y, &contact, &group, &hitFlags);
+ g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &movecontact, &movegroup);
if (hit == dat->iDragItem)
return DROPTARGET_ONSELF;
if (hit == -1 || movecontact == nullptr || (hitFlags & CLCHT_ONITEMEXTRA))
@@ -558,21 +558,21 @@ int GetDropTargetInformation(HWND hwnd, ClcData *dat, POINT pt) ClcGroup *topgroup = nullptr;
int topItem = -1, bottomItem = -1;
int ok = 0;
- if (pt.y + dat->yScroll < cli.pfnGetRowTopY(dat, hit) + dat->insertionMarkHitHeight) {
+ if (pt.y + dat->yScroll < g_CLI.pfnGetRowTopY(dat, hit) + dat->insertionMarkHitHeight) {
//could be insertion mark (above)
topItem = hit - 1;
bottomItem = hit;
bottomcontact = contact;
- topItem = cli.pfnGetRowByIndex(dat, topItem, &topcontact, &topgroup);
+ topItem = g_CLI.pfnGetRowByIndex(dat, topItem, &topcontact, &topgroup);
ok = 1;
}
- if (pt.y + dat->yScroll >= cli.pfnGetRowBottomY(dat, hit+1) - dat->insertionMarkHitHeight) {
+ if (pt.y + dat->yScroll >= g_CLI.pfnGetRowBottomY(dat, hit+1) - dat->insertionMarkHitHeight) {
//could be insertion mark (below)
topItem = hit;
bottomItem = hit + 1;
topcontact = contact;
topgroup = group;
- bottomItem = cli.pfnGetRowByIndex(dat, bottomItem, &bottomcontact, nullptr);
+ bottomItem = g_CLI.pfnGetRowByIndex(dat, bottomItem, &bottomcontact, nullptr);
ok = 1;
}
if (ok) {
@@ -703,7 +703,7 @@ void fnGetDefaultFontSetting(int i, LOGFONT *lf, COLORREF *colour) MIR_APP_DLL(void) Clist_GetFontSetting(int i, LOGFONT *lf, COLORREF *colour)
{
- cli.pfnGetDefaultFontSetting(i, lf, colour);
+ g_CLI.pfnGetDefaultFontSetting(i, lf, colour);
char idstr[20];
mir_snprintf(idstr, "Font%dName", i);
@@ -754,7 +754,7 @@ void fnLoadClcOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->quickSearchColour = db_get_dw(0, "CLC", "QuickSearchColour", CLCDEFAULT_QUICKSEARCHCOLOUR);
dat->bUseWindowsColours = db_get_b(0, "CLC", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS) != 0;
- if (cli.hwndContactTree != nullptr && hwnd != cli.hwndContactTree) {
+ if (g_CLI.hwndContactTree != nullptr && hwnd != g_CLI.hwndContactTree) {
dat->bkChanged = true; // block custom background
dat->bkColour = GetSysColor(COLOR_WINDOW);
if (dat->hBmpBackground) {
@@ -843,10 +843,10 @@ MIR_APP_DLL(void) Clist_SetGroupChildCheckboxes(ClcGroup *group, int checked) for (auto &cc : group->cl) {
if (cc->type == CLCIT_GROUP) {
Clist_SetGroupChildCheckboxes(cc->group, checked);
- cli.pfnSetContactCheckboxes(cc, checked);
+ g_CLI.pfnSetContactCheckboxes(cc, checked);
}
else if (cc->type == CLCIT_CONTACT)
- cli.pfnSetContactCheckboxes(cc, checked);
+ g_CLI.pfnSetContactCheckboxes(cc, checked);
}
}
@@ -857,9 +857,9 @@ MIR_APP_DLL(void) Clist_InvalidateItem(HWND hwnd, ClcData *dat, int iItem) RECT rc;
GetClientRect(hwnd, &rc);
- rc.top = cli.pfnGetRowTopY(dat, iItem) - dat->yScroll;
- rc.bottom = rc.top + cli.pfnGetRowHeight(dat, iItem);
- cli.pfnInvalidateRect(hwnd, &rc, FALSE);
+ rc.top = g_CLI.pfnGetRowTopY(dat, iItem) - dat->yScroll;
+ rc.bottom = rc.top + g_CLI.pfnGetRowHeight(dat, iItem);
+ g_CLI.pfnInvalidateRect(hwnd, &rc, FALSE);
}
///////////////////////////////////////////////////////////////////////////////
@@ -877,7 +877,7 @@ int fnGetRowBottomY(ClcData *dat, int item) int fnGetRowTotalHeight(ClcData *dat)
{
- return dat->rowHeight * cli.pfnGetGroupContentsCount(&dat->list, 1);
+ return dat->rowHeight * g_CLI.pfnGetGroupContentsCount(&dat->list, 1);
}
int fnGetRowHeight(ClcData *dat, int)
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index 7c300e574a..a6454e62f3 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int LoadContactListModule2(void);
int LoadCLCModule(void);
-CLIST_INTERFACE cli;
+MIR_APP_DLL(CLIST_INTERFACE) g_CLI;
static wchar_t szTip[MAX_TIP_SIZE+1];
@@ -58,79 +58,79 @@ static int fnIsVisibleContact(ClcCacheEntry*, ClcGroup*) void InitClistCore()
{
- cli.menuProtos = &g_menuProtos;
+ g_CLI.menuProtos = &g_menuProtos;
- cli.pfnContactListControlWndProc = fnContactListControlWndProc;
+ g_CLI.pfnContactListControlWndProc = fnContactListControlWndProc;
- cli.pfnGetRowsPriorTo = fnGetRowsPriorTo;
- cli.pfnFindItem = fnFindItem;
- cli.pfnGetRowByIndex = fnGetRowByIndex;
- cli.pfnGetContactHiddenStatus = fnGetContactHiddenStatus;
+ g_CLI.pfnGetRowsPriorTo = fnGetRowsPriorTo;
+ g_CLI.pfnFindItem = fnFindItem;
+ g_CLI.pfnGetRowByIndex = fnGetRowByIndex;
+ g_CLI.pfnGetContactHiddenStatus = fnGetContactHiddenStatus;
- cli.pfnAddGroup = fnAddGroup;
- cli.pfnAddItemToGroup = fnAddItemToGroup;
- cli.pfnCreateClcContact = fnCreateClcContact;
+ g_CLI.pfnAddGroup = fnAddGroup;
+ g_CLI.pfnAddItemToGroup = fnAddItemToGroup;
+ g_CLI.pfnCreateClcContact = fnCreateClcContact;
- cli.pfnFreeContact = fnFreeContact;
- cli.pfnAddInfoItemToGroup = fnAddInfoItemToGroup;
- cli.pfnAddContactToGroup = fnAddContactToGroup;
- cli.pfnAddContactToTree = fnAddContactToTree;
- cli.pfnRebuildEntireList = fnRebuildEntireList;
- cli.pfnGetGroupContentsCount = fnGetGroupContentsCount;
- cli.pfnSortCLC = fnSortCLC;
-
- cli.pfnProcessExternalMessages = fnProcessExternalMessages;
-
- cli.pfnPaintClc = fnPaintClc;
-
- cli.pfnHitTest = fnHitTest;
- cli.pfnScrollTo = fnScrollTo;
- cli.pfnRecalcScrollBar = fnRecalcScrollBar;
- cli.pfnSetGroupExpand = fnSetGroupExpand;
- cli.pfnFindRowByText = fnFindRowByText;
- cli.pfnBeginRenameSelection = fnBeginRenameSelection;
- cli.pfnIsVisibleContact = fnIsVisibleContact;
- cli.pfnGetDefaultFontSetting = fnGetDefaultFontSetting;
- cli.pfnLoadClcOptions = fnLoadClcOptions;
- cli.pfnGetRowBottomY = fnGetRowBottomY;
- cli.pfnGetRowHeight = fnGetRowHeight;
- cli.pfnGetRowTopY = fnGetRowTopY;
- cli.pfnGetRowTotalHeight = fnGetRowTotalHeight;
- cli.pfnRowHitTest = fnRowHitTest;
-
- cli.pfnAddEvent = fnAddEvent;
- cli.pfnGetEvent = fnGetEvent;
- cli.pfnGetImlIconIndex = fnGetImlIconIndex;
- cli.pfnRemoveEvent = fnRemoveEvent;
-
- cli.pfnInvalidateDisplayNameCacheEntry = fnInvalidateDisplayNameCacheEntry;
- cli.pfnCreateCacheItem = fnCreateCacheItem;
- cli.pfnCheckCacheItem = fnCheckCacheItem;
- cli.pfnFreeCacheItem = fnFreeCacheItem;
-
- cli.szTip = szTip;
-
- cli.pfnTrayIconInit = fnTrayIconInit;
- cli.pfnTrayIconPauseAutoHide = fnTrayIconPauseAutoHide;
- cli.pfnTrayIconProcessMessage = fnTrayIconProcessMessage;
-
- cli.pfnContactListWndProc = fnContactListWndProc;
- cli.pfnLoadCluiGlobalOpts = fnLoadCluiGlobalOpts;
- cli.pfnCluiProtocolStatusChanged = fnCluiProtocolStatusChanged;
- cli.pfnInvalidateRect = fnInvalidateRect;
- cli.pfnOnCreateClc = fnOnCreateClc;
-
- cli.pfnSetHideOffline = fnSetHideOffline;
-
- cli.pfnDocking_ProcessWindowMessage = fnDocking_ProcessWindowMessage;
-
- cli.pfnGetIconFromStatusMode = fnGetIconFromStatusMode;
- cli.pfnGetWindowVisibleState = fnGetWindowVisibleState;
- cli.pfnIconFromStatusMode = fnIconFromStatusMode;
- cli.pfnShowHide = fnShowHide;
-
- cli.pfnTrayCalcChanged = fnTrayCalcChanged;
- cli.pfnSetContactCheckboxes = fnSetContactCheckboxes;
+ g_CLI.pfnFreeContact = fnFreeContact;
+ g_CLI.pfnAddInfoItemToGroup = fnAddInfoItemToGroup;
+ g_CLI.pfnAddContactToGroup = fnAddContactToGroup;
+ g_CLI.pfnAddContactToTree = fnAddContactToTree;
+ g_CLI.pfnRebuildEntireList = fnRebuildEntireList;
+ g_CLI.pfnGetGroupContentsCount = fnGetGroupContentsCount;
+ g_CLI.pfnSortCLC = fnSortCLC;
+
+ g_CLI.pfnProcessExternalMessages = fnProcessExternalMessages;
+
+ g_CLI.pfnPaintClc = fnPaintClc;
+
+ g_CLI.pfnHitTest = fnHitTest;
+ g_CLI.pfnScrollTo = fnScrollTo;
+ g_CLI.pfnRecalcScrollBar = fnRecalcScrollBar;
+ g_CLI.pfnSetGroupExpand = fnSetGroupExpand;
+ g_CLI.pfnFindRowByText = fnFindRowByText;
+ g_CLI.pfnBeginRenameSelection = fnBeginRenameSelection;
+ g_CLI.pfnIsVisibleContact = fnIsVisibleContact;
+ g_CLI.pfnGetDefaultFontSetting = fnGetDefaultFontSetting;
+ g_CLI.pfnLoadClcOptions = fnLoadClcOptions;
+ g_CLI.pfnGetRowBottomY = fnGetRowBottomY;
+ g_CLI.pfnGetRowHeight = fnGetRowHeight;
+ g_CLI.pfnGetRowTopY = fnGetRowTopY;
+ g_CLI.pfnGetRowTotalHeight = fnGetRowTotalHeight;
+ g_CLI.pfnRowHitTest = fnRowHitTest;
+
+ g_CLI.pfnAddEvent = fnAddEvent;
+ g_CLI.pfnGetEvent = fnGetEvent;
+ g_CLI.pfnGetImlIconIndex = fnGetImlIconIndex;
+ g_CLI.pfnRemoveEvent = fnRemoveEvent;
+
+ g_CLI.pfnInvalidateDisplayNameCacheEntry = fnInvalidateDisplayNameCacheEntry;
+ g_CLI.pfnCreateCacheItem = fnCreateCacheItem;
+ g_CLI.pfnCheckCacheItem = fnCheckCacheItem;
+ g_CLI.pfnFreeCacheItem = fnFreeCacheItem;
+
+ g_CLI.szTip = szTip;
+
+ g_CLI.pfnTrayIconInit = fnTrayIconInit;
+ g_CLI.pfnTrayIconPauseAutoHide = fnTrayIconPauseAutoHide;
+ g_CLI.pfnTrayIconProcessMessage = fnTrayIconProcessMessage;
+
+ g_CLI.pfnContactListWndProc = fnContactListWndProc;
+ g_CLI.pfnLoadCluiGlobalOpts = fnLoadCluiGlobalOpts;
+ g_CLI.pfnCluiProtocolStatusChanged = fnCluiProtocolStatusChanged;
+ g_CLI.pfnInvalidateRect = fnInvalidateRect;
+ g_CLI.pfnOnCreateClc = fnOnCreateClc;
+
+ g_CLI.pfnSetHideOffline = fnSetHideOffline;
+
+ g_CLI.pfnDocking_ProcessWindowMessage = fnDocking_ProcessWindowMessage;
+
+ g_CLI.pfnGetIconFromStatusMode = fnGetIconFromStatusMode;
+ g_CLI.pfnGetWindowVisibleState = fnGetWindowVisibleState;
+ g_CLI.pfnIconFromStatusMode = fnIconFromStatusMode;
+ g_CLI.pfnShowHide = fnShowHide;
+
+ g_CLI.pfnTrayCalcChanged = fnTrayCalcChanged;
+ g_CLI.pfnSetContactCheckboxes = fnSetContactCheckboxes;
}
MIR_APP_DLL(CLIST_INTERFACE*) Clist_GetInterface(void)
@@ -141,5 +141,5 @@ MIR_APP_DLL(CLIST_INTERFACE*) Clist_GetInterface(void) g_bReadyToInitClist = false;
}
- return &cli;
+ return &g_CLI;
}
diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp index 192bf7b704..76e4116313 100644 --- a/src/mir_app/src/clistevents.cpp +++ b/src/mir_app/src/clistevents.cpp @@ -98,7 +98,7 @@ static void ShowOneEventInTray(int idx) static void ShowEventsInTray()
{
- int nTrayCnt = cli.trayIconCount;
+ int nTrayCnt = g_CLI.trayIconCount;
if (!g_cliEvents.getCount() || !nTrayCnt)
return;
@@ -110,11 +110,11 @@ static void ShowEventsInTray() // in case if we have several icons in tray and several events with different protocols
// lets use several icon to show events from protocols in different icons
mir_cslock lck(trayLockCS);
- char **pTrayProtos = (char**)_alloca(sizeof(char*)*cli.trayIconCount);
+ char **pTrayProtos = (char**)_alloca(sizeof(char*)*g_CLI.trayIconCount);
int nTrayProtoCnt = 0;
- for (int i = 0; i < cli.trayIconCount; i++)
- if (cli.trayIcon[i].id != 0 && cli.trayIcon[i].szProto)
- pTrayProtos[nTrayProtoCnt++] = cli.trayIcon[i].szProto;
+ for (int i = 0; i < g_CLI.trayIconCount; i++)
+ if (g_CLI.trayIcon[i].id != 0 && g_CLI.trayIcon[i].szProto)
+ pTrayProtos[nTrayProtoCnt++] = g_CLI.trayIcon[i].szProto;
for (int i = 0; i < g_cliEvents.getCount(); i++) {
char *iEventProto = GetEventProtocol(i);
@@ -147,7 +147,7 @@ static VOID CALLBACK IconFlashTimer(HWND, UINT, UINT_PTR idEvent, DWORD) // decrease eflashes in any case - no need to collect all events
if (e.flags & CLEF_ONLYAFEW)
if (0 >= --e.flashesDone)
- cli.pfnRemoveEvent(e.hContact, e.hDbEvent);
+ g_CLI.pfnRemoveEvent(e.hContact, e.hDbEvent);
}
if (g_cliEvents.getCount() == 0) {
@@ -269,7 +269,7 @@ int EventsProcessContactDoubleClick(MCONTACT hContact) if (it->hContact == hContact) {
MEVENT hDbEvent = it->hDbEvent;
CallService(it->pszService, 0, (LPARAM)it);
- cli.pfnRemoveEvent(hContact, hDbEvent);
+ g_CLI.pfnRemoveEvent(hContact, hDbEvent);
return 0;
}
}
@@ -286,11 +286,11 @@ MIR_APP_DLL(int) Clist_EventsProcessTrayDoubleClick(int index) CListEvent *pEvent = nullptr;
{
mir_cslock lck(trayLockCS);
- if (cli.trayIconCount > 1 && index > 0) {
+ if (g_CLI.trayIconCount > 1 && index > 0) {
char *szProto = nullptr;
- for (int i = 0; i < cli.trayIconCount; i++) {
- if (cli.trayIcon[i].id == index) {
- szProto = cli.trayIcon[i].szProto;
+ for (int i = 0; i < g_CLI.trayIconCount; i++) {
+ if (g_CLI.trayIcon[i].id == index) {
+ szProto = g_CLI.trayIcon[i].szProto;
if (i == 0)
click_in_first_icon = TRUE;
break;
@@ -323,11 +323,11 @@ MIR_APP_DLL(int) Clist_EventsProcessTrayDoubleClick(int index) continue;
int j;
- for (j = 0; j < cli.trayIconCount; j++)
- if (cli.trayIcon[j].szProto && !_strcmpi(eventProto, cli.trayIcon[j].szProto))
+ for (j = 0; j < g_CLI.trayIconCount; j++)
+ if (g_CLI.trayIcon[j].szProto && !_strcmpi(eventProto, g_CLI.trayIcon[j].szProto))
break;
- if (j == cli.trayIconCount) {
+ if (j == g_CLI.trayIconCount) {
pEvent = it;
break;
}
@@ -348,7 +348,7 @@ MIR_APP_DLL(int) Clist_EventsProcessTrayDoubleClick(int index) MCONTACT hContact = pEvent->hContact;
MEVENT hDbEvent = pEvent->hDbEvent;
CallService(pEvent->pszService, 0, (LPARAM)pEvent);
- cli.pfnRemoveEvent(hContact, hDbEvent);
+ g_CLI.pfnRemoveEvent(hContact, hDbEvent);
return 0;
}
@@ -368,7 +368,7 @@ static int CListEventSettingsChanged(WPARAM hContact, LPARAM lParam) int InitCListEvents(void)
{
- cli.events = &g_cliEvents;
+ g_CLI.events = &g_cliEvents;
disableTrayFlash = db_get_b(0, "CList", "DisableTrayFlash", 0);
disableIconFlash = db_get_b(0, "CList", "NoIconBlink", 0);
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index 1474f15630..df58d3d70f 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -186,7 +186,7 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup) if (db_get_b(0, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT)) {
wchar_t szQuestion[256 + 100];
mir_snwprintf(szQuestion, TranslateT("Are you sure you want to delete group '%s'? This operation cannot be undone."), pGroup->groupName+1);
- if (MessageBox(cli.hwndContactList, szQuestion, TranslateT("Delete group"), MB_YESNO | MB_ICONQUESTION) == IDNO)
+ if (MessageBox(g_CLI.hwndContactList, szQuestion, TranslateT("Delete group"), MB_YESNO | MB_ICONQUESTION) == IDNO)
return 1;
}
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index f7e1cd7c0e..c93e0a4ae1 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -103,7 +103,7 @@ MIR_APP_DLL(wchar_t*) Clist_GetStatusModeDescription(int mode, int flags) HICON fnGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status)
{
- return ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(szProto, status, hContact), ILD_NORMAL);
+ return ImageList_GetIcon(hCListImages, g_CLI.pfnIconFromStatusMode(szProto, status, hContact), ILD_NORMAL);
}
int fnIconFromStatusMode(const char *szProto, int status, MCONTACT)
@@ -128,7 +128,7 @@ int fnIconFromStatusMode(const char *szProto, int status, MCONTACT) MIR_APP_DLL(int) Clist_GetContactIcon(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
- return cli.pfnIconFromStatusMode(szProto,
+ return g_CLI.pfnIconFromStatusMode(szProto,
szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact);
}
@@ -181,7 +181,7 @@ static int ContactListAccountsChanged(WPARAM eventCode, LPARAM lParam) Menu_ReloadProtoMenus();
Clist_TrayIconIconsChanged();
- cli.bAutoRebuild = true;
+ g_CLI.bAutoRebuild = true;
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
Clist_Broadcast(INTM_INVALIDATE, 0, 0);
return 0;
@@ -229,7 +229,7 @@ static int CListIconsChanged(WPARAM, LPARAM) }
Clist_TrayIconIconsChanged();
- cli.pfnInvalidateRect(cli.hwndContactList, nullptr, TRUE);
+ g_CLI.pfnInvalidateRect(g_CLI.hwndContactList, nullptr, TRUE);
return 0;
}
@@ -309,7 +309,7 @@ int fnShowHide() {
BOOL bShow = FALSE;
- int iVisibleState = cli.pfnGetWindowVisibleState(cli.hwndContactList, 0, 0);
+ int iVisibleState = g_CLI.pfnGetWindowVisibleState(g_CLI.hwndContactList, 0, 0);
//bShow is FALSE when we enter the switch.
switch (iVisibleState) {
@@ -324,34 +324,34 @@ int fnShowHide() case GWVS_VISIBLE: //This is not needed, but goes for readability.
bShow = FALSE;
break;
- case -1: //We can't get here, both cli.hwndContactList and iStepX and iStepY are right.
+ case -1: //We can't get here, both g_CLI.hwndContactList and iStepX and iStepY are right.
return 0;
}
if (bShow == TRUE) {
- ShowWindow(cli.hwndContactList, SW_RESTORE);
+ ShowWindow(g_CLI.hwndContactList, SW_RESTORE);
if (!db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
- SetWindowPos(cli.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
else
- SetWindowPos(cli.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ SetWindowPos(g_CLI.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- SetForegroundWindow(cli.hwndContactList);
+ SetForegroundWindow(g_CLI.hwndContactList);
db_set_b(0, "CList", "State", SETTING_STATE_NORMAL);
// this forces the window onto the visible screen
RECT rcWindow;
- GetWindowRect(cli.hwndContactList, &rcWindow);
+ GetWindowRect(g_CLI.hwndContactList, &rcWindow);
if (Utils_AssertInsideScreen(&rcWindow) == 1)
- MoveWindow(cli.hwndContactList, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE);
+ MoveWindow(g_CLI.hwndContactList, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE);
}
else { // It needs to be hidden
if (db_get_b(0, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ||
db_get_b(0, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
- ShowWindow(cli.hwndContactList, SW_HIDE);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
db_set_b(0, "CList", "State", SETTING_STATE_HIDDEN);
}
else {
- ShowWindow(cli.hwndContactList, SW_MINIMIZE);
+ ShowWindow(g_CLI.hwndContactList, SW_MINIMIZE);
db_set_b(0, "CList", "State", SETTING_STATE_MINIMIZED);
}
@@ -372,11 +372,11 @@ MIR_APP_DLL(void) Clist_ChangeContactIcon(MCONTACT hContact, int iIcon) MIR_APP_DLL(int) Clist_ContactCompare(MCONTACT hContact1, MCONTACT hContact2)
{
- ClcData *dat = (ClcData*)GetWindowLongPtr(cli.hwndContactTree, 0);
+ ClcData *dat = (ClcData*)GetWindowLongPtr(g_CLI.hwndContactTree, 0);
if (dat != nullptr) {
ClcContact *p1, *p2;
- if (Clist_FindItem(cli.hwndContactTree, dat, hContact1, &p1, nullptr, nullptr) && Clist_FindItem(cli.hwndContactTree, dat, hContact2, &p2, nullptr, nullptr))
- return cli.pfnCompareContacts(p1, p2);
+ if (Clist_FindItem(g_CLI.hwndContactTree, dat, hContact1, &p1, nullptr, nullptr) && Clist_FindItem(g_CLI.hwndContactTree, dat, hContact2, &p2, nullptr, nullptr))
+ return g_CLI.pfnCompareContacts(p1, p2);
}
return 0;
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index 0bc6ea0435..3cf2daa8a5 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -30,7 +30,7 @@ static LIST<ClcCacheEntry> clistCache(50, NumericKeySortT); void FreeDisplayNameCache(void)
{
for (auto &it : clistCache) {
- cli.pfnFreeCacheItem(it);
+ g_CLI.pfnFreeCacheItem(it);
mir_free(it);
}
@@ -87,16 +87,16 @@ MIR_APP_DLL(ClcCacheEntry*) Clist_GetCacheEntry(MCONTACT hContact) ClcCacheEntry *p;
int idx = clistCache.getIndex((ClcCacheEntry*)&hContact);
if (idx == -1) {
- p = cli.pfnCreateCacheItem(hContact);
+ p = g_CLI.pfnCreateCacheItem(hContact);
if (p == nullptr)
return nullptr;
clistCache.insert(p);
- cli.pfnInvalidateDisplayNameCacheEntry(hContact);
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(hContact);
}
else p = clistCache[idx];
- cli.pfnCheckCacheItem(p);
+ g_CLI.pfnCheckCacheItem(p);
return p;
}
@@ -104,12 +104,12 @@ void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact) {
if (hContact == INVALID_CONTACT_ID) {
FreeDisplayNameCache();
- Clist_InitAutoRebuild(cli.hwndContactTree);
+ Clist_InitAutoRebuild(g_CLI.hwndContactTree);
}
else {
int idx = clistCache.getIndex((ClcCacheEntry*)&hContact);
if (idx != -1)
- cli.pfnFreeCacheItem(clistCache[idx]);
+ g_CLI.pfnFreeCacheItem(clistCache[idx]);
}
}
@@ -142,7 +142,7 @@ MIR_APP_DLL(wchar_t*) Clist_GetContactDisplayName(MCONTACT hContact, int mode) int ContactAdded(WPARAM hContact, LPARAM)
{
- Clist_ChangeContactIcon(hContact, cli.pfnIconFromStatusMode(GetContactProto(hContact), ID_STATUS_OFFLINE, 0));
+ Clist_ChangeContactIcon(hContact, g_CLI.pfnIconFromStatusMode(GetContactProto(hContact), ID_STATUS_OFFLINE, 0));
return 0;
}
@@ -152,7 +152,7 @@ int ContactDeleted(WPARAM hContact, LPARAM) int idx = clistCache.getIndex((ClcCacheEntry*)&hContact);
if (idx != -1) {
- cli.pfnFreeCacheItem(clistCache[idx]);
+ g_CLI.pfnFreeCacheItem(clistCache[idx]);
mir_free(clistCache[idx]);
clistCache.remove(idx);
}
@@ -160,7 +160,7 @@ int ContactDeleted(WPARAM hContact, LPARAM) // remove events for a contact
for (auto &it : g_cliEvents.rev_iter())
if (it->hContact == hContact)
- cli.pfnRemoveEvent(hContact, it->hDbEvent);
+ g_CLI.pfnRemoveEvent(hContact, it->hDbEvent);
return 0;
}
@@ -203,22 +203,22 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (!strcmp(cws->szSetting, "UIN") || !strcmp(cws->szSetting, "Nick") || !strcmp(cws->szSetting, "FirstName") || !strcmp(cws->szSetting, "LastName") || !strcmp(cws->szSetting, "e-mail")) {
ClcCacheEntry *pdnce = Clist_GetCacheEntry(hContact);
replaceStrW(pdnce->tszName, nullptr);
- cli.pfnCheckCacheItem(pdnce);
+ g_CLI.pfnCheckCacheItem(pdnce);
}
else if (!strcmp(cws->szSetting, "Status")) {
if (!db_get_b(hContact, "CList", "Hidden", 0))
- Clist_ChangeContactIcon(hContact, cli.pfnIconFromStatusMode(cws->szModule, cws->value.wVal, hContact));
+ Clist_ChangeContactIcon(hContact, g_CLI.pfnIconFromStatusMode(cws->szModule, cws->value.wVal, hContact));
}
}
else if (!strcmp(cws->szModule, "CList")) {
if (!strcmp(cws->szSetting, "Hidden")) {
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0)
- Clist_ChangeContactIcon(hContact, cli.pfnIconFromStatusMode(szProto, szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact));
+ Clist_ChangeContactIcon(hContact, g_CLI.pfnIconFromStatusMode(szProto, szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact));
}
else if (!strcmp(cws->szSetting, "MyHandle")) {
ClcCacheEntry *pdnce = Clist_GetCacheEntry(hContact);
replaceStrW(pdnce->tszName, nullptr);
- cli.pfnCheckCacheItem(pdnce);
+ g_CLI.pfnCheckCacheItem(pdnce);
}
else if (!strcmp(cws->szSetting, "Group")) {
ClcCacheEntry *pdnce = Clist_GetCacheEntry(hContact);
@@ -232,7 +232,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) else
szProto = cws->value.pszVal;
Clist_ChangeContactIcon(hContact,
- cli.pfnIconFromStatusMode(szProto, szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact));
+ g_CLI.pfnIconFromStatusMode(szProto, szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact));
}
}
return 0;
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index 95a48da22d..72764cd553 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -61,7 +61,7 @@ static HICON lastTaskBarIcon; static void SetTaskBarIcon(const HICON hIcon, const wchar_t *szNewTip)
{
if (pTaskbarInterface) {
- pTaskbarInterface->SetOverlayIcon(cli.hwndContactList, hIcon, szNewTip);
+ pTaskbarInterface->SetOverlayIcon(g_CLI.hwndContactList, hIcon, szNewTip);
lastTaskBarIcon = hIcon;
}
}
@@ -84,8 +84,8 @@ MIR_APP_DLL(wchar_t*) Clist_TrayIconMakeTooltip(const wchar_t *szPrefix, const c if (szPrefix && szPrefix[0]) {
if (!db_get_b(0, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
- wcsncpy_s(cli.szTip, MAX_TIP_SIZE, szPrefix, _TRUNCATE);
- return cli.szTip;
+ wcsncpy_s(g_CLI.szTip, MAX_TIP_SIZE, szPrefix, _TRUNCATE);
+ return g_CLI.szTip;
}
tszTip.Append(szPrefix);
}
@@ -118,7 +118,7 @@ MIR_APP_DLL(wchar_t*) Clist_TrayIconMakeTooltip(const wchar_t *szPrefix, const c else tszTip.AppendFormat(L"%s %s", pa->tszAccountName, szStatus);
}
- wcsncpy_s(cli.szTip, MAX_TIP_SIZE, tszTip, _TRUNCATE);
+ wcsncpy_s(g_CLI.szTip, MAX_TIP_SIZE, tszTip, _TRUNCATE);
}
else {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
@@ -129,27 +129,27 @@ MIR_APP_DLL(wchar_t*) Clist_TrayIconMakeTooltip(const wchar_t *szPrefix, const c if (db_get_b(0, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
if (hasTips()) {
if (ProtoXStatus != nullptr)
- mir_snwprintf(cli.szTip, MAX_TIP_SIZE, L"%s%s<b>%-12.12s</b>\t%s%s%-24.24s", szPrefix, szSeparator, pa->tszAccountName, szStatus, szSeparator, ProtoXStatus);
+ mir_snwprintf(g_CLI.szTip, MAX_TIP_SIZE, L"%s%s<b>%-12.12s</b>\t%s%s%-24.24s", szPrefix, szSeparator, pa->tszAccountName, szStatus, szSeparator, ProtoXStatus);
else
- mir_snwprintf(cli.szTip, MAX_TIP_SIZE, L"%s%s<b>%-12.12s</b>\t%s", szPrefix, szSeparator, pa->tszAccountName, szStatus);
+ mir_snwprintf(g_CLI.szTip, MAX_TIP_SIZE, L"%s%s<b>%-12.12s</b>\t%s", szPrefix, szSeparator, pa->tszAccountName, szStatus);
}
- else mir_snwprintf(cli.szTip, MAX_TIP_SIZE, L"%s%s%s %s", szPrefix, szSeparator, pa->tszAccountName, szStatus);
+ else mir_snwprintf(g_CLI.szTip, MAX_TIP_SIZE, L"%s%s%s %s", szPrefix, szSeparator, pa->tszAccountName, szStatus);
}
- else mir_wstrncpy(cli.szTip, szPrefix, MAX_TIP_SIZE);
+ else mir_wstrncpy(g_CLI.szTip, szPrefix, MAX_TIP_SIZE);
}
else {
if (hasTips()) {
if (ProtoXStatus != nullptr)
- mir_snwprintf(cli.szTip, MAX_TIP_SIZE, L"<b>%-12.12s</b>\t%s\n%-24.24s", pa->tszAccountName, szStatus, ProtoXStatus);
+ mir_snwprintf(g_CLI.szTip, MAX_TIP_SIZE, L"<b>%-12.12s</b>\t%s\n%-24.24s", pa->tszAccountName, szStatus, ProtoXStatus);
else
- mir_snwprintf(cli.szTip, MAX_TIP_SIZE, L"<b>%-12.12s</b>\t%s", pa->tszAccountName, szStatus);
+ mir_snwprintf(g_CLI.szTip, MAX_TIP_SIZE, L"<b>%-12.12s</b>\t%s", pa->tszAccountName, szStatus);
}
- else mir_snwprintf(cli.szTip, MAX_TIP_SIZE, L"%s %s", pa->tszAccountName, szStatus);
+ else mir_snwprintf(g_CLI.szTip, MAX_TIP_SIZE, L"%s %s", pa->tszAccountName, szStatus);
}
}
}
- return cli.szTip;
+ return g_CLI.szTip;
}
MIR_APP_DLL(int) Clist_TrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int status)
@@ -158,14 +158,14 @@ MIR_APP_DLL(int) Clist_TrayIconAdd(HWND hwnd, const char *szProto, const char *s mir_cslock lck(trayLockCS);
int i;
- for (i = 0; i < cli.trayIconCount; i++)
- if (cli.trayIcon[i].id == 0)
+ for (i = 0; i < g_CLI.trayIconCount; i++)
+ if (g_CLI.trayIcon[i].id == 0)
break;
- trayIconInfo_t &p = cli.trayIcon[i];
+ trayIconInfo_t &p = g_CLI.trayIcon[i];
p.id = TRAYICON_ID_BASE + i;
p.szProto = (char*)szProto;
- p.hBaseIcon = cli.pfnGetIconFromStatusMode(0, szIconProto ? szIconProto : p.szProto, status);
+ p.hBaseIcon = g_CLI.pfnGetIconFromStatusMode(0, szIconProto ? szIconProto : p.szProto, status);
NOTIFYICONDATA nid = { NOTIFYICONDATA_V2_SIZE };
nid.hWnd = hwnd;
@@ -176,14 +176,14 @@ MIR_APP_DLL(int) Clist_TrayIconAdd(HWND hwnd, const char *szProto, const char *s Clist_TrayIconMakeTooltip(nullptr, p.szProto);
if (!hasTips())
- mir_wstrncpy(nid.szTip, cli.szTip, _countof(nid.szTip));
- replaceStrW(p.ptszToolTip, cli.szTip);
+ mir_wstrncpy(nid.szTip, g_CLI.szTip, _countof(nid.szTip));
+ replaceStrW(p.ptszToolTip, g_CLI.szTip);
Shell_NotifyIcon(NIM_ADD, &nid);
p.isBase = 1;
- if (cli.trayIconCount == 1)
- SetTaskBarIcon(cli.trayIcon[0].hBaseIcon, cli.szTip);
+ if (g_CLI.trayIconCount == 1)
+ SetTaskBarIcon(g_CLI.trayIcon[0].hBaseIcon, g_CLI.szTip);
return i;
}
@@ -192,8 +192,8 @@ MIR_APP_DLL(void) Clist_TrayIconRemove(HWND hwnd, const char *szProto) initcheck;
mir_cslock lck(trayLockCS);
- for (int i = 0; i < cli.trayIconCount; i++) {
- trayIconInfo_t *pii = &cli.trayIcon[i];
+ for (int i = 0; i < g_CLI.trayIconCount; i++) {
+ trayIconInfo_t *pii = &g_CLI.trayIcon[i];
if (pii->id != 0 && !mir_strcmp(szProto, pii->szProto)) {
NOTIFYICONDATA nid = { NOTIFYICONDATA_V2_SIZE };
nid.hWnd = hwnd;
@@ -207,7 +207,7 @@ MIR_APP_DLL(void) Clist_TrayIconRemove(HWND hwnd, const char *szProto) }
}
- if (cli.trayIconCount == 1)
+ if (g_CLI.trayIconCount == 1)
SetTaskBarIcon(nullptr, nullptr);
}
@@ -225,10 +225,10 @@ int fnTrayIconInit(HWND hwnd) CycleTimerId = 0;
}
- cli.trayIconCount = 1;
+ g_CLI.trayIconCount = 1;
if (netProtoCount) {
- cli.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * accounts.getCount());
+ g_CLI.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * accounts.getCount());
int trayIconSetting = db_get_b(0, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
if (trayIconSetting == SETTING_TRAYICON_SINGLE) {
@@ -243,7 +243,7 @@ int fnTrayIconInit(HWND hwnd) db_free(&dbv);
}
else if (trayIconSetting == SETTING_TRAYICON_MULTI && (averageMode < 0 || db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))) {
- cli.trayIconCount = netProtoCount;
+ g_CLI.trayIconCount = netProtoCount;
for (int i = 0; i < accounts.getCount(); i++) {
int j = Clist_GetAccountIndex(i);
if (j >= 0) {
@@ -261,7 +261,7 @@ int fnTrayIconInit(HWND hwnd) }
}
else {
- cli.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t));
+ g_CLI.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t));
Clist_TrayIconAdd(hwnd, nullptr, nullptr, CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
}
@@ -273,22 +273,22 @@ MIR_APP_DLL(int) Clist_TrayIconDestroy(HWND hwnd) initcheck 0;
mir_cslock lck(trayLockCS);
- if (cli.trayIconCount == 1)
+ if (g_CLI.trayIconCount == 1)
SetTaskBarIcon(nullptr, nullptr);
NOTIFYICONDATA nid = { NOTIFYICONDATA_V2_SIZE };
nid.hWnd = hwnd;
- for (int i = 0; i < cli.trayIconCount; i++) {
- if (cli.trayIcon[i].id == 0)
+ for (int i = 0; i < g_CLI.trayIconCount; i++) {
+ if (g_CLI.trayIcon[i].id == 0)
continue;
- nid.uID = cli.trayIcon[i].id;
+ nid.uID = g_CLI.trayIcon[i].id;
Shell_NotifyIcon(NIM_DELETE, &nid);
- DestroyIcon(cli.trayIcon[i].hBaseIcon);
- mir_free(cli.trayIcon[i].ptszToolTip);
+ DestroyIcon(g_CLI.trayIcon[i].hBaseIcon);
+ mir_free(g_CLI.trayIcon[i].ptszToolTip);
}
- mir_free(cli.trayIcon);
- cli.trayIcon = nullptr;
- cli.trayIconCount = 0;
+ mir_free(g_CLI.trayIcon);
+ g_CLI.trayIcon = nullptr;
+ g_CLI.trayIconCount = 0;
return 0;
}
@@ -297,7 +297,7 @@ void TrayIconTaskbarCreated(HWND hwnd) {
initcheck;
Clist_TrayIconDestroy(hwnd);
- cli.pfnTrayIconInit(hwnd);
+ g_CLI.pfnTrayIconInit(hwnd);
}
static VOID CALLBACK RefreshTimerProc(HWND, UINT, UINT_PTR, DWORD)
@@ -317,52 +317,52 @@ int TrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPrefer mir_cslock lck(trayLockCS);
NOTIFYICONDATA nid = { NOTIFYICONDATA_V2_SIZE };
- nid.hWnd = cli.hwndContactList;
+ nid.hWnd = g_CLI.hwndContactList;
nid.uFlags = NIF_ICON | NIF_TIP;
nid.hIcon = hNewIcon;
if (!hNewIcon)
return -1;
- for (int i = 0; i < cli.trayIconCount; i++) {
- if (cli.trayIcon[i].id == 0)
+ for (int i = 0; i < g_CLI.trayIconCount; i++) {
+ if (g_CLI.trayIcon[i].id == 0)
continue;
- if (mir_strcmp(cli.trayIcon[i].szProto, szPreferredProto))
+ if (mir_strcmp(g_CLI.trayIcon[i].szProto, szPreferredProto))
continue;
- nid.uID = cli.trayIcon[i].id;
- Clist_TrayIconMakeTooltip(szNewTip, cli.trayIcon[i].szProto);
- replaceStrW(cli.trayIcon[i].ptszToolTip, cli.szTip);
+ nid.uID = g_CLI.trayIcon[i].id;
+ Clist_TrayIconMakeTooltip(szNewTip, g_CLI.trayIcon[i].szProto);
+ replaceStrW(g_CLI.trayIcon[i].ptszToolTip, g_CLI.szTip);
if (!hasTips())
- mir_wstrncpy(nid.szTip, cli.szTip, _countof(nid.szTip));
+ mir_wstrncpy(nid.szTip, g_CLI.szTip, _countof(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
- if (cli.trayIconCount == 1)
- SetTaskBarIcon(hNewIcon, cli.szTip);
+ if (g_CLI.trayIconCount == 1)
+ SetTaskBarIcon(hNewIcon, g_CLI.szTip);
else
SetTaskBarIcon(nullptr, nullptr);
- cli.trayIcon[i].isBase = isBase;
+ g_CLI.trayIcon[i].isBase = isBase;
return i;
}
// if there wasn't a suitable icon, change all the icons
- for (int i = 0; i < cli.trayIconCount; i++) {
- if (cli.trayIcon[i].id == 0)
+ for (int i = 0; i < g_CLI.trayIconCount; i++) {
+ if (g_CLI.trayIcon[i].id == 0)
continue;
- nid.uID = cli.trayIcon[i].id;
+ nid.uID = g_CLI.trayIcon[i].id;
- Clist_TrayIconMakeTooltip(szNewTip, cli.trayIcon[i].szProto);
- replaceStrW(cli.trayIcon[i].ptszToolTip, cli.szTip);
+ Clist_TrayIconMakeTooltip(szNewTip, g_CLI.trayIcon[i].szProto);
+ replaceStrW(g_CLI.trayIcon[i].ptszToolTip, g_CLI.szTip);
if (!hasTips())
- mir_wstrncpy(nid.szTip, cli.szTip, _countof(nid.szTip));
+ mir_wstrncpy(nid.szTip, g_CLI.szTip, _countof(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
- if (cli.trayIconCount == 1)
- SetTaskBarIcon(hNewIcon, cli.szTip);
+ if (g_CLI.trayIconCount == 1)
+ SetTaskBarIcon(hNewIcon, g_CLI.szTip);
else
SetTaskBarIcon(nullptr, nullptr);
- cli.trayIcon[i].isBase = isBase;
+ g_CLI.trayIcon[i].isBase = isBase;
if (db_get_b(0, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI) {
DWORD time1 = db_get_w(0, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 200;
DWORD time2 = db_get_w(0, "CList", "IconFlashTime", 550) + 1000;
@@ -391,14 +391,14 @@ MIR_APP_DLL(int) Clist_TrayIconSetBaseInfo(HICON hIcon, const char *szPreferredP mir_cslock lck(trayLockCS);
if (szPreferredProto) {
- for (int i = 0; i < cli.trayIconCount; i++) {
- if (cli.trayIcon[i].id == 0)
+ for (int i = 0; i < g_CLI.trayIconCount; i++) {
+ if (g_CLI.trayIcon[i].id == 0)
continue;
- if (mir_strcmp(cli.trayIcon[i].szProto, szPreferredProto))
+ if (mir_strcmp(g_CLI.trayIcon[i].szProto, szPreferredProto))
continue;
- DestroyIcon(cli.trayIcon[i].hBaseIcon);
- cli.trayIcon[i].hBaseIcon = hIcon;
+ DestroyIcon(g_CLI.trayIcon[i].hBaseIcon);
+ g_CLI.trayIcon[i].hBaseIcon = hIcon;
return i;
}
if ((Clist_GetProtocolVisibility(szPreferredProto)) &&
@@ -409,12 +409,12 @@ MIR_APP_DLL(int) Clist_TrayIconSetBaseInfo(HICON hIcon, const char *szPreferredP }
// if there wasn't a specific icon, there will only be one suitable
- for (int i = 0; i < cli.trayIconCount; i++) {
- if (cli.trayIcon[i].id == 0)
+ for (int i = 0; i < g_CLI.trayIconCount; i++) {
+ if (g_CLI.trayIcon[i].id == 0)
continue;
- DestroyIcon(cli.trayIcon[i].hBaseIcon);
- cli.trayIcon[i].hBaseIcon = hIcon;
+ DestroyIcon(g_CLI.trayIcon[i].hBaseIcon);
+ g_CLI.trayIcon[i].hBaseIcon = hIcon;
return i;
}
@@ -437,16 +437,16 @@ static VOID CALLBACK TrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD) int i;
for (i = accounts.getCount() + 1; --i;) {
- cli.cycleStep = (cli.cycleStep + 1) % accounts.getCount();
- if (accounts[cli.cycleStep]->IsVisible())
+ g_CLI.cycleStep = (g_CLI.cycleStep + 1) % accounts.getCount();
+ if (accounts[g_CLI.cycleStep]->IsVisible())
break;
}
if (i) {
- DestroyIcon(cli.trayIcon[0].hBaseIcon);
- cli.trayIcon[0].hBaseIcon = cli.pfnGetIconFromStatusMode(0, accounts[cli.cycleStep]->szModuleName, accounts[cli.cycleStep]->iRealStatus);
- if (cli.trayIcon[0].isBase)
- TrayIconUpdate(cli.trayIcon[0].hBaseIcon, nullptr, nullptr, 1);
+ DestroyIcon(g_CLI.trayIcon[0].hBaseIcon);
+ g_CLI.trayIcon[0].hBaseIcon = g_CLI.pfnGetIconFromStatusMode(0, accounts[g_CLI.cycleStep]->szModuleName, accounts[g_CLI.cycleStep]->iRealStatus);
+ if (g_CLI.trayIcon[0].isBase)
+ TrayIconUpdate(g_CLI.trayIcon[0].hBaseIcon, nullptr, nullptr, 1);
}
}
@@ -474,53 +474,53 @@ MIR_APP_DLL(void) Clist_TrayIconUpdateBase(const char *szChangedProto) for (auto &it : accounts)
if (!mir_strcmp(szChangedProto, it->szModuleName))
- cli.cycleStep = accounts.indexOf(&it);
+ g_CLI.cycleStep = accounts.indexOf(&it);
- int changed = cli.pfnTrayCalcChanged(szChangedProto, averageMode, netProtoCount);
- if (changed != -1 && cli.trayIcon[changed].isBase)
- TrayIconUpdate(cli.trayIcon[changed].hBaseIcon, nullptr, cli.trayIcon[changed].szProto, 1);
+ int changed = g_CLI.pfnTrayCalcChanged(szChangedProto, averageMode, netProtoCount);
+ if (changed != -1 && g_CLI.trayIcon[changed].isBase)
+ TrayIconUpdate(g_CLI.trayIcon[changed].hBaseIcon, nullptr, g_CLI.trayIcon[changed].szProto, 1);
}
int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount)
{
if (netProtoCount == 0)
- return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(nullptr, averageMode, 0), ILD_NORMAL), nullptr);
+ return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, g_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 Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
+ return Clist_TrayIconSetBaseInfo(g_CLI.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
if (db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
- return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto)), (char*)szChangedProto);
+ return Clist_TrayIconSetBaseInfo(g_CLI.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto)), (char*)szChangedProto);
- if (cli.trayIcon == nullptr || cli.trayIcon[0].szProto == nullptr)
- return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
+ if (g_CLI.trayIcon == nullptr || g_CLI.trayIcon[0].szProto == nullptr)
+ return Clist_TrayIconSetBaseInfo(g_CLI.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
- Clist_TrayIconDestroy(cli.hwndContactList);
- cli.pfnTrayIconInit(cli.hwndContactList);
+ Clist_TrayIconDestroy(g_CLI.hwndContactList);
+ g_CLI.pfnTrayIconInit(g_CLI.hwndContactList);
}
else {
switch (trayIconSetting) {
case SETTING_TRAYICON_CYCLE:
Clist_TraySetTimer();
- return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(szChangedProto, Proto_GetStatus(szChangedProto), 0), ILD_NORMAL), nullptr);
+ return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, g_CLI.pfnIconFromStatusMode(szChangedProto, Proto_GetStatus(szChangedProto), 0), ILD_NORMAL), nullptr);
case SETTING_TRAYICON_MULTI:
- if (!cli.trayIcon)
+ if (!g_CLI.trayIcon)
Clist_TrayIconRemove(nullptr, nullptr);
- else if ((cli.trayIconCount > 1 || netProtoCount == 1) || db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
- return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto)), (char*)szChangedProto);
+ else if ((g_CLI.trayIconCount > 1 || netProtoCount == 1) || db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
+ return Clist_TrayIconSetBaseInfo(g_CLI.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto)), (char*)szChangedProto);
else {
- Clist_TrayIconDestroy(cli.hwndContactList);
- cli.pfnTrayIconInit(cli.hwndContactList);
+ Clist_TrayIconDestroy(g_CLI.hwndContactList);
+ g_CLI.pfnTrayIconInit(g_CLI.hwndContactList);
}
break;
case SETTING_TRAYICON_SINGLE:
ptrA szProto(db_get_sa(0, "CList", "PrimaryStatus"));
- return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szProto, szProto ? Proto_GetStatus(szProto) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto);
+ return Clist_TrayIconSetBaseInfo(g_CLI.pfnGetIconFromStatusMode(0, szProto, szProto ? Proto_GetStatus(szProto) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto);
}
}
@@ -533,20 +533,20 @@ void TrayIconSetToBase(char *szPreferredProto) initcheck;
mir_cslock lck(trayLockCS);
- for (i = 0; i < cli.trayIconCount; i++) {
- if (cli.trayIcon[i].id == 0)
+ for (i = 0; i < g_CLI.trayIconCount; i++) {
+ if (g_CLI.trayIcon[i].id == 0)
continue;
- if (mir_strcmp(cli.trayIcon[i].szProto, szPreferredProto))
+ if (mir_strcmp(g_CLI.trayIcon[i].szProto, szPreferredProto))
continue;
- TrayIconUpdate(cli.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
+ TrayIconUpdate(g_CLI.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
return;
}
// if there wasn't a specific icon, there will only be one suitable
- for (i = 0; i < cli.trayIconCount; i++) {
- if (cli.trayIcon[i].id == 0)
+ for (i = 0; i < g_CLI.trayIconCount; i++) {
+ if (g_CLI.trayIcon[i].id == 0)
continue;
- TrayIconUpdate(cli.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
+ TrayIconUpdate(g_CLI.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
return;
}
}
@@ -556,8 +556,8 @@ MIR_APP_DLL(void) Clist_TrayIconIconsChanged() initcheck;
mir_cslock lck(trayLockCS);
- Clist_TrayIconDestroy(cli.hwndContactList);
- cli.pfnTrayIconInit(cli.hwndContactList);
+ Clist_TrayIconDestroy(g_CLI.hwndContactList);
+ g_CLI.pfnTrayIconInit(g_CLI.hwndContactList);
}
static UINT_PTR autoHideTimerId;
@@ -567,7 +567,7 @@ static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd, UINT, UINT_PTR idEvent, DW mir_cslock lck(trayLockCS);
KillTimer(hwnd, idEvent);
- HWND hwndClui = cli.hwndContactList;
+ HWND hwndClui = g_CLI.hwndContactList;
if (GetActiveWindow() != hwndClui) {
ShowWindow(hwndClui, SW_HIDE);
SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
@@ -580,7 +580,7 @@ int fnTrayIconPauseAutoHide(WPARAM, LPARAM) mir_cslock lck(trayLockCS);
if (db_get_b(0, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
- if (GetActiveWindow() != cli.hwndContactList) {
+ if (GetActiveWindow() != g_CLI.hwndContactList) {
KillTimer(nullptr, autoHideTimerId);
autoHideTimerId = SetTimer(nullptr, 0, 1000 * db_get_w(0, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
}
@@ -611,27 +611,27 @@ static void CALLBACK TrayHideToolTipTimerProc(HWND hwnd, UINT, UINT_PTR, DWORD) static void CALLBACK TrayToolTipTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD)
{
- if (!g_trayTooltipActive && !cli.bTrayMenuOnScreen) {
+ if (!g_trayTooltipActive && !g_CLI.bTrayMenuOnScreen) {
POINT pt;
GetCursorPos(&pt);
if (abs(pt.x - tray_hover_pos.x) <= TOOLTIP_TOLERANCE && abs(pt.y - tray_hover_pos.y) <= TOOLTIP_TOLERANCE) {
- wchar_t* szTipCur = cli.szTip;
+ wchar_t* szTipCur = g_CLI.szTip;
{
int n = s_LastHoverIconID - 100;
- if (n >= 0 && n < cli.trayIconCount)
- szTipCur = cli.trayIcon[n].ptszToolTip;
+ if (n >= 0 && n < g_CLI.trayIconCount)
+ szTipCur = g_CLI.trayIcon[n].ptszToolTip;
}
CLCINFOTIP ti = { sizeof(ti) };
ti.rcItem.left = pt.x - 10;
ti.rcItem.right = pt.x + 10;
ti.rcItem.top = pt.y - 10;
ti.rcItem.bottom = pt.y + 10;
- ti.isTreeFocused = GetFocus() == cli.hwndContactList ? 1 : 0;
+ ti.isTreeFocused = GetFocus() == g_CLI.hwndContactList ? 1 : 0;
if (CallService("mToolTip/ShowTipW", (WPARAM)szTipCur, (LPARAM)&ti) == CALLSERVICE_NOTFOUND)
CallService("mToolTip/ShowTip", (WPARAM)(char*)_T2A(szTipCur), (LPARAM)&ti);
GetCursorPos(&tray_hover_pos);
- SetTimer(cli.hwndContactList, TIMERID_TRAYHOVER_2, 600, TrayHideToolTipTimerProc);
+ SetTimer(g_CLI.hwndContactList, TIMERID_TRAYHOVER_2, 600, TrayHideToolTipTimerProc);
g_trayTooltipActive = true;
}
}
@@ -650,7 +650,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) break;
}
case TIM_CREATE:
- cli.pfnTrayIconInit(msg->hwnd);
+ g_CLI.pfnTrayIconInit(msg->hwnd);
break;
case WM_ACTIVATE:
@@ -674,22 +674,22 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) }
if (msg->lParam == WM_MBUTTONUP)
- cli.pfnShowHide();
+ g_CLI.pfnShowHide();
else if (msg->lParam == (db_get_b(0, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? WM_LBUTTONUP : WM_LBUTTONDBLCLK)) {
if ((GetAsyncKeyState(VK_CONTROL) & 0x8000)) {
POINT pt;
HMENU hMenu = Menu_GetStatusMenu();
- for (int i = 0; i < cli.trayIconCount; i++) {
- if ((unsigned)cli.trayIcon[i].id == msg->wParam) {
- if (!cli.trayIcon[i].szProto)
+ for (int i = 0; i < g_CLI.trayIconCount; i++) {
+ if ((unsigned)g_CLI.trayIcon[i].id == msg->wParam) {
+ if (!g_CLI.trayIcon[i].szProto)
break;
int ind = 0;
for (int j = 0; j < accounts.getCount(); j++) {
int k = Clist_GetAccountIndex(j);
if (k >= 0) {
- if (!mir_strcmp(cli.trayIcon[i].szProto, accounts[k]->szModuleName)) {
+ if (!mir_strcmp(g_CLI.trayIcon[i].szProto, accounts[k]->szModuleName)) {
HMENU hm = GetSubMenu(hMenu, ind);
if (hm) hMenu = hm;
break;
@@ -709,7 +709,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, nullptr);
}
else if (Clist_EventsProcessTrayDoubleClick(msg->wParam))
- cli.pfnShowHide();
+ g_CLI.pfnShowHide();
}
else if (msg->lParam == WM_RBUTTONUP) {
HMENU hMenu = Menu_BuildTrayMenu();
@@ -718,7 +718,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) POINT pt;
GetCursorPos(&pt);
- cli.bTrayMenuOnScreen = TRUE;
+ g_CLI.bTrayMenuOnScreen = TRUE;
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, nullptr);
Menu_DestroyNestedMenu(hMenu);
PostMessage(msg->hwnd, WM_NULL, 0, 0);
@@ -736,7 +736,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) }
else {
GetCursorPos(&tray_hover_pos);
- SetTimer(cli.hwndContactList, TIMERID_TRAYHOVER, 600, TrayToolTipTimerProc);
+ SetTimer(g_CLI.hwndContactList, TIMERID_TRAYHOVER, 600, TrayToolTipTimerProc);
}
break;
}
@@ -766,19 +766,19 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) static int sttGetIcon(const char *szProto)
{
if (szProto == nullptr)
- return cli.trayIcon[0].id;
+ return g_CLI.trayIcon[0].id;
UINT iconId = 0;
- for (int j = 0; j < cli.trayIconCount; j++) {
- if (cli.trayIcon[j].szProto != nullptr) {
- if (!mir_strcmp(szProto, cli.trayIcon[j].szProto)) {
- iconId = cli.trayIcon[j].id;
+ for (int j = 0; j < g_CLI.trayIconCount; j++) {
+ if (g_CLI.trayIcon[j].szProto != nullptr) {
+ if (!mir_strcmp(szProto, g_CLI.trayIcon[j].szProto)) {
+ iconId = g_CLI.trayIcon[j].id;
break;
}
}
- else if (cli.trayIcon[j].isBase) {
- iconId = cli.trayIcon[j].id;
+ else if (g_CLI.trayIcon[j].isBase) {
+ iconId = g_CLI.trayIcon[j].id;
break;
}
}
@@ -790,12 +790,12 @@ MIR_APP_DLL(int) Clist_TrayNotifyA(const char *szProto, const char *szInfoTitle, {
if (szInfo == nullptr || szInfoTitle == nullptr)
return 1;
- if (cli.trayIcon == nullptr)
+ if (g_CLI.trayIcon == nullptr)
return 2;
NOTIFYICONDATAA nid = { 0 };
nid.cbSize = NOTIFYICONDATAA_V2_SIZE;
- nid.hWnd = cli.hwndContactList;
+ nid.hWnd = g_CLI.hwndContactList;
nid.uID = sttGetIcon(szProto);
nid.uFlags = NIF_INFO;
strncpy_s(nid.szInfo, szInfo, _TRUNCATE);
@@ -809,12 +809,12 @@ MIR_APP_DLL(int) Clist_TrayNotifyW(const char *szProto, const wchar_t *wszInfoTi {
if (wszInfo == nullptr || wszInfoTitle == nullptr)
return 1;
- if (cli.trayIcon == nullptr)
+ if (g_CLI.trayIcon == nullptr)
return 2;
NOTIFYICONDATAW nid = { 0 };
nid.cbSize = NOTIFYICONDATAW_V2_SIZE;
- nid.hWnd = cli.hwndContactList;
+ nid.hWnd = g_CLI.hwndContactList;
nid.uID = sttGetIcon(szProto);
nid.uFlags = NIF_INFO;
mir_wstrncpy(nid.szInfo, wszInfo, _countof(nid.szInfo));
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index a4145e9395..9c38594de9 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -59,14 +59,14 @@ void fnLoadCluiGlobalOpts() static int CluiModulesLoaded(WPARAM, LPARAM)
{
- if (cli.hMenuMain) {
+ if (g_CLI.hMenuMain) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = Menu_GetMainMenu();
- SetMenuItemInfo(cli.hMenuMain, 0, TRUE, &mii);
+ SetMenuItemInfo(g_CLI.hMenuMain, 0, TRUE, &mii);
mii.hSubMenu = Menu_GetStatusMenu();
- SetMenuItemInfo(cli.hMenuMain, 1, TRUE, &mii);
+ SetMenuItemInfo(g_CLI.hMenuMain, 1, TRUE, &mii);
}
return 0;
}
@@ -81,7 +81,7 @@ static void DisconnectAll() static int CluiIconsChanged(WPARAM, LPARAM)
{
- DrawMenuBar(cli.hwndContactList);
+ DrawMenuBar(g_CLI.hwndContactList);
return 0;
}
@@ -92,7 +92,7 @@ static int MenuItem_PreBuild(WPARAM, LPARAM) wchar_t cls[128];
HWND hwndClist = GetFocus();
GetClassName(hwndClist, cls, _countof(cls));
- hwndClist = (!mir_wstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : cli.hwndContactList;
+ hwndClist = (!mir_wstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : g_CLI.hwndContactList;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
Menu_ShowItem(hRenameMenuItem, hItem != nullptr);
return 0;
@@ -104,7 +104,7 @@ static INT_PTR MenuItem_RenameContact(WPARAM, LPARAM) HWND hwndClist = GetFocus();
GetClassName(hwndClist, cls, _countof(cls));
// worst case scenario, the rename is sent to the main contact list
- hwndClist = (!mir_wstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : cli.hwndContactList;
+ hwndClist = (!mir_wstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : g_CLI.hwndContactList;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
if (hItem) {
SetFocus(hwndClist);
@@ -224,12 +224,12 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l m.message = msg;
m.wParam = wParam;
m.lParam = lParam;
- if (cli.pfnDocking_ProcessWindowMessage((WPARAM)&m, (LPARAM)&result))
+ if (g_CLI.pfnDocking_ProcessWindowMessage((WPARAM)&m, (LPARAM)&result))
return result;
- if (cli.pfnTrayIconProcessMessage((WPARAM)&m, (LPARAM)&result))
+ if (g_CLI.pfnTrayIconProcessMessage((WPARAM)&m, (LPARAM)&result))
return result;
- return cli.pfnContactListWndProc(hwnd, msg, wParam, lParam);
+ return g_CLI.pfnContactListWndProc(hwnd, msg, wParam, lParam);
}
int LoadCLUIModule(void)
@@ -238,7 +238,7 @@ int LoadCLUIModule(void) wchar_t titleText[256];
uMsgProcessProfile = RegisterWindowMessage(L"Miranda::ProcessProfile");
- cli.pfnLoadCluiGlobalOpts();
+ g_CLI.pfnLoadCluiGlobalOpts();
HookEvent(ME_SYSTEM_MODULESLOADED, CluiModulesLoaded);
HookEvent(ME_SKIN_ICONSCHANGED, CluiIconsChanged);
@@ -250,9 +250,9 @@ int LoadCLUIModule(void) WNDCLASSEX wndclass = { 0 };
wndclass.cbSize = sizeof(wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_GLOBALCLASS;
- wndclass.lpfnWndProc = cli.pfnContactListControlWndProc;
+ wndclass.lpfnWndProc = g_CLI.pfnContactListControlWndProc;
wndclass.cbWndExtra = sizeof(void *);
- wndclass.hInstance = cli.hInst;
+ wndclass.hInstance = g_CLI.hInst;
wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.lpszClassName = CLISTCONTROL_CLASSW;
RegisterClassEx(&wndclass);
@@ -261,7 +261,7 @@ int LoadCLUIModule(void) wndclass.cbSize = sizeof(wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW | ((db_get_b(0, "CList", "WindowShadow", 0) == 1) ? CS_DROPSHADOW : 0);
wndclass.lpfnWndProc = ContactListWndProc;
- wndclass.hInstance = cli.hInst;
+ wndclass.hInstance = g_CLI.hInst;
wndclass.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA, true);
wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
@@ -285,7 +285,7 @@ int LoadCLUIModule(void) Utils_AssertInsideScreen(&pos);
- cli.hwndContactList = CreateWindowEx(
+ g_CLI.hwndContactList = CreateWindowEx(
(db_get_b(0, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW),
_T(MIRANDACLASS),
titleText,
@@ -293,27 +293,27 @@ int LoadCLUIModule(void) (db_get_b(0, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? WS_CAPTION | WS_SYSMENU |
(db_get_b(0, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0),
pos.left, pos.top, pos.right - pos.left, pos.bottom - pos.top,
- nullptr, nullptr, cli.hInst, nullptr);
+ nullptr, nullptr, g_CLI.hInst, nullptr);
if (db_get_b(0, "CList", "OnDesktop", 0)) {
HWND hProgMan = FindWindow(L"Progman", nullptr);
if (IsWindow(hProgMan))
- SetParent(cli.hwndContactList, hProgMan);
+ SetParent(g_CLI.hwndContactList, hProgMan);
}
- cli.pfnOnCreateClc();
+ g_CLI.pfnOnCreateClc();
- PostMessage(cli.hwndContactList, M_RESTORESTATUS, 0, 0);
+ PostMessage(g_CLI.hwndContactList, M_RESTORESTATUS, 0, 0);
int state = db_get_b(0, "CList", "State", SETTING_STATE_NORMAL);
- cli.hMenuMain = GetMenu(cli.hwndContactList);
+ g_CLI.hMenuMain = GetMenu(g_CLI.hwndContactList);
if (!db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
- SetMenu(cli.hwndContactList, nullptr);
+ SetMenu(g_CLI.hwndContactList, nullptr);
if (state == SETTING_STATE_NORMAL)
- ShowWindow(cli.hwndContactList, SW_SHOW);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOW);
else if (state == SETTING_STATE_MINIMIZED)
- ShowWindow(cli.hwndContactList, SW_SHOWMINIMIZED);
- SetWindowPos(cli.hwndContactList,
+ ShowWindow(g_CLI.hwndContactList, SW_SHOWMINIMIZED);
+ SetWindowPos(g_CLI.hwndContactList,
db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
@@ -440,9 +440,9 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int flags = WS_CHILD | CCS_BOTTOM;
flags |= cluiopt.showsbar ? WS_VISIBLE : 0;
flags |= cluiopt.showgrip ? SBARS_SIZEGRIP : 0;
- cli.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, cli.hInst, nullptr);
+ g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, g_CLI.hInst, nullptr);
}
- cli.pfnCluiProtocolStatusChanged(0, nullptr);
+ g_CLI.pfnCluiProtocolStatusChanged(0, nullptr);
//delay creation of CLC so that it can get the status icons right the first time (needs protocol modules loaded)
PostMessage(hwnd, M_CREATECLC, 0, 0);
@@ -455,13 +455,13 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return FALSE;
case M_CREATECLC:
- cli.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
+ g_CLI.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
| CLS_CONTACTLIST
| (db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
| (db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
| (db_get_b(0, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? CLS_HIDEEMPTYGROUPS : 0),
- 0, 0, 0, 0, hwnd, nullptr, cli.hInst, nullptr);
+ 0, 0, 0, 0, hwnd, nullptr, g_CLI.hInst, nullptr);
SendMessage(hwnd, WM_SIZE, 0, 0);
break;
@@ -492,10 +492,10 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case WM_SYSCOLORCHANGE:
- SendMessage(cli.hwndContactTree, msg, wParam, lParam);
- SendMessage(cli.hwndStatus, msg, wParam, lParam);
+ SendMessage(g_CLI.hwndContactTree, msg, wParam, lParam);
+ SendMessage(g_CLI.hwndStatus, msg, wParam, lParam);
// XXX: only works with 4.71 with 95, IE4.
- SendMessage(cli.hwndStatus, SB_SETBKCOLOR, 0, GetSysColor(COLOR_3DFACE));
+ SendMessage(g_CLI.hwndStatus, SB_SETBKCOLOR, 0, GetSysColor(COLOR_3DFACE));
break;
case WM_SIZE:
@@ -505,13 +505,13 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM RECT rect, rcStatus;
GetClientRect(hwnd, &rect);
if (cluiopt.showsbar) {
- SetWindowPos(cli.hwndStatus, nullptr, 0, rect.bottom - 20, rect.right - rect.left, 20, SWP_NOZORDER);
- GetWindowRect(cli.hwndStatus, &rcStatus);
- cli.pfnCluiProtocolStatusChanged(0, nullptr);
+ SetWindowPos(g_CLI.hwndStatus, nullptr, 0, rect.bottom - 20, rect.right - rect.left, 20, SWP_NOZORDER);
+ GetWindowRect(g_CLI.hwndStatus, &rcStatus);
+ g_CLI.pfnCluiProtocolStatusChanged(0, nullptr);
}
else
rcStatus.top = rcStatus.bottom = 0;
- SetWindowPos(cli.hwndContactTree, nullptr, 0, 0, rect.right, rect.bottom - (rcStatus.bottom - rcStatus.top), SWP_NOZORDER);
+ SetWindowPos(g_CLI.hwndContactTree, nullptr, 0, 0, rect.right, rect.bottom - (rcStatus.bottom - rcStatus.top), SWP_NOZORDER);
}
if (wParam == SIZE_MINIMIZED) {
if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || db_get_b(0, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
@@ -540,7 +540,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return FALSE;
case WM_SETFOCUS:
- SetFocus(cli.hwndContactTree);
+ SetFocus(g_CLI.hwndContactTree);
return 0;
case WM_ACTIVATE:
@@ -643,7 +643,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (wParam)
SetForegroundWindow(hwnd);
AnimateWindow(hwnd, 200, AW_BLEND | (wParam ? 0 : AW_HIDE));
- SetWindowPos(cli.hwndContactTree, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ SetWindowPos(g_CLI.hwndContactTree, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
}
break;
@@ -691,16 +691,16 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case ID_TRAY_HIDE:
- cli.pfnShowHide();
+ g_CLI.pfnShowHide();
break;
case POPUP_NEWGROUP:
- SendMessage(cli.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
Clist_GroupCreate(0, nullptr);
break;
case POPUP_HIDEOFFLINE:
- cli.pfnSetHideOffline(-1);
+ g_CLI.pfnSetHideOffline(-1);
break;
case POPUP_HIDEOFFLINEROOT:
@@ -716,7 +716,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case POPUP_HIDEMIRANDA:
- cli.pfnShowHide();
+ g_CLI.pfnShowHide();
break;
}
return FALSE;
@@ -742,12 +742,12 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_DISPLAYCHANGE:
DefWindowProc(hwnd, msg, wParam, lParam);
- SendMessage(cli.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
break;
//MSG FROM CHILD CONTROL
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->hwndFrom == cli.hwndContactTree) {
+ if (((LPNMHDR)lParam)->hwndFrom == g_CLI.hwndContactTree) {
NMCLISTCONTROL *nmc = (NMCLISTCONTROL*)lParam;
switch (((LPNMHDR)lParam)->code) {
case CLN_EXPANDED:
@@ -758,7 +758,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM ClientToScreen(hwnd, &nmc->pt);
if (!(nmc->flags & CLNF_ISGROUP))
if (NotifyEventHooks(hContactDraggingEvent, (WPARAM)nmc->hItem, MAKELPARAM(nmc->pt.x, nmc->pt.y))) {
- SetCursor(LoadCursor(cli.hInst, MAKEINTRESOURCE(IDC_DROPUSER)));
+ SetCursor(LoadCursor(g_CLI.hInst, MAKEINTRESOURCE(IDC_DROPUSER)));
return TRUE;
}
break;
@@ -772,7 +772,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM ClientToScreen(hwnd, &nmc->pt);
if (!(nmc->flags & CLNF_ISGROUP))
if (NotifyEventHooks(hContactDroppedEvent, (WPARAM)nmc->hItem, MAKELPARAM(nmc->pt.x, nmc->pt.y))) {
- SetCursor(LoadCursor(cli.hInst, MAKEINTRESOURCE(IDC_DROPUSER)));
+ SetCursor(LoadCursor(g_CLI.hInst, MAKEINTRESOURCE(IDC_DROPUSER)));
return TRUE;
}
break;
@@ -800,7 +800,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
maxHeight = db_get_b(0, "CLUI", "MaxSizeHeight", 75);
GetWindowRect(hwnd, &rcWindow);
- GetWindowRect(cli.hwndContactTree, &rcTree);
+ GetWindowRect(g_CLI.hwndContactTree, &rcTree);
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
HMONITOR hMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
@@ -829,7 +829,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case NM_CLICK:
{
DWORD hitFlags;
- HANDLE hItem = (HANDLE)SendMessage(cli.hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nmc->pt.x, nmc->pt.y));
+ HANDLE hItem = (HANDLE)SendMessage(g_CLI.hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nmc->pt.x, nmc->pt.y));
if (hItem) {
if (hitFlags & CLCHT_ONITEMEXTRA) {
if (!IsHContactGroup((UINT_PTR)hItem) && !IsHContactInfo((UINT_PTR)hItem))
@@ -844,14 +844,14 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
POINT pt = nmc->pt;
- ClientToScreen(cli.hwndContactTree, &pt);
+ ClientToScreen(g_CLI.hwndContactTree, &pt);
return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
}
}
break;
}
}
- else if (((LPNMHDR)lParam)->hwndFrom == cli.hwndStatus) {
+ else if (((LPNMHDR)lParam)->hwndFrom == g_CLI.hwndStatus) {
if (((LPNMHDR)lParam)->code == NM_CLICK) {
unsigned int nParts, nPanel;
NMMOUSE *nm = (NMMOUSE *)lParam;
@@ -860,10 +860,10 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM POINT pt;
hMenu = Menu_GetStatusMenu();
- nParts = SendMessage(cli.hwndStatus, SB_GETPARTS, 0, 0);
+ nParts = SendMessage(g_CLI.hwndStatus, SB_GETPARTS, 0, 0);
if (nm->dwItemSpec == 0xFFFFFFFE) {
nPanel = nParts - 1;
- SendMessage(cli.hwndStatus, SB_GETRECT, nPanel, (LPARAM)& rc);
+ SendMessage(g_CLI.hwndStatus, SB_GETRECT, nPanel, (LPARAM)& rc);
if (nm->pt.x < rc.left)
return FALSE;
}
@@ -880,26 +880,26 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
}
}
- SendMessage(cli.hwndStatus, SB_GETRECT, nPanel, (LPARAM)& rc);
+ SendMessage(g_CLI.hwndStatus, SB_GETRECT, nPanel, (LPARAM)& rc);
pt.x = rc.left;
pt.y = rc.top;
- ClientToScreen(cli.hwndStatus, &pt);
+ ClientToScreen(g_CLI.hwndStatus, &pt);
TrackPopupMenu(hMenu, TPM_BOTTOMALIGN | TPM_LEFTALIGN, pt.x, pt.y, 0, hwnd, nullptr);
}
}
return FALSE;
case WM_MENUSELECT:
- if (lParam && (HMENU)lParam == cli.hMenuMain) {
+ if (lParam && (HMENU)lParam == g_CLI.hMenuMain) {
int pos = LOWORD(wParam);
POINT pt;
GetCursorPos(&pt);
- if ((pos == 0 || pos == 1) && (HIWORD(wParam) & MF_POPUP) && (!(HIWORD(wParam) & MF_MOUSESELECT) || MenuItemFromPoint(hwnd, cli.hMenuMain, pt) != -1)) {
+ if ((pos == 0 || pos == 1) && (HIWORD(wParam) & MF_POPUP) && (!(HIWORD(wParam) & MF_MOUSESELECT) || MenuItemFromPoint(hwnd, g_CLI.hMenuMain, pt) != -1)) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (pos == 0) ? Menu_GetMainMenu() : Menu_GetStatusMenu();
- SetMenuItemInfo(cli.hMenuMain, pos, TRUE, &mii);
+ SetMenuItemInfo(g_CLI.hMenuMain, pos, TRUE, &mii);
}
}
break;
@@ -910,7 +910,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
RECT rc;
- GetWindowRect(cli.hwndContactTree, &rc);
+ GetWindowRect(g_CLI.hwndContactTree, &rc);
if (pt.x == -1 && pt.y == -1) {
// all this is done in screen-coords!
GetCursorPos(&pt);
@@ -926,7 +926,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM Menu_DestroyNestedMenu(hMenu);
return 0;
}
- GetWindowRect(cli.hwndStatus, &rc);
+ GetWindowRect(g_CLI.hwndStatus, &rc);
if (PtInRect(&rc, pt)) {
HMENU hMenu;
if (db_get_b(0, "CLUI", "SBarRightClk", 0))
@@ -950,7 +950,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
- if (dis->hwndItem == cli.hwndStatus) {
+ if (dis->hwndItem == g_CLI.hwndStatus) {
char *szProto = (char *)dis->itemData;
if (szProto == nullptr) return 0;
int status, x;
@@ -1028,19 +1028,19 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM db_set_dw(0, "CList", "Width", (DWORD)(rc.right - rc.left));
}
- RemoveMenu(cli.hMenuMain, 0, MF_BYPOSITION);
- RemoveMenu(cli.hMenuMain, 0, MF_BYPOSITION);
+ RemoveMenu(g_CLI.hMenuMain, 0, MF_BYPOSITION);
+ RemoveMenu(g_CLI.hMenuMain, 0, MF_BYPOSITION);
- if (cli.hwndStatus) {
- DestroyWindow(cli.hwndStatus);
- cli.hwndStatus = nullptr;
+ if (g_CLI.hwndStatus) {
+ DestroyWindow(g_CLI.hwndStatus);
+ g_CLI.hwndStatus = nullptr;
}
// Disconnect all protocols
DisconnectAll();
ShowWindow(hwnd, SW_HIDE);
- DestroyWindow(cli.hwndContactTree);
+ DestroyWindow(g_CLI.hwndContactTree);
FreeLibrary(hUserDll);
PostQuitMessage(0);
diff --git a/src/mir_app/src/cluiservices.cpp b/src/mir_app/src/cluiservices.cpp index 90880c2877..c3fee62555 100644 --- a/src/mir_app/src/cluiservices.cpp +++ b/src/mir_app/src/cluiservices.cpp @@ -41,11 +41,11 @@ EXTERN_C MIR_APP_DLL(void) Clist_GroupAdded(MGROUP hGroup) EXTERN_C MIR_APP_DLL(void) Clist_EndRebuild(void)
{
- if (cli.hwndContactTree == nullptr)
+ if (g_CLI.hwndContactTree == nullptr)
return;
bool bRebuild = false;
- LONG_PTR dwStyle = GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE);
+ LONG_PTR dwStyle = GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE);
// CLC does this automatically, but we need to force it if hideoffline or hideempty has changed
if ((db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) == 0) != ((dwStyle & CLS_HIDEOFFLINE) == 0)) {
@@ -73,8 +73,8 @@ EXTERN_C MIR_APP_DLL(void) Clist_EndRebuild(void) }
if (bRebuild) {
- SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, dwStyle);
- Clist_InitAutoRebuild(cli.hwndContactTree);
+ SetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE, dwStyle);
+ Clist_InitAutoRebuild(g_CLI.hwndContactTree);
}
}
@@ -84,18 +84,18 @@ EXTERN_C MIR_APP_DLL(void) Clist_EndRebuild(void) void fnCluiProtocolStatusChanged(int, const char*)
{
if (g_menuProtos.getCount() == 0) {
- SendMessage(cli.hwndStatus, SB_SETPARTS, 0, 0);
- SendMessage(cli.hwndStatus, SB_SETTEXT, SBT_OWNERDRAW, 0);
+ SendMessage(g_CLI.hwndStatus, SB_SETPARTS, 0, 0);
+ SendMessage(g_CLI.hwndStatus, SB_SETTEXT, SBT_OWNERDRAW, 0);
return;
}
int borders[3];
- SendMessage(cli.hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
+ SendMessage(g_CLI.hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
int *partWidths = (int*)alloca(g_menuProtos.getCount() * sizeof(int));
if (db_get_b(0, "CLUI", "EqualSections", 0)) {
RECT rc;
- GetClientRect(cli.hwndStatus, &rc);
+ GetClientRect(g_CLI.hwndStatus, &rc);
rc.right -= borders[0] * 2 + (db_get_b(0, "CLUI", "ShowGrip", 1) ? GetSystemMetrics(SM_CXVSCROLL) : 0);
for (int i = 0; i < g_menuProtos.getCount(); i++)
partWidths[i] = (i + 1) * rc.right / g_menuProtos.getCount() - (borders[2] >> 1);
@@ -105,7 +105,7 @@ void fnCluiProtocolStatusChanged(int, const char*) BYTE showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
HDC hdc = GetDC(nullptr);
- HFONT hFont = (HFONT)SelectObject(hdc, (HFONT)SendMessage(cli.hwndStatus, WM_GETFONT, 0, 0));
+ HFONT hFont = (HFONT)SelectObject(hdc, (HFONT)SendMessage(g_CLI.hwndStatus, WM_GETFONT, 0, 0));
for (int i = 0; i < g_menuProtos.getCount(); i++) { //count down since built in ones tend to go at the end
int x = 2;
if (showOpts & 1)
@@ -137,13 +137,13 @@ void fnCluiProtocolStatusChanged(int, const char*) }
partWidths[g_menuProtos.getCount()-1] = -1;
- SendMessage(cli.hwndStatus, SB_SETMINHEIGHT, g_IconHeight, 0);
- SendMessage(cli.hwndStatus, SB_SETPARTS, g_menuProtos.getCount(), (LPARAM)partWidths);
+ SendMessage(g_CLI.hwndStatus, SB_SETMINHEIGHT, g_IconHeight, 0);
+ SendMessage(g_CLI.hwndStatus, SB_SETPARTS, g_menuProtos.getCount(), (LPARAM)partWidths);
int flags = SBT_OWNERDRAW;
if (db_get_b(0, "CLUI", "SBarBevel", 1) == 0)
flags |= SBT_NOBORDERS;
for (int i = 0; i < g_menuProtos.getCount(); i++)
- SendMessage(cli.hwndStatus, SB_SETTEXT, i | flags, (LPARAM)g_menuProtos[i].szProto);
+ SendMessage(g_CLI.hwndStatus, SB_SETTEXT, i | flags, (LPARAM)g_menuProtos[i].szProto);
}
diff --git a/src/mir_app/src/contact.cpp b/src/mir_app/src/contact.cpp index fd3049ba58..5e468f5d0f 100644 --- a/src/mir_app/src/contact.cpp +++ b/src/mir_app/src/contact.cpp @@ -41,7 +41,7 @@ MIR_APP_DLL(void) Clist_LoadContactTree(void) for (auto &hContact : Contacts()) { int status = GetContactStatus(hContact); if ((!hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0)) - Clist_ChangeContactIcon(hContact, cli.pfnIconFromStatusMode(GetContactProto(hContact), status, hContact)); + Clist_ChangeContactIcon(hContact, g_CLI.pfnIconFromStatusMode(GetContactProto(hContact), status, hContact)); } Clist_EndRebuild(); } diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index 0bd5ab73c9..1a44938d1e 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -339,7 +339,7 @@ public: tvi.hItem = m_nameOrder.GetNextSibling(tvi.hItem);
}
db_set_blob(0, "Contact", "NameOrder", nameOrder, _countof(nameOrderDescr));
- cli.pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID);
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID);
}
void OnBeginDrag(CCtrlTreeView::TEventInfo *evt)
diff --git a/src/mir_app/src/ei_services.cpp b/src/mir_app/src/ei_services.cpp index fff8bbb1c4..4e96de3489 100644 --- a/src/mir_app/src/ei_services.cpp +++ b/src/mir_app/src/ei_services.cpp @@ -77,18 +77,18 @@ int ExtraImage_ExtraIDToColumnNum(int extra) int Clist_SetExtraIcon(MCONTACT hContact, int slot, HANDLE hImage) { - if (cli.hwndContactTree == nullptr) + if (g_CLI.hwndContactTree == nullptr) return -1; int icol = ExtraImage_ExtraIDToColumnNum(ConvertToClistSlot(slot)); if (icol == -1) return -1; - HANDLE hItem = (HANDLE)SendMessage(cli.hwndContactTree, CLM_FINDCONTACT, hContact, 0); + HANDLE hItem = (HANDLE)SendMessage(g_CLI.hwndContactTree, CLM_FINDCONTACT, hContact, 0); if (hItem == nullptr) return -1; - SendMessage(cli.hwndContactTree, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(icol, hImage)); + SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(icol, hImage)); return 0; } @@ -277,23 +277,23 @@ MIR_APP_DLL(HANDLE) ExtraIcon_AddIcon(HICON hIcon) 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); + SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRASPACE, db_get_b(0, "CLUI", "ExtraColumnSpace", 18), 0); + SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, 0); if (hExtraImageList) ImageList_Destroy(hExtraImageList); hExtraImageList = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 1, 256); - SendMessage(cli.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hExtraImageList); - SendMessage(cli.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0); + SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hExtraImageList); + SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0); NotifyEventHooks(hEventExtraImageListRebuilding, 0, 0); bImageCreated = true; } MIR_APP_DLL(void) ExtraIcon_SetAll(MCONTACT hContact) { - if (cli.hwndContactTree == nullptr) + if (g_CLI.hwndContactTree == nullptr) return; bool hcontgiven = (hContact != 0); @@ -301,7 +301,7 @@ MIR_APP_DLL(void) ExtraIcon_SetAll(MCONTACT hContact) if (!bImageCreated) ExtraIcon_Reload(); - SendMessage(cli.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0); + SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0); if (hContact == 0) hContact = db_find_first(); @@ -312,7 +312,7 @@ MIR_APP_DLL(void) ExtraIcon_SetAll(MCONTACT hContact) break; } - cli.pfnInvalidateRect(cli.hwndContactTree, nullptr, FALSE); + g_CLI.pfnInvalidateRect(g_CLI.hwndContactTree, nullptr, FALSE); } /////////////////////////////////////////////////////////////////////////////// diff --git a/src/mir_app/src/keyboard.cpp b/src/mir_app/src/keyboard.cpp index 966281a42a..e104cb249f 100644 --- a/src/mir_app/src/keyboard.cpp +++ b/src/mir_app/src/keyboard.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static INT_PTR hkHideShow(WPARAM, LPARAM)
{
- cli.pfnShowHide();
+ g_CLI.pfnShowHide();
return 0;
}
@@ -37,8 +37,8 @@ static INT_PTR hkRead(WPARAM, LPARAM) if (Clist_EventsProcessTrayDoubleClick(0) == 0)
return true;
- SetForegroundWindow(cli.hwndContactList);
- SetFocus(cli.hwndContactList);
+ SetForegroundWindow(g_CLI.hwndContactList);
+ SetFocus(g_CLI.hwndContactList);
return 0;
}
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index ad7c8e5580..13d0ffe0f3 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -109,7 +109,7 @@ MIR_APP_DLL(HMENU) Menu_GetMainMenu(void) NotifyEventHooks(hPreBuildMainMenuEvent, 0, 0);
Menu_Build(hMainMenu, hMainMenuObject);
- DrawMenuBar(cli.hwndContactList);
+ DrawMenuBar(g_CLI.hwndContactList);
return hMainMenu;
}
@@ -548,8 +548,8 @@ static INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) replaceStrW(pimi->mi.name.w, ptszName);
replaceStrW(root->mi.name.w, ptszName);
- if (cli.hwndStatus)
- InvalidateRect(cli.hwndStatus, nullptr, TRUE);
+ if (g_CLI.hwndStatus)
+ InvalidateRect(g_CLI.hwndStatus, nullptr, TRUE);
return 0;
}
@@ -565,7 +565,7 @@ static INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) if (pa->IsVisible())
MenusProtoCount++;
- cli.currentDesiredStatusMode = smep->status;
+ g_CLI.currentDesiredStatusMode = smep->status;
for (auto &pa : accounts) {
if (!pa->IsEnabled())
@@ -573,10 +573,10 @@ static INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) if (MenusProtoCount > 1 && pa->IsLocked())
continue;
- Proto_SetStatus(pa->szModuleName, cli.currentDesiredStatusMode);
+ Proto_SetStatus(pa->szModuleName, g_CLI.currentDesiredStatusMode);
}
- NotifyEventHooks(hStatusModeChangeEvent, cli.currentDesiredStatusMode, 0);
- db_set_w(0, "CList", "Status", (WORD)cli.currentDesiredStatusMode);
+ NotifyEventHooks(hStatusModeChangeEvent, g_CLI.currentDesiredStatusMode, 0);
+ db_set_w(0, "CList", "Status", (WORD)g_CLI.currentDesiredStatusMode);
return 1;
}
@@ -669,7 +669,7 @@ static int MenuIconsChanged(WPARAM, LPARAM) {
// just rebuild menu
RebuildMenuOrder();
- cli.pfnCluiProtocolStatusChanged(0, nullptr);
+ g_CLI.pfnCluiProtocolStatusChanged(0, nullptr);
return 0;
}
@@ -882,7 +882,7 @@ MIR_APP_DLL(void) Menu_ReloadProtoMenus(void) RebuildMenuOrder();
if (db_get_b(0, "CList", "MoveProtoMenus", true))
BuildProtoMenus();
- cli.pfnCluiProtocolStatusChanged(0, nullptr);
+ g_CLI.pfnCluiProtocolStatusChanged(0, nullptr);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -994,7 +994,7 @@ static INT_PTR HotkeySetStatus(WPARAM, LPARAM lParam) static INT_PTR ShowHide(WPARAM, LPARAM)
{
- cli.pfnShowHide();
+ g_CLI.pfnShowHide();
return 0;
}
@@ -1095,7 +1095,7 @@ void InitCustomMenus(void) Menu_AddMainMenuItem(&mi);
currentStatusMenuItem = ID_STATUS_OFFLINE;
- cli.currentDesiredStatusMode = ID_STATUS_OFFLINE;
+ g_CLI.currentDesiredStatusMode = ID_STATUS_OFFLINE;
HookEvent(ME_SKIN_ICONSCHANGED, MenuIconsChanged);
}
diff --git a/src/mir_app/src/menu_groups.cpp b/src/mir_app/src/menu_groups.cpp index 16bc77d0fd..2767e5ee5c 100644 --- a/src/mir_app/src/menu_groups.cpp +++ b/src/mir_app/src/menu_groups.cpp @@ -105,36 +105,36 @@ INT_PTR FreeOwnerDataGroupMenu(WPARAM, LPARAM lParam) static INT_PTR HideGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
+ int newVal = !(GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
db_set_b(0, "CList", "HideEmptyGroups", (BYTE)newVal);
- SendMessage(cli.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
return newVal;
}
static INT_PTR UseGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
+ int newVal = !(GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
db_set_b(0, "CList", "UseGroups", (BYTE)newVal);
- SendMessage(cli.hwndContactTree, CLM_SETUSEGROUPS, newVal,0);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETUSEGROUPS, newVal,0);
return newVal;
}
static INT_PTR HideOfflineHelper(WPARAM, LPARAM)
{
- return cli.pfnSetHideOffline(-1);
+ return g_CLI.pfnSetHideOffline(-1);
}
static INT_PTR HideOfflineRootHelper(WPARAM, LPARAM)
{
- int newVal = !SendMessage(cli.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0);
- SendMessage(cli.hwndContactTree, CLM_SETHIDEOFFLINEROOT, newVal, 0);
+ int newVal = !SendMessage(g_CLI.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEOFFLINEROOT, newVal, 0);
return newVal;
}
static INT_PTR CreateGroupHelper(WPARAM, LPARAM)
{
- SendMessage(cli.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
- SendMessage(cli.hwndContactTree, CLM_SETUSEGROUPS, 1, 0);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETUSEGROUPS, 1, 0);
Clist_GroupCreate(0, nullptr);
return 0;
}
@@ -144,10 +144,10 @@ static int OnBuildGroupMenu(WPARAM, LPARAM) bool bChecked = db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) != 0;
Menu_SetChecked(hHideOfflineUsersMenuItem, bChecked);
- bChecked = SendMessage(cli.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) != 0;
+ bChecked = SendMessage(g_CLI.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) != 0;
Menu_SetChecked(hHideOfflineUsersOutHereMenuItem, bChecked);
- DWORD dwStyle = GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE);
+ DWORD dwStyle = GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE);
Menu_SetChecked(hHideEmptyGroupsMenuItem, (dwStyle & CLS_HIDEEMPTYGROUPS) != 0);
Menu_SetChecked(hDisableGroupsMenuItem, (dwStyle & CLS_USEGROUPS) == 0);
return 0;
@@ -263,7 +263,7 @@ static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM) static INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM lParam)
{
- SendMessage(lParam ? (HWND)lParam : (HWND)cli.hwndContactTree, WM_COMMAND, wParam, 0);
+ SendMessage(lParam ? (HWND)lParam : (HWND)g_CLI.hwndContactTree, WM_COMMAND, wParam, 0);
return 0;
}
diff --git a/src/mir_app/src/menu_tray.cpp b/src/mir_app/src/menu_tray.cpp index 0496f63670..26dad6887a 100644 --- a/src/mir_app/src/menu_tray.cpp +++ b/src/mir_app/src/menu_tray.cpp @@ -98,7 +98,7 @@ static INT_PTR TrayMenuOnAddService(WPARAM wParam, LPARAM lParam) static INT_PTR ShowHideStub(WPARAM, LPARAM)
{
- return cli.pfnShowHide();
+ return g_CLI.pfnShowHide();
}
void InitTrayMenus(void)
diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp index eb61784393..6852d8a6ee 100644 --- a/src/mir_app/src/meta_addto.cpp +++ b/src/mir_app/src/meta_addto.cpp @@ -236,7 +236,7 @@ void CMetaSelectDlg::SortCheck_OnChange(CCtrlCheck*) INT_PTR Meta_AddTo(WPARAM hContact, LPARAM)
{
CMetaSelectDlg dlg(hContact);
- dlg.SetParent(cli.hwndContactList);
+ dlg.SetParent(g_CLI.hwndContactList);
dlg.DoModal();
return 0;
}
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index 9aea3770e0..5558c7da82 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -446,6 +446,6 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara INT_PTR Meta_Edit(WPARAM wParam, LPARAM)
{
- DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_METAEDIT), cli.hwndContactList, Meta_EditDialogProc, (LPARAM)wParam);
+ DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_METAEDIT), g_CLI.hwndContactList, Meta_EditDialogProc, (LPARAM)wParam);
return 0;
}
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index 8ddebc8979..f868f1d2e2 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -191,7 +191,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) if (cc->IsMeta()) {
// check from recursion - see second half of this function
if (!bSkipQuestion && IDYES !=
- MessageBox(cli.hwndContactList,
+ MessageBox(g_CLI.hwndContactList,
TranslateT("This will remove the metacontact permanently.\n\nProceed anyway?"),
TranslateT("Are you sure?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2))
return 0;
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 592ca34e2f..f64b95e2f3 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -617,7 +617,7 @@ static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam) InsertMenuItem(hMenu, i, TRUE, &mii);
}
- UINT res = TrackPopupMenu(hMenu, TPM_NONOTIFY | TPM_RETURNCMD | TPM_BOTTOMALIGN | TPM_LEFTALIGN, sicd->clickLocation.x, sicd->clickLocation.y, 0, cli.hwndContactTree, nullptr);
+ UINT res = TrackPopupMenu(hMenu, TPM_NONOTIFY | TPM_RETURNCMD | TPM_BOTTOMALIGN | TPM_LEFTALIGN, sicd->clickLocation.x, sicd->clickLocation.y, 0, g_CLI.hwndContactTree, nullptr);
if (res > 0) {
MCONTACT hChosen = Meta_GetContactHandle(cc, res - 1);
@@ -662,7 +662,7 @@ static VOID CALLBACK sttMenuThread(PVOID param) TPMPARAMS tpmp = { 0 };
tpmp.cbSize = sizeof(tpmp);
- BOOL menuRet = TrackPopupMenuEx(hMenu, TPM_RETURNCMD, menuMousePoint.x, menuMousePoint.y, cli.hwndContactList, &tpmp);
+ BOOL menuRet = TrackPopupMenuEx(hMenu, TPM_RETURNCMD, menuMousePoint.x, menuMousePoint.y, g_CLI.hwndContactList, &tpmp);
Clist_MenuProcessCommand(LOWORD(menuRet), MPCF_CONTACTMENU, (INT_PTR)param);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index bd5c9da1c5..80b82ab300 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -612,3 +612,4 @@ UnregisterPlugin @633 ?addFont@CMPluginBase@@QAEHPAUFontID@@@Z @641 NONAME
?addFont@CMPluginBase@@QAEHPAUFontIDW@@@Z @642 NONAME
?addTTB@CMPluginBase@@QAEPAXPBUTTBButton@@@Z @643 NONAME
+?g_CLI@@3UCLIST_INTERFACE@@A @644 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index b7ca7c0fa4..2f15988949 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -612,3 +612,4 @@ UnregisterPlugin @633 ?addFont@CMPluginBase@@QEAAHPEAUFontID@@@Z @641 NONAME
?addFont@CMPluginBase@@QEAAHPEAUFontIDW@@@Z @642 NONAME
?addTTB@CMPluginBase@@QEAAPEAXPEBUTTBButton@@@Z @643 NONAME
+?g_CLI@@3UCLIST_INTERFACE@@A @644 NONAME
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index a3fb7f89c1..d49ebbab17 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -112,8 +112,6 @@ int ImageList_ReplaceIcon_IconLibLoaded(HIMAGELIST hIml, int nIndex, HICON hIcon /**** clistmenus.cpp ********************************************************************/
-extern CLIST_INTERFACE cli;
-
extern int hMainMenuObject, hContactMenuObject, hStatusMenuObject;
extern HANDLE hPreBuildMainMenuEvent, hPreBuildContactMenuEvent;
extern HANDLE hShutdownEvent, hPreShutdownEvent;
|