diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
commit | ddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch) | |
tree | 5d74f37a7013d13b92c182628d6b68a58e148ae4 /plugins/Clist_mw | |
parent | c39340bf493a1745a41317bbf937fc7eb6cbb26a (diff) |
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts
git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_mw')
-rw-r--r-- | plugins/Clist_mw/src/clc.cpp | 30 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clc.h | 10 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clcidents.cpp | 11 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clcitems.cpp | 23 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clist.h | 10 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clistmod.cpp | 15 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clistopts.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clistsettings.cpp | 34 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clui.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_mw/src/commonheaders.h | 2 | ||||
-rw-r--r-- | plugins/Clist_mw/src/contact.cpp | 20 | ||||
-rw-r--r-- | plugins/Clist_mw/src/init.cpp | 6 |
12 files changed, 82 insertions, 83 deletions
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index e11b858931..b138a66c92 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -48,7 +48,7 @@ static int stopStatusUpdater = 0; void StatusUpdaterThread(void*)
{
int i,curdelay,lastcheck = 0;
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_LOWEST);
@@ -62,7 +62,7 @@ void StatusUpdaterThread(void*) if ( db_get_b(hContact,"CList","StatusMsgAuto",0)) {
for (i = 0; i<5; i++) {
if (hContact != NULL) {
- ClcCacheEntry *pdnce = (ClcCacheEntry *)pcli->pfnGetCacheEntry((HANDLE)hContact);
+ ClcCacheEntry *pdnce = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (pdnce && !pdnce->protoNotExists && pdnce->szProto)
CallContactService(hContact, PSS_GETAWAYMSG, 0, 0);
@@ -143,9 +143,9 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_ICONCHANGED:
{
int recalcScrollBar = 0,shouldShow;
- HANDLE hSelItem = NULL;
+ HCONTACT hSelItem = NULL;
struct ClcContact *selcontact = NULL;
- ClcCacheEntry *cacheEntry = GetContactFullCacheEntry((HANDLE)wParam);
+ ClcCacheEntry *cacheEntry = GetContactFullCacheEntry((HCONTACT)wParam);
WORD status;
int needsResort = 0;
@@ -158,21 +158,21 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L // this means an offline msg is flashing, so the contact should be shown
shouldShow = (GetWindowLongPtr(hwnd,GWL_STYLE) & CLS_SHOWHIDDEN || !cacheEntry->bIsHidden) &&
- (!pcli->pfnIsHiddenMode(dat,status) || cacheEntry->noHiddenOffline || pcli->pfnGetContactIcon((HANDLE)wParam) != LOWORD(lParam));
+ (!pcli->pfnIsHiddenMode(dat, status) || cacheEntry->noHiddenOffline || pcli->pfnGetContactIcon((HCONTACT)wParam) != LOWORD(lParam));
ClcContact *contact;
ClcGroup *group;
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) {
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1)
- hSelItem = pcli->pfnContactToHItem(selcontact);
- AddContactToTree(hwnd,dat,(HANDLE)wParam,0,0);
+ hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
+ AddContactToTree(hwnd, dat, (HCONTACT)wParam, 0, 0);
needsResort = 1;
recalcScrollBar = 1;
- FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL);
+ FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL);
if (contact) {
contact->iImage = (WORD)lParam;
- pcli->pfnNotifyNewContact(hwnd,(HANDLE)wParam);
+ pcli->pfnNotifyNewContact(hwnd, (HCONTACT)wParam);
dat->needsResort = 1;
}
}
@@ -185,7 +185,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if ( !shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1)
- hSelItem = pcli->pfnContactToHItem(selcontact);
+ hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
RemoveItemFromGroup(hwnd,group,contact,0);
recalcScrollBar = 1;
dat->needsResort = 1;
@@ -220,13 +220,13 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L ClcContact *contact;
ClcGroup *group;
- if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL) && contact != NULL) {
+ if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL) && contact != NULL) {
contact->flags &= ~CONTACTF_STATUSMSG;
- if ( !db_get_ts((HANDLE)wParam, "CList", "StatusMsg", &dbv)) {
+ if (!db_get_ts((HCONTACT)wParam, "CList", "StatusMsg", &dbv)) {
int j;
- if (dbv.ptszVal == NULL||_tcslen(dbv.ptszVal) == 0) break;
+ if (dbv.ptszVal == NULL || _tcslen(dbv.ptszVal) == 0) break;
lstrcpyn(contact->szStatusMsg, dbv.ptszVal, SIZEOF(contact->szStatusMsg));
- for (j = (int)_tcslen(contact->szStatusMsg)-1;j>=0;j--) {
+ for (j = (int)_tcslen(contact->szStatusMsg) - 1; j >= 0; j--) {
if (contact->szStatusMsg[j] == '\r' || contact->szStatusMsg[j] == '\n' || contact->szStatusMsg[j] == '\t') {
contact->szStatusMsg[j] = ' ';
}
diff --git a/plugins/Clist_mw/src/clc.h b/plugins/Clist_mw/src/clc.h index 09b2981ccc..a64b3e055b 100644 --- a/plugins/Clist_mw/src/clc.h +++ b/plugins/Clist_mw/src/clc.h @@ -81,7 +81,7 @@ struct ClcData : public ClcDataBase //clcidents.c
int GetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex);
-int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,ClcGroup **subgroup,int *isVisible);
+int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible);
int GetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,ClcGroup **subgroup);
void ClearRowByIndexCache();
@@ -92,8 +92,8 @@ int AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText); void FreeContact(struct ClcContact *p);
void RebuildEntireList(HWND hwnd,struct ClcData *dat);
ClcGroup *RemoveItemFromGroup(HWND hwnd,ClcGroup *group,struct ClcContact *contact,int updateTotalCount);
-void DeleteItemFromTree(HWND hwnd,HANDLE hItem);
-void AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline);
+void DeleteItemFromTree(HWND hwnd, HCONTACT hItem);
+void AddContactToTree(HWND hwnd, struct ClcData *dat, HCONTACT hContact, int updateTotalCount, int checkHideOffline);
void SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort);
int GetGroupContentsCount(ClcGroup *group,int visibleOnly);
int GetNewSelection(ClcGroup *group,int selection, int direction);
@@ -124,8 +124,8 @@ void UnregisterFileDropping(HWND hwnd); //cluiservices.c
void FreeProtocolData( void );
-int GetContactCachedStatus(HANDLE hContact);
-char *GetContactCachedProtocol(HANDLE hContact);
+int GetContactCachedStatus(HCONTACT hContact);
+char *GetContactCachedProtocol(HCONTACT hContact);
#define CLUI_SetDrawerService "CLUI/SETDRAWERSERVICE"
typedef struct {
diff --git a/plugins/Clist_mw/src/clcidents.cpp b/plugins/Clist_mw/src/clcidents.cpp index a5953b1046..803b7b9f6b 100644 --- a/plugins/Clist_mw/src/clcidents.cpp +++ b/plugins/Clist_mw/src/clcidents.cpp @@ -80,7 +80,7 @@ int GetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex) return -1;
}
-ClcCacheEntry *GetCLCFullCacheEntry(struct ClcData *dat,HANDLE hContact)
+ClcCacheEntry *GetCLCFullCacheEntry(struct ClcData *dat,HCONTACT hContact)
{
if (hContact == 0)
return NULL;
@@ -107,7 +107,7 @@ ClcCacheEntry *GetCLCFullCacheEntry(struct ClcData *dat,HANDLE hContact) return (pdnce);
}
-void ClearClcContactCache(struct ClcData *dat,HANDLE hContact)
+void ClearClcContactCache(struct ClcData *dat,HCONTACT hContact)
{
ClcCacheEntry *cacheEntry;
@@ -133,7 +133,7 @@ void ClearClcContactCache(struct ClcData *dat,HANDLE hContact) }
}
-void SetClcContactCacheItem(struct ClcData *dat,HANDLE hContact,void *contact)
+void SetClcContactCacheItem(struct ClcData *dat, HCONTACT hContact, void *contact)
{
ClcCacheEntry *cacheEntry;
if ( !IsHContactGroup(hContact) && !IsHContactInfo(hContact)) {
@@ -143,7 +143,7 @@ void SetClcContactCacheItem(struct ClcData *dat,HANDLE hContact,void *contact) }
}
-int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,ClcGroup **subgroup,int *isVisible)
+int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible)
{
int index = 0, i;
int nowVisible = 1;
@@ -153,8 +153,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont if (isVisible == NULL && hItem != NULL && subgroup == NULL && !IsHContactGroup(hItem) && !IsHContactInfo(hItem)) {
//try use cache
- ClcCacheEntry *cacheEntry;
- cacheEntry = GetCLCFullCacheEntry(dat,hItem);
+ ClcCacheEntry *cacheEntry = GetCLCFullCacheEntry(dat, (HCONTACT)hItem);
if (cacheEntry != NULL) {
if (cacheEntry->ClcContact == NULL) {
int *isv = {0};
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp index 16e09c18c0..57b4a43fad 100644 --- a/plugins/Clist_mw/src/clcitems.cpp +++ b/plugins/Clist_mw/src/clcitems.cpp @@ -36,12 +36,11 @@ extern void (*saveFreeGroup)(ClcGroup *p); //routines for managing adding/removal of items in the list, including sorting
-extern void ClearClcContactCache(struct ClcData *dat,HANDLE hContact);
+extern void ClearClcContactCache(struct ClcData *dat,HCONTACT hContact);
void AddSubcontacts(struct ClcContact * cont)
{
int subcount,i,j;
- HANDLE hsub;
ClcCacheEntry *cacheEntry;
cacheEntry = GetContactFullCacheEntry(cont->hContact);
OutputDebugStringA("Proceed AddSubcontacts\r\n");
@@ -52,7 +51,7 @@ void AddSubcontacts(struct ClcContact * cont) cont->SubAllocated = subcount;
i = 0;
for (j = 0; j<subcount; j++) {
- hsub = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)cont->hContact,j);
+ HCONTACT hsub = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)cont->hContact, j);
cacheEntry = GetContactFullCacheEntry(hsub);
if ( !(db_get_b(NULL,"CLC","MetaHideOfflineSub",1) && db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) ||
cacheEntry->status != ID_STATUS_OFFLINE )
@@ -115,7 +114,7 @@ static struct ClcContact* AddContactToGroup(struct ClcData *dat,ClcGroup *group, char *szProto;
WORD apparentMode;
DWORD idleMode;
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
int i;
int img = -1;
@@ -183,7 +182,7 @@ static struct ClcContact* AddContactToGroup(struct ClcData *dat,ClcGroup *group, return group->cl.items[i];
}
-void AddContactToTree(HWND hwnd, ClcData *dat, HANDLE hContact, int updateTotalCount, int checkHideOffline)
+void AddContactToTree(HWND hwnd, ClcData *dat, HCONTACT hContact, int updateTotalCount, int checkHideOffline)
{
if ( FindItem(hwnd,dat,hContact,NULL,NULL,NULL) == 1)
return;
@@ -275,7 +274,7 @@ ClcGroup *RemoveItemFromGroup(HWND hwnd,ClcGroup *group,struct ClcContact *conta return group;
}
-void DeleteItemFromTree(HWND hwnd,HANDLE hItem)
+void DeleteItemFromTree(HWND hwnd, HCONTACT hItem)
{
struct ClcContact *contact;
ClcGroup *group;
@@ -327,7 +326,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) int tick = GetTickCount();
ClearRowByIndexCache();
- ClearClcContactCache(dat,INVALID_HANDLE_VALUE);
+ ClearClcContactCache(dat, (HCONTACT)INVALID_HANDLE_VALUE);
dat->list.expanded = 1;
dat->list.hideOffline = db_get_b(NULL,"CLC","HideOfflineRoot",0);
@@ -349,7 +348,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) }
}
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cacheEntry;
cont = NULL;
cacheEntry = GetContactFullCacheEntry(hContact);
@@ -417,7 +416,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) mir_snprintf(buf, SIZEOF(buf), "RebuildEntireList %d \r\n", tick);
OutputDebugStringA(buf);
- db_set_dw((HANDLE)0,"CLUI","PF:Last RebuildEntireList Time:",tick);
+ db_set_dw(0,"CLUI","PF:Last RebuildEntireList Time:",tick);
}
}
@@ -506,7 +505,7 @@ void SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort) if (tick > 5) {
mir_snprintf(buf, SIZEOF(buf), "SortCLC %d \r\n", tick);
OutputDebugStringA(buf);
- db_set_dw((HANDLE)0,"CLUI","PF:Last SortCLC Time:",tick);
+ db_set_dw(0,"CLUI","PF:Last SortCLC Time:",tick);
}
}
#endif
@@ -514,7 +513,7 @@ void SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort) struct SavedContactState_t
{
- HANDLE hContact;
+ HCONTACT hContact;
WORD iExtraImage[EXTRA_ICON_COUNT];
int checked;
};
@@ -654,7 +653,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat) for (i = 0;i<savedInfoCount;i++) {
if (savedInfo[i].parentId == -1) group = &dat->list;
else {
- if ( !FindItem(hwnd,dat,(HANDLE)(savedInfo[i].parentId|HCONTACT_ISGROUP),&contact,NULL,NULL)) continue;
+ if (!FindItem(hwnd, dat, (HCONTACT)(savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) continue;
group = contact->group;
}
j = AddInfoItemToGroup(group,savedInfo[i].contact.flags,_T(""));
diff --git a/plugins/Clist_mw/src/clist.h b/plugins/Clist_mw/src/clist.h index e234bbdd10..7b7b2e1589 100644 --- a/plugins/Clist_mw/src/clist.h +++ b/plugins/Clist_mw/src/clist.h @@ -26,12 +26,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define _CLIST_H_
void LoadContactTree(void);
-int ExtIconFromStatusMode(HANDLE hContact, const char *szProto,int status);
-HTREEITEM GetTreeItemByHContact(HANDLE hContact);
+int ExtIconFromStatusMode(HCONTACT hContact, const char *szProto,int status);
+HTREEITEM GetTreeItemByHContact(HCONTACT hContact);
void TrayIconUpdateWithImageList(int iImage,const char *szNewTip,char *szPreferredProto);
void SortContacts(void);
-void ChangeContactIcon(HANDLE hContact,int iIcon,int add);
-int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status);
+void ChangeContactIcon(HCONTACT hContact,int iIcon,int add);
+int GetContactInfosForSort(HCONTACT hContact,char **Proto,TCHAR **Name,int *Status);
struct ClcCacheEntry : public ClcCacheEntryBase
{
@@ -50,6 +50,6 @@ struct ClcCacheEntry : public ClcCacheEntryBase boolean isUnknown;
};
-ClcCacheEntry* GetContactFullCacheEntry(HANDLE hContact);
+ClcCacheEntry* GetContactFullCacheEntry(HCONTACT hContact);
#endif
\ No newline at end of file diff --git a/plugins/Clist_mw/src/clistmod.cpp b/plugins/Clist_mw/src/clistmod.cpp index 9beb827e1d..aff0c241fe 100644 --- a/plugins/Clist_mw/src/clistmod.cpp +++ b/plugins/Clist_mw/src/clistmod.cpp @@ -42,19 +42,18 @@ extern BYTE nameOrder[]; static HANDLE hSettingChanged, hProtoAckHook;
/////////// End by FYR ////////
-int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact)
+int cli_IconFromStatusMode(const char *szProto,int nStatus, HCONTACT hContact)
{
int result = -1;
if (hContact && szProto) {
char * szActProto = (char*)szProto;
int nActStatus = nStatus;
- HANDLE hActContact = hContact;
+ HCONTACT hActContact = hContact;
if ( !db_get_b(NULL,"CLC","Meta",0) && !strcmp(szActProto,"MetaContacts")) {
// substitute params by mostonline contact datas
- HANDLE hMostOnlineContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hActContact,0);
+ HCONTACT hMostOnlineContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hActContact, 0);
if (hMostOnlineContact && hMostOnlineContact != (HANDLE)CALLSERVICE_NOTFOUND) {
- ClcCacheEntry *cacheEntry;
- cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hMostOnlineContact);
+ ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hMostOnlineContact);
if (cacheEntry && cacheEntry->szProto) {
szActProto = cacheEntry->szProto;
nActStatus = cacheEntry->status;
@@ -76,14 +75,14 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) ////////// By FYR/////////////
-int ExtIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
+int ExtIconFromStatusMode(HCONTACT hContact, const char *szProto,int status)
{
/* if ( db_get_b( NULL, "CLC", "Meta", 0 ) == 1 )
return pcli->pfnIconFromStatusMode(szProto,status,hContact);
if ( szProto != NULL ) {
if (strcmp(szProto,"MetaContacts") == 0 ) {
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(UINT)hContact,0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT,(UINT)hContact,0);
if ( hContact != 0 ) {
szProto = GetContactProto((UINT)hContact,0);
status = db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE);
@@ -129,7 +128,7 @@ static int ContactListShutdownProc(WPARAM wParam,LPARAM lParam) int LoadContactListModule(void)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
db_set_s(hContact, "CList", "StatusMsg", "");
hCListImages = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
diff --git a/plugins/Clist_mw/src/clistopts.cpp b/plugins/Clist_mw/src/clistopts.cpp index bccc015bc2..c85b67c4f2 100644 --- a/plugins/Clist_mw/src/clistopts.cpp +++ b/plugins/Clist_mw/src/clistopts.cpp @@ -51,7 +51,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
case WM_USER+1:
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBCONTACTWRITESETTING * ws = (DBCONTACTWRITESETTING *)lParam;
if ( hContact == NULL && ws != NULL && ws->szModule != NULL && ws->szSetting != NULL
&& lstrcmpiA(ws->szModule,"CList") == 0 && lstrcmpiA(ws->szSetting,"UseGroups") == 0
diff --git a/plugins/Clist_mw/src/clistsettings.cpp b/plugins/Clist_mw/src/clistsettings.cpp index ed3573d6d7..29a14487cf 100644 --- a/plugins/Clist_mw/src/clistsettings.cpp +++ b/plugins/Clist_mw/src/clistsettings.cpp @@ -25,12 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h"
#include "clist.h"
-TCHAR *GetNameForContact(HANDLE hContact,int flag,boolean *isUnknown);
-char *GetProtoForContact(HANDLE hContact);
-int GetStatusForContact(HANDLE hContact,char *szProto);
+TCHAR *GetNameForContact(HCONTACT hContact,int flag,boolean *isUnknown);
+char *GetProtoForContact(HCONTACT hContact);
+int GetStatusForContact(HCONTACT hContact,char *szProto);
TCHAR *UnknownConctactTranslatedName;
extern boolean OnModulesLoadedCalled;
-void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,ClcCacheEntry *pdnce,int SettingType);
+void InvalidateDisplayNameCacheEntryByPDNE(HCONTACT hContact,ClcCacheEntry *pdnce,int SettingType);
static int handleCompare( ClcCacheEntry* c1, ClcCacheEntry* c2 )
{
@@ -46,7 +46,7 @@ void InitDisplayNameCache(SortedList *list) list->increment = CallService(MS_DB_CONTACT_GETCOUNT,0,0)+1;
i = 0;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *pdnce = (ClcCacheEntry *)mir_calloc(sizeof(ClcCacheEntry));
pdnce->hContact = hContact;
InvalidateDisplayNameCacheEntryByPDNE(hContact,pdnce,0);
@@ -143,7 +143,7 @@ void CheckPDNCE(ClcCacheEntry *_pdnce) pdnce->IsExpanded = db_get_b(pdnce->hContact,"CList","Expanded",0);
}
-void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,ClcCacheEntry *pdnce,int SettingType)
+void InvalidateDisplayNameCacheEntryByPDNE(HCONTACT hContact,ClcCacheEntry *pdnce,int SettingType)
{
if ( hContact == NULL || pdnce == NULL )
return;
@@ -192,7 +192,7 @@ void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,ClcCacheEntry *pdnce, pdnce->IsExpanded = -1;
}
-char *GetContactCachedProtocol(HANDLE hContact)
+char *GetContactCachedProtocol(HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry&&cacheEntry->szProto)
@@ -201,21 +201,21 @@ char *GetContactCachedProtocol(HANDLE hContact) return NULL;
}
-char *GetProtoForContact(HANDLE hContact)
+char *GetProtoForContact(HCONTACT hContact)
{
return mir_strdup(GetContactProto(hContact));
}
-int GetStatusForContact(HANDLE hContact,char *szProto)
+int GetStatusForContact(HCONTACT hContact,char *szProto)
{
int status = ID_STATUS_OFFLINE;
if (szProto)
- status = db_get_w((HANDLE)hContact,szProto,"Status",ID_STATUS_OFFLINE);
+ status = db_get_w((HCONTACT)hContact, szProto, "Status", ID_STATUS_OFFLINE);
return (status);
}
-TCHAR* GetNameForContact(HANDLE hContact,int flag,boolean *isUnknown)
+TCHAR* GetNameForContact(HCONTACT hContact,int flag,boolean *isUnknown)
{
TCHAR* result = pcli->pfnGetContactDisplayName(hContact, flag | GCDNF_NOCACHE);
@@ -229,7 +229,7 @@ TCHAR* GetNameForContact(HANDLE hContact,int flag,boolean *isUnknown) return result;
}
-ClcCacheEntry *GetContactFullCacheEntry(HANDLE hContact)
+ClcCacheEntry *GetContactFullCacheEntry(HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry != NULL)
@@ -238,7 +238,7 @@ ClcCacheEntry *GetContactFullCacheEntry(HANDLE hContact) return NULL;
}
-int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status)
+int GetContactInfosForSort(HCONTACT hContact,char **Proto,TCHAR **Name,int *Status)
{
ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry != NULL)
@@ -250,7 +250,7 @@ int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status return 0;
}
-int GetContactCachedStatus(HANDLE hContact)
+int GetContactCachedStatus(HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry&&cacheEntry->status != 0) return cacheEntry->status;
@@ -260,7 +260,7 @@ int GetContactCachedStatus(HANDLE hContact) int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
// Early exit
if (hContact == NULL)
@@ -281,7 +281,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) if (cws->value.type == DBVT_WORD && !strcmp(cws->szSetting, "Status")) {
if ( !(pdnce->bIsHidden == 1)) {
- if ( db_get_b((HANDLE)NULL,"CList","ShowStatusMsg",0)||db_get_b(hContact,"CList","StatusMsgAuto",0))
+ if ( db_get_b(NULL,"CList","ShowStatusMsg",0)||db_get_b(hContact,"CList","StatusMsgAuto",0))
db_set_s(hContact, "CList", "StatusMsg", "");
if ( db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) {
@@ -315,7 +315,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) if ( !strcmp(cws->szSetting,"Hidden")) {
InvalidateDisplayNameCacheEntryByPDNE(hContact,pdnce,cws->value.type);
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) {
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
ChangeContactIcon(hContact,ExtIconFromStatusMode(hContact, szProto, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)), 1); //by FYR
}
}
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp index c87b62c6ae..1dffd90f71 100644 --- a/plugins/Clist_mw/src/clui.cpp +++ b/plugins/Clist_mw/src/clui.cpp @@ -93,7 +93,7 @@ static int CluiModulesLoaded(WPARAM wParam,LPARAM lParam) PostMessage(pcli->hwndContactList,M_CREATECLC,0,0);
OnModulesLoadedCalled = TRUE;
- pcli->pfnInvalidateDisplayNameCacheEntry(INVALID_HANDLE_VALUE);
+ pcli->pfnInvalidateDisplayNameCacheEntry((HCONTACT)INVALID_HANDLE_VALUE);
InitGroupMenus();
RegisterProtoIconsForAllProtoIconLib();
return 0;
diff --git a/plugins/Clist_mw/src/commonheaders.h b/plugins/Clist_mw/src/commonheaders.h index 2a52b421a5..70dffe6570 100644 --- a/plugins/Clist_mw/src/commonheaders.h +++ b/plugins/Clist_mw/src/commonheaders.h @@ -88,7 +88,7 @@ extern int __cdecl MyStrCmpiT(const TCHAR *a, const TCHAR *b); extern DWORD exceptFunction(LPEXCEPTION_POINTERS EP);
-extern int (*saveIconFromStatusMode)(const char *szProto, int nStatus, HANDLE hContact);
+extern int (*saveIconFromStatusMode)(const char *szProto, int nStatus, HCONTACT hContact);
//from bkg options
diff --git a/plugins/Clist_mw/src/contact.cpp b/plugins/Clist_mw/src/contact.cpp index 095998689e..a41cc99992 100644 --- a/plugins/Clist_mw/src/contact.cpp +++ b/plugins/Clist_mw/src/contact.cpp @@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "clist.h"
extern HANDLE hContactIconChangedEvent;
-extern int GetContactCachedStatus(HANDLE hContact);
-extern char *GetContactCachedProtocol(HANDLE hContact);
+extern int GetContactCachedStatus(HCONTACT hContact);
+extern char *GetContactCachedProtocol(HCONTACT hContact);
int sortByStatus;
static int sortByProto;
@@ -47,7 +47,7 @@ struct { {ID_STATUS_ONTHEPHONE,150},
{ID_STATUS_OUTTOLUNCH,425}};
-static int GetContactStatus(HANDLE hContact)
+static int GetContactStatus(HCONTACT hContact)
{
/*
@@ -60,7 +60,7 @@ static int GetContactStatus(HANDLE hContact) return (GetContactCachedStatus(hContact));
}
-void ChangeContactIcon(HANDLE hContact,int iIcon,int add)
+void ChangeContactIcon(HCONTACT hContact,int iIcon,int add)
{
//clui MS_CLUI_CONTACTADDED MS_CLUI_CONTACTSETICON this methods is null
//CallService(add?MS_CLUI_CONTACTADDED:MS_CLUI_CONTACTSETICON,(WPARAM)hContact,iIcon);
@@ -87,7 +87,7 @@ void LoadContactTree(void) int hideOffline = db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cacheEntry = GetContactFullCacheEntry(hContact);
if (cacheEntry == NULL) {
MessageBoxA(0,"Fail To Get CacheEntry for hContact","!!!!!",0);
@@ -114,7 +114,7 @@ void LoadContactTree(void) int CompareContacts( const struct ClcContact *contact1, const struct ClcContact *contact2 )
{
- HANDLE a = contact1->hContact, b = contact2->hContact;
+ HCONTACT a = contact1->hContact, b = contact2->hContact;
TCHAR *namea,*nameb;
int statusa,statusb;
char *szProto1,*szProto2;
@@ -167,12 +167,14 @@ void SortContacts(void) INT_PTR ContactChangeGroup(WPARAM wParam,LPARAM lParam)
{
+ HCONTACT hContact = (HCONTACT)wParam;
+
CallService(MS_CLUI_CONTACTDELETED,wParam,0);
if ((HANDLE)lParam == NULL)
- db_unset((HANDLE)wParam,"CList","Group");
+ db_unset(hContact, "CList", "Group");
else
- db_set_s((HANDLE)wParam,"CList","Group",(char*)CallService(MS_CLIST_GROUPGETNAME2,lParam,(LPARAM)(int*)NULL));
+ db_set_s(hContact, "CList", "Group", (char*)CallService(MS_CLIST_GROUPGETNAME2, lParam, (LPARAM)(int*)NULL));
- CallService(MS_CLUI_CONTACTADDED,wParam,ExtIconFromStatusMode((HANDLE)wParam, GetContactProto((HANDLE)wParam), GetContactStatus((HANDLE)wParam)));
+ CallService(MS_CLUI_CONTACTADDED, wParam, ExtIconFromStatusMode(hContact, GetContactProto(hContact), GetContactStatus(hContact)));
return 0;
}
diff --git a/plugins/Clist_mw/src/init.cpp b/plugins/Clist_mw/src/init.cpp index 52581b9f03..940927a4b3 100644 --- a/plugins/Clist_mw/src/init.cpp +++ b/plugins/Clist_mw/src/init.cpp @@ -67,8 +67,8 @@ void SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort); INT_PTR ( *saveTrayIconProcessMessage )(WPARAM wParam,LPARAM lParam);
INT_PTR TrayIconProcessMessage(WPARAM wParam,LPARAM lParam);
-int (*saveIconFromStatusMode)(const char *szProto,int nStatus, HANDLE hContact);
-int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact);
+int (*saveIconFromStatusMode)(const char *szProto,int nStatus, HCONTACT hContact);
+int cli_IconFromStatusMode(const char *szProto,int nStatus, HCONTACT hContact);
//from clcfonts
void RegisterCListFonts( void );
@@ -140,7 +140,7 @@ static struct ClcContact* fnCreateClcContact( void ) return (struct ClcContact*)mir_calloc( sizeof( struct ClcContact ));
}
-static ClcCacheEntry *fnCreateCacheItem( HANDLE hContact )
+static ClcCacheEntry *fnCreateCacheItem(HCONTACT hContact )
{
ClcCacheEntry *p = (ClcCacheEntry *)mir_calloc( sizeof( ClcCacheEntry ));
if ( p )
|