summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-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
110 files changed, 977 insertions, 977 deletions
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)
{