summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-06-01 09:11:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-06-01 09:11:39 +0000
commitea68d4474bb7329a5e59e0388b88155b96f31f7c (patch)
tree85229af10f8def74cf963924bffb8df53bdab83f /plugins/Clist_modern/src
parent9ba730bc48e44630b418f4214aee57c7b7c987bd (diff)
- view modes support incorporated into the CLIST_INTERFACE;
- fix for the broken search by protocols in clist_nicer; - numerous Unicode fixes in clist_nicer; git-svn-id: http://svn.miranda-ng.org/main/trunk@16893 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r--plugins/Clist_modern/src/init.cpp1
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp16
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h2
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp62
4 files changed, 40 insertions, 41 deletions
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp
index 72bdd2dfab..268e6a508e 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -169,6 +169,7 @@ static HRESULT SubclassClistInterface()
pcli->pfnGetRowsPriorTo = cliGetRowsPriorTo;
pcli->pfnGetGroupContentsCount = cliGetGroupContentsCount;
pcli->pfnFindRowByText = cliFindRowByText;
+ pcli->pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
//partialy overloaded - call default handlers from inside
pcli->pfnGetContactIcon = cli_GetContactIcon;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 4f47e2b360..777181b598 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -462,15 +462,11 @@ int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly)
// if no view mode is active, it returns the CList/Hidden setting
// also cares about sub contacts (if meta is active)
-int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat)
+int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat)
{
int dbHidden = db_get_b(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
int filterResult = 1;
int searchResult = 0;
- DBVARIANT dbv = { 0 };
- char szTemp[64];
- TCHAR szGroupMask[256];
- DWORD dwLocalMask;
ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hContact);
// always hide subcontacts (but show them on embedded contact lists)
@@ -492,7 +488,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, Clc
szProto = GetContactProto(hContact);
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
if (g_CluiData.bFilterEffective & CLVM_STICKY_CONTACTS) {
- if ((dwLocalMask = db_get_dw(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) != 0) {
+ if (DWORD dwLocalMask = db_get_dw(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) {
if (g_CluiData.bFilterEffective & CLVM_FILTER_STICKYSTATUS) {
WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask)) | searchResult;
@@ -503,15 +499,17 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, Clc
// check the proto, use it as a base filter result for all further checks
if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) {
+ char szTemp[64];
mir_snprintf(szTemp, "%s|", szProto);
filterResult = strstr(g_CluiData.protoFilter, szTemp) ? 1 : 0;
}
if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
- if (!db_get_ts(hContact, "CList", "Group", &dbv)) {
- mir_sntprintf(szGroupMask, _T("%s|"), &dbv.ptszVal[0]);
+ ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ if (tszGroup != NULL) {
+ TCHAR szGroupMask[256];
+ mir_sntprintf(szGroupMask, _T("%s|"), tszGroup);
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
- mir_free(dbv.ptszVal);
}
else if (g_CluiData.filterFlags & CLVM_INCLUDED_UNGROUPED)
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 1;
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index 1612bd3fcc..4f285e9ad0 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -176,7 +176,7 @@ DWORD CompareContacts2_getLMTime(MCONTACT u);
DWORD mod_CalcHash(const char *a); //mod_skin_selector.c
HICON cliGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status); //clistmod.c
HICON GetMainStatusOverlay(int STATUS); //clc.c
-int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szStatus, ClcData *dat); //clcitems.c
+int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szStatus, ClcData *dat); //clcitems.c
int BgStatusBarChange(WPARAM wParam, LPARAM lParam); //clcopts.c
int ClcDoProtoAck(ACKDATA *ack); //clc.c
int ModernSkinButtonDeleteAll(); //modernbutton.c
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index a17eb50726..52c2b1fcc5 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -216,19 +216,19 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
case WM_NCPAINT:
case WM_PAINT:
- {
- PAINTSTRUCT ps;
- BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
- if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat) {
- BeginPaint(hwnd, &ps);
- if ((!g_CluiData.fLayered || bFloat) && !g_CluiData.fDisableSkinEngine)
- sttDrawNonLayeredSkinedBar(hwnd, ps.hdc);
- else
- sttDrawToolBarBackground(hwnd, ps.hdc, &ps.rcPaint, pMTBInfo);
- EndPaint(hwnd, &ps);
+ {
+ PAINTSTRUCT ps;
+ BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
+ if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat) {
+ BeginPaint(hwnd, &ps);
+ if ((!g_CluiData.fLayered || bFloat) && !g_CluiData.fDisableSkinEngine)
+ sttDrawNonLayeredSkinedBar(hwnd, ps.hdc);
+ else
+ sttDrawToolBarBackground(hwnd, ps.hdc, &ps.rcPaint, pMTBInfo);
+ EndPaint(hwnd, &ps);
+ }
}
- }
- return DefWindowProc(hwnd, msg, wParam, lParam);
+ return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == BUTTONNEEDREDRAW)
@@ -236,26 +236,26 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
return 0;
case MTBM_LAYEREDPAINT:
- {
- RECT MyRect = { 0 };
- HDC hDC = (HDC)wParam;
- GetWindowRect(hwnd, &MyRect);
-
- RECT rcClient;
- GetClientRect(hwnd, &rcClient);
- SkinDrawGlyph(hDC, &rcClient, &rcClient, "Bar,ID=ToolBar,Part=Background");
-
- for (int i = 0; i < pMTBInfo->pButtonList->realCount; i++) {
- RECT childRect;
- POINT Offset;
- TTBCtrlButton* mtbi = (TTBCtrlButton*)pMTBInfo->pButtonList->items[i];
- GetWindowRect(mtbi->hWindow, &childRect);
- Offset.x = childRect.left - MyRect.left;
- Offset.y = childRect.top - MyRect.top;
- SendMessage(mtbi->hWindow, BUTTONDRAWINPARENT, (WPARAM)hDC, (LPARAM)&Offset);
+ {
+ RECT MyRect = { 0 };
+ HDC hDC = (HDC)wParam;
+ GetWindowRect(hwnd, &MyRect);
+
+ RECT rcClient;
+ GetClientRect(hwnd, &rcClient);
+ SkinDrawGlyph(hDC, &rcClient, &rcClient, "Bar,ID=ToolBar,Part=Background");
+
+ for (int i = 0; i < pMTBInfo->pButtonList->realCount; i++) {
+ RECT childRect;
+ POINT Offset;
+ TTBCtrlButton* mtbi = (TTBCtrlButton*)pMTBInfo->pButtonList->items[i];
+ GetWindowRect(mtbi->hWindow, &childRect);
+ Offset.x = childRect.left - MyRect.left;
+ Offset.y = childRect.top - MyRect.top;
+ SendMessage(mtbi->hWindow, BUTTONDRAWINPARENT, (WPARAM)hDC, (LPARAM)&Offset);
+ }
}
- }
- return 0;
+ return 0;
case WM_DESTROY:
xpt_FreeThemeForWindow(hwnd);