diff options
author | George Hazan <george.hazan@gmail.com> | 2012-10-30 20:08:15 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-10-30 20:08:15 +0000 |
commit | cdff820aeb7d935d18fb66027102f69ec96bf92c (patch) | |
tree | d1746bf9d6525f235d2268b03c65280a030443cf | |
parent | 54afc006dbe5a48decbbf5d4f0c332b52e776ec8 (diff) |
minor clists' code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@2118 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
36 files changed, 896 insertions, 1029 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_cache_funcs.h b/plugins/Clist_modern/src/hdr/modern_cache_funcs.h index ba2b59f2c3..af86a029d4 100644 --- a/plugins/Clist_modern/src/hdr/modern_cache_funcs.h +++ b/plugins/Clist_modern/src/hdr/modern_cache_funcs.h @@ -31,11 +31,11 @@ Created by Pescuma #include "modern_clc.h"
#include "modern_commonprototypes.h"
-void Cache_GetText(struct ClcData *dat, struct ClcContact *contact, BOOL forceRenew);
-void Cache_GetFirstLineText(struct ClcData *dat, struct ClcContact *contact);
+void Cache_GetText(struct ClcData *dat, ClcContact *contact, BOOL forceRenew);
+void Cache_GetFirstLineText(struct ClcData *dat, ClcContact *contact);
void Cache_GetSecondLineText(struct SHORTDATA *dat, PDNCE pdnce);
void Cache_GetThirdLineText(struct SHORTDATA *dat, PDNCE pdnce);
-void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact);
+void Cache_GetAvatar(struct ClcData *dat, ClcContact *contact);
void Cache_GetTimezone(struct ClcData *dat, HANDLE hContact);
int Cache_GetLineText(PDNCE 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,
diff --git a/plugins/Clist_modern/src/hdr/modern_clc.h b/plugins/Clist_modern/src/hdr/modern_clc.h index e17ee3e03c..62d9473a60 100644 --- a/plugins/Clist_modern/src/hdr/modern_clc.h +++ b/plugins/Clist_modern/src/hdr/modern_clc.h @@ -128,7 +128,7 @@ void clcSetDelayTimer( UINT_PTR uIDEvent, HWND hwnd, int nDelay = -1); #define DROPTARGET_ONMETACONTACT 6
#define DROPTARGET_ONSUBCONTACT 7
-struct ClcGroup;
+ClcGroup;
#define CONTACTF_ONLINE 1
#define CONTACTF_INVISTO 2
@@ -208,7 +208,7 @@ struct tContactItems struct ClcContact : public ClcContactBase
{
- struct ClcContact *subcontacts;
+ ClcContact *subcontacts;
BYTE SubAllocated;
BYTE SubExpanded;
BYTE isSubcontact;
@@ -403,22 +403,22 @@ typedef struct tagOVERLAYICONINFO void ClcOptionsChanged(void);
//clcidents.c
-int cliGetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int contactIndex);
-int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,struct ClcGroup **subgroup,int *isVisible, BOOL isIgnoreSubcontacts );
-int cliGetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,struct ClcGroup **subgroup);
-HANDLE ContactToHItem(struct ClcContact *contact);
-HANDLE ContactToItemHandle(struct ClcContact *contact,DWORD *nmFlags);
+int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex);
+int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible, BOOL isIgnoreSubcontacts );
+int cliGetRowByIndex(struct ClcData *dat,int testindex,ClcContact **contact,ClcGroup **subgroup);
+HANDLE ContactToHItem(ClcContact *contact);
+HANDLE ContactToItemHandle(ClcContact *contact,DWORD *nmFlags);
void ClearRowByIndexCache();
//clcitems.c
-struct ClcGroup *cli_AddGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers);
-void cli_FreeGroup(struct ClcGroup *group);
-int cli_AddInfoItemToGroup(struct ClcGroup *group,int flags,const TCHAR *pszText);
+ClcGroup *cli_AddGroup(HWND hwnd,struct 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,struct ClcData *dat);
void cli_DeleteItemFromTree(HWND hwnd,HANDLE hItem);
void cli_AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline);
void cli_SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort);
-int GetNewSelection(struct ClcGroup *group,int selection, int direction);
+int GetNewSelection(ClcGroup *group,int selection, int direction);
//clcmsgs.c
LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARAM wParam,LPARAM lParam);
@@ -426,7 +426,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA //clcutils.c
void cliRecalcScrollBar(HWND hwnd,struct ClcData *dat);
void cliBeginRenameSelection(HWND hwnd,struct ClcData *dat);
-int cliHitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact **contact,struct ClcGroup **group,DWORD *flags);
+int cliHitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,ClcContact **contact,ClcGroup **group,DWORD *flags);
void cliScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth);
int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt);
void LoadCLCOptions(HWND hwnd,struct ClcData *dat);
diff --git a/plugins/Clist_modern/src/hdr/modern_clcpaint.h b/plugins/Clist_modern/src/hdr/modern_clcpaint.h index fdca01884f..73c275fe56 100644 --- a/plugins/Clist_modern/src/hdr/modern_clcpaint.h +++ b/plugins/Clist_modern/src/hdr/modern_clcpaint.h @@ -14,7 +14,7 @@ public: BOOL IsForegroundWindow( HWND hWnd );
HFONT ChangeToFont( HDC hdc, struct ClcData *dat, int id, int *fontHeight );
- int GetBasicFontID( struct ClcContact * contact );
+ int GetBasicFontID( ClcContact * contact );
void GetTextSize( SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height );
void AddParam( MODERNMASK * mpModernMask, DWORD dwParamHash, const char* szValue, DWORD dwValueHash );
BOOL CheckMiniMode( struct ClcData *dat, BOOL selected, BOOL hot );
@@ -101,33 +101,33 @@ private: void _SetHotTrackColour( HDC hdc, struct ClcData *dat );
int _GetStatusOnlineness( int status );
int _GetGeneralisedStatus();
- int _GetRealStatus( struct ClcContact * pContact, int nStatus );
+ int _GetRealStatus( ClcContact * pContact, int nStatus );
RECT _GetRectangle( struct ClcData *dat, RECT *row_rc, RECT *free_row_rc, int *left_pos, int *right_pos, BOOL left, int real_width, int width, int height, int horizontal_space );
void _DrawTextSmiley( HDC hdcMem, RECT * free_rc, SIZE * text_size, TCHAR *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley );
void _AddParameter( MODERNMASK * mpModernMask, MASKPARAM * lpParam );
void _AddParamShort( MODERNMASK * mpModernMask, DWORD dwParamIndex, DWORD dwValueIndex );
void _FillParam( MASKPARAM * lpParam, DWORD dwParamHash, const char* szValue, DWORD dwValueHash );
- MODERNMASK * _GetCLCContactRowBackModernMask( struct ClcGroup * group, struct ClcContact * Drawing, int indent, int index, BOOL selected, BOOL hottrack, struct ClcData * dat );
+ MODERNMASK * _GetCLCContactRowBackModernMask( ClcGroup * group, ClcContact * Drawing, int indent, int index, BOOL selected, BOOL hottrack, struct ClcData * dat );
void _RTLRect( RECT *rect, int width, int offset );
- void _PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint );
- void _DrawStatusIcon( struct ClcContact * Drawing, struct ClcData *dat, int iImage, HDC hdcMem, int x, int y, int cx, int cy, DWORD colorbg, DWORD colorfg, int mode );
+ void _PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint );
+ void _DrawStatusIcon( ClcContact * Drawing, struct ClcData *dat, int iImage, HDC hdcMem, int x, int y, int cx, int cy, DWORD colorbg, DWORD colorfg, int mode );
BOOL _DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT * rcPaint, RECT clRect, struct ClcData * dat );
void _PaintClc( HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint );
- void _StoreItemPos( struct ClcContact *contact, int ItemType, RECT * rc );
- void _CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT *in_row_rc, RECT *in_free_row_rc, int left_pos, int right_pos, int selected, int hottrack );
+ void _StoreItemPos( ClcContact *contact, int ItemType, RECT * rc );
+ void _CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *in_row_rc, RECT *in_free_row_rc, int left_pos, int right_pos, int selected, int hottrack );
BOOL __IsVisible( RECT * firtRect, RECT * secondRect );
- void _GetBlendMode( IN struct ClcData *dat, IN struct ClcContact * Drawing, IN BOOL selected, IN BOOL hottrack, IN BOOL bFlag, OUT COLORREF * OutColourFg, OUT int * OutMode );
- void _DrawContactItems( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT *row_rc, RECT *free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint );
- void _PaintRowItems ( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint );
+ void _GetBlendMode( IN struct ClcData *dat, IN ClcContact * Drawing, IN BOOL selected, IN BOOL hottrack, IN BOOL bFlag, OUT COLORREF * OutColourFg, OUT int * OutMode );
+ void _DrawContactItems( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *row_rc, RECT *free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint );
+ void _PaintRowItems ( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint );
- void _DrawContactAvatar ( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem );
- void _DrawContactIcon ( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem );
- void _DrawContactText ( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat );
- void _DrawContactSubText ( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat, BYTE itemType );
- void _DrawContactTime ( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem );
- void _DrawContactExtraIcon ( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * rc, int iImage );
- void _DrawContactSelection ( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT *rcPaint, RECT * prcItem );
- void _DrawContactLine ( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT *free_row_rc, RECT *rcPaint, RECT& text_rc );
+ void _DrawContactAvatar ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem );
+ void _DrawContactIcon ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem );
+ void _DrawContactText ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat );
+ void _DrawContactSubText ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat, BYTE itemType );
+ void _DrawContactTime ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem );
+ void _DrawContactExtraIcon ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * rc, int iImage );
+ void _DrawContactSelection ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rcPaint, RECT * prcItem );
+ void _DrawContactLine ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *free_row_rc, RECT *rcPaint, RECT& text_rc );
int _rcWidth( RECT *rc ) { return rc->right-rc->left; }
int _rcHeight( RECT *rc ) { return rc->bottom-rc->top; }
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index d8cb8d33e9..21abadc64c 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -89,7 +89,7 @@ typedef INT_PTR (*PSYNCCALLBACKPROC)(WPARAM,LPARAM); /* CLCItems */
-BOOL CLCItems_IsShowOfflineGroup(struct ClcGroup* group);
+BOOL CLCItems_IsShowOfflineGroup(ClcGroup* group);
/* CListMod */
int CListMod_HideWindow(HWND hwndContactList, int mode);
@@ -137,7 +137,7 @@ int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT * r); int ModernSkinButtonUnloadModule(WPARAM,LPARAM);
/* RowHeight */
-int RowHeight_CalcRowHeight(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item);
+int RowHeight_CalcRowHeight(struct ClcData *dat, HWND hwnd, ClcContact *contact, int item);
/* SkinEngine */
BOOL ske_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidthDest,int nHeightDest,HDC hdcSrc,int nXOriginSrc,int nYOriginSrc,int nWidthSrc,int nHeightSrc,BLENDFUNCTION blendFunction);
@@ -225,7 +225,7 @@ int GetAverageMode( void ); //clisttray.c int GetContactCachedStatus(HANDLE hContact); //clistsettings.c
INT_PTR GetContactIcon(WPARAM wParam,LPARAM lParam); //clistmod.c
int GetContactIconC(pdisplayNameCacheEntry cacheEntry); //clistmod.c
-int GetContactIndex(struct ClcGroup *group,struct ClcContact *contact); //clcidents.c
+int GetContactIndex(ClcGroup *group,ClcContact *contact); //clcidents.c
int GetStatusForContact(HANDLE hContact,char *szProto); //clistsettings.c
int InitCustomMenus(void); //clistmenus.c
int InitFramesMenus(void); //framesmenus.c
@@ -288,18 +288,18 @@ void cliFreeCacheItem( pdisplayNameCacheEntry p ); void cliRebuildEntireList(HWND hwnd,struct ClcData *dat);
void cliRecalcScrollBar(HWND hwnd,struct ClcData *dat);
void CLUI_cliOnCreateClc(void);
-int cli_AddItemToGroup(struct ClcGroup *group, int iAboveItem);
-int cli_AddInfoItemToGroup(struct ClcGroup *group,int flags,const TCHAR *pszText);
-int cliGetGroupContentsCount(struct ClcGroup *group, int visibleOnly);
+int cli_AddItemToGroup(ClcGroup *group, int iAboveItem);
+int cli_AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText);
+int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly);
int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk);
-int cliGetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int contactIndex);
+int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex);
int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact);
int cli_RemoveEvent(HANDLE hContact, HANDLE hDbEvent);
void cli_AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline);
void cli_DeleteItemFromTree(HWND hwnd, HANDLE hItem);
-void cli_FreeContact( struct ClcContact* );
-void cli_FreeGroup( struct ClcGroup* );
-char* cli_GetGroupCountsText(struct ClcData *dat, struct ClcContact *contact);
+void cli_FreeContact( ClcContact* );
+void cli_FreeGroup( ClcGroup* );
+char* cli_GetGroupCountsText(struct ClcData *dat, ClcContact *contact);
void cli_ChangeContactIcon(HANDLE hContact,int iIcon,int add);
LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARAM wParam,LPARAM lParam);
struct CListEvent* cliCreateEvent( void );
@@ -307,11 +307,11 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle); LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
int cliShowHide(WPARAM wParam,LPARAM lParam);
BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase );
-int cliCompareContacts(const struct ClcContact *contact1,const struct ClcContact *contact2);
-int cliFindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,struct ClcGroup **subgroup,int *isVisible);
+int cliCompareContacts(const ClcContact *contact1,const ClcContact *contact2);
+int cliFindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible);
void cliTrayIconUpdateBase(const char *szChangedProto);
void cliCluiProtocolStatusChanged(int status,const char * proto);
-HMENU cliBuildGroupPopupMenu(struct ClcGroup *group);
+HMENU cliBuildGroupPopupMenu(ClcGroup *group);
void cliInvalidateDisplayNameCacheEntry(HANDLE hContact);
void cliCheckCacheItem(pdisplayNameCacheEntry pdnce);
void cli_SaveStateAndRebuildList(HWND hwnd, struct ClcData *dat);
@@ -319,7 +319,7 @@ void CLUI_cli_LoadCluiGlobalOpts(void); INT_PTR cli_TrayIconProcessMessage(WPARAM wParam,LPARAM lParam);
BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase );
-struct ClcContact* cliCreateClcContact( void );
+ClcContact* cliCreateClcContact( void );
ClcCacheEntryBase* cliCreateCacheItem(HANDLE hContact);
ClcCacheEntryBase* cliGetCacheEntry(HANDLE hContact);
diff --git a/plugins/Clist_modern/src/hdr/modern_gettextasync.h b/plugins/Clist_modern/src/hdr/modern_gettextasync.h index 881e2b738d..3a4d9639bc 100644 --- a/plugins/Clist_modern/src/hdr/modern_gettextasync.h +++ b/plugins/Clist_modern/src/hdr/modern_gettextasync.h @@ -2,4 +2,4 @@ void InitCacheAsync();
void UninitCacheAsync();
void gtaRenewText(HANDLE hContact);
-int gtaAddRequest(struct ClcData *dat,struct ClcContact *contact,HANDLE hContact);
\ No newline at end of file +int gtaAddRequest(struct ClcData *dat,ClcContact *contact,HANDLE hContact);
diff --git a/plugins/Clist_modern/src/hdr/modern_rowheight_funcs.h b/plugins/Clist_modern/src/hdr/modern_rowheight_funcs.h index 57223cf3c0..ea74b5498f 100644 --- a/plugins/Clist_modern/src/hdr/modern_rowheight_funcs.h +++ b/plugins/Clist_modern/src/hdr/modern_rowheight_funcs.h @@ -47,7 +47,7 @@ BOOL RowHeights_Alloc(struct ClcData *dat, int size); int RowHeights_GetMaxRowHeight(struct ClcData *dat, HWND hwnd);
// Calc and store row height
-int RowHeights_GetRowHeight(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item);
+int RowHeights_GetRowHeight(struct ClcData *dat, HWND hwnd, ClcContact *contact, int item);
// Calc and store row height for all itens in the list
void RowHeights_CalcRowHeights(struct ClcData *dat, HWND hwnd);
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index ce11e9214a..575aba3a1c 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -37,7 +37,7 @@ Modified by FYR #include "./hdr/modern_gettextasync.h"
#include "hdr/modern_sync.h"
-typedef BOOL (* ExecuteOnAllContactsFuncPtr) (struct ClcContact *contact, BOOL subcontact, void *param);
+typedef BOOL (* ExecuteOnAllContactsFuncPtr) (ClcContact *contact, BOOL subcontact, void *param);
/***********************************/
@@ -49,7 +49,7 @@ typedef BOOL (* ExecuteOnAllContactsFuncPtr) (struct ClcContact *contact, BOOL s static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size);
static BOOL ExecuteOnAllContacts(struct ClcData *dat, ExecuteOnAllContactsFuncPtr func, void *param);
-static BOOL ExecuteOnAllContactsOfGroup(struct ClcGroup *group, ExecuteOnAllContactsFuncPtr func, void *param);
+static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFuncPtr func, void *param);
int CLUI_SyncGetShortData(WPARAM wParam, LPARAM lParam);
void CListSettings_FreeCacheItemData(pdisplayNameCacheEntry pDst);
void CListSettings_FreeCacheItemDataOption( pdisplayNameCacheEntry pDst, DWORD flag );
@@ -72,7 +72,7 @@ void Cache_GetTimezone(struct ClcData *dat, HANDLE hContact) * Get all lines of text
*/
-void Cache_GetText(struct ClcData *dat, struct ClcContact *contact, BOOL forceRenew)
+void Cache_GetText(struct ClcData *dat, ClcContact *contact, BOOL forceRenew)
{
Cache_GetFirstLineText(dat, contact);
if ( !dat->force_in_dialog) {
@@ -518,7 +518,7 @@ int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR * /*
* Get the text for First Line
*/
-void Cache_GetFirstLineText(struct ClcData *dat, struct ClcContact *contact)
+void Cache_GetFirstLineText(struct ClcData *dat, ClcContact *contact)
{
if (GetCurrentThreadId() != g_dwMainThreadID)
return;
@@ -678,7 +678,7 @@ static BOOL ExecuteOnAllContacts(struct ClcData *dat, ExecuteOnAllContactsFuncPt return res;
}
-static BOOL ExecuteOnAllContactsOfGroup(struct ClcGroup *group, ExecuteOnAllContactsFuncPtr func, void *param)
+static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFuncPtr func, void *param)
{
if ( !group)
return TRUE;
@@ -706,7 +706,7 @@ static BOOL ExecuteOnAllContactsOfGroup(struct ClcGroup *group, ExecuteOnAllCont /*
* Avatar working routines
*/
-BOOL UpdateAllAvatarsProxy(struct ClcContact *contact, BOOL subcontact, void *param)
+BOOL UpdateAllAvatarsProxy(ClcContact *contact, BOOL subcontact, void *param)
{
Cache_GetAvatar((struct ClcData *)param, contact);
return TRUE;
@@ -717,7 +717,7 @@ void UpdateAllAvatars(struct ClcData *dat) ExecuteOnAllContacts(dat,UpdateAllAvatarsProxy,dat);
}
-BOOL ReduceAvatarPosition(struct ClcContact *contact, BOOL subcontact, void *param)
+BOOL ReduceAvatarPosition(ClcContact *contact, BOOL subcontact, void *param)
{
if (contact->avatar_pos >= *((int *)param))
contact->avatar_pos--;
@@ -725,7 +725,7 @@ BOOL ReduceAvatarPosition(struct ClcContact *contact, BOOL subcontact, void *par return TRUE;
}
-void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact)
+void Cache_ProceedAvatarInList(struct ClcData *dat, ClcContact *contact)
{
struct avatarCacheEntry * ace = contact->avatar_data;
int old_pos = contact->avatar_pos;
@@ -831,7 +831,7 @@ void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact) }
}
-void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact)
+void Cache_GetAvatar(struct ClcData *dat, ClcContact *contact)
{
int old_pos = contact->avatar_pos;
// workaround for avatar service and other wich destroys service on OK_TOEXIT
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 40bb4a73cc..1725e0be57 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -54,7 +54,7 @@ HANDLE hIconChangedHook = NULL; HANDLE hAckHook = NULL;
HANDLE hAvatarChanged = NULL;
static BOOL g_bSortTimerIsSet = FALSE;
-static struct ClcContact * hitcontact = NULL;
+static ClcContact * hitcontact = NULL;
static int clcHookSmileyAddOptionsChanged(WPARAM wParam,LPARAM lParam);
@@ -315,7 +315,7 @@ static int clcProceedDragToScroll(HWND hwnd, int Y) static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const TCHAR *text, int prefixOk, BOOL fSearchUp)
{
- struct ClcGroup *group = &dat->list;
+ ClcGroup *group = &dat->list;
int testlen = lstrlen(text);
BOOL fReturnAsFound = FALSE;
int nLastFound = -1;
@@ -344,7 +344,7 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const found = ((prefixOk && CSTR_EQUAL == CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, text, -1, group->cl.items[group->scanIndex]->szText, testlen)) || (!prefixOk && !lstrcmpi(text, group->cl.items[group->scanIndex]->szText)));
}
if (found) {
- struct ClcGroup *contactGroup = group;
+ ClcGroup *contactGroup = group;
int contactScanIndex = group->scanIndex;
int foundindex;
for (; group; group = group->parent)
@@ -376,7 +376,7 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const return -1;
}
-static BOOL clcItemNotHiddenOffline(struct ClcData * dat, struct ClcGroup* group, struct ClcContact * contact)
+static BOOL clcItemNotHiddenOffline(struct ClcData * dat, ClcGroup* group, ClcContact * contact)
{
PDNCE pdnce;
@@ -451,7 +451,7 @@ static LRESULT clcOnHitTest(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa }
static LRESULT clcOnCommand(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct ClcContact *contact;
+ ClcContact *contact;
int hit = pcli->pfnGetRowByIndex(dat, dat->selection, &contact, NULL);
if (hit == -1) return 0;
if ( contact->type == CLCIT_CONTACT && CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM) contact->hContact)) return 0;
@@ -672,8 +672,8 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa if (changeGroupExpand)
{
int hit;
- struct ClcContact *contact;
- struct ClcGroup *group;
+ ClcContact *contact;
+ ClcGroup *group;
//dat->szQuickSearch[0] = 0;
hit = cliGetRowByIndex(dat,dat->selection,&contact,&group);
if (hit != -1)
@@ -695,7 +695,7 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa else if (changeGroupExpand == 1 && contact->SubExpanded)
{
//Contract
- struct ClcContact * ht = NULL;
+ ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
contact->SubExpanded = 0;
db_set_b(contact->hContact,"CList","Expanded",0);
@@ -712,7 +712,7 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa }
else if (changeGroupExpand == 2 && !contact->SubExpanded && dat->expandMeta)
{
- struct ClcContact * ht = NULL;
+ ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
contact->SubExpanded = 1;
db_set_b(contact->hContact,"CList","Expanded",1);
@@ -723,8 +723,8 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa if (ht)
{
int i=0;
- struct ClcContact *contact2;
- struct ClcGroup *group2;
+ ClcContact *contact2;
+ ClcGroup *group2;
if (FindItem(hwnd,dat,contact->hContact,&contact2,&group2,NULL,FALSE))
{
i = cliGetRowsPriorTo(&dat->list,group2,GetContactIndex(group2,contact2));
@@ -830,7 +830,7 @@ static LRESULT clcOnTimer(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPara }
case TIMERID_SUBEXPAND:
{
- struct ClcContact * ht = NULL;
+ ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
if (hitcontact && dat->expandMeta)
{
@@ -845,8 +845,8 @@ static LRESULT clcOnTimer(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPara cliRecalcScrollBar(hwnd,dat);
if (ht) {
int i=0;
- struct ClcContact *contact;
- struct ClcGroup *group;
+ ClcContact *contact;
+ ClcGroup *group;
if (FindItem(hwnd,dat,hitcontact->hContact,&contact,&group,NULL,FALSE))
{
i = cliGetRowsPriorTo(&dat->list,group,GetContactIndex(group,contact));
@@ -928,8 +928,8 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM }
}
{
- struct ClcContact *contact;
- struct ClcGroup *group;
+ ClcContact *contact;
+ ClcGroup *group;
int hit;
DWORD hitFlags;
fMouseUpped = FALSE;
@@ -987,8 +987,8 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM if (hit != -1 && !(hitFlags&CLCHT_NOWHERE) && contact->type == CLCIT_GROUP)
if (hitFlags&CLCHT_ONITEMICON)
{
- struct ClcGroup *selgroup;
- struct ClcContact *selcontact;
+ ClcGroup *selgroup;
+ ClcContact *selcontact;
dat->selection = cliGetRowByIndex(dat,dat->selection,&selcontact,&selgroup);
pcli->pfnSetGroupExpand(hwnd,dat,contact->group,-1);
if (dat->selection != -1)
@@ -1185,7 +1185,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w int target = GetDropTargetInformation(hwnd,dat,pt);
if (dat->dragStage&DRAGSTAGEF_OUTSIDE && target != DROPTARGET_OUTSIDE) {
NMCLISTCONTROL nm;
- struct ClcContact *contact;
+ ClcContact *contact;
cliGetRowByIndex(dat,dat->iDragItem,&contact,NULL);
nm.hdr.code = CLN_DRAGSTOP;
nm.hdr.hwndFrom = hwnd;
@@ -1203,7 +1203,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w case DROPTARGET_ONCONTACT:
if (ServiceExists(MS_MC_ADDTOMETA))
{
- struct ClcContact *contSour;
+ ClcContact *contSour;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
@@ -1219,7 +1219,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w case DROPTARGET_ONMETACONTACT:
if (ServiceExists(MS_MC_ADDTOMETA))
{
- struct ClcContact *contSour,*contDest;
+ ClcContact *contSour,*contDest;
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
@@ -1237,7 +1237,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w case DROPTARGET_ONSUBCONTACT:
if (ServiceExists(MS_MC_ADDTOMETA))
{
- struct ClcContact *contSour,*contDest;
+ ClcContact *contSour,*contDest;
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
@@ -1264,7 +1264,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w case DROPTARGET_OUTSIDE:
{
NMCLISTCONTROL nm;
- struct ClcContact *contact;
+ ClcContact *contact;
if (pt.x >= 0 && pt.x < clRect.right && ((pt.y < 0 && pt.y>-dat->dragAutoScrollHeight) || (pt.y >= clRect.bottom && pt.y < clRect.bottom+dat->dragAutoScrollHeight)))
{
@@ -1291,11 +1291,11 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w }
default:
{
- struct ClcGroup *group = NULL;
+ ClcGroup *group = NULL;
cliGetRowByIndex(dat,dat->iDragItem,NULL,&group);
if (group && group->parent)
{
- struct ClcContact *contSour;
+ ClcContact *contSour;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
if ( !contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER));
@@ -1350,7 +1350,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w case DROPTARGET_ONCONTACT:
if (ServiceExists(MS_MC_ADDTOMETA))
{
- struct ClcContact *contDest, *contSour;
+ ClcContact *contDest, *contSour;
int res;
HANDLE handle,hcontact;
@@ -1399,7 +1399,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w break;
case DROPTARGET_ONMETACONTACT:
{
- struct ClcContact *contDest, *contSour;
+ ClcContact *contDest, *contSour;
int res;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
@@ -1460,7 +1460,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w break;
case DROPTARGET_ONSUBCONTACT:
{
- struct ClcContact *contDest, *contSour;
+ ClcContact *contDest, *contSour;
int res;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
@@ -1511,8 +1511,8 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w break;
case DROPTARGET_INSERTION:
{
- struct ClcContact *contact, *destcontact;
- struct ClcGroup *group, *destgroup;
+ ClcContact *contact, *destcontact;
+ ClcGroup *group, *destgroup;
BOOL NeedRename = FALSE;
TCHAR newName[128] = {0};
int newIndex,i;
@@ -1599,7 +1599,7 @@ static LRESULT clcOnDestroy(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa }
static LRESULT clcOnIntmGroupChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct ClcContact *contact;
+ ClcContact *contact;
BYTE iExtraImage[MAXEXTRACOLUMNS];
WORD iWideExtraImage[MAXEXTRACOLUMNS];
BYTE flags = 0;
@@ -1637,15 +1637,15 @@ static LRESULT clcOnIntmGroupChanged(struct ClcData *dat, HWND hwnd, UINT msg, W static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct ClcContact *contact = NULL;
- struct ClcGroup *group = NULL;
+ ClcContact *contact = NULL;
+ ClcGroup *group = NULL;
int recalcScrollBar = 0, shouldShow;
BOOL needRepaint = FALSE;
WORD status;
RECT iconRect = {0};
int contacticon = CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
HANDLE hSelItem = NULL;
- struct ClcContact *selcontact = NULL;
+ ClcContact *selcontact = NULL;
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
if (szProto == NULL)
@@ -1714,7 +1714,7 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP }
if (hSelItem) {
- struct ClcGroup *selgroup;
+ ClcGroup *selgroup;
if (pcli->pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf(( SortedList* )&selgroup->cl, selcontact));
else
@@ -1738,7 +1738,7 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP static LRESULT clcOnIntmAvatarChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct ClcContact *contact;
+ ClcContact *contact;
if (FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
Cache_GetAvatar(dat, contact);
else if (dat->use_avatar_service && !wParam)
@@ -1750,7 +1750,7 @@ static LRESULT clcOnIntmAvatarChanged(struct ClcData *dat, HWND hwnd, UINT msg, static LRESULT clcOnIntmTimeZoneChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct ClcContact *contact;
+ ClcContact *contact;
if ( !FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
return corecli.pfnContactListControlWndProc(hwnd,msg,wParam,lParam);
@@ -1764,7 +1764,7 @@ static LRESULT clcOnIntmTimeZoneChanged(struct ClcData *dat, HWND hwnd, UINT msg static LRESULT clcOnIntmNameChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct ClcContact *contact;
+ ClcContact *contact;
int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
@@ -1792,13 +1792,13 @@ static LRESULT clcOnIntmApparentModeChanged(struct ClcData *dat, HWND hwnd, UINT static LRESULT clcOnIntmStatusMsgChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct ClcContact *contact;
+ ClcContact *contact;
HANDLE hContact = (HANDLE)wParam;
if (hContact == NULL || IsHContactInfo(hContact) || IsHContactGroup(hContact))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if ( !FindItem(hwnd,dat,hContact,&contact,NULL,NULL,FALSE))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- if (contact)//!IsBadWritePtr(contact, sizeof(struct ClcContact)))
+ if (contact)//!IsBadWritePtr(contact, sizeof(ClcContact)))
{
Cache_GetText(dat,contact,1);
cliRecalcScrollBar(hwnd,dat);
@@ -1810,7 +1810,7 @@ static LRESULT clcOnIntmStatusMsgChanged(struct ClcData *dat, HWND hwnd, UINT ms static LRESULT clcOnIntmNotOnListChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
- struct ClcContact *contact;
+ ClcContact *contact;
if ( !FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
@@ -1843,7 +1843,7 @@ static LRESULT clcOnIntmStatusChanged(struct ClcData *dat, HWND hwnd, UINT msg, if (wParam != 0) {
pdisplayNameCacheEntry pdnce = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry((HANDLE)wParam);
if (pdnce && pdnce->m_cache_cszProto) {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
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);
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index 903844eb9c..c1739d6a3c 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -26,13 +26,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "hdr/modern_commonprototypes.h"
#define CacheArrSize 255
-struct ClcGroup *CacheIndex[CacheArrSize] = {NULL};
+ClcGroup *CacheIndex[CacheArrSize] = {NULL};
bool CacheIndexClear = TRUE;
/* the CLC uses 3 different ways to identify elements in its list, this file
contains routines to convert between them.
-1) struct ClcContact/struct ClcGroup pair. Only ever used within the duration
+1) ClcContact/ClcGroup pair. Only ever used within the duration
of a single operation, but used at some point in nearly everything
2) index integer. The 0-based number of the item from the top. Only visible
items are counted (ie not closed groups). Used for saving selection and drag
@@ -46,14 +46,14 @@ exclusively externally 2->1: GetRowByIndex()
*/
-int GetContactIndex(struct ClcGroup *group,struct ClcContact *contact)
+int GetContactIndex(ClcGroup *group,ClcContact *contact)
{
for (int i=0; i < group->cl.count; i++)
if (group->cl.items[i]->hContact == contact->hContact) return i;
return -1;
}
-int cliGetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int contactIndex)
+int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex)
{
int count = 0;
BYTE k;
@@ -103,16 +103,16 @@ int cliGetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int conta return -1;
}
-int cliFindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,struct ClcGroup **subgroup,int *isVisible)
+int cliFindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible)
{
return FindItem(hwnd,dat, hItem,contact,subgroup,isVisible,FALSE);
}
-int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,struct ClcGroup **subgroup,int *isVisible, BOOL isIgnoreSubcontacts)
+int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible, BOOL isIgnoreSubcontacts)
{
int index = 0, i;
int nowVisible = 1;
- struct ClcGroup *group;
+ ClcGroup *group;
group = &dat->list;
@@ -121,7 +121,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont for (;;) {
if (group->scanIndex == group->cl.count) {
- struct ClcGroup *tgroup;
+ ClcGroup *tgroup;
group = group->parent;
if (group == NULL) break;
nowVisible = 1;
@@ -170,7 +170,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont if (group->cl.items[group->scanIndex]->subcontacts[i].hContact == hItem)
{
#ifdef _DEBUG
- if (IsBadWritePtr(&group->cl.items[group->scanIndex]->subcontacts[i], sizeof(struct ClcContact)))
+ if (IsBadWritePtr(&group->cl.items[group->scanIndex]->subcontacts[i], sizeof(ClcContact)))
{
log1("FindIltem->IsBadWritePtr | 2o [%08x]", &group->cl.items[group->scanIndex]->subcontacts[i]);
PostMessage(hwnd,CLM_AUTOREBUILD,0,0);
@@ -206,10 +206,10 @@ void ClearRowByIndexCache() CacheIndexClear = TRUE;
};
}
-int cliGetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,struct ClcGroup **subgroup)
+int cliGetRowByIndex(struct ClcData *dat,int testindex,ClcContact **contact,ClcGroup **subgroup)
{
int index = 0,i;
- struct ClcGroup *group = &dat->list;
+ ClcGroup *group = &dat->list;
if (testindex < 0) return (-1);
{
@@ -270,7 +270,7 @@ int cliGetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **conta return -1;
}
-HANDLE ContactToHItem(struct ClcContact *contact)
+HANDLE ContactToHItem(ClcContact *contact)
{
switch(contact->type) {
case CLCIT_CONTACT:
@@ -283,7 +283,7 @@ case CLCIT_INFO: return NULL;
}
-HANDLE ContactToItemHandle(struct ClcContact *contact,DWORD *nmFlags)
+HANDLE ContactToItemHandle(ClcContact *contact,DWORD *nmFlags)
{
switch(contact->type) {
case CLCIT_CONTACT:
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 7c1ec84dda..b912bf3762 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m_metacontacts.h"
#include "hdr/modern_commonprototypes.h"
-void AddSubcontacts(struct ClcData *dat, struct ClcContact * cont, BOOL showOfflineHereGroup)
+void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
{
int subcount,i,j;
HANDLE hsub;
@@ -45,66 +45,56 @@ void AddSubcontacts(struct ClcData *dat, struct ClcContact * cont, BOOL showOffl cont->isSubcontact = 0;
mir_free(cont->subcontacts);
- cont->subcontacts = (struct ClcContact *) mir_calloc(sizeof(struct ClcContact)*subcount);
+ cont->subcontacts = (ClcContact *) mir_calloc(sizeof(ClcContact)*subcount);
cont->SubAllocated = subcount;
i=0;
for (j = 0; j < subcount; j++) {
- WORD wStatus;
-
hsub = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)cont->hContact,j);
cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hsub);
- wStatus = pdnce___GetStatus( cacheEntry );
- if (showOfflineHereGroup || (!(db_get_b(NULL,"CLC","MetaHideOfflineSub",SETTING_METAHIDEOFFLINESUB_DEFAULT) && db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)) ||
- wStatus != ID_STATUS_OFFLINE )
- // &&
- //(!cacheEntry->Hidden || style&CLS_SHOWHIDDEN)
- )
-
- {
- cont->subcontacts[i].hContact = cacheEntry->hContact;
-
- cont->subcontacts[i].avatar_pos = AVATAR_POS_DONT_HAVE;
- Cache_GetAvatar(dat, &cont->subcontacts[i]);
-
- cont->subcontacts[i].iImage = CallService(MS_CLIST_GETCONTACTICON,(WPARAM)cacheEntry->hContact,1);
- memset(cont->subcontacts[i].iExtraImage,0xFF,sizeof(cont->subcontacts[i].iExtraImage));
- memset((void*)cont->subcontacts[i].iWideExtraImage,0xFF,sizeof(cont->subcontacts[i].iWideExtraImage));
- cont->subcontacts[i].proto = cacheEntry->m_cache_cszProto;
- cont->subcontacts[i].type = CLCIT_CONTACT;
- cont->subcontacts[i].flags = 0;//CONTACTF_ONLINE;
- cont->subcontacts[i].isSubcontact = i+1;
- cont->subcontacts[i].lastPaintCounter = 0;
- cont->subcontacts[i].subcontacts = cont;
- cont->subcontacts[i].image_is_special = FALSE;
- //cont->subcontacts[i].status = cacheEntry->status;
- Cache_GetTimezone(dat, (&cont->subcontacts[i])->hContact);
- Cache_GetText(dat, &cont->subcontacts[i],1);
-
- {
- int apparentMode;
- char *szProto;
- int idleMode;
- szProto = cacheEntry->m_cache_cszProto;
- if (szProto != NULL && !pcli->pfnIsHiddenMode(dat,wStatus))
- cont->subcontacts[i].flags |= CONTACTF_ONLINE;
- apparentMode = szProto != NULL?cacheEntry->ApparentMode:0;
- apparentMode = szProto != NULL?cacheEntry->ApparentMode:0;
- if (apparentMode == ID_STATUS_OFFLINE) cont->subcontacts[i].flags |= CONTACTF_INVISTO;
- else if (apparentMode == ID_STATUS_ONLINE) cont->subcontacts[i].flags |= CONTACTF_VISTO;
- else if (apparentMode) cont->subcontacts[i].flags |= CONTACTF_VISTO|CONTACTF_INVISTO;
- if (cacheEntry->NotOnList) cont->subcontacts[i].flags |= CONTACTF_NOTONLIST;
- idleMode = szProto != NULL?cacheEntry->IdleTS:0;
- if (idleMode) cont->subcontacts[i].flags |= CONTACTF_IDLE;
- }
+ 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))
+ || wStatus != ID_STATUS_OFFLINE )) {
+ ClcContact& p = cont->subcontacts[i];
+ p.hContact = cacheEntry->hContact;
+
+ p.avatar_pos = AVATAR_POS_DONT_HAVE;
+ Cache_GetAvatar(dat, &p);
+
+ p.iImage = CallService(MS_CLIST_GETCONTACTICON,(WPARAM)cacheEntry->hContact,1);
+ memset(p.iExtraImage,0xFF,sizeof(p.iExtraImage));
+ memset((void*)p.iWideExtraImage,0xFF,sizeof(p.iWideExtraImage));
+ p.proto = cacheEntry->m_cache_cszProto;
+ p.type = CLCIT_CONTACT;
+ p.flags = 0;//CONTACTF_ONLINE;
+ p.isSubcontact = i+1;
+ p.lastPaintCounter = 0;
+ p.subcontacts = cont;
+ p.image_is_special = FALSE;
+ //p.status = cacheEntry->status;
+ Cache_GetTimezone(dat, (&p)->hContact);
+ Cache_GetText(dat, &p,1);
+
+ char *szProto = cacheEntry->m_cache_cszProto;
+ if (szProto != NULL && !pcli->pfnIsHiddenMode(dat,wStatus))
+ p.flags |= CONTACTF_ONLINE;
+ int apparentMode = szProto != NULL?cacheEntry->ApparentMode:0;
+ apparentMode = szProto != NULL?cacheEntry->ApparentMode:0;
+ if (apparentMode == ID_STATUS_OFFLINE) p.flags |= CONTACTF_INVISTO;
+ else if (apparentMode == ID_STATUS_ONLINE) p.flags |= CONTACTF_VISTO;
+ else if (apparentMode) p.flags |= CONTACTF_VISTO|CONTACTF_INVISTO;
+ if (cacheEntry->NotOnList) p.flags |= CONTACTF_NOTONLIST;
+ int idleMode = szProto != NULL?cacheEntry->IdleTS:0;
+ if (idleMode) p.flags |= CONTACTF_IDLE;
i++;
- } }
+ }
+ }
cont->SubAllocated = i;
if ( !i && cont->subcontacts != NULL)
mir_free_and_nil(cont->subcontacts);
}
-int cli_AddItemToGroup(struct ClcGroup *group,int iAboveItem)
+int cli_AddItemToGroup(ClcGroup *group,int iAboveItem)
{
if ( group == NULL ) return 0;
@@ -113,33 +103,25 @@ int cli_AddItemToGroup(struct ClcGroup *group,int iAboveItem) return iAboveItem;
}
-struct ClcGroup *cli_AddGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers)
+ClcGroup *cli_AddGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName, DWORD flags,int groupId,int calcTotalMembers)
{
- struct ClcGroup* result;
ClearRowByIndexCache();
if ( !dat->force_in_dialog && !(GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN))
- if ( !lstrcmp(_T("-@-HIDDEN-GROUP-@-"),szName)) //group is hidden
- {
+ if ( !lstrcmp(_T("-@-HIDDEN-GROUP-@-"),szName)) { //group is hidden
ClearRowByIndexCache();
return NULL;
}
- result = corecli.pfnAddGroup( hwnd, dat, szName, flags, groupId, calcTotalMembers);
- /* ToDo: fix some times valid contact with valid group are placed to root
- if ( result == NULL )
- {
- result = &dat->list;
- }
- */
- ClearRowByIndexCache();
- return result;
+
+ ClcGroup *result = corecli.pfnAddGroup(hwnd, dat, szName, flags, groupId, calcTotalMembers);
+ ClearRowByIndexCache();
+ return result;
}
-void cli_FreeContact(struct ClcContact *p)
+void cli_FreeContact(ClcContact *p)
{
if ( p->SubAllocated) {
if ( p->subcontacts && !p->isSubcontact) {
- int i;
- for ( i=0 ; i < p->SubAllocated ; i++ ) {
+ for (int i=0 ; i < p->SubAllocated ; i++ ) {
p->subcontacts[i].ssText.DestroySmileyList();
if ( p->subcontacts[i].avatar_pos == AVATAR_POS_ANIMATED )
AniAva_RemoveAvatar( p->subcontacts[i].hContact );
@@ -155,20 +137,20 @@ void cli_FreeContact(struct ClcContact *p) corecli.pfnFreeContact( p );
}
-void cli_FreeGroup( struct ClcGroup* group )
+void cli_FreeGroup( ClcGroup* group )
{
corecli.pfnFreeGroup( group );
ClearRowByIndexCache();
}
-int cli_AddInfoItemToGroup(struct ClcGroup *group,int flags,const TCHAR *pszText)
+int cli_AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText)
{
int i = corecli.pfnAddInfoItemToGroup( group, flags, pszText );
ClearRowByIndexCache();
return i;
}
-static void _LoadDataToContact(struct ClcContact * cont, struct ClcGroup *group, struct ClcData *dat, HANDLE hContact)
+static void _LoadDataToContact(ClcContact * cont, ClcGroup *group, struct ClcData *dat, HANDLE hContact)
{
pdisplayNameCacheEntry cacheEntry = NULL;
WORD apparentMode;
@@ -232,7 +214,7 @@ static void _LoadDataToContact(struct ClcContact * cont, struct ClcGroup *group, cont->bContactRate = db_get_b(hContact, "CList", "Rate",0);
}
-static struct ClcContact * AddContactToGroup(struct ClcData *dat,struct ClcGroup *group, pdisplayNameCacheEntry cacheEntry)
+static ClcContact * AddContactToGroup(struct ClcData *dat,ClcGroup *group, pdisplayNameCacheEntry cacheEntry)
{
HANDLE hContact;
int i;
@@ -275,7 +257,7 @@ void * AddTempGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flag mir_sntprintf(b2,SIZEOF(b2),_T("#%s"),szName);
b2[0] = 1|GROUPF_EXPANDED;
db_set_ws(NULL,"CListGroups",buf,b2);
- pcli->pfnGetGroupName(i,&groupFlags);
+ pcli->pfnGetGroupName(i,&groupFlags);
res = cli_AddGroup(hwnd,dat,szName,groupFlags,i,0);
return res;
}
@@ -284,8 +266,8 @@ void * AddTempGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flag void cli_AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline)
{
- struct ClcGroup *group;
- struct ClcContact * cont;
+ ClcGroup *group;
+ ClcContact * cont;
pdisplayNameCacheEntry cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
if (dat->IsMetaContactsEnabled && cacheEntry && cacheEntry->m_cache_nHiddenSubcontact) return; //contact should not be added
if ( !dat->IsMetaContactsEnabled && cacheEntry && g_szMetaModuleName && !mir_strcmp(cacheEntry->m_cache_cszProto,g_szMetaModuleName)) return;
@@ -309,7 +291,7 @@ void cli_DeleteItemFromTree(HWND hwnd,HANDLE hItem) }
-__inline BOOL CLCItems_IsShowOfflineGroup(struct ClcGroup* group)
+__inline BOOL CLCItems_IsShowOfflineGroup(ClcGroup* group)
{
DWORD groupFlags = 0;
if ( !group) return FALSE;
@@ -330,8 +312,8 @@ HANDLE SaveSelection( struct ClcData *dat ) int RestoreSelection( struct ClcData *dat, HANDLE hSelected )
{
- ClcContact * selcontact = NULL;
- ClcGroup * selgroup = NULL;
+ ClcContact *selcontact = NULL;
+ ClcGroup *selgroup = NULL;
if ( !hSelected || !pcli->pfnFindItem( dat->hWnd, dat, hSelected, &selcontact, &selgroup, NULL))
{
@@ -358,19 +340,19 @@ void cliRebuildEntireList(HWND hwnd,struct ClcData *dat) {
DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
HANDLE hContact;
- struct ClcContact * cont;
- struct ClcGroup *group;
- static int rebuildCounter = 0;
+ ClcContact * cont;
+ ClcGroup *group;
+ static int rebuildCounter = 0;
- BOOL PlaceOfflineToRoot = db_get_b(NULL,"CList","PlaceOfflineToRoot",SETTING_PLACEOFFLINETOROOT_DEFAULT);
+ BOOL PlaceOfflineToRoot = db_get_b(NULL,"CList","PlaceOfflineToRoot",SETTING_PLACEOFFLINETOROOT_DEFAULT);
KillTimer(hwnd,TIMERID_REBUILDAFTER);
-
+
ClearRowByIndexCache();
ImageArray_Clear(&dat->avatar_cache);
RowHeights_Clear(dat);
RowHeights_GetMaxRowHeight(dat, hwnd);
- TRACEVAR("Rebuild Entire List %d times\n",++rebuildCounter);
-
+ TRACEVAR("Rebuild Entire List %d times\n",++rebuildCounter);
+
dat->list.expanded = 1;
dat->list.hideOffline = db_get_b(NULL,"CLC","HideOfflineRoot",SETTING_HIDEOFFLINEATROOT_DEFAULT) && style&CLS_USEGROUPS;
dat->list.cl.count = dat->list.cl.limit = 0;
@@ -381,26 +363,22 @@ void cliRebuildEntireList(HWND hwnd,struct ClcData *dat) dat->selection = -1;
dat->HiLightMode = db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT);
{
- int i;
- TCHAR *szGroupName;
- DWORD groupFlags;
-
- for (i = 1;;i++) {
- szGroupName = pcli->pfnGetGroupName(i,&groupFlags); //UNICODE
- if (szGroupName == NULL) break;
+ for (int i = 1;;i++) {
+ DWORD groupFlags;
+ TCHAR *szGroupName = pcli->pfnGetGroupName(i,&groupFlags); //UNICODE
+ if (szGroupName == NULL)
+ break;
cli_AddGroup(hwnd,dat,szGroupName,groupFlags,i,0);
}
}
hContact = db_find_first();
- while(hContact)
- {
+ while(hContact) {
pdisplayNameCacheEntry cacheEntry = NULL;
- int nHiddenStatus;
cont = NULL;
cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
- nHiddenStatus = CLVM_GetContactHiddenStatus(hContact, NULL, dat);
+ int nHiddenStatus = CLVM_GetContactHiddenStatus(hContact, NULL, dat);
if ((style&CLS_SHOWHIDDEN && nHiddenStatus != -1) || !nHiddenStatus)
{
@@ -464,7 +442,6 @@ void cliRebuildEntireList(HWND hwnd,struct ClcData *dat) pcli->pfnSortCLC(hwnd,dat,0);
RestoreSelection( dat, hSelected );
-
}
void cli_SortCLC( HWND hwnd, struct ClcData *dat, int useInsertionSort )
@@ -476,7 +453,7 @@ void cli_SortCLC( HWND hwnd, struct ClcData *dat, int useInsertionSort ) RestoreSelection( dat, hSelected );
}
-int GetNewSelection(struct ClcGroup *group, int selection, int direction)
+int GetNewSelection(ClcGroup *group, int selection, int direction)
{
int lastcount = 0, count = 0;//group->cl.count;
if (selection < 0) {
@@ -519,7 +496,7 @@ struct SavedGroupState_t { struct SavedInfoState_t {
int parentId;
- struct ClcContact contact;
+ ClcContact contact;
};
BOOL LOCK_RECALC_SCROLLBAR = FALSE;
@@ -533,8 +510,8 @@ void cli_SaveStateAndRebuildList(HWND hwnd, struct ClcData *dat) OBJLIST<SavedContactState_t> savedContact( 4 );
OBJLIST<SavedInfoState_t> savedInfo( 4 );
- struct ClcGroup *group;
- struct ClcContact *contact;
+ ClcGroup *group;
+ ClcContact *contact;
pcli->pfnHideInfoTip(hwnd, dat);
KillTimer(hwnd, TIMERID_INFOTIP);
@@ -669,9 +646,10 @@ void pdnce___SetStatus( pdisplayNameCacheEntry pdnce, WORD wStatus ) {
if (pdnce) pdnce->m_cache_nStatus = wStatus;
}
-struct ClcContact* cliCreateClcContact( void )
+
+ClcContact* cliCreateClcContact()
{
- struct ClcContact* contact = (struct ClcContact*)mir_calloc(sizeof( struct ClcContact ));
+ ClcContact* contact = (ClcContact*)mir_calloc(sizeof( ClcContact ));
memset((void*)contact->iWideExtraImage,0xFF,sizeof(contact->iWideExtraImage));
return contact;
}
@@ -679,21 +657,19 @@ struct ClcContact* cliCreateClcContact( void ) ClcCacheEntryBase* cliCreateCacheItem( HANDLE hContact )
{
pdisplayNameCacheEntry p = (pdisplayNameCacheEntry)mir_calloc(sizeof( displayNameCacheEntry ));
- if ( p )
- {
- memset(p,0,sizeof( displayNameCacheEntry ));
- p->hContact = hContact;
- InvalidateDNCEbyPointer(hContact,p,0);
- p->szSecondLineText = NULL;
- p->szThirdLineText = NULL;
- p->ssSecondLine.plText = NULL;
- p->ssThirdLine.plText = NULL;
- }
- return (ClcCacheEntryBase*)p;
+ if (p == NULL)
+ return NULL;
+
+ memset(p,0,sizeof( displayNameCacheEntry ));
+ p->hContact = hContact;
+ InvalidateDNCEbyPointer(hContact,p,0);
+ p->szSecondLineText = NULL;
+ p->szThirdLineText = NULL;
+ p->ssSecondLine.plText = NULL;
+ p->ssThirdLine.plText = NULL;
+ return p;
}
-
-
void cliInvalidateDisplayNameCacheEntry(HANDLE hContact)
{
pdisplayNameCacheEntry p;
@@ -702,7 +678,7 @@ void cliInvalidateDisplayNameCacheEntry(HANDLE hContact) return;
}
-char* cli_GetGroupCountsText(struct ClcData *dat, struct ClcContact *contact)
+char* cli_GetGroupCountsText(struct ClcData *dat, ClcContact *contact)
{
char * res;
@@ -711,10 +687,10 @@ char* cli_GetGroupCountsText(struct ClcData *dat, struct ClcContact *contact) return res;
}
-int cliGetGroupContentsCount(struct ClcGroup *group, int visibleOnly)
+int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly)
{
int count = group->cl.count;
- struct ClcGroup *topgroup = group;
+ ClcGroup *topgroup = group;
group->scanIndex = 0;
for (;;) {
@@ -729,12 +705,12 @@ int cliGetGroupContentsCount(struct ClcGroup *group, int visibleOnly) count += group->cl.count;
continue;
}
- else if ((group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) &&
- (group->cl.items[group->scanIndex]->subcontacts != NULL) &&
- ((group->cl.items[group->scanIndex]->SubExpanded || (!visibleOnly))))
- {
- count += group->cl.items[group->scanIndex]->SubAllocated;
- }
+ else if ((group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) &&
+ (group->cl.items[group->scanIndex]->subcontacts != NULL) &&
+ ((group->cl.items[group->scanIndex]->SubExpanded || (!visibleOnly))))
+ {
+ count += group->cl.items[group->scanIndex]->SubAllocated;
+ }
group->scanIndex++;
}
return count;
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index cef111c793..5b3a3aafde 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -184,7 +184,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA return 0;
case CLM_SELECTITEM:
{
- struct ClcGroup *tgroup;
+ ClcGroup *tgroup;
int index = -1;
int mainindex = -1;
if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
@@ -208,7 +208,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA if (k) {
for (int i=0; i < mainindex; i++)
{
- struct ClcContact *tempCont = group->cl.items[i];
+ ClcContact *tempCont = group->cl.items[i];
if (tempCont->type == CLCIT_CONTACT && tempCont->SubAllocated && tempCont->SubExpanded)
index += tempCont->SubAllocated;
}
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index ad023adf50..cc567908cd 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -151,7 +151,7 @@ HFONT CLCPaint::ChangeToFont( HDC hdc, struct ClcData *dat, int id, int *fontHei return res;
}
-int CLCPaint::GetBasicFontID( struct ClcContact * contact )
+int CLCPaint::GetBasicFontID( ClcContact * contact )
{
PDNCE pdnce = NULL;
if ( contact->type == CLCIT_CONTACT )
@@ -388,7 +388,7 @@ int CLCPaint::_GetGeneralisedStatus() return status;
}
-int CLCPaint::_GetRealStatus( struct ClcContact * pContact, int nStatus )
+int CLCPaint::_GetRealStatus( ClcContact * pContact, int nStatus )
{
if ( !pContact->proto )
return nStatus;
@@ -577,7 +577,7 @@ void CLCPaint::_AddParamShort( MODERNMASK * mpModernMask, DWORD dwParamIndex, D }
-MODERNMASK * CLCPaint::_GetCLCContactRowBackModernMask( struct ClcGroup * group, struct ClcContact * Drawing, int indent, int index, BOOL selected, BOOL hottrack, struct ClcData * dat )
+MODERNMASK * CLCPaint::_GetCLCContactRowBackModernMask( ClcGroup * group, ClcContact * Drawing, int indent, int index, BOOL selected, BOOL hottrack, struct ClcData * dat )
{
MODERNMASK * mpModernMask = NULL;
char buf[BUF2SIZE] = {0};
@@ -596,7 +596,7 @@ MODERNMASK * CLCPaint::_GetCLCContactRowBackModernMask( struct ClcGroup * group, break;
case CLCIT_CONTACT:
{
- struct ClcContact * mCont = Drawing;
+ ClcContact * mCont = Drawing;
if ( Drawing->isSubcontact )
{
_AddParamShort( mpModernMask, hi_Type, hi_SubContact );
@@ -710,7 +710,7 @@ void CLCPaint::_RTLRect( RECT *rect, int width, int offset ) return;
}
-void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint )
+void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint )
{
int i=0;
int dx = free_row_rc.left;
@@ -1694,7 +1694,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str -void CLCPaint::_DrawStatusIcon( struct ClcContact * Drawing, struct ClcData *dat, int iImage, HDC hdcMem, int x, int y, int cx, int cy, DWORD colorbg, DWORD colorfg, int mode )
+void CLCPaint::_DrawStatusIcon( ClcContact * Drawing, struct ClcData *dat, int iImage, HDC hdcMem, int x, int y, int cx, int cy, DWORD colorbg, DWORD colorfg, int mode )
{
if ( Drawing->type != CLCIT_CONTACT )
{
@@ -1919,8 +1919,8 @@ void CLCPaint::_DrawBackground( HWND hWnd, struct ClcData * dat, HDC hdc, int pa void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc )
{
- struct ClcContact *Drawing;
- struct ClcGroup *group = &dat->list;
+ ClcContact *Drawing;
+ ClcGroup *group = &dat->list;
group->scanIndex = 0;
int indent = 0;
int subident = 0;
@@ -2302,7 +2302,7 @@ void CLCPaint::_PaintClc( HWND hwnd, struct ClcData *dat, HDC hdc, RECT *_rcPain }
-void CLCPaint::_StoreItemPos( struct ClcContact *contact, int ItemType, RECT * rc )
+void CLCPaint::_StoreItemPos( ClcContact *contact, int ItemType, RECT * rc )
{
contact->ext_mpItemsDesc[contact->ext_nItemsNum].itemType = ItemType;
contact->ext_mpItemsDesc[contact->ext_nItemsNum].itemRect = *rc;
@@ -2335,7 +2335,7 @@ void CLCPaint::_StoreItemPos( struct ClcContact *contact, int ItemType, RECT * r }
-void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT *in_row_rc, RECT *in_free_row_rc, int left_pos, int right_pos, int selected, int hottrack )
+void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *in_row_rc, RECT *in_free_row_rc, int left_pos, int right_pos, int selected, int hottrack )
{
int item_iterator, item, item_text, text_left_pos;
BOOL left = TRUE; //TODO remove
@@ -2957,7 +2957,7 @@ BOOL CLCPaint::__IsVisible( RECT * firtRect, RECT * secondRect ) }
-void CLCPaint::_GetBlendMode( IN struct ClcData *dat, IN struct ClcContact * Drawing, IN BOOL selected, IN BOOL hottrack, IN BOOL bFlag, OUT COLORREF * OutColourFg, OUT int * OutMode )
+void CLCPaint::_GetBlendMode( IN struct ClcData *dat, IN ClcContact * Drawing, IN BOOL selected, IN BOOL hottrack, IN BOOL bFlag, OUT COLORREF * OutColourFg, OUT int * OutMode )
{
COLORREF colourFg;
int mode;
@@ -2999,7 +2999,7 @@ void CLCPaint::_GetBlendMode( IN struct ClcData *dat, IN struct ClcContact * Dra }
}
-void CLCPaint::_DrawContactAvatar( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem )
+void CLCPaint::_DrawContactAvatar( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem )
{
if ( Drawing->avatar_pos == AVATAR_POS_ANIMATED )
{
@@ -3122,7 +3122,7 @@ void CLCPaint::_DrawContactAvatar( HDC hdcMem, struct ClcData *dat, struct ClcCo }
}
-void CLCPaint::_DrawContactIcon( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem )
+void CLCPaint::_DrawContactIcon( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem )
{
//Draw Icon
int iImage = -1;
@@ -3147,7 +3147,7 @@ void CLCPaint::_DrawContactIcon( HDC hdcMem, struct ClcData *dat, struct ClcCont }
}
-void CLCPaint::_DrawContactText( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat )
+void CLCPaint::_DrawContactText( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat )
{
ChangeToFont( hdcMem, dat, GetBasicFontID( Drawing ), NULL );
if ( selected )
@@ -3192,7 +3192,7 @@ void CLCPaint::_DrawContactText( HDC hdcMem, struct ClcData *dat, struct ClcCont text_rc.right = max( text_rc.right, prcItem->right );
text_rc.left = min( text_rc.left, prcItem->left );
}
-void CLCPaint::_DrawContactSubText( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat, BYTE itemType )
+void CLCPaint::_DrawContactSubText( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat, BYTE itemType )
{
if ( Drawing->type == CLCIT_GROUP )
{
@@ -3232,7 +3232,7 @@ void CLCPaint::_DrawContactSubText( HDC hdcMem, struct ClcData *dat, struct ClcC text_rc.right = max( text_rc.right, prcItem->right );
text_rc.left = min( text_rc.left, prcItem->left );
}
-void CLCPaint::_DrawContactTime( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem )
+void CLCPaint::_DrawContactTime( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem )
{
TCHAR szResult[80];
PDNCE pdnce = ( PDNCE )(( Drawing->type == CLCIT_CONTACT )?pcli->pfnGetCacheEntry( Drawing->hContact ):NULL );
@@ -3247,7 +3247,7 @@ void CLCPaint::_DrawContactTime( HDC hdcMem, struct ClcData *dat, struct ClcCont }
}
-void CLCPaint::_DrawContactSelection( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT *rcPaint, RECT * prcItem )
+void CLCPaint::_DrawContactSelection( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rcPaint, RECT * prcItem )
{
// Selection background
if (( selected || hottrack ) && dat->HiLightMode == 0) {
@@ -3258,7 +3258,7 @@ void CLCPaint::_DrawContactSelection( HDC hdcMem, struct ClcData *dat, struct Cl }
}
-void CLCPaint::_DrawContactExtraIcon( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * rc, int iImage )
+void CLCPaint::_DrawContactExtraIcon( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * rc, int iImage )
{
//Draw extra icon
COLORREF colourFg;
@@ -3275,7 +3275,7 @@ void CLCPaint::_DrawContactExtraIcon( HDC hdcMem, struct ClcData *dat, struct Cl }
}
-void CLCPaint::_DrawContactLine( HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT *free_row_rc, RECT *rcPaint, RECT& text_rc )
+void CLCPaint::_DrawContactLine( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *free_row_rc, RECT *rcPaint, RECT& text_rc )
{ //draw line
RECT rc1 = *free_row_rc;
RECT rc2 = *free_row_rc;
@@ -3314,7 +3314,7 @@ void CLCPaint::_DrawContactLine( HDC hdcMem, struct ClcData *dat, struct ClcCont }
}
-void CLCPaint::_DrawContactItems( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT *row_rc, RECT *free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint )
+void CLCPaint::_DrawContactItems( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *row_rc, RECT *free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint )
{
int i;
RECT text_rc = {0};
@@ -3372,7 +3372,7 @@ void CLCPaint::_DrawContactItems( HWND hwnd, HDC hdcMem, struct ClcData *dat, st || ( Drawing->type == CLCIT_DIVIDER ))
_DrawContactLine( hdcMem, dat, Drawing, free_row_rc, rcPaint, text_rc );
}
-void CLCPaint::_PaintRowItems ( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint )
+void CLCPaint::_PaintRowItems ( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint )
{
//Extended LAYOUT
if ( gl_RowRoot && ( dat->hWnd == pcli->hwndContactTree ))
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index ef1c374536..955cf7e5f7 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -33,10 +33,10 @@ BOOL RectHitTest(RECT *rc, int testx, int testy) return testx >= rc->left && testx < rc->right && testy >= rc->top && testy < rc->bottom;
}
-int cliHitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact **contact,struct ClcGroup **group,DWORD *flags)
+int cliHitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,ClcContact **contact,ClcGroup **group,DWORD *flags)
{
- struct ClcContact *hitcontact = NULL;
- struct ClcGroup *hitgroup = NULL;
+ ClcContact *hitcontact = NULL;
+ ClcGroup *hitgroup = NULL;
int hit = -1;
RECT clRect;
if (CLUI_TestCursorOnBorders() != 0)
@@ -268,8 +268,8 @@ static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPara void cliBeginRenameSelection(HWND hwnd,struct ClcData *dat)
{
- struct ClcContact *contact;
- struct ClcGroup *group;
+ ClcContact *contact;
+ ClcGroup *group;
int indent,x,y,subident, h,w;
RECT clRect;
RECT r;
@@ -358,8 +358,8 @@ int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt) {
RECT clRect;
int hit;
- struct ClcContact *contact = NULL,*movecontact = NULL;
- struct ClcGroup *group,*movegroup;
+ ClcContact *contact = NULL,*movecontact = NULL;
+ ClcGroup *group,*movegroup;
DWORD hitFlags;
int nSetSelection = -1;
@@ -375,8 +375,8 @@ int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt) if (hit == -1 || hitFlags&CLCHT_ONITEMEXTRA || !movecontact) return DROPTARGET_ONNOTHING;
if (movecontact->type == CLCIT_GROUP) {
- struct ClcContact *bottomcontact = NULL,*topcontact = NULL;
- struct ClcGroup *topgroup = NULL, *bottomgroup = NULL;
+ ClcContact *bottomcontact = NULL,*topcontact = NULL;
+ ClcGroup *topgroup = NULL, *bottomgroup = NULL;
int topItem = -1,bottomItem = -1;
int ok = 0;
if (pt.y+dat->yScroll < cliGetRowTopY(dat,hit)+dat->insertionMarkHitHeight || contact->type != CLCIT_GROUP) {
@@ -413,7 +413,7 @@ int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt) }
if (bottomItem != -1 && bottomcontact->type != CLCIT_GROUP)
{
- struct ClcGroup * gr = bottomgroup;
+ ClcGroup * gr = bottomgroup;
do
{
bottomItem = cliGetRowByIndex(dat,bottomItem-1,&bottomcontact,&bottomgroup);}
@@ -790,9 +790,9 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) }
-int ExpandMetaContact(HWND hwnd, struct ClcContact * contact, struct ClcData * dat, BOOL bExpand)
+int ExpandMetaContact(HWND hwnd, ClcContact * contact, struct ClcData * dat, BOOL bExpand)
{
- struct ClcContact * ht = NULL;
+ ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
if (contact->type != CLCIT_CONTACT || contact->SubAllocated == 0 || contact->SubExpanded == bExpand || !db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT)) return 0;
contact->SubExpanded = bExpand;
@@ -805,9 +805,9 @@ int ExpandMetaContact(HWND hwnd, struct ClcContact * contact, struct ClcData * d int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk)
{
- struct ClcGroup *group = &dat->list;
+ ClcGroup *group = &dat->list;
int testlen = lstrlen(text);
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
int SubCount = 0;
group->scanIndex = 0;
@@ -831,7 +831,7 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref found = (prefixOk && !_tcsnicmp(text, contact->szText, testlen)) || (!prefixOk && !lstrcmpi(text, contact->szText));
}
if (found) {
- struct ClcGroup *contactGroup = group;
+ ClcGroup *contactGroup = group;
int contactScanIndex = group->scanIndex;
for (; group; group = group->parent)
pcli->pfnSetGroupExpand(hwnd, dat, group, 1);
@@ -854,7 +854,7 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref int i=0;
for (i=0; i < contact->SubAllocated; i++)
{
- struct ClcContact * subcontact = &(contact->subcontacts[i]);
+ ClcContact * subcontact = &(contact->subcontacts[i]);
bool found;
if (dat->filterSearch) {
@@ -865,7 +865,7 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref found = (prefixOk && !_tcsnicmp(text, subcontact->szText, testlen)) || (!prefixOk && !lstrcmpi(text, subcontact->szText));
}
if (found) {
- struct ClcGroup *contactGroup = group;
+ ClcGroup *contactGroup = group;
int contactScanIndex = group->scanIndex;
for (; group; group = group->parent)
pcli->pfnSetGroupExpand(hwnd, dat, group, 1);
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index 7b1ba95544..e1cc237e36 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -94,7 +94,7 @@ int GetProtoIndex(char * szName) return -1;
}
-int CompareContacts2(const struct ClcContact *contact1,const struct ClcContact *contact2, int by)
+int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int by)
{
HANDLE a;
@@ -159,7 +159,7 @@ int CompareContacts2(const struct ClcContact *contact1,const struct ClcContact * return 0;
}
-int cliCompareContacts(const struct ClcContact *contact1,const struct ClcContact *contact2)
+int cliCompareContacts(const ClcContact *contact1,const ClcContact *contact2)
{
int i, r;
for (i=0; i < SIZEOF(g_CluiData.bSortByOrder); i++)
diff --git a/plugins/Clist_modern/src/modern_gettextasync.cpp b/plugins/Clist_modern/src/modern_gettextasync.cpp index 0e01838ae4..d0ba4061cb 100644 --- a/plugins/Clist_modern/src/modern_gettextasync.cpp +++ b/plugins/Clist_modern/src/modern_gettextasync.cpp @@ -152,7 +152,7 @@ BOOL gtaWakeThread() return FALSE;
}
-int gtaAddRequest(struct ClcData *dat,struct ClcContact *contact,HANDLE hContact)
+int gtaAddRequest(struct ClcData *dat,ClcContact *contact,HANDLE hContact)
{
if (MirandaExiting()) return 0;
gtalock;
diff --git a/plugins/Clist_modern/src/modern_groupmenu.cpp b/plugins/Clist_modern/src/modern_groupmenu.cpp index 33c93a10a6..2abef3c387 100644 --- a/plugins/Clist_modern/src/modern_groupmenu.cpp +++ b/plugins/Clist_modern/src/modern_groupmenu.cpp @@ -476,7 +476,7 @@ static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam) BOOL showOfflineinGroup = FALSE;
- struct ClcGroup *group = (struct ClcGroup *)wParam;
+ ClcGroup *group = (ClcGroup *)wParam;
if (wParam == 0) return 0;
if (MirandaExiting()) return 0;
@@ -518,7 +518,7 @@ INT_PTR BuildSubGroupMenu(WPARAM wParam,LPARAM lParam) return (INT_PTR)hMenu;
}
-HMENU cliBuildGroupPopupMenu(struct ClcGroup *group)
+HMENU cliBuildGroupPopupMenu(ClcGroup *group)
{
//HWND wnd = GetForegroundWindow();
return (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP,(WPARAM)group,0);
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index 0737505c86..7005e38d88 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -30,9 +30,9 @@ Created by Pescuma, modified by Artem Shpynov #include "hdr/modern_clcpaint.h"
int g_mutex_nCalcRowHeightLock = 0;
-int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item);
+int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, ClcContact *contact, int item);
void RowHeights_CalcRowHeights_Worker(struct ClcData *dat, HWND hwnd);
-int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item);
+int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, ClcContact *contact, int item);
/*
*
@@ -57,466 +57,410 @@ SIZE GetAvatarSize(int imageWidth, int imageHeight, int maxWidth, int maxHeight) {
float scalefactor = 0;
SIZE sz = {0};
- if (imageWidth == 0 || imageHeight == 0) return sz;
- if (maxWidth == 0) maxWidth = maxHeight;
+ if (imageWidth == 0 || imageHeight == 0)
+ return sz;
+
+ if (maxWidth == 0)
+ maxWidth = maxHeight;
scalefactor = min((float)maxWidth/imageWidth,(float)maxHeight/imageHeight);
sz.cx = (LONG)(imageWidth*scalefactor);
sz.cy = (LONG)(imageHeight*scalefactor);
return sz;
}
-int RowHeight_CalcRowHeight(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item)
+int RowHeight_CalcRowHeight(struct ClcData *dat, HWND hwnd, ClcContact *contact, int item)
{
- int res;
- if (MirandaExiting()) return 0;
- g_mutex_nCalcRowHeightLock++;
- res = mod_CalcRowHeight_worker(dat,hwnd,contact,item);
- g_mutex_nCalcRowHeightLock--;
- return res;
+ if (MirandaExiting()) return 0;
+ g_mutex_nCalcRowHeightLock++;
+ int res = mod_CalcRowHeight_worker(dat,hwnd,contact,item);
+ g_mutex_nCalcRowHeightLock--;
+ return res;
}
-int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item)
+
+int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, ClcContact *contact, int item)
{
- BYTE i=0;
- int res = 0;
- int height = 0;
- displayNameCacheEntry * pdnce;
- BOOL hasAvatar = FALSE;
- DWORD style;
- style = GetWindowLongPtr(hwnd,GWL_STYLE);
- pdnce = (displayNameCacheEntry*)pcli->pfnGetCacheEntry(contact->hContact);
- if ( !RowHeights_Alloc(dat, item + 1))
- return -1;
- if ( !pcli->hwndContactTree) return 0;
- //if ( !gl_RowRoot) RowHeight_InitModernRow();
- if (dat->hWnd != pcli->hwndContactTree || !gl_RowRoot || contact->type == CLCIT_GROUP)
- {
- int tmp = 0;
- tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
- if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
- tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
- if (contact->type == CLCIT_GROUP)
- {
- char * szCounts = pcli->pfnGetGroupCountsText(dat, contact);
- // Has the count?
- if (szCounts && szCounts[0])
- tmp = max(tmp,dat->fontModernInfo[contact->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS].fontHeight);
- }
- tmp = max(tmp, ICON_HEIGHT);
- tmp = max(tmp,dat->row_min_heigh);
- tmp += dat->row_border*2;
- if (contact->type == CLCIT_GROUP &&
- contact->group->parent->groupId == 0 &&
- contact->group->parent->cl.items[0] != contact)
- tmp += dat->row_before_group_space;
- if (item != -1) dat->row_heights[item] = tmp;
- return tmp;
- }
- hasAvatar = (dat->use_avatar_service && contact->avatar_data != NULL) || (!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE);
- while (gl_RowTabAccess[i] != NULL)
- {
- if (gl_RowTabAccess[i]->type != TC_SPACE)
- {
- gl_RowTabAccess[i]->h = 0;
- gl_RowTabAccess[i]->w = 0;
- SetRect(&(gl_RowTabAccess[i]->r),0,0,0,0);
- switch (gl_RowTabAccess[i]->type)
- {
- case TC_TEXT1:
- {
- int tmp = 0;
- tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
- if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
- tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
- if (item == -1)
- {
- //calculate text width here
- SIZE size = {0};
- RECT dummyRect = {0,0,1024,tmp};
- HDC hdc = CreateCompatibleDC(NULL);
- g_clcPainter.ChangeToFont(hdc,dat,g_clcPainter.GetBasicFontID(contact),NULL);
- g_clcPainter.GetTextSize(&size,hdc,dummyRect,contact->szText,contact->ssText.plText,0, dat->text_resize_smileys ? 0 : contact->ssText.iMaxSmileyHeight);
- if (contact->type == CLCIT_GROUP)
- {
- char * szCounts = pcli->pfnGetGroupCountsText(dat, contact);
- if (szCounts && strlen(szCounts)>0)
- {
- RECT count_rc = {0};
- // calc width and height
- g_clcPainter.ChangeToFont(hdc,dat,contact->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS,NULL);
- ske_DrawText(hdc,_T(" "),1,&count_rc,DT_CALCRECT | DT_NOPREFIX);
- size.cx += count_rc.right-count_rc.left;
- count_rc.right = 0;
- count_rc.left = 0;
- ske_DrawTextA(hdc,szCounts,lstrlenA(szCounts),&count_rc,DT_CALCRECT);
- size.cx += count_rc.right-count_rc.left;
- tmp = max(tmp,count_rc.bottom-count_rc.top);
- }
- }
- gl_RowTabAccess[i]->w = size.cx;
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
- ske_ResetTextEffect(hdc);
- mod_DeleteDC(hdc);
- }
- gl_RowTabAccess[i]->h = tmp;
-
- break;
- }
- case TC_TEXT2:
- {
- int tmp = 0;
- HANDLE hContact = pdnce->hContact;
- if (dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0] )
- {
- tmp = dat->fontModernInfo[FONTID_SECONDLINE].fontHeight;
- if (dat->text_replace_smileys && dat->second_line_draw_smileys && !dat->text_resize_smileys)
- tmp = max(tmp, pdnce->ssSecondLine.iMaxSmileyHeight);
- if (item == -1)
- {
- //calculate text width here
-
- SIZE size = {0};
- RECT dummyRect = {0,0,1024,tmp};
- HDC hdc = CreateCompatibleDC(NULL);
- g_clcPainter.ChangeToFont(hdc,dat,FONTID_SECONDLINE,NULL);
- g_clcPainter.GetTextSize(&size,hdc,dummyRect,pdnce->szSecondLineText,pdnce->ssSecondLine.plText,0, dat->text_resize_smileys ? 0 : pdnce->ssSecondLine.iMaxSmileyHeight);
- gl_RowTabAccess[i]->w = size.cx;
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
- ske_ResetTextEffect(hdc);
- mod_DeleteDC(hdc);
- }
- }
- gl_RowTabAccess[i]->h = tmp;
- break;
- }
- case TC_TEXT3:
- {
- int tmp = 0;
- HANDLE hContact = pdnce->hContact;
- if (dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0])
- {
- tmp = dat->fontModernInfo[FONTID_THIRDLINE].fontHeight;
- if (dat->text_replace_smileys && dat->third_line_draw_smileys && !dat->text_resize_smileys)
- tmp = max(tmp, pdnce->ssThirdLine.iMaxSmileyHeight);
- if (item == -1)
- {
- //calculate text width here
- SIZE size = {0};
- RECT dummyRect = {0,0,1024,tmp};
- HDC hdc = CreateCompatibleDC(NULL);
- g_clcPainter.ChangeToFont(hdc,dat,FONTID_THIRDLINE,NULL);
- g_clcPainter.GetTextSize(&size,hdc,dummyRect,pdnce->szThirdLineText,pdnce->ssThirdLine.plText,0, dat->text_resize_smileys ? 0 : pdnce->ssThirdLine.iMaxSmileyHeight);
- gl_RowTabAccess[i]->w = size.cx;
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
- ske_ResetTextEffect(hdc);
- mod_DeleteDC(hdc);
- }
- }
- gl_RowTabAccess[i]->h = tmp;
- break;
- }
- case TC_STATUS:
- {
- if (
- (contact->type == CLCIT_GROUP && !dat->row_hide_group_icon) ||
- ( contact->type == CLCIT_CONTACT && contact->iImage != -1 &&
- !(dat->icon_hide_on_avatar && dat->avatars_show && (hasAvatar || (!hasAvatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)) && !contact->image_is_special))
- )
- {
- gl_RowTabAccess[i]->h = ICON_HEIGHT;
- gl_RowTabAccess[i]->w = ICON_HEIGHT;
- }
- break;
- }
- case TC_AVATAR:
- {
- if (dat->avatars_show &&
- contact->type == CLCIT_CONTACT &&
- (hasAvatar || (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && contact->iImage != -1) )
- )
- {
- SIZE sz = {0};
- int iW = 0, iH = 0;
- if (dat->use_avatar_service)
- {
- if (contact->avatar_data)
- {
- iH = contact->avatar_data->bmHeight;
- iW = contact->avatar_data->bmWidth;
- }
- }
- else if (dat->avatar_cache.nodes)
- {
- iW = dat->avatar_cache.nodes[contact->avatar_pos].width;
- iH = dat->avatar_cache.nodes[contact->avatar_pos].height;
- }
- sz = GetAvatarSize(iW,iH,dat->avatars_maxwidth_size,dat->avatars_maxheight_size);
- if ((sz.cx == 0 || sz.cy == 0) && dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)
- { sz.cx = ICON_HEIGHT; sz.cy = ICON_HEIGHT; }
-
- gl_RowTabAccess[i]->h = sz.cy;
- gl_RowTabAccess[i]->w = sz.cx;
- }
-
- break;
- }
- case TC_EXTRA:
- {
- // Draw extra icons
-
- if (contact->type == CLCIT_CONTACT &&
- (!contact->isSubcontact || db_get_b(NULL,"CLC","MetaHideExtra",SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0))
- {
- BOOL hasExtra = FALSE;
- int k;
- int width = 0;
- for (k = 0; k < dat->extraColumnsCount; k++)
- if (contact->iExtraImage[k] != 0xFF || contact->iWideExtraImage[k] != 0xFFFF || !dat->MetaIgnoreEmptyExtra)
- {
- hasExtra = TRUE;
- if (item != -1) break;
- width += (width>0)?dat->extraColumnSpacing:(dat->extraColumnSpacing-2);
- }
- if (hasExtra)
- {
- gl_RowTabAccess[i]->h = ICON_HEIGHT;
- gl_RowTabAccess[i]->w = width;
- }
- }
- break;
- }
- case TC_EXTRA1:
- case TC_EXTRA2:
- case TC_EXTRA3:
- case TC_EXTRA4:
- case TC_EXTRA5:
- case TC_EXTRA6:
- case TC_EXTRA7:
- case TC_EXTRA8:
- case TC_EXTRA9:
- {
- if (contact->type == CLCIT_CONTACT &&
- (!contact->isSubcontact || db_get_b(NULL,"CLC","MetaHideExtra",SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0))
- {
- int eNum = gl_RowTabAccess[i]->type-TC_EXTRA1;
- if (eNum < dat->extraColumnsCount)
- if (contact->iExtraImage[eNum] != 255 || contact->iWideExtraImage[eNum] != 0xFFFF || !dat->MetaIgnoreEmptyExtra)
+ BYTE i=0;
+ int res = 0;
+ int height = 0;
+ displayNameCacheEntry * pdnce;
+ BOOL hasAvatar = FALSE;
+ DWORD style;
+ style = GetWindowLongPtr(hwnd,GWL_STYLE);
+ pdnce = (displayNameCacheEntry*)pcli->pfnGetCacheEntry(contact->hContact);
+ if ( !RowHeights_Alloc(dat, item + 1))
+ return -1;
+
+ if ( !pcli->hwndContactTree)
+ return 0;
+
+ if (dat->hWnd != pcli->hwndContactTree || !gl_RowRoot || contact->type == CLCIT_GROUP) {
+ int tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
+ if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
+ tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
+ if (contact->type == CLCIT_GROUP) {
+ char *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
+ // Has the count?
+ if (szCounts && szCounts[0])
+ tmp = max(tmp,dat->fontModernInfo[contact->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS].fontHeight);
+ }
+ tmp = max(tmp, ICON_HEIGHT);
+ tmp = max(tmp,dat->row_min_heigh);
+ tmp += dat->row_border*2;
+ if (contact->type == CLCIT_GROUP &&
+ contact->group->parent->groupId == 0 &&
+ contact->group->parent->cl.items[0] != contact)
+ tmp += dat->row_before_group_space;
+ if (item != -1) dat->row_heights[item] = tmp;
+ return tmp;
+ }
+
+ hasAvatar = (dat->use_avatar_service && contact->avatar_data != NULL) || (!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE);
+ while (gl_RowTabAccess[i] != NULL) {
+ if (gl_RowTabAccess[i]->type != TC_SPACE) {
+ gl_RowTabAccess[i]->h = 0;
+ gl_RowTabAccess[i]->w = 0;
+ SetRect(&(gl_RowTabAccess[i]->r),0,0,0,0);
+ switch (gl_RowTabAccess[i]->type) {
+ case TC_TEXT1:
+ {
+ int tmp = 0;
+ tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
+ if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
+ tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
+ if (item == -1)
+ {
+ //calculate text width here
+ SIZE size = {0};
+ RECT dummyRect = {0,0,1024,tmp};
+ HDC hdc = CreateCompatibleDC(NULL);
+ g_clcPainter.ChangeToFont(hdc,dat,g_clcPainter.GetBasicFontID(contact),NULL);
+ g_clcPainter.GetTextSize(&size,hdc,dummyRect,contact->szText,contact->ssText.plText,0, dat->text_resize_smileys ? 0 : contact->ssText.iMaxSmileyHeight);
+ if (contact->type == CLCIT_GROUP)
+ {
+ char * szCounts = pcli->pfnGetGroupCountsText(dat, contact);
+ if (szCounts && strlen(szCounts)>0)
+ {
+ RECT count_rc = {0};
+ // calc width and height
+ g_clcPainter.ChangeToFont(hdc,dat,contact->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS,NULL);
+ ske_DrawText(hdc,_T(" "),1,&count_rc,DT_CALCRECT | DT_NOPREFIX);
+ size.cx += count_rc.right-count_rc.left;
+ count_rc.right = 0;
+ count_rc.left = 0;
+ ske_DrawTextA(hdc,szCounts,lstrlenA(szCounts),&count_rc,DT_CALCRECT);
+ size.cx += count_rc.right-count_rc.left;
+ tmp = max(tmp,count_rc.bottom-count_rc.top);
+ }
+ }
+ gl_RowTabAccess[i]->w = size.cx;
+ SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
+ ske_ResetTextEffect(hdc);
+ mod_DeleteDC(hdc);
+ }
+ gl_RowTabAccess[i]->h = tmp;
+ }
+ break;
+
+ case TC_TEXT2:
+ {
+ int tmp = 0;
+ HANDLE hContact = pdnce->hContact;
+ if (dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0] )
{
- gl_RowTabAccess[i]->h = ICON_HEIGHT;
- gl_RowTabAccess[i]->w = ICON_HEIGHT;
+ tmp = dat->fontModernInfo[FONTID_SECONDLINE].fontHeight;
+ if (dat->text_replace_smileys && dat->second_line_draw_smileys && !dat->text_resize_smileys)
+ tmp = max(tmp, pdnce->ssSecondLine.iMaxSmileyHeight);
+ if (item == -1)
+ {
+ //calculate text width here
+
+ SIZE size = {0};
+ RECT dummyRect = {0,0,1024,tmp};
+ HDC hdc = CreateCompatibleDC(NULL);
+ g_clcPainter.ChangeToFont(hdc,dat,FONTID_SECONDLINE,NULL);
+ g_clcPainter.GetTextSize(&size,hdc,dummyRect,pdnce->szSecondLineText,pdnce->ssSecondLine.plText,0, dat->text_resize_smileys ? 0 : pdnce->ssSecondLine.iMaxSmileyHeight);
+ gl_RowTabAccess[i]->w = size.cx;
+ SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
+ ske_ResetTextEffect(hdc);
+ mod_DeleteDC(hdc);
+ }
}
+ gl_RowTabAccess[i]->h = tmp;
+ }
+ break;
+
+ case TC_TEXT3:
+ {
+ HANDLE hContact = pdnce->hContact;
+ int tmp = 0;
+ if (dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0]) {
+ tmp = dat->fontModernInfo[FONTID_THIRDLINE].fontHeight;
+ if (dat->text_replace_smileys && dat->third_line_draw_smileys && !dat->text_resize_smileys)
+ tmp = max(tmp, pdnce->ssThirdLine.iMaxSmileyHeight);
+ if (item == -1) {
+ //calculate text width here
+ SIZE size = {0};
+ RECT dummyRect = {0,0,1024,tmp};
+ HDC hdc = CreateCompatibleDC(NULL);
+ g_clcPainter.ChangeToFont(hdc,dat,FONTID_THIRDLINE,NULL);
+ g_clcPainter.GetTextSize(&size,hdc,dummyRect,pdnce->szThirdLineText,pdnce->ssThirdLine.plText,0, dat->text_resize_smileys ? 0 : pdnce->ssThirdLine.iMaxSmileyHeight);
+ gl_RowTabAccess[i]->w = size.cx;
+ SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
+ ske_ResetTextEffect(hdc);
+ mod_DeleteDC(hdc);
+ }
+ }
+ gl_RowTabAccess[i]->h = tmp;
+ }
+ break;
+
+ case TC_STATUS:
+ if ((contact->type == CLCIT_GROUP && !dat->row_hide_group_icon) ||
+ (contact->type == CLCIT_CONTACT && contact->iImage != -1 &&
+ !(dat->icon_hide_on_avatar && dat->avatars_show && (hasAvatar || (!hasAvatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)) && !contact->image_is_special)))
+ {
+ gl_RowTabAccess[i]->h = ICON_HEIGHT;
+ gl_RowTabAccess[i]->w = ICON_HEIGHT;
+ }
+ break;
+
+ case TC_AVATAR:
+ if (dat->avatars_show &&
+ contact->type == CLCIT_CONTACT &&
+ (hasAvatar || (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)))
+ {
+ SIZE sz = {0};
+ int iW = 0, iH = 0;
+ if (dat->use_avatar_service) {
+ if (contact->avatar_data) {
+ iH = contact->avatar_data->bmHeight;
+ iW = contact->avatar_data->bmWidth;
+ }
+ }
+ else if (dat->avatar_cache.nodes) {
+ iW = dat->avatar_cache.nodes[contact->avatar_pos].width;
+ iH = dat->avatar_cache.nodes[contact->avatar_pos].height;
+ }
+ sz = GetAvatarSize(iW,iH,dat->avatars_maxwidth_size,dat->avatars_maxheight_size);
+ if ((sz.cx == 0 || sz.cy == 0) && dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)
+ sz.cx = ICON_HEIGHT, sz.cy = ICON_HEIGHT;
+
+ gl_RowTabAccess[i]->h = sz.cy;
+ gl_RowTabAccess[i]->w = sz.cx;
+ }
+ break;
+
+ case TC_EXTRA:
+ // Draw extra icons
+
+ if (contact->type == CLCIT_CONTACT &&
+ (!contact->isSubcontact || db_get_b(NULL,"CLC","MetaHideExtra",SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0))
+ {
+ BOOL hasExtra = FALSE;
+ int width = 0;
+ for (int k = 0; k < dat->extraColumnsCount; k++)
+ if (contact->iExtraImage[k] != 0xFF || contact->iWideExtraImage[k] != 0xFFFF || !dat->MetaIgnoreEmptyExtra) {
+ hasExtra = TRUE;
+ if (item != -1) break;
+ width += (width>0)?dat->extraColumnSpacing:(dat->extraColumnSpacing-2);
+ }
+ if (hasExtra) {
+ gl_RowTabAccess[i]->h = ICON_HEIGHT;
+ gl_RowTabAccess[i]->w = width;
+ }
+ }
+ break;
+
+ case TC_EXTRA1:
+ case TC_EXTRA2:
+ case TC_EXTRA3:
+ case TC_EXTRA4:
+ case TC_EXTRA5:
+ case TC_EXTRA6:
+ case TC_EXTRA7:
+ case TC_EXTRA8:
+ case TC_EXTRA9:
+ if (contact->type == CLCIT_CONTACT &&
+ (!contact->isSubcontact || db_get_b(NULL,"CLC","MetaHideExtra",SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0))
+ {
+ int eNum = gl_RowTabAccess[i]->type-TC_EXTRA1;
+ if (eNum < dat->extraColumnsCount)
+ if (contact->iExtraImage[eNum] != 255 || contact->iWideExtraImage[eNum] != 0xFFFF || !dat->MetaIgnoreEmptyExtra) {
+ gl_RowTabAccess[i]->h = ICON_HEIGHT;
+ gl_RowTabAccess[i]->w = ICON_HEIGHT;
+ }
+ }
+ break;
+
+ case TC_TIME:
+ if (contact->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone) {
+ gl_RowTabAccess[i]->h = dat->fontModernInfo[FONTID_CONTACT_TIME].fontHeight;
+ if (item == -1) {
+ TCHAR szResult[80];
+
+ if ( !tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) {
+ SIZE text_size = {0};
+ RECT rc = {0};
+ // Select font
+ HDC hdc = CreateCompatibleDC(NULL);
+ g_clcPainter.ChangeToFont(hdc,dat,FONTID_CONTACT_TIME,NULL);
+
+ // Get text size
+ text_size.cy = ske_DrawText(hdc, szResult, lstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
+ SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
+ ske_ResetTextEffect(hdc);
+ mod_DeleteDC(hdc);
+ text_size.cx = rc.right - rc.left;
+ gl_RowTabAccess[i]->w = text_size.cx;
+ }
+ }
+ }
+ break;
}
- break;
- }
- case TC_TIME:
- {
- if (contact->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone)
- {
- gl_RowTabAccess[i]->h = dat->fontModernInfo[FONTID_CONTACT_TIME].fontHeight;
- if (item == -1)
- {
- TCHAR szResult[80];
-
- if ( !tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
- {
- SIZE text_size = {0};
- RECT rc = {0};
- // Select font
- HDC hdc = CreateCompatibleDC(NULL);
- g_clcPainter.ChangeToFont(hdc,dat,FONTID_CONTACT_TIME,NULL);
-
- // Get text size
- text_size.cy = ske_DrawText(hdc, szResult, lstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
- ske_ResetTextEffect(hdc);
- mod_DeleteDC(hdc);
- text_size.cx = rc.right - rc.left;
- gl_RowTabAccess[i]->w = text_size.cx;
-
- }
- }
- }
- break;
- }
- }
- }
- i++;
- }
-
- height = cppCalculateRowHeight(gl_RowRoot);
- height += dat->row_border*2;
- height = max(height,dat->row_min_heigh);
- if (item != -1) dat->row_heights[item] = height;
- return height;
+ }
+ i++;
+ }
+
+ height = cppCalculateRowHeight(gl_RowRoot);
+ height += dat->row_border*2;
+ height = max(height,dat->row_min_heigh);
+ if (item != -1) dat->row_heights[item] = height;
+ return height;
}
-
-
-
/*
*
*/
-
-
-
BOOL RowHeights_Initialize(struct ClcData *dat)
{
- dat->rowHeight = 0;
- dat->row_heights_size = 0;
- dat->row_heights_allocated = 0;
- dat->row_heights = NULL;
+ dat->rowHeight = 0;
+ dat->row_heights_size = 0;
+ dat->row_heights_allocated = 0;
+ dat->row_heights = NULL;
- return TRUE;
+ return TRUE;
}
void RowHeights_Free(struct ClcData *dat)
{
- if (dat->row_heights != NULL)
- {
- free(dat->row_heights);
- dat->row_heights = NULL;
- }
-
- dat->row_heights_allocated = 0;
- dat->row_heights_size = 0;
+ if (dat->row_heights != NULL) {
+ free(dat->row_heights);
+ dat->row_heights = NULL;
+ }
+
+ dat->row_heights_allocated = 0;
+ dat->row_heights_size = 0;
}
void RowHeights_Clear(struct ClcData *dat)
{
- dat->row_heights_size = 0;
+ dat->row_heights_size = 0;
}
-
BOOL RowHeights_Alloc(struct ClcData *dat, int size)
{
- if (size > dat->row_heights_size)
- {
- if (size > dat->row_heights_allocated)
- {
- int size_grow = size;
-
- size_grow += 100 - (size_grow % 100);
-
- if (dat->row_heights != NULL)
- {
- int *tmp = (int *) realloc((void *)dat->row_heights, sizeof(int) * size_grow);
-
- if (tmp == NULL)
- {
- TRACE("Out of memory: realloc returned NULL (RowHeights_Alloc)");
- RowHeights_Free(dat);
- return FALSE;
- }
-
- dat->row_heights = tmp;
- memset(dat->row_heights+(dat->row_heights_allocated),0,sizeof(int) * (size_grow-dat->row_heights_allocated));
- }
- else
- {
- dat->row_heights = (int *) malloc(sizeof(int) * size_grow);
-
- if (dat->row_heights == NULL)
- {
- TRACE("Out of memory: alloc returned NULL (RowHeights_Alloc)");
- RowHeights_Free(dat);
- return FALSE;
- }
- memset(dat->row_heights,0,sizeof(int) * size_grow);
- }
-
- dat->row_heights_allocated = size_grow;
- }
-
- dat->row_heights_size = size;
- }
-
- return TRUE;
-}
+ if (size > dat->row_heights_size) {
+ if (size > dat->row_heights_allocated) {
+ int size_grow = size;
+
+ size_grow += 100 - (size_grow % 100);
+
+ if (dat->row_heights != NULL) {
+ int *tmp = (int *) realloc((void *)dat->row_heights, sizeof(int) * size_grow);
+ if (tmp == NULL) {
+ TRACE("Out of memory: realloc returned NULL (RowHeights_Alloc)");
+ RowHeights_Free(dat);
+ return FALSE;
+ }
+
+ dat->row_heights = tmp;
+ memset(dat->row_heights+(dat->row_heights_allocated),0,sizeof(int) * (size_grow-dat->row_heights_allocated));
+ }
+ else {
+ dat->row_heights = (int *) malloc(sizeof(int) * size_grow);
+ if (dat->row_heights == NULL) {
+ TRACE("Out of memory: alloc returned NULL (RowHeights_Alloc)");
+ RowHeights_Free(dat);
+ return FALSE;
+ }
+ memset(dat->row_heights,0,sizeof(int) * size_grow);
+ }
+ dat->row_heights_allocated = size_grow;
+ }
+ dat->row_heights_size = size;
+ }
+ return TRUE;
+}
// Calc and store max row height
+
+static int contact_fonts[] = {
+ FONTID_CONTACTS, FONTID_INVIS, FONTID_OFFLINE, FONTID_NOTONLIST, FONTID_OFFINVIS,
+ FONTID_AWAY,FONTID_DND, FONTID_NA, FONTID_OCCUPIED, FONTID_CHAT, FONTID_INVISIBLE,
+ FONTID_PHONE, FONTID_LUNCH };
+
+static int other_fonts[] = {FONTID_OPENGROUPS, FONTID_OPENGROUPCOUNTS,FONTID_CLOSEDGROUPS, FONTID_CLOSEDGROUPCOUNTS, FONTID_DIVIDERS, FONTID_CONTACT_TIME};
+
int RowHeights_GetMaxRowHeight(struct ClcData *dat, HWND hwnd)
{
- int max_height = 0, i, tmp;
- DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
-
- if ( !dat->text_ignore_size_for_row_height)
- {
- int contact_fonts[] = {FONTID_CONTACTS, FONTID_INVIS, FONTID_OFFLINE, FONTID_NOTONLIST, FONTID_OFFINVIS,
- FONTID_AWAY,FONTID_DND, FONTID_NA, FONTID_OCCUPIED, FONTID_CHAT, FONTID_INVISIBLE,
- FONTID_PHONE, FONTID_LUNCH};
- int other_fonts[] = {FONTID_OPENGROUPS, FONTID_OPENGROUPCOUNTS,FONTID_CLOSEDGROUPS, FONTID_CLOSEDGROUPCOUNTS, FONTID_DIVIDERS, FONTID_CONTACT_TIME};
-
- // Get contact font size
- tmp = 0;
- for (i=0 ; i < MAX_REGS(contact_fonts) ; i++)
- {
- if (tmp < dat->fontModernInfo[contact_fonts[i]].fontHeight)
- tmp = dat->fontModernInfo[contact_fonts[i]].fontHeight;
- }
- if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
- {
- tmp = max(tmp, dat->text_smiley_height);
- }
- max_height += tmp;
-
- if (dat->second_line_show)
- {
- tmp = dat->fontModernInfo[FONTID_SECONDLINE].fontHeight;
- if (dat->text_replace_smileys && dat->second_line_draw_smileys && !dat->text_resize_smileys)
- {
- tmp = max(tmp, dat->text_smiley_height);
- }
- max_height += dat->second_line_top_space + tmp;
- }
-
- if (dat->third_line_show)
- {
- tmp = dat->fontModernInfo[FONTID_THIRDLINE].fontHeight;
- if (dat->text_replace_smileys && dat->third_line_draw_smileys && !dat->text_resize_smileys)
- {
- tmp = max(tmp, dat->text_smiley_height);
- }
- max_height += dat->third_line_top_space + tmp;
- }
-
- // Get other font sizes
- for (i=0 ; i < MAX_REGS(other_fonts) ; i++)
- {
- if (max_height < dat->fontModernInfo[other_fonts[i]].fontHeight)
- max_height = dat->fontModernInfo[other_fonts[i]].fontHeight;
- }
- }
-
- // Avatar size
- if (dat->avatars_show && !dat->avatars_ignore_size_for_row_height)
- {
- max_height = max(max_height, dat->avatars_maxheight_size);
- }
-
- // Checkbox size
- if (style&CLS_CHECKBOXES || style&CLS_GROUPCHECKBOXES)
- {
- max_height = max(max_height, dat->checkboxSize);
- }
-
- // Icon size
- if ( !dat->icon_ignore_size_for_row_height)
- {
- max_height = max(max_height, ICON_HEIGHT);
- }
-
- max_height += 2 * dat->row_border;
-
- // Min size
- max_height = max(max_height, dat->row_min_heigh);
-
- dat->rowHeight = max_height;
-
- return max_height;
+ int max_height = 0, i, tmp;
+ DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
+
+ if ( !dat->text_ignore_size_for_row_height) {
+ // Get contact font size
+ tmp = 0;
+ for (i=0 ; i < MAX_REGS(contact_fonts) ; i++)
+ if (tmp < dat->fontModernInfo[contact_fonts[i]].fontHeight)
+ tmp = dat->fontModernInfo[contact_fonts[i]].fontHeight;
+
+ if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
+ tmp = max(tmp, dat->text_smiley_height);
+
+ max_height += tmp;
+
+ if (dat->second_line_show) {
+ tmp = dat->fontModernInfo[FONTID_SECONDLINE].fontHeight;
+ if (dat->text_replace_smileys && dat->second_line_draw_smileys && !dat->text_resize_smileys)
+ tmp = max(tmp, dat->text_smiley_height);
+ max_height += dat->second_line_top_space + tmp;
+ }
+
+ if (dat->third_line_show) {
+ tmp = dat->fontModernInfo[FONTID_THIRDLINE].fontHeight;
+ if (dat->text_replace_smileys && dat->third_line_draw_smileys && !dat->text_resize_smileys)
+ tmp = max(tmp, dat->text_smiley_height);
+ max_height += dat->third_line_top_space + tmp;
+ }
+
+ // Get other font sizes
+ for (i=0 ; i < MAX_REGS(other_fonts) ; i++)
+ if (max_height < dat->fontModernInfo[other_fonts[i]].fontHeight)
+ max_height = dat->fontModernInfo[other_fonts[i]].fontHeight;
+ }
+
+ // Avatar size
+ if (dat->avatars_show && !dat->avatars_ignore_size_for_row_height)
+ max_height = max(max_height, dat->avatars_maxheight_size);
+
+ // Checkbox size
+ if (style & CLS_CHECKBOXES || style & CLS_GROUPCHECKBOXES)
+ max_height = max(max_height, dat->checkboxSize);
+
+ // Icon size
+ if ( !dat->icon_ignore_size_for_row_height)
+ max_height = max(max_height, ICON_HEIGHT);
+
+ max_height += 2 * dat->row_border;
+
+ // Min size
+ max_height = max(max_height, dat->row_min_heigh);
+
+ dat->rowHeight = max_height;
+ return max_height;
}
-
// Calc and store row height for all items in the list
void RowHeights_CalcRowHeights(struct ClcData *dat, HWND hwnd)
{
@@ -528,269 +472,216 @@ void RowHeights_CalcRowHeights(struct ClcData *dat, HWND hwnd) void RowHeights_CalcRowHeights_Worker(struct ClcData *dat, HWND hwnd)
{
- int indent, subident, subindex, line_num;
- struct ClcContact *Drawing;
- struct ClcGroup *group;
-
- if (MirandaExiting()) return;
-
- // Draw lines
- group = &dat->list;
- group->scanIndex = 0;
- indent = 0;
- subindex = -1;
- line_num = -1;
-
- RowHeights_Clear(dat);
-
- while(TRUE)
- {
- if (subindex == -1)
- {
- if (group->scanIndex == group->cl.count)
- {
- group = group->parent;
- indent--;
- if (group == NULL) break; // Finished list
- group->scanIndex++;
- continue;
- }
-
- // Get item to draw
- Drawing = group->cl.items[group->scanIndex];
- subident = 0;
- }
- else
- {
- // Get item to draw
- Drawing = &(group->cl.items[group->scanIndex]->subcontacts[subindex]);
- subident = dat->subIndent;
- }
-
- line_num++;
-
- // Calc row height
- if ( !gl_RowRoot) RowHeights_GetRowHeight(dat, hwnd, Drawing, line_num);
- else RowHeight_CalcRowHeight(dat, hwnd, Drawing, line_num);
-
- //increment by subcontacts
- if (group->cl.items[group->scanIndex]->subcontacts != NULL && group->cl.items[group->scanIndex]->type != CLCIT_GROUP)
- {
- if (group->cl.items[group->scanIndex]->SubExpanded && dat->expandMeta)
- {
- if (subindex < group->cl.items[group->scanIndex]->SubAllocated-1)
- {
- subindex++;
- }
- else
- {
- subindex = -1;
- }
- }
- }
-
- if (subindex == -1)
- {
- if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded)
- {
- group = group->cl.items[group->scanIndex]->group;
- indent++;
- group->scanIndex = 0;
- subindex = -1;
- continue;
- }
- group->scanIndex++;
- }
- }
-
-}
+ if (MirandaExiting()) return;
+
+ // Draw lines
+ ClcGroup *group = &dat->list;
+ ClcContact *Drawing;
+ group->scanIndex = 0;
+ int indent = 0, subident;
+ int subindex = -1;
+ int line_num = -1;
+
+ RowHeights_Clear(dat);
+
+ while(TRUE) {
+ if (subindex == -1) {
+ if (group->scanIndex == group->cl.count) {
+ group = group->parent;
+ indent--;
+ if (group == NULL) break; // Finished list
+ group->scanIndex++;
+ continue;
+ }
+ // Get item to draw
+ Drawing = group->cl.items[group->scanIndex];
+ subident = 0;
+ }
+ else {
+ // Get item to draw
+ Drawing = &(group->cl.items[group->scanIndex]->subcontacts[subindex]);
+ subident = dat->subIndent;
+ }
+
+ line_num++;
+
+ // Calc row height
+ if ( !gl_RowRoot)
+ RowHeights_GetRowHeight(dat, hwnd, Drawing, line_num);
+ else
+ RowHeight_CalcRowHeight(dat, hwnd, Drawing, line_num);
+
+ //increment by subcontacts
+ if (group->cl.items[group->scanIndex]->subcontacts != NULL && group->cl.items[group->scanIndex]->type != CLCIT_GROUP) {
+ if (group->cl.items[group->scanIndex]->SubExpanded && dat->expandMeta) {
+ if (subindex < group->cl.items[group->scanIndex]->SubAllocated-1)
+ subindex++;
+ else
+ subindex = -1;
+ }
+ }
+
+ if (subindex == -1) {
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded) {
+ group = group->cl.items[group->scanIndex]->group;
+ indent++;
+ group->scanIndex = 0;
+ subindex = -1;
+ continue;
+ }
+ group->scanIndex++;
+ }
+ }
+}
// Calc and store row height
-int RowHeights_GetRowHeight(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item)
+int RowHeights_GetRowHeight(struct ClcData *dat, HWND hwnd, ClcContact *contact, int item)
{
- int res;
- if (MirandaExiting()) return 0;
- g_mutex_nCalcRowHeightLock++;
- res = RowHeights_GetRowHeight_worker(dat, hwnd, contact, item);
- g_mutex_nCalcRowHeightLock--;
- return res;
+ if (MirandaExiting()) return 0;
+ g_mutex_nCalcRowHeightLock++;
+ int res = RowHeights_GetRowHeight_worker(dat, hwnd, contact, item);
+ g_mutex_nCalcRowHeightLock--;
+ return res;
}
-int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item)
+int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, ClcContact *contact, int item)
{
- int height = 0;
- if (MirandaExiting()) return 0;
- if (gl_RowRoot)
- return RowHeight_CalcRowHeight(dat, hwnd, contact, item);
- else
- {
- displayNameCacheEntry *pdnce = (displayNameCacheEntry *)pcli->pfnGetCacheEntry(contact->hContact);
- DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
- //TODO replace futher code with new rowheight definition
- int tmp;
+ if (gl_RowRoot)
+ return RowHeight_CalcRowHeight(dat, hwnd, contact, item);
+
+ DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
+ //TODO replace futher code with new rowheight definition
+ int tmp;
BOOL selected = ((item == dat->selection) && (dat->hwndRenameEdit != NULL || dat->showSelAlways || dat->exStyle&CLS_EX_SHOWSELALWAYS || g_clcPainter.IsForegroundWindow(hwnd)) && contact->type != CLCIT_DIVIDER);
BOOL hottrack = ((item == dat->iHotTrack) && (dat->hwndRenameEdit != NULL || dat->showSelAlways || dat->exStyle&CLS_EX_SHOWSELALWAYS || g_clcPainter.IsForegroundWindow(hwnd)) && contact->type != CLCIT_DIVIDER);
BOOL minimalistic = (g_clcPainter.CheckMiniMode(dat,selected,hottrack));
- if ( !RowHeights_Alloc(dat, item + 1))
- return -1;
-
- if (dat->row_variable_height)
- {
- if ( !dat->text_ignore_size_for_row_height)
- {
- HANDLE hContact = pdnce->hContact;
- tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
- if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
- {
- tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
- }
- height += tmp;
-
- if ( !minimalistic && dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0])
- {
- tmp = dat->fontModernInfo[FONTID_SECONDLINE].fontHeight;
- if (dat->text_replace_smileys && dat->second_line_draw_smileys && !dat->text_resize_smileys)
- {
- tmp = max(tmp, pdnce->ssSecondLine.iMaxSmileyHeight);
- }
- height += dat->second_line_top_space + tmp;
- }
-
- if ( !minimalistic && dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0])
- {
- tmp = dat->fontModernInfo[FONTID_THIRDLINE].fontHeight;
- if (dat->text_replace_smileys && dat->third_line_draw_smileys && !dat->text_resize_smileys)
- {
- tmp = max(tmp, pdnce->ssThirdLine.iMaxSmileyHeight);
- }
- height += dat->third_line_top_space + tmp;
- }
- }
-
- // Avatar size
- if (dat->avatars_show && !dat->avatars_ignore_size_for_row_height &&
- contact->type == CLCIT_CONTACT &&
- (
- (dat->use_avatar_service && contact->avatar_data != NULL) ||
- (!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE)
- ) && !minimalistic )
- {
- height = max(height, dat->avatars_maxheight_size);
- }
-
- // Checkbox size
- if ((style&CLS_CHECKBOXES && contact->type == CLCIT_CONTACT) ||
- (style&CLS_GROUPCHECKBOXES && contact->type == CLCIT_GROUP) ||
- (contact->type == CLCIT_INFO && contact->flags&CLCIIF_CHECKBOX))
- {
- height = max(height, dat->checkboxSize);
- }
-
- // Icon size
- if ( !dat->icon_ignore_size_for_row_height)
- {
- if (contact->type == CLCIT_GROUP
- || (contact->type == CLCIT_CONTACT && contact->iImage != -1
- && !(dat->icon_hide_on_avatar && dat->avatars_show
- && ((dat->use_avatar_service && contact->avatar_data != NULL) ||
- (!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE)
- )
- && !contact->image_is_special)))
- {
- height = max(height, ICON_HEIGHT);
- }
- }
-
- height += 2 * dat->row_border;
-
- // Min size
- height = max(height, dat->row_min_heigh);
- }
- else
- {
- height = dat->rowHeight;
- }
-
- dat->row_heights[item] = height;
-
- return height;
- }
-}
+ if ( !RowHeights_Alloc(dat, item + 1))
+ return -1;
+
+ int height = 0;
+ displayNameCacheEntry *pdnce = (contact->type == CLCIT_CONTACT) ? (displayNameCacheEntry*)pcli->pfnGetCacheEntry(contact->hContact) : NULL;
+
+ if (dat->row_variable_height) {
+ if ( !dat->text_ignore_size_for_row_height) {
+ tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
+ if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
+ tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
+ height += tmp;
+
+ if (pdnce) {
+ if ( !minimalistic && dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0]) {
+ tmp = dat->fontModernInfo[FONTID_SECONDLINE].fontHeight;
+ if (dat->text_replace_smileys && dat->second_line_draw_smileys && !dat->text_resize_smileys)
+ tmp = max(tmp, pdnce->ssSecondLine.iMaxSmileyHeight);
+ height += dat->second_line_top_space + tmp;
+ }
+
+ if ( !minimalistic && dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0]) {
+ tmp = dat->fontModernInfo[FONTID_THIRDLINE].fontHeight;
+ if (dat->text_replace_smileys && dat->third_line_draw_smileys && !dat->text_resize_smileys)
+ tmp = max(tmp, pdnce->ssThirdLine.iMaxSmileyHeight);
+ height += dat->third_line_top_space + tmp;
+ }
+ }
+ }
+
+ // Avatar size
+ if (dat->avatars_show && !dat->avatars_ignore_size_for_row_height &&
+ contact->type == CLCIT_CONTACT &&
+ ((dat->use_avatar_service && contact->avatar_data != NULL) || (!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE)) && !minimalistic )
+ {
+ height = max(height, dat->avatars_maxheight_size);
+ }
+
+ // Checkbox size
+ if ((style & CLS_CHECKBOXES && contact->type == CLCIT_CONTACT) ||
+ (style & CLS_GROUPCHECKBOXES && contact->type == CLCIT_GROUP) ||
+ (contact->type == CLCIT_INFO && contact->flags & CLCIIF_CHECKBOX))
+ {
+ height = max(height, dat->checkboxSize);
+ }
+
+ // Icon size
+ if ( !dat->icon_ignore_size_for_row_height) {
+ if (contact->type == CLCIT_GROUP
+ || (contact->type == CLCIT_CONTACT && contact->iImage != -1
+ && !(dat->icon_hide_on_avatar && dat->avatars_show
+ && ((dat->use_avatar_service && contact->avatar_data != NULL) ||
+ (!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE))
+ && !contact->image_is_special)))
+ {
+ height = max(height, ICON_HEIGHT);
+ }
+ }
+ height += 2 * dat->row_border;
+
+ // Min size
+ height = max(height, dat->row_min_heigh);
+ }
+ else height = dat->rowHeight;
+
+ dat->row_heights[item] = height;
+
+ return height;
+}
// Calc item top Y (using stored data)
int cliGetRowTopY(struct ClcData *dat, int item)
{
- int i;
- int y = 0;
- if (item >= dat->row_heights_size)
- return cliGetRowBottomY(dat,item-1);
-
- for (i=0 ; i < item ; i++)
- {
- y += dat->row_heights[i];
- }
+ if (item >= dat->row_heights_size)
+ return cliGetRowBottomY(dat,item-1);
- return y;
+ int y = 0;
+ for (int i=0 ; i < item ; i++)
+ y += dat->row_heights[i];
+ return y;
}
-
// Calc item bottom Y (using stored data)
int cliGetRowBottomY(struct ClcData *dat, int item)
{
- int i;
- int y = 0;
+ if (item >= dat->row_heights_size)
+ return -1;
- if (item >= dat->row_heights_size)
- return -1;
-
- for (i=0 ; i <= item ; i++)
- {
- y += dat->row_heights[i];
- }
-
- return y;
+ int y = 0;
+ for (int i=0 ; i <= item ; i++)
+ y += dat->row_heights[i];
+ return y;
}
// Calc total height of rows (using stored data)
int cliGetRowTotalHeight(struct ClcData *dat)
{
- int i;
- int y = 0;
-
- for (i=0 ; i < dat->row_heights_size ; i++)
- {
- y += dat->row_heights[i];
- }
+ int y = 0;
+ for (int i=0 ; i < dat->row_heights_size ; i++)
+ y += dat->row_heights[i];
- return y;
+ return y;
}
// Return the line that pos_y is at or -1 (using stored data)
int cliRowHitTest(struct ClcData *dat, int pos_y)
{
- int i;
- int y = 0;
+ if (pos_y < 0)
+ return -1;
- if (pos_y < 0)
- return -1;
+ int y = 0;
+ for (int i=0 ; i < dat->row_heights_size ; i++) {
+ y += dat->row_heights[i];
+ if (pos_y < y)
+ return i;
+ }
- for (i=0 ; i < dat->row_heights_size ; i++)
- {
- y += dat->row_heights[i];
-
- if (pos_y < y)
- return i;
- }
-
- return -1;
+ return -1;
}
int cliGetRowHeight(struct ClcData *dat, int item)
{
- if ( item >= dat->row_heights_size || item < 0 )
- return dat->rowHeight;
- return dat->row_heights[ item ];
+ if ( item >= dat->row_heights_size || item < 0 )
+ return dat->rowHeight;
+
+ return dat->row_heights[ item ];
}
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index 386fa06f11..840943b2e8 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -83,7 +83,7 @@ void StatusUpdaterThread(void*) }
}
-HMENU BuildGroupPopupMenu( struct ClcGroup* group )
+HMENU BuildGroupPopupMenu( ClcGroup* group )
{
return (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP,(WPARAM)group,0);
}
@@ -143,7 +143,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_ICONCHANGED:
{ struct ClcContact *contact = NULL;
- struct ClcGroup *group = NULL;
+ ClcGroup *group = NULL;
int recalcScrollBar = 0,shouldShow;
HANDLE hSelItem = NULL;
struct ClcContact *selcontact = NULL;
@@ -197,7 +197,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L dat->needsResort = 1;
} }
if (hSelItem) {
- struct ClcGroup *selgroup;
+ ClcGroup *selgroup;
if (FindItem(hwnd,dat,hSelItem,&selcontact,&selgroup,NULL))
dat->selection = GetRowsPriorTo(&dat->list,selgroup,List_IndexOf((SortedList*)&selgroup->cl, selcontact));
else
@@ -210,7 +210,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
case INTM_STATUSMSGCHANGED:
{ struct ClcContact *contact = NULL;
- struct ClcGroup *group = NULL;
+ ClcGroup *group = NULL;
DBVARIANT dbv;
if (!(dat->style&CLS_SHOWSTATUSMESSAGES)) break;
diff --git a/plugins/Clist_mw/src/clc.h b/plugins/Clist_mw/src/clc.h index 29b7086d20..94de40448a 100644 --- a/plugins/Clist_mw/src/clc.h +++ b/plugins/Clist_mw/src/clc.h @@ -79,23 +79,23 @@ struct ClcData : public ClcDataBase };
//clcidents.c
-int GetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int contactIndex);
-int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,struct ClcGroup **subgroup,int *isVisible);
-int GetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,struct ClcGroup **subgroup);
+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 GetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,ClcGroup **subgroup);
void ClearRowByIndexCache();
//clcitems.c
-struct ClcGroup *AddGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers);
-void FreeGroup(struct ClcGroup *group);
-int AddInfoItemToGroup(struct ClcGroup *group,int flags,const TCHAR *pszText);
+ClcGroup *AddGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers);
+void FreeGroup(ClcGroup *group);
+int AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText);
void FreeContact(struct ClcContact *p);
void RebuildEntireList(HWND hwnd,struct ClcData *dat);
-struct ClcGroup *RemoveItemFromGroup(HWND hwnd,struct ClcGroup *group,struct ClcContact *contact,int updateTotalCount);
+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 SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort);
-int GetGroupContentsCount(struct ClcGroup *group,int visibleOnly);
-int GetNewSelection(struct ClcGroup *group,int selection, int direction);
+int GetGroupContentsCount(ClcGroup *group,int visibleOnly);
+int GetNewSelection(ClcGroup *group,int selection, int direction);
void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat);
//clcmsgs.c
@@ -104,7 +104,7 @@ LRESULT ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARAM wP //clcutils.c
void RecalcScrollBar(HWND hwnd,struct ClcData *dat);
void BeginRenameSelection(HWND hwnd,struct ClcData *dat);
-int HitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact **contact,struct ClcGroup **group,DWORD *flags);
+int HitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact **contact,ClcGroup **group,DWORD *flags);
void ScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth);
void LoadClcOptions(HWND hwnd,struct ClcData *dat);
diff --git a/plugins/Clist_mw/src/clcidents.cpp b/plugins/Clist_mw/src/clcidents.cpp index 58517fa8c0..2d706916a9 100644 --- a/plugins/Clist_mw/src/clcidents.cpp +++ b/plugins/Clist_mw/src/clcidents.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* the CLC uses 3 different ways to identify elements in its list, this file
contains routines to convert between them.
-1) struct ClcContact/struct ClcGroup pair. Only ever used within the duration
+1) struct ClcContact/ClcGroup pair. Only ever used within the duration
of a single operation, but used at some point in nearly everything
2) index integer. The 0-based number of the item from the top. Only visible
items are counted (ie not closed groups). Used for saving selection and drag
@@ -41,7 +41,7 @@ exclusively externally 2->1: GetRowByIndex()
*/
-int GetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int contactIndex)
+int GetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex)
{
int count = 0;
@@ -143,11 +143,11 @@ void SetClcContactCacheItem(struct ClcData *dat,HANDLE hContact,void *contact) }
}
-int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,struct 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;
- struct ClcGroup *group = &dat->list;
+ ClcGroup *group = &dat->list;
group->scanIndex = 0;
@@ -178,7 +178,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont for (;;) {
if (group->scanIndex == group->cl.count) {
- struct ClcGroup *tgroup;
+ ClcGroup *tgroup;
group = group->parent;
if (group == NULL)
break;
@@ -223,7 +223,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont }
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
- struct ClcGroup* save = group;
+ ClcGroup* save = group;
group = group->cl.items[group->scanIndex]->group;
group->scanIndex = 0;
nowVisible &= group->expanded;
@@ -234,7 +234,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont return 0;
}
#define CacheArrSize 255
-struct ClcGroup *CacheIndex[CacheArrSize] = {NULL};
+ClcGroup *CacheIndex[CacheArrSize] = {NULL};
boolean CacheIndexClear = TRUE;
void ClearRowByIndexCache()
{
@@ -244,10 +244,10 @@ void ClearRowByIndexCache() }
}
-int GetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,struct ClcGroup **subgroup)
+int GetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,ClcGroup **subgroup)
{
int index = 0,i;
- struct ClcGroup *group = &dat->list;
+ ClcGroup *group = &dat->list;
if (testindex < 0) return -1;
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp index cf3909024f..16d3c2e309 100644 --- a/plugins/Clist_mw/src/clcitems.cpp +++ b/plugins/Clist_mw/src/clcitems.cpp @@ -27,11 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m_metacontacts.h"
-extern int ( *saveAddItemToGroup )( struct ClcGroup *group, int iAboveItem );
-extern int ( *saveAddInfoItemToGroup )(struct ClcGroup *group,int flags,const TCHAR *pszText);
-extern struct ClcGroup* ( *saveAddGroup )(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers);
+extern int ( *saveAddItemToGroup )( ClcGroup *group, int iAboveItem );
+extern int ( *saveAddInfoItemToGroup )(ClcGroup *group,int flags,const TCHAR *pszText);
+extern ClcGroup* ( *saveAddGroup )(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers);
extern void (*saveFreeContact)(struct ClcContact *p);
-extern void (*saveFreeGroup)(struct ClcGroup *p);
+extern void (*saveFreeGroup)(ClcGroup *p);
//routines for managing adding/removal of items in the list, including sorting
@@ -80,16 +80,16 @@ void FreeContact(struct ClcContact *p) saveFreeContact( p );
}
-int AddItemToGroup(struct ClcGroup *group,int iAboveItem)
+int AddItemToGroup(ClcGroup *group,int iAboveItem)
{
iAboveItem = saveAddItemToGroup( group, iAboveItem );
ClearRowByIndexCache();
return iAboveItem;
}
-struct ClcGroup *AddGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers)
+ClcGroup *AddGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers)
{
- struct ClcGroup* result;
+ ClcGroup* result;
ClearRowByIndexCache();
dat->needsResort = 1;
@@ -98,20 +98,20 @@ struct ClcGroup *AddGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWOR return result;
}
-void FreeGroup(struct ClcGroup *group)
+void FreeGroup(ClcGroup *group)
{
saveFreeGroup( group );
ClearRowByIndexCache();
}
-int AddInfoItemToGroup(struct ClcGroup *group,int flags,const TCHAR *pszText)
+int AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText)
{
int i = saveAddInfoItemToGroup( group, flags, pszText );
ClearRowByIndexCache();
return i;
}
-static struct ClcContact * AddContactToGroup(struct ClcData *dat,struct ClcGroup *group,pdisplayNameCacheEntry cacheEntry)
+static struct ClcContact * AddContactToGroup(struct ClcData *dat,ClcGroup *group,pdisplayNameCacheEntry cacheEntry)
{
char *szProto;
WORD apparentMode;
@@ -263,9 +263,9 @@ void AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTo ClearRowByIndexCache();
}
-extern struct ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd,struct ClcGroup *group,struct ClcContact *contact,int updateTotalCount);
+extern ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd,ClcGroup *group,struct ClcContact *contact,int updateTotalCount);
-struct ClcGroup *RemoveItemFromGroup(HWND hwnd,struct ClcGroup *group,struct ClcContact *contact,int updateTotalCount)
+ClcGroup *RemoveItemFromGroup(HWND hwnd,ClcGroup *group,struct ClcContact *contact,int updateTotalCount)
{
ClearRowByIndexCache();
if (contact->type == CLCIT_CONTACT) {
@@ -282,7 +282,7 @@ struct ClcGroup *RemoveItemFromGroup(HWND hwnd,struct ClcGroup *group,struct Clc void DeleteItemFromTree(HWND hwnd,HANDLE hItem)
{
struct ClcContact *contact;
- struct ClcGroup *group;
+ ClcGroup *group;
struct ClcData *dat = (struct ClcData*)GetWindowLongPtr(hwnd,0);
ClearRowByIndexCache();
@@ -327,7 +327,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
HANDLE hContact;
struct ClcContact * cont;
- struct ClcGroup *group;
+ ClcGroup *group;
//DBVARIANT dbv;
int tick = GetTickCount();
@@ -432,10 +432,10 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) }
-int GetNewSelection(struct ClcGroup *group, int selection, int direction)
+int GetNewSelection(ClcGroup *group, int selection, int direction)
{
int lastcount = 0, count = 0;//group->cl.count;
- struct ClcGroup *topgroup = group;
+ ClcGroup *topgroup = group;
if (selection<0) {
return 0;
}
@@ -468,10 +468,10 @@ int GetNewSelection(struct ClcGroup *group, int selection, int direction) return lastcount;
}
-int GetGroupContentsCount(struct ClcGroup *group,int visibleOnly)
+int GetGroupContentsCount(ClcGroup *group,int visibleOnly)
{
int count = 0;//group->cl.count;
- struct ClcGroup *topgroup = group;
+ ClcGroup *topgroup = group;
group->scanIndex = 0;
for (;;) {
@@ -550,7 +550,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat) int savedContactCount = 0,savedContactAlloced = 0;
struct SavedInfoState_t *savedInfo = NULL;
int savedInfoCount = 0,savedInfoAlloced = 0;
- struct ClcGroup *group;
+ ClcGroup *group;
struct ClcContact *contact;
int tick = GetTickCount();
diff --git a/plugins/Clist_mw/src/clcpaint.cpp b/plugins/Clist_mw/src/clcpaint.cpp index b4fc20850f..ee5e17fb53 100644 --- a/plugins/Clist_mw/src/clcpaint.cpp +++ b/plugins/Clist_mw/src/clcpaint.cpp @@ -151,7 +151,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint) RECT clRect;
int y,indent,index,fontHeight, subindex, subident;
struct ClcContact *Drawing;
- struct ClcGroup *group;
+ ClcGroup *group;
HBITMAP hBmpOsb;
DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
int status = GetGeneralisedStatus();
@@ -452,9 +452,9 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint) else if (Drawing->type == CLCIT_GROUP) {
RECT rc;
if (szCounts[0]) {
- struct ClcGroup *clcg;
+ ClcGroup *clcg;
- clcg = (struct ClcGroup *)Drawing;
+ clcg = (ClcGroup *)Drawing;
fontHeight = dat->fontInfo[FONTID_GROUPS].fontHeight;
diff --git a/plugins/Clist_mw/src/clcutils.cpp b/plugins/Clist_mw/src/clcutils.cpp index e9253b4082..db47677f84 100644 --- a/plugins/Clist_mw/src/clcutils.cpp +++ b/plugins/Clist_mw/src/clcutils.cpp @@ -26,10 +26,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //loads of stuff that didn't really fit anywhere else
-int HitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact **contact,struct ClcGroup **group,DWORD *flags)
+int HitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact **contact,ClcGroup **group,DWORD *flags)
{
struct ClcContact *hitcontact;
- struct ClcGroup *hitgroup;
+ ClcGroup *hitgroup;
int hit,indent,width,i,cxSmIcon;
int checkboxWidth, subident,ic = 0;
SIZE textSize;
@@ -238,7 +238,7 @@ void RecalcScrollBar(HWND hwnd,struct ClcData *dat) ScrollTo(hwnd,dat,dat->yScroll,1);
}
-void CalcEipPosition( struct ClcData *dat, struct ClcContact *contact, struct ClcGroup *group, POINT *result)
+void CalcEipPosition( struct ClcData *dat, struct ClcContact *contact, ClcGroup *group, POINT *result)
{
int indent;
for (indent = 0; group->parent; indent++, group = group->parent);
diff --git a/plugins/Clist_mw/src/groupmenu.cpp b/plugins/Clist_mw/src/groupmenu.cpp index 496f98e78c..a92a2b4113 100644 --- a/plugins/Clist_mw/src/groupmenu.cpp +++ b/plugins/Clist_mw/src/groupmenu.cpp @@ -444,7 +444,7 @@ static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam,LPARAM lParam) static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
CLISTMENUITEM mi;
- struct ClcGroup *group = (struct ClcGroup *)wParam;
+ ClcGroup *group = (ClcGroup *)wParam;
if (wParam == 0) return 0;
//contact->group
diff --git a/plugins/Clist_mw/src/init.cpp b/plugins/Clist_mw/src/init.cpp index 2144ab6eb8..ea29d0d419 100644 --- a/plugins/Clist_mw/src/init.cpp +++ b/plugins/Clist_mw/src/init.cpp @@ -29,9 +29,9 @@ int hLangpack; static HANDLE hCListShutdown = 0;
-HMENU BuildGroupPopupMenu( struct ClcGroup* group );
+HMENU BuildGroupPopupMenu( ClcGroup* group );
-void CalcEipPosition( struct ClcData *dat, struct ClcContact *contact, struct ClcGroup *group, POINT *result);
+void CalcEipPosition( struct ClcData *dat, struct ClcContact *contact, ClcGroup *group, POINT *result);
void CheckPDNCE(ClcCacheEntryBase*);
void CluiProtocolStatusChanged( int, const char* );
int CompareContacts( const struct ClcContact *contact1, const struct ClcContact *contact2 );
@@ -40,11 +40,11 @@ void GetDefaultFontSetting(int i,LOGFONT *lf,COLORREF *colour); void RebuildEntireList(HWND hwnd,struct ClcData *dat);
void RecalcScrollBar(HWND hwnd,struct ClcData *dat);
-struct ClcGroup* ( *saveAddGroup )(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers);
-struct ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd,struct ClcGroup *group,struct ClcContact *contact,int updateTotalCount);
+ClcGroup* ( *saveAddGroup )(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers);
+ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd,ClcGroup *group,struct ClcContact *contact,int updateTotalCount);
void (*saveFreeContact)(struct ClcContact *p);
-void (*saveFreeGroup)(struct ClcGroup *p);
+void (*saveFreeGroup)(ClcGroup *p);
LRESULT ( CALLBACK *saveContactListControlWndProc )( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -54,11 +54,11 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l void ( *saveLoadClcOptions )(HWND hwnd,struct ClcData *dat);
-int ( *saveAddItemToGroup )( struct ClcGroup *group, int iAboveItem );
-int AddItemToGroup(struct ClcGroup *group, int iAboveItem);
+int ( *saveAddItemToGroup )( ClcGroup *group, int iAboveItem );
+int AddItemToGroup(ClcGroup *group, int iAboveItem);
-int ( *saveAddInfoItemToGroup)(struct ClcGroup *group,int flags,const TCHAR *pszText);
-int AddInfoItemToGroup(struct ClcGroup *group,int flags,const TCHAR *pszText);
+int ( *saveAddInfoItemToGroup)(ClcGroup *group,int flags,const TCHAR *pszText);
+int AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText);
void ( *saveSortCLC )(HWND hwnd,struct ClcData *dat,int useInsertionSort);
void SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort);
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp index a784e30883..99d93d30fd 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp @@ -478,7 +478,7 @@ static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam,LPARAM lParam) static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
- ClcGroup *group=(struct ClcGroup *)wParam;
+ ClcGroup *group=(ClcGroup *)wParam;
if (group == 0)
return 0;
diff --git a/plugins/Clist_nicer/src/Include/clc.h b/plugins/Clist_nicer/src/Include/clc.h index a1bd91939f..3329cfa76a 100644 --- a/plugins/Clist_nicer/src/Include/clc.h +++ b/plugins/Clist_nicer/src/Include/clc.h @@ -54,7 +54,7 @@ #define TIMERID_SORT 15
#define TIMERID_REFRESH 18
#define TIMERID_PAINT 19
-struct ClcGroup;
+ClcGroup;
#define CONTACTF_ONLINE 1
#define CONTACTF_INVISTO 2
@@ -421,7 +421,7 @@ typedef struct { } protoMenu;
//clcidents.c
-int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, struct ClcGroup **subgroup, int *isVisible);
+int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible);
HANDLE ContactToItemHandle(struct ClcContact *contact, DWORD *nmFlags);
//clcitems.c
@@ -433,11 +433,11 @@ DWORD INTSORT_GetLastMsgTime(HANDLE hContact); LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
//clcutils.c
-void SetGroupExpand(HWND hwnd, struct ClcData *dat, struct ClcGroup *group, int newState);
+void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newState);
void DoSelectionDefaultAction(HWND hwnd, struct ClcData *dat);
int FindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk);
void BeginRenameSelection(HWND hwnd, struct ClcData *dat);
-int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcContact **contact, struct ClcGroup **group, DWORD *flags);
+int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcContact **contact, ClcGroup **group, DWORD *flags);
void ScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
void RecalcScrollBar(HWND hwnd, struct ClcData *dat);
size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut);
@@ -452,7 +452,7 @@ size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut); int GetDropTargetInformation(HWND hwnd, struct ClcData *dat, POINT pt);
void LoadClcOptions(HWND hwnd, struct ClcData *dat);
void RecalculateGroupCheckboxes(HWND hwnd, struct ClcData *dat);
-void SetGroupChildCheckboxes(struct ClcGroup *group, int checked);
+void SetGroupChildCheckboxes(ClcGroup *group, int checked);
BYTE GetCachedStatusMsg(int iExtraCacheEntry, char *szProto);
int __fastcall GetStatusOnlineness(int status);
void GetExtendedInfo(struct ClcContact *contact, struct ClcData *dat);
@@ -492,7 +492,7 @@ HWND ClcGetButtonWindow(int ctrlid); //clcpaint.c
void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint);
-void __inline PaintItem(HDC hdcMem, struct ClcGroup *group, struct ClcContact *contact, int indent, int y, struct ClcData *dat, int index, HWND hwnd, DWORD style, RECT *clRect, BOOL *bFirstNGdrawn, int groupCountsFontTopShift, int rowHeight);
+void __inline PaintItem(HDC hdcMem, ClcGroup *group, struct ClcContact *contact, int indent, int y, struct ClcData *dat, int index, HWND hwnd, DWORD style, RECT *clRect, BOOL *bFirstNGdrawn, int groupCountsFontTopShift, int rowHeight);
void Reload3dBevelColors();
void ReloadThemedOptions();
void SetButtonToSkinned();
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 84ab25af3c..5c70df5d48 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -59,7 +59,7 @@ LONG g_cxsmIcon, g_cysmIcon; void SetDBButtonStates(HANDLE hContact);
-HMENU BuildGroupPopupMenu(struct ClcGroup* group)
+HMENU BuildGroupPopupMenu(ClcGroup* group)
{
return (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP, (WPARAM)group, 0);
}
@@ -355,7 +355,7 @@ LBL_Def: case INTM_ICONCHANGED: {
struct ClcContact *contact = NULL;
- struct ClcGroup *group = NULL;
+ ClcGroup *group = NULL;
int recalcScrollBar = 0, shouldShow;
WORD status = ID_STATUS_OFFLINE;
char *szProto;
@@ -402,7 +402,7 @@ LBL_Def: }
}
if (hSelItem) {
- struct ClcGroup *selgroup;
+ ClcGroup *selgroup;
if (pcli->pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*) & selgroup->cl, selcontact));
else
@@ -564,7 +564,7 @@ LBL_Def: case INTM_INVALIDATECONTACT: {
struct ClcContact *contact = 0;
- struct ClcGroup *group = 0;
+ ClcGroup *group = 0;
int iItem;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
diff --git a/plugins/Clist_nicer/src/clcidents.cpp b/plugins/Clist_nicer/src/clcidents.cpp index 277fbe32db..fdb7eac8df 100644 --- a/plugins/Clist_nicer/src/clcidents.cpp +++ b/plugins/Clist_nicer/src/clcidents.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* the CLC uses 3 different ways to identify elements in its list, this file
contains routines to convert between them.
-1) struct ClcContact/struct ClcGroup pair. Only ever used within the duration
+1) struct ClcContact/ClcGroup pair. Only ever used within the duration
of a single operation, but used at some point in nearly everything
2) index integer. The 0-based number of the item from the top. Only visible
items are counted (ie not closed groups). Used for saving selection and drag
@@ -39,16 +39,16 @@ contains routines to convert between them. 2->1: GetRowByIndex()
*/
-int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, struct ClcGroup **subgroup, int *isVisible)
+int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible)
{
int index = 0;
int nowVisible = 1;
- struct ClcGroup *group = &dat->list;
+ ClcGroup *group = &dat->list;
group->scanIndex = 0;
for (; ;) {
if (group->scanIndex == group->cl.count) {
- struct ClcGroup *tgroup;
+ ClcGroup *tgroup;
group = group->parent;
if (group == NULL)
break;
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 7bc8154533..8086fe7ebd 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -35,10 +35,10 @@ extern HANDLE hExtraImageListRebuilding, hExtraImageApplying;
-extern int ( *saveAddContactToGroup )(struct ClcData *dat, struct ClcGroup *group, HANDLE hContact);
-extern int ( *saveAddInfoItemToGroup )(struct ClcGroup *group, int flags, const TCHAR *pszText);
-extern struct ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, struct ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
-extern struct ClcGroup* ( *saveAddGroup )(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
+extern int ( *saveAddContactToGroup )(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
+extern int ( *saveAddInfoItemToGroup )(ClcGroup *group, int flags, const TCHAR *pszText);
+extern ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
+extern ClcGroup* ( *saveAddGroup )(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
static void TZ_LoadTimeZone(HANDLE hContact, struct TExtraCache *c, const char *szProto);
@@ -58,7 +58,7 @@ struct ClcContact* CreateClcContact( void ) return p;
}
-int AddInfoItemToGroup(struct ClcGroup *group, int flags, const TCHAR *pszText)
+int AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText)
{
int i = saveAddInfoItemToGroup(group, flags, pszText);
struct ClcContact* p = group->cl.items[i];
@@ -72,9 +72,9 @@ int AddInfoItemToGroup(struct ClcGroup *group, int flags, const TCHAR *pszText) return i;
}
-struct ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers)
+ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers)
{
- struct ClcGroup *p = saveAddGroup( hwnd, dat, szName, flags, groupId, calcTotalMembers);
+ ClcGroup *p = saveAddGroup( hwnd, dat, szName, flags, groupId, calcTotalMembers);
if ( p && p->parent )
@@ -83,7 +83,7 @@ struct ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, D return p;
}
-struct ClcGroup *RemoveItemFromGroup(HWND hwnd, struct ClcGroup *group, struct ClcContact *contact, int updateTotalCount)
+ClcGroup *RemoveItemFromGroup(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount)
{
if (contact->extraCacheEntry >= 0 && contact->extraCacheEntry < cfg::nextCacheEntry) {
if (cfg::eCache[contact->extraCacheEntry].floater && cfg::eCache[contact->extraCacheEntry].floater->hwnd)
@@ -118,7 +118,7 @@ void LoadAvatarForContact(struct ClcContact *p) p->cFlags &= ~ECF_AVATAR;
}
-int AddContactToGroup(struct ClcData *dat, struct ClcGroup *group, HANDLE hContact)
+int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact)
{
int i = saveAddContactToGroup( dat, group, hContact );
struct ClcContact* p = group->cl.items[i];
@@ -177,7 +177,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat) char *szProto;
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
HANDLE hContact;
- struct ClcGroup *group;
+ ClcGroup *group;
DBVARIANT dbv = {0};
RowHeight::Clear(dat);
diff --git a/plugins/Clist_nicer/src/clcmsgs.cpp b/plugins/Clist_nicer/src/clcmsgs.cpp index c89174af44..195a8565c8 100644 --- a/plugins/Clist_nicer/src/clcmsgs.cpp +++ b/plugins/Clist_nicer/src/clcmsgs.cpp @@ -42,7 +42,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM case CLM_SETSTICKY:
{
struct ClcContact *contact;
- struct ClcGroup *group;
+ ClcGroup *group;
if (wParam == 0 || !FindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
return 0;
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index 17e5cba9ed..99625c23f0 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -449,7 +449,7 @@ static BOOL mirror_rtl, mirror_always, mirror_rtltext; BYTE savedCORNER = -1;
int g_padding_y = 0;
-void __inline PaintItem(HDC hdcMem, struct ClcGroup *group, struct ClcContact *contact, int indent, int y, struct ClcData *dat, int index, HWND hwnd, DWORD style, RECT *clRect, BOOL *bFirstNGdrawn, int groupCountsFontTopShift, int rowHeight)
+void __inline PaintItem(HDC hdcMem, ClcGroup *group, struct ClcContact *contact, int indent, int y, struct ClcData *dat, int index, HWND hwnd, DWORD style, RECT *clRect, BOOL *bFirstNGdrawn, int groupCountsFontTopShift, int rowHeight)
{
RECT rc;
int iImage = -1;
@@ -1372,7 +1372,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint) HDC hdcMem;
RECT clRect;
int y,indent,index,fontHeight;
- struct ClcGroup *group;
+ ClcGroup *group;
HBITMAP hBmpOsb, hOldBitmap;
HFONT hOldFont;
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 5384867f5f..45e9cdb9db 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -188,10 +188,10 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct Clc return -1;
}
-int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcContact **contact, struct ClcGroup **group, DWORD *flags)
+int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcContact **contact, ClcGroup **group, DWORD *flags)
{
struct ClcContact *hitcontact;
- struct ClcGroup *hitgroup;
+ ClcGroup *hitgroup;
int hit, indent, width, i, cxSmIcon;
int checkboxWidth;
SIZE textSize;
@@ -443,7 +443,7 @@ void RecalcScrollBar(HWND hwnd, struct ClcData *dat) //saveRecalcScrollBar(hwnd, dat);
}
-void SetGroupExpand(HWND hwnd,struct ClcData *dat,struct ClcGroup *group,int newState)
+void SetGroupExpand(HWND hwnd,struct ClcData *dat,ClcGroup *group,int newState)
{
int contentCount;
int groupy;
@@ -516,7 +516,7 @@ static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPara void BeginRenameSelection(HWND hwnd, struct ClcData *dat)
{
struct ClcContact *contact;
- struct ClcGroup *group;
+ ClcGroup *group;
int indent, x, y, h;
RECT clRect;
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index f4cb71debc..d6eee3bc0b 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -50,7 +50,7 @@ extern HIMAGELIST himlExtraImages; TIME_API tmi;
-HMENU BuildGroupPopupMenu( struct ClcGroup* group );
+HMENU BuildGroupPopupMenu( ClcGroup* group );
struct ClcContact* CreateClcContact( void );
struct CListEvent* fnCreateEvent( void );
void ReloadThemedOptions();
@@ -66,20 +66,20 @@ int ClcShutdown(WPARAM wParam, LPARAM lParam); void ( *saveLoadClcOptions )(HWND hwnd,struct ClcData *dat);
void LoadClcOptions(HWND hwnd,struct ClcData *dat);
-int ( *saveAddContactToGroup )(struct ClcData *dat, struct ClcGroup *group, HANDLE hContact);
-int AddContactToGroup(struct ClcData *dat, struct ClcGroup *group, HANDLE hContact);
+int ( *saveAddContactToGroup )(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
+int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
-struct ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, struct ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
-struct ClcGroup* RemoveItemFromGroup(HWND hwnd, struct ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
+ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
+ClcGroup* RemoveItemFromGroup(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
struct CListEvent* ( *saveAddEvent )(CLISTEVENT *cle);
struct CListEvent* AddEvent(CLISTEVENT *cle);
-int ( *saveAddInfoItemToGroup )(struct ClcGroup *group, int flags, const TCHAR *pszText);
-int AddInfoItemToGroup(struct ClcGroup *group, int flags, const TCHAR *pszText);
+int ( *saveAddInfoItemToGroup )(ClcGroup *group, int flags, const TCHAR *pszText);
+int AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
-struct ClcGroup* ( *saveAddGroup )(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
-struct ClcGroup* AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
+ClcGroup* ( *saveAddGroup )(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
+ClcGroup* AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
LRESULT ( CALLBACK *saveContactListWndProc )(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Clist_nicer/src/rowheight_funcs.cpp b/plugins/Clist_nicer/src/rowheight_funcs.cpp index 3ef0bef92e..1f0bbdd6e7 100644 --- a/plugins/Clist_nicer/src/rowheight_funcs.cpp +++ b/plugins/Clist_nicer/src/rowheight_funcs.cpp @@ -143,7 +143,7 @@ void RowHeight::calcRowHeights(ClcData *dat, HWND hwnd) {
int indent, subindex, line_num;
struct ClcContact *Drawing;
- struct ClcGroup *group;
+ ClcGroup *group;
DWORD dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
// Draw lines
diff --git a/plugins/Clist_nicer/src/statusfloater.cpp b/plugins/Clist_nicer/src/statusfloater.cpp index 392fe90d2a..3421c7b016 100644 --- a/plugins/Clist_nicer/src/statusfloater.cpp +++ b/plugins/Clist_nicer/src/statusfloater.cpp @@ -972,7 +972,7 @@ void FLT_Create(int iEntry) if (iEntry >= 0 && iEntry < cfg::nextCacheEntry) {
struct ClcContact *contact = NULL;
- struct ClcGroup *group = NULL;
+ ClcGroup *group = NULL;
centry = &cfg::eCache[iEntry];
if (centry->floater == 0 && API::pfnUpdateLayeredWindow != NULL) {
@@ -1018,7 +1018,7 @@ void FLT_Update(struct ClcData *dat, struct ClcContact *contact) HWND hwnd;
HDC hdc;
BOOL firstDrawn = TRUE;
- struct ClcGroup *group = NULL;
+ ClcGroup *group = NULL;
struct ClcContact *newContact = NULL;
HRGN rgn;
HBRUSH hbrBorder;
|