diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 12 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcmsgs.cpp | 24 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clc.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcitems.cpp | 7 |
5 files changed, 28 insertions, 21 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 187c06b76d..914cc0d175 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -784,7 +784,7 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT, WPARAM, LPARAM lP nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
nm.flags = 0;
- nm.hItem = pcli->pfnContactToItemHandle(contact, &nm.flags);
+ nm.hItem = Clist_ContactToItemHandle(contact, &nm.flags);
SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&nm);
}
@@ -794,7 +794,7 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT, WPARAM, LPARAM lP nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
nm.flags = 0;
- nm.hItem = (hit == -1 || hitFlags & CLCHT_NOWHERE) ? NULL : pcli->pfnContactToItemHandle(contact, &nm.flags);
+ nm.hItem = (hit == -1 || hitFlags & CLCHT_NOWHERE) ? NULL : Clist_ContactToItemHandle(contact, &nm.flags);
nm.iColumn = hitFlags & CLCHT_ONITEMEXTRA ? HIBYTE(HIWORD(hitFlags)) : -1;
nm.pt = dat->ptDragStart;
SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&nm);
@@ -945,7 +945,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
nm.flags = 0;
- nm.hItem = pcli->pfnContactToItemHandle(contact, &nm.flags);
+ nm.hItem = Clist_ContactToItemHandle(contact, &nm.flags);
SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&nm);
dat->dragStage &= ~DRAGSTAGEF_OUTSIDE;
}
@@ -1025,7 +1025,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
nm.flags = 0;
- nm.hItem = pcli->pfnContactToItemHandle(contact, &nm.flags);
+ nm.hItem = Clist_ContactToItemHandle(contact, &nm.flags);
nm.pt = pt;
if (SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&nm))
return 0;
@@ -1359,7 +1359,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = (DWORD_PTR)pcli->pfnContactToHItem(selcontact);
+ hSelItem = Clist_ContactToHItem(selcontact);
pcli->pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
needRepaint = TRUE;
pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL);
@@ -1381,7 +1381,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline || g_CluiData.bFilterEffective)) { // CLVM changed
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = (DWORD_PTR)pcli->pfnContactToHItem(selcontact);
+ hSelItem = Clist_ContactToHItem(selcontact);
pcli->pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
needRepaint = TRUE;
dat->bNeedsResort = true;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 08f2aed6fe..4f47e2b360 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -214,7 +214,7 @@ MCONTACT SaveSelection(ClcData *dat) if (pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) == -1)
return NULL;
- return (DWORD_PTR)pcli->pfnContactToHItem(selcontact);
+ return Clist_ContactToHItem(selcontact);
}
int RestoreSelection(ClcData *dat, MCONTACT hSelected)
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index 8d540bf13b..22a130250d 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -114,37 +114,43 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP switch (wParam) {
case CLGN_ROOT:
if (dat->list.cl.getCount())
- return (LRESULT)pcli->pfnContactToHItem(dat->list.cl[0]);
+ return Clist_ContactToHItem(dat->list.cl[0]);
else
return NULL;
+
case CLGN_CHILD:
if (contact->type != CLCIT_GROUP)
return NULL;
group = contact->group;
if (group->cl.getCount() == 0)
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl[0]);
+ return Clist_ContactToHItem(group->cl[0]);
+
case CLGN_PARENT:
return group->groupId | HCONTACT_ISGROUP;
+
case CLGN_NEXT:
do {
if (++i >= group->cl.getCount())
return NULL;
} while (group->cl[i]->type == CLCIT_DIVIDER);
- return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
+
case CLGN_PREVIOUS:
do {
if (--i < 0)
return NULL;
} while (group->cl[i]->type == CLCIT_DIVIDER);
- return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
+
case CLGN_NEXTCONTACT:
for (i++; i < group->cl.getCount(); i++)
if (group->cl[i]->type == CLCIT_CONTACT)
break;
if (i >= group->cl.getCount())
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
+
case CLGN_PREVIOUSCONTACT:
if (i >= group->cl.getCount())
return NULL;
@@ -153,14 +159,16 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP break;
if (i < 0)
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
+
case CLGN_NEXTGROUP:
for (i++; i < group->cl.getCount(); i++)
if (group->cl[i]->type == CLCIT_GROUP)
break;
if (i >= group->cl.getCount())
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
+
case CLGN_PREVIOUSGROUP:
if (i >= group->cl.getCount())
return NULL;
@@ -169,7 +177,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP break;
if (i < 0)
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
}
}
return NULL;
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index d49cd4a0e7..97748297a4 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -325,7 +325,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (!pcli->pfnFindItem(hwnd, dat, hContact, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = (UINT_PTR)pcli->pfnContactToHItem(selcontact);
+ hSelItem = Clist_ContactToHItem(selcontact);
pcli->pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
recalcScrollBar = 1;
pcli->pfnFindItem(hwnd, dat, hContact, &contact, NULL, NULL);
@@ -342,7 +342,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L break;
if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline || cfg::dat.bFilterEffective)) { // CLVM changed
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = (UINT_PTR)pcli->pfnContactToHItem(selcontact);
+ hSelItem = Clist_ContactToHItem(selcontact);
pcli->pfnRemoveItemFromGroup(hwnd, group, contact, 0);
contactRemoved = TRUE;
recalcScrollBar = 1;
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 82c614643d..452fc2863d 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -45,11 +45,10 @@ static void TZ_LoadTimeZone(MCONTACT hContact, struct TExtraCache *c) ClcContact* CreateClcContact(void)
{
- ClcContact* p = (ClcContact*)mir_alloc(sizeof(ClcContact));
- if (p != NULL) {
- memset(p, 0, sizeof(ClcContact));
+ ClcContact* p = (ClcContact*)mir_calloc(sizeof(ClcContact));
+ if (p != NULL)
p->avatarLeft = p->extraIconRightBegin = p->xStatusIcon = -1;
- }
+
return p;
}
|