summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r--plugins/Clist_modern/src/cluiframes.cpp4
-rw-r--r--plugins/Clist_modern/src/groupmenu.cpp2
-rw-r--r--plugins/Clist_modern/src/init.cpp5
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp14
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h6
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp2
9 files changed, 25 insertions, 26 deletions
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp
index 701715a7c3..9f1287c328 100644
--- a/plugins/Clist_modern/src/cluiframes.cpp
+++ b/plugins/Clist_modern/src/cluiframes.cpp
@@ -1382,7 +1382,7 @@ static int _us_DoCollapseFrame(WPARAM wParam, LPARAM lParam)
// do not collapse/uncollapse client/locked/invisible frames
if (g_pfwFrames[FrameId].align == alClient && !(g_pfwFrames[FrameId].Locked || (!g_pfwFrames[FrameId].visible) || g_pfwFrames[FrameId].floating)) {
RECT rc;
- if (CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { return 0; };
+ if (Clist_IsDocked()) { return 0; };
if (!g_CluiData.fDocked && g_CluiData.fAutoSize) { return 0; };
GetWindowRect(pcli->hwndContactList, &rc);
@@ -2614,7 +2614,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
return 1;
case WM_COMMAND:
- if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), 0), Frameid))
+ if (Clist_MenuProcessCommand(LOWORD(wParam), 0, Frameid))
break;
if (HIWORD(wParam) == 0) {//mouse events for self created menu
diff --git a/plugins/Clist_modern/src/groupmenu.cpp b/plugins/Clist_modern/src/groupmenu.cpp
index 0c33a8b972..b2cbffff5a 100644
--- a/plugins/Clist_modern/src/groupmenu.cpp
+++ b/plugins/Clist_modern/src/groupmenu.cpp
@@ -60,7 +60,7 @@ void InitGroupMenus(void)
SET_UID(mi, 0xe386678a, 0x5aee, 0x4bfa, 0xa8, 0x23, 0xd, 0xa0, 0x11, 0x99, 0xb1, 0x98);
mi.position = 500;
- mi.pszService = MS_CLIST_SHOWHIDE;
+ mi.pszService = "Clist/ShowHide";
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
mi.name.a = LPGEN("&Hide/show");
Menu_AddGroupMenuItem(&mi);
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp
index 4e76e461f3..ccb7e2a412 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -119,6 +119,9 @@ extern "C" __declspec(dllexport) int Unload(void)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static int cliShowHideStub() { return cliShowHide(false); }
static HRESULT SubclassClistInterface()
{
@@ -160,7 +163,7 @@ static HRESULT SubclassClistInterface()
pcli->pfnRecalcScrollBar = cliRecalcScrollBar;
pcli->pfnRowHitTest = cliRowHitTest;
pcli->pfnScrollTo = cliScrollTo;
- pcli->pfnShowHide = cliShowHide;
+ pcli->pfnShowHide = cliShowHideStub;
pcli->pfnHitTest = cliHitTest;
pcli->pfnCompareContacts = cliCompareContacts;
pcli->pfnGetIconFromStatusMode = cliGetIconFromStatusMode;
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 2f9b9d7f2c..1cd8e95663 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -409,7 +409,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM
KillTimer(hwnd, TIMERID_INFOTIP);
KillTimer(hwnd, TIMERID_RENAME);
- if (CallService(MS_CLIST_MENUPROCESSHOTKEY, wParam, MPCF_CONTACTMENU))
+ if (Clist_MenuProcessHotkey(wParam))
return 0;
RECT clRect;
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 3e0f9e51e9..f3c9ae692a 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -920,7 +920,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM
SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
CLUI_ReloadCLUIOptions();
EventArea_ConfigureEventArea();
- cliShowHide(0, 1);
+ cliShowHide(true);
g_mutex_bChangingMode = FALSE;
return TRUE;
}
@@ -1194,7 +1194,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
CLUI_ChangeWindowMode();
SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
CLUI_ReloadCLUIOptions();
- cliShowHide(0, 1);
+ cliShowHide(true);
g_mutex_bChangingMode = FALSE;
return TRUE;
}
@@ -1756,7 +1756,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar
CLUI_ChangeWindowMode();
SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
CLUI_ReloadCLUIOptions();
- cliShowHide(0, 1);
+ cliShowHide(true);
}
g_mutex_bChangingMode = FALSE;
return TRUE;
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index d1786bb6a3..3c24073f87 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -318,14 +318,14 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
BYTE g_bCalledFromShowHide = 0;
-int cliShowHide(WPARAM, LPARAM lParam)
+int cliShowHide(bool bAlwaysShow)
{
BOOL bShow = FALSE;
int iVisibleState = GetWindowVisibleState(pcli->hwndContactList, 0, 0);
int method = db_get_b(NULL, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT); //(0-none, 1-leftedge, 2-rightedge);
if (method) {
- if (db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT) == 0 && lParam != 1)
+ if (db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT) == 0 && !bAlwaysShow)
CLUI_HideBehindEdge(); //hide
else
CLUI_ShowFromBehindEdge();
@@ -342,7 +342,7 @@ int cliShowHide(WPARAM, LPARAM lParam)
db_unset(NULL, "ModernData", "BehindEdge");
}
- //bShow is FALSE when we enter the switch if no hide behind edge.
+ // bShow is FALSE when we enter the switch if no hide behind edge.
switch (iVisibleState) {
case GWVS_PARTIALLY_COVERED:
bShow = TRUE; break;
@@ -356,7 +356,7 @@ int cliShowHide(WPARAM, LPARAM lParam)
return 0;
}
- if (bShow || lParam == 1) {
+ if (bShow || bAlwaysShow) {
Sync(CLUIFrames_ActivateSubContainers, TRUE);
CLUI_ShowWindowMod(pcli->hwndContactList, SW_RESTORE);
@@ -381,7 +381,7 @@ int cliShowHide(WPARAM, LPARAM lParam)
MoveWindow(pcli->hwndContactList, rcWindow.left, rcWindow.top,
rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE);
}
- else { //It needs to be hidden
+ else { // It needs to be hidden
if (GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) {
CListMod_HideWindow();
db_set_b(NULL, "CList", "State", SETTING_STATE_HIDDEN);
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 5859cbd7eb..5a7d189c51 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -736,7 +736,7 @@ void CLUI_ChangeWindowMode()
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(NULL, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT)) && (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)))
+ if (db_get_b(NULL, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT) && !Clist_IsDocked())
SetWindowRgn(pcli->hwndContactList, hRgn1, 1);
else {
DeleteObject(hRgn1);
@@ -1680,7 +1680,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
CheckFramesPos(&rc);
Sync(CLUIFrames_OnMoving, m_hWnd, &rc);
if (!IsIconic(m_hWnd)) {
- if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { // if g_CluiData.fDocked, dont remember pos (except for width)
+ if (!Clist_IsDocked()) { // if g_CluiData.fDocked, dont remember pos (except for width)
db_set_dw(NULL, "CList", "Height", (DWORD)(rc.bottom - rc.top));
db_set_dw(NULL, "CList", "x", (DWORD)rc.left);
db_set_dw(NULL, "CList", "y", (DWORD)rc.top);
@@ -1717,7 +1717,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
}
// if g_CluiData.fDocked, dont remember pos (except for width)
- if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
+ if (!Clist_IsDocked()) {
db_set_dw(NULL, "CList", "Height", (DWORD)(rc.bottom - rc.top));
db_set_dw(NULL, "CList", "x", (DWORD)rc.left);
db_set_dw(NULL, "CList", "y", (DWORD)rc.top);
@@ -1734,7 +1734,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
int v = (r.bottom - r.top) > (w * 2) ? w : (r.bottom - r.top);
h = (h < v) ? h : v;
hRgn1 = CreateRoundRectRgn(0, 0, (r.right - r.left + 1), (r.bottom - r.top + 1), h, h);
- if ((db_get_b(NULL, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT)) && (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)))
+ if (db_get_b(NULL, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT) && !Clist_IsDocked())
SetWindowRgn(m_hWnd, hRgn1, FALSE);
else {
DeleteObject(hRgn1);
@@ -1905,7 +1905,7 @@ LRESULT CLUI::OnCreateClc(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/)
{
CreateCLC();
if (db_get_b(NULL, "CList", "ShowOnStart", SETTING_SHOWONSTART_DEFAULT))
- cliShowHide((WPARAM)m_hWnd, TRUE);
+ cliShowHide(true);
pcli->pfnInitAutoRebuild(pcli->hwndContactTree);
return FALSE;
}
@@ -2177,7 +2177,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 CallService(MS_CLIST_SHOWHIDE, 0, 0);
+ return pcli->pfnShowHide();
}
return DefCluiWndProc(msg, wParam, lParam);
}
@@ -2279,7 +2279,7 @@ LRESULT CLUI::OnListSizeChangeNotify(NMCLISTCONTROL * pnmc)
rcWindow = rcSizingRect;
else
GetWindowRect(m_hWnd, &rcWindow);
- if (!g_CluiData.fAutoSize || pcli->hwndContactTree == 0 || CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0))
+ if (!g_CluiData.fAutoSize || pcli->hwndContactTree == 0 || Clist_IsDocked())
return FALSE;
maxHeight = db_get_b(NULL, "CLUI", "MaxSizeHeight", SETTING_MAXSIZEHEIGHT_DEFAULT);
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index 610778758a..e48b78c646 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -120,7 +120,6 @@ BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT *lpRect, UINT f
LPSKINOBJECTDESCRIPTOR ske_FindObjectByName(const char *szName, BYTE objType, SKINOBJECTSLIST *Skin);
HBITMAP ske_GetCurrentWindowImage();
int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, BOOL madeAbsolute);
-int ske_GetSkinFolder(wchar_t *szFileName, char *t2);
BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i);
int ske_JustUpdateWindowImageRect(RECT *rty);
@@ -218,8 +217,6 @@ void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *sz
// cluiframes.c
int ExtraImage_ExtraIDToColumnNum(int extra);
-int LoadSkinButtonModule();
-void GetDefaultFontSetting(int i, LOGFONTA *lf, COLORREF *colour);
int CLUI_OnSkinLoad(WPARAM wParam, LPARAM lParam);
HRESULT CluiLoadModule();
HRESULT PreLoadContactListModule();
@@ -234,7 +231,6 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce);
void cliFreeCacheItem(ClcCacheEntry *p);
void cliRebuildEntireList(HWND hwnd, ClcData *dat);
void cliRecalcScrollBar(HWND hwnd, ClcData *dat);
-void CLUI_cliOnCreateClc(void);
int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly);
int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk);
int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
@@ -246,7 +242,7 @@ void cli_SetContactCheckboxes(ClcContact*, int);
LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
CListEvent* cli_AddEvent(CLISTEVENT *cle);
LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-int cliShowHide(WPARAM wParam, LPARAM lParam);
+int cliShowHide(bool bAlwaysShow);
BOOL cliInvalidateRect(HWND hWnd, CONST RECT *lpRect, BOOL bErase);
int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2);
int cliFindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index ace3621e07..161038a4f5 100644
--- a/plugins/Clist_modern/src/modern_skinopt.cpp
+++ b/plugins/Clist_modern/src/modern_skinopt.cpp
@@ -500,7 +500,7 @@ INT_PTR SvcApplySkin(WPARAM, LPARAM lParam)
CLUI_ChangeWindowMode();
SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
CLUI_ReloadCLUIOptions();
- cliShowHide(0, 1);
+ cliShowHide(true);
g_mutex_bChangingMode = FALSE;
if (g_hCLUIOptionsWnd) {