diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-06 20:59:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-06 20:59:25 +0300 |
commit | 205963dfbb2297f5fab4adeec027342394329d2d (patch) | |
tree | bbf0df9820b79995c1b631bee47f8294c8ab4a83 /src | |
parent | da9aa1870502d88752c5482e3eb2d2548dd64984 (diff) |
CLIST_INTERFACE::pfnGetGroupCountsText => Clist_GetGroupCountsText
CLIST_INTERFACE::pfnEnsureVisible => Clist_EnsureVisible
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdclist/src/clcpaint.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/clc.cpp | 12 | ||||
-rw-r--r-- | src/mir_app/src/clc.h | 2 | ||||
-rw-r--r-- | src/mir_app/src/clcmsgs.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/clcutils.cpp | 7 | ||||
-rw-r--r-- | src/mir_app/src/clistcore.cpp | 9 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 2 |
8 files changed, 19 insertions, 21 deletions
diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp index 03a927d63d..05114952f2 100644 --- a/src/core/stdclist/src/clcpaint.cpp +++ b/src/core/stdclist/src/clcpaint.cpp @@ -318,7 +318,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) wchar_t *ptszGroupCount = nullptr;
if (cc->type == CLCIT_GROUP) {
- ptszGroupCount = pcli->pfnGetGroupCountsText(dat, cc);
+ ptszGroupCount = Clist_GetGroupCountsText(dat, cc);
if (*ptszGroupCount) {
GetTextExtentPoint32(hdcMem, L" ", 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 011f315b78..a0a1f2f9f7 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -745,7 +745,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (dat->selection < 0)
dat->selection = 0;
cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
- cli.pfnEnsureVisible(hwnd, dat, dat->selection, 0);
+ Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
UpdateWindow(hwnd);
return 0;
}
@@ -803,7 +803,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam cli.pfnSaveStateAndRebuildList(hwnd, dat);
}
cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
- cli.pfnEnsureVisible(hwnd, dat, dat->selection, 0);
+ Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
}
else
cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
@@ -960,7 +960,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam dat->selection = hit;
cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
if (dat->selection != -1)
- cli.pfnEnsureVisible(hwnd, dat, hit, 0);
+ Clist_EnsureVisible(hwnd, dat, hit, 0);
UpdateWindow(hwnd);
if (dat->selection != -1 && (contact->type == CLCIT_CONTACT || contact->type == CLCIT_GROUP) && !(hitFlags & (CLCHT_ONITEMEXTRA | CLCHT_ONITEMCHECK))) {
SetCapture(hwnd);
@@ -1171,7 +1171,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam dat->selection = cli.pfnHitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, nullptr, &hitFlags);
cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
if (dat->selection != -1)
- cli.pfnEnsureVisible(hwnd, dat, dat->selection, 0);
+ Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
if (hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMLABEL)) {
UpdateWindow(hwnd);
@@ -1194,7 +1194,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (pt.x == -1 && pt.y == -1) {
dat->selection = cli.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
if (dat->selection != -1)
- cli.pfnEnsureVisible(hwnd, dat, dat->selection, 0);
+ Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
pt.x = dat->iconXSpace + 15;
pt.y = cli.pfnGetRowTopY(dat, dat->selection) - dat->yScroll + (int)(cli.pfnGetRowHeight(dat, dat->selection) * .7);
hitFlags = (dat->selection == -1) ? CLCHT_NOWHERE : CLCHT_ONITEMLABEL;
@@ -1205,7 +1205,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam }
cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
if (dat->selection != -1)
- cli.pfnEnsureVisible(hwnd, dat, dat->selection, 0);
+ Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
UpdateWindow(hwnd);
if (dat->selection != -1 && hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMCHECK | CLCHT_ONITEMLABEL)) {
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 8396747bc2..c8b0063219 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -75,10 +75,8 @@ int fnGetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat); LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
/* clcutils.c */
-wchar_t* fnGetGroupCountsText(ClcData *dat, ClcContact *contact);
int fnHitTest(HWND hwnd, ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD * flags);
void fnScrollTo(HWND hwnd, ClcData *dat, int desty, int noSmooth);
-void fnEnsureVisible(HWND hwnd, ClcData *dat, int iItem, int partialOk);
void fnRecalcScrollBar(HWND hwnd, ClcData *dat);
void fnSetGroupExpand(HWND hwnd, ClcData *dat, ClcGroup *group, int newState);
int fnFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk);
diff --git a/src/mir_app/src/clcmsgs.cpp b/src/mir_app/src/clcmsgs.cpp index c13bf9924a..b96d80711d 100644 --- a/src/mir_app/src/clcmsgs.cpp +++ b/src/mir_app/src/clcmsgs.cpp @@ -101,7 +101,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
- cli.pfnEnsureVisible(hwnd, dat, cli.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact)), 0);
+ Clist_EnsureVisible(hwnd, dat, cli.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact)), 0);
break;
case CLM_EXPAND:
@@ -294,7 +294,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
dat->selection = cli.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact));
- cli.pfnEnsureVisible(hwnd, dat, dat->selection, 0);
+ Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
break;
case CLM_SETBKBITMAP:
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index cc2d806737..74e4039e38 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern HANDLE hHideInfoTipEvent;
-wchar_t* fnGetGroupCountsText(ClcData *dat, ClcContact *contact)
+MIR_APP_DLL(wchar_t*) Clist_GetGroupCountsText(ClcData *dat, ClcContact *contact)
{
if (contact->type != CLCIT_GROUP || !(dat->exStyle & CLS_EX_SHOWGROUPCOUNTS))
return L"";
@@ -171,8 +171,7 @@ int fnHitTest(HWND hwnd, ClcData *dat, int testx, int testy, ClcContact **contac GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_wstrlen(hitcontact->szText), &textSize);
int width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
- wchar_t *szCounts;
- szCounts = cli.pfnGetGroupCountsText(dat, hitcontact);
+ wchar_t *szCounts = Clist_GetGroupCountsText(dat, hitcontact);
if (szCounts[0]) {
GetTextExtentPoint32(hdc, L" ", 1, &textSize);
width += textSize.cx;
@@ -243,7 +242,7 @@ void fnScrollTo(HWND hwnd, ClcData *dat, int desty, int noSmooth) SetScrollPos(hwnd, SB_VERT, dat->yScroll, TRUE);
}
-void fnEnsureVisible(HWND hwnd, ClcData *dat, int iItem, int partialOk)
+MIR_APP_DLL(void) Clist_EnsureVisible(HWND hwnd, ClcData *dat, int iItem, int partialOk)
{
int itemy = cli.pfnGetRowTopY(dat, iItem), itemh = cli.pfnGetRowHeight(dat, iItem), newY = 0;
int moved = 0;
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index 37ba317f2a..eb10cce9fd 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -92,13 +92,10 @@ void InitClistCore() cli.pfnPaintClc = fnPaintClc;
- cli.pfnGetGroupCountsText = fnGetGroupCountsText;
- cli.pfnHitTest = fnHitTest;
- cli.pfnScrollTo = fnScrollTo;
- cli.pfnEnsureVisible = fnEnsureVisible;
- cli.pfnRecalcScrollBar = fnRecalcScrollBar;
+ cli.pfnHitTest = fnHitTest;
+ cli.pfnScrollTo = fnScrollTo;
+ cli.pfnRecalcScrollBar = fnRecalcScrollBar;
cli.pfnSetGroupExpand = fnSetGroupExpand;
-
cli.pfnFindRowByText = fnFindRowByText;
cli.pfnBeginRenameSelection = fnBeginRenameSelection;
cli.pfnIsVisibleContact = fnIsVisibleContact;
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 4af222c749..e88ae9c037 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -570,3 +570,5 @@ Clist_CalcEipPosition @589 Clist_DeleteFromContactList @590
Clist_EndRename @591
Clist_DoSelectionDefaultAction @592
+Clist_EnsureVisible @593
+Clist_GetGroupCountsText @594
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index fdab2e472d..8e84b5fcd6 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -570,3 +570,5 @@ Clist_CalcEipPosition @589 Clist_DeleteFromContactList @590
Clist_EndRename @591
Clist_DoSelectionDefaultAction @592
+Clist_EnsureVisible @593
+Clist_GetGroupCountsText @594
|