summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
commitddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch)
tree5d74f37a7013d13b92c182628d6b68a58e148ae4 /plugins/Clist_modern
parentc39340bf493a1745a41317bbf937fc7eb6cbb26a (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_modern')
-rw-r--r--plugins/Clist_modern/src/hdr/modern_awaymsg.h2
-rw-r--r--plugins/Clist_modern/src/hdr/modern_cache_funcs.h4
-rw-r--r--plugins/Clist_modern/src/hdr/modern_clc.h14
-rw-r--r--plugins/Clist_modern/src/hdr/modern_clist.h6
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonheaders.h10
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonprototypes.h38
-rw-r--r--plugins/Clist_modern/src/hdr/modern_gettextasync.h4
-rw-r--r--plugins/Clist_modern/src/hdr/modern_global_structure.h2
-rw-r--r--plugins/Clist_modern/src/hdr/modern_skinned_profile.h8
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp14
-rw-r--r--plugins/Clist_modern/src/modern_awaymsg.cpp15
-rw-r--r--plugins/Clist_modern/src/modern_cachefuncs.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp81
-rw-r--r--plugins/Clist_modern/src/modern_clcidents.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp47
-rw-r--r--plugins/Clist_modern/src/modern_clcmsgs.cpp44
-rw-r--r--plugins/Clist_modern/src/modern_clistevents.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp32
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_contact.cpp46
-rw-r--r--plugins/Clist_modern/src/modern_gettextasync.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_rowheight_funcs.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp12
26 files changed, 213 insertions, 222 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_awaymsg.h b/plugins/Clist_modern/src/hdr/modern_awaymsg.h
index ced79d077f..df40446f2c 100644
--- a/plugins/Clist_modern/src/hdr/modern_awaymsg.h
+++ b/plugins/Clist_modern/src/hdr/modern_awaymsg.h
@@ -34,4 +34,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void InitAwayMsgModule();
void UninitAwayMsgModule();
-void amRequestAwayMsg(HANDLE hContact);
+void amRequestAwayMsg(HCONTACT hContact);
diff --git a/plugins/Clist_modern/src/hdr/modern_cache_funcs.h b/plugins/Clist_modern/src/hdr/modern_cache_funcs.h
index 8566333734..9b32eb6788 100644
--- a/plugins/Clist_modern/src/hdr/modern_cache_funcs.h
+++ b/plugins/Clist_modern/src/hdr/modern_cache_funcs.h
@@ -37,11 +37,11 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact);
void Cache_GetSecondLineText(struct SHORTDATA *dat, ClcCacheEntry *pdnce);
void Cache_GetThirdLineText(struct SHORTDATA *dat, ClcCacheEntry *pdnce);
void Cache_GetAvatar(ClcData *dat, ClcContact *contact);
-void Cache_GetTimezone(ClcData *dat, HANDLE hContact);
+void Cache_GetTimezone(ClcData *dat, HCONTACT hContact);
int Cache_GetLineText(ClcCacheEntry *pdnce, int type, LPTSTR text, int text_size, TCHAR *variable_text, BOOL xstatus_has_priority,
BOOL show_status_if_no_away, BOOL show_listening_if_no_away, BOOL use_name_and_message_for_xstatus,
BOOL pdnce_time_show_only_if_different);
-void amRequestAwayMsg(HANDLE hContact);
+void amRequestAwayMsg(HCONTACT hContact);
#endif // __CACHE_FUNCS_H__
diff --git a/plugins/Clist_modern/src/hdr/modern_clc.h b/plugins/Clist_modern/src/hdr/modern_clc.h
index af1838b8a5..2e8cfe1224 100644
--- a/plugins/Clist_modern/src/hdr/modern_clc.h
+++ b/plugins/Clist_modern/src/hdr/modern_clc.h
@@ -396,7 +396,7 @@ void ClcOptionsChanged(void);
//clcidents.c
int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex);
-int FindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible, BOOL isIgnoreSubcontacts );
+int FindItem(HWND hwnd, ClcData *dat, HCONTACT hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts);
int cliGetRowByIndex(ClcData *dat,int testindex,ClcContact **contact,ClcGroup **subgroup);
HANDLE ContactToHItem(ClcContact *contact);
HANDLE ContactToItemHandle(ClcContact *contact,DWORD *nmFlags);
@@ -406,9 +406,9 @@ void ClearRowByIndexCache();
ClcGroup *cli_AddGroup(HWND hwnd,ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers);
void cli_FreeGroup(ClcGroup *group);
int cli_AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText);
-void cliRebuildEntireList(HWND hwnd,ClcData *dat);
-void cli_DeleteItemFromTree(HWND hwnd,HANDLE hItem);
-void cli_AddContactToTree(HWND hwnd,ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline);
+void cliRebuildEntireList(HWND hwnd, ClcData *dat);
+void cli_DeleteItemFromTree(HWND hwnd, HCONTACT hItem);
+void cli_AddContactToTree(HWND hwnd,ClcData *dat,HCONTACT hContact,int updateTotalCount,int checkHideOffline);
void cli_SortCLC(HWND hwnd,ClcData *dat,int useInsertionSort);
int GetNewSelection(ClcGroup *group,int selection, int direction);
@@ -433,13 +433,13 @@ DWORD GetDefaultExStyle(void);
void GetFontSetting(int i,LOGFONT *lf,COLORREF *colour,BYTE *effect, COLORREF *eColour1,COLORREF *eColour2);
//clistsettings.c
-TCHAR * GetContactDisplayNameW( HANDLE hContact, int mode );
+TCHAR * GetContactDisplayNameW(HCONTACT hContact, int mode );
//groups.c
TCHAR* GetGroupNameTS( int idx, DWORD* pdwFlags );
int RenameGroupT(WPARAM groupID, LPARAM newName);
-int GetContactCachedStatus(HANDLE hContact);
-char *GetContactCachedProtocol(HANDLE hContact);
+int GetContactCachedStatus(HCONTACT hContact);
+char *GetContactCachedProtocol(HCONTACT hContact);
#endif /* _CLC_H_ */
diff --git a/plugins/Clist_modern/src/hdr/modern_clist.h b/plugins/Clist_modern/src/hdr/modern_clist.h
index ff9c776fd4..1c6c5923e8 100644
--- a/plugins/Clist_modern/src/hdr/modern_clist.h
+++ b/plugins/Clist_modern/src/hdr/modern_clist.h
@@ -28,9 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define _CLIST_H_
void LoadContactTree(void);
-HTREEITEM GetTreeItemByHContact(HANDLE hContact);
-void cli_ChangeContactIcon(HANDLE hContact,int iIcon,int add);
-int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status);
+HTREEITEM GetTreeItemByHContact(HCONTACT hContact);
+void cli_ChangeContactIcon(HCONTACT hContact,int iIcon,int add);
+int GetContactInfosForSort(HCONTACT hContact,char **Proto,TCHAR **Name,int *Status);
///////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
index f9424cb810..636388c61a 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
@@ -241,14 +241,14 @@ int AniAva_InitModule(); // HAVE TO BE AFTER GDI+ INITIALIZED
int AniAva_UnloadModule();
int AniAva_UpdateOptions(); //reload options, //hot enable/disable engine
-int AniAva_AddAvatar(HANDLE hContact, TCHAR * szFilename, int width, int heigth); // adds avatars to be displayed
-int AniAva_SetAvatarPos(HANDLE hContact, RECT *rc, int overlayIdx, BYTE bAlpha); // update avatars pos
-int AniAva_InvalidateAvatarPositions(HANDLE hContact); // reset positions of avatars to be drawn (still be painted at same place)
+int AniAva_AddAvatar(HCONTACT hContact, TCHAR * szFilename, int width, int heigth); // adds avatars to be displayed
+int AniAva_SetAvatarPos(HCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha); // update avatars pos
+int AniAva_InvalidateAvatarPositions(HCONTACT hContact); // reset positions of avatars to be drawn (still be painted at same place)
int AniAva_RemoveInvalidatedAvatars(); // all avatars without validated position will be stop painted and probably removed
-int AniAva_RemoveAvatar(HANDLE hContact); // remove avatar
+int AniAva_RemoveAvatar(HCONTACT hContact); // remove avatar
int AniAva_RedrawAllAvatars(BOOL updateZOrder); // request to repaint all
void AniAva_UpdateParent();
-int AniAva_RenderAvatar( HANDLE hContact, HDC hdcMem, RECT *rc );
+int AniAva_RenderAvatar(HCONTACT hContact, HDC hdcMem, RECT *rc );
#define CCI_NAME 1
#define CCI_GROUP (1<<1)
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
index 7d8eb47536..64409abab3 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
@@ -207,21 +207,21 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); //RowTemplate.c
BOOL FindMenuHanleByGlobalID(HMENU hMenu, int globalID, struct _MenuItemHandles * dat); //GenMenu.c
BOOL MatchMask(char *name, char *mask); //mod_skin_selector.c
-char* GetContactCachedProtocol(HANDLE hContact); //clistsettings.c
+char* GetContactCachedProtocol(HCONTACT hContact); //clistsettings.c
char* GetParamN(char *string, char *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces); //mod_skin_selector.c
WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim, BOOL SkipSpaces);
-DWORD CompareContacts2_getLMTime(HANDLE u); //contact.c
+DWORD CompareContacts2_getLMTime(HCONTACT u); //contact.c
DWORD mod_CalcHash(const char * a); //mod_skin_selector.c
-HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status); //clistmod.c
+HICON cliGetIconFromStatusMode(HCONTACT hContact, const char *szProto,int status); //clistmod.c
HICON GetMainStatusOverlay(int STATUS); //clc.c
-int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szStatus, ClcData *dat); //clcitems.c
+int __fastcall CLVM_GetContactHiddenStatus(HCONTACT hContact, char *szStatus, ClcData *dat); //clcitems.c
int BgStatusBarChange(WPARAM wParam,LPARAM lParam); //clcopts.c
int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack); //clc.c
int ModernSkinButtonDeleteAll(); //modernbutton.c
-int GetContactCachedStatus(HANDLE hContact); //clistsettings.c
+int GetContactCachedStatus(HCONTACT hContact); //clistsettings.c
int GetContactIconC(ClcCacheEntry *cacheEntry); //clistmod.c
int GetContactIndex(ClcGroup *group,ClcContact *contact); //clcidents.c
-int GetStatusForContact(HANDLE hContact,char *szProto); //clistsettings.c
+int GetStatusForContact(HCONTACT hContact,char *szProto); //clistsettings.c
int InitCustomMenus(void); //clistmenus.c
int InitFramesMenus(void); //framesmenus.c
int LoadMoveToGroup(); //movetogroup.c
@@ -247,7 +247,7 @@ void Docking_GetMonitorRectFromWindow(HWND hWnd,RECT *rc);
void DrawAvatarImageWithGDIp(HDC hDestDC,int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1,DWORD flag,BYTE alpha); //gdiplus.cpp
void FreeRowCell(); //RowHeight
void InitGdiPlus(); //gdiplus.cpp
-void InvalidateDNCEbyPointer(HANDLE hContact,ClcCacheEntry *pdnce,int SettingType); //clistsettings.c
+void InvalidateDNCEbyPointer(HCONTACT hContact,ClcCacheEntry *pdnce,int SettingType); //clistsettings.c
void ShutdownGdiPlus(); //gdiplus.cpp
void UninitCustomMenus(); //clistmenus.c
void UnloadAvatarOverlayIcon(); //clc.c
@@ -255,7 +255,7 @@ void UnLoadContactListModule(); /
void UpdateAllAvatars(ClcData *dat); //cache_func.c
//cluiframes.c
-void gtaRenewText(HANDLE hContact);
+void gtaRenewText(HCONTACT hContact);
int ExtraImage_ExtraIDToColumnNum(int extra);
int LoadSkinButtonModule();
@@ -281,15 +281,15 @@ int cli_AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText);
int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly);
int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk);
int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex);
-int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact);
-int cli_GetContactIcon(HANDLE hContact);
-int cli_RemoveEvent(HANDLE hContact, HANDLE hDbEvent);
-void cli_AddContactToTree(HWND hwnd,ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline);
-void cli_DeleteItemFromTree(HWND hwnd, HANDLE hItem);
+int cli_IconFromStatusMode(const char *szProto,int nStatus, HCONTACT hContact);
+int cli_GetContactIcon(HCONTACT hContact);
+int cli_RemoveEvent(HCONTACT hContact, HANDLE hDbEvent);
+void cli_AddContactToTree(HWND hwnd,ClcData *dat,HCONTACT hContact,int updateTotalCount,int checkHideOffline);
+void cli_DeleteItemFromTree(HWND hwnd, HCONTACT hItem);
void cli_FreeContact( ClcContact* );
void cli_FreeGroup( ClcGroup* );
char* cli_GetGroupCountsText(ClcData *dat, ClcContact *contact);
-void cli_ChangeContactIcon(HANDLE hContact,int iIcon,int add);
+void cli_ChangeContactIcon(HCONTACT hContact,int iIcon,int add);
LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wParam,LPARAM lParam);
struct CListEvent* cliCreateEvent( void );
struct CListEvent* cli_AddEvent(CLISTEVENT *cle);
@@ -297,12 +297,12 @@ LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wPara
int cliShowHide(WPARAM wParam,LPARAM lParam);
BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase );
int cliCompareContacts(const ClcContact *contact1,const ClcContact *contact2);
-int cliFindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible);
+int cliFindItem(HWND hwnd, ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount);
int cliTrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam);
void cliCluiProtocolStatusChanged(int status,const char * proto);
HMENU cliBuildGroupPopupMenu(ClcGroup *group);
-void cliInvalidateDisplayNameCacheEntry(HANDLE hContact);
+void cliInvalidateDisplayNameCacheEntry(HCONTACT hContact);
void cliCheckCacheItem(ClcCacheEntry *pdnce);
void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat);
void CLUI_cli_LoadCluiGlobalOpts(void);
@@ -310,8 +310,8 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam,LPARAM lParam);
BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase );
ClcContact* cliCreateClcContact( void );
-ClcCacheEntry* cliCreateCacheItem(HANDLE hContact);
-ClcCacheEntry* cliGetCacheEntry(HANDLE hContact);
+ClcCacheEntry* cliCreateCacheItem(HCONTACT hContact);
+ClcCacheEntry* cliGetCacheEntry(HCONTACT hContact);
#define WM_DWMCOMPOSITIONCHANGED 0x031E
@@ -332,7 +332,7 @@ extern tPaintCallbackProc CLCPaint_PaintCallbackProc(HWND hWnd, HDC hDC, RECT *r
/* SkinEngine.c */
-BYTE SkinDBGetContactSettingByte(HANDLE hContact, const char* szSection, const char*szKey, BYTE bDefault);
+BYTE SkinDBGetContactSettingByte(HCONTACT hContact, const char* szSection, const char*szKey, BYTE bDefault);
extern OVERLAYICONINFO g_pAvatarOverlayIcons[ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1];
extern OVERLAYICONINFO g_pStatusOverlayIcons[ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1];
diff --git a/plugins/Clist_modern/src/hdr/modern_gettextasync.h b/plugins/Clist_modern/src/hdr/modern_gettextasync.h
index b0e08b64a2..4e8c7c6ed5 100644
--- a/plugins/Clist_modern/src/hdr/modern_gettextasync.h
+++ b/plugins/Clist_modern/src/hdr/modern_gettextasync.h
@@ -1,5 +1,5 @@
#pragma once
void InitCacheAsync();
void UninitCacheAsync();
-void gtaRenewText(HANDLE hContact);
-int gtaAddRequest(ClcData *dat,ClcContact *contact,HANDLE hContact);
+void gtaRenewText(HCONTACT hContact);
+int gtaAddRequest(ClcData *dat,ClcContact *contact,HCONTACT hContact);
diff --git a/plugins/Clist_modern/src/hdr/modern_global_structure.h b/plugins/Clist_modern/src/hdr/modern_global_structure.h
index 5ba424dde0..7be8dd2ff8 100644
--- a/plugins/Clist_modern/src/hdr/modern_global_structure.h
+++ b/plugins/Clist_modern/src/hdr/modern_global_structure.h
@@ -18,7 +18,7 @@ typedef struct tagCLUIDATA
DWORD dwFlags;
TCHAR *szNoEvents;
int hIconNotify;
- HANDLE hUpdateContact;
+ HCONTACT hUpdateContact;
/* Contact List View Mode */
TCHAR groupFilter[2048];
diff --git a/plugins/Clist_modern/src/hdr/modern_skinned_profile.h b/plugins/Clist_modern/src/hdr/modern_skinned_profile.h
index 78fdb1578d..0eebf53cba 100644
--- a/plugins/Clist_modern/src/hdr/modern_skinned_profile.h
+++ b/plugins/Clist_modern/src/hdr/modern_skinned_profile.h
@@ -233,10 +233,10 @@ public:
HRESULT Init();
HRESULT Clear();
- static BYTE SpiGetSkinByte ( HANDLE hContact, const char * szSection, const char * szKey, const BYTE defValue );
- static WORD SpiGetSkinWord ( HANDLE hContact, const char * szSection, const char * szKey, const WORD defValue );
- static DWORD SpiGetSkinDword( HANDLE hContact, const char * szSection, const char * szKey, const DWORD defValue );
- static BOOL SpiCheckSkinned( HANDLE hContact, const char * szSection, const char * szKey );
+ static BYTE SpiGetSkinByte (HCONTACT hContact, const char * szSection, const char * szKey, const BYTE defValue );
+ static WORD SpiGetSkinWord (HCONTACT hContact, const char * szSection, const char * szKey, const WORD defValue );
+ static DWORD SpiGetSkinDword(HCONTACT hContact, const char * szSection, const char * szKey, const DWORD defValue );
+ static BOOL SpiCheckSkinned(HCONTACT hContact, const char * szSection, const char * szKey );
};
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index 08415dda17..1a27ac5079 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -60,7 +60,7 @@ enum {
struct ANIAVA_OBJECT
{
- HANDLE hContact;
+ HCONTACT hContact;
HWND hWindow;
BOOL bInvalidPos;
BOOL bToBeDeleted;
@@ -284,7 +284,7 @@ int AniAva_UpdateOptions()
}
// adds avatars to be displayed
-int AniAva_AddAvatar(HANDLE hContact, TCHAR * szFilename, int width, int heigth)
+int AniAva_AddAvatar(HCONTACT hContact, TCHAR * szFilename, int width, int heigth)
{
aacheck 0;
if (!GDIPlus_IsAnimatedGif (szFilename))
@@ -344,7 +344,7 @@ void AniAva_UpdateParent()
}
}
-ANIAVA_OBJECT * FindAvatarByContact( HANDLE hContact )
+ANIAVA_OBJECT * FindAvatarByContact(HCONTACT hContact )
{
for ( int i=0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT *pai = ((ANIAVA_OBJECT *)s_Objects[i]);
@@ -354,7 +354,7 @@ ANIAVA_OBJECT * FindAvatarByContact( HANDLE hContact )
return NULL;
}
-int AniAva_RenderAvatar( HANDLE hContact, HDC hdcMem, RECT *rc )
+int AniAva_RenderAvatar(HCONTACT hContact, HDC hdcMem, RECT *rc )
{
aacheck 0;
mir_cslock lck(s_CS);
@@ -365,7 +365,7 @@ int AniAva_RenderAvatar( HANDLE hContact, HDC hdcMem, RECT *rc )
}
// update avatars pos
-int AniAva_SetAvatarPos(HANDLE hContact, RECT *rc, int overlayIdx, BYTE bAlpha)
+int AniAva_SetAvatarPos(HCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha)
{
aacheck 0;
mir_cslock lck(s_CS);
@@ -404,7 +404,7 @@ int AniAva_SetAvatarPos(HANDLE hContact, RECT *rc, int overlayIdx, BYTE bAlpha)
return 1;
}
// remove avatar
-int AniAva_RemoveAvatar(HANDLE hContact)
+int AniAva_RemoveAvatar(HCONTACT hContact)
{
aacheck 0;
mir_cslock lck(s_CS);
@@ -419,7 +419,7 @@ int AniAva_RemoveAvatar(HANDLE hContact)
return 1;
}
// reset positions of avatars to be drawn (still be painted at same place)
-int AniAva_InvalidateAvatarPositions(HANDLE hContact)
+int AniAva_InvalidateAvatarPositions(HCONTACT hContact)
{
aacheck 0;
mir_cslock lck(s_CS);
diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp
index 7953807781..b9b66caab0 100644
--- a/plugins/Clist_modern/src/modern_awaymsg.cpp
+++ b/plugins/Clist_modern/src/modern_awaymsg.cpp
@@ -42,13 +42,10 @@ static LIST<void> amItems(10, PtrKeySortT);
static HANDLE hamProcessEvent = NULL;
static DWORD amRequestTick = 0;
-static int amAddHandleToChain(HANDLE hContact);
-static HANDLE amGetCurrentChain();
-
/*
* Add contact handle to requests queue
*/
-static int amAddHandleToChain(HANDLE hContact)
+static int amAddHandleToChain(HCONTACT hContact)
{
mir_cslockfull lck(amCS);
if (amItems.find(hContact) != NULL)
@@ -63,13 +60,13 @@ static int amAddHandleToChain(HANDLE hContact)
/*
* Gets handle from queue for request
*/
-static HANDLE amGetCurrentChain()
+static HCONTACT amGetCurrentChain()
{
mir_cslock lck(amCS);
if (amItems.getCount() == 0)
return NULL;
- HANDLE res = amItems[0];
+ HCONTACT res = (HCONTACT)amItems[0];
amItems.remove(0);
return res;
}
@@ -85,7 +82,7 @@ static void amThreadProc(void *)
memset(&dnce, 0, sizeof(dnce));
while (!MirandaExiting()) {
- HANDLE hContact = amGetCurrentChain();
+ HCONTACT hContact = amGetCurrentChain();
while (hContact) {
DWORD time = GetTickCount();
if ((time-amRequestTick) < AMASKPERIOD) {
@@ -94,7 +91,7 @@ static void amThreadProc(void *)
return;
}
CListSettings_FreeCacheItemData(&dnce);
- dnce.hContact = (HANDLE)hContact;
+ dnce.hContact = hContact;
Sync(CLUI_SyncGetPDNCE, (WPARAM) 0, (LPARAM)&dnce);
HANDLE ACK = 0;
@@ -146,7 +143,7 @@ BOOL amWakeThread()
/*
* Sub to be called outside on status changing to retrieve away message
*/
-void amRequestAwayMsg(HANDLE hContact)
+void amRequestAwayMsg(HCONTACT hContact)
{
if (!g_CluiData.bInternalAwayMsgDiscovery || !hContact)
return;
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp
index f41b7c1db9..0066366f4c 100644
--- a/plugins/Clist_modern/src/modern_cachefuncs.cpp
+++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp
@@ -54,7 +54,7 @@ void CListSettings_FreeCacheItemDataOption( ClcCacheEntry *pDst, DWORD flag );
/*
* Get time zone for contact
*/
-void Cache_GetTimezone(ClcData *dat, HANDLE hContact)
+void Cache_GetTimezone(ClcData *dat, HCONTACT hContact)
{
ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hContact);
if (dat == NULL && pcli->hwndContactTree)
@@ -205,7 +205,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce,
sp.Protocolname = pdnce->m_cache_cszProto;
if ( db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) != 1 && pdnce->m_cache_cszProto != NULL && g_szMetaModuleName && strcmp(pdnce->m_cache_cszProto, g_szMetaModuleName) == 0) {
- HANDLE hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (LPARAM)pdnce->hContact, 0);
+ HCONTACT hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (LPARAM)pdnce->hContact, 0);
if (hContact != 0)
sp.Protocolname = GetContactProto(hContact);
}
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 7a364dd2bb..8aaad5eddf 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -258,7 +258,7 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam)
else if (!strcmp(cws->szSetting,"ListeningTo"))
pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0);
else if (!strcmp(cws->szSetting,"Transport") || !strcmp(cws->szSetting,"IsTransported")) {
- pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
+ pcli->pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam);
pcli->pfnClcBroadcast( CLM_AUTOREBUILD,wParam,0);
}
}
@@ -273,8 +273,8 @@ static int clcHookDbEventAdded(WPARAM wParam,LPARAM lParam)
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get((HANDLE)lParam, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
- ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry((HANDLE)wParam);
- db_set_dw((HANDLE)wParam, "CList", "mf_lastmsg", dbei.timestamp);
+ ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry((HCONTACT)wParam);
+ db_set_dw((HCONTACT)wParam, "CList", "mf_lastmsg", dbei.timestamp);
if (pdnce)
pdnce->dwLastMsgTime = dbei.timestamp;
}
@@ -1472,17 +1472,17 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM w
BYTE flags = 0;
ClcContact *contact;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
flags = contact->flags;
}
- pcli->pfnDeleteItemFromTree(hwnd, (HANDLE) wParam);
- if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((HANDLE) wParam, "CList", "Hidden", 0)) {
+ pcli->pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam);
+ if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((HCONTACT)wParam, "CList", "Hidden", 0)) {
NMCLISTCONTROL nm;
- pcli->pfnAddContactToTree(hwnd, dat, (HANDLE) wParam, 1, 1);
- if (pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL)) {
+ pcli->pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1);
+ if (pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
@@ -1507,41 +1507,41 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP
BOOL needRepaint = FALSE;
WORD status;
RECT iconRect = {0};
- int contacticon = corecli.pfnGetContactIcon((HANDLE)wParam);
- HANDLE hSelItem = NULL;
+ int contacticon = corecli.pfnGetContactIcon((HCONTACT)wParam);
+ HCONTACT hSelItem = NULL;
ClcContact *selcontact = NULL;
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (szProto == NULL)
status = ID_STATUS_OFFLINE;
else
- status = GetContactCachedStatus((HANDLE) wParam);
+ status = GetContactCachedStatus((HCONTACT)wParam);
BOOL image_is_special = (LOWORD(contacticon) != (LOWORD(lParam))); //check only base icons
- int nHiddenStatus = CLVM_GetContactHiddenStatus((HANDLE)wParam, szProto, dat);
+ int nHiddenStatus = CLVM_GetContactHiddenStatus((HCONTACT)wParam, szProto, dat);
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- bool isVisiblebyFilter = (( ( style & CLS_SHOWHIDDEN ) && nHiddenStatus != -1 ) || !nHiddenStatus );
- bool ifVisibleByClui = !pcli->pfnIsHiddenMode( dat, status );
- bool isVisible = g_CluiData.bFilterEffective&CLVM_FILTER_STATUS ? TRUE : ifVisibleByClui;
- bool isIconChanged = cli_GetContactIcon((HANDLE)wParam) != LOWORD(lParam);
+ bool isVisiblebyFilter = (( ( style & CLS_SHOWHIDDEN ) && nHiddenStatus != -1 ) || !nHiddenStatus );
+ bool ifVisibleByClui = !pcli->pfnIsHiddenMode( dat, status );
+ bool isVisible = g_CluiData.bFilterEffective&CLVM_FILTER_STATUS ? TRUE : ifVisibleByClui;
+ bool isIconChanged = cli_GetContactIcon((HCONTACT)wParam) != LOWORD(lParam);
- shouldShow = isVisiblebyFilter && ( isVisible || isIconChanged ) ;
+ shouldShow = isVisiblebyFilter && ( isVisible || isIconChanged ) ;
// XXX CLVM changed - this means an offline msg is flashing, so the contact should be shown
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL)) {
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)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 = pcli->pfnContactToHItem(selcontact);
- pcli->pfnAddContactToTree(hwnd, dat, (HANDLE) wParam, (style & CLS_CONTACTLIST) == 0, 0);
+ hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
+ pcli->pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, (style & CLS_CONTACTLIST) == 0, 0);
recalcScrollBar = 1;
needRepaint = TRUE;
- pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL);
+ pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL);
if (contact) {
contact->iImage = lParam;
contact->image_is_special = image_is_special;
- pcli->pfnNotifyNewContact(hwnd, (HANDLE) wParam);
+ pcli->pfnNotifyNewContact(hwnd, (HCONTACT)wParam);
dat->needsResort = 1;
}
}
@@ -1555,7 +1555,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP
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 = pcli->pfnContactToHItem(selcontact);
+ hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
pcli->pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
needRepaint = TRUE;
recalcScrollBar = 1;
@@ -1603,7 +1603,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP
static LRESULT clcOnIntmAvatarChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact;
- if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL, FALSE))
Cache_GetAvatar(dat, contact);
else if (dat->use_avatar_service && !wParam)
UpdateAllAvatars(dat);
@@ -1615,7 +1615,7 @@ static LRESULT clcOnIntmAvatarChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM
static LRESULT clcOnIntmTimeZoneChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact;
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL, FALSE))
return corecli.pfnContactListControlWndProc(hwnd,msg,wParam,lParam);
if (contact) {
@@ -1630,13 +1630,13 @@ static LRESULT clcOnIntmNameChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP
{
int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
+ pcli->pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam);
ClcContact *contact;
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL, FALSE))
return ret;
- lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam,0),SIZEOF(contact->szText));
+ lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HCONTACT)wParam, 0), SIZEOF(contact->szText));
if (contact) {
Cache_GetText(dat,contact,1);
cliRecalcScrollBar(hwnd,dat);
@@ -1655,7 +1655,7 @@ static LRESULT clcOnIntmApparentModeChanged(ClcData *dat, HWND hwnd, UINT msg, W
static LRESULT clcOnIntmStatusMsgChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL || IsHContactInfo(hContact) || IsHContactGroup(hContact))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (!FindItem(hwnd,dat,hContact,&contact,NULL,NULL,FALSE))
@@ -1674,7 +1674,7 @@ static LRESULT clcOnIntmNotOnListChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR
DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
ClcContact *contact;
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL, TRUE))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (contact->type != CLCIT_CONTACT)
@@ -1691,10 +1691,11 @@ static LRESULT clcOnIntmNotOnListChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR
static LRESULT clcOnIntmScrollBarChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_CONTACTLIST)
- {
- if (dat->noVScrollbar) ShowScrollBar(hwnd, SB_VERT, FALSE);
- else pcli->pfnRecalcScrollBar(hwnd, dat);
+ if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_CONTACTLIST) {
+ if (dat->noVScrollbar)
+ ShowScrollBar(hwnd, SB_VERT, FALSE);
+ else
+ pcli->pfnRecalcScrollBar(hwnd, dat);
}
return 0;
}
@@ -1703,20 +1704,20 @@ static LRESULT clcOnIntmStatusChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM
{
int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (wParam != 0) {
- ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry((HANDLE)wParam);
+ ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry((HCONTACT)wParam);
if (pdnce && pdnce->m_cache_cszProto) {
pdnce___SetStatus( pdnce, GetStatusForContact(pdnce->hContact,pdnce->m_cache_cszProto));
if (!dat->force_in_dialog && (dat->second_line_show || dat->third_line_show))
gtaRenewText(pdnce->hContact);
- SendMessage(hwnd,INTM_ICONCHANGED, wParam, corecli.pfnGetContactIcon((HANDLE)wParam));
+ SendMessage(hwnd, INTM_ICONCHANGED, wParam, corecli.pfnGetContactIcon((HCONTACT)wParam));
ClcContact *contact;
- if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE)) {
+ if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL, TRUE)) {
if (contact && contact->type == CLCIT_CONTACT) {
if (!contact->image_is_special && pdnce___GetStatus( pdnce ) > ID_STATUS_OFFLINE)
- contact->iImage = corecli.pfnGetContactIcon((HANDLE)wParam);
+ contact->iImage = corecli.pfnGetContactIcon((HCONTACT)wParam);
if (contact->isSubcontact && contact->subcontacts && contact->subcontacts->type == CLCIT_CONTACT)
- pcli->pfnClcBroadcast( INTM_STATUSCHANGED,(WPARAM)contact->subcontacts->hContact,0); //forward status changing to host meta contact
+ pcli->pfnClcBroadcast(INTM_STATUSCHANGED, (WPARAM)contact->subcontacts->hContact, 0); //forward status changing to host meta contact
}
}
}
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp
index 165a0ab00b..2bd079760f 100644
--- a/plugins/Clist_modern/src/modern_clcidents.cpp
+++ b/plugins/Clist_modern/src/modern_clcidents.cpp
@@ -104,12 +104,12 @@ int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex)
return -1;
}
-int cliFindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible)
+int cliFindItem(HWND hwnd, ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible)
{
- return FindItem(hwnd,dat, hItem,contact,subgroup,isVisible,FALSE);
+ return FindItem(hwnd, dat, (HCONTACT)hItem, contact, subgroup, isVisible, FALSE);
}
-int FindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible, BOOL isIgnoreSubcontacts)
+int FindItem(HWND hwnd, ClcData *dat, HCONTACT hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts)
{
int index = 0, i;
int nowVisible = 1;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index bb65dcd753..b01e397d01 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -46,7 +46,7 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
cont->SubAllocated = subcount;
int i=0;
for (int j = 0; j < subcount; j++) {
- HANDLE hsub = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)cont->hContact,j);
+ HCONTACT hsub = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)cont->hContact, j);
cacheEntry = pcli->pfnGetCacheEntry(hsub);
WORD wStatus = pdnce___GetStatus(cacheEntry);
if (showOfflineHereGroup || (!( db_get_b(NULL,"CLC","MetaHideOfflineSub",SETTING_METAHIDEOFFLINESUB_DEFAULT) && db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT))
@@ -145,7 +145,7 @@ int cli_AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText)
return i;
}
-static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat, HANDLE hContact)
+static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat, HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = NULL;
WORD apparentMode;
@@ -211,7 +211,7 @@ static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat,
static ClcContact *AddContactToGroup(ClcData *dat,ClcGroup *group, ClcCacheEntry *cacheEntry)
{
- HANDLE hContact;
+ HCONTACT hContact;
int i;
if (cacheEntry == NULL) return NULL;
if (group == NULL) return NULL;
@@ -259,7 +259,7 @@ void * AddTempGroup(HWND hwnd,ClcData *dat,const TCHAR *szName,DWORD flags,int g
return NULL;
}
-void cli_AddContactToTree(HWND hwnd,ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline)
+void cli_AddContactToTree(HWND hwnd,ClcData *dat,HCONTACT hContact,int updateTotalCount,int checkHideOffline)
{
ClcCacheEntry *cacheEntry = pcli->pfnGetCacheEntry(hContact);
if (dat->IsMetaContactsEnabled && cacheEntry && cacheEntry->m_cache_nHiddenSubcontact)
@@ -277,7 +277,7 @@ void cli_AddContactToTree(HWND hwnd,ClcData *dat,HANDLE hContact,int updateTotal
return;
}
-void cli_DeleteItemFromTree(HWND hwnd,HANDLE hItem)
+void cli_DeleteItemFromTree(HWND hwnd, HCONTACT hItem)
{
ClcData *dat = (ClcData *) GetWindowLongPtr(hwnd, 0);
ClearRowByIndexCache();
@@ -300,17 +300,16 @@ __inline BOOL CLCItems_IsShowOfflineGroup(ClcGroup* group)
return (groupFlags&GROUPF_SHOWOFFLINE) != 0;
}
-HANDLE SaveSelection( ClcData *dat )
+HCONTACT SaveSelection(ClcData *dat)
{
ClcContact *selcontact = NULL;
-
- if ( pcli->pfnGetRowByIndex( dat, dat->selection, &selcontact, NULL ) == -1 )
+ if (pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) == -1)
return NULL;
- else
- return pcli->pfnContactToHItem( selcontact );
+
+ return (HCONTACT)pcli->pfnContactToHItem(selcontact);
}
-int RestoreSelection( ClcData *dat, HANDLE hSelected )
+int RestoreSelection(ClcData *dat, HCONTACT hSelected)
{
ClcContact *selcontact = NULL;
ClcGroup *selgroup = NULL;
@@ -336,7 +335,7 @@ int RestoreSelection( ClcData *dat, HANDLE hSelected )
}
-void cliRebuildEntireList(HWND hwnd,ClcData *dat)
+void cliRebuildEntireList(HWND hwnd, ClcData *dat)
{
DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
ClcContact *cont;
@@ -358,7 +357,7 @@ void cliRebuildEntireList(HWND hwnd,ClcData *dat)
dat->list.cl.increment = 50;
dat->needsResort = 1;
- HANDLE hSelected = SaveSelection( dat );
+ HCONTACT hSelected = SaveSelection(dat);
dat->selection = -1;
dat->HiLightMode = db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT);
{
@@ -371,7 +370,7 @@ void cliRebuildEntireList(HWND hwnd,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 = NULL;
cont = NULL;
cacheEntry = pcli->pfnGetCacheEntry(hContact);
@@ -430,14 +429,14 @@ void cliRebuildEntireList(HWND hwnd,ClcData *dat)
}
}
- pcli->pfnSortCLC(hwnd,dat,0);
+ pcli->pfnSortCLC(hwnd, dat, 0);
- RestoreSelection( dat, hSelected );
+ RestoreSelection(dat, hSelected);
}
-void cli_SortCLC( HWND hwnd, ClcData *dat, int useInsertionSort )
+void cli_SortCLC(HWND hwnd, ClcData *dat, int useInsertionSort)
{
- HANDLE hSelected = SaveSelection( dat );
+ HCONTACT hSelected = SaveSelection(dat);
corecli.pfnSortCLC(hwnd,dat,useInsertionSort);
@@ -475,7 +474,7 @@ int GetNewSelection(ClcGroup *group, int selection, int direction)
}
struct SavedContactState_t {
- HANDLE hContact;
+ HCONTACT hContact;
WORD iExtraImage[EXTRA_ICON_COUNT];
int checked;
};
@@ -584,7 +583,7 @@ void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat)
if (savedInfo[i].parentId == -1)
group = &dat->list;
else {
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) (savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)(savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL))
continue;
group = contact->group;
}
@@ -624,7 +623,7 @@ ClcContact* cliCreateClcContact()
return contact;
}
-ClcCacheEntry* cliCreateCacheItem( HANDLE hContact )
+ClcCacheEntry* cliCreateCacheItem(HCONTACT hContact )
{
ClcCacheEntry *p = (ClcCacheEntry *)mir_calloc(sizeof( ClcCacheEntry ));
if (p == NULL)
@@ -639,10 +638,10 @@ ClcCacheEntry* cliCreateCacheItem( HANDLE hContact )
return p;
}
-void cliInvalidateDisplayNameCacheEntry(HANDLE hContact)
+void cliInvalidateDisplayNameCacheEntry(HCONTACT hContact)
{
if (hContact == INVALID_HANDLE_VALUE)
- corecli.pfnInvalidateDisplayNameCacheEntry(INVALID_HANDLE_VALUE);
+ corecli.pfnInvalidateDisplayNameCacheEntry((HCONTACT)INVALID_HANDLE_VALUE);
else {
ClcCacheEntry *p = pcli->pfnGetCacheEntry(hContact);
if (p)
@@ -690,7 +689,7 @@ int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly)
* also cares about sub contacts (if meta is active)
*/
-int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, ClcData *dat)
+int __fastcall CLVM_GetContactHiddenStatus(HCONTACT hContact, char *szProto, ClcData *dat)
{
int dbHidden = db_get_b(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
int filterResult = 1;
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp
index 26e2e403ba..047b671172 100644
--- a/plugins/Clist_modern/src/modern_clcmsgs.cpp
+++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp
@@ -35,7 +35,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
switch(msg) {
case CLM_DELETEITEM:
- pcli->pfnDeleteItemFromTree(hwnd, (HANDLE) wParam);
+ pcli->pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam);
clcSetDelayTimer( TIMERID_DELAYEDRESORTCLC, hwnd, 1 ); //pcli->pfnSortCLC(hwnd, dat, 1);
clcSetDelayTimer( TIMERID_RECALCSCROLLBAR, hwnd, 2 ); //pcli->pfnRecalcScrollBar(hwnd, dat);
return 0;
@@ -108,24 +108,24 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
{
int i;
if (wParam != CLGN_ROOT) {
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL))
- return (LRESULT) (HANDLE) NULL;
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)lParam, &contact, &group, NULL))
+ return NULL;
i = List_IndexOf((SortedList*)&group->cl,contact);
if (i < 0) return 0;
}
switch (wParam) {
case CLGN_ROOT:
if (dat->list.cl.count)
- return (LRESULT) pcli->pfnContactToHItem(dat->list.cl.items[0]);
+ return (LRESULT)pcli->pfnContactToHItem(dat->list.cl.items[0]);
else
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
case CLGN_CHILD:
if (contact->type != CLCIT_GROUP)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
group = contact->group;
if (group->cl.count == 0)
- return (LRESULT) (HANDLE) NULL;
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[0]);
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[0]);
case CLGN_PARENT:
return group->groupId | HCONTACT_ISGROUP;
case CLGN_NEXT:
@@ -133,49 +133,49 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
if (++i >= group->cl.count)
return NULL;
}
- while (group->cl.items[i]->type == CLCIT_DIVIDER);
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
+ while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUS:
do {
if (--i < 0)
return NULL;
}
- while (group->cl.items[i]->type == CLCIT_DIVIDER);
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
+ while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_NEXTCONTACT:
for (i++; i < group->cl.count; i++)
if (group->cl.items[i]->type == CLCIT_CONTACT)
break;
if (i >= group->cl.count)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUSCONTACT:
if (i >= group->cl.count)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
for (i--; i >= 0; i--)
if (group->cl.items[i]->type == CLCIT_CONTACT)
break;
if (i < 0)
- return (LRESULT) (HANDLE) NULL;
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_NEXTGROUP:
for (i++; i < group->cl.count; i++)
if (group->cl.items[i]->type == CLCIT_GROUP)
break;
if (i >= group->cl.count)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUSGROUP:
if (i >= group->cl.count)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
for (i--; i >= 0; i--)
if (group->cl.items[i]->type == CLCIT_GROUP)
break;
if (i < 0)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
}
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
}
return 0;
case CLM_SELECTITEM:
@@ -183,7 +183,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
ClcGroup *tgroup;
int index = -1;
int mainindex = -1;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1);
@@ -217,7 +217,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
if (LOWORD(lParam) >= dat->extraColumnsCount)
return 0;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
return 0;
contact->iExtraImage[LOWORD(lParam)] = HIWORD(lParam);
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp
index 327d6e4d3f..bf19a6c5c2 100644
--- a/plugins/Clist_modern/src/modern_clistevents.cpp
+++ b/plugins/Clist_modern/src/modern_clistevents.cpp
@@ -75,7 +75,7 @@ static int iconsOn;
struct NotifyMenuItemExData {
- HANDLE hContact;
+ HCONTACT hContact;
int iIcon; // icon index in the image list
HICON hIcon; // corresponding icon handle
HANDLE hDbEvent;
@@ -176,7 +176,7 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle)
}
-int cli_RemoveEvent(HANDLE hContact, HANDLE hDbEvent)
+int cli_RemoveEvent(HCONTACT hContact, HANDLE hDbEvent)
{
int i;
int res = 0;
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index b4c41cd20c..78d7b35238 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -94,7 +94,7 @@ static IconItem iconList[] =
static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
{
- BYTE bContactRate = db_get_b((HANDLE)wParam, "CList", "Rate",0);
+ BYTE bContactRate = db_get_b((HCONTACT)wParam, "CList", "Rate", 0);
if ( bContactRate > SIZEOF(rates)-1)
bContactRate = SIZEOF(rates)-1;
@@ -149,7 +149,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
mi.hIcon = NULL;
mi.ptszName = LPGENT("Show even if offline");
- mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR | ( db_get_b((HANDLE)wParam,"CList","noOffline",0)?CMIF_CHECKED:0);
+ mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR | (db_get_b((HCONTACT)wParam, "CList", "noOffline", 0) ? CMIF_CHECKED : 0);
mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE;
mi.popupPosition = i+100000000;
mi.position = -100000000;
@@ -165,7 +165,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
{
if (hContact)
- db_set_b((HANDLE)hContact, "CList", "Rate",(BYTE)nRate);
+ db_set_b((HCONTACT)hContact, "CList", "Rate", (BYTE)nRate);
return 0;
}
@@ -173,7 +173,7 @@ INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
INT_PTR FAV_ToggleShowOffline(WPARAM hContact,LPARAM lParam)
{
if (hContact)
- db_set_b((HANDLE)hContact,"CList","noOffline", !db_get_b((HANDLE)hContact, "CList", "noOffline", 0));
+ db_set_b((HCONTACT)hContact, "CList", "noOffline", !db_get_b((HCONTACT)hContact, "CList", "noOffline", 0));
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 610e801097..c8b4523352 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -42,7 +42,7 @@ int GetContactDisplayName(WPARAM wParam,LPARAM lParam);
int CListOptInit(WPARAM wParam,LPARAM lParam);
int SkinOptInit(WPARAM wParam,LPARAM lParam);
int ModernSkinOptInit(WPARAM wParam,LPARAM lParam);
-int EventsProcessContactDoubleClick(HANDLE hContact);
+int EventsProcessContactDoubleClick(HCONTACT hContact);
INT_PTR TrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam);
@@ -52,7 +52,7 @@ void UninitTrayMenu();
HIMAGELIST hCListImages = NULL;
//returns normal icon or combined with status overlay. Needs to be destroyed.
-HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
+HICON cliGetIconFromStatusMode(HCONTACT hContact, const char *szProto,int status)
{
// check if options is turned on
BYTE trayOption = db_get_b(NULL,"CLUI","XStatusTray",SETTING_TRAYOPTION_DEFAULT);
@@ -81,7 +81,7 @@ HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
return ske_ImageList_GetIcon(g_himlCListClc,pcli->pfnIconFromStatusMode(szProto,status,hContact),ILD_NORMAL);
}
-int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact)
+int cli_IconFromStatusMode(const char *szProto,int nStatus, HCONTACT hContact)
{
if (hContact && szProto) {
char *szActProto = (char*)szProto;
@@ -89,7 +89,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact)
HANDLE hActContact = hContact;
if (!db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) && g_szMetaModuleName && !mir_strcmp(szActProto,g_szMetaModuleName)) {
// 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) {
ClcCacheEntry *cacheEntry = pcli->pfnGetCacheEntry(hMostOnlineContact);
if (cacheEntry && cacheEntry->m_cache_cszProto) {
@@ -118,7 +118,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact)
return corecli.pfnIconFromStatusMode(szProto,nStatus,NULL);
}
-int cli_GetContactIcon(HANDLE hContact)
+int cli_GetContactIcon(HCONTACT hContact)
{
int res = corecli.pfnGetContactIcon(hContact);
if (res != -1)
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index a45d83705a..83c4edb7bd 100644
--- a/plugins/Clist_modern/src/modern_clistsettings.cpp
+++ b/plugins/Clist_modern/src/modern_clistsettings.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "hdr/modern_commonprototypes.h"
#include "hdr/modern_awaymsg.h"
-void InsertContactIntoTree(HANDLE hContact,int status);
+void InsertContactIntoTree(HCONTACT hContact,int status);
static ClcCacheEntry *displayNameCache;
void CListSettings_FreeCacheItemDataOption( ClcCacheEntry *pDst, DWORD flag );
@@ -36,11 +36,11 @@ static int displayNameCacheSize;
BOOL CLM_AUTOREBUILD_WAS_POSTED = FALSE;
SortedList *clistCache = NULL;
-char *GetProtoForContact(HANDLE hContact);
-int GetStatusForContact(HANDLE hContact,char *szProto);
+char *GetProtoForContact(HCONTACT hContact);
+int GetStatusForContact(HCONTACT hContact,char *szProto);
TCHAR *UnknownConctactTranslatedName = NULL;
-void InvalidateDNCEbyPointer(HANDLE hContact,ClcCacheEntry *pdnce,int SettingType);
+void InvalidateDNCEbyPointer(HCONTACT hContact,ClcCacheEntry *pdnce,int SettingType);
static int handleCompare( void* c1, void* c2 )
{
@@ -86,7 +86,7 @@ void FreeDisplayNameCache()
}
}
-ClcCacheEntry* cliGetCacheEntry(HANDLE hContact)
+ClcCacheEntry* cliGetCacheEntry(HCONTACT hContact)
{
if (!clistCache) return NULL;
@@ -205,7 +205,7 @@ int CListSettings_SetToCache(ClcCacheEntry *pSrc, DWORD flag)
void cliFreeCacheItem( ClcCacheEntry *p )
{
- HANDLE hContact = p->hContact;
+ HCONTACT hContact = p->hContact;
TRACEVAR("cliFreeCacheItem hContact = %d",hContact);
p->freeName();
mir_free_and_nil(p->tszGroup);
@@ -299,7 +299,7 @@ void IvalidateDisplayNameCache(DWORD mode)
}
}
-void InvalidateDNCEbyPointer(HANDLE hContact, ClcCacheEntry *pdnce, int SettingType)
+void InvalidateDNCEbyPointer(HCONTACT hContact, ClcCacheEntry *pdnce, int SettingType)
{
if (hContact == NULL || pdnce == NULL)
return;
@@ -344,7 +344,7 @@ void InvalidateDNCEbyPointer(HANDLE hContact, ClcCacheEntry *pdnce, int SettingT
pdnce->IsExpanded = -1;
}
-char *GetContactCachedProtocol(HANDLE hContact)
+char *GetContactCachedProtocol(HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = NULL;
cacheEntry = pcli->pfnGetCacheEntry(hContact);
@@ -354,14 +354,14 @@ char *GetContactCachedProtocol(HANDLE hContact)
return NULL;
}
-char* GetProtoForContact(HANDLE hContact)
+char* GetProtoForContact(HCONTACT hContact)
{
return (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT,(WPARAM)hContact,0);
}
-int GetStatusForContact(HANDLE hContact,char *szProto)
+int GetStatusForContact(HCONTACT hContact,char *szProto)
{
- return (szProto) ? (int)(db_get_w((HANDLE)hContact,szProto,"Status",ID_STATUS_OFFLINE)) : ID_STATUS_OFFLINE;
+ return (szProto) ? (int)(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)) : ID_STATUS_OFFLINE;
}
void ClcCacheEntry::freeName()
@@ -393,7 +393,7 @@ LBL_Unknown:
isUnknown = false;
}
-int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status)
+int GetContactInfosForSort(HCONTACT hContact,char **Proto,TCHAR **Name,int *Status)
{
ClcCacheEntry *cacheEntry = NULL;
cacheEntry = pcli->pfnGetCacheEntry(hContact);
@@ -407,7 +407,7 @@ int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status
};
-int GetContactCachedStatus(HANDLE hContact)
+int GetContactCachedStatus(HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = NULL;
cacheEntry = pcli->pfnGetCacheEntry(hContact);
@@ -417,7 +417,7 @@ int GetContactCachedStatus(HANDLE hContact)
int ContactAdded(WPARAM wParam,LPARAM lParam)
{
if (!MirandaExiting()) {
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
cli_ChangeContactIcon(hContact,pcli->pfnIconFromStatusMode((char*)GetContactCachedProtocol(hContact),ID_STATUS_OFFLINE,hContact),1); ///by FYR
pcli->pfnSortContacts();
}
@@ -426,7 +426,7 @@ int ContactAdded(WPARAM wParam,LPARAM lParam)
int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (MirandaExiting() || !pcli || !clistCache || hContact == NULL)
return 0;
@@ -494,7 +494,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
else if (!strcmp(cws->szSetting,"Hidden")) {
InvalidateDNCEbyPointer(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);
cli_ChangeContactIcon(hContact,pcli->pfnIconFromStatusMode(szProto,
szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE), hContact),1); //by FYR
}
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 586db4e522..2ed245edd2 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -188,7 +188,7 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam)
if ( lstrcmp( _T(CLISTCONTROL_CLASS), cls))
hwndClist = pcli->hwndContactList;
- HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
+ HCONTACT hItem = (HCONTACT)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
Menu_ShowItem(hRenameMenuItem, hItem != 0);
if (!hItem || !IsHContactContact(hItem) || !db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT)) {
@@ -240,7 +240,7 @@ INT_PTR CLUI::Service_ShowStatusMenu(WPARAM wParam,LPARAM lParam)
INT_PTR CLUI::Service_Menu_ShowContactAvatar(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
db_set_b(hContact, "CList", "HideContactAvatar", 0);
@@ -250,7 +250,7 @@ INT_PTR CLUI::Service_Menu_ShowContactAvatar(WPARAM wParam,LPARAM lParam)
INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
db_set_b(hContact, "CList", "HideContactAvatar", 1);
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp
index b1e297d58b..a4390b70d6 100644
--- a/plugins/Clist_modern/src/modern_contact.cpp
+++ b/plugins/Clist_modern/src/modern_contact.cpp
@@ -42,15 +42,15 @@ struct
{ID_STATUS_ONTHEPHONE,150},
{ID_STATUS_OUTTOLUNCH,425}};
-static int GetContactStatus(HANDLE hContact)
+static int GetContactStatus(HCONTACT hContact)
{
return (GetContactCachedStatus(hContact));
}
-void cli_ChangeContactIcon(HANDLE hContact,int iIcon,int add)
+void cli_ChangeContactIcon(HCONTACT hContact, int iIcon, int add)
{
- corecli.pfnChangeContactIcon((HANDLE) hContact,(int)iIcon,(int)add);
+ corecli.pfnChangeContactIcon(hContact, iIcon, add);
}
static int GetStatusModeOrdering(int statusMode)
@@ -62,7 +62,7 @@ static int GetStatusModeOrdering(int statusMode)
}
-DWORD CompareContacts2_getLMTime(HANDLE hContact)
+DWORD CompareContacts2_getLMTime(HCONTACT hContact)
{
HANDLE hDbEvent = db_event_last(hContact);
while(hDbEvent) {
@@ -95,16 +95,14 @@ int GetProtoIndex(char * szName)
int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int by)
{
- HANDLE a;
- HANDLE b;
TCHAR *namea, *nameb;
int statusa,statusb;
char *szProto1,*szProto2;
if ((INT_PTR)contact1 < 100 || (INT_PTR)contact2 < 100) return 0;
- a = contact1->hContact;
- b = contact2->hContact;
+ HCONTACT a = contact1->hContact;
+ HCONTACT b = contact2->hContact;
namea = (TCHAR *)contact1->szText;
statusa = GetContactCachedStatus(contact1->hContact);
@@ -118,39 +116,35 @@ int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int
int ordera,orderb;
ordera = GetStatusModeOrdering(statusa);
orderb = GetStatusModeOrdering(statusb);
- if (ordera != orderb) return ordera-orderb;
- else return 0;
+ return (ordera != orderb) ? ordera - orderb : 0;
}
-
- if (g_CluiData.fSortNoOfflineBottom == 0 && (statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE)) { //one is offline: offline goes below online
+ //one is offline: offline goes below online
+ if (g_CluiData.fSortNoOfflineBottom == 0 && (statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE))
return 2*(statusa == ID_STATUS_OFFLINE)-1;
- }
- if (by == SORTBY_NAME)
- { //name
+ if (by == SORTBY_NAME) //name
return mir_tstrcmpi(namea,nameb);
- }
- if (by == SORTBY_NAME_LOCALE)
- { //name
+
+ if (by == SORTBY_NAME_LOCALE) {
+ //name
static int LocaleId = -1;
if (LocaleId == -1) LocaleId = CallService(MS_LANGPACK_GETLOCALE, 0, 0);
return (CompareString(LocaleId,NORM_IGNORECASE,SAFETSTRING(namea),-1,SAFETSTRING(nameb),-1))-2;
}
- else if (by == SORTBY_LASTMSG)
- { //last message
+ if (by == SORTBY_LASTMSG) {
+ //last message
DWORD ta = CompareContacts2_getLMTime(a);
DWORD tb = CompareContacts2_getLMTime(b);
return tb-ta;
}
- else if (by == SORTBY_PROTO)
- {
+ if (by == SORTBY_PROTO) {
int rc = GetProtoIndex(szProto1)-GetProtoIndex(szProto2);
-
- if (rc != 0 && (szProto1 != NULL && szProto2 != NULL)) return rc;
+ if (rc != 0 && (szProto1 != NULL && szProto2 != NULL))
+ return rc;
}
- else if (by == SORTBY_RATE)
- return contact2->bContactRate-contact1->bContactRate;
+ else if (by == SORTBY_RATE)
+ return contact2->bContactRate - contact1->bContactRate;
// else :o)
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_gettextasync.cpp b/plugins/Clist_modern/src/modern_gettextasync.cpp
index 45dad063b6..6194bcb3c2 100644
--- a/plugins/Clist_modern/src/modern_gettextasync.cpp
+++ b/plugins/Clist_modern/src/modern_gettextasync.cpp
@@ -42,7 +42,7 @@ int CLUI_SyncGetShortData(WPARAM wParam, LPARAM lParam);
#define gtaunlock LeaveCriticalSection( &gtaCS )
typedef struct _GetTextAsyncItem {
- HANDLE hContact;
+ HCONTACT hContact;
ClcData *dat;
struct _GetTextAsyncItem *Next;
} GTACHAINITEM;
@@ -134,7 +134,7 @@ BOOL gtaWakeThread()
return FALSE;
}
-int gtaAddRequest(ClcData *dat,ClcContact *contact,HANDLE hContact)
+int gtaAddRequest(ClcData *dat,ClcContact *contact,HCONTACT hContact)
{
if (MirandaExiting()) return 0;
gtalock;
@@ -159,7 +159,7 @@ int gtaAddRequest(ClcData *dat,ClcContact *contact,HANDLE hContact)
return FALSE;
}
-void gtaRenewText(HANDLE hContact)
+void gtaRenewText(HCONTACT hContact)
{
gtaAddRequest(NULL,NULL, hContact);
}
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
index 66abdc832c..db2a5a4ae0 100644
--- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
+++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
@@ -165,7 +165,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
case TC_TEXT2:
{
int tmp = 0;
- HANDLE hContact = pdnce->hContact;
+ HCONTACT hContact = pdnce->hContact;
if (dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0] )
{
tmp = dat->fontModernInfo[FONTID_SECONDLINE].fontHeight;
@@ -192,7 +192,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
case TC_TEXT3:
{
- HANDLE hContact = pdnce->hContact;
+ HCONTACT hContact = pdnce->hContact;
int tmp = 0;
if (dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0]) {
tmp = dat->fontModernInfo[FONTID_THIRDLINE].fontHeight;
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index 9a73e5188a..74159b8b68 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -4081,7 +4081,7 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha)
#define SKINSETSECTION "SkinnedSettings"
-BOOL SkinDBGetContactSetting(HANDLE hContact, const char* szSection, const char*szKey, DBVARIANT * retdbv, BOOL * bSkinned )
+BOOL SkinDBGetContactSetting(HCONTACT hContact, const char* szSection, const char*szKey, DBVARIANT * retdbv, BOOL * bSkinned )
{
if (!hContact) { //only for not contact settings
char *szSkinKey;
@@ -4096,7 +4096,7 @@ BOOL SkinDBGetContactSetting(HANDLE hContact, const char* szSection, const char*
return db_get(hContact, szSection, szKey, retdbv);
}
-BYTE SkinDBGetContactSettingByte(HANDLE hContact, const char* szSection, const char*szKey, BYTE bDefault)
+BYTE SkinDBGetContactSettingByte(HCONTACT hContact, const char* szSection, const char*szKey, BYTE bDefault)
{
DBVARIANT dbv = { 0 };
BOOL bSkinned = FALSE;
@@ -4115,7 +4115,7 @@ BYTE SkinDBGetContactSettingByte(HANDLE hContact, const char* szSection, const c
return bDefault;
}
-WORD SkinDBGetContactSettingWord(HANDLE hContact, const char* szSection, const char*szKey, WORD wDefault)
+WORD SkinDBGetContactSettingWord(HCONTACT hContact, const char* szSection, const char*szKey, WORD wDefault)
{
BOOL bSkinned = FALSE;
DBVARIANT dbv = { 0 };
@@ -4132,7 +4132,7 @@ WORD SkinDBGetContactSettingWord(HANDLE hContact, const char* szSection, const c
return wDefault;
}
-DWORD SkinDBGetContactSettingDword(HANDLE hContact, const char* szSection, const char*szKey, DWORD dwDefault)
+DWORD SkinDBGetContactSettingDword(HCONTACT hContact, const char* szSection, const char*szKey, DWORD dwDefault)
{
DBVARIANT dbv = { 0 };
BOOL bSkinned = FALSE;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 7cc1989376..db1f1e8b62 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -164,7 +164,7 @@ static void ShowPage(HWND hwnd, int page)
}
}
-static int UpdateClistItem(HANDLE hContact, DWORD mask)
+static int UpdateClistItem(HCONTACT hContact, DWORD mask)
{
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hContact, MAKELONG(i - ID_STATUS_OFFLINE,
@@ -188,8 +188,8 @@ static void UpdateStickies()
DWORD localMask;
int i;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ HCONTACT hItem = (HCONTACT)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, (BYTE)db_get_dw(hContact, CLVM_MODULE, g_szModename, 0) ? 1 : 0);
localMask = HIWORD(db_get_dw(hContact, CLVM_MODULE, g_szModename, 0));
@@ -450,7 +450,7 @@ void SaveState()
ptrA szModeName(mir_utf8encodeT(szTempModeName));
DWORD dwGlobalMask = GetMaskForItem(hInfoItem);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem == NULL)
continue;
@@ -656,7 +656,7 @@ void DeleteViewMode( char * szName )
SetWindowText(hwndSelector, TranslateT("All contacts"));
}
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
if (db_get_dw(hContact, CLVM_MODULE, szName, -1) != -1)
db_set_dw(hContact, CLVM_MODULE, szName, 0);
}
@@ -844,7 +844,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
case IDC_CLEARALL:
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0);