summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_clistint.h2
-rw-r--r--libs/win32/mir_app.libbin168840 -> 168864 bytes
-rw-r--r--libs/win64/mir_app.libbin164038 -> 164062 bytes
-rwxr-xr-xplugins/Alarms/src/alarmlist.cpp2
-rwxr-xr-xplugins/Alarms/src/frame.cpp14
-rw-r--r--plugins/AsSingleWindow/src/AsSingleWindow.cpp2
-rw-r--r--plugins/AutoShutdown/src/frame.cpp4
-rw-r--r--plugins/AutoShutdown/src/shutdownsvc.cpp2
-rw-r--r--plugins/BASS_interface/src/Main.cpp4
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp14
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp12
-rw-r--r--plugins/Clist_blind/src/clistmenus.cpp2
-rw-r--r--plugins/Clist_blind/src/clistopts.cpp2
-rw-r--r--plugins/Clist_blind/src/cluiopts.cpp66
-rw-r--r--plugins/Clist_blind/src/init.cpp30
-rw-r--r--plugins/Clist_modern/src/cluiframes.cpp150
-rw-r--r--plugins/Clist_modern/src/init.cpp114
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp28
-rw-r--r--plugins/Clist_modern/src/modern_cachefuncs.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp62
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_clcmsgs.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp20
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp14
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp32
-rw-r--r--plugins/Clist_modern/src/modern_clistevents.cpp22
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp34
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp64
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp202
-rw-r--r--plugins/Clist_modern/src/modern_cluiservices.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_contact.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_rowheight_funcs.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_skinbutton.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp32
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_static_cluiframes_service.h44
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_tbbutton.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp24
-rw-r--r--plugins/Clist_nicer/src/CLCButton.cpp10
-rw-r--r--plugins/Clist_nicer/src/clc.cpp32
-rw-r--r--plugins/Clist_nicer/src/clcitems.cpp4
-rw-r--r--plugins/Clist_nicer/src/clcopts.cpp8
-rw-r--r--plugins/Clist_nicer/src/clcutils.cpp20
-rw-r--r--plugins/Clist_nicer/src/clistevents.cpp18
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp12
-rw-r--r--plugins/Clist_nicer/src/clistmod.cpp24
-rw-r--r--plugins/Clist_nicer/src/clistopts.cpp6
-rw-r--r--plugins/Clist_nicer/src/clistsettings.cpp2
-rw-r--r--plugins/Clist_nicer/src/clui.cpp134
-rw-r--r--plugins/Clist_nicer/src/cluiframes.cpp118
-rw-r--r--plugins/Clist_nicer/src/cluiopts.cpp96
-rw-r--r--plugins/Clist_nicer/src/cluiservices.cpp28
-rw-r--r--plugins/Clist_nicer/src/extBackg.cpp46
-rw-r--r--plugins/Clist_nicer/src/groupmenu.cpp2
-rw-r--r--plugins/Clist_nicer/src/init.cpp76
-rw-r--r--plugins/Clist_nicer/src/statusbar.cpp6
-rw-r--r--plugins/Clist_nicer/src/viewmodes.cpp8
-rw-r--r--plugins/CmdLine/src/mimcmd_handlers.cpp14
-rw-r--r--plugins/ContactsPlus/src/main.cpp2
-rw-r--r--plugins/ExternalAPI/m_skin_eng.h2
-rw-r--r--plugins/FileAsMessage/src/dialog.cpp6
-rw-r--r--plugins/FloatingContacts/src/main.cpp4
-rw-r--r--plugins/GmailNotifier/src/notify.cpp10
-rw-r--r--plugins/HTTPServer/src/GuiElements.cpp2
-rw-r--r--plugins/HwHotKeys/src/HwHotKeys_KbdHook.cpp6
-rw-r--r--plugins/IEView/src/HTMLBuilder.cpp2
-rw-r--r--plugins/KeyboardNotify/src/main.cpp6
-rw-r--r--plugins/MagneticWindows/src/MagneticWindows.cpp2
-rw-r--r--plugins/MagneticWindows/src/SnapToListService.cpp2
-rw-r--r--plugins/MenuItemEx/src/main.cpp2
-rw-r--r--plugins/MirandaG15/src/CAppletManager.cpp2
-rw-r--r--plugins/MyDetails/src/frame.cpp4
-rw-r--r--plugins/NewEventNotify/src/popup.cpp4
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp2
-rw-r--r--plugins/NotesAndReminders/src/reminders.cpp6
-rw-r--r--plugins/Nudge/src/main.cpp2
-rw-r--r--plugins/Nudge/src/shake.cpp2
-rw-r--r--plugins/Ping/src/pingthread.cpp2
-rw-r--r--plugins/Ping/src/utils.cpp2
-rw-r--r--plugins/Popup/src/popup_thread.cpp2
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp4
-rw-r--r--plugins/SMS/src/receive.cpp4
-rw-r--r--plugins/Scriver/src/chat_window.cpp8
-rw-r--r--plugins/Scriver/src/msgdialog.cpp2
-rw-r--r--plugins/Scriver/src/msglog.cpp2
-rw-r--r--plugins/Scriver/src/msgs.cpp10
-rw-r--r--plugins/StatusManager/src/StartupStatus/startupstatus.cpp8
-rw-r--r--plugins/TabSRMM/src/chat_tools.cpp4
-rw-r--r--plugins/TabSRMM/src/chat_window.cpp8
-rw-r--r--plugins/TabSRMM/src/globals.cpp4
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp8
-rw-r--r--plugins/TabSRMM/src/mim.cpp8
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp2
-rw-r--r--plugins/TabSRMM/src/msglog.cpp2
-rw-r--r--plugins/TipperYM/src/message_pump.cpp4
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.cpp4
-rw-r--r--plugins/TopToolBar/src/InternalButtons.cpp6
-rw-r--r--plugins/TopToolBar/src/toolbarwnd.cpp2
-rw-r--r--plugins/TrafficCounter/src/TrafficCounter.cpp4
-rw-r--r--plugins/UserInfoEx/src/dlg_propsheet.cpp2
-rw-r--r--plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp4
-rw-r--r--plugins/UserInfoEx/src/mir_menuitems.cpp8
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp2
-rw-r--r--plugins/Weather/src/weather_mwin.cpp2
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp8
-rw-r--r--plugins/YAPP/src/popwin.cpp2
-rw-r--r--plugins/ZeroSwitch/src/ZeroSwitch.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/links.cpp2
-rw-r--r--protocols/IRCG/src/clist.cpp6
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp12
-rw-r--r--protocols/JabberG/src/jabber_frame.cpp4
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp2
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp2
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp2
-rw-r--r--protocols/MRA/src/Mra_functions.cpp4
-rw-r--r--protocols/MSN/src/msn_mail.cpp4
-rw-r--r--protocols/MSN/src/msn_menu.cpp2
-rw-r--r--protocols/MSN/src/msn_misc.cpp4
-rw-r--r--protocols/MSN/src/msn_svcs.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_trouter.cpp6
-rw-r--r--protocols/VKontakte/src/misc.cpp4
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp2
-rw-r--r--src/core/stdclist/src/clistmenus.cpp2
-rw-r--r--src/core/stdclist/src/clistopts.cpp2
-rw-r--r--src/core/stdclist/src/cluiopts.cpp66
-rw-r--r--src/core/stdclist/src/init.cpp12
-rw-r--r--src/core/stdfile/src/file.cpp6
-rw-r--r--src/core/stdmsg/src/chat_manager.cpp4
-rw-r--r--src/core/stdmsg/src/chat_window.cpp4
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp2
-rw-r--r--src/core/stdmsg/src/msglog.cpp2
-rw-r--r--src/core/stdmsg/src/msgs.cpp10
-rw-r--r--src/core/stdmsg/src/tabs.cpp4
-rw-r--r--src/core/stduseronline/src/useronline.cpp4
-rw-r--r--src/mir_app/src/auth.cpp4
-rw-r--r--src/mir_app/src/chat_clist.cpp12
-rw-r--r--src/mir_app/src/chat_manager.cpp4
-rw-r--r--src/mir_app/src/chat_tools.cpp4
-rw-r--r--src/mir_app/src/clc.cpp170
-rw-r--r--src/mir_app/src/clcfiledrop.cpp10
-rw-r--r--src/mir_app/src/clcidents.cpp4
-rw-r--r--src/mir_app/src/clcitems.cpp60
-rw-r--r--src/mir_app/src/clcmsgs.cpp60
-rw-r--r--src/mir_app/src/clcutils.cpp82
-rw-r--r--src/mir_app/src/clistcore.cpp142
-rw-r--r--src/mir_app/src/clistevents.cpp32
-rw-r--r--src/mir_app/src/clistgroups.cpp2
-rw-r--r--src/mir_app/src/clistmod.cpp34
-rw-r--r--src/mir_app/src/clistsettings.cpp28
-rw-r--r--src/mir_app/src/clisttray.cpp254
-rw-r--r--src/mir_app/src/clui.cpp128
-rw-r--r--src/mir_app/src/cluiservices.cpp24
-rw-r--r--src/mir_app/src/contact.cpp2
-rw-r--r--src/mir_app/src/contacts.cpp2
-rw-r--r--src/mir_app/src/ei_services.cpp20
-rw-r--r--src/mir_app/src/keyboard.cpp6
-rw-r--r--src/mir_app/src/menu_clist.cpp22
-rw-r--r--src/mir_app/src/menu_groups.cpp24
-rw-r--r--src/mir_app/src/menu_tray.cpp2
-rw-r--r--src/mir_app/src/meta_addto.cpp2
-rw-r--r--src/mir_app/src/meta_edit.cpp2
-rw-r--r--src/mir_app/src/meta_menu.cpp2
-rw-r--r--src/mir_app/src/meta_services.cpp4
-rw-r--r--src/mir_app/src/mir_app.def2
-rw-r--r--src/mir_app/src/mir_app64.def2
174 files changed, 1642 insertions, 1642 deletions
diff --git a/include/m_clistint.h b/include/m_clistint.h
index 207c5e14f3..3375faaa79 100644
--- a/include/m_clistint.h
+++ b/include/m_clistint.h
@@ -441,6 +441,6 @@ struct CLIST_INTERFACE
EXTERN_C MIR_APP_DLL(CLIST_INTERFACE*) Clist_GetInterface(void);
-extern MIR_APP_EXPORT CLIST_INTERFACE g_CLI;
+extern MIR_APP_EXPORT CLIST_INTERFACE g_clistApi;
#endif // M_CLISTINT_H__
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index 5dba355917..171e8a9c3e 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index 8a6fbcce4a..d7b6692158 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp
index 91085be269..eabf7ad40d 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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
}
}
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp
index 686cbdd5c9..b2f4221e09 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(g_CLI.hwndContactList)) {
+ if ((!options.hide_with_clist && FrameIsFloating()) || IsWindowVisible(g_clistApi.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(g_CLI.hwndContactList))
+ if (!options.hide_with_clist || IsWindowVisible(g_clistApi.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(g_CLI.hwndContactList) && IsWindowVisible(hwnd)) {
+ if (!IsWindowVisible(g_clistApi.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(g_CLI.hwndContactList)) {
+ if (!IsWindowVisible(hwnd) && IsWindowVisible(g_clistApi.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, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ 0, 0, 10, 10, g_clistApi.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, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ 0, 0, 200, 100, g_clistApi.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(g_CLI.hwndContactList)) {
+ if (IsWindowVisible(g_clistApi.hwndContactList)) {
ShowWindow(hwnd_frame, SW_SHOW);
RefreshReminderFrame();
}
diff --git a/plugins/AsSingleWindow/src/AsSingleWindow.cpp b/plugins/AsSingleWindow/src/AsSingleWindow.cpp
index 4c0a8a1cce..8135edefcf 100644
--- a/plugins/AsSingleWindow/src/AsSingleWindow.cpp
+++ b/plugins/AsSingleWindow/src/AsSingleWindow.cpp
@@ -48,7 +48,7 @@ static int MsgWindowEvent(WPARAM, LPARAM lParam)
static int OnModulesLoaded(WPARAM, LPARAM)
{
- windowAdd(g_CLI.hwndContactList, true);
+ windowAdd(g_clistApi.hwndContactList, true);
HookEvent(ME_MSG_WINDOWEVENT, MsgWindowEvent);
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp
index 78b11eb92d..c27c96c3fe 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,
- g_CLI.hwndContactList,
+ g_clistApi.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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.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/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp
index d1ebc110a7..b6f4ac85e0 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(g_CLI.hwndContactList))
+ if (!DestroyWindow(g_clistApi.hwndContactList))
dwErrCode = GetLastError();
}
break;
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp
index 84123087bc..e65f1fda14 100644
--- a/plugins/BASS_interface/src/Main.cpp
+++ b/plugins/BASS_interface/src/Main.cpp
@@ -444,7 +444,7 @@ void CreateFrame()
RegisterClass(&wndclass);
hwnd_plugin = CreateWindow(L"BassInterfaceFrame", TranslateT("BASS Interface"),
- WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, g_clistApi.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
CLISTFrame Frame = { sizeof(CLISTFrame) };
Frame.tname = TranslateT("BASS Interface");
@@ -506,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, g_CLI.hwndContactList, nullptr);
+ BASS_Init(device, 44100, 0, g_clistApi.hwndContactList, nullptr);
Volume = db_get_b(NULL, MODULENAME, OPT_VOLUME, 33);
BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume * 100);
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index dad6b89086..baec5d057b 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -334,7 +334,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
}
}
- Clist_TrayIconDestroy(g_CLI.hwndContactList);
+ Clist_TrayIconDestroy(g_clistApi.hwndContactList);
if (g_wMask & OPT_TRAYICON)
CreateTrayIcon(true);
@@ -410,12 +410,12 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
if (g_TrayIcon) CreateTrayIcon(false);
- g_CLI.pfnTrayIconInit(g_CLI.hwndContactList);
+ g_clistApi.pfnTrayIconInit(g_clistApi.hwndContactList);
// force a redraw
// should prevent drawing problems
- InvalidateRect(g_CLI.hwndContactList, nullptr, true);
- UpdateWindow(g_CLI.hwndContactList);
+ InvalidateRect(g_clistApi.hwndContactList, nullptr, true);
+ UpdateWindow(g_clistApi.hwndContactList);
PostMessage(hWnd, WM_MOUSEMOVE, 0, (LPARAM)MAKELONG(2, 2)); // reset core's IDLE
g_bWindowHidden = false;
@@ -438,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 == g_CLI.hwndContactList)
+ if (hwnd == g_clistApi.hwndContactList)
ShowWindow(hwnd, SW_HIDE);
else
EnumWindows(EnumWindowsProc, 0);
@@ -631,7 +631,7 @@ static int MirandaLoaded(WPARAM, LPARAM)
HookTemporaryEvent(ME_MSG_TOOLBARLOADED, TabsrmmButtonsInit);
- GetWindowThreadProcessId(g_CLI.hwndContactList, &g_dwMirandaPID);
+ GetWindowThreadProcessId(g_clistApi.hwndContactList, &g_dwMirandaPID);
WNDCLASS winclass = { 0 };
winclass.lpfnWndProc = ListenWndProc;
@@ -641,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, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ g_hListenWindow = CreateWindow(BOSSKEY_LISTEN_INFO, BOSSKEY_LISTEN_INFO, WS_POPUP, 0, 0, 5, 5, g_clistApi.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
WTSRegisterSessionNotification(g_hListenWindow, 0);
}
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index 00f1e38127..e10b249dbf 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -164,14 +164,14 @@ LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
switch (message) {
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
- g_CLI.pfnRemoveEvent(PUGetContact(hWnd), 0);
+ g_clistApi.pfnRemoveEvent(PUGetContact(hWnd), 0);
CallServiceSync("BuddyExpectator/actionReturned", PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
}
break;
case WM_CONTEXTMENU:
- g_CLI.pfnRemoveEvent(PUGetContact(hWnd), 0);
+ g_clistApi.pfnRemoveEvent(PUGetContact(hWnd), 0);
setLastSeen(PUGetContact(hWnd));
PUDeletePopup(hWnd);
break;
@@ -189,14 +189,14 @@ LRESULT CALLBACK PopupDlgProcNoSet(HWND hWnd, UINT message, WPARAM wParam, LPARA
switch (message) {
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
- g_CLI.pfnRemoveEvent(PUGetContact(hWnd), 0);
+ g_clistApi.pfnRemoveEvent(PUGetContact(hWnd), 0);
CallServiceSync("BuddyExpectator/actionStillAbsent", (WPARAM)PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
}
break;
case WM_CONTEXTMENU:
- g_CLI.pfnRemoveEvent(PUGetContact(hWnd), 0);
+ g_clistApi.pfnRemoveEvent(PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
break;
@@ -286,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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
}
@@ -324,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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
}
diff --git a/plugins/Clist_blind/src/clistmenus.cpp b/plugins/Clist_blind/src/clistmenus.cpp
index a9278b4009..741f21060c 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(g_CLI.hwndContactList);
+ DestroyWindow(g_clistApi.hwndContactList);
return 0;
}
diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp
index 142d70fb8d..eb0c7fb5e6 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 */
- g_CLI.pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID); /* force reshuffle */
+ g_clistApi.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 a3828746f9..56c397973e 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(g_CLI.hwndContactList, title);
+ SetWindowText(g_clistApi.hwndContactList, title);
}
- g_CLI.pfnLoadCluiGlobalOpts();
- SetWindowPos(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0,
+ g_clistApi.pfnLoadCluiGlobalOpts();
+ SetWindowPos(g_clistApi.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(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);
+ GetWindowPlacement(g_clistApi.hwndContactList, &p);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE,
+ GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
+ SetWindowPlacement(g_clistApi.hwndContactList, &p);
}
- else SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW);
+ else SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW);
if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
HWND hProgMan = FindWindowA("Progman", nullptr);
if (IsWindow(hProgMan))
- SetParent(g_CLI.hwndContactList, hProgMan);
+ SetParent(g_clistApi.hwndContactList, hProgMan);
}
- else SetParent(g_CLI.hwndContactList, nullptr);
+ else SetParent(g_clistApi.hwndContactList, nullptr);
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION))
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE,
- GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE,
+ GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX);
else
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE,
- GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE,
+ GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
- SetMenu(g_CLI.hwndContactList, nullptr);
+ SetMenu(g_clistApi.hwndContactList, nullptr);
else
- 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);
+ SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
+ SetWindowPos(g_clistApi.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ RedrawWindow(g_clistApi.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
+ if (IsIconic(g_clistApi.hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
+ ShowWindow(g_clistApi.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
- 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);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
- else SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ else SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
- SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_clistApi.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));
- g_CLI.pfnLoadCluiGlobalOpts();
+ g_clistApi.pfnLoadCluiGlobalOpts();
if (db_get_b(NULL, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
- HWND parent = GetParent(g_CLI.hwndStatus);
+ HWND parent = GetParent(g_clistApi.hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
db_set_b(NULL, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
- ShowWindow(g_CLI.hwndStatus, SW_HIDE);
- DestroyWindow(g_CLI.hwndStatus);
+ ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
+ DestroyWindow(g_clistApi.hwndStatus);
flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
- g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
+ g_clistApi.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR))
- ShowWindow(g_CLI.hwndStatus, SW_SHOW);
+ ShowWindow(g_clistApi.hwndStatus, SW_SHOW);
else
- ShowWindow(g_CLI.hwndStatus, SW_HIDE);
- SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
+ SendMessage(g_clistApi.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 676be214fb..a4f2527ad5 100644
--- a/plugins/Clist_blind/src/init.cpp
+++ b/plugins/Clist_blind/src/init.cpp
@@ -109,7 +109,7 @@ static int OnOptsInit(WPARAM wParam, LPARAM lParam)
static INT_PTR GetStatusMode(WPARAM, LPARAM)
{
- return g_CLI.currentDesiredStatusMode;
+ return g_clistApi.currentDesiredStatusMode;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -121,19 +121,19 @@ extern "C" int __declspec(dllexport) CListInitialise()
g_bSortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
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;
+ coreCli = g_clistApi;
+ g_clistApi.hInst = g_plugin.getInst();
+ g_clistApi.pfnPaintClc = PaintClc;
+ g_clistApi.pfnContactListWndProc = ContactListWndProc;
+ g_clistApi.pfnContactListControlWndProc = ContactListControlWndProc;
+ g_clistApi.pfnRebuildEntireList = RebuildEntireList;
+ g_clistApi.pfnSetGroupExpand = SetGroupExpand;
+ g_clistApi.pfnRecalcScrollBar = RecalcScrollBar;
+ g_clistApi.pfnScrollTo = ScrollTo;
+ g_clistApi.pfnLoadClcOptions = LoadClcOptions;
+ g_clistApi.pfnGetRowHeight = GetRowHeight;
+ g_clistApi.pfnSortCLC = SortCLC;
+ g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 990e8f1215..d28d9068bf 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 != g_CLI.hwndContactList);
+ g_CluiData.fOnDesktop = (parent && parent != g_clistApi.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(g_CLI.hwndContactList);
+ SetForegroundWindow(g_clistApi.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 = g_CLI.hwndContactList;
+ fakeMainWindow.ContainerWnd = g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
}
else {
retval = fw.HeightWhenCollapsed;
@@ -1117,7 +1117,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam)
return 0;
}
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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(g_CLI.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
+ CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(g_clistApi.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
else if (g_pfwFrames[pos].visible) {
- g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(g_CLI.hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
+ g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(g_clistApi.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(g_CLI.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
+ CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
return 0;
}
@@ -1251,7 +1251,7 @@ static int _us_DoMoveFrame(WPARAM wParam, LPARAM lParam)
free(sd);
CLUIFramesStoreFrameSettings(pos);
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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(g_CLI.hwndContactList, &rc);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactList, nullptr, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);
+ SetWindowPos(g_clistApi.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)g_CLI.hwndContactList,0);
+ //CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList,0);
if (!g_pfwFrames[FrameId].floating) {
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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 (g_CLI.hwndContactList == nullptr) return -1;
+ if (g_clistApi.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, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ 0, 0, 0, 0, g_clistApi.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,
- g_CLI.hwndContactList, nullptr, g_plugin.getInst(),
+ g_clistApi.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(g_CLI.hwndContactList, &mainRect);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactList, nullptr, mainRect.left, mainRect.top, mainRect.right - mainRect.left, mainRect.bottom - mainRect.top, SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
+ SetWindowPos(g_clistApi.hwndContactList, nullptr, mainRect.left, mainRect.top, mainRect.right - mainRect.left, mainRect.bottom - mainRect.top, SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
}
- GetWindowRect(g_CLI.hwndContactList, &mainRect);
+ GetWindowRect(g_clistApi.hwndContactList, &mainRect);
mainHeight = mainRect.bottom - mainRect.top;
_nClientFrameId = eUnknownId; // recalc it
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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(g_CLI.hwndContactList, nullptr, TRUE);
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
- cliInvalidateRect(g_CLI.hwndContactList, nullptr, TRUE);
+ cliInvalidateRect(g_clistApi.hwndContactList, nullptr, TRUE);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
+ cliInvalidateRect(g_clistApi.hwndContactList, nullptr, TRUE);
return 0;
};
@@ -1721,8 +1721,8 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame)
RECT pr;
POINT Off = { 0 };
- ClientToScreen(g_CLI.hwndContactList, &Off);
- GetWindowRect(g_CLI.hwndContactList, &pr);
+ ClientToScreen(g_clistApi.hwndContactList, &Off);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactList) && Frame->collapsed && Frame->wndSize.bottom - Frame->wndSize.top != 0) {
+ if (Frame->visible && IsWindowVisible(g_clistApi.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 (g_CLI.hwndContactList == nullptr) return 0;
+ if (g_clistApi.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) && (g_CLI.hwndContactTree) && (F.hWnd != g_CLI.hwndContactTree))
+ if ((F.visible) && (!F.needhide) && (!F.floating) && (g_clistApi.hwndContactTree) && (F.hWnd != g_clistApi.hwndContactTree))
sumheight += (F.height) + (g_nTitleBarHeight*btoint(F.TitleBar.ShowTitleBar));
}
- GetBorderSize(g_CLI.hwndContactList, &border);
+ GetBorderSize(g_clistApi.hwndContactList, &border);
- //GetWindowRect(g_CLI.hwndContactList,&winrect);
- //GetClientRect(g_CLI.hwndContactList,&clirect);
+ //GetWindowRect(g_clistApi.hwndContactList,&winrect);
+ //GetClientRect(g_clistApi.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 (g_CLI.hwndContactList == nullptr) return 0;
+ if (g_clistApi.hwndContactList == nullptr) return 0;
// search for alClient frame and get the titlebar's height
@@ -1841,10 +1841,10 @@ int CLUIFramesGetMinHeight()
}
}
- GetBorderSize(g_CLI.hwndContactList, &border);
+ GetBorderSize(g_clistApi.hwndContactList, &border);
- //GetWindowRect(g_CLI.hwndContactList,&winrect);
- //GetClientRect(g_CLI.hwndContactList,&clirect);
+ //GetWindowRect(g_clistApi.hwndContactList,&winrect);
+ //GetClientRect(g_clistApi.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(g_CLI.hwndContactList)) {
+ if (IsWindowVisible(g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
return 0;
}
if (lParam & FU_FMPOS)
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 1);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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(g_CLI.hwndContactList, &nRect);
+ GetClientRect(g_clistApi.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(g_CLI.hwndContactList, &mainRect);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactList, nullptr, mainRect.left, mainRect.top, mainRect.right - mainRect.left, mainRect.bottom - mainRect.top, SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
+ SetWindowPos(g_clistApi.hwndContactList, nullptr, mainRect.left, mainRect.top, mainRect.right - mainRect.left, mainRect.bottom - mainRect.top, SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
}
- GetWindowRect(g_CLI.hwndContactList, &mainRect);
+ GetWindowRect(g_clistApi.hwndContactList, &mainRect);
mainHeight = mainRect.bottom - mainRect.top;
}
- GetClientRect(g_CLI.hwndContactList, &nRect);
+ GetClientRect(g_clistApi.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(g_CLI.hwndContactList, &pt);
+ ClientToScreen(g_clistApi.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 (g_CLI.hwndContactList != nullptr) cliInvalidateRect(g_CLI.hwndContactList, nullptr, TRUE);
- if (g_CLI.hwndContactList != nullptr) UpdateWindow(g_CLI.hwndContactList);
+ if (g_clistApi.hwndContactList != nullptr) cliInvalidateRect(g_clistApi.hwndContactList, nullptr, TRUE);
+ if (g_clistApi.hwndContactList != nullptr) UpdateWindow(g_clistApi.hwndContactList);
- if (lParam == 2) RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE);
+ if (lParam == 2) RedrawWindow(g_clistApi.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(g_CLI.hwndContactList, nullptr, 0);
+ cliInvalidateRect(g_clistApi.hwndContactList, nullptr, 0);
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE);
+ RedrawWindow(g_clistApi.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() != g_CLI.hwndContactList) state = CS_INACTIVE;
+ // if (GetForegroundWindow() != g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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(g_CLI.hwndContactList, &rcMiranda);
+ GetWindowRect(g_clistApi.hwndContactList, &rcMiranda);
//GetWindowRect( Frames[pos].ContainerWnd, &rcwnd );
//IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )
- if (IsWindowVisible(g_CLI.hwndContactList) && IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) {
+ if (IsWindowVisible(g_clistApi.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(g_CLI.hwndContactList, &rcMiranda);
+ GetWindowRect(g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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(g_CLI.hwndContactList, msg, wParam, lParam);
+ return SendMessage(g_clistApi.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(g_CLI.hwndContactList, &rcMiranda);
+ GetWindowRect(g_clistApi.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(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);
+ if (g_pfwFrames[pos].OwnerWindow == nullptr) g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(g_clistApi.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_clistApi.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
SetParent(g_pfwFrames[pos].hWnd, g_pfwFrames[pos].OwnerWindow);
- SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_CLI.hwndContactList);
+ SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_clistApi.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, g_CLI.hwndContactList);
- SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_CLI.hwndContactList);
+ SetParent(g_pfwFrames[pos].hWnd, g_clistApi.hwndContactList);
+ SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_clistApi.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(g_CLI.hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
+ g_pfwFrames[pos].ContainerWnd = CreateContainerWindow(g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
if (hwndtmp)
SendMessage(hwndtmp, WM_SIZE, 0, 0);
@@ -3367,7 +3367,7 @@ int UnLoadCLUIFramesModule(void)
DeleteObject(sttBmpBackground);
sttBmpBackground = nullptr;
}
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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 != g_CLI.hwndContactTree)
+ if (F.hWnd != g_clistApi.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) == g_CLI.hwndContactList && F.PaintCallbackProc == nullptr) {
+ if (F.visible && GetParent(F.hWnd) == g_clistApi.hwndContactList && F.PaintCallbackProc == nullptr) {
//create owner window
- F.OwnerWindow = CreateSubContainerWindow(g_CLI.hwndContactList, F.FloatingPos.x, F.FloatingPos.y, 10, 10);
+ F.OwnerWindow = CreateSubContainerWindow(g_clistApi.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 40aa1ad468..03fd4a044e 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -101,9 +101,9 @@ extern "C" __declspec(dllexport) int Unload(void)
{
TRACE("Unloading Clist Modern\r\n");
- if (IsWindow(g_CLI.hwndContactList))
- DestroyWindow(g_CLI.hwndContactList);
- g_CLI.hwndContactList = nullptr;
+ if (IsWindow(g_clistApi.hwndContactList))
+ DestroyWindow(g_clistApi.hwndContactList);
+ g_clistApi.hwndContactList = nullptr;
ToolbarButtonUnloadModule();
BackgroundsUnloadModule();
@@ -132,62 +132,62 @@ static HRESULT SubclassClistInterface()
// 'cli_*' - new handler with default core service calling
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;
+ corecli = g_clistApi;
+
+ g_clistApi.hInst = g_plugin.getInst();
+
+ g_clistApi.pfnCreateCacheItem = cliCreateCacheItem;
+ g_clistApi.pfnCheckCacheItem = cliCheckCacheItem;
+ g_clistApi.pfnFreeCacheItem = cliFreeCacheItem;
+ g_clistApi.pfnInvalidateDisplayNameCacheEntry = cliInvalidateDisplayNameCacheEntry;
+
+ g_clistApi.pfnTrayIconPauseAutoHide = cliTrayIconPauseAutoHide;
+ g_clistApi.pfnTrayIconInit = cliTrayIconInit;
+ g_clistApi.pfnTrayCalcChanged = cliTrayCalcChanged;
+
+ g_clistApi.pfnCluiProtocolStatusChanged = cliCluiProtocolStatusChanged;
+
+ g_clistApi.pfnBeginRenameSelection = cliBeginRenameSelection;
+ g_clistApi.pfnCreateClcContact = cliCreateClcContact;
+ g_clistApi.pfnGetRowBottomY = cliGetRowBottomY;
+ g_clistApi.pfnGetRowHeight = cliGetRowHeight;
+ g_clistApi.pfnGetRowTopY = cliGetRowTopY;
+ g_clistApi.pfnGetRowTotalHeight = cliGetRowTotalHeight;
+ g_clistApi.pfnInvalidateRect = cliInvalidateRect;
+ g_clistApi.pfnOnCreateClc = CLUI::cliOnCreateClc;
+ g_clistApi.pfnPaintClc = CLCPaint::cliPaintClc;
+ g_clistApi.pfnRebuildEntireList = cliRebuildEntireList;
+ g_clistApi.pfnIsVisibleContact = cliIsVisibleContact;
+ g_clistApi.pfnRecalcScrollBar = cliRecalcScrollBar;
+ g_clistApi.pfnRowHitTest = cliRowHitTest;
+ g_clistApi.pfnScrollTo = cliScrollTo;
+ g_clistApi.pfnShowHide = cliShowHideStub;
+ g_clistApi.pfnHitTest = cliHitTest;
+ g_clistApi.pfnCompareContacts = cliCompareContacts;
+ g_clistApi.pfnGetIconFromStatusMode = cliGetIconFromStatusMode;
+ g_clistApi.pfnFindItem = cliFindItem;
+ g_clistApi.pfnGetRowByIndex = cliGetRowByIndex;
+ g_clistApi.pfnGetRowsPriorTo = cliGetRowsPriorTo;
+ g_clistApi.pfnGetGroupContentsCount = cliGetGroupContentsCount;
+ g_clistApi.pfnFindRowByText = cliFindRowByText;
+ g_clistApi.pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
// partialy overloaded - call default handlers from inside
- 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;
+ g_clistApi.pfnIconFromStatusMode = cli_IconFromStatusMode;
+ g_clistApi.pfnLoadCluiGlobalOpts = CLUI_cli_LoadCluiGlobalOpts;
+ g_clistApi.pfnLoadClcOptions = cli_LoadCLCOptions;
+ g_clistApi.pfnSortCLC = cli_SortCLC;
+ g_clistApi.pfnAddContactToGroup = cli_AddContactToGroup;
+ g_clistApi.pfnAddContactToTree = cli_AddContactToTree;
+ g_clistApi.pfnContactListWndProc = CLUI::cli_ContactListWndProc;
+ g_clistApi.pfnFreeContact = cli_FreeContact;
+ g_clistApi.pfnSetContactCheckboxes = cli_SetContactCheckboxes;
+ g_clistApi.pfnTrayIconProcessMessage = cli_TrayIconProcessMessage;
+ g_clistApi.pfnContactListControlWndProc = cli_ContactListControlWndProc;
+ g_clistApi.pfnProcessExternalMessages = cli_ProcessExternalMessages;
+ g_clistApi.pfnAddEvent = cli_AddEvent;
+ g_clistApi.pfnRemoveEvent = cli_RemoveEvent;
+ g_clistApi.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 7cfd68746a..41d6b51efb 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, g_CLI.hwndContactList, nullptr, g_CLI.hInst, nullptr);
+ (wchar_t*)tszName, WS_POPUP, 0, 0, 1, 1, g_clistApi.hwndContactList, nullptr, g_clistApi.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 = g_CLI.hwndContactTree;
+ HWND hwndParent = g_clistApi.hwndContactTree;
RECT rcPos = dat->rcPos;
- g_CLI.pfnInvalidateRect(hwndParent, &rcPos, FALSE);
+ g_clistApi.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(g_CLI.hwndContactTree, &clistRect);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactTree, dat->hWindow, 0, 0, 0, 0, SWP_ASYNCWINDOWPOS | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
+ SetWindowPos(g_clistApi.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(g_CLI.hwndContactList, GWL_EXSTYLE);
- SetWindowPos(g_CLI.hwndContactList, hwnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ LONG exStyle = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE);
+ SetWindowPos(g_clistApi.hwndContactList, hwnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
if (!(exStyle & WS_EX_TOPMOST))
- SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ SetWindowPos(g_clistApi.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(g_CLI.hwndContactList, GWL_EXSTYLE);
- SetWindowPos(g_CLI.hwndContactList, hwnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ LONG exStyle = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE);
+ SetWindowPos(g_clistApi.hwndContactList, hwnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
if (!(exStyle&WS_EX_TOPMOST))
- SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ SetWindowPos(g_clistApi.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(g_CLI.hwndContactList, GA_PARENT);
+ HWND parent = GetAncestor(g_clistApi.hwndContactList, GA_PARENT);
pai->hWindow = hwnd;
SendMessage(hwnd, AAM_SETPARENT, (WPARAM)parent, 0);
@@ -957,7 +957,7 @@ int AniAva_UpdateOptions()
}
if (bReloadAvatars)
- PostMessage(g_CLI.hwndContactTree, INTM_AVATARCHANGED, 0, 0);
+ PostMessage(g_clistApi.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(g_CLI.hwndContactList, GA_PARENT);
+ HWND parent = GetAncestor(g_clistApi.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 65a350be88..7c8901bf67 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 && g_CLI.hwndContactTree)
- dat = (ClcData *)GetWindowLongPtr(g_CLI.hwndContactTree, 0);
+ if (dat == nullptr && g_clistApi.hwndContactTree)
+ dat = (ClcData *)GetWindowLongPtr(g_clistApi.hwndContactTree, 0);
- if (dat && dat->hWnd == g_CLI.hwndContactTree) {
+ if (dat && dat->hWnd == g_clistApi.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 923e67fda5..bf60ce87c9 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(g_CLI.hwndContactList, cws->value.bVal ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ SetWindowPos(g_clistApi.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")) {
- g_CLI.pfnInvalidateDisplayNameCacheEntry(hContact);
+ g_clistApi.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)
- g_CLI.pfnSetGroupExpand(hwnd, dat, group, 1);
- foundindex = g_CLI.pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
+ g_clistApi.pfnSetGroupExpand(hwnd, dat, group, 1);
+ foundindex = g_clistApi.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 = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
+ int hit = g_clistApi.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) != g_CLI.hwndContactList) {
+ if (!g_CluiData.fLayered || GetParent(hwnd) != g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 = g_CLI.pfnGetGroupContentsCount(&dat->list, 1) - 1; selMoved = 1; break;
+ case VK_END: dat->selection = g_clistApi.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;
- g_CLI.pfnSortCLC(hwnd, dat, 1);
+ g_clistApi.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;
- g_CLI.pfnSortCLC(hwnd, dat, 1);
+ g_clistApi.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 g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, 0);
+ else g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, 0);
}
else if (changeGroupExpand == 2) {
- g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, 1);
+ g_clistApi.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 >= g_CLI.pfnGetGroupContentsCount(&dat->list, 1))
- dat->selection = g_CLI.pfnGetGroupContentsCount(&dat->list, 1) - 1;
+ if (dat->selection >= g_clistApi.pfnGetGroupContentsCount(&dat->list, 1))
+ dat->selection = g_clistApi.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;
- g_CLI.pfnSortCLC(hwnd, dat, 1);
+ g_clistApi.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);
- g_CLI.pfnSortCLC(hwnd, dat, 1);
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnSortCLC(hwnd, dat, 1);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
return 0;
case TIMERID_RECALCSCROLLBAR:
KillTimer(hwnd, TIMERID_RECALCSCROLLBAR);
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.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);
- g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
+ g_clistApi.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
- g_CLI.pfnSetContactCheckboxes(contact, bNewState);
+ g_clistApi.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 };
- g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
- int i = g_CLI.pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
+ g_clistApi.pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
+ int i = g_clistApi.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;
- g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_clistApi.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 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_clistApi.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
- g_CLI.pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
+ g_clistApi.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 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_clistApi.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 = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_clistApi.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
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.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);
- g_CLI.pfnLoadClcOptions(hwnd, dat, FALSE);
+ g_clistApi.pfnLoadClcOptions(hwnd, dat, FALSE);
Clist_SaveStateAndRebuildList(hwnd, dat);
- g_CLI.pfnSortCLC(hwnd, dat, 1);
+ g_clistApi.pfnSortCLC(hwnd, dat, 1);
if (IsWindowVisible(hwnd))
- g_CLI.pfnInvalidateRect(GetParent(hwnd), nullptr, FALSE);
+ g_clistApi.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 be79fcb714..d5c6efd7b0 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 (g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) == -1)
+ if (g_clistApi.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 = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else {
- dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact->subcontacts));
+ dat->selection = g_clistApi.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);
- g_CLI.bAutoRebuild = false;
+ g_clistApi.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 fead72d234..c05679e86b 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); //g_CLI.pfnSortCLC(hwnd, dat, 1);
- clcSetDelayTimer(TIMERID_RECALCSCROLLBAR, hwnd, 2); //g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ clcSetDelayTimer(TIMERID_DELAYEDRESORTCLC, hwnd, 1); //g_clistApi.pfnSortCLC(hwnd, dat, 1);
+ clcSetDelayTimer(TIMERID_RECALCSCROLLBAR, hwnd, 2); //g_clistApi.pfnRecalcScrollBar(hwnd, dat);
return 0;
case CLM_AUTOREBUILD:
if (dat->bForceInDialog) {
Clist_SaveStateAndRebuildList(hwnd, dat);
- g_CLI.bAutoRebuild = false;
+ g_clistApi.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)
- g_CLI.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
+ g_clistApi.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 = g_CLI.pfnGetRowsPriorTo(&dat->list, group, index);
+ dat->selection = g_clistApi.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 229c8f1e53..7fbc457397 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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_clistApi.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(g_CLI.hwndContactTree); /* force reshuffle */
+ Clist_InitAutoRebuild(g_clistApi.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(g_CLI.hwndContactTree); /* force reshuffle */
+ Clist_InitAutoRebuild(g_clistApi.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(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_clistApi.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(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ SetWindowPos(g_clistApi.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(g_CLI.hwndContactList, hProgMan);
+ SetParent(g_clistApi.hwndContactList, hProgMan);
Sync(CLUIFrames_SetParentForContainers, (HWND)hProgMan);
g_CluiData.fOnDesktop = true;
}
}
else {
- if (GetParent(g_CLI.hwndContactList)) {
- SetParent(g_CLI.hwndContactList, nullptr);
+ if (GetParent(g_clistApi.hwndContactList)) {
+ SetParent(g_clistApi.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)g_CLI.hwndContactList, 0);
+ Sync(CLUIFramesOnClistResize, (WPARAM)g_clistApi.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(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_clistApi.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 8cdf7221c4..7de0e4022b 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(g_CLI.hwndContactTree, 0);
+ dat = (ClcData*)GetWindowLongPtr(g_clistApi.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 == g_CLI.hwndContactTree && dat->fontModernInfo[id].effect != 0)
+ if (dat->hWnd == g_clistApi.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 == g_CLI.hwndContactTree);
+ BOOL InClistWindow = (dat->hWnd == g_clistApi.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 = g_CLI.pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
+ int item = g_clistApi.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 = g_CLI.pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
+ overlayIdx = g_clistApi.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 = g_CLI.pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
+ int item = g_clistApi.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 == g_CLI.hwndContactTree)) {
+ if (gl_RowRoot && (dat->hWnd == g_clistApi.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 5406a0e693..0648e1434c 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(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.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 != g_CLI.hwndContactTree && g_CLI.hwndContactTree != nullptr)
+ dat->row_before_group_space = ((hwnd != g_clistApi.hwndContactTree && g_clistApi.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 (g_CLI.hwndContactTree == nullptr || dat->hWnd == g_CLI.hwndContactTree) {
+ if (g_clistApi.hwndContactTree == nullptr || dat->hWnd == g_clistApi.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 (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr) {
+ if (g_clistApi.hwndContactTree == hwnd || g_clistApi.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 (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr) {
+ if (g_clistApi.hwndContactTree == hwnd || g_clistApi.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 (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr) {
+ if (g_clistApi.hwndContactTree == hwnd || g_clistApi.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 (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr)
+ if (g_clistApi.hwndContactTree == hwnd || g_clistApi.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 (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr) {
+ if (g_clistApi.hwndContactTree == hwnd || g_clistApi.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 (g_CLI.hwndContactTree == hwnd || g_CLI.hwndContactTree == nullptr) {
+ if (g_clistApi.hwndContactTree == hwnd || g_clistApi.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 = (g_CLI.hwndContactTree) ? (hwnd != g_CLI.hwndContactTree) : 0;
+ dat->bForceInDialog = (g_clistApi.hwndContactTree) ? (hwnd != g_clistApi.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 (g_CLI.hwndContactTree == nullptr || dat->hWnd == g_CLI.hwndContactTree)
+ if (g_clistApi.hwndContactTree == nullptr || dat->hWnd == g_clistApi.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;
- g_CLI.pfnSortCLC(hwnd, dat, 1);
+ g_clistApi.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)
- g_CLI.pfnSetGroupExpand(hwnd, dat, group, 1);
- return g_CLI.pfnGetRowsPriorTo(&dat->list, ccGroup, ccScanIndex + SubCount);
+ g_clistApi.pfnSetGroupExpand(hwnd, dat, group, 1);
+ return g_clistApi.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)
- g_CLI.pfnSetGroupExpand(hwnd, dat, group, 1);
+ g_clistApi.pfnSetGroupExpand(hwnd, dat, group, 1);
if (!cc->bSubExpanded)
ExpandMetaContact(hwnd, cc, dat);
- return g_CLI.pfnGetRowsPriorTo(&dat->list, ccGroup, ccScanIndex + SubCount + i + 1);
+ return g_clistApi.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 45c2c6db07..62447a7711 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 : *g_CLI.events)
+ for (auto &it : *g_clistApi.events)
if (it->menuId == iSelection)
return it;
@@ -142,7 +142,7 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle)
g_CluiData.hUpdateContact = p->hContact;
}
- if (g_CLI.events->getCount() > 0) {
+ if (g_clistApi.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 : *g_CLI.events)
+ for (auto &it : *g_clistApi.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 (g_CLI.events->getCount() == 0) {
+ if (g_clistApi.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) != g_CLI.hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != g_clistApi.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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
return 0;
}
void EventArea_ConfigureEventArea()
{
- int iCount = g_CLI.events->getCount();
+ int iCount = g_clistApi.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) == g_CLI.hwndContactList)
+ if (GetParent(hwnd) == g_clistApi.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)
- g_CLI.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ g_clistApi.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) == g_CLI.hwndContactList && g_CluiData.fLayered)
+ if (GetParent(hwnd) == g_clistApi.hwndContactList && g_CluiData.fLayered)
CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)hwnd, 0);
- else if (GetParent(hwnd) == g_CLI.hwndContactList && !g_CluiData.fLayered) {
+ else if (GetParent(hwnd) == g_clistApi.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 8c30001324..923242e93f 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(g_CLI.hwndContactList);
+ DestroyWindow(g_clistApi.hwndContactList);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 2aae35ea02..4734bcada5 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, g_CLI.pfnIconFromStatusMode(szProto, status, hContact));
+ return ske_ImageList_GetIcon(g_himlCListClc, g_clistApi.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 g_CLI.pfnIconFromStatusMode(p->szProto, p->szProto == nullptr ? ID_STATUS_OFFLINE : p->m_iStatus, p->hContact);
+ return g_clistApi.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 == g_CLI.hwndContactList || GetParent(hwndFocused) == g_CLI.hwndContactList)
+ if (hwndFocused == g_clistApi.hwndContactList || GetParent(hwndFocused) == g_clistApi.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(g_CLI.hwndContactList, 0, 0);
+ int iVisibleState = GetWindowVisibleState(g_clistApi.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 g_CLI.hwndContactList and iStepX and iStepY are right.
+ case -1: //We can't get here, both g_clistApi.hwndContactList and iStepX and iStepY are right.
return 0;
}
if (bShow || bAlwaysShow) {
Sync(CLUIFrames_ActivateSubContainers, TRUE);
- CLUI_ShowWindowMod(g_CLI.hwndContactList, SW_RESTORE);
+ CLUI_ShowWindowMod(g_clistApi.hwndContactList, SW_RESTORE);
if (!db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
Sync(CLUIFrames_OnShowHide, 1); //TO BE PROXIED
- SetWindowPos(g_CLI.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ SetWindowPos(g_clistApi.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(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos(g_clistApi.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
g_bCalledFromShowHide = 0;
}
else {
- SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos(g_clistApi.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
Sync(CLUIFrames_OnShowHide, 1);
- SetForegroundWindow(g_CLI.hwndContactList);
+ SetForegroundWindow(g_clistApi.hwndContactList);
}
db_set_b(0, "CList", "State", SETTING_STATE_NORMAL);
RECT rcWindow;
- GetWindowRect(g_CLI.hwndContactList, &rcWindow);
+ GetWindowRect(g_clistApi.hwndContactList, &rcWindow);
if (Utils_AssertInsideScreen(&rcWindow) == 1)
- MoveWindow(g_CLI.hwndContactList, rcWindow.left, rcWindow.top,
+ MoveWindow(g_clistApi.hwndContactList, rcWindow.left, rcWindow.top,
rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE);
}
else { // It needs to be hidden
- if (GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) {
+ if (GetWindowLongPtr(g_clistApi.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(g_CLI.hwndContactList, SW_HIDE);
+ CLUI_ShowWindowMod(g_clistApi.hwndContactList, SW_HIDE);
db_set_b(0, "CList", "State", SETTING_STATE_HIDDEN);
}
else {
- CLUI_ShowWindowMod(g_CLI.hwndContactList, SW_MINIMIZE);
+ CLUI_ShowWindowMod(g_clistApi.hwndContactList, SW_MINIMIZE);
db_set_b(0, "CList", "State", SETTING_STATE_MINIMIZED);
}
@@ -387,9 +387,9 @@ int cliShowHide(bool bAlwaysShow)
int CListMod_HideWindow()
{
- KillTimer(g_CLI.hwndContactList, 1);
+ KillTimer(g_clistApi.hwndContactList, 1);
if (!CLUI_HideBehindEdge())
- return CLUI_SmoothAlphaTransition(g_CLI.hwndContactList, 0, 1);
+ return CLUI_SmoothAlphaTransition(g_clistApi.hwndContactList, 0, 1);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index ccaf1c54d7..26fa401b41 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, g_CLI.pfnIconFromStatusMode(GetContactProto(hContact), ID_STATUS_OFFLINE, hContact));
+ Clist_ChangeContactIcon(hContact, g_clistApi.pfnIconFromStatusMode(GetContactProto(hContact), ID_STATUS_OFFLINE, hContact));
return 0;
}
@@ -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 (g_CLI.hwndContactTree && g_flag_bOnModulesLoadedCalled)
- Clist_InitAutoRebuild(g_CLI.hwndContactTree);
+ if (g_clistApi.hwndContactTree && g_flag_bOnModulesLoadedCalled)
+ Clist_InitAutoRebuild(g_clistApi.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(g_CLI.hwndContactTree);
+ Clist_InitAutoRebuild(g_clistApi.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, g_CLI.pfnIconFromStatusMode(pdnce->szProto, pdnce->getStatus(), hContact));
+ Clist_ChangeContactIcon(hContact, g_clistApi.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, g_CLI.pfnIconFromStatusMode(szProto, pdnce->getStatus(), hContact));
+ Clist_ChangeContactIcon(hContact, g_clistApi.pfnIconFromStatusMode(szProto, pdnce->getStatus(), hContact));
}
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 450e3462c3..3e4a04ba0d 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 = g_CLI.hwndContactList;
+ HWND hwndClui = g_clistApi.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() != g_CLI.hwndContactList && GetWindow(GetParent(GetActiveWindow()), GW_OWNER) != g_CLI.hwndContactList) {
+ if (GetActiveWindow() != g_clistApi.hwndContactList && GetWindow(GetParent(GetActiveWindow()), GW_OWNER) != g_clistApi.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 (g_CLI.bTrayMenuOnScreen)
- g_CLI.bTrayMenuOnScreen = FALSE;
+ if (g_clistApi.bTrayMenuOnScreen)
+ g_clistApi.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);
- g_CLI.bTrayMenuOnScreen = TRUE;
+ g_clistApi.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 != g_CLI.hwndContactList)
+ if (LOWORD(msg->wParam) == WA_INACTIVE && h2 != g_clistApi.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 (!g_CLI.trayIconCount)
+ if (!g_clistApi.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 = g_CLI.cycleStep;
+ int t = g_clistApi.cycleStep;
do {
- g_CLI.cycleStep = (g_CLI.cycleStep + 1) % AccNum;
- if (g_CLI.cycleStep == t)
+ g_clistApi.cycleStep = (g_clistApi.cycleStep + 1) % AccNum;
+ if (g_clistApi.cycleStep == t)
return;
- } while (acc[g_CLI.cycleStep]->bIsVirtual || !acc[g_CLI.cycleStep]->bIsVisible);
+ } while (acc[g_clistApi.cycleStep]->bIsVirtual || !acc[g_clistApi.cycleStep]->bIsVisible);
- cliTrayCalcChanged(acc[g_CLI.cycleStep]->szModuleName, 0, 0);
+ cliTrayCalcChanged(acc[g_clistApi.cycleStep]->szModuleName, 0, 0);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -294,7 +294,7 @@ UINT_PTR TimerID = 0;
int cliTrayIconInit(HWND hwnd)
{
- if (g_CLI.trayIconCount != 0)
+ if (g_clistApi.trayIconCount != 0)
return 0;
if (TimerID) {
@@ -308,11 +308,11 @@ int cliTrayIconInit(HWND hwnd)
// Нужно узнать количество годных аккаунтов и неодинаковость их статусов.
bool bDiffers;
- g_CLI.trayIconCount = GetGoodAccNum(&bDiffers);
+ g_clistApi.trayIconCount = GetGoodAccNum(&bDiffers);
// Если таковых аккаунтов не нашлось вообще, то будем показывать основную иконку Миранды.
- if (!g_CLI.trayIconCount) {
- g_CLI.trayIconCount = 1;
- g_CLI.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * g_CLI.trayIconCount);
+ if (!g_clistApi.trayIconCount) {
+ g_clistApi.trayIconCount = 1;
+ g_clistApi.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * g_clistApi.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)
- g_CLI.trayIconCount = 1;
+ g_clistApi.trayIconCount = 1;
- g_CLI.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * g_CLI.trayIconCount);
+ g_clistApi.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * g_clistApi.trayIconCount);
// Добавляем иконки.
switch (Mode) {
@@ -352,7 +352,7 @@ int cliTrayIconInit(HWND hwnd)
case TRAY_ICON_MODE_CYCLE:
Clist_TrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
- g_CLI.cycleStep = 0;
+ g_clistApi.cycleStep = 0;
cliTrayCycleTimerProc(nullptr, 0, 0, 0); // force icon update
// Не сохраняем ID таймера в pcli, чтобы fnTrayIconUpdateBase не убивала его.
@@ -374,7 +374,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int)
if (!szChangedProto)
return -1;
- if (!g_CLI.trayIconCount)
+ if (!g_clistApi.trayIconCount)
return -1;
if (!Clist_GetProtocolVisibility(szChangedProto))
@@ -395,7 +395,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int)
switch (Mode) {
case TRAY_ICON_MODE_GLOBAL:
- hIcon = g_CLI.pfnGetIconFromStatusMode(0, nullptr, CListTray_GetGlobalStatus(0, 0));
+ hIcon = g_clistApi.pfnGetIconFromStatusMode(0, nullptr, CListTray_GetGlobalStatus(0, 0));
Clist_TrayIconMakeTooltip(nullptr, nullptr);
break;
@@ -410,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 = g_CLI.pfnGetIconFromStatusMode(0, szProto, Proto_GetStatus(szProto));
+ hIcon = g_clistApi.pfnGetIconFromStatusMode(0, szProto, Proto_GetStatus(szProto));
Clist_TrayIconMakeTooltip(nullptr, szProto);
}
@@ -421,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 = g_CLI.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto));
+ hIcon = g_clistApi.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto));
Clist_TrayIconMakeTooltip(nullptr, nullptr);
break;
case TRAY_ICON_MODE_ALL:
// Какой индекс у аккаунта, который будем апдейтить?
- for (; i < g_CLI.trayIconCount; i++)
- if (!mir_strcmp(g_CLI.trayIcon[i].szProto, szChangedProto))
+ for (; i < g_clistApi.trayIconCount; i++)
+ if (!mir_strcmp(g_clistApi.trayIcon[i].szProto, szChangedProto))
break;
iStatus = Proto_GetStatus(szChangedProto);
if (g_StatusBarData.bConnectingIcon && IsStatusConnecting(iStatus))
hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0);
else
- hIcon = g_CLI.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto));
- Clist_TrayIconMakeTooltip(nullptr, g_CLI.trayIcon[i].szProto);
+ hIcon = g_clistApi.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto));
+ Clist_TrayIconMakeTooltip(nullptr, g_clistApi.trayIcon[i].szProto);
break;
}
- trayIconInfo_t &p = g_CLI.trayIcon[i];
+ trayIconInfo_t &p = g_clistApi.trayIcon[i];
DestroyIcon(p.hBaseIcon);
p.hBaseIcon = hIcon;
- replaceStrW(p.ptszToolTip, g_CLI.szTip);
+ replaceStrW(p.ptszToolTip, g_clistApi.szTip);
NOTIFYICONDATA nid = { sizeof(NOTIFYICONDATA) };
- nid.hWnd = g_CLI.hwndContactList;
+ nid.hWnd = g_clistApi.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, g_CLI.szTip, _countof(nid.szTip));
+ mir_wstrncpy(nid.szTip, g_clistApi.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 745ca9a62b..be0136f7e5 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(g_CLI.hwndContactList, UM_CREATECLC, 0, 0); // $$$
+ SendMessage(g_clistApi.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(g_CLI.hwndContactList, nullptr, 0);
+ cliInvalidateRect(g_clistApi.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 = g_CLI.hwndContactList;
+ hwndClist = g_clistApi.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, g_CLI.hwndContactList, nullptr);
+ TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, g_clistApi.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, g_CLI.hwndContactList, nullptr);
+ TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, g_clistApi.hwndContactList, nullptr);
return 0;
}
@@ -239,7 +239,7 @@ INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM hContact, LPARAM)
HRESULT CLUI::CreateCluiFrames()
{
- g_hMenuMain = GetMenu(g_CLI.hwndContactList);
+ g_hMenuMain = GetMenu(g_clistApi.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(g_CLI.hwndContactList);
+ CreateCLCWindow(g_clistApi.hwndContactList);
CLUI_ChangeWindowMode();
@@ -348,7 +348,7 @@ HRESULT CLUI::RegisterAvatarMenu()
HRESULT CLUI::CreateCLCWindow(const HWND hwndClui)
{
- g_CLI.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
+ g_clistApi.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(g_CLI.hwndContactList);
+ EventArea_Create(g_clistApi.hwndContactList);
CreateViewModeFrame();
- g_CLI.hwndStatus = StatusBar_Create(g_CLI.hwndContactList);
+ g_clistApi.hwndStatus = StatusBar_Create(g_clistApi.hwndContactList);
return S_OK;
}
@@ -408,7 +408,7 @@ HRESULT CLUI::FillAlphaChannel(HDC hDC, RECT *prcParent)
HRESULT CLUI::CreateCLC()
{
CLISTFrame Frame = { sizeof(Frame) };
- Frame.hWnd = g_CLI.hwndContactTree;
+ Frame.hWnd = g_clistApi.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') {
- g_CLI.pfnSetHideOffline((bOldHideOffline == -1) ? false : bOldHideOffline);
+ g_clistApi.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 = g_CLI.hwndContactList;
+ HWND hWndClui = g_clistApi.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 == g_CLI.hwndContactList) {
+ if (hWnd == g_clistApi.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(g_CLI.hwndContactList);
+ BOOL fWasVisible = IsWindowVisible(g_clistApi.hwndContactList);
if (fWasVisible)
- ShowWindow(g_CLI.hwndContactList, SW_HIDE);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
//change layered mode
- LONG_PTR exStyle = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
+ LONG_PTR exStyle = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE);
if (tLayeredFlag)
exStyle |= WS_EX_LAYERED;
else
exStyle &= ~WS_EX_LAYERED;
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, exStyle&~WS_EX_LAYERED);
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, exStyle);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, exStyle&~WS_EX_LAYERED);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, exStyle);
g_CluiData.fLayered = tLayeredFlag;
- Sync(CLUIFrames_SetLayeredMode, tLayeredFlag, g_CLI.hwndContactList);
+ Sync(CLUIFrames_SetLayeredMode, tLayeredFlag, g_clistApi.hwndContactList);
CLUI_ChangeWindowMode();
Sync(CLUIFrames_OnClistResize_mod, 0, 0);
if (fWasVisible)
- ShowWindow(g_CLI.hwndContactList, SW_SHOW);
+ ShowWindow(g_clistApi.hwndContactList, SW_SHOW);
}
}
@@ -594,7 +594,7 @@ void CLUI_UpdateAeroGlass()
bb.dwFlags |= DWM_BB_BLURREGION;
}
- g_proc_DWMEnableBlurBehindWindow(g_CLI.hwndContactList, &bb);
+ g_proc_DWMEnableBlurBehindWindow(g_clistApi.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 (!g_CLI.hwndContactList) return;
+ if (!g_clistApi.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(g_CLI.hwndContactList, titleText);
+ SetWindowText(g_clistApi.hwndContactList, titleText);
// < ->
// 1 - If visible store it and hide
if (g_CluiData.fLayered && (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT))) {
- SetParent(g_CLI.hwndContactList, nullptr);
+ SetParent(g_clistApi.hwndContactList, nullptr);
Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
- UpdateWindow(g_CLI.hwndContactList);
+ UpdateWindow(g_clistApi.hwndContactList);
g_CluiData.fOnDesktop = false;
}
// 5 - TODO Apply Style
- oldStyleEx = curStyleEx = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
- oldStyle = curStyle = GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE);
+ oldStyleEx = curStyleEx = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE);
+ oldStyle = curStyle = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE);
curStyleEx = (curStyleEx & ~styleMaskEx) | styleEx;
curStyle = (curStyle & ~styleMask) | style;
if (oldStyleEx != curStyleEx || oldStyle != curStyle) {
- if (IsWindowVisible(g_CLI.hwndContactList)) {
+ if (IsWindowVisible(g_clistApi.hwndContactList)) {
storedVisMode = TRUE;
mutex_bShowHideCalledFromAnimation = TRUE;
- ShowWindow(g_CLI.hwndContactList, SW_HIDE);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
Sync(CLUIFrames_OnShowHide, 0);
}
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, curStyleEx);
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, curStyle);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, curStyleEx);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE, curStyle);
}
CLUI_UpdateAeroGlass();
if (g_CluiData.fLayered || !db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT)) {
- SetMenu(g_CLI.hwndContactList, nullptr);
+ SetMenu(g_clistApi.hwndContactList, nullptr);
}
- else SetMenu(g_CLI.hwndContactList, g_hMenuMain);
+ else SetMenu(g_clistApi.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(g_CLI.hwndContactList, hProgMan);
+ SetParent(g_clistApi.hwndContactList, hProgMan);
Sync(CLUIFrames_SetParentForContainers, (HWND)hProgMan);
g_CluiData.fOnDesktop = true;
}
}
else {
- SetParent(g_CLI.hwndContactList, nullptr);
+ SetParent(g_clistApi.hwndContactList, nullptr);
Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
g_CluiData.fOnDesktop = false;
}
// 7 - if it was visible - show
if (storedVisMode) {
- ShowWindow(g_CLI.hwndContactList, SW_SHOW);
+ ShowWindow(g_clistApi.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(g_CLI.hwndContactList, &r);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactList, hRgn1, 1);
+ SetWindowRgn(g_clistApi.hwndContactList, hRgn1, 1);
else {
DeleteObject(hRgn1);
- SetWindowRgn(g_CLI.hwndContactList, nullptr, 1);
+ SetWindowRgn(g_clistApi.hwndContactList, nullptr, 1);
}
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(g_clistApi.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(g_CLI.hwndContactList, TM_BRINGOUTTIMEOUT);
- CLUI_SafeSetTimer(g_CLI.hwndContactList, TM_BRINGOUTTIMEOUT, wBehindEdgeHideDelay * 100, nullptr);
+ KillTimer(g_clistApi.hwndContactList, TM_BRINGOUTTIMEOUT);
+ CLUI_SafeSetTimer(g_clistApi.hwndContactList, TM_BRINGOUTTIMEOUT, wBehindEdgeHideDelay * 100, nullptr);
}
if (bShowEventStarted == 0 && g_CluiData.nBehindEdgeState > 0) {
- KillTimer(g_CLI.hwndContactList, TM_BRINGINTIMEOUT);
- bShowEventStarted = (BOOL)CLUI_SafeSetTimer(g_CLI.hwndContactList, TM_BRINGINTIMEOUT, wBehindEdgeShowDelay * 100, nullptr);
+ KillTimer(g_clistApi.hwndContactList, TM_BRINGINTIMEOUT);
+ bShowEventStarted = (BOOL)CLUI_SafeSetTimer(g_clistApi.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(g_CLI.hwndContactList, &rcScreen);
+ Docking_GetMonitorRectFromWindow(g_clistApi.hwndContactList, &rcScreen);
//SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen,FALSE);
//2. move out
int bordersize = wBehindEdgeBorderSize;
- GetWindowRect(g_CLI.hwndContactList, &rcWindow);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactList, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
- Sync(CLUIFrames_OnMoving, g_CLI.hwndContactList, &rcWindow);
+ SetWindowPos(g_clistApi.hwndContactList, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
+ Sync(CLUIFrames_OnMoving, g_clistApi.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(g_CLI.hwndContactList, &rcScreen);
+ Docking_GetMonitorRectFromWindow(g_clistApi.hwndContactList, &rcScreen);
// 2. move out
RECT rcWindow;
- GetWindowRect(g_CLI.hwndContactList, &rcWindow);
+ GetWindowRect(g_clistApi.hwndContactList, &rcWindow);
switch (method) {
case 1: // left
rcWindow.left = rcScreen.left;
@@ -839,8 +839,8 @@ int CLUI_ShowFromBehindEdge()
break;
}
g_CluiData.mutexPreventDockMoving = 0;
- SetWindowPos(g_CLI.hwndContactList, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
- Sync(CLUIFrames_OnMoving, g_CLI.hwndContactList, &rcWindow);
+ SetWindowPos(g_clistApi.hwndContactList, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
+ Sync(CLUIFrames_OnMoving, g_clistApi.hwndContactList, &rcWindow);
g_CluiData.mutexPreventDockMoving = 1;
// 3. store setting
@@ -852,8 +852,8 @@ int CLUI_ShowFromBehindEdge()
int CLUI_IsInMainWindow(HWND hwnd)
{
- if (hwnd == g_CLI.hwndContactList) return 1;
- if (GetParent(hwnd) == g_CLI.hwndContactList) return 2;
+ if (hwnd == g_clistApi.hwndContactList) return 1;
+ if (GetParent(hwnd) == g_clistApi.hwndContactList) return 2;
return 0;
}
@@ -975,7 +975,7 @@ static bool StartTicksTimer(PROTOTICKS *pt)
DestroyIcon(ic);
}
}
- CLUI_SafeSetTimer(g_CLI.hwndContactList, TM_STATUSBARUPDATE + pt->nIndex, nAnimatedIconStep, nullptr);
+ CLUI_SafeSetTimer(g_clistApi.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(g_CLI.hwndContactList, TM_UPDATEBRINGTIMER);
+ KillTimer(g_clistApi.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(g_CLI.hwndContactList, WM_THEMECHANGED, 0, 0);
+ BroadCastMessageToChild(g_clistApi.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(g_CLI.hwndContactTree, 0);
+ ClcData *dat = (ClcData*)GetWindowLongPtr(g_clistApi.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(g_CLI.hwndContactList, &rc);
+ GetWindowRect(g_clistApi.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 == g_CLI.hwndContactList)
+ if (mutex_bDuringSizing && hwnd == g_clistApi.hwndContactList)
*rc = rcSizingRect;
else
GetWindowRect(hwnd, rc);
@@ -1208,7 +1208,7 @@ int CLUI_IconsChanged(WPARAM, LPARAM)
if (MirandaExiting())
return 0;
- DrawMenuBar(g_CLI.hwndContactList);
+ DrawMenuBar(g_clistApi.hwndContactList);
ExtraIcon_Reload();
ExtraIcon_SetAll();
@@ -1236,7 +1236,7 @@ void CLUI_cli_LoadCluiGlobalOpts()
int CLUI_TestCursorOnBorders()
{
- HWND hwnd = g_CLI.hwndContactList;
+ HWND hwnd = g_clistApi.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 = g_CLI.hwndContactList;
+ HWND hwnd = g_clistApi.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(g_CLI.hwndContactList, 0);
+ CLUI_ShowWindowMod(g_clistApi.hwndContactList, 0);
Sync(CLUIFrames_OnShowHide, 0);
mutex_bShowHideCalledFromAnimation = 0;
g_CluiData.bCurrentAlpha = 0;
- if (!g_CluiData.fLayered) RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_ERASE | RDW_FRAME);
+ if (!g_CluiData.fLayered) RedrawWindow(g_clistApi.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(g_CLI.hwndContactList, SW_RESTORE);
+ CLUI_ShowWindowMod(g_clistApi.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(g_CLI.hwndContactList, 0);
+ CLUI_ShowWindowMod(g_clistApi.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(g_CLI.hwndContactList, SW_SHOWNA);
+ CLUI_ShowWindowMod(g_clistApi.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, g_CLI.hwndContactList);
+ g_hSmoothAnimationThread = mir_forkthread(CLUI_SmoothAnimationThreadProc, g_clistApi.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(g_CLI.hwndContactList, 0);
+ CLUI_ShowWindowMod(g_clistApi.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(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.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 (g_CLI.hwndContactList == nullptr)
+ if (g_clistApi.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(g_CLI.hwndContactTree);
+ Clist_InitAutoRebuild(g_clistApi.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(g_CLI.hwndContactTree);
+ SetFocus(g_clistApi.hwndContactTree);
return FALSE;
}
@@ -1959,14 +1959,14 @@ LRESULT CLUI::OnStatusBarUpdateTimer(UINT msg, WPARAM wParam, LPARAM lParam)
PROTOTICKS *pt = &arTicks[wParam - TM_STATUSBARUPDATE];
- if (IsWindowVisible(g_CLI.hwndStatus))
- g_CLI.pfnInvalidateRect(g_CLI.hwndStatus, nullptr, 0);
+ if (IsWindowVisible(g_clistApi.hwndStatus))
+ g_clistApi.pfnInvalidateRect(g_clistApi.hwndStatus, nullptr, 0);
if (pt->bGlobal)
Clist_TrayIconUpdateBase(g_szConnectingProto);
else
Clist_TrayIconUpdateBase(pt->szProto);
- g_CLI.pfnInvalidateRect(g_CLI.hwndStatus, nullptr, TRUE);
+ g_clistApi.pfnInvalidateRect(g_clistApi.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() == g_CLI.hwndContactList);
+ inwnd = (GetCapture() == g_clistApi.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 (!g_CLI.hwndStatus)
+ if (!g_clistApi.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(g_CLI.hwndContactTree, WM_ACTIVATE, wParam, lParam);
+ SendMessage(g_clistApi.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 g_CLI.pfnShowHide();
+ return g_clistApi.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(g_CLI.hwndContactTree);
+ Clist_InitAutoRebuild(g_clistApi.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 || g_CLI.hwndContactTree == nullptr || Clist_IsDocked())
+ if (!g_CluiData.fAutoSize || g_clistApi.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(g_CLI.hwndContactTree, &rcTree);
+ GetWindowRect(g_clistApi.hwndContactTree, &rcTree);
- FRAMEWND *frm = FindFrameByItsHWND(g_CLI.hwndContactTree);
+ FRAMEWND *frm = FindFrameByItsHWND(g_clistApi.hwndContactTree);
if (frm)
rcTree2 = frm->wndSize;
else
SetRect(&rcTree2, 0, 0, 0, 0);
- winstyle = GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE);
+ winstyle = GetWindowLongPtr(g_clistApi.hwndContactTree, GWL_STYLE);
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
- HMONITOR hMon = MonitorFromWindow(g_CLI.hwndContactTree, MONITOR_DEFAULTTONEAREST);
+ HMONITOR hMon = MonitorFromWindow(g_clistApi.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(g_CLI.hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(pnmc->pt.x, pnmc->pt.y));
+ HANDLE hItem = (HANDLE)SendMessage(g_clistApi.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(g_CLI.hwndContactTree, &pt);
+ ClientToScreen(g_clistApi.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(g_CLI.hwndContactTree, pnmc->pt.y);
+ return ClcEnterDragToScroll(g_clistApi.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 != g_CLI.hwndContactTree)
+ if (pnmhdr->hwndFrom != g_clistApi.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(g_CLI.hwndContactTree, &rc);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactTree, 0);
+ ClcData *dat = (ClcData*)GetWindowLongPtr(g_clistApi.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;
- g_CLI.pfnInvalidateRect(m_hWnd, nullptr, 0);
+ g_clistApi.pfnInvalidateRect(m_hWnd, nullptr, 0);
}
return TRUE;
}
@@ -2469,7 +2469,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM, LPARAM lParam)
}
else {
nStatusMenuState = dis->itemState;
- g_CLI.pfnInvalidateRect(m_hWnd, nullptr, 0);
+ g_clistApi.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");
- g_CLI.hwndContactTree = nullptr;
- g_CLI.hwndStatus = nullptr;
+ g_clistApi.hwndContactTree = nullptr;
+ g_clistApi.hwndStatus = nullptr;
if (g_CluiData.fAutoSize && !g_CluiData.fDocked) {
RECT r;
- GetWindowRect(g_CLI.hwndContactList, &r);
+ GetWindowRect(g_clistApi.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;
- g_CLI.hwndContactList = nullptr;
- g_CLI.hwndStatus = nullptr;
+ g_clistApi.hwndContactList = nullptr;
+ g_clistApi.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 ee7f240b9a..2162a9f3fe 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)g_CLI.hwndStatus, 0);
+ CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)g_clistApi.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 f917ed3470..b44777478a 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 g_CLI.pfnSetHideOffline(-1);
+ return g_clistApi.pfnSetHideOffline(-1);
}
INT_PTR SetUseGroups(WPARAM wParam, LPARAM)
{
- int newVal = !(GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE)&CLS_USEGROUPS);
+ int newVal = !(GetWindowLongPtr(g_clistApi.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(g_CLI.hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
+ SendMessage(g_clistApi.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 890609c861..8ec9b2ea0a 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 (!g_CLI.hwndContactTree)
+ if (!g_clistApi.hwndContactTree)
return 0;
ClcCacheEntry *pdnce = contact->pce;
- if (dat->hWnd != g_CLI.hwndContactTree || !gl_RowRoot || contact->type == CLCIT_GROUP) {
+ if (dat->hWnd != g_clistApi.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 77b9eeab7c..6884fbbbe6 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 (g_CLI.hwndContactList && Buttons[i].hwnd != nullptr) {
+ if (g_clistApi.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 (g_CLI.hwndContactList && Buttons[i].hwnd == nullptr)
- Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct, g_CLI.hwndContactList);
+ if (g_clistApi.hwndContactList && Buttons[i].hwnd == nullptr)
+ Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct, g_clistApi.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 ae772c97eb..f9d925d662 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(g_CLI.hwndContactList, nullptr, nullptr, RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME);
+ else RedrawWindow(g_clistApi.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(g_CLI.hwndContactList, &wnd);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactList, UM_UPDATE, 0, 0)) {
+ if (PostMessage(g_clistApi.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(g_CLI.hwndContactList, &wnd);
+ CLUI_SizingGetWindowRect(g_clistApi.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(g_CLI.hwndContactList, &ptMainWnd);
+ ClientToScreen(g_clistApi.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(g_CLI.hwndContactList, &wnd);
+ GetClientRect(g_clistApi.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(g_CLI.hwndContactList, &w);
+ else CLUI_SizingGetWindowRect(g_clistApi.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(g_CLI.hwndContactList, &wnd);
+ else GetWindowRect(g_clistApi.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(g_CLI.hwndContactList, &r);
+ GetWindowRect(g_clistApi.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 = g_CLI.hwndContactList;
+ HWND hwnd = g_clistApi.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(g_CLI.hwndContactList, &r);
+ GetWindowRect(g_clistApi.hwndContactList, &r);
return ske_JustUpdateWindowImageRect(&r);
}
@@ -3226,7 +3226,7 @@ int ske_JustUpdateWindowImageRect(RECT *rty)
ske_ApplyTranslucency();
return 0;
}
- if (!g_CLI.hwndContactList)
+ if (!g_clistApi.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(g_CLI.hwndContactList, GWL_EXSTYLE)&WS_EX_LAYERED))
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ if (!(GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE)&WS_EX_LAYERED))
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
Sync(SetAlpha, g_CluiData.bCurrentAlpha);
BLENDFUNCTION bf = { AC_SRC_OVER, 0, g_CluiData.bCurrentAlpha, AC_SRC_ALPHA };
- UpdateLayeredWindow(g_CLI.hwndContactList, g_pCachedWindow->hScreenDC, &dest, &sz, g_pCachedWindow->hImageDC, &src, RGB(1, 1, 1), &bf, ULW_ALPHA);
+ UpdateLayeredWindow(g_clistApi.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(g_CLI.hwndContactList, nullptr, TRUE);
+ else InvalidateRect(g_clistApi.hwndContactList, nullptr, TRUE);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index 2d8c4e6e61..bfd20fc48b 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(g_CLI.hwndContactList, &rc);
- Sync(CLUIFrames_OnMoving, g_CLI.hwndContactList, &rc);
+ GetWindowRect(g_clistApi.hwndContactList, &rc);
+ Sync(CLUIFrames_OnMoving, g_clistApi.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(g_CLI.hwndContactTree), nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);
+ RedrawWindow(GetParent(g_clistApi.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 = g_CLI.hwndContactList;
+ HWND hwnd = g_clistApi.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(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_clistApi.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 1fb12dc80e..3c167fd430 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(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);
+ return ModernSkinButton_AddButton(g_clistApi.hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateW(Hint), Section, Type, MinWidth, MinHeight);
+ return ModernSkinButton_AddButton(g_clistApi.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 2927dbf7cc..8f74e844d5 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 (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SETFRAMEPAINTPROC, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SETFRAMEPAINTPROC, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_AddFrame(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_ADDFRAME, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_ADDFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_RemoveFrame(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_REMOVEFRAME, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_REMOVEFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_SetFrameOptions(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SETFRAMEOPTIONS, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SETFRAMEOPTIONS, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_GetFrameOptions(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_GETFRAMEOPTIONS, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_GETFRAMEOPTIONS, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_UpdateFrame(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_UPDATEFRAME, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_UPDATEFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_ShowHideFrameTitle(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SHOWHIDEFRAMETITLE, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SHOWHIDEFRAMETITLE, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_ShowTitles(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SHOWTITLES, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SHOWTITLES, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_HideTitles(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_HIDETITLES, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_HIDETITLES, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_ShowHideFrame(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SHOWHIDEFRAME, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SHOWHIDEFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_ShowAllFrames(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SHOWALL, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SHOWALL, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_LockFrame(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_LOCKFRAME, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_LOCKFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_CollapseFrame(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_COLLAPSEFRAME, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_COLLAPSEFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_SetFrameBorder(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SETFRAMEBORDER, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SETFRAMEBORDER, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_SetFrameAlign(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SETFRAMEALIGN, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SETFRAMEALIGN, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_MoveFrame(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_MOVEFRAME, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_MOVEFRAME, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_MoveFrameUp(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_MOVEFRAMEUP, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_MOVEFRAMEUP, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_MoveFrameDown(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_MOVEFRAMEDOWN, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_MOVEFRAMEDOWN, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_AlignFrameTop(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_ALIGNFRAMETOP, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_ALIGNFRAMETOP, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_AlignFrameClient(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_ALIGNFRAMEBOTTOM, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_ALIGNFRAMEBOTTOM, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_AlignFrameBottom(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_ALIGNFRAMECLIENT, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_ALIGNFRAMECLIENT, wParam, lParam) : 0;
}
static INT_PTR CLUIFrames_SetFrameFloat(WPARAM wParam, LPARAM lParam)
{
- return (g_CLI.hwndContactList) ? SendMessage(g_CLI.hwndContactList, CFM_SETFRAMEFLOAT, wParam, lParam) : 0;
+ return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.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 8c710bb358..4d40efc5ad 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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.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) == g_CLI.hwndContactList)
+ if (GetParent(hwnd) == g_clistApi.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) != g_CLI.hwndContactList)
+ if (!g_CluiData.fLayered || GetParent(hwnd) != g_clistApi.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) == g_CLI.hwndContactList && g_CluiData.fLayered)
+ if (GetParent(hwnd) == g_clistApi.hwndContactList && g_CluiData.fLayered)
CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)hwnd, 0);
- else if (GetParent(hwnd) == g_CLI.hwndContactList && !g_CluiData.fLayered) {
+ else if (GetParent(hwnd) == g_clistApi.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 != g_CLI.hwndContactList) parent = GetParent(parent);
+ if (parent != g_clistApi.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 c7177719cb..93745e6aa2 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);
- g_CLI.pfnInvalidateRect(GetParent(GetParent(hwndDlg)), nullptr, TRUE);
+ g_clistApi.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 be5af7037b..4baf61d193 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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
return 0;
}
static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT *rect, ModernToolbarCtrl* pMTBInfo)
{
- BOOL bFloat = (GetParent(hwnd) != g_CLI.hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != g_clistApi.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) != g_CLI.hwndContactList) {
+ if (GetParent(hwnd) != g_clistApi.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) != g_CLI.hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != g_clistApi.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)
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 2f3567f6f8..a94709dc67 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) == g_CLI.hwndContactList && g_CluiData.fLayered)
+ if (GetParent(hwnd) == g_clistApi.hwndContactList && g_CluiData.fLayered)
ValidateRect(hwnd, nullptr);
- else if (GetParent(hwnd) != g_CLI.hwndContactList || !g_CluiData.fLayered) {
+ else if (GetParent(hwnd) != g_clistApi.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) != g_CLI.hwndContactList) {
+ if (GetParent(hwnd) != g_clistApi.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)
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
return 0;
case WM_TIMER:
if (wParam == TIMERID_VIEWMODEEXPIRE) {
RECT rcCLUI;
- GetWindowRect(g_CLI.hwndContactList, &rcCLUI);
+ GetWindowRect(g_clistApi.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) != g_CLI.hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != g_clistApi.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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_clistApi.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, g_CLI.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_clistApi.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)
- g_CLI.pfnSetHideOffline(g_CluiData.boldHideOffline);
+ g_clistApi.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);
- g_CLI.pfnSetHideOffline(false);
+ g_clistApi.pfnSetHideOffline(false);
}
else if (g_CluiData.boldHideOffline != (BYTE)-1) {
- g_CLI.pfnSetHideOffline(g_CluiData.boldHideOffline);
+ g_clistApi.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(g_CLI.hwndStatus, nullptr, FALSE);
+ cliInvalidateRect(g_clistApi.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 ea251eda52..4fcc9f8c71 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(g_CLI.hwndContactList, &pt);
+ ScreenToClient(g_clistApi.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(g_CLI.hwndContactList, &pt);
+ ScreenToClient(g_clistApi.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(g_CLI.hwndContactList, &pt);
+ ScreenToClient(g_clistApi.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(g_CLI.hwndContactList, WM_NCHITTEST, wParam, lParam)) {
+ switch (SendMessage(g_clistApi.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(g_CLI.hwndContactList, msg, MAKELONG(iCtrlId, BN_CLICKED), lParam);
+ SendMessage(g_clistApi.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 74a71b83a0..cbc7fe3c7f 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(g_CLI.hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
+ SendMessage(g_clistApi.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(g_CLI.hwndContactTree, INTM_STATUSCHANGED, hContact, lParam);
+ SendMessage(g_clistApi.hwndContactTree, INTM_STATUSCHANGED, hContact, lParam);
return 0;
}
if (strstr("YMsg|StatusDescr|XStatusMsg", cws->szSetting))
- SendMessage(g_CLI.hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
+ SendMessage(g_clistApi.hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
else if (strstr(cws->szSetting, "XStatus"))
- SendMessage(g_CLI.hwndContactTree, INTM_XSTATUSCHANGED, hContact, lParam);
+ SendMessage(g_clistApi.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);
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.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)) {
- g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_clistApi.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 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_clistApi.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
- g_CLI.pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
+ g_clistApi.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 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_clistApi.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 = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_clistApi.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)
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.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);
- g_CLI.pfnInvalidateDisplayNameCacheEntry(wParam);
+ g_clistApi.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) {
- g_CLI.pfnSortCLC(hwnd, dat, TRUE);
+ g_clistApi.pfnSortCLC(hwnd, dat, TRUE);
dat->bNeedsResort = false;
}
if (lParam)
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.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 = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
+ dat->selection = g_clistApi.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, g_CLI.hwndContactList, nullptr);
+ TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_clistApi.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 24c4429dee..d415dfb92d 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 && g_CLI.hwndContactTree) {
+ if (hContact && g_clistApi.hwndContactTree) {
TExtraCache *p = cfg::getCache(hContact, nullptr);
if (p) {
TZ_LoadTimeZone(hContact, p);
- InvalidateRect(g_CLI.hwndContactTree, nullptr, FALSE);
+ InvalidateRect(g_clistApi.hwndContactTree, nullptr, FALSE);
}
}
}
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp
index ed44db113f..2268822a7c 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(g_CLI.hwndContactTree, TIMERID_REFRESH);
+ KillTimer(g_clistApi.hwndContactTree, TIMERID_REFRESH);
if (cfg::dat.bShowLocalTime)
- SetTimer(g_CLI.hwndContactTree, TIMERID_REFRESH, 65000, nullptr);
+ SetTimer(g_clistApi.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(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_clistApi.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(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_clistApi.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 2872e69e22..6ad33b5da5 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 = g_CLI.pfnGetRowByIndex(dat, hit, &hitcontact, &hitgroup);
+ hit = g_clistApi.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 = g_CLI.pfnGetRowTotalHeight(dat) - 1;
+ si.nMax = g_clistApi.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 = g_CLI.pfnGetGroupContentsCount(group, 1);
+ contentCount = g_clistApi.pfnGetGroupContentsCount(group, 1);
- groupy = g_CLI.pfnGetRowsPriorTo(&dat->list, group, -1);
+ groupy = g_clistApi.pfnGetRowsPriorTo(&dat->list, group, -1);
if (dat->selection > groupy && dat->selection < groupy + contentCount) dat->selection = groupy;
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.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 = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, &group);
+ dat->selection = g_clistApi.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(g_CLI.hwndContactList);
+ HDC hdcThis = GetDC(g_clistApi.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(g_CLI.hwndContactList, hdcThis);
+ ReleaseDC(g_clistApi.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(g_CLI.hwndContactList);
+ HDC hdcThis = GetDC(g_clistApi.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(g_CLI.hwndContactList, hdcThis);
+ ReleaseDC(g_clistApi.hwndContactList, hdcThis);
}
}
}
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp
index 9dce2f7897..715fab58d4 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 : *g_CLI.events)
+ for (auto &p : *g_clistApi.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)
- g_CLI.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ g_clistApi.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
}
}
}
@@ -289,14 +289,14 @@ CListEvent* AddEvent(CLISTEVENT *cle)
}
if (cfg::dat.dwFlags & CLUI_STICKYEVENTS) {
- HANDLE hItem = (HANDLE)SendMessage(g_CLI.hwndContactTree, CLM_FINDCONTACT, (WPARAM)p->hContact, 0);
+ HANDLE hItem = (HANDLE)SendMessage(g_clistApi.hwndContactTree, CLM_FINDCONTACT, (WPARAM)p->hContact, 0);
if (hItem) {
- SendMessage(g_CLI.hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 1);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 1);
Clist_Broadcast(INTM_PROTOCHANGED, (WPARAM)p->hContact, 0);
}
}
- if (g_CLI.events->getCount() > 0) {
+ if (g_clistApi.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 : *g_CLI.events)
+ for (auto &it : *g_clistApi.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 (g_CLI.events->getCount() == 0) {
+ if (g_clistApi.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(g_CLI.hwndContactTree, CLM_FINDCONTACT, hContact, 0);
+ HANDLE hItem = (HANDLE)SendMessage(g_clistApi.hwndContactTree, CLM_FINDCONTACT, hContact, 0);
if (hItem) {
- SendMessage(g_CLI.hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 0);
+ SendMessage(g_clistApi.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 c934abf440..28a8555f09 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(g_CLI.hwndContactList);
+ DestroyWindow(g_clistApi.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(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
+ Clist_FindItem(g_clistApi.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(g_CLI.hwndContactTree, CLM_TOGGLEPRIORITYCONTACT, hContact, 0);
+ SendMessage(g_clistApi.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(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
+ Clist_FindItem(g_clistApi.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(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(g_clistApi.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(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(g_clistApi.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 409a88fbfc..c3adad09c8 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 ? g_CLI.currentDesiredStatusMode : g_maxStatus);
+ return(g_maxStatus == ID_STATUS_OFFLINE ? g_clistApi.currentDesiredStatusMode : g_maxStatus);
}
int IconFromStatusMode(const char *szProto, int status, MCONTACT hContact)
@@ -166,10 +166,10 @@ int ShowHide()
{
BOOL bShow = FALSE;
- int iVisibleState = g_CLI.pfnGetWindowVisibleState(g_CLI.hwndContactList, 0, 0);
+ int iVisibleState = g_clistApi.pfnGetWindowVisibleState(g_clistApi.hwndContactList, 0, 0);
- if (IsIconic(g_CLI.hwndContactList)) {
- SendMessage(g_CLI.hwndContactList, WM_SYSCOMMAND, SC_RESTORE, 0);
+ if (IsIconic(g_clistApi.hwndContactList)) {
+ SendMessage(g_clistApi.hwndContactList, WM_SYSCOMMAND, SC_RESTORE, 0);
bShow = TRUE;
}
else {
@@ -193,22 +193,22 @@ int ShowHide()
if (bShow == TRUE) {
RECT rcWindow;
- SetWindowPos(g_CLI.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
+ SetWindowPos(g_clistApi.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(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);
+ SetWindowPos(g_clistApi.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
+ SetForegroundWindow(g_clistApi.hwndContactList);
+ //SetActiveWindow(g_clistApi.hwndContactList);
+ ShowWindow(g_clistApi.hwndContactList, SW_SHOW);
db_set_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
- GetWindowRect(g_CLI.hwndContactList, &rcWindow);
+ GetWindowRect(g_clistApi.hwndContactList, &rcWindow);
if (Utils_AssertInsideScreen(&rcWindow) == 1) {
- MoveWindow(g_CLI.hwndContactList, rcWindow.left, rcWindow.top,
+ MoveWindow(g_clistApi.hwndContactList, rcWindow.left, rcWindow.top,
rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE);
}
}
else { //It needs to be hidden
- ShowWindow(g_CLI.hwndContactList, SW_HIDE);
+ ShowWindow(g_clistApi.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 2c8ffaab60..36296161fd 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(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
- SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.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(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_clistApi.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 7b2c55bac8..7808194e02 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(g_CLI.hwndContactTree, CLM_GETSTATUSMSG, wParam, lParam);
+ return SendMessage(g_clistApi.hwndContactTree, CLM_GETSTATUSMSG, wParam, lParam);
return 0;
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index e5ec38b3c6..4d08b64480 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(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(g_CLI.hwndContactList, clr, 0, LWA_COLORKEY);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_clistApi.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(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(g_clistApi.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)
{
- g_CLI.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
+ g_clistApi.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(g_CLI.hwndContactTree, 0);
- return g_CLI.hwndContactTree;
+ cfg::clcdat = (struct ClcData *)GetWindowLongPtr(g_clistApi.hwndContactTree, 0);
+ return g_clistApi.hwndContactTree;
}
// create internal frames, including the last frame (actual CLC control)
static int CreateCLC()
{
ExtraIcon_Reload();
- g_CLI.pfnSetHideOffline(oldhideoffline);
+ g_clistApi.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, g_CLI.hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr);
+ frame.hWnd = CreateWindowExA(0, "EventAreaClass", "evt", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, g_clistApi.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 = g_CLI.hwndContactTree;
+ Frame.hWnd = g_clistApi.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(g_CLI.hwndStatus, WM_SIZE, 0, 0);
- GetWindowRect(g_CLI.hwndStatus, &rcStatus);
+ SendMessage(g_clistApi.hwndStatus, WM_SIZE, 0, 0);
+ GetWindowRect(g_clistApi.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) {
- g_CLI.pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr);
+ g_clistApi.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(g_CLI.hwndContactTree, &rcTree);
- winstyle = GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE);
+ GetWindowRect(g_clistApi.hwndContactTree, &rcTree);
+ winstyle = GetWindowLongPtr(g_clistApi.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(g_CLI.hwndContactTree, &rc);
+ GetWindowRect(g_clistApi.hwndContactTree, &rc);
POINT pt;
pt.x = rc.left;
pt.y = rc.top;
- ScreenToClient(g_CLI.hwndContactList, &pt);
+ ScreenToClient(g_clistApi.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(g_CLI.hwndContactList, nullptr);
+ SetMenu(g_clistApi.hwndContactList, nullptr);
if (state == SETTING_STATE_NORMAL) {
- SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
- ShowWindow(g_CLI.hwndContactList, SW_SHOWNORMAL);
- SendMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
+ ShowWindow(g_clistApi.hwndContactList, SW_SHOWNORMAL);
+ SendMessage(g_clistApi.hwndContactList, CLUIINTM_REDRAW, 0, 0);
}
else if (state == SETTING_STATE_MINIMIZED) {
cfg::dat.forceResize = TRUE;
- ShowWindow(g_CLI.hwndContactList, SW_HIDE);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
}
else if (state == SETTING_STATE_HIDDEN) {
cfg::dat.forceResize = TRUE;
- ShowWindow(g_CLI.hwndContactList, SW_HIDE);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
}
- SetWindowPos(g_CLI.hwndContactList, onTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOSENDCHANGING);
+ SetWindowPos(g_clistApi.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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
- SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.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;
- g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, g_plugin.getInst(), nullptr);
+ g_clistApi.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, g_plugin.getInst(), nullptr);
if (flags & WS_VISIBLE) {
- ShowWindow(g_CLI.hwndStatus, SW_SHOW);
- SendMessage(g_CLI.hwndStatus, WM_SIZE, 0, 0);
+ ShowWindow(g_clistApi.hwndStatus, SW_SHOW);
+ SendMessage(g_clistApi.hwndStatus, WM_SIZE, 0, 0);
}
- mir_subclassWindow(g_CLI.hwndStatus, NewStatusBarWndProc);
- SetClassLong(g_CLI.hwndStatus, GCL_STYLE, GetClassLong(g_CLI.hwndStatus, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW));
+ mir_subclassWindow(g_clistApi.hwndStatus, NewStatusBarWndProc);
+ SetClassLong(g_clistApi.hwndStatus, GCL_STYLE, GetClassLong(g_clistApi.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(g_CLI.hwndContactList, SW_HIDE);
- style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
+ style = GetWindowLongPtr(g_clistApi.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(g_CLI.hwndContactList, GWL_EXSTYLE, style);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, style);
ApplyCLUIBorderStyle();
- SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE);
+ SetWindowPos(g_clistApi.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(g_CLI.hwndContactTree, 0);
+ cfg::clcdat = (struct ClcData *)GetWindowLongPtr(g_clistApi.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(g_CLI.hwndContactTree, cfg::clcdat);
+ RecalcScrollBar(g_clistApi.hwndContactTree, cfg::clcdat);
}
return 0;
}
@@ -1044,7 +1044,7 @@ skipbg:
break;
case WM_WINDOWPOSCHANGING:
- if (g_CLI.hwndContactList != nullptr) {
+ if (g_clistApi.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(g_CLI.hwndStatus, nullptr, 0, new_window_rect.bottom - 20, new_window_rect.right, 20, SWP_NOZORDER);
- GetWindowRect(g_CLI.hwndStatus, &rcStatus);
+ SetWindowPos(g_clistApi.hwndStatus, nullptr, 0, new_window_rect.bottom - 20, new_window_rect.right, 20, SWP_NOZORDER);
+ GetWindowRect(g_clistApi.hwndStatus, &rcStatus);
cfg::dat.statusBarHeight = (rcStatus.bottom - rcStatus.top);
if (wp->cx != g_oldSize.cx)
SendMessage(hwnd, CLUIINTM_STATUSBARUPDATE, 0, 0);
- RedrawWindow(g_CLI.hwndStatus, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
+ RedrawWindow(g_clistApi.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 (g_CLI.hwndContactList != nullptr) {
+ if (g_clistApi.hwndContactList != nullptr) {
SendMessage(hwnd, WM_ENTERSIZEMOVE, 0, 0);
GetWindowRect(hwnd, &rc);
WINDOWPOS wp = {};
@@ -1127,7 +1127,7 @@ skipbg:
return TRUE;
case WM_SETFOCUS:
- SetFocus(g_CLI.hwndContactTree);
+ SetFocus(g_clistApi.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(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);
+ SetWindowPos(g_clistApi.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;
}
- g_CLI.pfnShowHide();
+ g_clistApi.pfnShowHide();
return 0;
}
if (wParam == SC_RESTORE) {
- g_CLI.pfnShowHide();
+ g_clistApi.pfnShowHide();
return 0;
}
}
@@ -1334,7 +1334,7 @@ skipbg:
int serviceFailure = FALSE;
if (cfg::clcdat) {
- g_CLI.pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr);
+ g_clistApi.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:
- g_CLI.pfnShowHide();
+ g_clistApi.pfnShowHide();
break;
case POPUP_NEWGROUP:
- SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
- SendMessage(g_CLI.hwndContactTree, CLM_SETUSEGROUPS, 1, 0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETUSEGROUPS, 1, 0);
Clist_GroupCreate(NULL, nullptr);
break;
case POPUP_HIDEOFFLINE:
case IDC_TBHIDEOFFLINE:
case IDC_STBHIDEOFFLINE:
- g_CLI.pfnSetHideOffline(-1);
+ g_clistApi.pfnSetHideOffline(-1);
break;
case POPUP_HIDEOFFLINEROOT:
CallService(MS_CLIST_TOGGLEHIDEOFFLINEROOT, 0, 0);
@@ -1508,11 +1508,11 @@ buttons_done:
SetButtonStates();
break;
case POPUP_HIDEMIRANDA:
- g_CLI.pfnShowHide();
+ g_clistApi.pfnShowHide();
break;
case POPUP_SHOWMETAICONS:
cfg::dat.dwFlags ^= CLUI_USEMETAICONS;
- Clist_InitAutoRebuild(g_CLI.hwndContactTree);
+ Clist_InitAutoRebuild(g_clistApi.hwndContactTree);
break;
case POPUP_FRAME:
cfg::dat.dwFlags ^= CLUI_FRAME_CLISTSUNKEN;
@@ -1525,15 +1525,15 @@ buttons_done:
break;
}
if (dwOldFlags != cfg::dat.dwFlags) {
- InvalidateRect(g_CLI.hwndContactTree, nullptr, FALSE);
+ InvalidateRect(g_clistApi.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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
- PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_clistApi.hwndContactList, CLUIINTM_REDRAW, 0, 0);
}
}
return FALSE;
@@ -1547,11 +1547,11 @@ buttons_done:
break;
case WM_DISPLAYCHANGE:
- SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_clistApi.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->hwndFrom == g_CLI.hwndContactTree) {
+ if (((LPNMHDR)lParam)->hwndFrom == g_clistApi.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(g_CLI.hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
+ SendMessage(g_clistApi.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(g_CLI.hwndContactTree, &pt);
+ ClientToScreen(g_clistApi.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(g_CLI.hwndContactTree, &rc);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndStatus, &rc);
+ GetWindowRect(g_clistApi.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 == g_CLI.hwndStatus) {
+ if (dis->hwndItem == g_clistApi.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(g_CLI.hwndStatus, SB_GETPARTS, 0, 0);
+ int nParts = SendMessage(g_clistApi.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;
}
- g_CLI.pfnShowHide();
+ g_clistApi.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, g_CLI.hwndContactList, nullptr);
+ TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, g_clistApi.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, g_CLI.hwndContactList, nullptr);
+ TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, g_clistApi.hwndContactList, nullptr);
return 0;
}
@@ -1848,7 +1848,7 @@ void OnCreateClc()
InitGroupMenus();
LoadExtBkSettingsFromDB();
- PreCreateCLC(g_CLI.hwndContactList);
+ PreCreateCLC(g_clistApi.hwndContactList);
}
struct
diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp
index 2c50952b3a..5aefb329d5 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 = g_CLI.hwndContactList;
+ fakeMainWindow.ContainerWnd = g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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)g_CLI.hwndContactList, 0);
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
+ RedrawWindow(g_clistApi.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)g_CLI.hwndContactList, 0);
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
+ RedrawWindow(g_clistApi.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)g_CLI.hwndContactList, 0);
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
+ RedrawWindow(g_clistApi.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)g_CLI.hwndContactList, 0);
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
+ RedrawWindow(g_clistApi.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)g_CLI.hwndContactList, 0);
- PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
+ PostMessage(g_clistApi.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)g_CLI.hwndContactList, 0);
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
+ RedrawWindow(g_clistApi.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(g_CLI.hwndContactList, &rc);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactList, nullptr, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);
+ SetWindowPos(g_clistApi.hwndContactList, nullptr, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);
CLUIFramesStoreAllFrames();
lck.unlock();
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(g_clistApi.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)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.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(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(g_clistApi.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
CLUIFramesStoreAllFrames();
return 0;
}
@@ -1373,9 +1373,9 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO
HWND hwndParent = GetParent(hwnd);
LRESULT result = 0;
- if (hwndParent != g_CLI.hwndContactList || !cfg::dat.bSkinnedScrollbar)
+ if (hwndParent != g_clistApi.hwndContactList || !cfg::dat.bSkinnedScrollbar)
result = CallWindowProc(oldWndProc, hwnd, WM_NCPAINT, wParam, lParam);
- if (!g_CLI.hwndContactList || hwndParent != g_CLI.hwndContactList)
+ if (!g_clistApi.hwndContactList || hwndParent != g_clistApi.hwndContactList)
return result;
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SKINNEDFRAME) {
@@ -1389,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 == g_CLI.hwndContactTree) {
+ if (hwnd == g_clistApi.hwndContactTree) {
HDC realDC = CreateCompatibleDC(hdc);
HBITMAP hbmDraw = CreateCompatibleBitmap(hdc, rc.right, rc.bottom);
HBITMAP hbmOld = reinterpret_cast<HBITMAP>(SelectObject(realDC, hbmDraw));
@@ -1441,7 +1441,7 @@ int FrameNCCalcSize(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam,
if (item == nullptr)
return orig;
- if (item->IGNORED || !(dwStyle & CLS_SKINNEDFRAME) || GetParent(hwnd) != g_CLI.hwndContactList)
+ if (item->IGNORED || !(dwStyle & CLS_SKINNEDFRAME) || GetParent(hwnd) != g_clistApi.hwndContactList)
return orig;
nccp->rgrc[0].left += item->MARGIN_LEFT;
@@ -1531,7 +1531,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM)
int style;
CLISTFrame *clfrm = (CLISTFrame *)wParam;
- if (g_CLI.hwndContactList == nullptr) return -1;
+ if (g_clistApi.hwndContactList == nullptr) return -1;
if (FramesSysNotStarted) return -1;
if (clfrm->cbSize != sizeof(CLISTFrame)) return -1;
@@ -1556,13 +1556,13 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM)
if (clfrm->Flags & F_NO_SUBCONTAINER)
Frames[nFramescount].OwnerWindow = (HWND)-2;
else
- Frames[nFramescount].OwnerWindow = g_CLI.hwndContactList;
+ Frames[nFramescount].OwnerWindow = g_clistApi.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 != g_CLI.hwndContactTree && clfrm->hWnd != g_hwndViewModeFrame && clfrm->hWnd != g_hwndEventArea) {
+ if (clfrm->hWnd != g_clistApi.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);
}
@@ -1570,7 +1570,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM)
if (clfrm->hWnd == g_hwndEventArea)
wndFrameEventArea = &Frames[nFramescount];
- else if (clfrm->hWnd == g_CLI.hwndContactTree)
+ else if (clfrm->hWnd == g_clistApi.hwndContactTree)
wndFrameCLC = &Frames[nFramescount];
else if (clfrm->hWnd == g_hwndViewModeFrame)
wndFrameViewMode = &Frames[nFramescount];
@@ -1605,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, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ WS_CLIPCHILDREN, 0, 0, 0, 0, g_clistApi.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,
- g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ g_clistApi.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
SetWindowPos(Frames[nFramescount].TitleBar.hwndTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
{
@@ -1649,13 +1649,13 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM)
lck.unlock();
alclientFrame = -1;//recalc it
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
if (Frames[nFramescount - 1].floating) {
Frames[nFramescount - 1].floating = FALSE;
CLUIFrameSetFloat(retval, 1);//lparam=1 use stored width and height
}
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(g_clistApi.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
return retval;
}
@@ -1673,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 == g_CLI.hwndContactTree)
+ else if (F->hWnd == g_clistApi.hwndContactTree)
wndFrameCLC = nullptr;
else if (F->hWnd == g_hwndViewModeFrame)
wndFrameViewMode = nullptr;
@@ -1694,9 +1694,9 @@ static INT_PTR CLUIFramesRemoveFrame(WPARAM wParam, LPARAM)
}
if (!cfg::shutDown) {
- 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);
+ InvalidateRect(g_clistApi.hwndContactList, nullptr, TRUE);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
+ RedrawWindow(g_clistApi.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
return 0;
}
@@ -1769,7 +1769,7 @@ bool CLUIFramesFitInSize(void)
int CLUIFramesGetMinHeight()
{
- if (g_CLI.hwndContactList == nullptr)
+ if (g_clistApi.hwndContactList == nullptr)
return 0;
int i, tbh, clientfrm, sumheight = 0;
@@ -1796,7 +1796,7 @@ int CLUIFramesGetMinHeight()
}
}
- GetBorderSize(g_CLI.hwndContactList, &border);
+ GetBorderSize(g_clistApi.hwndContactList, &border);
return(sumheight + border.top + border.bottom + allbord + tbh + 3);
}
@@ -1956,12 +1956,12 @@ INT_PTR CLUIFramesUpdateFrame(WPARAM wParam, LPARAM lParam)
return -1;
if (wParam == -1) {
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
return 0;
}
if (lParam & FU_FMPOS)
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 1);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 1);
mir_cslock lck(csFrameHook);
int pos = id2pos(wParam);
@@ -2068,7 +2068,7 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam)
{
mir_cslock lck(csFrameHook);
- GetClientRect(g_CLI.hwndContactList, &nRect);
+ GetClientRect(g_clistApi.hwndContactList, &nRect);
if (lParam && lParam != 1) {
RECT oldRect;
POINT pt;
@@ -2077,7 +2077,7 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam)
GetWindowRect((HWND)wParam, &oldRect);
pt.x = nRect.left;
pt.y = nRect.top;
- ClientToScreen(g_CLI.hwndContactList, &pt);
+ ClientToScreen(g_clistApi.hwndContactList, &pt);
dl = pt.x - oldRect.left;
dt = pt.y - oldRect.top;
dr = (oldRect.right - oldRect.left) - (nRect.right - nRect.left) - dl;
@@ -2104,10 +2104,10 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam)
tick = GetTickCount() - tick;
- if (g_CLI.hwndContactList != nullptr)
- InvalidateRect(g_CLI.hwndContactList, nullptr, TRUE);
- if (g_CLI.hwndContactList != nullptr)
- UpdateWindow(g_CLI.hwndContactList);
+ if (g_clistApi.hwndContactList != nullptr)
+ InvalidateRect(g_clistApi.hwndContactList, nullptr, TRUE);
+ if (g_clistApi.hwndContactList != nullptr)
+ UpdateWindow(g_clistApi.hwndContactList);
Sleep(0);
@@ -2281,7 +2281,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
CLUIFrameSetFloat(Frameid, 0);
break;
}
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
}
break;
@@ -2352,7 +2352,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
lbypos = -1;
oldframeheight = -1;
ReleaseCapture();
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(g_clistApi.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
break;
case WM_LBUTTONDOWN:
@@ -2419,8 +2419,8 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
rcwnd.left = curpt.x;
rcwnd.right = curpt.x + 5;
- GetWindowRect(g_CLI.hwndContactList, &rcMiranda);
- if (IsWindowVisible(g_CLI.hwndContactList) && IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) {
+ GetWindowRect(g_clistApi.hwndContactList, &rcMiranda);
+ if (IsWindowVisible(g_clistApi.hwndContactList) && IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) {
int id = Frames[pos].id;
lck.unlock();
@@ -2451,7 +2451,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
rcwnd.left = curpt.x;
rcwnd.right = curpt.x + 5;
- GetWindowRect(g_CLI.hwndContactList, &rcMiranda);
+ GetWindowRect(g_clistApi.hwndContactList, &rcMiranda);
if (!IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) {
lck.unlock();
@@ -2574,7 +2574,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
lck.unlock();
if (newh > 0)
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
break;
}
curdragbar = -1;
@@ -2792,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, g_CLI.hwndContactList);
- SetParent(Frames[wParam].TitleBar.hwnd, g_CLI.hwndContactList);
+ SetParent(Frames[wParam].hWnd, g_clistApi.hwndContactList);
+ SetParent(Frames[wParam].TitleBar.hwnd, g_clistApi.hwndContactList);
Frames[wParam].floating = FALSE;
DestroyWindow(Frames[wParam].ContainerWnd);
Frames[wParam].ContainerWnd = nullptr;
@@ -2814,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(g_CLI.hwndContactList, Frames[wParam].FloatingPos.x, Frames[wParam].FloatingPos.y, 10, 10);
+ Frames[wParam].ContainerWnd = CreateContainerWindow(g_clistApi.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);
@@ -2867,7 +2867,7 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam)
hwndtmp = Frames[wParam].ContainerWnd;
}
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
SendMessage(hwndtmp, WM_SIZE, 0, 0);
SetWindowPos(hwndtooltiptmp, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
return 0;
@@ -3020,7 +3020,7 @@ void LoadExtraIconModule()
int UnLoadCLUIFramesModule(void)
{
- CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0);
+ CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
CLUIFramesStoreAllFrames();
DeleteObject(g_hPenCLUIFrames);
diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp
index 9e6a279af3..6ac0c0af8d 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(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ SetWindowPos(g_clistApi.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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.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(g_CLI.hwndContactList, &p);
- ShowWindow(g_CLI.hwndContactList, SW_HIDE);
+ GetWindowPlacement(g_clistApi.hwndContactList, &p);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
- style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
+ style = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE);
style |= WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE;
style &= ~WS_EX_APPWINDOW;
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, style);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, style);
- SetWindowPlacement(g_CLI.hwndContactList, &p);
- ShowWindow(g_CLI.hwndContactList, SW_SHOW);
+ SetWindowPlacement(g_clistApi.hwndContactList, &p);
+ ShowWindow(g_clistApi.hwndContactList, SW_SHOW);
}
else {
LONG style;
- style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
+ style = GetWindowLongPtr(g_clistApi.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(g_CLI.hwndContactList);
+ AddToTaskBar(g_clistApi.hwndContactList);
}
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, style);
+ SetWindowLongPtr(g_clistApi.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(g_CLI.hwndContactList, nullptr);
+ SetMenu(g_clistApi.hwndContactList, nullptr);
else
- SetMenu(g_CLI.hwndContactList, g_CLI.hMenuMain);
+ SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ws(NULL, "CList", "TitleText", title);
- SetWindowText(g_CLI.hwndContactList, title);
+ SetWindowText(g_clistApi.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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
- SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.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(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
cfg::dat.colorkey = RGB(255, 0, 255);
}
if (cfg::dat.isTransparent || cfg::dat.bFullTransparent) {
- 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,
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_clistApi.hwndContactList, 0, 255, LWA_ALPHA | LWA_COLORKEY);
+ SetLayeredWindowAttributes(g_clistApi.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(g_CLI.hwndContactList, RGB(0, 0, 0), (BYTE)255, LWA_ALPHA);
+ SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (BYTE)255, LWA_ALPHA);
if (!cfg::dat.bLayeredHack)
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
}
ConfigureCLUIGeometry(1);
- 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);
+ ShowWindow(g_clistApi.hwndContactList, SW_SHOW);
+ SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
+ SetWindowPos(g_clistApi.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ RedrawWindow(g_clistApi.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(g_CLI.hwndStatus);
+ HWND parent = GetParent(g_clistApi.hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
db_set_b(NULL, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
- ShowWindow(g_CLI.hwndStatus, SW_HIDE);
- mir_unsubclassWindow(g_CLI.hwndStatus, NewStatusBarWndProc);
- DestroyWindow(g_CLI.hwndStatus);
+ ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
+ mir_unsubclassWindow(g_clistApi.hwndStatus, NewStatusBarWndProc);
+ DestroyWindow(g_clistApi.hwndStatus);
flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
- g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
- mir_subclassWindow(g_CLI.hwndStatus, NewStatusBarWndProc);
+ g_clistApi.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
+ mir_subclassWindow(g_clistApi.hwndStatus, NewStatusBarWndProc);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) {
- ShowWindow(g_CLI.hwndStatus, SW_SHOW);
- SendMessage(g_CLI.hwndStatus, WM_SIZE, 0, 0);
+ ShowWindow(g_clistApi.hwndStatus, SW_SHOW);
+ SendMessage(g_clistApi.hwndStatus, WM_SIZE, 0, 0);
cfg::dat.dwFlags |= CLUI_FRAME_SBARSHOW;
}
else {
- ShowWindow(g_CLI.hwndStatus, SW_HIDE);
+ ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
cfg::dat.dwFlags &= ~CLUI_FRAME_SBARSHOW;
}
db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
ConfigureCLUIGeometry(1);
- SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
CluiProtocolStatusChanged(0, nullptr);
- PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_clistApi.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(g_CLI.hwndContactList, &p);
- ShowWindow(g_CLI.hwndContactList, SW_HIDE);
+ GetWindowPlacement(g_clistApi.hwndContactList, &p);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT || windowStyle == SETTING_WINDOWSTYLE_TOOLWINDOW) {
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME);
if (SETTING_WINDOWSTYLE_DEFAULT == windowStyle) {
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_MAXIMIZEBOX/* | WS_MINIMIZEBOX*/));
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) & ~(WS_MAXIMIZEBOX/* | WS_MINIMIZEBOX*/));
minToTray = FALSE;
}
}
else if (windowStyle == SETTING_WINDOWSTYLE_THINBORDER) {
- 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);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME));
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) | WS_BORDER | WS_CLIPCHILDREN);
}
else {
- 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);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME));
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) | WS_CLIPCHILDREN);
}
p.showCmd = SW_HIDE;
- SetWindowPlacement(g_CLI.hwndContactList, &p);
+ SetWindowPlacement(g_clistApi.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 9e64b242d2..66ca240586 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(g_CLI.hwndStatus, SB_GETPARTS, 0, 0);
+ int nParts = SendMessage(g_clistApi.hwndStatus, SB_GETPARTS, 0, 0);
for (int nPanel = 0; nPanel < nParts; nPanel++) {
- ProtocolData *PD = (ProtocolData *)SendMessage(g_CLI.hwndStatus, SB_GETTEXT, nPanel, 0);
+ ProtocolData *PD = (ProtocolData *)SendMessage(g_clistApi.hwndStatus, SB_GETTEXT, nPanel, 0);
if (PD != nullptr && !IsBadCodePtr((FARPROC)PD)) {
- SendMessage(g_CLI.hwndStatus, SB_SETTEXT, (WPARAM)nPanel | SBT_OWNERDRAW, 0);
+ SendMessage(g_clistApi.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 (g_CLI.hwndStatus == nullptr || cfg::shutDown)
+ if (g_clistApi.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(g_CLI.hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
+ SendMessage(g_clistApi.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(g_CLI.hwndStatus, &rc);
+ GetClientRect(g_clistApi.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(g_CLI.hwndStatus, WM_GETFONT, 0, 0)));
+ HFONT hofont = reinterpret_cast<HFONT>(SelectObject(hdc, (HFONT)SendMessage(g_clistApi.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(g_CLI.hwndStatus, SB_SIMPLE, TRUE, 0);
+ SendMessage(g_clistApi.hwndStatus, SB_SIMPLE, TRUE, 0);
return;
}
- SendMessage(g_CLI.hwndStatus, SB_SIMPLE, FALSE, 0);
+ SendMessage(g_clistApi.hwndStatus, SB_SIMPLE, FALSE, 0);
partWidths[partCount - 1] = -1;
BYTE windowStyle = db_get_b(NULL, "CLUI", "WindowStyle", 0);
- 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);
+ SendMessage(g_clistApi.hwndStatus, SB_SETMINHEIGHT, 18 + cfg::dat.bClipBorder + ((windowStyle == SETTING_WINDOWSTYLE_THINBORDER || windowStyle == SETTING_WINDOWSTYLE_NOBORDER) ? 3 : 0), 0);
+ SendMessage(g_clistApi.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(g_CLI.hwndStatus, SB_SETTEXTA, partCount | flags, (LPARAM)PD);
+ SendMessageA(g_clistApi.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 && g_CLI.hwndContactList) {
- HWND hwndClistBtn = GetDlgItem(g_CLI.hwndContactList, IDC_TBGLOBALSTATUS);
+ if (szStatus && g_clistApi.hwndContactList) {
+ HWND hwndClistBtn = GetDlgItem(g_clistApi.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 0aa41471b7..6b7637a62d 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(g_CLI.hwndContactList, IDC_TBMENU), bSkinned, !bSkinned, bSkinned);
- CustomizeButton(GetDlgItem(g_CLI.hwndContactList, IDC_TBGLOBALSTATUS), bSkinned, !bSkinned, bSkinned);
+ CustomizeButton(GetDlgItem(g_clistApi.hwndContactList, IDC_TBMENU), bSkinned, !bSkinned, bSkinned);
+ CustomizeButton(GetDlgItem(g_clistApi.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(g_CLI.hwndContactList);
+ HDC hdc = GetDC(g_clistApi.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(g_CLI.hwndContactList, hdc);
+ ReleaseDC(g_clistApi.hwndContactList, hdc);
return;
}
}
@@ -929,7 +929,7 @@ done_with_glyph:
}
}
imgread_done:
- ReleaseDC(g_CLI.hwndContactList, hdc);
+ ReleaseDC(g_clistApi.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, g_CLI.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_clistApi.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 (g_CLI.hwndContactList)
+ if (g_clistApi.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(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(g_CLI.hwndContactList, cfg::dat.colorkey, 0, LWA_COLORKEY);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_clistApi.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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
- RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
+ RedrawWindow(g_clistApi.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(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);
+ ShowWindow(g_clistApi.hwndContactList, SW_SHOWNORMAL);
+ SetWindowPos(g_clistApi.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
+ RedrawWindow(g_clistApi.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(g_CLI.hwndContactList, WM_SIZE, 0, 0);
- PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_clistApi.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(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_clistApi.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 = g_CLI.hwndContactList;
+ sd.hwndCLUI = g_clistApi.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(g_CLI.hwndContactTree);
+ UninitializeCoolSB(g_clistApi.hwndContactTree);
return 0;
}
if (cfg::dat.bSkinnedScrollbar) {
- InitializeCoolSB(g_CLI.hwndContactTree);
- CoolSB_SetStyle(g_CLI.hwndContactTree, SB_VERT, CSBS_HOTTRACKED);
+ InitializeCoolSB(g_clistApi.hwndContactTree);
+ CoolSB_SetStyle(g_clistApi.hwndContactTree, SB_VERT, CSBS_HOTTRACKED);
}
- else UninitializeCoolSB(g_CLI.hwndContactTree);
+ else UninitializeCoolSB(g_clistApi.hwndContactTree);
return 0;
}
diff --git a/plugins/Clist_nicer/src/groupmenu.cpp b/plugins/Clist_nicer/src/groupmenu.cpp
index e1e34d2131..0d9a351a49 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(g_CLI.hwndContactList, WM_COMMAND, MAKELONG(wParam, BN_CLICKED), 1);
+ SendMessage(g_clistApi.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 5acbf75006..d745f1e13d 100644
--- a/plugins/Clist_nicer/src/init.cpp
+++ b/plugins/Clist_nicer/src/init.cpp
@@ -110,7 +110,7 @@ static int systemModulesLoaded(WPARAM, LPARAM)
extern "C" int __declspec(dllexport) CListInitialise()
{
Clist_GetInterface();
- coreCli = g_CLI;
+ coreCli = g_clistApi;
API::onInit();
@@ -172,41 +172,41 @@ extern "C" int __declspec(dllexport) CListInitialise()
wcslwr(cfg::dat.tszProfilePath);
// get the clist interface
- 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;
+ g_clistApi.hInst = g_plugin.getInst();
+ g_clistApi.pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged;
+ g_clistApi.pfnCompareContacts = CompareContacts;
+ g_clistApi.pfnCreateClcContact = CreateClcContact;
+ g_clistApi.pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
+ g_clistApi.pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
+ g_clistApi.pfnGetDefaultFontSetting = GetDefaultFontSetting;
+ g_clistApi.pfnGetRowBottomY = RowHeight::getItemBottomY;
+ g_clistApi.pfnGetRowHeight = RowHeight::getHeight;
+ g_clistApi.pfnGetRowTopY = RowHeight::getItemTopY;
+ g_clistApi.pfnGetRowTotalHeight = RowHeight::getTotalHeight;
+ g_clistApi.pfnGetWindowVisibleState = GetWindowVisibleState;
+ g_clistApi.pfnHitTest = HitTest;
+ g_clistApi.pfnOnCreateClc = OnCreateClc;
+ g_clistApi.pfnPaintClc = PaintClc;
+ g_clistApi.pfnRebuildEntireList = RebuildEntireList;
+ g_clistApi.pfnRowHitTest = RowHeight::hitTest;
+ g_clistApi.pfnScrollTo = ScrollTo;
+ g_clistApi.pfnSetHideOffline = SetHideOffline;
+ g_clistApi.pfnShowHide = ShowHide;
+
+ g_clistApi.pfnAddContactToGroup = AddContactToGroup;
+
+ g_clistApi.pfnAddEvent = AddEvent;
+ g_clistApi.pfnRemoveEvent = RemoveEvent;
+
+ g_clistApi.pfnAddGroup = AddGroup;
+ g_clistApi.pfnAddInfoItemToGroup = AddInfoItemToGroup;
+ g_clistApi.pfnContactListControlWndProc = ContactListControlWndProc;
+ g_clistApi.pfnContactListWndProc = ContactListWndProc;
+ g_clistApi.pfnIconFromStatusMode = IconFromStatusMode;
+ g_clistApi.pfnLoadClcOptions = LoadClcOptions;
+ g_clistApi.pfnProcessExternalMessages = ProcessExternalMessages;
+ g_clistApi.pfnRecalcScrollBar = RecalcScrollBar;
+ g_clistApi.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(g_CLI.hwndContactList))
- DestroyWindow(g_CLI.hwndContactList);
+ if (IsWindow(g_clistApi.hwndContactList))
+ DestroyWindow(g_clistApi.hwndContactList);
ClcShutdown(0, 0);
UnLoadCLUIFramesModule();
return 0;
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp
index 62cef006e7..007fdb34e5 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(g_CLI.hwndContactList, &pt);
+ ScreenToClient(g_clistApi.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(g_CLI.hwndContactList, WM_DRAWITEM, 0, (LPARAM)&dis);
+ SendMessage(g_clistApi.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() == g_CLI.hwndContactList);
+ ti.isTreeFocused = (GetFocus() == g_clistApi.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 1e9e674432..b5429d776b 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(g_CLI.hwndContactList, &rcCLUI);
+ GetWindowRect(g_clistApi.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"));
- g_CLI.pfnSetHideOffline(cfg::dat.boldHideOffline);
+ g_clistApi.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, g_CLI.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_clistApi.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);
- g_CLI.pfnSetHideOffline(false);
+ g_clistApi.pfnSetHideOffline(false);
SetWindowTextA(hwndSelector, name);
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
SetButtonStates();
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp
index f7ed632c9d..8a0a2eaa9f 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(g_CLI.hwndContactList);
+ int state = IsWindowVisible(g_clistApi.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(g_CLI.hwndContactList, SW_SHOW);
+ ShowWindow(g_clistApi.hwndContactList, SW_SHOW);
state = TRUE;
break;
case STATE_OFF:
- ShowWindow(g_CLI.hwndContactList, SW_HIDE);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
state = FALSE;
break;
case STATE_TOGGLE:
- state = !IsWindowVisible(g_CLI.hwndContactList);
- ShowWindow(g_CLI.hwndContactList, (state) ? SW_SHOW : SW_HIDE);
+ state = !IsWindowVisible(g_clistApi.hwndContactList);
+ ShowWindow(g_clistApi.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(g_CLI.hwndContactList, WM_COMMAND, ID_ICQ_EXIT, 0);
+ PostMessage(g_clistApi.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(g_CLI.hwndContactList, WM_COMMAND, ID_ICQ_EXIT, 0);
+ PostMessage(g_clistApi.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/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp
index f733a32177..ad1a35320b 100644
--- a/plugins/ContactsPlus/src/main.cpp
+++ b/plugins/ContactsPlus/src/main.cpp
@@ -80,7 +80,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent)
cle.pszService = MS_CONTACTS_RECEIVE;
cle.szTooltip.w = caToolTip;
cle.flags |= CLEF_UNICODE;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
return 0; //continue processing by other hooks
}
diff --git a/plugins/ExternalAPI/m_skin_eng.h b/plugins/ExternalAPI/m_skin_eng.h
index 83d4801690..6868145834 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(g_CLI.hwndContactList, &rc);
+ GetWindowRect(g_clistApi.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 48ef4a9c79..327bbb7d59 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);
- g_CLI.pfnRemoveEvent(hContact, 0);
+ g_clistApi.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";
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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);
- g_CLI.pfnRemoveEvent(hContact, 0);
+ g_clistApi.pfnRemoveEvent(hContact, 0);
}
Skin_PlaySound("FileDone");
destroyTransfer();
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp
index 03a65a43d1..99ab507a73 100644
--- a/plugins/FloatingContacts/src/main.cpp
+++ b/plugins/FloatingContacts/src/main.cpp
@@ -867,10 +867,10 @@ static int OnModulesLoded(WPARAM, LPARAM)
HookEvent(ME_CLIST_STATUSMODECHANGE, OnStatusModeChange);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildContactMenu);
- hwndMiranda = g_CLI.hwndContactList;
+ hwndMiranda = g_clistApi.hwndContactList;
mir_subclassWindow(hwndMiranda, newMirandaWndProc);
- UINT_PTR dwStyle = SendMessageW(g_CLI.hwndContactTree, CLM_GETEXSTYLE, 0, 0);
+ UINT_PTR dwStyle = SendMessageW(g_clistApi.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"),
diff --git a/plugins/GmailNotifier/src/notify.cpp b/plugins/GmailNotifier/src/notify.cpp
index dc34a05c23..f47c0792cd 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);
- g_CLI.pfnRemoveEvent(curAcc->hContact, 1);
+ g_clistApi.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;
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.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);
- g_CLI.pfnRemoveEvent(curAcc->hContact, 1);
+ g_clistApi.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) {
- g_CLI.pfnRemoveEvent(curAcc->hContact, 1);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
if (opt.notifierOnPop&&newMails > 0) {
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp
index db1770221b..20216b816b 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) : g_CLI.hwndContactList), &stNewShare))
+ if (!bShowShareNewFileDlg((lParam ? HWND(lParam) : g_clistApi.hwndContactList), &stNewShare))
return 0;
if (stNewShare.dwAllowedIP)
diff --git a/plugins/HwHotKeys/src/HwHotKeys_KbdHook.cpp b/plugins/HwHotKeys/src/HwHotKeys_KbdHook.cpp
index 1dfa18bd81..a0808bd8b4 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);
- g_CLI.pfnShowHide(); // есть варианты
+ g_clistApi.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(g_CLI.hwndContactList);
- SetFocus(g_CLI.hwndContactList);
+ SetForegroundWindow(g_clistApi.hwndContactList);
+ SetFocus(g_clistApi.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 e9480ded24..67f501e30a 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);
- g_CLI.pfnRemoveEvent(event->hContact, hDbEvent);
+ g_clistApi.pfnRemoveEvent(event->hContact, hDbEvent);
}
if (!isDbEventShown(&dbei)) {
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp
index 01566bb6d1..e78befc9f4 100644
--- a/plugins/KeyboardNotify/src/main.cpp
+++ b/plugins/KeyboardNotify/src/main.cpp
@@ -247,7 +247,7 @@ BOOL checkUnopenEvents()
if (nExternCount && bFlashOnOther)
return TRUE;
- for (nIndex = 0; pCLEvent = g_CLI.pfnGetEvent(-1, nIndex); nIndex++) {
+ for (nIndex = 0; pCLEvent = g_clistApi.pfnGetEvent(-1, nIndex); nIndex++) {
DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg) ||
@@ -423,7 +423,7 @@ static VOID CALLBACK ReminderTimer(HWND, UINT, UINT_PTR, DWORD)
return;
}
- for (nIndex = 0; !bReminderDisabled && (pCLEvent = g_CLI.pfnGetEvent(-1, nIndex)); nIndex++) {
+ for (nIndex = 0; !bReminderDisabled && (pCLEvent = g_clistApi.pfnGetEvent(-1, nIndex)); nIndex++) {
DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg) ||
@@ -853,7 +853,7 @@ void countUnopenEvents(int *msgCount, int *fileCount, int *urlCount, int *otherC
int nIndex;
CLISTEVENT *pCLEvent;
- for (nIndex = 0; pCLEvent = g_CLI.pfnGetEvent(-1, nIndex); nIndex++) {
+ for (nIndex = 0; pCLEvent = g_clistApi.pfnGetEvent(-1, nIndex); nIndex++) {
DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if (metaCheckProtocol(einfo.szModule, pCLEvent->hContact, einfo.eventType)) {
diff --git a/plugins/MagneticWindows/src/MagneticWindows.cpp b/plugins/MagneticWindows/src/MagneticWindows.cpp
index c8b23c3615..03ea94abbd 100644
--- a/plugins/MagneticWindows/src/MagneticWindows.cpp
+++ b/plugins/MagneticWindows/src/MagneticWindows.cpp
@@ -91,7 +91,7 @@ int SnapPluginStart(WPARAM, LPARAM)
HookEvent(ME_MSG_WINDOWEVENT, PluginMessageWindowEvent);
- WindowOpen(g_CLI.hwndContactList);
+ WindowOpen(g_clistApi.hwndContactList);
return 0;
}
diff --git a/plugins/MagneticWindows/src/SnapToListService.cpp b/plugins/MagneticWindows/src/SnapToListService.cpp
index 143daf12df..ef4eefe19c 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 = g_CLI.hwndContactList;
+ HWND hWndList = g_clistApi.hwndContactList;
RECT WndRect, ListRect;
GetWindowRect(hWnd, &WndRect);
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index 700cbebb99..51f6746c27 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -425,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), g_CLI.hwndContactList, AuthReqWndProc, (LPARAM)hContact);
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_AUTHREQ), g_clistApi.hwndContactList, AuthReqWndProc, (LPARAM)hContact);
return 0;
}
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp
index 5580aa8c92..2ab2c723ab 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);
- g_CLI.pfnRemoveEvent(hContact, hEvent);
+ g_clistApi.pfnRemoveEvent(hContact, hEvent);
}
//************************************************************************
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp
index 2ea67d87d2..6574fe47ed 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, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ 0, 0, 10, 10, g_clistApi.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, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
+ 0, 0, 200, 130, g_clistApi.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/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index 9ce4dd2a41..e3126f4bb3 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 = g_CLI.pfnGetEvent(pdata->hContact, idx);
+ CLISTEVENT *cle = g_clistApi.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) {
- g_CLI.pfnRemoveEvent(pdata->hContact, eventData->hEvent);
+ g_clistApi.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 1a89ea51bb..387b28c549 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -330,7 +330,7 @@ void BlinkIcon(MCONTACT hContact, HICON hIcon, wchar_t *stzText)
cle.hIcon = hIcon;
cle.pszService = "UserOnline/Description";
cle.szTooltip.w = stzText;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
void PlayChangeSound(MCONTACT hContact, const char *name)
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp
index 32adf4521e..5f8b9b7fc6 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 = g_CLI.pfnGetEvent(-1, i);
+ CLISTEVENT *pev = g_clistApi.pfnGetEvent(-1, i);
if (!pev)
break;
if ((ULONG)pev->lParam == p->uid && !pev->hContact && pev->pszService && !mir_strcmp(pev->pszService, MODULENAME"/OpenTriggeredReminder")) {
- if (!g_CLI.pfnRemoveEvent(pev->hContact, pev->hDbEvent)) {
+ if (!g_clistApi.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");
- g_CLI.pfnAddEvent(&ev);
+ g_clistApi.pfnAddEvent(&ev);
}
pReminder->SystemEventQueued = TRUE;
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp
index e4eaf555c9..b74ec95f5b 100644
--- a/plugins/Nudge/src/main.cpp
+++ b/plugins/Nudge/src/main.cpp
@@ -85,7 +85,7 @@ static INT_PTR NudgeSend(WPARAM hContact, LPARAM lParam)
void OpenContactList()
{
- HWND hWnd = g_CLI.hwndContactList;
+ HWND hWnd = g_clistApi.hwndContactList;
ShowWindow(hWnd, SW_RESTORE);
ShowWindow(hWnd, SW_SHOW);
}
diff --git a/plugins/Nudge/src/shake.cpp b/plugins/Nudge/src/shake.cpp
index afcb4181f8..f9c9bc3e2e 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*)g_CLI.hwndContactList);
+ mir_forkthread(ShakeClistWindow, (void*)g_clistApi.hwndContactList);
return 0;
}
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp
index 0abd6c1025..3673f7e4a2 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 = g_CLI.hwndContactList;
+ hwnd_clist = g_clistApi.hwndContactList;
WNDCLASS wndclass;
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp
index 2e813cd598..dda9d77211 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 = g_CLI.hwndContactList;
+ HWND hwndList = g_clistApi.hwndContactList;
CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp
index 2037f2d46f..6aecc57af8 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 = g_CLI.hwndContactList;
+ hWnd = g_clistApi.hwndContactList;
else // PopupOptions.Monitor == MN_ACTIVE
hWnd = GetForegroundWindow();
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index 3babe1eeb4..4d4177a4b2 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -253,7 +253,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
if (!restorePos) {
RECT rect;
- if (GetWindowRect(g_CLI.hwndContactList, &rect)) {
+ if (GetWindowRect(g_clistApi.hwndContactList, &rect)) {
WINDOWPLACEMENT wp;
wp.length = sizeof(wp);
@@ -264,7 +264,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(g_CLI.hwndContactList)) right = rect.right;
+ if (!IsWindowVisible(g_clistApi.hwndContactList)) right = rect.right;
wp.rcNormalPosition.left = right - width;
wp.rcNormalPosition.top = rect.top;
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp
index 60d9eab6f6..bb4546e440 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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
}
}
diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp
index afd499701b..87c4868053 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 (g_CLI.pfnGetEvent(m_hContact, 0))
- g_CLI.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
+ if (g_clistApi.pfnGetEvent(m_hContact, 0))
+ g_clistApi.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 (g_CLI.pfnGetEvent(m_hContact, 0))
- g_CLI.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
+ if (g_clistApi.pfnGetEvent(m_hContact, 0))
+ g_clistApi.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 8feedac031..b008fa924b 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))
- g_CLI.pfnRemoveEvent(m_hContact, hDbEvent);
+ g_clistApi.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 15de2e0439..fdc59bc513 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);
- g_CLI.pfnRemoveEvent(hContact, hDbEvent);
+ g_clistApi.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 fcd32c8d2e..e5f4ca310e 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;
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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) {
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
}
diff --git a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp
index 7f4463a93e..4f3a487bb2 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 = g_CLI.hwndContactList;
+ HWND hClist = g_clistApi.hwndContactList;
BOOL isHidden = !IsWindowVisible(hClist);
switch (state) {
case SETTING_STATE_HIDDEN:
// try to use services where possible
if (!isHidden)
- g_CLI.pfnShowHide();
+ g_clistApi.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)
- g_CLI.pfnShowHide();
+ g_clistApi.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 = g_CLI.hwndContactList;
+ HWND hClist = g_clistApi.hwndContactList;
// store in db
if (db_get_b(0, SSMODULENAME, SETTING_SETWINLOCATION, 0)) {
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp
index 1e5a27c8c7..74a0e7468c 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 (g_CLI.pfnGetEvent(si->hContact, 0))
- g_CLI.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ if (g_clistApi.pfnGetEvent(si->hContact, 0))
+ g_clistApi.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 e51abd0bca..e7e8faaa9f 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 (g_CLI.pfnGetEvent(m_si->hContact, 0))
- g_CLI.pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT);
+ if (g_clistApi.pfnGetEvent(m_si->hContact, 0))
+ g_clistApi.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 (g_CLI.pfnGetEvent(m_si->hContact, 0))
- g_CLI.pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT);
+ if (g_clistApi.pfnGetEvent(m_si->hContact, 0))
+ g_clistApi.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 0799699983..bdc5bdc3ec 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 = g_CLI.hwndContactList;
+ m_hwndClist = g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
}
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp
index e541f394eb..21421b3f19 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 = g_CLI.pfnGetEvent(-1, 0);
+ CLISTEVENT *cli = g_clistApi.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 = g_CLI.pfnGetEvent(wParam, 0);
+ CLISTEVENT *cle = g_clistApi.pfnGetEvent(wParam, 0);
if (cle) {
if (ServiceExists(cle->pszService)) {
CallService(cle->pszService, 0, (LPARAM)cle);
- g_CLI.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ g_clistApi.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
- g_CLI.pfnRemoveEvent(wParam, lParam);
+ g_clistApi.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 d64e729331..6dd35d2073 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) {
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
}
return 0;
@@ -390,7 +390,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
if (dbei.markedRead() || (isCustomEvent && !isShownCustomEvent))
return 0;
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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 174aa7bcf9..604f43ac0b 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)
- g_CLI.pfnRemoveEvent(m_hContact, m_hFlashingEvent);
+ g_clistApi.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 721046180f..e5c2cd2186 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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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 d275d001c1..7c9c1fa2ec 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);
- g_CLI.pfnRemoveEvent(hContact, hDbEvent);
+ g_clistApi.pfnRemoveEvent(hContact, hDbEvent);
}
g_groupBreak = TRUE;
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp
index caee65d88e..9aaa791482 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 = g_CLI.hwndContactTree;
+ HWND clist = g_clistApi.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 = g_CLI.hwndContactTree;
+ HWND clist = g_clistApi.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/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp
index 3644de47d4..5e12e64a5b 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:
- g_CLI.pfnShowHide();
+ g_clistApi.pfnShowHide();
break;
case OPEN_MSGDLG:
@@ -851,7 +851,7 @@ void CTooltipNotify::OnTooltipDblClicked(CTooltip *pTooltip)
}
default:
- g_CLI.pfnShowHide();
+ g_clistApi.pfnShowHide();
break;
}
}
diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp
index b1e2613b0a..7ce86882b9 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, g_CLI.hwndContactList, nullptr);
+ TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_clistApi.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, g_CLI.hwndContactList, nullptr);
+ TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_clistApi.hwndContactList, nullptr);
return 0;
}
@@ -61,7 +61,7 @@ INT_PTR TTBInternalSoundsOnOff(WPARAM, LPARAM)
void InitInternalButtons()
{
- hwndContactTree = g_CLI.hwndContactTree;
+ hwndContactTree = g_clistApi.hwndContactTree;
CreateServiceFunction(TTBI_SOUNDSONOFF, TTBInternalSoundsOnOff);
CreateServiceFunction(TTBI_MAINMENUBUTT, TTBInternalMainMenuButt);
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp
index cd5dcf1900..5099ddad7f 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 = g_CLI.hwndContactList;
+ HWND parent = g_clistApi.hwndContactList;
if (parent == nullptr) // no clist, no buttons
return;
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp
index a49d09d34d..5359c976ec 100644
--- a/plugins/TrafficCounter/src/TrafficCounter.cpp
+++ b/plugins/TrafficCounter/src/TrafficCounter.cpp
@@ -224,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) == g_CLI.hwndContactList)
+ if (GetParent(hwnd) == g_clistApi.hwndContactList)
return PaintTrafficCounterWindow(hwnd, hDC);
else
InvalidateRect(hwnd, nullptr, FALSE);
@@ -1141,7 +1141,7 @@ static int TrafficCounterModulesLoaded(WPARAM, LPARAM)
HookEvent(ME_NETLIB_FASTRECV, TrafficRecv);
HookEvent(ME_NETLIB_FASTSEND, TrafficSend);
- CreateTrafficWindow(g_CLI.hwndContactList);
+ CreateTrafficWindow(g_clistApi.hwndContactList);
UpdateFonts(0, 0); //Load and create fonts here
return 0;
}
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp
index 30832b7889..63a3979aee 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);
- g_CLI.pfnInvalidateDisplayNameCacheEntry(pPs->hContact);
+ g_clistApi.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 458a9ea3de..8c769c20d8 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 = g_CLI.hwndContactTree;
+ HWND hClist = g_clistApi.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 = g_CLI.hwndContactTree;
+ HWND hClist = g_clistApi.hwndContactTree;
lpStatusMenuExecParam smep = (lpStatusMenuExecParam)Menu_GetItemData((HGENMENU)lParam);
ExIm.pszName = mir_strdup(smep->proto);
ExIm.Typ = EXIM_ACCOUNT;
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp
index ea97bdaa89..75532fdfd8 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 * g_CLI.menuProtos->getCount() * sizeof(HGENMENU);
+ size_t sizeNew = mItems * g_clistApi.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 * g_CLI.menuProtos->getCount());
+ RemoveMenuItems(hMenuItemAccount, mItems * g_clistApi.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 : *g_CLI.menuProtos) {
+ for (auto &it : *g_clistApi.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 = g_CLI.menuProtos->indexOf(&it);
+ int i = g_clistApi.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 4c4cc084a6..993bf7dcf5 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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
/**
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp
index 3658fcb89d..e81a01f038 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, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), (void*)hContact);
+ 0, 0, 10, 10, g_clistApi.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 627ea22e04..a1aed2bf90 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;
- g_CLI.pfnAddEvent(&evt);
+ g_clistApi.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))
- g_CLI.pfnRemoveEvent(ActualAccount->hContact, ActualAccount->hContact);
+ g_clistApi.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))
- g_CLI.pfnRemoveEvent(hContact, hContact);
+ g_clistApi.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)
- g_CLI.pfnRemoveEvent(ActualAccount->hContact, (LPARAM)"yamn new mail message");
+ g_clistApi.pfnRemoveEvent(ActualAccount->hContact, (LPARAM)"yamn new mail message");
mir_subclassWindow(GetDlgItem(hDlg, IDC_LISTMAILS), ListViewSubclassProc);
}
diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp
index 274dfb2cc7..f45605f34a 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(g_CLI.hwndContactList, &clr);
+ GetWindowRect(g_clistApi.hwndContactList, &clr);
HMONITOR hMonitor = MonitorFromRect(&clr, MONITOR_DEFAULTTONEAREST);
if (hMonitor) {
MONITORINFO mi;
diff --git a/plugins/ZeroSwitch/src/ZeroSwitch.cpp b/plugins/ZeroSwitch/src/ZeroSwitch.cpp
index 7b55436f59..f51bb04b17 100644
--- a/plugins/ZeroSwitch/src/ZeroSwitch.cpp
+++ b/plugins/ZeroSwitch/src/ZeroSwitch.cpp
@@ -113,7 +113,7 @@ LRESULT CALLBACK CallWndRetProc(int nCode, WPARAM wParam, LPARAM lParam)
{
pMes = (PCWPRETSTRUCT)lParam; // Get message details
if (!hMirandaWnd)
- hMirandaWnd = g_CLI.hwndContactList;
+ hMirandaWnd = g_clistApi.hwndContactList;
if (pMes->hwnd == hMirandaWnd)
{
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index 10a3436df4..81416b50c4 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");
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
ReleaseIconEx("image", FALSE);
}
}
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp
index 95aeb08146..c8fb37df03 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, g_CLI.hwndContactList, nullptr);
+ int cmd = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_clistApi.hwndContactList, nullptr);
DestroyMenu(hMenu);
if (cmd)
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp
index ff43d197c8..4c6b695325 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 (g_CLI.pfnGetEvent(hContact, 0))
- g_CLI.pfnRemoveEvent(hContact, -100);
- g_CLI.pfnAddEvent(&cle);
+ if (g_clistApi.pfnGetEvent(hContact, 0))
+ g_clistApi.pfnRemoveEvent(hContact, -100);
+ g_clistApi.pfnAddEvent(&cle);
}
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 63f729f9b5..5e9654f1ad 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(g_CLI.hwndContactList, him->m_tszResourceName);
+ JabberCopyText(g_clistApi.hwndContactList, him->m_tszResourceName);
break;
case IDM_RJID_COPY:
case IDM_CPY_RJID:
- JabberCopyText(g_CLI.hwndContactList, him->m_tszRealJid);
+ JabberCopyText(g_clistApi.hwndContactList, him->m_tszRealJid);
break;
case IDM_CPY_INROOMJID:
szBuffer.Format(L"%s/%s", item->jid, him->m_tszResourceName);
- JabberCopyText(g_CLI.hwndContactList, szBuffer);
+ JabberCopyText(g_clistApi.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, g_CLI.hwndContactList);
+ Contact_AddBySearch(ppro->m_szModuleName, &psr, g_clistApi.hwndContactList);
}
break;
}
@@ -1329,11 +1329,11 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
break;
case IDM_CPY_RJID:
- JabberCopyText(g_CLI.hwndContactList, item->jid);
+ JabberCopyText(g_clistApi.hwndContactList, item->jid);
break;
case IDM_CPY_TOPIC:
- JabberCopyText(g_CLI.hwndContactList, item->getTemp()->m_tszStatusMessage);
+ JabberCopyText(g_clistApi.hwndContactList, item->getTemp()->m_tszStatusMessage);
break;
}
}
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp
index 7a0e1a947b..73436781c3 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 = g_CLI.hwndContactList;
+ HWND hwndClist = g_clistApi.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, g_CLI.hwndContactList, nullptr);
+ int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_clistApi.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 f7dd1d1764..a0877649a4 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");
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 439d091e0d..7f5360de00 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, g_CLI.hwndContactList, nullptr);
+ int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_clistApi.hwndContactList, nullptr);
DestroyMenu(hMenu);
if (res) {
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index b787622f2a..7441b8f669 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");
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
return true;
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 11a6144b76..b58441b70f 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, g_CLI.hwndContactList, nullptr);
+ int res = TrackPopupMenu(hContactMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_clistApi.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 2fe625e4f8..98e976c51d 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)
- g_CLI.pfnRemoveEvent(hContact, hDbEvent);
+ g_clistApi.pfnRemoveEvent(hContact, hDbEvent);
}
}
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 6bf5697249..d3d6886d38 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;
}
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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)
- g_CLI.pfnRemoveEvent(0, (LPARAM)m_szModuleName);
+ g_clistApi.pfnRemoveEvent(0, (LPARAM)m_szModuleName);
PUDeletePopup(hWndEMailPopupStatus);
hWndEMailPopupStatus = nullptr;
}
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp
index fc003304bd..1ace72c08a 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) {
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
}
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index 00b0d3384c..bcafc431b8 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)
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.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 b7a800b6ee..7422a9ee3d 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)
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.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)
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.pfnRemoveEvent(hContact, 1);
}
}
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp
index 919f92bafc..1bdb6cac2e 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))
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.pfnRemoveEvent(hContact, 1);
if (szEmail[0]) {
debugLogA("Deleted Handler Email");
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp
index 0b39aeea58..75fb98df62 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();
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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 = g_CLI.pfnGetEvent(hContact, 0)) {
+ while (CLISTEVENT *cle = g_clistApi.pfnGetEvent(hContact, 0)) {
if (cle->lParam == SKYPE_DB_EVENT_TYPE_INCOMING_CALL) {
- g_CLI.pfnRemoveEvent(hContact, cle->hDbEvent);
+ g_clistApi.pfnRemoveEvent(hContact, cle->hDbEvent);
break;
}
}
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 1aa0f98c15..815a87b7d6 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);
- g_CLI.pfnRemoveEvent(hMContact, hDBEvent);
+ g_clistApi.pfnRemoveEvent(hMContact, hDBEvent);
if (hContact != hMContact)
- g_CLI.pfnRemoveEvent(hContact, hDBEvent);
+ g_clistApi.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 20e2bdfbe6..06656e43ad 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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdclist/src/clistmenus.cpp b/src/core/stdclist/src/clistmenus.cpp
index 9ac72f36e2..e88326e0ea 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(g_CLI.hwndContactList);
+ DestroyWindow(g_clistApi.hwndContactList);
return(0);
}
diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp
index 65e6f790fb..10892215ac 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 */
- g_CLI.pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID); /* force reshuffle */
+ g_clistApi.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 6d1f00ddd3..2584384cad 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(g_CLI.hwndContactList, title);
+ SetWindowText(g_clistApi.hwndContactList, title);
}
- g_CLI.pfnLoadCluiGlobalOpts();
- SetWindowPos(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST,
+ g_clistApi.pfnLoadCluiGlobalOpts();
+ SetWindowPos(g_clistApi.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(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);
+ GetWindowPlacement(g_clistApi.hwndContactList, &p);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE,
+ GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_APPWINDOW | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
+ SetWindowPlacement(g_clistApi.hwndContactList, &p);
}
else
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW);
if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
HWND hProgMan = FindWindow(L"Progman", nullptr);
if (hProgMan)
- SetParent(g_CLI.hwndContactList, hProgMan);
+ SetParent(g_clistApi.hwndContactList, hProgMan);
}
else
- SetParent(g_CLI.hwndContactList, nullptr);
+ SetParent(g_clistApi.hwndContactList, nullptr);
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) {
- int style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, style);
+ int style = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE, style);
}
else {
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE,
- GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE,
+ GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
}
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
- SetMenu(g_CLI.hwndContactList, nullptr);
+ SetMenu(g_clistApi.hwndContactList, nullptr);
else
- SetMenu(g_CLI.hwndContactList, g_CLI.hMenuMain);
+ SetMenu(g_clistApi.hwndContactList, g_clistApi.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);
+ SetWindowPos(g_clistApi.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ RedrawWindow(g_clistApi.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 (IsIconic(g_clistApi.hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
+ ShowWindow(g_clistApi.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
- 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);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
else
- SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
- SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_clistApi.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));
- g_CLI.pfnLoadCluiGlobalOpts();
+ g_clistApi.pfnLoadCluiGlobalOpts();
if (db_get_b(NULL, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
- HWND parent = GetParent(g_CLI.hwndStatus);
+ HWND parent = GetParent(g_clistApi.hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
db_set_b(NULL, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
- ShowWindow(g_CLI.hwndStatus, SW_HIDE);
- DestroyWindow(g_CLI.hwndStatus);
+ ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
+ DestroyWindow(g_clistApi.hwndStatus);
flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
- g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
+ g_clistApi.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR))
- ShowWindow(g_CLI.hwndStatus, SW_SHOW);
+ ShowWindow(g_clistApi.hwndStatus, SW_SHOW);
else
- ShowWindow(g_CLI.hwndStatus, SW_HIDE);
- SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
+ SendMessage(g_clistApi.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 fc49caac7a..6d86619ed9 100644
--- a/src/core/stdclist/src/init.cpp
+++ b/src/core/stdclist/src/init.cpp
@@ -99,7 +99,7 @@ static int OnOptsInit(WPARAM wParam, LPARAM lParam)
static INT_PTR GetStatusMode(WPARAM, LPARAM)
{
- return g_CLI.currentDesiredStatusMode;
+ return g_clistApi.currentDesiredStatusMode;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -111,11 +111,11 @@ extern "C" __declspec(dllexport) int CListInitialise()
g_bSortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
Clist_GetInterface();
- coreCli = g_CLI;
- g_CLI.hInst = g_plugin.getInst();
- g_CLI.pfnPaintClc = PaintClc;
- g_CLI.pfnLoadClcOptions = LoadClcOptions;
- g_CLI.pfnCompareContacts = CompareContacts;
+ coreCli = g_clistApi;
+ g_clistApi.hInst = g_plugin.getInst();
+ g_clistApi.pfnPaintClc = PaintClc;
+ g_clistApi.pfnLoadClcOptions = LoadClcOptions;
+ g_clistApi.pfnCompareContacts = CompareContacts;
CreateServiceFunction(MS_CLIST_GETSTATUSMODE, GetStatusMode);
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index fa85763130..977536464d 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";
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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 = g_CLI.pfnGetEvent(ack->hContact, iEvent++))
+ while (CLISTEVENT *cle = g_clistApi.pfnGetEvent(ack->hContact, iEvent++))
if (cle->lParam == (LPARAM)ack->hProcess)
- g_CLI.pfnRemoveEvent(ack->hContact, cle->hDbEvent);
+ g_clistApi.pfnRemoveEvent(ack->hContact, cle->hDbEvent);
}
return 0;
}
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp
index 38d36978ad..30dfa94bb8 100644
--- a/src/core/stdmsg/src/chat_manager.cpp
+++ b/src/core/stdmsg/src/chat_manager.cpp
@@ -73,10 +73,10 @@ static void OnCreateModule(MODULEINFO *mi)
{
OnDestroyModule(mi);
- mi->OnlineIconIndex = g_CLI.pfnIconFromStatusMode(mi->pszModule, ID_STATUS_ONLINE, 0);
+ mi->OnlineIconIndex = g_clistApi.pfnIconFromStatusMode(mi->pszModule, ID_STATUS_ONLINE, 0);
mi->hOnlineIcon = ImageList_GetIcon(Clist_GetImageList(), mi->OnlineIconIndex, ILD_TRANSPARENT);
- mi->OfflineIconIndex = g_CLI.pfnIconFromStatusMode(mi->pszModule, ID_STATUS_OFFLINE, 0);
+ mi->OfflineIconIndex = g_clistApi.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 828961afc8..8b2aa83de4 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 (g_CLI.pfnGetEvent(m_hContact, 0))
- g_CLI.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
+ if (g_clistApi.pfnGetEvent(m_hContact, 0))
+ g_clistApi.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 e8e95ecff8..8a9524e3b4 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)g_CLI.pfnIconFromStatusMode(m_szProto, m_wStatus, m_hContact);
+ return (WORD)g_clistApi.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 029d72a8e2..1a2d22043b 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);
- g_CLI.pfnRemoveEvent(dat->hContact, dat->hDbEvent);
+ g_clistApi.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 9f4532041b..869d679855 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;
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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) {
- g_CLI.pfnRemoveEvent(hContact, 1);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
}
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp
index 1b4f8867be..eee76499a3 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 (g_CLI.pfnGetEvent(s->hContact, 0))
- g_CLI.pfnRemoveEvent(s->hContact, GC_FAKE_EVENT);
+ if (g_clistApi.pfnGetEvent(s->hContact, 0))
+ g_clistApi.pfnRemoveEvent(s->hContact, GC_FAKE_EVENT);
}
FixTabIcons(pDlg);
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp
index 8a0980bbae..14adec2c65 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) {
- g_CLI.pfnRemoveEvent(hContact, lastEvent);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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 7eb89bc2b0..91200e360a 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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.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;
- g_CLI.pfnAddEvent(&cle);
+ g_clistApi.pfnAddEvent(&cle);
}
return 0;
}
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp
index 339db5cca4..296eb81739 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 && !g_CLI.pfnGetEvent(hContact, 0) && IsWindowVisible(si->pDlg->GetHwnd()) && !IsIconic(si->pDlg->GetHwnd())) {
+ if (si->pDlg != nullptr && !g_clistApi.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 (!g_CLI.pfnGetEvent(hContact, 0))
- g_CLI.pfnAddEvent(&cle);
+ if (!g_clistApi.pfnGetEvent(hContact, 0))
+ g_clistApi.pfnAddEvent(&cle);
}
else {
- if (g_CLI.pfnGetEvent(hContact, 0))
- g_CLI.pfnRemoveEvent(hContact, GC_FAKE_EVENT);
- g_CLI.pfnAddEvent(&cle);
+ if (g_clistApi.pfnGetEvent(hContact, 0))
+ g_clistApi.pfnRemoveEvent(hContact, GC_FAKE_EVENT);
+ g_clistApi.pfnAddEvent(&cle);
}
return TRUE;
}
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp
index 345331ebb0..dfff3b975f 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 (g_CLI.pfnGetEvent(si->hContact, 0))
- g_CLI.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ if (g_clistApi.pfnGetEvent(si->hContact, 0))
+ g_clistApi.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 dfd627a4de..79c5022557 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 (g_CLI.pfnGetEvent(si->hContact, 0))
- g_CLI.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ if (g_clistApi.pfnGetEvent(si->hContact, 0))
+ g_clistApi.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 3eb5bebf8e..6869e431f1 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 (!g_CLI.bAutoRebuild && hWnd) {
- g_CLI.bAutoRebuild = true;
+ if (!g_clistApi.bAutoRebuild && hWnd) {
+ g_clistApi.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")) {
- g_CLI.pfnInvalidateDisplayNameCacheEntry(hContact);
+ g_clistApi.pfnInvalidateDisplayNameCacheEntry(hContact);
Clist_Broadcast(INTM_NAMECHANGED, hContact, lParam);
}
else if (!strcmp(cws->szSetting, "Group"))
@@ -142,7 +142,7 @@ static int ClcProtoAck(WPARAM, LPARAM lParam)
}
}
- g_CLI.pfnCluiProtocolStatusChanged(lParam, ack->szModule);
+ g_clistApi.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 g_CLI.pfnProcessExternalMessages(hwnd, dat, uMsg, wParam, lParam);
+ return g_clistApi.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;
- g_CLI.pfnLoadClcOptions(hwnd, dat, TRUE);
+ g_clistApi.pfnLoadClcOptions(hwnd, dat, TRUE);
if (!IsWindowVisible(hwnd))
SetTimer(hwnd, TIMERID_REBUILDAFTER, 10, nullptr);
else {
- g_CLI.pfnRebuildEntireList(hwnd, dat);
+ g_clistApi.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
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.pfnRecalcScrollBar(hwnd, dat);
}
break;
case INTM_RELOADOPTIONS:
- g_CLI.pfnLoadClcOptions(hwnd, dat, FALSE);
+ g_clistApi.pfnLoadClcOptions(hwnd, dat, FALSE);
Clist_SaveStateAndRebuildList(hwnd, dat);
break;
case WM_THEMECHANGED:
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case WM_SIZE:
Clist_EndRename(dat, 1);
KillTimer(hwnd, TIMERID_INFOTIP);
KillTimer(hwnd, TIMERID_RENAME);
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.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:
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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:
- g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_clistApi.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;
- g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_clistApi.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;
- g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_clistApi.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 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_clistApi.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
- g_CLI.pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
+ g_clistApi.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 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_clistApi.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 = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_clistApi.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);
- g_CLI.pfnInvalidateDisplayNameCacheEntry(wParam);
+ g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
}
break;
case INTM_INVALIDATE:
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
}
break;
case WM_PRINTCLIENT:
- g_CLI.pfnPaintClc(hwnd, dat, (HDC)wParam, nullptr);
+ g_clistApi.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 g_CLI.pfnInvalidateRect()'s that there is no point painting,
+ /* we get so many g_clistApi.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))
- g_CLI.pfnPaintClc(hwnd, dat, hdc, &ps.rcPaint);
+ g_clistApi.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;
}
- g_CLI.pfnScrollTo(hwnd, dat, desty, noSmooth);
+ g_clistApi.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;
- g_CLI.pfnScrollTo(hwnd, dat, dat->yScroll - (short)HIWORD(wParam) * dat->rowHeight * (signed)scrollLines / WHEEL_DELTA, 0);
+ g_clistApi.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 = g_CLI.pfnGetGroupContentsCount(&dat->list, 1) - 1; selMoved = 1; break;
+ case VK_END: dat->selection = g_clistApi.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: g_CLI.pfnBeginRenameSelection(hwnd, dat); return 0;
+ case VK_F2: g_clistApi.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 = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, &group);
+ hit = g_clistApi.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 = g_CLI.pfnGetRowsPriorTo(&dat->list, group, -1);
+ dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, group, -1);
selMoved = 1;
}
else {
if (contact->type == CLCIT_GROUP)
- g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, changeGroupExpand == 2);
+ g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, changeGroupExpand == 2);
return 0;
}
}
if (selMoved) {
if (!dat->bFilterSearch)
dat->szQuickSearch[0] = 0;
- if (dat->selection >= g_CLI.pfnGetGroupContentsCount(&dat->list, 1))
- dat->selection = g_CLI.pfnGetGroupContentsCount(&dat->list, 1) - 1;
+ if (dat->selection >= g_clistApi.pfnGetGroupContentsCount(&dat->list, 1))
+ dat->selection = g_clistApi.pfnGetGroupContentsCount(&dat->list, 1) - 1;
if (dat->selection < 0)
dat->selection = 0;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 (g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
+ if (g_clistApi.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
break;
if (contact->type != CLCIT_CONTACT)
break;
contact->flags ^= CONTACTF_CHECKED;
Clist_RecalculateGroupCheckboxes(dat);
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 = g_CLI.pfnFindRowByText(hwnd, dat, dat->szQuickSearch, 1);
+ index = g_clistApi.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);
}
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
}
else
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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:
- g_CLI.pfnBeginRenameSelection(hwnd, dat);
+ g_clistApi.pfnBeginRenameSelection(hwnd, dat);
break;
case TIMERID_DRAGAUTOSCROLL:
- g_CLI.pfnScrollTo(hwnd, dat, dat->yScroll + dat->dragAutoScrolling * dat->rowHeight * 2, 0);
+ g_clistApi.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 = g_CLI.pfnHitTest(hwnd, dat, it.ptCursor.x, it.ptCursor.y, &contact, nullptr, nullptr);
+ hit = g_clistApi.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 = g_CLI.pfnGetRowTopY(dat, hit) - dat->yScroll;
- it.rcItem.bottom = it.rcItem.top + g_CLI.pfnGetRowHeight(dat, hit);
+ it.rcItem.top = g_clistApi.pfnGetRowTopY(dat, hit) - dat->yScroll;
+ it.rcItem.bottom = it.rcItem.top + g_clistApi.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);
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
Clist_SaveStateAndRebuildList(hwnd, dat);
- g_CLI.bAutoRebuild = false;
+ g_clistApi.bAutoRebuild = false;
break;
case TIMERID_DELAYEDRESORTCLC:
KillTimer(hwnd, TIMERID_DELAYEDRESORTCLC);
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
- g_CLI.pfnSortCLC(hwnd, dat, 1);
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnSortCLC(hwnd, dat, 1);
+ g_clistApi.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 = g_CLI.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, &group, &hitFlags);
+ hit = g_clistApi.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 = g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, &selgroup);
- g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
+ dat->selection = g_clistApi.pfnGetRowByIndex(dat, dat->selection, &selcontact, &selgroup);
+ g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
if (dat->selection != -1) {
dat->selection =
- g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
if (dat->selection == -1)
- dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, contact->group, -1);
+ dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, contact->group, -1);
}
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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);
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 = g_CLI.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), nullptr, nullptr, nullptr);
+ dat->iHotTrack = g_clistApi.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);
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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) {
- g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
+ g_clistApi.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(g_CLI.hInst, MAKEINTRESOURCE(IDC_DROPUSER));
+ hNewCursor = LoadCursor(g_clistApi.hInst, MAKEINTRESOURCE(IDC_DROPUSER));
break;
case DROPTARGET_INSERTION:
- hNewCursor = LoadCursor(g_CLI.hInst, MAKEINTRESOURCE(IDC_DROPUSER));
+ hNewCursor = LoadCursor(g_clistApi.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;
- g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
+ g_clistApi.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:
- g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, nullptr, &group);
+ g_clistApi.pfnGetRowByIndex(dat, dat->iDragItem, nullptr, &group);
if (group->parent)
- hNewCursor = LoadCursor(g_CLI.hInst, MAKEINTRESOURCE(IDC_DROPUSER));
+ hNewCursor = LoadCursor(g_clistApi.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 = g_CLI.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), nullptr, nullptr, nullptr);
+ dat->iHotTrack = g_clistApi.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;
- g_CLI.pfnGetRowByIndex(dat, dat->selection, &contactn, nullptr);
- g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contacto, nullptr);
+ g_clistApi.pfnGetRowByIndex(dat, dat->selection, &contactn, nullptr);
+ g_clistApi.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:
- g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
+ g_clistApi.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
{
ClcContact *destcontact;
ClcGroup *destgroup;
- if (g_CLI.pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup) == -1 || destgroup != contact->group->parent)
+ if (g_clistApi.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:
- g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, nullptr);
+ g_clistApi.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:
- g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
+ g_clistApi.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
}
}
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 = g_CLI.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, nullptr, &hitFlags);
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ dat->selection = g_clistApi.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, nullptr, &hitFlags);
+ g_clistApi.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 = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
+ dat->selection = g_clistApi.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
if (dat->selection != -1)
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
pt.x = dat->iconXSpace + 15;
- pt.y = g_CLI.pfnGetRowTopY(dat, dat->selection) - dat->yScroll + (int)(g_CLI.pfnGetRowHeight(dat, dat->selection) * .7);
+ pt.y = g_clistApi.pfnGetRowTopY(dat, dat->selection) - dat->yScroll + (int)(g_clistApi.pfnGetRowHeight(dat, dat->selection) * .7);
hitFlags = (dat->selection == -1) ? CLCHT_NOWHERE : CLCHT_ONITEMLABEL;
}
else {
ScreenToClient(hwnd, &pt);
- dat->selection = g_CLI.pfnHitTest(hwnd, dat, pt.x, pt.y, &contact, nullptr, &hitFlags);
+ dat->selection = g_clistApi.pfnHitTest(hwnd, dat, pt.x, pt.y, &contact, nullptr, &hitFlags);
}
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
+ hit = g_clistApi.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:
- g_CLI.pfnBeginRenameSelection(hwnd, dat);
+ g_clistApi.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 572bdf1305..18fcd1daeb 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 = g_CLI.pfnHitTest(hwnd, dat, x, y, &contact, nullptr, &hitFlags);
+ int hit = g_clistApi.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;
}
- g_CLI.pfnTrayIconPauseAutoHide(0, 0);
+ g_clistApi.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;
- g_CLI.pfnScrollTo(hwndCurrentDrag, dat, dat->yScroll + (shortPt.y < dat->dragAutoScrollHeight ? -1 : 1) * dat->rowHeight * 2, 0);
+ g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwndCurrentDrag, nullptr, FALSE);
+ g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwndCurrentDrag, nullptr, FALSE);
+ g_clistApi.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 e624598861..817da20873 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 = g_CLI.pfnFindItem(dwItem, cc);
+ ClcContact *res = g_clistApi.pfnFindItem(dwItem, cc);
if (res != nullptr) {
if (isVisible) {
if (!nowVisible)
*isVisible = 0;
else {
- int posY = g_CLI.pfnGetRowTopY(dat, index+1);
+ int posY = g_clistApi.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 2d11498bb0..418fde4cd2 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 = g_CLI.pfnCreateClcContact();
+ ClcContact* newItem = g_clistApi.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 = g_CLI.pfnAddItemToGroup(group, i);
+ ClcContact *cc = g_clistApi.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) {
- g_CLI.pfnFreeContact(it);
+ g_clistApi.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 = g_CLI.pfnAddItemToGroup(group, i);
+ ClcContact *cc = g_clistApi.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 = g_CLI.pfnAddItemToGroup(group, index + 1);
+ ClcContact *cc = g_clistApi.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 = g_CLI.pfnAddGroup(hwnd, dat, tszGroup, (DWORD)-1, 0, 0);
+ group = g_clistApi.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] == '\\')
- g_CLI.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 1);
+ g_clistApi.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 1);
}
- group = g_CLI.pfnAddGroup(hwnd, dat, tszGroup, groupFlags, i, 1);
+ group = g_clistApi.pfnAddGroup(hwnd, dat, tszGroup, groupFlags, i, 1);
}
}
@@ -268,7 +268,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo
return;
}
}
- g_CLI.pfnAddContactToGroup(dat, group, hContact);
+ g_clistApi.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--;
- g_CLI.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
+ g_clistApi.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
}
- g_CLI.pfnFreeContact(group->cl[iContact]);
+ g_clistApi.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;
- g_CLI.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 0);
+ g_clistApi.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 0);
}
for (auto &hContact : Contacts()) {
- int nHiddenStatus = g_CLI.pfnGetContactHiddenStatus(hContact, nullptr, dat);
+ int nHiddenStatus = g_clistApi.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 = g_CLI.pfnAddGroup(hwnd, dat, tszGroupName, (DWORD)-1, 0, 0);
+ group = g_clistApi.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))
- g_CLI.pfnAddContactToGroup(dat, group, hContact);
+ g_clistApi.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) || g_CLI.pfnIsVisibleContact(pce, group))
- g_CLI.pfnAddContactToGroup(dat, group, hContact);
+ if (!Clist_IsHiddenMode(dat, ID_STATUS_OFFLINE) || g_clistApi.pfnIsVisibleContact(pce, group))
+ g_clistApi.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 if (!Clist_IsHiddenMode(dat, db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)) || g_clistApi.pfnIsVisibleContact(pce, group))
+ g_clistApi.pfnAddContactToGroup(dat, group, hContact);
}
- else g_CLI.pfnAddContactToGroup(dat, group, hContact);
+ else g_clistApi.pfnAddContactToGroup(dat, group, hContact);
}
}
}
@@ -427,7 +427,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat)
}
}
- g_CLI.pfnSortCLC(hwnd, dat, 0);
+ g_clistApi.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 = g_CLI.pfnCompareContacts(contact1[0], contact2[0]);
+ int result = g_clistApi.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 = g_CLI.pfnAddItemToGroup(group, i);
+ ClcContact *cc = g_clistApi.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 (g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) == -1)
+ if (g_clistApi.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 = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
}
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.pfnRecalcScrollBar(hwnd, dat);
}
dat->bNeedsResort = false;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
}
struct SavedContactState_t
@@ -663,7 +663,7 @@ MIR_APP_DLL(void) Clist_SaveStateAndRebuildList(HWND hwnd, ClcData *dat)
}
FreeGroup(&dat->list);
- g_CLI.pfnRebuildEntireList(hwnd, dat);
+ g_clistApi.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 = g_CLI.pfnAddInfoItemToGroup(group, it->contact.flags, L"");
+ ClcContact *cc = g_clistApi.pfnAddInfoItemToGroup(group, it->contact.flags, L"");
*cc = it->contact;
}
dat->bLockScrollbar = false;
Clist_RecalculateGroupCheckboxes(dat);
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.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 427f352e10..27fa517b22 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:
- g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 0);
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
- g_CLI.pfnSortCLC(hwnd, dat, 1);
+ g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, 1, 0);
+ g_clistApi.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.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;
- g_CLI.pfnAddGroup(hwnd, dat, szName, groupFlags, wParam, 0);
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.pfnAddGroup(hwnd, dat, szName, groupFlags, wParam, 0);
+ g_clistApi.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 = g_CLI.pfnAddInfoItemToGroup(group, cii->flags, wszText);
+ cc = g_clistApi.pfnAddInfoItemToGroup(group, cii->flags, wszText);
mir_free(wszText);
}
- else cc = g_CLI.pfnAddInfoItemToGroup(group, cii->flags, cii->pszText);
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ else cc = g_clistApi.pfnAddInfoItemToGroup(group, cii->flags, cii->pszText);
+ g_clistApi.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);
- g_CLI.pfnSortCLC(hwnd, dat, 1);
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.pfnSortCLC(hwnd, dat, 1);
+ g_clistApi.pfnRecalcScrollBar(hwnd, dat);
break;
case CLM_EDITLABEL:
SendMessage(hwnd, CLM_SELECTITEM, wParam, 0);
- g_CLI.pfnBeginRenameSelection(hwnd, dat);
+ g_clistApi.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)
- g_CLI.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
- Clist_EnsureVisible(hwnd, dat, g_CLI.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact)), 0);
+ g_clistApi.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
+ Clist_EnsureVisible(hwnd, dat, g_clistApi.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)
- g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, lParam);
+ g_clistApi.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 g_CLI.pfnGetGroupContentsCount(&dat->list, 0);
+ return g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 (g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
+ if (g_clistApi.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 = g_CLI.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, nullptr, &hitFlags);
+ int hit = g_clistApi.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)
- g_CLI.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
- dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact));
+ g_clistApi.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
+ dat->selection = g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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);
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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)
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
}
}
break;
case CLM_SETEXTRAIMAGELIST:
dat->himlExtraColumns = (HIMAGELIST)lParam;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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))
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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));
- g_CLI.pfnSortCLC(hwnd, dat, 1);
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.pfnSortCLC(hwnd, dat, 1);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
break;
case CLM_SETLEFTMARGIN:
dat->leftMargin = wParam;
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 00e920c3aa..c827c8be1a 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 = g_CLI.pfnRowHitTest(dat, dat->yScroll + testy);
+ int hit = g_clistApi.pfnRowHitTest(dat, dat->yScroll + testy);
if (hit != -1)
- hit = g_CLI.pfnGetRowByIndex(dat, hit, &hitcontact, &hitgroup);
+ hit = g_clistApi.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 = g_CLI.pfnGetRowTotalHeight(dat) - clRect.bottom;
+ int maxy = g_clistApi.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
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ g_clistApi.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 = g_CLI.pfnGetRowTopY(dat, iItem), itemh = g_CLI.pfnGetRowHeight(dat, iItem), newY = 0;
+ int itemy = g_clistApi.pfnGetRowTopY(dat, iItem), itemh = g_clistApi.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)
- g_CLI.pfnScrollTo(hwnd, dat, newY, 0);
+ g_clistApi.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 = g_CLI.pfnGetRowTotalHeight(dat)-1;
+ si.nMax = g_clistApi.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);
- g_CLI.pfnScrollTo(hwnd, dat, dat->yScroll, 1);
+ g_clistApi.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;
}
- g_CLI.pfnInvalidateRect(hwnd, nullptr, FALSE);
- contentCount = g_CLI.pfnGetGroupContentsCount(group, 1);
- groupy = g_CLI.pfnGetRowsPriorTo(&dat->list, group, -1);
+ g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
+ contentCount = g_clistApi.pfnGetGroupContentsCount(group, 1);
+ groupy = g_clistApi.pfnGetRowsPriorTo(&dat->list, group, -1);
if (dat->selection > groupy && dat->selection < groupy + contentCount)
dat->selection = groupy;
GetClientRect(hwnd, &clRect);
newY = dat->yScroll;
- posY = g_CLI.pfnGetRowBottomY(dat, groupy + contentCount);
+ posY = g_clistApi.pfnGetRowBottomY(dat, groupy + contentCount);
if (posY >= newY + clRect.bottom)
newY = posY - clRect.bottom;
- posY = g_CLI.pfnGetRowTopY(dat, groupy);
+ posY = g_clistApi.pfnGetRowTopY(dat, groupy);
if (newY > posY)
newY = posY;
- g_CLI.pfnRecalcScrollBar(hwnd, dat);
+ g_clistApi.pfnRecalcScrollBar(hwnd, dat);
if (group->expanded)
- g_CLI.pfnScrollTo(hwnd, dat, newY, 0);
+ g_clistApi.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 (g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
+ if (g_clistApi.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
return;
if (contact->type == CLCIT_GROUP)
- g_CLI.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
+ g_clistApi.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)
- g_CLI.pfnSetGroupExpand(hwnd, dat, group, 1);
- return g_CLI.pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
+ g_clistApi.pfnSetGroupExpand(hwnd, dat, group, 1);
+ return g_clistApi.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 (g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) != -1) {
+ if (g_clistApi.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) {
- g_CLI.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
+ g_clistApi.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 (g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr) == -1)
+ if (g_clistApi.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 = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, &group);
+ dat->selection = g_clistApi.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 = 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);
+ int h = g_clistApi.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_clistApi.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 = g_CLI.pfnGetRowTopY(dat, dat->selection) - dat->yScroll;
+ result->y = g_clistApi.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 = g_CLI.pfnHitTest(hwnd, dat, pt.x, pt.y, &contact, &group, &hitFlags);
- g_CLI.pfnGetRowByIndex(dat, dat->iDragItem, &movecontact, &movegroup);
+ int hit = g_clistApi.pfnHitTest(hwnd, dat, pt.x, pt.y, &contact, &group, &hitFlags);
+ g_clistApi.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 < g_CLI.pfnGetRowTopY(dat, hit) + dat->insertionMarkHitHeight) {
+ if (pt.y + dat->yScroll < g_clistApi.pfnGetRowTopY(dat, hit) + dat->insertionMarkHitHeight) {
//could be insertion mark (above)
topItem = hit - 1;
bottomItem = hit;
bottomcontact = contact;
- topItem = g_CLI.pfnGetRowByIndex(dat, topItem, &topcontact, &topgroup);
+ topItem = g_clistApi.pfnGetRowByIndex(dat, topItem, &topcontact, &topgroup);
ok = 1;
}
- if (pt.y + dat->yScroll >= g_CLI.pfnGetRowBottomY(dat, hit+1) - dat->insertionMarkHitHeight) {
+ if (pt.y + dat->yScroll >= g_clistApi.pfnGetRowBottomY(dat, hit+1) - dat->insertionMarkHitHeight) {
//could be insertion mark (below)
topItem = hit;
bottomItem = hit + 1;
topcontact = contact;
topgroup = group;
- bottomItem = g_CLI.pfnGetRowByIndex(dat, bottomItem, &bottomcontact, nullptr);
+ bottomItem = g_clistApi.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)
{
- g_CLI.pfnGetDefaultFontSetting(i, lf, colour);
+ g_clistApi.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 (g_CLI.hwndContactTree != nullptr && hwnd != g_CLI.hwndContactTree) {
+ if (g_clistApi.hwndContactTree != nullptr && hwnd != g_clistApi.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);
- g_CLI.pfnSetContactCheckboxes(cc, checked);
+ g_clistApi.pfnSetContactCheckboxes(cc, checked);
}
else if (cc->type == CLCIT_CONTACT)
- g_CLI.pfnSetContactCheckboxes(cc, checked);
+ g_clistApi.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 = g_CLI.pfnGetRowTopY(dat, iItem) - dat->yScroll;
- rc.bottom = rc.top + g_CLI.pfnGetRowHeight(dat, iItem);
- g_CLI.pfnInvalidateRect(hwnd, &rc, FALSE);
+ rc.top = g_clistApi.pfnGetRowTopY(dat, iItem) - dat->yScroll;
+ rc.bottom = rc.top + g_clistApi.pfnGetRowHeight(dat, iItem);
+ g_clistApi.pfnInvalidateRect(hwnd, &rc, FALSE);
}
///////////////////////////////////////////////////////////////////////////////
@@ -877,7 +877,7 @@ int fnGetRowBottomY(ClcData *dat, int item)
int fnGetRowTotalHeight(ClcData *dat)
{
- return dat->rowHeight * g_CLI.pfnGetGroupContentsCount(&dat->list, 1);
+ return dat->rowHeight * g_clistApi.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 a6454e62f3..b4a6bc2109 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);
-MIR_APP_DLL(CLIST_INTERFACE) g_CLI;
+MIR_APP_EXPORT CLIST_INTERFACE g_clistApi;
static wchar_t szTip[MAX_TIP_SIZE+1];
@@ -58,79 +58,79 @@ static int fnIsVisibleContact(ClcCacheEntry*, ClcGroup*)
void InitClistCore()
{
- g_CLI.menuProtos = &g_menuProtos;
+ g_clistApi.menuProtos = &g_menuProtos;
- g_CLI.pfnContactListControlWndProc = fnContactListControlWndProc;
+ g_clistApi.pfnContactListControlWndProc = fnContactListControlWndProc;
- g_CLI.pfnGetRowsPriorTo = fnGetRowsPriorTo;
- g_CLI.pfnFindItem = fnFindItem;
- g_CLI.pfnGetRowByIndex = fnGetRowByIndex;
- g_CLI.pfnGetContactHiddenStatus = fnGetContactHiddenStatus;
+ g_clistApi.pfnGetRowsPriorTo = fnGetRowsPriorTo;
+ g_clistApi.pfnFindItem = fnFindItem;
+ g_clistApi.pfnGetRowByIndex = fnGetRowByIndex;
+ g_clistApi.pfnGetContactHiddenStatus = fnGetContactHiddenStatus;
- g_CLI.pfnAddGroup = fnAddGroup;
- g_CLI.pfnAddItemToGroup = fnAddItemToGroup;
- g_CLI.pfnCreateClcContact = fnCreateClcContact;
+ g_clistApi.pfnAddGroup = fnAddGroup;
+ g_clistApi.pfnAddItemToGroup = fnAddItemToGroup;
+ g_clistApi.pfnCreateClcContact = fnCreateClcContact;
- 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;
+ g_clistApi.pfnFreeContact = fnFreeContact;
+ g_clistApi.pfnAddInfoItemToGroup = fnAddInfoItemToGroup;
+ g_clistApi.pfnAddContactToGroup = fnAddContactToGroup;
+ g_clistApi.pfnAddContactToTree = fnAddContactToTree;
+ g_clistApi.pfnRebuildEntireList = fnRebuildEntireList;
+ g_clistApi.pfnGetGroupContentsCount = fnGetGroupContentsCount;
+ g_clistApi.pfnSortCLC = fnSortCLC;
+
+ g_clistApi.pfnProcessExternalMessages = fnProcessExternalMessages;
+
+ g_clistApi.pfnPaintClc = fnPaintClc;
+
+ g_clistApi.pfnHitTest = fnHitTest;
+ g_clistApi.pfnScrollTo = fnScrollTo;
+ g_clistApi.pfnRecalcScrollBar = fnRecalcScrollBar;
+ g_clistApi.pfnSetGroupExpand = fnSetGroupExpand;
+ g_clistApi.pfnFindRowByText = fnFindRowByText;
+ g_clistApi.pfnBeginRenameSelection = fnBeginRenameSelection;
+ g_clistApi.pfnIsVisibleContact = fnIsVisibleContact;
+ g_clistApi.pfnGetDefaultFontSetting = fnGetDefaultFontSetting;
+ g_clistApi.pfnLoadClcOptions = fnLoadClcOptions;
+ g_clistApi.pfnGetRowBottomY = fnGetRowBottomY;
+ g_clistApi.pfnGetRowHeight = fnGetRowHeight;
+ g_clistApi.pfnGetRowTopY = fnGetRowTopY;
+ g_clistApi.pfnGetRowTotalHeight = fnGetRowTotalHeight;
+ g_clistApi.pfnRowHitTest = fnRowHitTest;
+
+ g_clistApi.pfnAddEvent = fnAddEvent;
+ g_clistApi.pfnGetEvent = fnGetEvent;
+ g_clistApi.pfnGetImlIconIndex = fnGetImlIconIndex;
+ g_clistApi.pfnRemoveEvent = fnRemoveEvent;
+
+ g_clistApi.pfnInvalidateDisplayNameCacheEntry = fnInvalidateDisplayNameCacheEntry;
+ g_clistApi.pfnCreateCacheItem = fnCreateCacheItem;
+ g_clistApi.pfnCheckCacheItem = fnCheckCacheItem;
+ g_clistApi.pfnFreeCacheItem = fnFreeCacheItem;
+
+ g_clistApi.szTip = szTip;
+
+ g_clistApi.pfnTrayIconInit = fnTrayIconInit;
+ g_clistApi.pfnTrayIconPauseAutoHide = fnTrayIconPauseAutoHide;
+ g_clistApi.pfnTrayIconProcessMessage = fnTrayIconProcessMessage;
+
+ g_clistApi.pfnContactListWndProc = fnContactListWndProc;
+ g_clistApi.pfnLoadCluiGlobalOpts = fnLoadCluiGlobalOpts;
+ g_clistApi.pfnCluiProtocolStatusChanged = fnCluiProtocolStatusChanged;
+ g_clistApi.pfnInvalidateRect = fnInvalidateRect;
+ g_clistApi.pfnOnCreateClc = fnOnCreateClc;
+
+ g_clistApi.pfnSetHideOffline = fnSetHideOffline;
+
+ g_clistApi.pfnDocking_ProcessWindowMessage = fnDocking_ProcessWindowMessage;
+
+ g_clistApi.pfnGetIconFromStatusMode = fnGetIconFromStatusMode;
+ g_clistApi.pfnGetWindowVisibleState = fnGetWindowVisibleState;
+ g_clistApi.pfnIconFromStatusMode = fnIconFromStatusMode;
+ g_clistApi.pfnShowHide = fnShowHide;
+
+ g_clistApi.pfnTrayCalcChanged = fnTrayCalcChanged;
+ g_clistApi.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 &g_CLI;
+ return &g_clistApi;
}
diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp
index 76e4116313..9e7c61af1a 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 = g_CLI.trayIconCount;
+ int nTrayCnt = g_clistApi.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*)*g_CLI.trayIconCount);
+ char **pTrayProtos = (char**)_alloca(sizeof(char*)*g_clistApi.trayIconCount);
int nTrayProtoCnt = 0;
- 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_clistApi.trayIconCount; i++)
+ if (g_clistApi.trayIcon[i].id != 0 && g_clistApi.trayIcon[i].szProto)
+ pTrayProtos[nTrayProtoCnt++] = g_clistApi.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)
- g_CLI.pfnRemoveEvent(e.hContact, e.hDbEvent);
+ g_clistApi.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);
- g_CLI.pfnRemoveEvent(hContact, hDbEvent);
+ g_clistApi.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 (g_CLI.trayIconCount > 1 && index > 0) {
+ if (g_clistApi.trayIconCount > 1 && index > 0) {
char *szProto = nullptr;
- for (int i = 0; i < g_CLI.trayIconCount; i++) {
- if (g_CLI.trayIcon[i].id == index) {
- szProto = g_CLI.trayIcon[i].szProto;
+ for (int i = 0; i < g_clistApi.trayIconCount; i++) {
+ if (g_clistApi.trayIcon[i].id == index) {
+ szProto = g_clistApi.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 < g_CLI.trayIconCount; j++)
- if (g_CLI.trayIcon[j].szProto && !_strcmpi(eventProto, g_CLI.trayIcon[j].szProto))
+ for (j = 0; j < g_clistApi.trayIconCount; j++)
+ if (g_clistApi.trayIcon[j].szProto && !_strcmpi(eventProto, g_clistApi.trayIcon[j].szProto))
break;
- if (j == g_CLI.trayIconCount) {
+ if (j == g_clistApi.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);
- g_CLI.pfnRemoveEvent(hContact, hDbEvent);
+ g_clistApi.pfnRemoveEvent(hContact, hDbEvent);
return 0;
}
@@ -368,7 +368,7 @@ static int CListEventSettingsChanged(WPARAM hContact, LPARAM lParam)
int InitCListEvents(void)
{
- g_CLI.events = &g_cliEvents;
+ g_clistApi.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 df58d3d70f..c49f028d62 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(g_CLI.hwndContactList, szQuestion, TranslateT("Delete group"), MB_YESNO | MB_ICONQUESTION) == IDNO)
+ if (MessageBox(g_clistApi.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 c93e0a4ae1..7b31bc49df 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, g_CLI.pfnIconFromStatusMode(szProto, status, hContact), ILD_NORMAL);
+ return ImageList_GetIcon(hCListImages, g_clistApi.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 g_CLI.pfnIconFromStatusMode(szProto,
+ return g_clistApi.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();
- g_CLI.bAutoRebuild = true;
+ g_clistApi.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();
- g_CLI.pfnInvalidateRect(g_CLI.hwndContactList, nullptr, TRUE);
+ g_clistApi.pfnInvalidateRect(g_clistApi.hwndContactList, nullptr, TRUE);
return 0;
}
@@ -309,7 +309,7 @@ int fnShowHide()
{
BOOL bShow = FALSE;
- int iVisibleState = g_CLI.pfnGetWindowVisibleState(g_CLI.hwndContactList, 0, 0);
+ int iVisibleState = g_clistApi.pfnGetWindowVisibleState(g_clistApi.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 g_CLI.hwndContactList and iStepX and iStepY are right.
+ case -1: //We can't get here, both g_clistApi.hwndContactList and iStepX and iStepY are right.
return 0;
}
if (bShow == TRUE) {
- ShowWindow(g_CLI.hwndContactList, SW_RESTORE);
+ ShowWindow(g_clistApi.hwndContactList, SW_RESTORE);
if (!db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
- SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos(g_clistApi.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
else
- SetWindowPos(g_CLI.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ SetWindowPos(g_clistApi.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- SetForegroundWindow(g_CLI.hwndContactList);
+ SetForegroundWindow(g_clistApi.hwndContactList);
db_set_b(0, "CList", "State", SETTING_STATE_NORMAL);
// this forces the window onto the visible screen
RECT rcWindow;
- GetWindowRect(g_CLI.hwndContactList, &rcWindow);
+ GetWindowRect(g_clistApi.hwndContactList, &rcWindow);
if (Utils_AssertInsideScreen(&rcWindow) == 1)
- MoveWindow(g_CLI.hwndContactList, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE);
+ MoveWindow(g_clistApi.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(g_CLI.hwndContactList, SW_HIDE);
+ ShowWindow(g_clistApi.hwndContactList, SW_HIDE);
db_set_b(0, "CList", "State", SETTING_STATE_HIDDEN);
}
else {
- ShowWindow(g_CLI.hwndContactList, SW_MINIMIZE);
+ ShowWindow(g_clistApi.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(g_CLI.hwndContactTree, 0);
+ ClcData *dat = (ClcData*)GetWindowLongPtr(g_clistApi.hwndContactTree, 0);
if (dat != nullptr) {
ClcContact *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);
+ if (Clist_FindItem(g_clistApi.hwndContactTree, dat, hContact1, &p1, nullptr, nullptr) && Clist_FindItem(g_clistApi.hwndContactTree, dat, hContact2, &p2, nullptr, nullptr))
+ return g_clistApi.pfnCompareContacts(p1, p2);
}
return 0;
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp
index 3cf2daa8a5..cc8020975c 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) {
- g_CLI.pfnFreeCacheItem(it);
+ g_clistApi.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 = g_CLI.pfnCreateCacheItem(hContact);
+ p = g_clistApi.pfnCreateCacheItem(hContact);
if (p == nullptr)
return nullptr;
clistCache.insert(p);
- g_CLI.pfnInvalidateDisplayNameCacheEntry(hContact);
+ g_clistApi.pfnInvalidateDisplayNameCacheEntry(hContact);
}
else p = clistCache[idx];
- g_CLI.pfnCheckCacheItem(p);
+ g_clistApi.pfnCheckCacheItem(p);
return p;
}
@@ -104,12 +104,12 @@ void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact)
{
if (hContact == INVALID_CONTACT_ID) {
FreeDisplayNameCache();
- Clist_InitAutoRebuild(g_CLI.hwndContactTree);
+ Clist_InitAutoRebuild(g_clistApi.hwndContactTree);
}
else {
int idx = clistCache.getIndex((ClcCacheEntry*)&hContact);
if (idx != -1)
- g_CLI.pfnFreeCacheItem(clistCache[idx]);
+ g_clistApi.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, g_CLI.pfnIconFromStatusMode(GetContactProto(hContact), ID_STATUS_OFFLINE, 0));
+ Clist_ChangeContactIcon(hContact, g_clistApi.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) {
- g_CLI.pfnFreeCacheItem(clistCache[idx]);
+ g_clistApi.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)
- g_CLI.pfnRemoveEvent(hContact, it->hDbEvent);
+ g_clistApi.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);
- g_CLI.pfnCheckCacheItem(pdnce);
+ g_clistApi.pfnCheckCacheItem(pdnce);
}
else if (!strcmp(cws->szSetting, "Status")) {
if (!db_get_b(hContact, "CList", "Hidden", 0))
- Clist_ChangeContactIcon(hContact, g_CLI.pfnIconFromStatusMode(cws->szModule, cws->value.wVal, hContact));
+ Clist_ChangeContactIcon(hContact, g_clistApi.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, g_CLI.pfnIconFromStatusMode(szProto, szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact));
+ Clist_ChangeContactIcon(hContact, g_clistApi.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);
- g_CLI.pfnCheckCacheItem(pdnce);
+ g_clistApi.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,
- g_CLI.pfnIconFromStatusMode(szProto, szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact));
+ g_clistApi.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 72764cd553..0f18e7329c 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(g_CLI.hwndContactList, hIcon, szNewTip);
+ pTaskbarInterface->SetOverlayIcon(g_clistApi.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(g_CLI.szTip, MAX_TIP_SIZE, szPrefix, _TRUNCATE);
- return g_CLI.szTip;
+ wcsncpy_s(g_clistApi.szTip, MAX_TIP_SIZE, szPrefix, _TRUNCATE);
+ return g_clistApi.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(g_CLI.szTip, MAX_TIP_SIZE, tszTip, _TRUNCATE);
+ wcsncpy_s(g_clistApi.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(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);
+ mir_snwprintf(g_clistApi.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(g_CLI.szTip, MAX_TIP_SIZE, L"%s%s<b>%-12.12s</b>\t%s", szPrefix, szSeparator, pa->tszAccountName, szStatus);
+ mir_snwprintf(g_clistApi.szTip, MAX_TIP_SIZE, L"%s%s<b>%-12.12s</b>\t%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_snwprintf(g_clistApi.szTip, MAX_TIP_SIZE, L"%s%s%s %s", szPrefix, szSeparator, pa->tszAccountName, szStatus);
}
- else mir_wstrncpy(g_CLI.szTip, szPrefix, MAX_TIP_SIZE);
+ else mir_wstrncpy(g_clistApi.szTip, szPrefix, MAX_TIP_SIZE);
}
else {
if (hasTips()) {
if (ProtoXStatus != nullptr)
- mir_snwprintf(g_CLI.szTip, MAX_TIP_SIZE, L"<b>%-12.12s</b>\t%s\n%-24.24s", pa->tszAccountName, szStatus, ProtoXStatus);
+ mir_snwprintf(g_clistApi.szTip, MAX_TIP_SIZE, L"<b>%-12.12s</b>\t%s\n%-24.24s", pa->tszAccountName, szStatus, ProtoXStatus);
else
- mir_snwprintf(g_CLI.szTip, MAX_TIP_SIZE, L"<b>%-12.12s</b>\t%s", pa->tszAccountName, szStatus);
+ mir_snwprintf(g_clistApi.szTip, MAX_TIP_SIZE, L"<b>%-12.12s</b>\t%s", pa->tszAccountName, szStatus);
}
- else mir_snwprintf(g_CLI.szTip, MAX_TIP_SIZE, L"%s %s", pa->tszAccountName, szStatus);
+ else mir_snwprintf(g_clistApi.szTip, MAX_TIP_SIZE, L"%s %s", pa->tszAccountName, szStatus);
}
}
}
- return g_CLI.szTip;
+ return g_clistApi.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 < g_CLI.trayIconCount; i++)
- if (g_CLI.trayIcon[i].id == 0)
+ for (i = 0; i < g_clistApi.trayIconCount; i++)
+ if (g_clistApi.trayIcon[i].id == 0)
break;
- trayIconInfo_t &p = g_CLI.trayIcon[i];
+ trayIconInfo_t &p = g_clistApi.trayIcon[i];
p.id = TRAYICON_ID_BASE + i;
p.szProto = (char*)szProto;
- p.hBaseIcon = g_CLI.pfnGetIconFromStatusMode(0, szIconProto ? szIconProto : p.szProto, status);
+ p.hBaseIcon = g_clistApi.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, g_CLI.szTip, _countof(nid.szTip));
- replaceStrW(p.ptszToolTip, g_CLI.szTip);
+ mir_wstrncpy(nid.szTip, g_clistApi.szTip, _countof(nid.szTip));
+ replaceStrW(p.ptszToolTip, g_clistApi.szTip);
Shell_NotifyIcon(NIM_ADD, &nid);
p.isBase = 1;
- if (g_CLI.trayIconCount == 1)
- SetTaskBarIcon(g_CLI.trayIcon[0].hBaseIcon, g_CLI.szTip);
+ if (g_clistApi.trayIconCount == 1)
+ SetTaskBarIcon(g_clistApi.trayIcon[0].hBaseIcon, g_clistApi.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 < g_CLI.trayIconCount; i++) {
- trayIconInfo_t *pii = &g_CLI.trayIcon[i];
+ for (int i = 0; i < g_clistApi.trayIconCount; i++) {
+ trayIconInfo_t *pii = &g_clistApi.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 (g_CLI.trayIconCount == 1)
+ if (g_clistApi.trayIconCount == 1)
SetTaskBarIcon(nullptr, nullptr);
}
@@ -225,10 +225,10 @@ int fnTrayIconInit(HWND hwnd)
CycleTimerId = 0;
}
- g_CLI.trayIconCount = 1;
+ g_clistApi.trayIconCount = 1;
if (netProtoCount) {
- g_CLI.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t) * accounts.getCount());
+ g_clistApi.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))) {
- g_CLI.trayIconCount = netProtoCount;
+ g_clistApi.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 {
- g_CLI.trayIcon = (trayIconInfo_t*)mir_calloc(sizeof(trayIconInfo_t));
+ g_clistApi.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 (g_CLI.trayIconCount == 1)
+ if (g_clistApi.trayIconCount == 1)
SetTaskBarIcon(nullptr, nullptr);
NOTIFYICONDATA nid = { NOTIFYICONDATA_V2_SIZE };
nid.hWnd = hwnd;
- for (int i = 0; i < g_CLI.trayIconCount; i++) {
- if (g_CLI.trayIcon[i].id == 0)
+ for (int i = 0; i < g_clistApi.trayIconCount; i++) {
+ if (g_clistApi.trayIcon[i].id == 0)
continue;
- nid.uID = g_CLI.trayIcon[i].id;
+ nid.uID = g_clistApi.trayIcon[i].id;
Shell_NotifyIcon(NIM_DELETE, &nid);
- DestroyIcon(g_CLI.trayIcon[i].hBaseIcon);
- mir_free(g_CLI.trayIcon[i].ptszToolTip);
+ DestroyIcon(g_clistApi.trayIcon[i].hBaseIcon);
+ mir_free(g_clistApi.trayIcon[i].ptszToolTip);
}
- mir_free(g_CLI.trayIcon);
- g_CLI.trayIcon = nullptr;
- g_CLI.trayIconCount = 0;
+ mir_free(g_clistApi.trayIcon);
+ g_clistApi.trayIcon = nullptr;
+ g_clistApi.trayIconCount = 0;
return 0;
}
@@ -297,7 +297,7 @@ void TrayIconTaskbarCreated(HWND hwnd)
{
initcheck;
Clist_TrayIconDestroy(hwnd);
- g_CLI.pfnTrayIconInit(hwnd);
+ g_clistApi.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 = g_CLI.hwndContactList;
+ nid.hWnd = g_clistApi.hwndContactList;
nid.uFlags = NIF_ICON | NIF_TIP;
nid.hIcon = hNewIcon;
if (!hNewIcon)
return -1;
- for (int i = 0; i < g_CLI.trayIconCount; i++) {
- if (g_CLI.trayIcon[i].id == 0)
+ for (int i = 0; i < g_clistApi.trayIconCount; i++) {
+ if (g_clistApi.trayIcon[i].id == 0)
continue;
- if (mir_strcmp(g_CLI.trayIcon[i].szProto, szPreferredProto))
+ if (mir_strcmp(g_clistApi.trayIcon[i].szProto, szPreferredProto))
continue;
- nid.uID = g_CLI.trayIcon[i].id;
- Clist_TrayIconMakeTooltip(szNewTip, g_CLI.trayIcon[i].szProto);
- replaceStrW(g_CLI.trayIcon[i].ptszToolTip, g_CLI.szTip);
+ nid.uID = g_clistApi.trayIcon[i].id;
+ Clist_TrayIconMakeTooltip(szNewTip, g_clistApi.trayIcon[i].szProto);
+ replaceStrW(g_clistApi.trayIcon[i].ptszToolTip, g_clistApi.szTip);
if (!hasTips())
- mir_wstrncpy(nid.szTip, g_CLI.szTip, _countof(nid.szTip));
+ mir_wstrncpy(nid.szTip, g_clistApi.szTip, _countof(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
- if (g_CLI.trayIconCount == 1)
- SetTaskBarIcon(hNewIcon, g_CLI.szTip);
+ if (g_clistApi.trayIconCount == 1)
+ SetTaskBarIcon(hNewIcon, g_clistApi.szTip);
else
SetTaskBarIcon(nullptr, nullptr);
- g_CLI.trayIcon[i].isBase = isBase;
+ g_clistApi.trayIcon[i].isBase = isBase;
return i;
}
// if there wasn't a suitable icon, change all the icons
- for (int i = 0; i < g_CLI.trayIconCount; i++) {
- if (g_CLI.trayIcon[i].id == 0)
+ for (int i = 0; i < g_clistApi.trayIconCount; i++) {
+ if (g_clistApi.trayIcon[i].id == 0)
continue;
- nid.uID = g_CLI.trayIcon[i].id;
+ nid.uID = g_clistApi.trayIcon[i].id;
- Clist_TrayIconMakeTooltip(szNewTip, g_CLI.trayIcon[i].szProto);
- replaceStrW(g_CLI.trayIcon[i].ptszToolTip, g_CLI.szTip);
+ Clist_TrayIconMakeTooltip(szNewTip, g_clistApi.trayIcon[i].szProto);
+ replaceStrW(g_clistApi.trayIcon[i].ptszToolTip, g_clistApi.szTip);
if (!hasTips())
- mir_wstrncpy(nid.szTip, g_CLI.szTip, _countof(nid.szTip));
+ mir_wstrncpy(nid.szTip, g_clistApi.szTip, _countof(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
- if (g_CLI.trayIconCount == 1)
- SetTaskBarIcon(hNewIcon, g_CLI.szTip);
+ if (g_clistApi.trayIconCount == 1)
+ SetTaskBarIcon(hNewIcon, g_clistApi.szTip);
else
SetTaskBarIcon(nullptr, nullptr);
- g_CLI.trayIcon[i].isBase = isBase;
+ g_clistApi.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 < g_CLI.trayIconCount; i++) {
- if (g_CLI.trayIcon[i].id == 0)
+ for (int i = 0; i < g_clistApi.trayIconCount; i++) {
+ if (g_clistApi.trayIcon[i].id == 0)
continue;
- if (mir_strcmp(g_CLI.trayIcon[i].szProto, szPreferredProto))
+ if (mir_strcmp(g_clistApi.trayIcon[i].szProto, szPreferredProto))
continue;
- DestroyIcon(g_CLI.trayIcon[i].hBaseIcon);
- g_CLI.trayIcon[i].hBaseIcon = hIcon;
+ DestroyIcon(g_clistApi.trayIcon[i].hBaseIcon);
+ g_clistApi.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 < g_CLI.trayIconCount; i++) {
- if (g_CLI.trayIcon[i].id == 0)
+ for (int i = 0; i < g_clistApi.trayIconCount; i++) {
+ if (g_clistApi.trayIcon[i].id == 0)
continue;
- DestroyIcon(g_CLI.trayIcon[i].hBaseIcon);
- g_CLI.trayIcon[i].hBaseIcon = hIcon;
+ DestroyIcon(g_clistApi.trayIcon[i].hBaseIcon);
+ g_clistApi.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;) {
- g_CLI.cycleStep = (g_CLI.cycleStep + 1) % accounts.getCount();
- if (accounts[g_CLI.cycleStep]->IsVisible())
+ g_clistApi.cycleStep = (g_clistApi.cycleStep + 1) % accounts.getCount();
+ if (accounts[g_clistApi.cycleStep]->IsVisible())
break;
}
if (i) {
- 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);
+ DestroyIcon(g_clistApi.trayIcon[0].hBaseIcon);
+ g_clistApi.trayIcon[0].hBaseIcon = g_clistApi.pfnGetIconFromStatusMode(0, accounts[g_clistApi.cycleStep]->szModuleName, accounts[g_clistApi.cycleStep]->iRealStatus);
+ if (g_clistApi.trayIcon[0].isBase)
+ TrayIconUpdate(g_clistApi.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))
- g_CLI.cycleStep = accounts.indexOf(&it);
+ g_clistApi.cycleStep = accounts.indexOf(&it);
- 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 changed = g_clistApi.pfnTrayCalcChanged(szChangedProto, averageMode, netProtoCount);
+ if (changed != -1 && g_clistApi.trayIcon[changed].isBase)
+ TrayIconUpdate(g_clistApi.trayIcon[changed].hBaseIcon, nullptr, g_clistApi.trayIcon[changed].szProto, 1);
}
int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount)
{
if (netProtoCount == 0)
- return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, g_CLI.pfnIconFromStatusMode(nullptr, averageMode, 0), ILD_NORMAL), nullptr);
+ return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, g_clistApi.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(g_CLI.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
+ return Clist_TrayIconSetBaseInfo(g_clistApi.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
if (db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
- return Clist_TrayIconSetBaseInfo(g_CLI.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto)), (char*)szChangedProto);
+ return Clist_TrayIconSetBaseInfo(g_clistApi.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto)), (char*)szChangedProto);
- if (g_CLI.trayIcon == nullptr || g_CLI.trayIcon[0].szProto == nullptr)
- return Clist_TrayIconSetBaseInfo(g_CLI.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
+ if (g_clistApi.trayIcon == nullptr || g_clistApi.trayIcon[0].szProto == nullptr)
+ return Clist_TrayIconSetBaseInfo(g_clistApi.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
- Clist_TrayIconDestroy(g_CLI.hwndContactList);
- g_CLI.pfnTrayIconInit(g_CLI.hwndContactList);
+ Clist_TrayIconDestroy(g_clistApi.hwndContactList);
+ g_clistApi.pfnTrayIconInit(g_clistApi.hwndContactList);
}
else {
switch (trayIconSetting) {
case SETTING_TRAYICON_CYCLE:
Clist_TraySetTimer();
- return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, g_CLI.pfnIconFromStatusMode(szChangedProto, Proto_GetStatus(szChangedProto), 0), ILD_NORMAL), nullptr);
+ return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, g_clistApi.pfnIconFromStatusMode(szChangedProto, Proto_GetStatus(szChangedProto), 0), ILD_NORMAL), nullptr);
case SETTING_TRAYICON_MULTI:
- if (!g_CLI.trayIcon)
+ if (!g_clistApi.trayIcon)
Clist_TrayIconRemove(nullptr, nullptr);
- 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 if ((g_clistApi.trayIconCount > 1 || netProtoCount == 1) || db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
+ return Clist_TrayIconSetBaseInfo(g_clistApi.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto)), (char*)szChangedProto);
else {
- Clist_TrayIconDestroy(g_CLI.hwndContactList);
- g_CLI.pfnTrayIconInit(g_CLI.hwndContactList);
+ Clist_TrayIconDestroy(g_clistApi.hwndContactList);
+ g_clistApi.pfnTrayIconInit(g_clistApi.hwndContactList);
}
break;
case SETTING_TRAYICON_SINGLE:
ptrA szProto(db_get_sa(0, "CList", "PrimaryStatus"));
- return Clist_TrayIconSetBaseInfo(g_CLI.pfnGetIconFromStatusMode(0, szProto, szProto ? Proto_GetStatus(szProto) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto);
+ return Clist_TrayIconSetBaseInfo(g_clistApi.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 < g_CLI.trayIconCount; i++) {
- if (g_CLI.trayIcon[i].id == 0)
+ for (i = 0; i < g_clistApi.trayIconCount; i++) {
+ if (g_clistApi.trayIcon[i].id == 0)
continue;
- if (mir_strcmp(g_CLI.trayIcon[i].szProto, szPreferredProto))
+ if (mir_strcmp(g_clistApi.trayIcon[i].szProto, szPreferredProto))
continue;
- TrayIconUpdate(g_CLI.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
+ TrayIconUpdate(g_clistApi.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
return;
}
// if there wasn't a specific icon, there will only be one suitable
- for (i = 0; i < g_CLI.trayIconCount; i++) {
- if (g_CLI.trayIcon[i].id == 0)
+ for (i = 0; i < g_clistApi.trayIconCount; i++) {
+ if (g_clistApi.trayIcon[i].id == 0)
continue;
- TrayIconUpdate(g_CLI.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
+ TrayIconUpdate(g_clistApi.trayIcon[i].hBaseIcon, nullptr, szPreferredProto, 1);
return;
}
}
@@ -556,8 +556,8 @@ MIR_APP_DLL(void) Clist_TrayIconIconsChanged()
initcheck;
mir_cslock lck(trayLockCS);
- Clist_TrayIconDestroy(g_CLI.hwndContactList);
- g_CLI.pfnTrayIconInit(g_CLI.hwndContactList);
+ Clist_TrayIconDestroy(g_clistApi.hwndContactList);
+ g_clistApi.pfnTrayIconInit(g_clistApi.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 = g_CLI.hwndContactList;
+ HWND hwndClui = g_clistApi.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() != g_CLI.hwndContactList) {
+ if (GetActiveWindow() != g_clistApi.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 && !g_CLI.bTrayMenuOnScreen) {
+ if (!g_trayTooltipActive && !g_clistApi.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 = g_CLI.szTip;
+ wchar_t* szTipCur = g_clistApi.szTip;
{
int n = s_LastHoverIconID - 100;
- if (n >= 0 && n < g_CLI.trayIconCount)
- szTipCur = g_CLI.trayIcon[n].ptszToolTip;
+ if (n >= 0 && n < g_clistApi.trayIconCount)
+ szTipCur = g_clistApi.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() == g_CLI.hwndContactList ? 1 : 0;
+ ti.isTreeFocused = GetFocus() == g_clistApi.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(g_CLI.hwndContactList, TIMERID_TRAYHOVER_2, 600, TrayHideToolTipTimerProc);
+ SetTimer(g_clistApi.hwndContactList, TIMERID_TRAYHOVER_2, 600, TrayHideToolTipTimerProc);
g_trayTooltipActive = true;
}
}
@@ -650,7 +650,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
break;
}
case TIM_CREATE:
- g_CLI.pfnTrayIconInit(msg->hwnd);
+ g_clistApi.pfnTrayIconInit(msg->hwnd);
break;
case WM_ACTIVATE:
@@ -674,22 +674,22 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
}
if (msg->lParam == WM_MBUTTONUP)
- g_CLI.pfnShowHide();
+ g_clistApi.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 < g_CLI.trayIconCount; i++) {
- if ((unsigned)g_CLI.trayIcon[i].id == msg->wParam) {
- if (!g_CLI.trayIcon[i].szProto)
+ for (int i = 0; i < g_clistApi.trayIconCount; i++) {
+ if ((unsigned)g_clistApi.trayIcon[i].id == msg->wParam) {
+ if (!g_clistApi.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(g_CLI.trayIcon[i].szProto, accounts[k]->szModuleName)) {
+ if (!mir_strcmp(g_clistApi.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))
- g_CLI.pfnShowHide();
+ g_clistApi.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);
- g_CLI.bTrayMenuOnScreen = TRUE;
+ g_clistApi.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(g_CLI.hwndContactList, TIMERID_TRAYHOVER, 600, TrayToolTipTimerProc);
+ SetTimer(g_clistApi.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 g_CLI.trayIcon[0].id;
+ return g_clistApi.trayIcon[0].id;
UINT iconId = 0;
- 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;
+ for (int j = 0; j < g_clistApi.trayIconCount; j++) {
+ if (g_clistApi.trayIcon[j].szProto != nullptr) {
+ if (!mir_strcmp(szProto, g_clistApi.trayIcon[j].szProto)) {
+ iconId = g_clistApi.trayIcon[j].id;
break;
}
}
- else if (g_CLI.trayIcon[j].isBase) {
- iconId = g_CLI.trayIcon[j].id;
+ else if (g_clistApi.trayIcon[j].isBase) {
+ iconId = g_clistApi.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 (g_CLI.trayIcon == nullptr)
+ if (g_clistApi.trayIcon == nullptr)
return 2;
NOTIFYICONDATAA nid = { 0 };
nid.cbSize = NOTIFYICONDATAA_V2_SIZE;
- nid.hWnd = g_CLI.hwndContactList;
+ nid.hWnd = g_clistApi.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 (g_CLI.trayIcon == nullptr)
+ if (g_clistApi.trayIcon == nullptr)
return 2;
NOTIFYICONDATAW nid = { 0 };
nid.cbSize = NOTIFYICONDATAW_V2_SIZE;
- nid.hWnd = g_CLI.hwndContactList;
+ nid.hWnd = g_clistApi.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 9c38594de9..528bc4492e 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 (g_CLI.hMenuMain) {
+ if (g_clistApi.hMenuMain) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = Menu_GetMainMenu();
- SetMenuItemInfo(g_CLI.hMenuMain, 0, TRUE, &mii);
+ SetMenuItemInfo(g_clistApi.hMenuMain, 0, TRUE, &mii);
mii.hSubMenu = Menu_GetStatusMenu();
- SetMenuItemInfo(g_CLI.hMenuMain, 1, TRUE, &mii);
+ SetMenuItemInfo(g_clistApi.hMenuMain, 1, TRUE, &mii);
}
return 0;
}
@@ -81,7 +81,7 @@ static void DisconnectAll()
static int CluiIconsChanged(WPARAM, LPARAM)
{
- DrawMenuBar(g_CLI.hwndContactList);
+ DrawMenuBar(g_clistApi.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 : g_CLI.hwndContactList;
+ hwndClist = (!mir_wstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : g_clistApi.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 : g_CLI.hwndContactList;
+ hwndClist = (!mir_wstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : g_clistApi.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 (g_CLI.pfnDocking_ProcessWindowMessage((WPARAM)&m, (LPARAM)&result))
+ if (g_clistApi.pfnDocking_ProcessWindowMessage((WPARAM)&m, (LPARAM)&result))
return result;
- if (g_CLI.pfnTrayIconProcessMessage((WPARAM)&m, (LPARAM)&result))
+ if (g_clistApi.pfnTrayIconProcessMessage((WPARAM)&m, (LPARAM)&result))
return result;
- return g_CLI.pfnContactListWndProc(hwnd, msg, wParam, lParam);
+ return g_clistApi.pfnContactListWndProc(hwnd, msg, wParam, lParam);
}
int LoadCLUIModule(void)
@@ -238,7 +238,7 @@ int LoadCLUIModule(void)
wchar_t titleText[256];
uMsgProcessProfile = RegisterWindowMessage(L"Miranda::ProcessProfile");
- g_CLI.pfnLoadCluiGlobalOpts();
+ g_clistApi.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 = g_CLI.pfnContactListControlWndProc;
+ wndclass.lpfnWndProc = g_clistApi.pfnContactListControlWndProc;
wndclass.cbWndExtra = sizeof(void *);
- wndclass.hInstance = g_CLI.hInst;
+ wndclass.hInstance = g_clistApi.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 = g_CLI.hInst;
+ wndclass.hInstance = g_clistApi.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);
- g_CLI.hwndContactList = CreateWindowEx(
+ g_clistApi.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, g_CLI.hInst, nullptr);
+ nullptr, nullptr, g_clistApi.hInst, nullptr);
if (db_get_b(0, "CList", "OnDesktop", 0)) {
HWND hProgMan = FindWindow(L"Progman", nullptr);
if (IsWindow(hProgMan))
- SetParent(g_CLI.hwndContactList, hProgMan);
+ SetParent(g_clistApi.hwndContactList, hProgMan);
}
- g_CLI.pfnOnCreateClc();
+ g_clistApi.pfnOnCreateClc();
- PostMessage(g_CLI.hwndContactList, M_RESTORESTATUS, 0, 0);
+ PostMessage(g_clistApi.hwndContactList, M_RESTORESTATUS, 0, 0);
int state = db_get_b(0, "CList", "State", SETTING_STATE_NORMAL);
- g_CLI.hMenuMain = GetMenu(g_CLI.hwndContactList);
+ g_clistApi.hMenuMain = GetMenu(g_clistApi.hwndContactList);
if (!db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
- SetMenu(g_CLI.hwndContactList, nullptr);
+ SetMenu(g_clistApi.hwndContactList, nullptr);
if (state == SETTING_STATE_NORMAL)
- ShowWindow(g_CLI.hwndContactList, SW_SHOW);
+ ShowWindow(g_clistApi.hwndContactList, SW_SHOW);
else if (state == SETTING_STATE_MINIMIZED)
- ShowWindow(g_CLI.hwndContactList, SW_SHOWMINIMIZED);
- SetWindowPos(g_CLI.hwndContactList,
+ ShowWindow(g_clistApi.hwndContactList, SW_SHOWMINIMIZED);
+ SetWindowPos(g_clistApi.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;
- g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, g_CLI.hInst, nullptr);
+ g_clistApi.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, g_clistApi.hInst, nullptr);
}
- g_CLI.pfnCluiProtocolStatusChanged(0, nullptr);
+ g_clistApi.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:
- g_CLI.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
+ g_clistApi.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, g_CLI.hInst, nullptr);
+ 0, 0, 0, 0, hwnd, nullptr, g_clistApi.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(g_CLI.hwndContactTree, msg, wParam, lParam);
- SendMessage(g_CLI.hwndStatus, msg, wParam, lParam);
+ SendMessage(g_clistApi.hwndContactTree, msg, wParam, lParam);
+ SendMessage(g_clistApi.hwndStatus, msg, wParam, lParam);
// XXX: only works with 4.71 with 95, IE4.
- SendMessage(g_CLI.hwndStatus, SB_SETBKCOLOR, 0, GetSysColor(COLOR_3DFACE));
+ SendMessage(g_clistApi.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(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);
+ SetWindowPos(g_clistApi.hwndStatus, nullptr, 0, rect.bottom - 20, rect.right - rect.left, 20, SWP_NOZORDER);
+ GetWindowRect(g_clistApi.hwndStatus, &rcStatus);
+ g_clistApi.pfnCluiProtocolStatusChanged(0, nullptr);
}
else
rcStatus.top = rcStatus.bottom = 0;
- SetWindowPos(g_CLI.hwndContactTree, nullptr, 0, 0, rect.right, rect.bottom - (rcStatus.bottom - rcStatus.top), SWP_NOZORDER);
+ SetWindowPos(g_clistApi.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(g_CLI.hwndContactTree);
+ SetFocus(g_clistApi.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(g_CLI.hwndContactTree, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ SetWindowPos(g_clistApi.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:
- g_CLI.pfnShowHide();
+ g_clistApi.pfnShowHide();
break;
case POPUP_NEWGROUP:
- SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
Clist_GroupCreate(0, nullptr);
break;
case POPUP_HIDEOFFLINE:
- g_CLI.pfnSetHideOffline(-1);
+ g_clistApi.pfnSetHideOffline(-1);
break;
case POPUP_HIDEOFFLINEROOT:
@@ -716,7 +716,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case POPUP_HIDEMIRANDA:
- g_CLI.pfnShowHide();
+ g_clistApi.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(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ SendMessage(g_clistApi.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
break;
//MSG FROM CHILD CONTROL
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->hwndFrom == g_CLI.hwndContactTree) {
+ if (((LPNMHDR)lParam)->hwndFrom == g_clistApi.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(g_CLI.hInst, MAKEINTRESOURCE(IDC_DROPUSER)));
+ SetCursor(LoadCursor(g_clistApi.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(g_CLI.hInst, MAKEINTRESOURCE(IDC_DROPUSER)));
+ SetCursor(LoadCursor(g_clistApi.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(g_CLI.hwndContactTree, &rcTree);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nmc->pt.x, nmc->pt.y));
+ HANDLE hItem = (HANDLE)SendMessage(g_clistApi.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(g_CLI.hwndContactTree, &pt);
+ ClientToScreen(g_clistApi.hwndContactTree, &pt);
return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
}
}
break;
}
}
- else if (((LPNMHDR)lParam)->hwndFrom == g_CLI.hwndStatus) {
+ else if (((LPNMHDR)lParam)->hwndFrom == g_clistApi.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(g_CLI.hwndStatus, SB_GETPARTS, 0, 0);
+ nParts = SendMessage(g_clistApi.hwndStatus, SB_GETPARTS, 0, 0);
if (nm->dwItemSpec == 0xFFFFFFFE) {
nPanel = nParts - 1;
- SendMessage(g_CLI.hwndStatus, SB_GETRECT, nPanel, (LPARAM)& rc);
+ SendMessage(g_clistApi.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(g_CLI.hwndStatus, SB_GETRECT, nPanel, (LPARAM)& rc);
+ SendMessage(g_clistApi.hwndStatus, SB_GETRECT, nPanel, (LPARAM)& rc);
pt.x = rc.left;
pt.y = rc.top;
- ClientToScreen(g_CLI.hwndStatus, &pt);
+ ClientToScreen(g_clistApi.hwndStatus, &pt);
TrackPopupMenu(hMenu, TPM_BOTTOMALIGN | TPM_LEFTALIGN, pt.x, pt.y, 0, hwnd, nullptr);
}
}
return FALSE;
case WM_MENUSELECT:
- if (lParam && (HMENU)lParam == g_CLI.hMenuMain) {
+ if (lParam && (HMENU)lParam == g_clistApi.hMenuMain) {
int pos = LOWORD(wParam);
POINT pt;
GetCursorPos(&pt);
- if ((pos == 0 || pos == 1) && (HIWORD(wParam) & MF_POPUP) && (!(HIWORD(wParam) & MF_MOUSESELECT) || MenuItemFromPoint(hwnd, g_CLI.hMenuMain, pt) != -1)) {
+ if ((pos == 0 || pos == 1) && (HIWORD(wParam) & MF_POPUP) && (!(HIWORD(wParam) & MF_MOUSESELECT) || MenuItemFromPoint(hwnd, g_clistApi.hMenuMain, pt) != -1)) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (pos == 0) ? Menu_GetMainMenu() : Menu_GetStatusMenu();
- SetMenuItemInfo(g_CLI.hMenuMain, pos, TRUE, &mii);
+ SetMenuItemInfo(g_clistApi.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(g_CLI.hwndContactTree, &rc);
+ GetWindowRect(g_clistApi.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(g_CLI.hwndStatus, &rc);
+ GetWindowRect(g_clistApi.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 == g_CLI.hwndStatus) {
+ if (dis->hwndItem == g_clistApi.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(g_CLI.hMenuMain, 0, MF_BYPOSITION);
- RemoveMenu(g_CLI.hMenuMain, 0, MF_BYPOSITION);
+ RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
- if (g_CLI.hwndStatus) {
- DestroyWindow(g_CLI.hwndStatus);
- g_CLI.hwndStatus = nullptr;
+ if (g_clistApi.hwndStatus) {
+ DestroyWindow(g_clistApi.hwndStatus);
+ g_clistApi.hwndStatus = nullptr;
}
// Disconnect all protocols
DisconnectAll();
ShowWindow(hwnd, SW_HIDE);
- DestroyWindow(g_CLI.hwndContactTree);
+ DestroyWindow(g_clistApi.hwndContactTree);
FreeLibrary(hUserDll);
PostQuitMessage(0);
diff --git a/src/mir_app/src/cluiservices.cpp b/src/mir_app/src/cluiservices.cpp
index c3fee62555..da7241dff1 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 (g_CLI.hwndContactTree == nullptr)
+ if (g_clistApi.hwndContactTree == nullptr)
return;
bool bRebuild = false;
- LONG_PTR dwStyle = GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE);
+ LONG_PTR dwStyle = GetWindowLongPtr(g_clistApi.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(g_CLI.hwndContactTree, GWL_STYLE, dwStyle);
- Clist_InitAutoRebuild(g_CLI.hwndContactTree);
+ SetWindowLongPtr(g_clistApi.hwndContactTree, GWL_STYLE, dwStyle);
+ Clist_InitAutoRebuild(g_clistApi.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(g_CLI.hwndStatus, SB_SETPARTS, 0, 0);
- SendMessage(g_CLI.hwndStatus, SB_SETTEXT, SBT_OWNERDRAW, 0);
+ SendMessage(g_clistApi.hwndStatus, SB_SETPARTS, 0, 0);
+ SendMessage(g_clistApi.hwndStatus, SB_SETTEXT, SBT_OWNERDRAW, 0);
return;
}
int borders[3];
- SendMessage(g_CLI.hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
+ SendMessage(g_clistApi.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(g_CLI.hwndStatus, &rc);
+ GetClientRect(g_clistApi.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(g_CLI.hwndStatus, WM_GETFONT, 0, 0));
+ HFONT hFont = (HFONT)SelectObject(hdc, (HFONT)SendMessage(g_clistApi.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(g_CLI.hwndStatus, SB_SETMINHEIGHT, g_IconHeight, 0);
- SendMessage(g_CLI.hwndStatus, SB_SETPARTS, g_menuProtos.getCount(), (LPARAM)partWidths);
+ SendMessage(g_clistApi.hwndStatus, SB_SETMINHEIGHT, g_IconHeight, 0);
+ SendMessage(g_clistApi.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(g_CLI.hwndStatus, SB_SETTEXT, i | flags, (LPARAM)g_menuProtos[i].szProto);
+ SendMessage(g_clistApi.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 5e468f5d0f..7a63d3d122 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, g_CLI.pfnIconFromStatusMode(GetContactProto(hContact), status, hContact));
+ Clist_ChangeContactIcon(hContact, g_clistApi.pfnIconFromStatusMode(GetContactProto(hContact), status, hContact));
}
Clist_EndRebuild();
}
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp
index 1a44938d1e..72a7e5d5b1 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));
- g_CLI.pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID);
+ g_clistApi.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 4e96de3489..645327ad7d 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 (g_CLI.hwndContactTree == nullptr)
+ if (g_clistApi.hwndContactTree == nullptr)
return -1;
int icol = ExtraImage_ExtraIDToColumnNum(ConvertToClistSlot(slot));
if (icol == -1)
return -1;
- HANDLE hItem = (HANDLE)SendMessage(g_CLI.hwndContactTree, CLM_FINDCONTACT, hContact, 0);
+ HANDLE hItem = (HANDLE)SendMessage(g_clistApi.hwndContactTree, CLM_FINDCONTACT, hContact, 0);
if (hItem == nullptr)
return -1;
- SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(icol, hImage));
+ SendMessage(g_clistApi.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(g_CLI.hwndContactTree, CLM_SETEXTRASPACE, db_get_b(0, "CLUI", "ExtraColumnSpace", 18), 0);
- SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, 0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETEXTRASPACE, db_get_b(0, "CLUI", "ExtraColumnSpace", 18), 0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, 0);
if (hExtraImageList)
ImageList_Destroy(hExtraImageList);
hExtraImageList = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 1, 256);
- SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hExtraImageList);
- SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hExtraImageList);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0);
NotifyEventHooks(hEventExtraImageListRebuilding, 0, 0);
bImageCreated = true;
}
MIR_APP_DLL(void) ExtraIcon_SetAll(MCONTACT hContact)
{
- if (g_CLI.hwndContactTree == nullptr)
+ if (g_clistApi.hwndContactTree == nullptr)
return;
bool hcontgiven = (hContact != 0);
@@ -301,7 +301,7 @@ MIR_APP_DLL(void) ExtraIcon_SetAll(MCONTACT hContact)
if (!bImageCreated)
ExtraIcon_Reload();
- SendMessage(g_CLI.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0);
+ SendMessage(g_clistApi.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;
}
- g_CLI.pfnInvalidateRect(g_CLI.hwndContactTree, nullptr, FALSE);
+ g_clistApi.pfnInvalidateRect(g_clistApi.hwndContactTree, nullptr, FALSE);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/keyboard.cpp b/src/mir_app/src/keyboard.cpp
index e104cb249f..bb52a04504 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)
{
- g_CLI.pfnShowHide();
+ g_clistApi.pfnShowHide();
return 0;
}
@@ -37,8 +37,8 @@ static INT_PTR hkRead(WPARAM, LPARAM)
if (Clist_EventsProcessTrayDoubleClick(0) == 0)
return true;
- SetForegroundWindow(g_CLI.hwndContactList);
- SetFocus(g_CLI.hwndContactList);
+ SetForegroundWindow(g_clistApi.hwndContactList);
+ SetFocus(g_clistApi.hwndContactList);
return 0;
}
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp
index 13d0ffe0f3..e751cafcbf 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(g_CLI.hwndContactList);
+ DrawMenuBar(g_clistApi.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 (g_CLI.hwndStatus)
- InvalidateRect(g_CLI.hwndStatus, nullptr, TRUE);
+ if (g_clistApi.hwndStatus)
+ InvalidateRect(g_clistApi.hwndStatus, nullptr, TRUE);
return 0;
}
@@ -565,7 +565,7 @@ static INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM)
if (pa->IsVisible())
MenusProtoCount++;
- g_CLI.currentDesiredStatusMode = smep->status;
+ g_clistApi.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, g_CLI.currentDesiredStatusMode);
+ Proto_SetStatus(pa->szModuleName, g_clistApi.currentDesiredStatusMode);
}
- NotifyEventHooks(hStatusModeChangeEvent, g_CLI.currentDesiredStatusMode, 0);
- db_set_w(0, "CList", "Status", (WORD)g_CLI.currentDesiredStatusMode);
+ NotifyEventHooks(hStatusModeChangeEvent, g_clistApi.currentDesiredStatusMode, 0);
+ db_set_w(0, "CList", "Status", (WORD)g_clistApi.currentDesiredStatusMode);
return 1;
}
@@ -669,7 +669,7 @@ static int MenuIconsChanged(WPARAM, LPARAM)
{
// just rebuild menu
RebuildMenuOrder();
- g_CLI.pfnCluiProtocolStatusChanged(0, nullptr);
+ g_clistApi.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();
- g_CLI.pfnCluiProtocolStatusChanged(0, nullptr);
+ g_clistApi.pfnCluiProtocolStatusChanged(0, nullptr);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -994,7 +994,7 @@ static INT_PTR HotkeySetStatus(WPARAM, LPARAM lParam)
static INT_PTR ShowHide(WPARAM, LPARAM)
{
- g_CLI.pfnShowHide();
+ g_clistApi.pfnShowHide();
return 0;
}
@@ -1095,7 +1095,7 @@ void InitCustomMenus(void)
Menu_AddMainMenuItem(&mi);
currentStatusMenuItem = ID_STATUS_OFFLINE;
- g_CLI.currentDesiredStatusMode = ID_STATUS_OFFLINE;
+ g_clistApi.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 2767e5ee5c..065fee01a1 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(g_CLI.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
+ int newVal = !(GetWindowLongPtr(g_clistApi.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
db_set_b(0, "CList", "HideEmptyGroups", (BYTE)newVal);
- SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
return newVal;
}
static INT_PTR UseGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
+ int newVal = !(GetWindowLongPtr(g_clistApi.hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
db_set_b(0, "CList", "UseGroups", (BYTE)newVal);
- SendMessage(g_CLI.hwndContactTree, CLM_SETUSEGROUPS, newVal,0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETUSEGROUPS, newVal,0);
return newVal;
}
static INT_PTR HideOfflineHelper(WPARAM, LPARAM)
{
- return g_CLI.pfnSetHideOffline(-1);
+ return g_clistApi.pfnSetHideOffline(-1);
}
static INT_PTR HideOfflineRootHelper(WPARAM, LPARAM)
{
- int newVal = !SendMessage(g_CLI.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0);
- SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEOFFLINEROOT, newVal, 0);
+ int newVal = !SendMessage(g_clistApi.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETHIDEOFFLINEROOT, newVal, 0);
return newVal;
}
static INT_PTR CreateGroupHelper(WPARAM, LPARAM)
{
- SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
- SendMessage(g_CLI.hwndContactTree, CLM_SETUSEGROUPS, 1, 0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
+ SendMessage(g_clistApi.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(g_CLI.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) != 0;
+ bChecked = SendMessage(g_clistApi.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) != 0;
Menu_SetChecked(hHideOfflineUsersOutHereMenuItem, bChecked);
- DWORD dwStyle = GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE);
+ DWORD dwStyle = GetWindowLongPtr(g_clistApi.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)g_CLI.hwndContactTree, WM_COMMAND, wParam, 0);
+ SendMessage(lParam ? (HWND)lParam : (HWND)g_clistApi.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 26dad6887a..aa8b245c1d 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 g_CLI.pfnShowHide();
+ return g_clistApi.pfnShowHide();
}
void InitTrayMenus(void)
diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp
index 6852d8a6ee..d2d8e38dcc 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(g_CLI.hwndContactList);
+ dlg.SetParent(g_clistApi.hwndContactList);
dlg.DoModal();
return 0;
}
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp
index 5558c7da82..2b740d8b79 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), g_CLI.hwndContactList, Meta_EditDialogProc, (LPARAM)wParam);
+ DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_METAEDIT), g_clistApi.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 f868f1d2e2..b73cdcc613 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(g_CLI.hwndContactList,
+ MessageBox(g_clistApi.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 f64b95e2f3..630502cda4 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, g_CLI.hwndContactTree, nullptr);
+ UINT res = TrackPopupMenu(hMenu, TPM_NONOTIFY | TPM_RETURNCMD | TPM_BOTTOMALIGN | TPM_LEFTALIGN, sicd->clickLocation.x, sicd->clickLocation.y, 0, g_clistApi.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, g_CLI.hwndContactList, &tpmp);
+ BOOL menuRet = TrackPopupMenuEx(hMenu, TPM_RETURNCMD, menuMousePoint.x, menuMousePoint.y, g_clistApi.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 6c61e2026e..ba888977a6 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -612,5 +612,5 @@ 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
+?g_clistApi@@3UCLIST_INTERFACE@@A @644 NONAME
?g_chatApi@@3UCHAT_MANAGER@@A @645 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index c0b7131851..4631a91664 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -612,5 +612,5 @@ 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
+?g_clistApi@@3UCLIST_INTERFACE@@A @644 NONAME
?g_chatApi@@3UCHAT_MANAGER@@A @645 NONAME