diff options
author | George Hazan <george.hazan@gmail.com> | 2016-05-28 12:41:49 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-05-28 12:41:49 +0000 |
commit | dcab83811dfb2d8f2a64c606995cd8ca35c1f6bb (patch) | |
tree | 3806b1c86a1791ce8b406672765ff4abeffa5a80 | |
parent | 19e55c9c066703b870c116740821cc6727e72697 (diff) |
2 static functions removed from CLIST_INTERFACE.
git-svn-id: http://svn.miranda-ng.org/main/trunk@16881 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
22 files changed, 88 insertions, 76 deletions
diff --git a/bin10/lib/mir_app.lib b/bin10/lib/mir_app.lib Binary files differindex ebb1d7775a..0a10ea673b 100644 --- a/bin10/lib/mir_app.lib +++ b/bin10/lib/mir_app.lib diff --git a/bin10/lib/mir_app64.lib b/bin10/lib/mir_app64.lib Binary files differindex cd768db41f..6e0db7fe4b 100644 --- a/bin10/lib/mir_app64.lib +++ b/bin10/lib/mir_app64.lib diff --git a/bin12/lib/mir_app.lib b/bin12/lib/mir_app.lib Binary files differindex ebb1d7775a..0a10ea673b 100644 --- a/bin12/lib/mir_app.lib +++ b/bin12/lib/mir_app.lib diff --git a/bin12/lib/mir_app64.lib b/bin12/lib/mir_app64.lib Binary files differindex cd768db41f..6e0db7fe4b 100644 --- a/bin12/lib/mir_app64.lib +++ b/bin12/lib/mir_app64.lib diff --git a/bin14/lib/mir_app.lib b/bin14/lib/mir_app.lib Binary files differindex ebb1d7775a..0a10ea673b 100644 --- a/bin14/lib/mir_app.lib +++ b/bin14/lib/mir_app.lib diff --git a/bin14/lib/mir_app64.lib b/bin14/lib/mir_app64.lib Binary files differindex cd768db41f..6e0db7fe4b 100644 --- a/bin14/lib/mir_app64.lib +++ b/bin14/lib/mir_app64.lib diff --git a/include/delphi/m_clistint.inc b/include/delphi/m_clistint.inc index a0a9a1a69e..c17aa1a0ee 100644 --- a/include/delphi/m_clistint.inc +++ b/include/delphi/m_clistint.inc @@ -181,7 +181,7 @@ type exStyle :dword;
ptInfoTip :TPOINT;
infoTipTimeout :int;
- hInfoTipItem :THANDLE;
+ hInfoTipItem :DWORD;
himlExtraColumns :THANDLE; // HIMAGELIST in CommCtrl
extraColumnsCount :int;
extraColumnSpacing :int;
@@ -322,8 +322,8 @@ type var contact:PClcContact; var subgroup:PClcGroup; var isVisible:int):int; cdecl;
pfnGetRowByIndex : function (var dat:TClcData; testindex:int;
var contact:PClcContact; var subgroup:PClcGroup):int; cdecl;
- pfnContactToHItem : function (var contact:TClcContact):THANDLE;cdecl;
- pfnContactToItemHandle : function (var contact:TClcContact; var nmFlags:dword):THANDLE; cdecl;
+ unused1 : function (var contact:TClcContact):THANDLE;cdecl;
+ unused2 : function (var contact:TClcContact; var nmFlags:dword):THANDLE; cdecl;
(* clcitems.c *)
pfnCreateClcContact : function :PClcContact; cdecl;
diff --git a/include/m_clistint.h b/include/m_clistint.h index d47aa89473..a0bf3d9f70 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -104,7 +104,7 @@ struct ClcContactBase BYTE flags;
union {
struct {
- int iImage;
+ int iImage;
MCONTACT hContact;
};
struct {
@@ -152,7 +152,7 @@ struct ClcDataBase : public MZeroedObject DWORD exStyle;
POINT ptInfoTip;
int infoTipTimeout;
- HANDLE hInfoTipItem;
+ DWORD hInfoTipItem;
HIMAGELIST himlExtraColumns;
int extraColumnsCount;
int extraColumnSpacing;
@@ -185,15 +185,15 @@ struct trayIconInfo_t TCHAR* ptszToolTip;
};
-typedef struct _menuProto
+struct MenuProto
{
char *szProto; //This is DLL-based unique name
HGENMENU pMenu;
HICON hIcon;
-}
- MenuProto;
+};
-/* constants */
+/////////////////////////////////////////////////////////////////////////////////////////
+// constants
#define DRAGSTAGE_NOTMOVED 0
#define DRAGSTAGE_ACTIVE 1
@@ -241,9 +241,14 @@ typedef struct _menuProto #define TIM_CALLBACK (WM_USER+1857)
#define TIM_CREATE (WM_USER+1858)
-/***************************************************************************
- * CLIST_INTERFACE structure definition
- ***************************************************************************/
+/////////////////////////////////////////////////////////////////////////////////////////
+// functions
+
+EXTERN_C MIR_APP_DLL(DWORD) Clist_ContactToHItem(ClcContact *contact);
+EXTERN_C MIR_APP_DLL(HANDLE) Clist_ContactToItemHandle(ClcContact *contact, DWORD *nmFlags);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// CLIST_INTERFACE structure definition
struct ClcProtoStatus
{
@@ -285,8 +290,8 @@ struct CLIST_INTERFACE int (*pfnGetRowsPriorTo)(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
int (*pfnFindItem)(HWND hwnd, struct ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
int (*pfnGetRowByIndex)(struct ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup);
- HANDLE (*pfnContactToHItem)(ClcContact *contact);
- HANDLE (*pfnContactToItemHandle)(ClcContact *contact, DWORD *nmFlags);
+ HANDLE (*unused1)(ClcContact *contact);
+ HANDLE (*unused2)(ClcContact *contact, DWORD *nmFlags);
/* clcitems.c */
ClcContact* (*pfnCreateClcContact)(void);
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;
}
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 9f3f8c46c4..26bfc36841 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -497,7 +497,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = (UINT_PTR)cli.pfnContactToHItem(selcontact);
+ hSelItem = Clist_ContactToHItem(selcontact);
cli.pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL);
if (contact) {
@@ -512,7 +512,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = (UINT_PTR)cli.pfnContactToHItem(selcontact);
+ hSelItem = Clist_ContactToHItem(selcontact);
cli.pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
}
else {
@@ -779,7 +779,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
nm.flags = 0;
- nm.hItem = cli.pfnContactToItemHandle(contact, &nm.flags);
+ nm.hItem = Clist_ContactToItemHandle(contact, &nm.flags);
SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)& nm);
}
else {
@@ -868,7 +868,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam it.isGroup = contact->type == CLCIT_GROUP;
it.hItem = (contact->type == CLCIT_GROUP) ? (HANDLE)contact->groupId : (HANDLE)contact->hContact;
it.cbSize = sizeof(it);
- dat->hInfoTipItem = cli.pfnContactToHItem(contact);
+ dat->hInfoTipItem = Clist_ContactToHItem(contact);
NotifyEventHooks(hShowInfoTipEvent, 0, (LPARAM)&it);
}
break;
@@ -942,7 +942,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
nm.flags = 0;
- nm.hItem = cli.pfnContactToItemHandle(contact, &nm.flags);
+ nm.hItem = Clist_ContactToItemHandle(contact, &nm.flags);
SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&nm);
}
if (!(hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMLABEL | CLCHT_ONITEMCHECK))) {
@@ -954,7 +954,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (hit == -1)
nm.hItem = NULL;
else
- nm.hItem = cli.pfnContactToItemHandle(contact, &nm.flags);
+ nm.hItem = 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);
@@ -1029,7 +1029,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
nm.flags = 0;
- nm.hItem = cli.pfnContactToItemHandle(contact, &nm.flags);
+ nm.hItem = Clist_ContactToItemHandle(contact, &nm.flags);
SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)& nm);
dat->dragStage &= ~DRAGSTAGEF_OUTSIDE;
}
@@ -1066,7 +1066,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
nm.flags = 0;
- nm.hItem = cli.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;
@@ -1141,7 +1141,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam nm.hdr.hwndFrom = hwnd;
nm.hdr.idFrom = GetDlgCtrlID(hwnd);
nm.flags = 0;
- nm.hItem = cli.pfnContactToItemHandle(contact, &nm.flags);
+ nm.hItem = Clist_ContactToItemHandle(contact, &nm.flags);
nm.pt = pt;
SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)& nm);
}
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index ba2c718153..1ab8c2fefb 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -39,18 +39,16 @@ extern int g_IconWidth, g_IconHeight; extern MWindowList hClcWindowList;
extern HIMAGELIST hCListImages;
-void fnClcOptionsChanged(void);
-void fnClcBroadcast(int msg, WPARAM wParam, LPARAM lParam);
-void fnInitAutoRebuild(HWND hWnd);
+void fnClcOptionsChanged(void);
+void fnClcBroadcast(int msg, WPARAM wParam, LPARAM lParam);
+void fnInitAutoRebuild(HWND hWnd);
LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
/* clcidents.c */
-int fnGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
-int fnFindItem(HWND hwnd, struct ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
-int fnGetRowByIndex(struct ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup);
-HANDLE fnContactToHItem(ClcContact *contact);
-HANDLE fnContactToItemHandle(ClcContact *contact, DWORD *nmFlags);
+int fnGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
+int fnFindItem(HWND hwnd, struct ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
+int fnGetRowByIndex(struct ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup);
/* clcitems.c */
ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
diff --git a/src/mir_app/src/clcidents.cpp b/src/mir_app/src/clcidents.cpp index a287626133..fe310a8c97 100644 --- a/src/mir_app/src/clcidents.cpp +++ b/src/mir_app/src/clcidents.cpp @@ -176,20 +176,20 @@ int fnGetRowByIndex(ClcData *dat, int testindex, ClcContact **contact, ClcGroup return -1;
}
-HANDLE fnContactToHItem(ClcContact *contact)
+MIR_APP_DLL(DWORD) Clist_ContactToHItem(ClcContact *contact)
{
switch (contact->type) {
case CLCIT_CONTACT:
- return (HANDLE)contact->hContact;
+ return contact->hContact;
case CLCIT_GROUP:
- return (HANDLE)(contact->groupId | HCONTACT_ISGROUP);
+ return contact->groupId | HCONTACT_ISGROUP;
case CLCIT_INFO:
- return (HANDLE)((UINT_PTR)contact->hContact | HCONTACT_ISINFO);
+ return contact->hContact | HCONTACT_ISINFO;
}
return NULL;
}
-HANDLE fnContactToItemHandle(ClcContact *contact, DWORD *nmFlags)
+MIR_APP_DLL(HANDLE) Clist_ContactToItemHandle(ClcContact *contact, DWORD *nmFlags)
{
switch (contact->type) {
case CLCIT_CONTACT:
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index 772eecfb54..37ddd166ee 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -343,7 +343,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) dat->list.expanded = 1; dat->list.hideOffline = db_get_b(NULL, "CLC", "HideOfflineRoot", 0) && (style & CLS_USEGROUPS); dat->list.cl.destroy(); - dat->list.totalMembers = 0;
+ dat->list.totalMembers = 0; dat->selection = -1; for (int i = 1;; i++) { @@ -357,9 +357,9 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { if (style & CLS_SHOWHIDDEN || !db_get_b(hContact, "CList", "Hidden", 0)) { ClcGroup *group; - ptrT tszGroupName(db_get_tsa(hContact, "CList", "Group"));
- if (tszGroupName == NULL)
- group = &dat->list;
+ ptrT tszGroupName(db_get_tsa(hContact, "CList", "Group")); + if (tszGroupName == NULL) + group = &dat->list; else { group = cli.pfnAddGroup(hwnd, dat, tszGroupName, (DWORD)-1, 0, 0); if (group == NULL && style & CLS_SHOWHIDDEN) @@ -550,7 +550,7 @@ void fnSortCLC(HWND hwnd, ClcData *dat, int useInsertionSort) if (cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) == -1) hSelItem = NULL; else - hSelItem = (UINT_PTR)cli.pfnContactToHItem(selcontact); + hSelItem = Clist_ContactToHItem(selcontact); group->scanIndex = 0; SortGroup(dat, group, useInsertionSort); for (;;) { diff --git a/src/mir_app/src/clcmsgs.cpp b/src/mir_app/src/clcmsgs.cpp index b433ab3e7c..bd9bd1a4b7 100644 --- a/src/mir_app/src/clcmsgs.cpp +++ b/src/mir_app/src/clcmsgs.cpp @@ -191,7 +191,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar case CLM_GETNEXTITEM:
if (wParam == CLGN_ROOT) {
if (dat->list.cl.getCount())
- return (LRESULT)cli.pfnContactToHItem(dat->list.cl[0]);
+ return Clist_ContactToHItem(dat->list.cl[0]);
return NULL;
}
@@ -206,7 +206,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar group = contact->group;
if (group->cl.getCount() == 0)
return NULL;
- return (LRESULT)cli.pfnContactToHItem(group->cl[0]);
+ return Clist_ContactToHItem(group->cl[0]);
case CLGN_PARENT:
return group->groupId | HCONTACT_ISGROUP;
@@ -216,14 +216,14 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar if (++i >= group->cl.getCount())
return NULL;
} while (group->cl[i]->type == CLCIT_DIVIDER);
- return (LRESULT)cli.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)cli.pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
case CLGN_NEXTCONTACT:
for (i++; i < group->cl.getCount(); i++)
@@ -231,7 +231,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar break;
if (i >= group->cl.getCount())
return NULL;
- return (LRESULT)cli.pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
case CLGN_PREVIOUSCONTACT:
if (i >= group->cl.getCount())
@@ -241,7 +241,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar break;
if (i < 0)
return NULL;
- return (LRESULT)cli.pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
case CLGN_NEXTGROUP:
for (i++; i < group->cl.getCount(); i++)
@@ -249,7 +249,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar break;
if (i >= group->cl.getCount())
return NULL;
- return (LRESULT)cli.pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
case CLGN_PREVIOUSGROUP:
if (i >= group->cl.getCount())
@@ -259,7 +259,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar break;
if (i < 0)
return NULL;
- return (LRESULT)cli.pfnContactToHItem(group->cl[i]);
+ return Clist_ContactToHItem(group->cl[i]);
}
return NULL;
@@ -269,7 +269,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar case CLM_GETSELECTION:
if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, NULL) == -1)
return NULL;
- return (LRESULT)cli.pfnContactToHItem(contact);
+ return Clist_ContactToHItem(contact);
case CLM_GETTEXTCOLOR:
if (wParam > FONTID_MAX)
@@ -285,7 +285,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar if (hit == -1)
return NULL;
}
- return (LRESULT)cli.pfnContactToHItem(contact);
+ return Clist_ContactToHItem(contact);
case CLM_SELECTITEM:
if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL))
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index da0f86b0ad..b8cdb04f8f 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -635,8 +635,8 @@ void fnHideInfoTip(HWND, ClcData *dat) return;
CLCINFOTIP it = { 0 };
- it.isGroup = IsHContactGroup((UINT_PTR)dat->hInfoTipItem);
- it.hItem = (HANDLE)((UINT_PTR)dat->hInfoTipItem & ~HCONTACT_ISGROUP);
+ it.isGroup = IsHContactGroup(dat->hInfoTipItem);
+ it.hItem = (HANDLE)(dat->hInfoTipItem & ~HCONTACT_ISGROUP);
it.cbSize = sizeof(it);
dat->hInfoTipItem = NULL;
NotifyEventHooks(hHideInfoTipEvent, 0, (LPARAM)&it);
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index 70b8ef420c..7fc033e22c 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -81,8 +81,6 @@ static INT_PTR srvRetrieveInterface(WPARAM, LPARAM) cli.pfnGetRowsPriorTo = fnGetRowsPriorTo;
cli.pfnFindItem = fnFindItem;
cli.pfnGetRowByIndex = fnGetRowByIndex;
- cli.pfnContactToHItem = fnContactToHItem;
- cli.pfnContactToItemHandle = fnContactToItemHandle;
cli.pfnAddGroup = fnAddGroup;
cli.pfnAddItemToGroup = fnAddItemToGroup;
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 83558a0ecf..07184f4596 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -260,3 +260,5 @@ Clist_GroupRename @258 Clist_EndRebuild @259
Clist_GroupAdded @260
Contact_GetInfo @261
+Clist_ContactToHItem @262
+Clist_ContactToItemHandle @263
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index e4d27302d3..962847263d 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -260,3 +260,5 @@ Clist_GroupRename @258 Clist_EndRebuild @259
Clist_GroupAdded @260
Contact_GetInfo @261
+Clist_ContactToHItem @262
+Clist_ContactToItemHandle @263
|