diff options
Diffstat (limited to 'plugins/Clist_nicer/src')
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp | 9 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/Include/clc.h | 54 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/Include/commonheaders.h | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/Include/config.h | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/Include/resource.h | 13 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clc.cpp | 34 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcidents.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcitems.cpp | 329 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcmsgs.cpp | 66 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcopts.cpp | 222 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcpaint.cpp | 775 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcutils.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistmenus.cpp | 58 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clui.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/config.cpp | 56 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/contact.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/init.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/rowheight_funcs.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/statusfloater.cpp | 44 |
19 files changed, 662 insertions, 1030 deletions
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp index dd1a660c5c..e3f277004b 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp @@ -3385,6 +3385,7 @@ static int CLUIFrameOnModulesUnload(WPARAM wParam, LPARAM lParam) return 0;
}
+/*
static INT_PTR SetIconForExtraColumn(WPARAM wParam, LPARAM lParam)
{
pIconExtraColumn piec;
@@ -3406,7 +3407,7 @@ static INT_PTR SetIconForExtraColumn(WPARAM wParam, LPARAM lParam) PostMessage(pcli->hwndContactTree, CLM_SETEXTRAIMAGEINT, wParam, MAKELONG((WORD)piec->ColumnType, (WORD)piec->hImage));
return 0;
}
-
+*/
/*
* wparam=hIcon
* return hImage on success,-1 on failure
@@ -3535,12 +3536,6 @@ int LoadCLUIFramesModule(void) void LoadExtraIconModule()
{
- CreateServiceFunction(MS_CLIST_EXTRA_SET_ICON, SetIconForExtraColumn);
- CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON, AddIconToExtraImageList);
-
- hExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);
- hExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
-
hStatusBarShowToolTipEvent = CreateHookableEvent(ME_CLIST_FRAMES_SB_SHOW_TOOLTIP);
hStatusBarHideToolTipEvent = CreateHookableEvent(ME_CLIST_FRAMES_SB_HIDE_TOOLTIP);
}
diff --git a/plugins/Clist_nicer/src/Include/clc.h b/plugins/Clist_nicer/src/Include/clc.h index 3329cfa76a..eb1ea2b004 100644 --- a/plugins/Clist_nicer/src/Include/clc.h +++ b/plugins/Clist_nicer/src/Include/clc.h @@ -98,14 +98,14 @@ ClcGroup; #define ECF_SECONDLINE 2
struct ContactFloater {
- struct ContactFloater *pNextFloater;
+ ContactFloater *pNextFloater;
HWND hwnd;
HDC hdc;
HBITMAP hbm, hbmOld;
HANDLE hContact;
};
-typedef struct ContactFloater CONTACTFLOATER;
+typedef ContactFloater CONTACTFLOATER;
#define DSPF_CENTERSTATUSICON 1
#define DSPF_DIMIDLE 2
@@ -162,21 +162,21 @@ typedef struct DisplayProfileSet DISPLAYPROFILESET; struct TExtraCache
{
- BYTE iExtraImage[MAXEXTRACOLUMNS];
+ WORD iExtraImage[MAXEXTRACOLUMNS];
HANDLE hContact;
HANDLE hTimeZone;
- DWORD iExtraValid;
- BYTE valid;
+ DWORD iExtraValid;
+ BYTE valid;
TCHAR *statusMsg;
- BYTE bStatusMsgValid;
- DWORD dwCFlags;
- DWORD dwDFlags; // display flags for caching only
- DWORD dwXMask; // local extra icon mask, calculated from CLN_xmask
+ BYTE bStatusMsgValid;
+ DWORD dwCFlags;
+ DWORD dwDFlags; // display flags for caching only
+ DWORD dwXMask; // local extra icon mask, calculated from CLN_xmask
StatusItems_t *status_item, *proto_status_item;
CONTACTFLOATER *floater;
- DWORD dwLastMsgTime;
- DWORD msgFrequency;
- BOOL isChatRoom;
+ DWORD dwLastMsgTime;
+ DWORD msgFrequency;
+ BOOL isChatRoom;
};
struct ClcContact : public ClcContactBase
@@ -421,8 +421,8 @@ typedef struct { } protoMenu;
//clcidents.c
-int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible);
-HANDLE ContactToItemHandle(struct ClcContact *contact, DWORD *nmFlags);
+int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
+HANDLE ContactToItemHandle(ClcContact *contact, DWORD *nmFlags);
//clcitems.c
void RebuildEntireList(HWND hwnd, struct ClcData *dat);
@@ -437,7 +437,7 @@ void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newSta 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, ClcGroup **group, DWORD *flags);
+int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, 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);
@@ -455,7 +455,7 @@ void RecalculateGroupCheckboxes(HWND hwnd, struct ClcData *dat); 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);
+void GetExtendedInfo(ClcContact *contact, struct ClcData *dat);
extern LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void HideShowNotifyFrame();
DWORD GetCLUIWindowStyle(BYTE style);
@@ -466,24 +466,24 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO void FreeProtocolData( void );
-void GetClientID(struct ClcContact *contact, char *client);
+void GetClientID(ClcContact *contact, char *client);
int LoadCLCButtonModule(void);
void SetButtonStates(HWND hwnd);
void ConfigureCLUIGeometry(int mode);
void IcoLibReloadIcons();
-int CompareContacts(const struct ClcContact* p1, const struct ClcContact* p2);
+int CompareContacts(const ClcContact* p1, const ClcContact* p2);
void PaintNotifyArea(HDC hDC, RECT *rc);
int AvatarChanged(WPARAM wParam, LPARAM lParam);
void ConfigureFrame();
void ConfigureEventArea(HWND hwnd);
void ClearIcons(int mode);
void SkinDrawBg(HWND hwnd, HDC hdc);
-int GetBasicFontID(struct ClcContact * contact);
+int GetBasicFontID(ClcContact * contact);
extern int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szStatus, struct ClcData *dat);
void CreateViewModeFrame();
int GetExtraCache(HANDLE hContact, char *szProto);
void ReloadExtraInfo(HANDLE hContact);
-void LoadAvatarForContact(struct ClcContact *p);
+void LoadAvatarForContact(ClcContact *p);
void ApplyViewMode(const char *name);
DWORD CalcXMask(HANDLE hContact);
@@ -492,12 +492,12 @@ HWND ClcGetButtonWindow(int ctrlid); //clcpaint.c
void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint);
-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 __inline PaintItem(HDC hdcMem, ClcGroup *group, 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();
-void RTL_DetectAndSet(struct ClcContact *contact, HANDLE hContact);
-void RTL_DetectGroupName(struct ClcContact *group);
+void RTL_DetectAndSet(ClcContact *contact, HANDLE hContact);
+void RTL_DetectGroupName(ClcContact *group);
void CLN_LoadAllIcons(BOOL mode);
void ReloadSkinItemsToCache();
void SFL_RegisterWindowClass(), SFL_UnregisterWindowClass();
@@ -508,7 +508,7 @@ void SFL_SetSize(); void SFL_PaintNotifyArea();
void SFL_Update(HICON hIcon, int iIcon, HIMAGELIST hIml, const TCHAR *szText, BOOL refresh);
-void FLT_Update(struct ClcData *dat, struct ClcContact *contact);
+void FLT_Update(struct ClcData *dat, ClcContact *contact);
int FLT_CheckAvail();
void FLT_Create(int iEntry);
void FLT_SetSize(struct TExtraCache *centry, LONG width, LONG height);
@@ -625,10 +625,8 @@ typedef struct _floatopts { BYTE trans, act_trans;
BYTE radius;
BYTE enabled;
- BYTE def_hover_time;
- WORD hover_time;
+ BYTE def_hover_time;
+ WORD hover_time;
} FLOATINGOPTIONS;
extern FLOATINGOPTIONS g_floatoptions;
-
-
diff --git a/plugins/Clist_nicer/src/Include/commonheaders.h b/plugins/Clist_nicer/src/Include/commonheaders.h index 9d2c14f304..27f0da733b 100644 --- a/plugins/Clist_nicer/src/Include/commonheaders.h +++ b/plugins/Clist_nicer/src/Include/commonheaders.h @@ -206,7 +206,7 @@ extern ImageItem *g_glyphItem; #define MAX_REGS(_A_) (sizeof(_A_)/sizeof(_A_[0]))
-typedef int (__cdecl *pfnDrawAvatar)(HDC hdcOrig, HDC hdcMem, RECT *rc, struct ClcContact *contact, int y, struct ClcData *dat, int selected, WORD cstatus, int rowHeight);
+typedef int (__cdecl *pfnDrawAvatar)(HDC hdcOrig, HDC hdcMem, RECT *rc, ClcContact *contact, int y, struct ClcData *dat, int selected, WORD cstatus, int rowHeight);
#define safe_sizeof(a) (sizeof((a)) / sizeof((a)[0]))
diff --git a/plugins/Clist_nicer/src/Include/config.h b/plugins/Clist_nicer/src/Include/config.h index 4ee9983798..f84b2b8238 100644 --- a/plugins/Clist_nicer/src/Include/config.h +++ b/plugins/Clist_nicer/src/Include/config.h @@ -40,7 +40,7 @@ #define IS_THEMED (API::sysState.isThemed)
#define IS_AERO (API::sysState.isAero)
-typedef int (__cdecl *pfnDrawAvatar)(HDC hdcOrig, HDC hdcMem, RECT *rc, struct ClcContact *contact, int y, struct ClcData *dat, int selected, WORD cstatus, int rowHeight);
+typedef int (__cdecl *pfnDrawAvatar)(HDC hdcOrig, HDC hdcMem, RECT *rc, ClcContact *contact, int y, struct ClcData *dat, int selected, WORD cstatus, int rowHeight);
typedef BOOL (WINAPI *pfnSetLayeredWindowAttributes_t)(HWND, COLORREF, BYTE, DWORD);
typedef BOOL (WINAPI *pfnUpdateLayeredWindow_t)(HWND, HDC, POINT *, SIZE *, HDC, POINT *, COLORREF, BLENDFUNCTION *, DWORD);
typedef HMONITOR (WINAPI *pfnMonitorFromPoint_t)(POINT,DWORD);
diff --git a/plugins/Clist_nicer/src/Include/resource.h b/plugins/Clist_nicer/src/Include/resource.h index e7224dd57d..121ebe07f8 100644 --- a/plugins/Clist_nicer/src/Include/resource.h +++ b/plugins/Clist_nicer/src/Include/resource.h @@ -26,7 +26,6 @@ #define IDC_HYPERLINKHAND 214
#define IDC_DROPUSER 215
#define IDD_OPT_CLUI 218
-#define IDD_OPT_XICONS 219
#define IDD_OPT_ICONS 220
#define IDD_OPT_CLC 228
#define IDD_OPT_CLCBKG 230
@@ -74,17 +73,8 @@ #define IDC_SETALLBUTTONSKINNED 1043
#define IDC_EVENTSONTOP 1044
#define IDC_FASTGRADIENT 1044
-#define IDC_EXTRA_ICON_EMAIL 1045
#define IDC_DONTSEPARATE 1045
-#define IDC_EXTRA_ICON_SMS 1047
-#define IDC_EXTRA_ICON_RES0 1054
-#define IDC_EXTRA_ICON_WEB 1055
#define IDC_FADEINOUT 1056
-#define IDC_EXTRA_ICON_ADV2 1057
-#define IDC_EXTRA_ICON_RES1 1058
-#define IDC_EXTRA_ICON_RES2 1059
-#define IDC_EXTRA_ICON_ADV3 1060
-#define IDC_EXTRAORDER 1061
#define IDC_FRAMEGAP 1064
#define IDC_FRAMEGAPSPIN 1065
#define IDC_CLIPBORDER 1066
@@ -108,7 +98,6 @@ #define IDC_HIDEOFFLINE 1081
#define IDC_CRIGHTSPIN 1081
#define IDC_HIDEOFFLINEOPTS 1082
-#define IDC_EXTRA_ICON_ADV4 1085
#define IDC_LEFTMARGINSPIN 1092
#define IDC_NOGROUPICON 1102
#define IDC_ONECLK 1105
@@ -130,8 +119,6 @@ #define IDC_STATIC22 1157
#define IDC_STATIC14 1157
#define IDC_STATIC15 1158
-#define IDC_EXTRA_ICON_CLIENT 1164
-#define IDC_EXTRA_ICON_ADV1 1166
#define IDC_SHOWGRIP 1169
#define IDC_SKINBACKGROUND 1170
#define IDC_FILLWALLPAPER 1171
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 190ffffba7..486a81e3f4 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -323,7 +323,7 @@ LBL_Def: case WM_NCPAINT:
return FrameNCPaint(hwnd, DefWindowProc, wParam, lParam, frameHasTitlebar);
case INTM_GROUPCHANGED: {
- struct ClcContact *contact;
+ ClcContact *contact;
BYTE iExtraImage[MAXEXTRACOLUMNS];
BYTE flags = 0;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
@@ -354,14 +354,14 @@ LBL_Def: }
case INTM_ICONCHANGED: {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
ClcGroup *group = NULL;
int recalcScrollBar = 0, shouldShow;
WORD status = ID_STATUS_OFFLINE;
char *szProto;
int contactRemoved = 0;
HANDLE hSelItem = NULL;
- struct ClcContact *selcontact = NULL;
+ ClcContact *selcontact = NULL;
szProto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
if (szProto == NULL)
@@ -416,7 +416,7 @@ LBL_Def: goto LBL_Def;
}
case INTM_METACHANGED: {
- struct ClcContact *contact;
+ ClcContact *contact;
if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
if (contact->bIsMeta && cfg::dat.bMetaAvail && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
@@ -437,7 +437,7 @@ LBL_Def: goto LBL_Def;
}
case INTM_METACHANGEDEVENT: {
- struct ClcContact *contact;
+ ClcContact *contact;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
if (lParam == 0)
@@ -445,7 +445,7 @@ LBL_Def: goto LBL_Def;
}
case INTM_NAMECHANGED: {
- struct ClcContact *contact;
+ ClcContact *contact;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam, 0), safe_sizeof(contact->szText));
@@ -458,7 +458,7 @@ LBL_Def: }
case INTM_CODEPAGECHANGED: {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
contact->codePage = cfg::getDword((HANDLE) wParam, "Tab_SRMsg", "ANSIcodepage", cfg::getDword((HANDLE)wParam, "UserInfo", "ANSIcodepage", CP_ACP));
@@ -467,7 +467,7 @@ LBL_Def: }
case INTM_AVATARCHANGED: {
struct avatarCacheEntry *cEntry = (struct avatarCacheEntry *)lParam;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (wParam == 0) {
//RemoveFromImgCache(0, cEntry);
@@ -498,7 +498,7 @@ LBL_Def: goto LBL_Def;
}
case INTM_STATUSMSGCHANGED: {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
int index = -1;
char *szProto = NULL;
@@ -513,7 +513,7 @@ LBL_Def: goto LBL_Def;
}
case INTM_STATUSCHANGED: {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
WORD wStatus;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
@@ -530,7 +530,7 @@ LBL_Def: }
case INTM_PROTOCHANGED: {
DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING *) lParam;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
@@ -553,7 +553,7 @@ LBL_Def: }
if (lParam && !dat->bisEmbedded) {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (FindItem(hwnd, dat, (HANDLE)lParam, &contact, NULL, 0)) {
if (contact && contact->extraCacheEntry >= 0 && contact->extraCacheEntry < cfg::nextCacheEntry && cfg::eCache[contact->extraCacheEntry].floater)
@@ -563,7 +563,7 @@ LBL_Def: goto LBL_Def;
case INTM_INVALIDATECONTACT: {
- struct ClcContact *contact = 0;
+ ClcContact *contact = 0;
ClcGroup *group = 0;
int iItem;
@@ -592,7 +592,7 @@ LBL_Def: case INTM_IDLECHANGED: {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
char *szProto;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
@@ -609,7 +609,7 @@ LBL_Def: case INTM_XSTATUSCHANGED: {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
char *szProto;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
int index;
szProto = (char *)cws->szModule;
@@ -670,7 +670,7 @@ LBL_Def: break;
case WM_LBUTTONDBLCLK: {
- struct ClcContact *contact;
+ ClcContact *contact;
DWORD hitFlags;
ReleaseCapture();
dat->iHotTrack = -1;
@@ -724,7 +724,7 @@ LBL_Def: return TRUE;
}
case WM_CONTEXTMENU: {
- struct ClcContact *contact;
+ ClcContact *contact;
HMENU hMenu = NULL;
POINT pt;
DWORD hitFlags;
diff --git a/plugins/Clist_nicer/src/clcidents.cpp b/plugins/Clist_nicer/src/clcidents.cpp index fdb7eac8df..e56157d9b5 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/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
@@ -39,7 +39,7 @@ contains routines to convert between them. 2->1: GetRowByIndex()
*/
-int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible)
+int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible)
{
int index = 0;
int nowVisible = 1;
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index ebf7229ab9..97f438dbc5 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -37,18 +37,18 @@ extern HANDLE hExtraImageListRebuilding, hExtraImageApplying; 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* ( *saveRemoveItemFromGroup )(HWND hwnd, ClcGroup *group, 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);
//routines for managing adding/removal of items in the list, including sorting
-struct ClcContact* CreateClcContact( void )
+ClcContact* CreateClcContact( void )
{
- struct ClcContact* p = (struct ClcContact*)mir_alloc( sizeof( struct ClcContact ));
+ ClcContact* p = (ClcContact*)mir_alloc( sizeof( ClcContact ));
if ( p != NULL ) {
- ZeroMemory(p, sizeof(struct ClcContact));
+ ZeroMemory(p, sizeof(ClcContact));
//p->clientId = -1;
p->extraCacheEntry = -1;
p->avatarLeft = p->extraIconRightBegin = -1;
@@ -61,7 +61,7 @@ struct ClcContact* CreateClcContact( void ) int AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText)
{
int i = saveAddInfoItemToGroup(group, flags, pszText);
- struct ClcContact* p = group->cl.items[i];
+ ClcContact* p = group->cl.items[i];
p->codePage = 0;
//p->clientId = -1;
p->bIsMeta = 0;
@@ -83,7 +83,7 @@ ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD fl return p;
}
-ClcGroup *RemoveItemFromGroup(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount)
+ClcGroup *RemoveItemFromGroup(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount)
{
if (contact->extraCacheEntry >= 0 && contact->extraCacheEntry < cfg::nextCacheEntry) {
if (cfg::eCache[contact->extraCacheEntry].floater && cfg::eCache[contact->extraCacheEntry].floater->hwnd)
@@ -92,7 +92,7 @@ ClcGroup *RemoveItemFromGroup(HWND hwnd, ClcGroup *group, struct ClcContact *con return(saveRemoveItemFromGroup(hwnd, group, contact, updateTotalCount));
}
-void LoadAvatarForContact(struct ClcContact *p)
+void LoadAvatarForContact(ClcContact *p)
{
DWORD dwFlags;
@@ -121,7 +121,7 @@ void LoadAvatarForContact(struct ClcContact *p) int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact)
{
int i = saveAddContactToGroup( dat, group, hContact );
- struct ClcContact* p = group->cl.items[i];
+ ClcContact* p = group->cl.items[i];
p->wStatus = cfg::getWord(hContact, p->proto, "Status", ID_STATUS_OFFLINE);
p->xStatus = cfg::getByte(hContact, p->proto, "XStatusId", 0);
@@ -395,7 +395,7 @@ void ReloadExtraInfo(HANDLE hContact) */
-void RTL_DetectAndSet(struct ClcContact *contact, HANDLE hContact)
+void RTL_DetectAndSet(ClcContact *contact, HANDLE hContact)
{
WORD infoTypeC2[12];
int i, index;
@@ -425,7 +425,7 @@ void RTL_DetectAndSet(struct ClcContact *contact, HANDLE hContact) }
}
-void RTL_DetectGroupName(struct ClcContact *group)
+void RTL_DetectGroupName(ClcContact *group)
{
WORD infoTypeC2[12];
int i;
@@ -450,210 +450,163 @@ void RTL_DetectGroupName(struct ClcContact *group) * set extra icons accordingly
*/
-void GetExtendedInfo(struct ClcContact *contact, struct ClcData *dat)
+void GetExtendedInfo(ClcContact *contact, struct ClcData *dat)
{
- CONTACTINFO ci;
- BOOL iCacheNew = FALSE;
- int index;
+ if (dat->bisEmbedded || contact == NULL)
+ return;
- if (dat->bisEmbedded || contact == NULL)
- return;
+ if (contact->proto == NULL || contact->hContact == 0)
+ return;
- if (contact->proto == NULL || contact->hContact == 0)
- return;
+ int index = contact->extraCacheEntry;
- index = contact->extraCacheEntry;
+ //firstTime = DBGetContactSettingDword(contact->hContact, "CList", "mf_firstEvent", 0);
+ //count = DBGetContactSettingDword(contact->hContact, "CList", "mf_count", 0);
+ //new_freq = count ? (g_CluiData.t_now - firstTime) / count : 0x7fffffff;
+ cfg::eCache[index].msgFrequency = cfg::getDword(contact->hContact, "CList", "mf_freq", 0x7fffffff);
+ //g_ExtraCache[index].msgFrequency = new_freq;
+ //DBWriteContactSettingDword(contact->hContact, "CList", "mf_freq", new_freq);
- //firstTime = DBGetContactSettingDword(contact->hContact, "CList", "mf_firstEvent", 0);
- //count = DBGetContactSettingDword(contact->hContact, "CList", "mf_count", 0);
- //new_freq = count ? (g_CluiData.t_now - firstTime) / count : 0x7fffffff;
- cfg::eCache[index].msgFrequency = cfg::getDword(contact->hContact, "CList", "mf_freq", 0x7fffffff);
- //g_ExtraCache[index].msgFrequency = new_freq;
- //DBWriteContactSettingDword(contact->hContact, "CList", "mf_freq", new_freq);
-
- if (index >= 0 && index < cfg::nextCacheEntry) {
- if (cfg::eCache[index].valid)
- return;
- cfg::eCache[index].valid = TRUE;
- }
- else
- return;
-
- cfg::eCache[index].isChatRoom = cfg::getByte(contact->hContact, contact->proto, "ChatRoom", 0);
-
- cfg::eCache[index].iExtraValid &= ~(EIMG_SHOW_EMAIL | EIMG_SHOW_SMS | EIMG_SHOW_WEB);
- cfg::eCache[index].iExtraImage[EXTRA_ICON_EMAIL] = cfg::eCache[index].iExtraImage[EXTRA_ICON_WEB] = cfg::eCache[index].iExtraImage[EXTRA_ICON_SMS] = 0xff;
-
- ZeroMemory(&ci,sizeof(CONTACTINFO));
- ci.cbSize = sizeof(CONTACTINFO);
- ci.hContact = contact->hContact;
- ci.szProto = contact->proto;
-
- ci.dwFlag = CNF_EMAIL;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
- cfg::eCache[index].iExtraImage[EXTRA_ICON_EMAIL] = 0;
- mir_free(ci.pszVal);
- }
-
- ci.dwFlag = CNF_HOMEPAGE;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
- cfg::eCache[index].iExtraImage[EXTRA_ICON_WEB] = 1;
- mir_free(ci.pszVal);
- }
-
- ci.dwFlag = CNF_CELLULAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
- cfg::eCache[index].iExtraImage[EXTRA_ICON_SMS] = 2;
- mir_free(ci.pszVal);
+ if (index >= 0 && index < cfg::nextCacheEntry) {
+ if (cfg::eCache[index].valid)
+ return;
+ cfg::eCache[index].valid = TRUE;
}
- else {
- ci.dwFlag = CNF_PHONE;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
- cfg::eCache[index].iExtraImage[EXTRA_ICON_SMS] = 2;
- mir_free(ci.pszVal);
- }
- }
-
- // set the mask for valid extra images...
-
- cfg::eCache[index].iExtraValid |= ((cfg::eCache[index].iExtraImage[EXTRA_ICON_EMAIL] != 0xff ? EIMG_SHOW_EMAIL : 0) |
- (cfg::eCache[index].iExtraImage[EXTRA_ICON_WEB] != 0xff ? EIMG_SHOW_WEB : 0) |
- (cfg::eCache[index].iExtraImage[EXTRA_ICON_SMS] != 0xff ? EIMG_SHOW_SMS : 0));
+ else
+ return;
+ cfg::eCache[index].isChatRoom = cfg::getByte(contact->hContact, contact->proto, "ChatRoom", 0);
+ cfg::eCache[index].iExtraValid &= ~(EIMG_SHOW_EMAIL | EIMG_SHOW_SMS | EIMG_SHOW_WEB);
+ memset(cfg::eCache[index].iExtraImage, 0xFF, sizeof(cfg::eCache[index].iExtraImage));
}
void LoadSkinItemToCache(struct TExtraCache *cEntry, const char *szProto)
{
- HANDLE hContact = cEntry->hContact;
-
- if (cfg::getByte(hContact, "EXTBK", "VALID", 0)) {
- if (cEntry->status_item == NULL)
- cEntry->status_item = reinterpret_cast<StatusItems_t *>(malloc(sizeof(StatusItems_t)));
- ZeroMemory(cEntry->status_item, sizeof(StatusItems_t));
- strcpy(cEntry->status_item->szName, "{--CONTACT--}"); // mark as "per contact" item
- cEntry->status_item->IGNORED = 0;
-
- cEntry->status_item->TEXTCOLOR = cfg::getDword(hContact, "EXTBK", "TEXT", RGB(20, 20, 20));
- cEntry->status_item->COLOR = cfg::getDword(hContact, "EXTBK", "COLOR1", RGB(224, 224, 224));
- cEntry->status_item->COLOR2 = cfg::getDword(hContact, "EXTBK", "COLOR2", RGB(224, 224, 224));
- cEntry->status_item->ALPHA = (BYTE)cfg::getByte(hContact, "EXTBK", "ALPHA", 100);
-
- cEntry->status_item->MARGIN_LEFT = (DWORD)cfg::getByte(hContact, "EXTBK", "LEFT", 0);
- cEntry->status_item->MARGIN_RIGHT = (DWORD)cfg::getByte(hContact, "EXTBK", "RIGHT", 0);
- cEntry->status_item->MARGIN_TOP = (DWORD)cfg::getByte(hContact, "EXTBK", "TOP", 0);
- cEntry->status_item->MARGIN_BOTTOM = (DWORD)cfg::getByte(hContact, "EXTBK", "BOTTOM", 0);
-
- cEntry->status_item->COLOR2_TRANSPARENT = (BYTE)cfg::getByte(hContact, "EXTBK", "TRANS", 1);
- cEntry->status_item->BORDERSTYLE = cfg::getDword(hContact, "EXTBK", "BDR", 0);
-
- cEntry->status_item->CORNER = cfg::getByte(hContact, "EXTBK", "CORNER", 0);
- cEntry->status_item->GRADIENT = cfg::getByte(hContact, "EXTBK", "GRAD", 0);
- }
- else if (cEntry->status_item) {
- free(cEntry->status_item);
- cEntry->status_item = NULL;
- }
+ HANDLE hContact = cEntry->hContact;
+
+ if (cfg::getByte(hContact, "EXTBK", "VALID", 0)) {
+ if (cEntry->status_item == NULL)
+ cEntry->status_item = reinterpret_cast<StatusItems_t *>(malloc(sizeof(StatusItems_t)));
+ ZeroMemory(cEntry->status_item, sizeof(StatusItems_t));
+ strcpy(cEntry->status_item->szName, "{--CONTACT--}"); // mark as "per contact" item
+ cEntry->status_item->IGNORED = 0;
+
+ cEntry->status_item->TEXTCOLOR = cfg::getDword(hContact, "EXTBK", "TEXT", RGB(20, 20, 20));
+ cEntry->status_item->COLOR = cfg::getDword(hContact, "EXTBK", "COLOR1", RGB(224, 224, 224));
+ cEntry->status_item->COLOR2 = cfg::getDword(hContact, "EXTBK", "COLOR2", RGB(224, 224, 224));
+ cEntry->status_item->ALPHA = (BYTE)cfg::getByte(hContact, "EXTBK", "ALPHA", 100);
+
+ cEntry->status_item->MARGIN_LEFT = (DWORD)cfg::getByte(hContact, "EXTBK", "LEFT", 0);
+ cEntry->status_item->MARGIN_RIGHT = (DWORD)cfg::getByte(hContact, "EXTBK", "RIGHT", 0);
+ cEntry->status_item->MARGIN_TOP = (DWORD)cfg::getByte(hContact, "EXTBK", "TOP", 0);
+ cEntry->status_item->MARGIN_BOTTOM = (DWORD)cfg::getByte(hContact, "EXTBK", "BOTTOM", 0);
+
+ cEntry->status_item->COLOR2_TRANSPARENT = (BYTE)cfg::getByte(hContact, "EXTBK", "TRANS", 1);
+ cEntry->status_item->BORDERSTYLE = cfg::getDword(hContact, "EXTBK", "BDR", 0);
+
+ cEntry->status_item->CORNER = cfg::getByte(hContact, "EXTBK", "CORNER", 0);
+ cEntry->status_item->GRADIENT = cfg::getByte(hContact, "EXTBK", "GRAD", 0);
+ }
+ else if (cEntry->status_item) {
+ free(cEntry->status_item);
+ cEntry->status_item = NULL;
+ }
}
void ReloadSkinItemsToCache()
{
- int i;
- char *szProto;
-
- for (i = 0; i < cfg::nextCacheEntry; i++) {
- szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cfg::eCache[i].hContact, 0);
- if (szProto)
- LoadSkinItemToCache(&cfg::eCache[i], szProto);
- }
+ for (int i = 0; i < cfg::nextCacheEntry; i++) {
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cfg::eCache[i].hContact, 0);
+ if (szProto)
+ LoadSkinItemToCache(&cfg::eCache[i], szProto);
+ }
}
DWORD CalcXMask(HANDLE hContact)
{
- DWORD dwXMask = cfg::getDword(hContact, "CList", "CLN_xmask", 0);
- int i;
- DWORD dwResult = cfg::dat.dwExtraImageMask, bForced, bHidden;
-
- for (i = 0; i <= 10; i++) {
- bForced = (dwXMask & (1 << (2 * i)));
- bHidden = (dwXMask & (1 << (2 * i + 1)));
- if (bForced == 0 && bHidden == 0)
- continue;
- else if (bForced)
- dwResult |= (1 << i);
- else if (bHidden)
- dwResult &= ~(1 << i);
- }
- return(dwResult);
+ DWORD dwXMask = cfg::getDword(hContact, "CList", "CLN_xmask", 0);
+ DWORD dwResult = cfg::dat.dwExtraImageMask, bForced, bHidden;
+
+ for (int i = 0; i <= 10; i++) {
+ bForced = (dwXMask & (1 << (2 * i)));
+ bHidden = (dwXMask & (1 << (2 * i + 1)));
+ if (bForced == 0 && bHidden == 0)
+ continue;
+ else if (bForced)
+ dwResult |= (1 << i);
+ else if (bHidden)
+ dwResult &= ~(1 << i);
+ }
+ return(dwResult);
}
/*
- * checks the currently active view mode filter and returns true, if the contact should be hidden
- * if no view mode is active, it returns the CList/Hidden setting
- * also cares about sub contacts (if meta is active)
- */
+* checks the currently active view mode filter and returns true, if the contact should be hidden
+* if no view mode is active, it returns the CList/Hidden setting
+* also cares about sub contacts (if meta is active)
+*/
int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struct ClcData *dat)
{
- int dbHidden = cfg::getByte(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
- int filterResult = 1;
- DBVARIANT dbv = {0};
- char szTemp[64];
- TCHAR szGroupMask[256];
- DWORD dwLocalMask;
-
- // always hide subcontacts (but show them on embedded contact lists)
-
- if (cfg::dat.bMetaAvail && dat != NULL && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && cfg::getByte(hContact, cfg::dat.szMetaName, "IsSubcontact", 0))
- return 1;
-
- if (cfg::dat.bFilterEffective) {
- if (szProto == NULL)
- szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- // check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
- if (cfg::dat.bFilterEffective & CLVM_STICKY_CONTACTS) {
- if ((dwLocalMask = cfg::getDword(hContact, "CLVM", cfg::dat.current_viewmode, 0)) != 0) {
- if (cfg::dat.bFilterEffective & CLVM_FILTER_STICKYSTATUS) {
- WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask));
- }
- return 0;
- }
- }
- // check the proto, use it as a base filter result for all further checks
- if (cfg::dat.bFilterEffective & CLVM_FILTER_PROTOS) {
- mir_snprintf(szTemp, sizeof(szTemp), "%s|", szProto);
- filterResult = strstr(cfg::dat.protoFilter, szTemp) ? 1 : 0;
- }
- if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
- if (!cfg::getTString(hContact, "CList", "Group", &dbv)) {
- _sntprintf(szGroupMask, safe_sizeof(szGroupMask), _T("%s|"), &dbv.ptszVal[1]);
- filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0));
- mir_free(dbv.ptszVal);
- }
- else if (cfg::dat.filterFlags & CLVM_INCLUDED_UNGROUPED)
- filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 1;
- else
- filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 0;
- }
- if (cfg::dat.bFilterEffective & CLVM_FILTER_STATUS) {
- WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- filterResult = (cfg::dat.filterFlags & CLVM_GROUPSTATUS_OP) ? ((filterResult | ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0))) : (filterResult & ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0));
- }
- if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG) {
- DWORD now;
- int iEntry = cfg::getCache(hContact, szProto);
- if (iEntry >= 0 && iEntry <= cfg::nextCacheEntry) {
- now = cfg::dat.t_now;
- now -= cfg::dat.lastMsgFilter;
- if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG_OLDERTHAN)
- filterResult = filterResult & (cfg::eCache[iEntry].dwLastMsgTime < now);
- else if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG_NEWERTHAN)
- filterResult = filterResult & (cfg::eCache[iEntry].dwLastMsgTime > now);
+ int dbHidden = cfg::getByte(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
+ int filterResult = 1;
+ DBVARIANT dbv = {0};
+ char szTemp[64];
+ TCHAR szGroupMask[256];
+ DWORD dwLocalMask;
+
+ // always hide subcontacts (but show them on embedded contact lists)
+
+ if (cfg::dat.bMetaAvail && dat != NULL && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && cfg::getByte(hContact, cfg::dat.szMetaName, "IsSubcontact", 0))
+ return 1;
+
+ if (!cfg::dat.bFilterEffective)
+ return dbHidden;
+
+ if (szProto == NULL)
+ szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ // check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
+ if (cfg::dat.bFilterEffective & CLVM_STICKY_CONTACTS) {
+ if ((dwLocalMask = cfg::getDword(hContact, "CLVM", cfg::dat.current_viewmode, 0)) != 0) {
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_STICKYSTATUS) {
+ WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask));
}
+ return 0;
}
- return (dbHidden | !filterResult);
- }
- else
- return dbHidden;
+ }
+ // check the proto, use it as a base filter result for all further checks
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_PROTOS) {
+ mir_snprintf(szTemp, sizeof(szTemp), "%s|", szProto);
+ filterResult = strstr(cfg::dat.protoFilter, szTemp) ? 1 : 0;
+ }
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
+ if (!cfg::getTString(hContact, "CList", "Group", &dbv)) {
+ _sntprintf(szGroupMask, safe_sizeof(szGroupMask), _T("%s|"), &dbv.ptszVal[1]);
+ filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0));
+ mir_free(dbv.ptszVal);
+ }
+ else if (cfg::dat.filterFlags & CLVM_INCLUDED_UNGROUPED)
+ filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 1;
+ else
+ filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 0;
+ }
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_STATUS) {
+ WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ filterResult = (cfg::dat.filterFlags & CLVM_GROUPSTATUS_OP) ? ((filterResult | ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0))) : (filterResult & ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0));
+ }
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG) {
+ DWORD now;
+ int iEntry = cfg::getCache(hContact, szProto);
+ if (iEntry >= 0 && iEntry <= cfg::nextCacheEntry) {
+ now = cfg::dat.t_now;
+ now -= cfg::dat.lastMsgFilter;
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG_OLDERTHAN)
+ filterResult = filterResult & (cfg::eCache[iEntry].dwLastMsgTime < now);
+ else if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG_NEWERTHAN)
+ filterResult = filterResult & (cfg::eCache[iEntry].dwLastMsgTime > now);
+ }
+ }
+ return (dbHidden | !filterResult);
}
diff --git a/plugins/Clist_nicer/src/clcmsgs.cpp b/plugins/Clist_nicer/src/clcmsgs.cpp index 195a8565c8..c1900f2141 100644 --- a/plugins/Clist_nicer/src/clcmsgs.cpp +++ b/plugins/Clist_nicer/src/clcmsgs.cpp @@ -39,23 +39,23 @@ extern LRESULT ( *saveProcessExternalMessages )(HWND hwnd, struct ClcData *dat, LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
- case CLM_SETSTICKY:
- {
- struct ClcContact *contact;
- ClcGroup *group;
-
- if (wParam == 0 || !FindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
- return 0;
- if (lParam)
- contact->flags |= CONTACTF_STICKY;
- else
- contact->flags &= ~CONTACTF_STICKY;
- break;
- }
+ case CLM_SETSTICKY:
+ {
+ ClcContact *contact;
+ ClcGroup *group;
+ if (wParam == 0 || !FindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
+ return 0;
+
+ if (lParam)
+ contact->flags |= CONTACTF_STICKY;
+ else
+ contact->flags &= ~CONTACTF_STICKY;
+ break;
+ }
case CLM_SETEXTRAIMAGEINT:
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
int index = -1;
if (LOWORD(lParam) >= MAXEXTRACOLUMNS || wParam == 0)
@@ -72,14 +72,14 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM //if (contact->bIsMeta && LOWORD(lParam) != EIMG_EXTRA && LOWORD(lParam) != EIMG_CLIENT)
// return 0;
- /*
- if (contact->hContact == 5846286) {
- _DebugTraceA("set extra image %d", LOWORD(lParam));
- }
- */
+ /*
+ if (contact->hContact == 5846286) {
+ _DebugTraceA("set extra image %d", LOWORD(lParam));
+ }
+ */
if (index >= 0 && index < cfg::nextCacheEntry) {
cfg::eCache[index].iExtraImage[LOWORD(lParam)] = (BYTE)HIWORD(lParam);
- cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != (BYTE)0xff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
+ cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != 0xffff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)(contact ? contact->hContact : 0));
}
}
@@ -92,26 +92,26 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM if (LOWORD(lParam) >= MAXEXTRACOLUMNS)
return 0;
- index = cfg::getCache((HANDLE)wParam, NULL);
- if (index >= 0 && index < cfg::nextCacheEntry) {
- cfg::eCache[index].iExtraImage[LOWORD(lParam)] = (BYTE)HIWORD(lParam);
- cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != (BYTE)0xff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
- }
+ index = cfg::getCache((HANDLE)wParam, NULL);
+ if (index >= 0 && index < cfg::nextCacheEntry) {
+ cfg::eCache[index].iExtraImage[LOWORD(lParam)] = (BYTE)HIWORD(lParam);
+ cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != 0xffff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
+ }
hMasterContact = (HANDLE)cfg::getDword((HANDLE)wParam, cfg::dat.szMetaName, "Handle", 0);
index = cfg::getCache(hMasterContact, NULL);
if (index >= 0 && index < cfg::nextCacheEntry) {
cfg::eCache[index].iExtraImage[LOWORD(lParam)] = (BYTE)HIWORD(lParam);
- cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != (BYTE)0xff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
+ cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != 0xffff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
PostMessage(hwnd, INTM_INVALIDATE, 0, 0);
- }
- }
+ }
+ }
return 0;
case CLM_GETSTATUSMSG:
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (wParam == 0)
return 0;
@@ -123,7 +123,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM if (contact->extraCacheEntry >= 0 && contact->extraCacheEntry <= cfg::nextCacheEntry) {
if (cfg::eCache[contact->extraCacheEntry].bStatusMsgValid != STATUSMSG_NOTFOUND)
return((INT_PTR)cfg::eCache[contact->extraCacheEntry].statusMsg);
- } }
+ } }
return 0;
case CLM_SETHIDESUBCONTACTS:
@@ -132,7 +132,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM case CLM_TOGGLEPRIORITYCONTACT:
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (wParam == 0)
return 0;
@@ -148,7 +148,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM }
case CLM_QUERYPRIORITYCONTACT:
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (wParam == 0)
return 0;
@@ -161,7 +161,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM }
case CLM_TOGGLEFLOATINGCONTACT:
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
BYTE state;
int iEntry;
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 0ab595a853..7555aacb94 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -805,218 +805,6 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam return FALSE;
}
-ORDERTREEDATA OrderTreeData[]=
-{
- {EXTRA_ICON_RES0, _T("Reserved, unused"), 9, TRUE, 0},
- {EXTRA_ICON_EMAIL, _T("E-mail"), 0, TRUE, 0},
- {EXTRA_ICON_RES1, _T("Reserved #1"), 7, TRUE, 0},
- {EXTRA_ICON_SMS, _T("Telephone"), 2, TRUE, 0},
- {EXTRA_ICON_ADV1, _T("Advanced #1 (ICQ X-Status)"), 3, TRUE, 0},
- {EXTRA_ICON_ADV2, _T("Advanced #2"), 4, TRUE, 0},
- {EXTRA_ICON_WEB, _T("Homepage"), 1, TRUE, 0},
- {EXTRA_ICON_CLIENT, _T("Client (fingerprint required)"), 10, TRUE, 0},
- {EXTRA_ICON_RES2, _T("Reserved #2"), 8, TRUE, 0},
- {EXTRA_ICON_ADV3, _T("Advanced #3"), 5, TRUE, 0},
- {EXTRA_ICON_ADV4, _T("Advanced #4"), 6, TRUE, 0},
-};
-
-static int dragging=0;
-static HTREEITEM hDragItem=NULL;
-
-static int FillOrderTree(HWND hwndDlg, HWND hwndTree, BYTE *exIconOrder, unsigned dwExtraImageMask)
-{
- TVINSERTSTRUCT tvis = {0};
- TreeView_DeleteAllItems(hwndTree);
- tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
-
- for (int i = 0; i < EXICON_COUNT; i++) {
- int iIndex = (int)(exIconOrder[i] - 1);
- tvis.item.lParam=(LPARAM)(&(OrderTreeData[iIndex]));
- tvis.item.pszText = TranslateTS(OrderTreeData[iIndex].Name);
- OrderTreeData[iIndex].Visible = (dwExtraImageMask & (1 << OrderTreeData[iIndex].ID)) != 0;
- tvis.item.iImage = tvis.item.iSelectedImage = OrderTreeData[iIndex].Visible;
- TreeView_InsertItem(hwndTree, &tvis);
- }
-
- return 0;
-}
-
-static int SaveOrderTree(HWND hwndDlg, HWND hwndTree, DISPLAYPROFILE *p)
-{
- TVITEM tvi = {0};
- tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
-
- p->dwExtraImageMask = 0;
-
- HTREEITEM ht = TreeView_GetRoot(hwndTree);
- for (int iIndex = 0; ht != NULL; iIndex++) {
- tvi.hItem = ht;
- TreeView_GetItem(hwndTree, &tvi);
-
- ORDERTREEDATA *it = (ORDERTREEDATA *)(tvi.lParam);
- p->exIconOrder[iIndex] = it->ID + 1;
- p->dwExtraImageMask |= (it->Visible ? (1 << it->ID) : 0);
- ht = TreeView_GetNextSibling(hwndTree, ht);
- }
-
- return 0;
-}
-
-static INT_PTR CALLBACK DlgProcXIcons(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- DISPLAYPROFILE *p;
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_EXTRAORDER), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_EXTRAORDER),GWL_STYLE)|TVS_NOHSCROLL);
-
- if (himlCheckBoxes == 0)
- CreateStateImageList();
-
- TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_EXTRAORDER), himlCheckBoxes, TVSIL_NORMAL);
- return TRUE;
-
- case WM_COMMAND:
- if ((LOWORD(wParam) == IDC_EXICONSCALE) && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()))
- return 0;
-
- if (IDC_RESETXICONS == LOWORD(wParam)) {
- BYTE exIconOrder[EXICON_COUNT];
- for (int i = 0; i < EXICON_COUNT; i++) {
- OrderTreeData[i].Visible = TRUE;
- exIconOrder[i] = i + 1;
- }
- FillOrderTree(hwndDlg, GetDlgItem(hwndDlg, IDC_EXTRAORDER), exIconOrder, 0xffffffff);
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
- case WM_USER + 100:
- p = (DISPLAYPROFILE *)lParam;
- if (p) {
- SendDlgItemMessage(hwndDlg, IDC_EXICONSCALESPIN, UDM_SETRANGE, 0, MAKELONG(20, 8));
- SendDlgItemMessage(hwndDlg, IDC_EXICONSCALESPIN, UDM_SETPOS, 0, (LPARAM)p->exIconScale);
- FillOrderTree(hwndDlg, GetDlgItem(hwndDlg, IDC_EXTRAORDER), p->exIconOrder, p->dwExtraImageMask);
- }
- return 0;
-
- case WM_USER + 200:
- p = (DISPLAYPROFILE *)lParam;
- if (p) {
- SaveOrderTree(hwndDlg, GetDlgItem(hwndDlg, IDC_EXTRAORDER), p);
-
- p->exIconScale = SendDlgItemMessage(hwndDlg, IDC_EXICONSCALESPIN, UDM_GETPOS, 0, 0);
- p->exIconScale = (p->exIconScale < 8 || p->exIconScale > 20) ? 16 : p->exIconScale;
- }
- return 0;
-
- case WM_NOTIFY:
- if (((LPNMHDR) lParam)->idFrom == IDC_EXTRAORDER) {
- switch (((LPNMHDR)lParam)->code) {
- case TVN_BEGINDRAGA:
- case TVN_BEGINDRAGW:
- SetCapture(hwndDlg);
- dragging=1;
- hDragItem=((LPNMTREEVIEWA)lParam)->itemNew.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hDragItem);
- break;
- case NM_CLICK:
- {
- TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if (hti.flags&TVHT_ONITEMICON)
- {
- TVITEMA tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvi.hItem=hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- tvi.iImage=tvi.iSelectedImage=!tvi.iImage;
- ((ORDERTREEDATA *)tvi.lParam)->Visible=tvi.iImage;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- }
- }
- break;
- }
- switch (((LPNMHDR) lParam)->code) {
- case PSN_APPLY:
- return TRUE;
- }
- break;
-
- case WM_MOUSEMOVE:
- if (dragging) {
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(lParam);
- hti.pt.y = (short)HIWORD(lParam);
- ClientToScreen(hwndDlg, &hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg, IDC_EXTRAORDER), &hti.pt);
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER), &hti);
- if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)) {
- HTREEITEM it = hti.hItem;
- hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_EXTRAORDER)) / 2;
- TreeView_HitTest(GetDlgItem(hwndDlg, IDC_EXTRAORDER), &hti);
- //TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hti.hItem,1);
- if (!(hti.flags & TVHT_ABOVE))
- TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_EXTRAORDER), hti.hItem, 1);
- else
- TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_EXTRAORDER), it, 0);
- }
- else {
- if (hti.flags & TVHT_ABOVE) SendDlgItemMessage(hwndDlg,IDC_EXTRAORDER, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0);
- if (hti.flags & TVHT_BELOW) SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0);
- TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_EXTRAORDER), NULL, 0);
- }
- }
- break;
-
- case WM_LBUTTONUP:
- if (dragging) {
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,0);
- dragging=0;
- ReleaseCapture();
-
- TVHITTESTINFO hti;
- TVITEM tvi;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
- ClientToScreen(hwndDlg,&hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti.pt);
- hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_EXTRAORDER))/2;
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti);
- if (hDragItem==hti.hItem) break;
- if (hti.flags&TVHT_ABOVE) hti.hItem=TVI_FIRST;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hDragItem;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvi);
- if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)||(hti.hItem==TVI_FIRST)) {
- TVINSERTSTRUCT tvis;
- TCHAR name[128];
- tvis.item.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvis.item.stateMask=0xFFFFFFFF;
- tvis.item.pszText=name;
- tvis.item.cchTextMax=sizeof(name);
- tvis.item.hItem=hDragItem;
- tvis.item.iImage=tvis.item.iSelectedImage=((ORDERTREEDATA *)tvi.lParam)->Visible;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvis.item);
- TreeView_DeleteItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hDragItem);
- tvis.hParent=NULL;
- tvis.hInsertAfter=hti.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),TreeView_InsertItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvis));
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- }
- break;
- }
- return FALSE;
-}
-
static INT_PTR CALLBACK DlgProcIcons(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
DISPLAYPROFILE *p;
@@ -1145,16 +933,6 @@ static INT_PTR CALLBACK DlgProcDspProfiles(HWND hwnd, UINT msg, WPARAM wParam, L if (IS_THEMED)
API::pfnEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
- if ( !ServiceExists(MS_EXTRAICON_REGISTER)) {
- tci.lParam = (LPARAM)CreateDialog(g_hInst,MAKEINTRESOURCE(IDD_OPT_XICONS), hwnd, DlgProcXIcons);
- tci.pszText = TranslateT("Extra Icons");
- TabCtrl_InsertItem(hwndTab, ++iOrder, &tci);
- MoveWindow((HWND)tci.lParam,64,25,rcClient.right-128,rcClient.bottom-67,1);
- ShowWindow((HWND)tci.lParam, oPage == iOrder ? SW_SHOW : SW_HIDE);
- if (IS_THEMED)
- API::pfnEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
- }
-
tci.lParam = (LPARAM)CreateDialog(g_hInst,MAKEINTRESOURCE(IDD_OPT_DSPADVANCED), hwnd, DlgProcDspAdvanced);
tci.pszText = TranslateT("Advanced");
TabCtrl_InsertItem(hwndTab, ++iOrder, &tci);
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index 99625c23f0..45a525e65d 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -1,34 +1,31 @@ /*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
- * Miranda IM: the free IM client for Microsoft* Windows*
- *
- * Copyright 2000-2010 Miranda ICQ/IM project,
- * all portions of this codebase are copyrighted to the people
- * listed in contributors.txt.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * you should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * part of clist_nicer plugin for Miranda.
- *
- * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors
- *
- * $Id: clcpaint.cpp 12909 2010-10-06 14:53:00Z silvercircle $
- *
- */
+* Miranda IM: the free IM client for Microsoft* Windows*
+*
+* Copyright 2000-2010 Miranda ICQ/IM project,
+* all portions of this codebase are copyrighted to the people
+* listed in contributors.txt.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* you should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+* part of clist_nicer plugin for Miranda.
+*
+* (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors
+*
+* $Id: clcpaint.cpp 12909 2010-10-06 14:53:00Z silvercircle $
+*
+*/
#include "commonheaders.h"
@@ -38,7 +35,6 @@ extern int g_curAvatar; extern ImageItem *g_glyphItem;
extern int hClcProtoCount;
-extern ORDERTREEDATA OrderTreeData[];
extern HIMAGELIST hCListImages;
static BYTE divide3[765] = {255};
@@ -62,19 +58,12 @@ int g_list_avatars = 0; HFONT __fastcall ChangeToFont(HDC hdc, struct ClcData *dat, int id, int *fontHeight)
{
- HFONT hOldFont = 0;
- /*
- hOldFont = SelectObject(hdc, dat->fontInfo[id].hFont);
- SetTextColor(hdc, dat->fontInfo[id].colour);
+ HFONT hOldFont = reinterpret_cast<HFONT>(SelectObject(hdc, cfg::clcdat->fontInfo[id].hFont));
+ SetTextColor(hdc, cfg::clcdat->fontInfo[id].colour);
if (fontHeight)
- *fontHeight = dat->fontInfo[id].fontHeight;
- */
- hOldFont = reinterpret_cast<HFONT>(SelectObject(hdc, cfg::clcdat->fontInfo[id].hFont));
- SetTextColor(hdc, cfg::clcdat->fontInfo[id].colour);
- if (fontHeight)
- *fontHeight = cfg::clcdat->fontInfo[id].fontHeight;
-
- dat->currentFontID = id;
+ *fontHeight = cfg::clcdat->fontInfo[id].fontHeight;
+
+ dat->currentFontID = id;
return hOldFont;
}
@@ -134,24 +123,24 @@ int __fastcall GetStatusOnlineness(int status) return 120;
switch (status) {
- case ID_STATUS_FREECHAT:
- return 110;
- case ID_STATUS_ONLINE:
- return 100;
- case ID_STATUS_OCCUPIED:
- return 60;
- case ID_STATUS_ONTHEPHONE:
- return 50;
- case ID_STATUS_DND:
- return 40;
- case ID_STATUS_AWAY:
- return 30;
- case ID_STATUS_OUTTOLUNCH:
- return 20;
- case ID_STATUS_NA:
- return 10;
- case ID_STATUS_INVISIBLE:
- return 5;
+ case ID_STATUS_FREECHAT:
+ return 110;
+ case ID_STATUS_ONLINE:
+ return 100;
+ case ID_STATUS_OCCUPIED:
+ return 60;
+ case ID_STATUS_ONTHEPHONE:
+ return 50;
+ case ID_STATUS_DND:
+ return 40;
+ case ID_STATUS_AWAY:
+ return 30;
+ case ID_STATUS_OUTTOLUNCH:
+ return 20;
+ case ID_STATUS_NA:
+ return 10;
+ case ID_STATUS_INVISIBLE:
+ return 5;
}
return 0;
}
@@ -176,7 +165,7 @@ static int __fastcall GetGeneralisedStatus(void) return status;
}
-static int __fastcall GetRealStatus(struct ClcContact *contact, int status)
+static int __fastcall GetRealStatus(ClcContact *contact, int status)
{
int i;
char *szProto = contact->proto;
@@ -190,7 +179,7 @@ static int __fastcall GetRealStatus(struct ClcContact *contact, int status) return status;
}
-int GetBasicFontID(struct ClcContact * contact)
+int GetBasicFontID(ClcContact * contact)
{
switch (contact->type)
{
@@ -273,7 +262,7 @@ HDC hdcAV; LONG g_maxAV_X = 200, g_maxAV_Y = 200;
-static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contact, int y, struct ClcData *dat, WORD cstatus, int rowHeight, DWORD dwFlags)
+static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, ClcContact *contact, int y, struct ClcData *dat, WORD cstatus, int rowHeight, DWORD dwFlags)
{
float dScale = 0.;
float newHeight, newWidth;
@@ -286,11 +275,11 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac HRGN rgn = 0;
int avatar_size = cfg::dat.avatarSize;
DWORD av_saved_left;
- StatusItems_t *item = contact->wStatus == ID_STATUS_OFFLINE ? &StatusItems[ID_EXTBKAVATARFRAMEOFFLINE - ID_STATUS_OFFLINE] : &StatusItems[ID_EXTBKAVATARFRAME - ID_STATUS_OFFLINE];
- int skinMarginX, skinMarginY;
- BOOL fOverlay = (cfg::dat.dwFlags & CLUI_FRAME_OVERLAYICONS);
+ StatusItems_t *item = contact->wStatus == ID_STATUS_OFFLINE ? &StatusItems[ID_EXTBKAVATARFRAMEOFFLINE - ID_STATUS_OFFLINE] : &StatusItems[ID_EXTBKAVATARFRAME - ID_STATUS_OFFLINE];
+ int skinMarginX, skinMarginY;
+ BOOL fOverlay = (cfg::dat.dwFlags & CLUI_FRAME_OVERLAYICONS);
- contact->avatarLeft = -1;
+ contact->avatarLeft = -1;
if (!cfg::dat.bAvatarServiceAvail || dat->bisEmbedded)
return 0;
@@ -318,30 +307,30 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac if (bmHeight == 0 || bmWidth == 0 || hbm == 0)
return 0;
- g_maxAV_X = max(bmWidth, g_maxAV_X);
- g_maxAV_Y = max(bmHeight, g_maxAV_Y);
+ g_maxAV_X = max(bmWidth, g_maxAV_X);
+ g_maxAV_Y = max(bmHeight, g_maxAV_Y);
if (dAspect >= 1.0) { // height > width
- skinMarginY = item->IGNORED ? 0 : (item->MARGIN_TOP + item->MARGIN_BOTTOM);
- skinMarginX = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
+ skinMarginY = item->IGNORED ? 0 : (item->MARGIN_TOP + item->MARGIN_BOTTOM);
+ skinMarginX = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
- dScale = (float)(avatar_size - 2) / (float)bmHeight;
+ dScale = (float)(avatar_size - 2) / (float)bmHeight;
newHeight = (float)(avatar_size - skinMarginY - 2);
newWidth = (float)(bmWidth * dScale) - skinMarginX;
}
else {
- skinMarginY = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
- skinMarginX = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
+ skinMarginY = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
+ skinMarginX = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
- newWidth = (float)(avatar_size - 2) - skinMarginX;
+ newWidth = (float)(avatar_size - 2) - skinMarginX;
dScale = (float)(avatar_size - 2) / (float)bmWidth;
newHeight = (float)(bmHeight * dScale) - skinMarginY;
}
topoffset = rowHeight > (int)newHeight ? (rowHeight - (int)newHeight) / 2 : 0;
- if (!item->IGNORED) {
- //topoffset += item->MARGIN_TOP;
- leftoffset = item->MARGIN_LEFT;
- }
+ if (!item->IGNORED) {
+ //topoffset += item->MARGIN_TOP;
+ leftoffset = item->MARGIN_LEFT;
+ }
// create the region for the avatar border - use the same region for clipping, if needed.
av_saved_left = rc->left;
@@ -353,30 +342,22 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac else
rgn = CreateRectRgn(leftoffset + rc->left, y + topoffset, leftoffset + rc->left + (int)newWidth, y + topoffset + (int)newHeight);
- hbmOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcAV, hbm));
- bf.SourceConstantAlpha = 255; //(g_CluiData.dwFlags & CLUI_FRAME_TRANSPARENTAVATAR && (UCHAR)saved_alpha > 20) ? (UCHAR)saved_alpha : 255;
- bf.AlphaFormat = contact->ace->dwFlags & AVS_PREMULTIPLIED ? AC_SRC_ALPHA : 0;
-
- /*
- if (dat->showIdle && contact->flags & CONTACTF_IDLE)
- bf.SourceConstantAlpha -= (bf.SourceConstantAlpha > 100 ? 50 : 0);
- */
-
- SelectClipRgn(hdcMem, rgn);
- SetStretchBltMode(hdcMem, HALFTONE);
- if (bf.SourceConstantAlpha == 255 && bf.AlphaFormat == 0) {
- StretchBlt(hdcMem, leftoffset + rc->left - (g_RTL ? 1 : 0), y + topoffset, (int)newWidth, (int)newHeight, hdcAvatar, 0, 0, bmWidth, bmHeight, SRCCOPY);
- }
- else {
- /*
- * get around SUCKY AlphaBlend() rescaling quality...
- */
- SetStretchBltMode(hdcTempAV, HALFTONE);
- StretchBlt(hdcTempAV, 0, 0, bmWidth, bmHeight, hdcMem, leftoffset + rc->left, y + topoffset, (int)newWidth, (int)newHeight, SRCCOPY);
- API::pfnAlphaBlend(hdcTempAV, 0, 0, bmWidth, bmHeight, hdcAvatar, 0, 0, bmWidth, bmHeight, bf);
- StretchBlt(hdcMem, leftoffset + rc->left - (g_RTL ? 1 : 0), y + topoffset, (int)newWidth, (int)newHeight, hdcTempAV, 0, 0, bmWidth, bmHeight, SRCCOPY);
- }
- SelectObject(hdcAV, hbmOldAV);
+ hbmOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcAV, hbm));
+ bf.SourceConstantAlpha = 255; //(g_CluiData.dwFlags & CLUI_FRAME_TRANSPARENTAVATAR && (UCHAR)saved_alpha > 20) ? (UCHAR)saved_alpha : 255;
+ bf.AlphaFormat = contact->ace->dwFlags & AVS_PREMULTIPLIED ? AC_SRC_ALPHA : 0;
+
+ SelectClipRgn(hdcMem, rgn);
+ SetStretchBltMode(hdcMem, HALFTONE);
+ if (bf.SourceConstantAlpha == 255 && bf.AlphaFormat == 0) {
+ StretchBlt(hdcMem, leftoffset + rc->left - (g_RTL ? 1 : 0), y + topoffset, (int)newWidth, (int)newHeight, hdcAvatar, 0, 0, bmWidth, bmHeight, SRCCOPY);
+ }
+ else {
+ SetStretchBltMode(hdcTempAV, HALFTONE);
+ StretchBlt(hdcTempAV, 0, 0, bmWidth, bmHeight, hdcMem, leftoffset + rc->left, y + topoffset, (int)newWidth, (int)newHeight, SRCCOPY);
+ API::pfnAlphaBlend(hdcTempAV, 0, 0, bmWidth, bmHeight, hdcAvatar, 0, 0, bmWidth, bmHeight, bf);
+ StretchBlt(hdcMem, leftoffset + rc->left - (g_RTL ? 1 : 0), y + topoffset, (int)newWidth, (int)newHeight, hdcTempAV, 0, 0, bmWidth, bmHeight, SRCCOPY);
+ }
+ SelectObject(hdcAV, hbmOldAV);
if (cfg::dat.dwFlags & CLUI_FRAME_AVATARBORDER) {
if (g_RTL)
@@ -384,54 +365,54 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac FrameRgn(hdcMem, rgn, cfg::dat.hBrushAvatarBorder, 1, 1);
}
- if (fOverlay)
- fOverlay = (dwFlags & ECF_HIDEOVERLAY) ? 0 : 1;
- else
- fOverlay = (dwFlags & ECF_FORCEOVERLAY) ? 1 : 0;
+ if (fOverlay)
+ fOverlay = (dwFlags & ECF_HIDEOVERLAY) ? 0 : 1;
+ else
+ fOverlay = (dwFlags & ECF_FORCEOVERLAY) ? 1 : 0;
- if (fOverlay && cstatus && (int)newHeight >= g_cysmIcon)
+ if (fOverlay && cstatus && (int)newHeight >= g_cysmIcon)
DrawIconEx(hdcMem, rc->left + (int)newWidth - 15, y + topoffset + (int)newHeight - 15, overlayicons[cstatus - ID_STATUS_OFFLINE], g_cxsmIcon, g_cysmIcon, 0, 0, DI_NORMAL | DI_COMPAT);
SelectClipRgn(hdcMem, NULL);
DeleteObject(rgn);
- if (!item->IGNORED) {
- RECT rcFrame;
- BOOL inClCPaint_save = g_inCLCpaint;
- HDC hdcTemp = 0, hdcSaved = 0;
- HBITMAP hbmOld, hbmTemp;
-
- g_inCLCpaint = FALSE;
- rcFrame.left = rc->left;
- rcFrame.top = y + topoffset - item->MARGIN_TOP;
- rcFrame.right = rcFrame.left + (int)newWidth + item->MARGIN_RIGHT + item->MARGIN_LEFT;
- rcFrame.bottom = rcFrame.top + (int)newHeight + item->MARGIN_BOTTOM + item->MARGIN_TOP;
- if (g_RTL) {
- RECT rcTemp;
-
- OffsetRect(&rcFrame, 1, 0);
- rcTemp.left = rcTemp.top = 0;
- rcTemp.right = rcFrame.right - rcFrame.left;
- rcTemp.bottom = rcFrame.bottom - rcFrame.top;
- hdcTemp = CreateCompatibleDC(g_HDC);
- hbmTemp = CreateCompatibleBitmap(g_HDC, rcTemp.right, rcTemp.bottom);
- hbmOld = reinterpret_cast<HBITMAP>(SelectObject(hdcTemp, hbmTemp));
- API::pfnSetLayout(hdcTemp, LAYOUT_RTL);
- BitBlt(hdcTemp, 0, 0, rcTemp.right, rcTemp.bottom,
- hdcMem, rcFrame.left, rcFrame.top, SRCCOPY);
- API::pfnSetLayout(hdcTemp, 0);
- DrawAlpha(hdcTemp, &rcTemp, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
- item->CORNER, item->BORDERSTYLE, item->imageItem);
- BitBlt(hdcMem, rcFrame.left, rcFrame.top, rcFrame.right - rcFrame.left, rcFrame.bottom - rcFrame.top,
- hdcTemp, 0, 0, SRCCOPY);
- SelectObject(hdcTemp, hbmOld);
- DeleteObject(hbmTemp);
- DeleteDC(hdcTemp);
- } else
- DrawAlpha(hdcMem, &rcFrame, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
- item->CORNER, item->BORDERSTYLE, item->imageItem);
- g_inCLCpaint = inClCPaint_save;
- }
+ if (!item->IGNORED) {
+ RECT rcFrame;
+ BOOL inClCPaint_save = g_inCLCpaint;
+ HDC hdcTemp = 0, hdcSaved = 0;
+ HBITMAP hbmOld, hbmTemp;
+
+ g_inCLCpaint = FALSE;
+ rcFrame.left = rc->left;
+ rcFrame.top = y + topoffset - item->MARGIN_TOP;
+ rcFrame.right = rcFrame.left + (int)newWidth + item->MARGIN_RIGHT + item->MARGIN_LEFT;
+ rcFrame.bottom = rcFrame.top + (int)newHeight + item->MARGIN_BOTTOM + item->MARGIN_TOP;
+ if (g_RTL) {
+ RECT rcTemp;
+
+ OffsetRect(&rcFrame, 1, 0);
+ rcTemp.left = rcTemp.top = 0;
+ rcTemp.right = rcFrame.right - rcFrame.left;
+ rcTemp.bottom = rcFrame.bottom - rcFrame.top;
+ hdcTemp = CreateCompatibleDC(g_HDC);
+ hbmTemp = CreateCompatibleBitmap(g_HDC, rcTemp.right, rcTemp.bottom);
+ hbmOld = reinterpret_cast<HBITMAP>(SelectObject(hdcTemp, hbmTemp));
+ API::pfnSetLayout(hdcTemp, LAYOUT_RTL);
+ BitBlt(hdcTemp, 0, 0, rcTemp.right, rcTemp.bottom,
+ hdcMem, rcFrame.left, rcFrame.top, SRCCOPY);
+ API::pfnSetLayout(hdcTemp, 0);
+ DrawAlpha(hdcTemp, &rcTemp, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
+ item->CORNER, item->BORDERSTYLE, item->imageItem);
+ BitBlt(hdcMem, rcFrame.left, rcFrame.top, rcFrame.right - rcFrame.left, rcFrame.bottom - rcFrame.top,
+ hdcTemp, 0, 0, SRCCOPY);
+ SelectObject(hdcTemp, hbmOld);
+ DeleteObject(hbmTemp);
+ DeleteDC(hdcTemp);
+ } else
+ DrawAlpha(hdcMem, &rcFrame, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
+ item->CORNER, item->BORDERSTYLE, item->imageItem);
+ g_inCLCpaint = inClCPaint_save;
+ }
contact->avatarLeft = rc->left;
avatar_done = TRUE;
rc->left = av_saved_left;
@@ -449,7 +430,7 @@ static BOOL mirror_rtl, mirror_always, mirror_rtltext; BYTE savedCORNER = -1;
int g_padding_y = 0;
-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 __inline PaintItem(HDC hdcMem, ClcGroup *group, 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;
@@ -486,7 +467,7 @@ void __inline PaintItem(HDC hdcMem, ClcGroup *group, struct ClcContact *contact, g_RTL = FALSE;
scanIndex = group->scanIndex;
- av_local_wanted = (g_list_avatars > 0);
+ av_local_wanted = (g_list_avatars > 0);
type = contact->type;
flags = contact->flags;
@@ -498,10 +479,10 @@ void __inline PaintItem(HDC hdcMem, ClcGroup *group, struct ClcContact *contact, cEntry = cfg::eCache;
- if (dat->bisEmbedded)
- goto set_bg_l;
+ if (dat->bisEmbedded)
+ goto set_bg_l;
- if (type == CLCIT_CONTACT && (cEntry->dwCFlags & ECF_RTLNICK || mirror_always)) {
+ if (type == CLCIT_CONTACT && (cEntry->dwCFlags & ECF_RTLNICK || mirror_always)) {
if (API::pfnSetLayout != NULL && (mirror_rtl || mirror_always)) {
g_RTL = TRUE;
bg_indent_r = cfg::dat.bApplyIndentToBg ? indent * dat->groupIndent : 0;
@@ -542,9 +523,9 @@ set_bg_l: else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
} else if (type == CLCIT_DIVIDER) {
- ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight);
- GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize);
- }
+ ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight);
+ GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize);
+ }
else if (type == CLCIT_CONTACT && flags & CONTACTF_NOTONLIST)
ChangeToFont(hdcMem, dat, FONTID_NOTONLIST, &fontHeight);
else if (type == CLCIT_CONTACT && ((flags & CONTACTF_INVISTO && GetRealStatus(contact, my_status) != ID_STATUS_INVISIBLE) || (flags & CONTACTF_VISTO && GetRealStatus(contact, my_status) == ID_STATUS_INVISIBLE))) {
@@ -556,9 +537,9 @@ set_bg_l: else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
- if (type == CLCIT_GROUP) {
- GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize);
- width = textSize.cx;
+ if (type == CLCIT_GROUP) {
+ GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize);
+ width = textSize.cx;
szCounts = pcli->pfnGetGroupCountsText(dat, contact);
if (szCounts[0]) {
GetTextExtentPoint32(hdcMem, _T(" "), 1, &spaceSize);
@@ -581,22 +562,22 @@ set_bg_l: g_hottrack_done = 0;
check_selected = (!selected || selBlend);
- if (dat->bisEmbedded) {
- rc.left = bg_indent_l;
- rc.top = y;
- rc.right = clRect->right - bg_indent_r;
- rc.bottom = y + rowHeight;
- if (selected) {
- FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
- SetTextColor(hdcMem, dat->selTextColour);
- }
- else {
- FillRect(hdcMem, &rc, cfg::dat.hBrushCLCBk);
- if (g_hottrack)
- SetHotTrackColour(hdcMem,dat);
- }
- goto bgskipped;
- }
+ if (dat->bisEmbedded) {
+ rc.left = bg_indent_l;
+ rc.top = y;
+ rc.right = clRect->right - bg_indent_r;
+ rc.bottom = y + rowHeight;
+ if (selected) {
+ FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
+ SetTextColor(hdcMem, dat->selTextColour);
+ }
+ else {
+ FillRect(hdcMem, &rc, cfg::dat.hBrushCLCBk);
+ if (g_hottrack)
+ SetHotTrackColour(hdcMem,dat);
+ }
+ goto bgskipped;
+ }
if (type == CLCIT_CONTACT || type == CLCIT_DIVIDER) {
StatusItems_t *sitem, *sfirstitem, *ssingleitem, *slastitem, *slastitem_NG,
@@ -605,25 +586,25 @@ set_bg_l: if (cstatus >= ID_STATUS_OFFLINE && cstatus <= ID_STATUS_OUTTOLUNCH) {
BYTE perstatus_ignored;
- if ((flags & CONTACTF_IDLE) && !StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE].IGNORED)
- sitem = &StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE];
- else
- sitem = &StatusItems[cstatus - ID_STATUS_OFFLINE];
+ if ((flags & CONTACTF_IDLE) && !StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE].IGNORED)
+ sitem = &StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE];
+ else
+ sitem = &StatusItems[cstatus - ID_STATUS_OFFLINE];
- if (!dat->bisEmbedded) {
- pp_item = cEntry->status_item ? cEntry->status_item : cEntry->proto_status_item;
+ if (!dat->bisEmbedded) {
+ pp_item = cEntry->status_item ? cEntry->status_item : cEntry->proto_status_item;
- if (!(perstatus_ignored = sitem->IGNORED) && !(flags & CONTACTF_NOTONLIST))
- SetTextColor(hdcMem, sitem->TEXTCOLOR);
+ if (!(perstatus_ignored = sitem->IGNORED) && !(flags & CONTACTF_NOTONLIST))
+ SetTextColor(hdcMem, sitem->TEXTCOLOR);
- if (cfg::dat.bUsePerProto && pp_item && !pp_item->IGNORED) {
- sitem = pp_item;
- if ((perstatus_ignored || cfg::dat.bOverridePerStatusColors) && sitem->TEXTCOLOR != -1)
- SetTextColor(hdcMem, sitem->TEXTCOLOR);
- }
- }
- else if (!sitem->IGNORED)
- SetTextColor(hdcMem, sitem->TEXTCOLOR);
+ if (cfg::dat.bUsePerProto && pp_item && !pp_item->IGNORED) {
+ sitem = pp_item;
+ if ((perstatus_ignored || cfg::dat.bOverridePerStatusColors) && sitem->TEXTCOLOR != -1)
+ SetTextColor(hdcMem, sitem->TEXTCOLOR);
+ }
+ }
+ else if (!sitem->IGNORED)
+ SetTextColor(hdcMem, sitem->TEXTCOLOR);
sevencontact_pos = &StatusItems[ID_EXTBKEVEN_CNTCTPOS - ID_STATUS_OFFLINE];
soddcontact_pos = &StatusItems[ID_EXTBKODD_CNTCTPOS - ID_STATUS_OFFLINE];
@@ -692,7 +673,7 @@ set_bg_l: rc.top = y + slastitem->MARGIN_TOP;
rc.right = clRect->right - slastitem->MARGIN_RIGHT - bg_indent_r;
rc.bottom = y + rowHeight - slastitem->MARGIN_BOTTOM;
- rc.bottom = y + rowHeight - slastitem->MARGIN_BOTTOM;
+ rc.bottom = y + rowHeight - slastitem->MARGIN_BOTTOM;
// draw odd/even contact underlay
if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
@@ -738,71 +719,71 @@ set_bg_l: }
if (check_selected)
DrawAlpha(hdcMem, &rc, sfirstitem_NG->COLOR, sfirstitem_NG->ALPHA, sfirstitem_NG->COLOR2, sfirstitem_NG->COLOR2_TRANSPARENT, sfirstitem_NG->GRADIENT, sfirstitem_NG->CORNER, sfirstitem->BORDERSTYLE, sfirstitem->imageItem);
- } else if (type != CLCIT_GROUP // not a group
- && group->parent == NULL && !slastitem_NG->IGNORED && scanIndex == group->cl.count - 1 && (*bFirstNGdrawn)) {
- // last item of list (NON-group)
- // last NON-grouped
- rc.left = slastitem_NG->MARGIN_LEFT + bg_indent_l;
- rc.top = y + slastitem_NG->MARGIN_TOP;
- rc.right = clRect->right - slastitem_NG->MARGIN_RIGHT - bg_indent_r;
- rc.bottom = y + rowHeight - slastitem_NG->MARGIN_BOTTOM;
-
- // draw odd/even contact underlay
- if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, slastitem_NG->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
- } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, slastitem_NG->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
- }
-
- if (!sitem->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, slastitem_NG->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
- savedCORNER = slastitem_NG->CORNER;
- }
+ } else if (type != CLCIT_GROUP // not a group
+ && group->parent == NULL && !slastitem_NG->IGNORED && scanIndex == group->cl.count - 1 && (*bFirstNGdrawn)) {
+ // last item of list (NON-group)
+ // last NON-grouped
+ rc.left = slastitem_NG->MARGIN_LEFT + bg_indent_l;
+ rc.top = y + slastitem_NG->MARGIN_TOP;
+ rc.right = clRect->right - slastitem_NG->MARGIN_RIGHT - bg_indent_r;
+ rc.bottom = y + rowHeight - slastitem_NG->MARGIN_BOTTOM;
+
+ // draw odd/even contact underlay
+ if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, slastitem_NG->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
+ } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, slastitem_NG->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
+ }
+
+ if (!sitem->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, slastitem_NG->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
+ savedCORNER = slastitem_NG->CORNER;
+ }
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, slastitem_NG->COLOR, slastitem_NG->ALPHA, slastitem_NG->COLOR2, slastitem_NG->COLOR2_TRANSPARENT, slastitem_NG->GRADIENT, slastitem_NG->CORNER, slastitem->BORDERSTYLE, slastitem->imageItem);
+ } else if (type != CLCIT_GROUP // not a group
+ && group->parent == NULL && !slastitem_NG->IGNORED && !(*bFirstNGdrawn)) {
+ // single item of NON-group
+ // single NON-grouped
+ rc.left = ssingleitem_NG->MARGIN_LEFT + bg_indent_l;
+ rc.top = y + ssingleitem_NG->MARGIN_TOP;
+ rc.right = clRect->right - ssingleitem_NG->MARGIN_RIGHT - bg_indent_r;
+ rc.bottom = y + rowHeight - ssingleitem_NG->MARGIN_BOTTOM;
+
+ // draw odd/even contact underlay
+ if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, ssingleitem_NG->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
+ } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, ssingleitem_NG->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
+ }
+
+ if (!sitem->IGNORED) {
if (check_selected)
- DrawAlpha(hdcMem, &rc, slastitem_NG->COLOR, slastitem_NG->ALPHA, slastitem_NG->COLOR2, slastitem_NG->COLOR2_TRANSPARENT, slastitem_NG->GRADIENT, slastitem_NG->CORNER, slastitem->BORDERSTYLE, slastitem->imageItem);
- } else if (type != CLCIT_GROUP // not a group
- && group->parent == NULL && !slastitem_NG->IGNORED && !(*bFirstNGdrawn)) {
- // single item of NON-group
- // single NON-grouped
- rc.left = ssingleitem_NG->MARGIN_LEFT + bg_indent_l;
- rc.top = y + ssingleitem_NG->MARGIN_TOP;
- rc.right = clRect->right - ssingleitem_NG->MARGIN_RIGHT - bg_indent_r;
- rc.bottom = y + rowHeight - ssingleitem_NG->MARGIN_BOTTOM;
-
- // draw odd/even contact underlay
- if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, ssingleitem_NG->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
- } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, ssingleitem_NG->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
- }
-
- if (!sitem->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, ssingleitem_NG->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
- savedCORNER = ssingleitem_NG->CORNER;
- }
- if (check_selected)
- DrawAlpha(hdcMem, &rc, ssingleitem_NG->COLOR, ssingleitem_NG->ALPHA, ssingleitem_NG->COLOR2, ssingleitem_NG->COLOR2_TRANSPARENT, ssingleitem_NG->GRADIENT, ssingleitem_NG->CORNER, ssingleitem->BORDERSTYLE, ssingleitem->imageItem);
- } else if (!sitem->IGNORED) {
- // draw default grouped
- // draw odd/even contact underlay
- if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, sitem->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
- } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, sitem->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
- }
-
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, sitem->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
- savedCORNER = sitem->CORNER;
- }
+ DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, ssingleitem_NG->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
+ savedCORNER = ssingleitem_NG->CORNER;
+ }
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, ssingleitem_NG->COLOR, ssingleitem_NG->ALPHA, ssingleitem_NG->COLOR2, ssingleitem_NG->COLOR2_TRANSPARENT, ssingleitem_NG->GRADIENT, ssingleitem_NG->CORNER, ssingleitem->BORDERSTYLE, ssingleitem->imageItem);
+ } else if (!sitem->IGNORED) {
+ // draw default grouped
+ // draw odd/even contact underlay
+ if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, sitem->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
+ } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, sitem->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
+ }
+
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, sitem->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
+ savedCORNER = sitem->CORNER;
+ }
}
}
if (type == CLCIT_GROUP) {
@@ -849,38 +830,38 @@ set_bg_l: if (!g_ignoreselforgroups || type != CLCIT_GROUP) {
if (!sselected->IGNORED) {
- rc.left = sselected->MARGIN_LEFT + bg_indent_l;
- rc.top = y + sselected->MARGIN_TOP;
- rc.right = clRect->right - sselected->MARGIN_RIGHT - bg_indent_r;
- rc.bottom = y + rowHeight - sselected->MARGIN_BOTTOM;
+ rc.left = sselected->MARGIN_LEFT + bg_indent_l;
+ rc.top = y + sselected->MARGIN_TOP;
+ rc.right = clRect->right - sselected->MARGIN_RIGHT - bg_indent_r;
+ rc.bottom = y + rowHeight - sselected->MARGIN_BOTTOM;
if (cfg::getByte("CLCExt", "EXBK_EqualSelection", 0) == 1 && savedCORNER != -1) {
DrawAlpha(hdcMem, &rc, sselected->COLOR, sselected->ALPHA, sselected->COLOR2, sselected->COLOR2_TRANSPARENT, sselected->GRADIENT, savedCORNER, sselected->BORDERSTYLE, sselected->imageItem);
} else {
DrawAlpha(hdcMem, &rc, sselected->COLOR, sselected->ALPHA, sselected->COLOR2, sselected->COLOR2_TRANSPARENT, sselected->GRADIENT, sselected->CORNER, sselected->BORDERSTYLE, sselected->imageItem);
}
- SetTextColor(hdcMem, sselected->TEXTCOLOR);
+ SetTextColor(hdcMem, sselected->TEXTCOLOR);
}
else {
- rc.left = bg_indent_l;
- rc.top = y;
- rc.right = clRect->right - bg_indent_r;
- rc.bottom = y + rowHeight;
- FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
- SetTextColor(hdcMem, dat->selTextColour);
- }
+ rc.left = bg_indent_l;
+ rc.top = y;
+ rc.right = clRect->right - bg_indent_r;
+ rc.bottom = y + rowHeight;
+ FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
+ SetTextColor(hdcMem, dat->selTextColour);
+ }
}
}
else if (g_hottrack) {
- StatusItems_t *ht = &StatusItems[ID_EXTBKHOTTRACK - ID_STATUS_OFFLINE];
+ StatusItems_t *ht = &StatusItems[ID_EXTBKHOTTRACK - ID_STATUS_OFFLINE];
- SetHotTrackColour(hdcMem,dat);
- if (ht->IGNORED == 0)
- SetTextColor(hdcMem, ht->TEXTCOLOR);
+ SetHotTrackColour(hdcMem,dat);
+ if (ht->IGNORED == 0)
+ SetTextColor(hdcMem, ht->TEXTCOLOR);
if (!g_hottrack_done) {
- if (ht->IGNORED == 0) {
- DrawAlpha(hdcMem, &rc, ht->COLOR, ht->ALPHA, ht->COLOR2, ht->COLOR2_TRANSPARENT, ht->GRADIENT,
- ht->CORNER, ht->BORDERSTYLE, ht->imageItem);
- }
+ if (ht->IGNORED == 0) {
+ DrawAlpha(hdcMem, &rc, ht->COLOR, ht->ALPHA, ht->COLOR2, ht->COLOR2_TRANSPARENT, ht->GRADIENT,
+ ht->CORNER, ht->BORDERSTYLE, ht->imageItem);
+ }
}
}
@@ -888,13 +869,13 @@ set_bg_l: API::pfnSetLayout(hdcMem, LAYOUT_RTL | LAYOUT_BITMAPORIENTATIONPRESERVED);
bgskipped:
- rcContent.top = y + g_padding_y;
- rcContent.bottom = y + rowHeight - (2 * g_padding_y);
- rcContent.left = leftX;
- rcContent.right = clRect->right - dat->rightMargin;
+ rcContent.top = y + g_padding_y;
+ rcContent.bottom = y + rowHeight - (2 * g_padding_y);
+ rcContent.left = leftX;
+ rcContent.right = clRect->right - dat->rightMargin;
twoRows = ((dat->fontInfo[FONTID_STATUS].fontHeight + fontHeight <= rowHeight + 1) && (contact->bSecondLine != MULTIROW_NEVER)) && !dat->bisEmbedded;
- pi_avatar = !dat->bisEmbedded && type == CLCIT_CONTACT && (contact->cFlags & ECF_AVATAR) && contact->ace != 0 && !(contact->ace->dwFlags & AVS_HIDEONCLIST);
+ pi_avatar = !dat->bisEmbedded && type == CLCIT_CONTACT && (contact->cFlags & ECF_AVATAR) && contact->ace != 0 && !(contact->ace->dwFlags & AVS_HIDEONCLIST);
//checkboxes
if (checkboxWidth) {
@@ -966,20 +947,11 @@ bgskipped: pi_selectiveIcon = g_selectiveIcon && (type == CLCIT_CONTACT);
if ((dwFlags & CLUI_FRAME_STATUSICONS && !pi_selectiveIcon) || type != CLCIT_CONTACT || (pi_selectiveIcon && !avatar_done)) {
- HIMAGELIST hImgList = 0;
- if (!dat->bisEmbedded && type == CLCIT_CONTACT && cEntry && (dwFlags & CLUI_FRAME_USEXSTATUSASSTATUS) && cEntry->iExtraImage[EXTRA_ICON_ADV1] != 0xff) {
- if (pcli->pfnIconFromStatusMode(contact->proto, contact->wStatus, contact->hContact) == iImage) {
- hImgList = dat->himlExtraColumns;
- iImage = cEntry->iExtraImage[EXTRA_ICON_ADV1];
- }
- else hImgList = hCListImages;
- }
- else
- hImgList = hCListImages;
-
- if (g_hottrack) {
+ HIMAGELIST hImgList = hCListImages;
+
+ if (g_hottrack)
colourFg = dat->hotTextColour;
- } else if (type == CLCIT_CONTACT && flags & CONTACTF_NOTONLIST) {
+ else if (type == CLCIT_CONTACT && flags & CONTACTF_NOTONLIST) {
colourFg = dat->fontInfo[FONTID_NOTONLIST].colour;
mode = ILD_BLEND50;
}
@@ -1004,46 +976,45 @@ bgskipped: if (type == CLCIT_CONTACT && !dat->bisEmbedded) {
BYTE bApparentModeDontCare = !((flags & CONTACTF_VISTO) ^ (flags & CONTACTF_INVISTO));
contact->extraIconRightBegin = 0;
- if (cEntry && (contact->extraCacheEntry >= 0 && contact->extraCacheEntry < cfg::nextCacheEntry && cEntry->iExtraValid)) {
- int i, iIndex, id;
- DWORD dwOldMask = cEntry->dwXMask;
- if (dwFlags & CLUI_FRAME_USEXSTATUSASSTATUS)
- cEntry->dwXMask &= ~EIMG_SHOW_ADV1;
+ if (cEntry && (contact->extraCacheEntry >= 0 && contact->extraCacheEntry < cfg::nextCacheEntry && cEntry->iExtraValid)) {
+ int i, iIndex;
+ DWORD dwOldMask = cEntry->dwXMask;
+ if (dwFlags & CLUI_FRAME_USEXSTATUSASSTATUS)
+ cEntry->dwXMask &= ~EIMG_SHOW_ADV1;
for (i = EXICON_COUNT - 1; i >= 0; i--) {
- iIndex = cfg::dat.exIconOrder[i] - 1;
- if (iIndex >= 0 && iIndex < EXICON_COUNT) {
- id = OrderTreeData[iIndex].ID;
- if (cEntry->iExtraImage[id] != 0xff && ((1 << id) & cEntry->dwXMask)) {
- if (contact->extraIconRightBegin == 0 && i != (EXICON_COUNT - 1))
- contact->extraIconRightBegin = rcContent.right;
- ImageList_DrawEx(dat->himlExtraColumns, cEntry->iExtraImage[id], hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
- 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL);
- rcContent.right -= g_exIconSpacing;
- rightIcons++;
- }
- }
+ iIndex = cfg::dat.exIconOrder[i] - 1;
+ if (iIndex >= 0 && iIndex < EXICON_COUNT) {
+ if (cEntry->iExtraImage[i] != 0xffff && ((1 << i) & cEntry->dwXMask)) {
+ if (contact->extraIconRightBegin == 0 && i != (EXICON_COUNT - 1))
+ contact->extraIconRightBegin = rcContent.right;
+ ImageList_DrawEx(dat->himlExtraColumns, cEntry->iExtraImage[i], hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
+ 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL);
+ rcContent.right -= g_exIconSpacing;
+ rightIcons++;
+ }
+ }
}
- cEntry->dwXMask = dwOldMask;
+ cEntry->dwXMask = dwOldMask;
}
if (!bApparentModeDontCare && (dwFlags & CLUI_SHOWVISI) && contact->proto) {
- BOOL fVisi;
-
- if (dwFlags & CLUI_SHOWVISI)
- fVisi = cEntry->dwDFlags & ECF_HIDEVISIBILITY ? 0 : 1;
- else
- fVisi = cEntry->dwDFlags & ECF_FORCEVISIBILITY ? 1 : 0;
-
- if (fVisi) {
- if (cEntry->isChatRoom)
- DrawIconEx(hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
- cfg::dat.hIconChatactive, cfg::dat.exIconScale, cfg::dat.exIconScale, 0, 0, DI_NORMAL | DI_COMPAT);
- else
- DrawIconEx(hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
- flags & CONTACTF_VISTO ? cfg::dat.hIconVisible : cfg::dat.hIconInvisible, cfg::dat.exIconScale, cfg::dat.exIconScale, 0, 0, DI_NORMAL | DI_COMPAT);
- rcContent.right -= g_exIconSpacing;
- rightIcons++;
- }
+ BOOL fVisi;
+
+ if (dwFlags & CLUI_SHOWVISI)
+ fVisi = cEntry->dwDFlags & ECF_HIDEVISIBILITY ? 0 : 1;
+ else
+ fVisi = cEntry->dwDFlags & ECF_FORCEVISIBILITY ? 1 : 0;
+
+ if (fVisi) {
+ if (cEntry->isChatRoom)
+ DrawIconEx(hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
+ cfg::dat.hIconChatactive, cfg::dat.exIconScale, cfg::dat.exIconScale, 0, 0, DI_NORMAL | DI_COMPAT);
+ else
+ DrawIconEx(hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
+ flags & CONTACTF_VISTO ? cfg::dat.hIconVisible : cfg::dat.hIconInvisible, cfg::dat.exIconScale, cfg::dat.exIconScale, 0, 0, DI_NORMAL | DI_COMPAT);
+ rcContent.right -= g_exIconSpacing;
+ rightIcons++;
+ }
}
}
}
@@ -1173,9 +1144,9 @@ text: // nickname
if (!twoRows) {
if (dt_nickflags)
- DrawText(hdcMem, szText, -1, &rcContent, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE | dt_nickflags);
+ DrawText(hdcMem, szText, -1, &rcContent, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE | dt_nickflags);
else
- DrawText(hdcMem, szText, -1, &rcContent, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
+ DrawText(hdcMem, szText, -1, &rcContent, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
}
else {
int statusFontHeight;
@@ -1185,10 +1156,10 @@ text: rcContent.top = y + cfg::dat.avatarPadding / 2;
- if (cfg::dat.bShowLocalTime)
- fLocalTime = cEntry->dwDFlags & ECF_HIDELOCALTIME ? 0 : 1;
- else
- fLocalTime = cEntry->dwDFlags & ECF_FORCELOCALTIME ? 1 : 0;
+ if (cfg::dat.bShowLocalTime)
+ fLocalTime = cEntry->dwDFlags & ECF_HIDELOCALTIME ? 0 : 1;
+ else
+ fLocalTime = cEntry->dwDFlags & ECF_FORCELOCALTIME ? 1 : 0;
if (cEntry->hTimeZone && fLocalTime) {
int idOldFont;
@@ -1479,43 +1450,43 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint) maxx = dat->backgroundBmpUse & CLBF_TILEH ? clRect.right : 1;
maxy = dat->backgroundBmpUse & CLBF_TILEV ? maxy = rcPaint->bottom : y + 1;
switch (dat->backgroundBmpUse & CLBM_TYPE) {
- case CLB_STRETCH:
- if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
- if (clRect.right * bmp.bmHeight < clRect.bottom * bmp.bmWidth) {
- desth = clRect.bottom;
- destw = desth * bmp.bmWidth / bmp.bmHeight;
- } else {
- destw = clRect.right;
- desth = destw * bmp.bmHeight / bmp.bmWidth;
- }
- } else {
- destw = clRect.right;
- desth = clRect.bottom;
- }
- break;
- case CLB_STRETCHH:
- if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
- destw = clRect.right;
- desth = destw * bmp.bmHeight / bmp.bmWidth;
- } else {
- destw = clRect.right;
- desth = bmp.bmHeight;
- }
- break;
- case CLB_STRETCHV:
- if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
+ case CLB_STRETCH:
+ if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
+ if (clRect.right * bmp.bmHeight < clRect.bottom * bmp.bmWidth) {
desth = clRect.bottom;
destw = desth * bmp.bmWidth / bmp.bmHeight;
} else {
- destw = bmp.bmWidth;
- desth = clRect.bottom;
+ destw = clRect.right;
+ desth = destw * bmp.bmHeight / bmp.bmWidth;
}
- break;
- default:
- //clb_topleft
- destw = bmp.bmWidth;
+ } else {
+ destw = clRect.right;
+ desth = clRect.bottom;
+ }
+ break;
+ case CLB_STRETCHH:
+ if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
+ destw = clRect.right;
+ desth = destw * bmp.bmHeight / bmp.bmWidth;
+ } else {
+ destw = clRect.right;
desth = bmp.bmHeight;
- break;
+ }
+ break;
+ case CLB_STRETCHV:
+ if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
+ desth = clRect.bottom;
+ destw = desth * bmp.bmWidth / bmp.bmHeight;
+ } else {
+ destw = bmp.bmWidth;
+ desth = clRect.bottom;
+ }
+ break;
+ default:
+ //clb_topleft
+ destw = bmp.bmWidth;
+ desth = bmp.bmHeight;
+ break;
}
bitx = 0;
@@ -1539,37 +1510,37 @@ bgdone: if ( dat->row_heights == NULL )
RowHeight::calcRowHeights(dat, hwnd);
- group = &dat->list;
- group->scanIndex = 0;
-
- g_list_avatars = 0;
- while(TRUE)
- {
- if (group->scanIndex==group->cl.count)
- {
- group=group->parent;
- if (group==NULL) break; // Finished list
- group->scanIndex++;
- continue;
- }
-
- if (group->cl.items[group->scanIndex]->cFlags & ECF_AVATAR)
- g_list_avatars++;
-
- if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded)) {
- group=group->cl.items[group->scanIndex]->group;
- group->scanIndex=0;
- continue;
- }
- group->scanIndex++;
- }
- g_selectiveIcon = (g_list_avatars > 0) && (cfg::dat.dwFlags & CLUI_FRAME_SELECTIVEICONS) && !dat->bisEmbedded;
-
- group = &dat->list;
- group->scanIndex = 0;
- indent = 0;
-
- for (index = 0; y< rcPaint->bottom;) {
+ group = &dat->list;
+ group->scanIndex = 0;
+
+ g_list_avatars = 0;
+ while(TRUE)
+ {
+ if (group->scanIndex==group->cl.count)
+ {
+ group=group->parent;
+ if (group==NULL) break; // Finished list
+ group->scanIndex++;
+ continue;
+ }
+
+ if (group->cl.items[group->scanIndex]->cFlags & ECF_AVATAR)
+ g_list_avatars++;
+
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded)) {
+ group=group->cl.items[group->scanIndex]->group;
+ group->scanIndex=0;
+ continue;
+ }
+ group->scanIndex++;
+ }
+ g_selectiveIcon = (g_list_avatars > 0) && (cfg::dat.dwFlags & CLUI_FRAME_SELECTIVEICONS) && !dat->bisEmbedded;
+
+ group = &dat->list;
+ group->scanIndex = 0;
+ indent = 0;
+
+ for (index = 0; y< rcPaint->bottom;) {
if (group->scanIndex == group->cl.count) {
group = group->parent;
indent--;
@@ -1585,8 +1556,8 @@ bgdone: group->cl.items[group->scanIndex]->ace = (struct avatarCacheEntry*)-1;
if (y > rcPaint->top - dat->row_heights[line_num] && y <= rcPaint->bottom) {
- if (group->cl.items[group->scanIndex]->ace == (struct avatarCacheEntry*)-1 )
- group->cl.items[group->scanIndex]->ace = (struct avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)group->cl.items[group->scanIndex]->hContact, 0);
+ if (group->cl.items[group->scanIndex]->ace == (struct avatarCacheEntry*)-1 )
+ group->cl.items[group->scanIndex]->ace = (struct avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)group->cl.items[group->scanIndex]->hContact, 0);
RowHeight::getRowHeight(dat, hwnd, group->cl.items[group->scanIndex], line_num, style);
PaintItem(hdcMem, group, group->cl.items[group->scanIndex], indent, y, dat, index, hwnd, style, &clRect, &bFirstNGdrawn, groupCountsFontTopShift, dat->row_heights[line_num]);
}
@@ -1601,11 +1572,11 @@ bgdone: group->scanIndex++;
}
- SelectObject(hdcTempAV, hbmTempOldAV);
- DeleteObject(hbmTempAV);
- DeleteDC(hdcTempAV);
+ SelectObject(hdcTempAV, hbmTempOldAV);
+ DeleteObject(hbmTempAV);
+ DeleteDC(hdcTempAV);
- DeleteDC(hdcAV);
+ DeleteDC(hdcAV);
if (dat->iInsertionMark != -1) {
//insertion mark
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 45e9cdb9db..bc0c144f87 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -84,7 +84,7 @@ size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut) * shares all the init stuff with HitTest()
*/
-int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcContact *hitcontact, DWORD *flags, int indent, int hit)
+int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact *hitcontact, DWORD *flags, int indent, int hit)
{
RECT clRect;
int right, checkboxWidth, cxSmIcon, i, width;
@@ -188,9 +188,9 @@ 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, ClcGroup **group, DWORD *flags)
+int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD *flags)
{
- struct ClcContact *hitcontact;
+ ClcContact *hitcontact;
ClcGroup *hitgroup;
int hit, indent, width, i, cxSmIcon;
int checkboxWidth;
@@ -515,7 +515,7 @@ static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPara void BeginRenameSelection(HWND hwnd, struct ClcData *dat)
{
- struct ClcContact *contact;
+ ClcContact *contact;
ClcGroup *group;
int indent, x, y, h;
RECT clRect;
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index b4abce1084..2078fcc6ed 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -65,35 +65,6 @@ static HANDLE hWindowListIGN = 0; * menu
*/
-static const UINT xImgCtrlIds[] = {
- IDC_EXTRA_ICON_RES0,
- IDC_EXTRA_ICON_EMAIL,
- IDC_EXTRA_ICON_RES1,
- IDC_EXTRA_ICON_SMS,
- IDC_EXTRA_ICON_ADV1,
- IDC_EXTRA_ICON_ADV2,
- IDC_EXTRA_ICON_WEB,
- IDC_EXTRA_ICON_CLIENT,
- IDC_EXTRA_ICON_RES2,
- IDC_EXTRA_ICON_ADV3,
- IDC_EXTRA_ICON_ADV4
-};
-
-// static UINT xImgCtrlBits[] = {6, 4, 0, 1, 2, 3, 5, 7, 8, 9, 10};
-static const UINT xImgCtrlBits[] = {
- EXTRA_ICON_RES0,
- EXTRA_ICON_EMAIL,
- EXTRA_ICON_RES1,
- EXTRA_ICON_SMS,
- EXTRA_ICON_ADV1,
- EXTRA_ICON_ADV2,
- EXTRA_ICON_WEB,
- EXTRA_ICON_CLIENT,
- EXTRA_ICON_RES2,
- EXTRA_ICON_ADV3,
- EXTRA_ICON_ADV4
-};
-
static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = (HANDLE)GetWindowLongPtr(hWnd, GWLP_USERDATA);
@@ -102,7 +73,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case WM_INITDIALOG:
{
DWORD dwMask;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
int pCaps;
HWND hwndAdd;
@@ -188,16 +159,6 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA else
SendDlgItemMessage(hWnd, IDC_SHOWVISIBILITY, BM_SETCHECK, BST_INDETERMINATE, 0);
- while(xImgCtrlIds[i] != 0) {
- if (dwXMask & (1 << (2 * xImgCtrlBits[i])))
- SendDlgItemMessage(hWnd, xImgCtrlIds[i], BM_SETCHECK, BST_CHECKED, 0);
- else if (dwXMask & (1 << (2 * xImgCtrlBits[i] + 1)))
- SendDlgItemMessage(hWnd, xImgCtrlIds[i], BM_SETCHECK, BST_UNCHECKED, 0);
- else
- SendDlgItemMessage(hWnd, xImgCtrlIds[i], BM_SETCHECK, BST_INDETERMINATE, 0);
- i++;
- }
-
if (bSecondLine == 0xff)
SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_SETCURSEL, 0, 0);
else
@@ -248,9 +209,6 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA SendDlgItemMessage(hWnd, IDC_AVATARDISPMODE, CB_SETCURSEL, 0, 0);
SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_SETCURSEL, 0, 0);
- while(xImgCtrlIds[i] != 0)
- SendDlgItemMessage(hWnd, xImgCtrlIds[i++], BM_SETCHECK, BST_INDETERMINATE, 0);
-
SendDlgItemMessage(hWnd, IDC_OVERLAYICON, BM_SETCHECK, BST_INDETERMINATE, 0);
SendDlgItemMessage(hWnd, IDC_LOCALTIME, BM_SETCHECK, BST_INDETERMINATE, 0);
SendDlgItemMessage(hWnd, IDC_SHOWVISIBILITY, BM_SETCHECK, BST_INDETERMINATE, 0);
@@ -259,7 +217,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case IDOK:
{
DWORD newMask = 0;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
SendMessage(hWnd, WM_USER + 110, 0, (LPARAM)&newMask);
cfg::writeDword(hContact, "Ignore", "Mask1", newMask);
@@ -318,14 +276,6 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA contact->bSecondLine = (BYTE)(iSel - 1);
}
}
- while(xImgCtrlIds[i] != 0) {
- checked = SendDlgItemMessage(hWnd, xImgCtrlIds[i], BM_GETCHECK, 0, 0);
- if (checked == BST_CHECKED)
- dwXMask |= (1 << (2 * xImgCtrlBits[i]));
- else if (checked == BST_UNCHECKED)
- dwXMask |= (1 << (2 * xImgCtrlBits[i] + 1));
- i++;
- }
cfg::writeDword(hContact, "CList", "CLN_xmask", dwXMask);
if (contact) {
if (contact->extraCacheEntry >= 0 && contact->extraCacheEntry <= cfg::nextCacheEntry) {
@@ -376,7 +326,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA }
case WM_USER + 120: // set visibility status
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
if (contact) {
@@ -390,7 +340,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA }
case WM_USER + 130: // update apparent mode
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
if (contact) {
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 1a238e5f9d..98f34ad1a4 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -493,7 +493,7 @@ void SetDBButtonStates(HANDLE hPassedContact) HANDLE hContact = 0, hFinalContact = 0;
char *szModule, *szSetting;
int sel = cfg::clcdat ? cfg::clcdat->selection : -1;
- struct ClcContact *contact = 0;
+ ClcContact *contact = 0;
if (sel != -1 && hPassedContact == 0) {
sel = pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, NULL);
@@ -1456,7 +1456,7 @@ skipbg: WPARAM wwParam = 0;
LPARAM llParam = 0;
HANDLE hContact = 0;
- struct ClcContact *contact = 0;
+ ClcContact *contact = 0;
int sel = cfg::clcdat ? cfg::clcdat->selection : -1;
int serviceFailure = FALSE;
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 1cbfeb8190..8ed431ad40 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -204,38 +204,38 @@ INT_PTR cfg::writeString(const HANDLE hContact, const char *szModule = 0, const int cfg::getCache(const HANDLE hContact, const char *szProto)
{
- int i, iFound = -1;
-
- for (i = 0; i < nextCacheEntry; i++) {
- if (eCache[i].hContact == hContact) {
- iFound = i;
- break;
- }
- }
- if (iFound == -1) {
+ int i, iFound = -1;
+
+ for (i = 0; i < nextCacheEntry; i++) {
+ if (eCache[i].hContact == hContact) {
+ iFound = i;
+ break;
+ }
+ }
+ if (iFound == -1) {
EnterCriticalSection(&cachecs);
- if (nextCacheEntry == maxCacheEntry) {
- maxCacheEntry += 100;
- cfg::eCache = (TExtraCache *)realloc(cfg::eCache, maxCacheEntry * sizeof(TExtraCache));
- }
- memset(&cfg::eCache[nextCacheEntry], 0, sizeof(TExtraCache));
+ if (nextCacheEntry == maxCacheEntry) {
+ maxCacheEntry += 100;
+ cfg::eCache = (TExtraCache *)realloc(cfg::eCache, maxCacheEntry * sizeof(TExtraCache));
+ }
+ memset(&cfg::eCache[nextCacheEntry], 0, sizeof(TExtraCache));
cfg::eCache[nextCacheEntry].hContact = hContact;
- memset(cfg::eCache[nextCacheEntry].iExtraImage, 0xff, MAXEXTRACOLUMNS);
- cfg::eCache[nextCacheEntry].iExtraValid = 0;
- cfg::eCache[nextCacheEntry].valid = FALSE;
- cfg::eCache[nextCacheEntry].bStatusMsgValid = 0;
- cfg::eCache[nextCacheEntry].statusMsg = NULL;
- cfg::eCache[nextCacheEntry].status_item = NULL;
- LoadSkinItemToCache(&cfg::eCache[nextCacheEntry], szProto);
- cfg::eCache[nextCacheEntry].dwCFlags = 0;
- cfg::eCache[nextCacheEntry].dwDFlags = DBGetContactSettingDword(hContact, "CList", "CLN_Flags", 0);
- cfg::eCache[nextCacheEntry].dwXMask = CalcXMask(hContact);
- GetCachedStatusMsg(nextCacheEntry, const_cast<char *>(szProto));
+ memset(cfg::eCache[nextCacheEntry].iExtraImage, 0xffff, MAXEXTRACOLUMNS);
+ cfg::eCache[nextCacheEntry].iExtraValid = 0;
+ cfg::eCache[nextCacheEntry].valid = FALSE;
+ cfg::eCache[nextCacheEntry].bStatusMsgValid = 0;
+ cfg::eCache[nextCacheEntry].statusMsg = NULL;
+ cfg::eCache[nextCacheEntry].status_item = NULL;
+ LoadSkinItemToCache(&cfg::eCache[nextCacheEntry], szProto);
+ cfg::eCache[nextCacheEntry].dwCFlags = 0;
+ cfg::eCache[nextCacheEntry].dwDFlags = DBGetContactSettingDword(hContact, "CList", "CLN_Flags", 0);
+ cfg::eCache[nextCacheEntry].dwXMask = CalcXMask(hContact);
+ GetCachedStatusMsg(nextCacheEntry, const_cast<char *>(szProto));
cfg::eCache[nextCacheEntry].dwLastMsgTime = INTSORT_GetLastMsgTime(hContact);
- iFound = nextCacheEntry++;
+ iFound = nextCacheEntry++;
LeaveCriticalSection(&cachecs);
- }
- return iFound;
+ }
+ return iFound;
}
void API::onInit()
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index ef614af287..99be0ebcf8 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -211,7 +211,7 @@ int __forceinline GetProtoIndex(char * szName) }
}
-int __forceinline INTSORT_CompareContacts(const struct ClcContact* c1, const struct ClcContact* c2, UINT bywhat)
+int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact* c2, UINT bywhat)
{
TCHAR *namea, *nameb;
int statusa, statusb;
@@ -290,7 +290,7 @@ int __forceinline INTSORT_CompareContacts(const struct ClcContact* c1, const str return 0;
}
-int CompareContacts(const struct ClcContact* c1, const struct ClcContact* c2)
+int CompareContacts(const ClcContact* c1, const ClcContact* c2)
{
int i, result;
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index d6eee3bc0b..2016cceccc 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -51,7 +51,7 @@ extern HIMAGELIST himlExtraImages; TIME_API tmi;
HMENU BuildGroupPopupMenu( ClcGroup* group );
-struct ClcContact* CreateClcContact( void );
+ClcContact* CreateClcContact( void );
struct CListEvent* fnCreateEvent( void );
void ReloadThemedOptions();
void TrayIconUpdateBase(const char *szChangedProto);
@@ -69,8 +69,8 @@ void LoadClcOptions(HWND hwnd,struct ClcData *dat); int ( *saveAddContactToGroup )(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
-ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
-ClcGroup* RemoveItemFromGroup(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
+ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount);
+ClcGroup* RemoveItemFromGroup(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount);
struct CListEvent* ( *saveAddEvent )(CLISTEVENT *cle);
struct CListEvent* AddEvent(CLISTEVENT *cle);
diff --git a/plugins/Clist_nicer/src/rowheight_funcs.cpp b/plugins/Clist_nicer/src/rowheight_funcs.cpp index 1f0bbdd6e7..f89a1a90c8 100644 --- a/plugins/Clist_nicer/src/rowheight_funcs.cpp +++ b/plugins/Clist_nicer/src/rowheight_funcs.cpp @@ -142,7 +142,7 @@ int RowHeight::getMaxRowHeight(ClcData *dat, const HWND hwnd) void RowHeight::calcRowHeights(ClcData *dat, HWND hwnd)
{
int indent, subindex, line_num;
- struct ClcContact *Drawing;
+ ClcContact *Drawing;
ClcGroup *group;
DWORD dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
diff --git a/plugins/Clist_nicer/src/statusfloater.cpp b/plugins/Clist_nicer/src/statusfloater.cpp index 3421c7b016..8ffa0fd9ec 100644 --- a/plugins/Clist_nicer/src/statusfloater.cpp +++ b/plugins/Clist_nicer/src/statusfloater.cpp @@ -44,7 +44,7 @@ BYTE __forceinline percent_to_byte(UINT32 percent) return(BYTE) ((FLOAT) (((FLOAT) percent) / 100) * 255);
}
-void FLT_Update(struct ClcData *dat, struct ClcContact *contact);
+void FLT_Update(struct ClcData *dat, ClcContact *contact);
void FLT_ShowHideAll(int showCmd);
void FLT_SnapToEdges(HWND hwnd);
void FLT_SnapToFloater(HWND hwnd);
@@ -52,7 +52,7 @@ void FLT_SnapToFloater(HWND hwnd); HWND g_hwndSFL = 0;
HDC g_SFLCachedDC = 0;
HBITMAP g_SFLhbmOld = 0, g_SFLhbm = 0;
-struct ContactFloater *pFirstFloater = 0;
+ContactFloater *pFirstFloater = 0;
BOOL hover = FALSE;
BOOL tooltip = FALSE;
UINT_PTR hTooltipTimer = 0;
@@ -78,8 +78,8 @@ static UINT padctrlIDs[] = { IDC_FLT_PADLEFTSPIN, IDC_FLT_PADRIGHTSPIN, IDC_FLT_ * simple linked list of allocated ContactFloater* structs
*/
-static struct ContactFloater *FLT_AddToList(struct ContactFloater *pFloater) {
- struct ContactFloater *pCurrent = pFirstFloater;
+static ContactFloater *FLT_AddToList(ContactFloater *pFloater) {
+ ContactFloater *pCurrent = pFirstFloater;
if (!pFirstFloater) {
pFirstFloater = pFloater;
@@ -94,8 +94,8 @@ static struct ContactFloater *FLT_AddToList(struct ContactFloater *pFloater) { }
}
-static struct ContactFloater *FLT_RemoveFromList(struct ContactFloater *pFloater) {
- struct ContactFloater *pCurrent = pFirstFloater;
+static ContactFloater *FLT_RemoveFromList(ContactFloater *pFloater) {
+ ContactFloater *pCurrent = pFirstFloater;
if (pFloater == pFirstFloater) {
if (pFloater->pNextFloater != NULL)
@@ -152,7 +152,7 @@ void FLT_SnapToEdges(HWND hwnd) void FLT_SnapToFloater(HWND hwnd)
{
- struct ContactFloater *pCurrent = pFirstFloater;
+ ContactFloater *pCurrent = pFirstFloater;
RECT rcWindow, rcBase;
int minTop = 0xFFFFFF, minBottom = 0xFFFFFF, minRight = 0xFFFFFF, minLeft = 0xFFFFFF;
int posTop = 0, posBottom = 0, posRight = 0, posLeft = 0;
@@ -554,7 +554,7 @@ LRESULT CALLBACK StatusFloaterClassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR }
void CALLBACK ShowTooltip(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime){
- struct ContactFloater *pCurrent = pFirstFloater;
+ ContactFloater *pCurrent = pFirstFloater;
POINT pt;
CLCINFOTIP ti = {0};
@@ -657,8 +657,8 @@ LRESULT CALLBACK ContactFloaterClassProc(HWND hwnd, UINT msg, WPARAM wParam, LPA case WM_MOUSEHOVER:
{
- struct ClcContact *contact = NULL;
- struct ContactFloater *pCurrent = pFirstFloater;
+ ClcContact *contact = NULL;
+ ContactFloater *pCurrent = pFirstFloater;
int oldTrans = g_floatoptions.trans;
while(pCurrent->hwnd != hwnd)
@@ -674,8 +674,8 @@ LRESULT CALLBACK ContactFloaterClassProc(HWND hwnd, UINT msg, WPARAM wParam, LPA }
case WM_MOUSELEAVE:
{
- struct ClcContact *contact = NULL;
- struct ContactFloater *pCurrent = pFirstFloater;
+ ClcContact *contact = NULL;
+ ContactFloater *pCurrent = pFirstFloater;
while(pCurrent->hwnd != hwnd)
pCurrent = pCurrent->pNextFloater;
@@ -971,13 +971,13 @@ void FLT_Create(int iEntry) struct TExtraCache *centry = NULL;
if (iEntry >= 0 && iEntry < cfg::nextCacheEntry) {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
ClcGroup *group = NULL;
centry = &cfg::eCache[iEntry];
if (centry->floater == 0 && API::pfnUpdateLayeredWindow != NULL) {
- centry->floater = (struct ContactFloater *)malloc(sizeof(struct ContactFloater));
+ centry->floater = (ContactFloater *)malloc(sizeof(ContactFloater));
if (centry->floater == NULL)
return;
FLT_AddToList(centry->floater);
@@ -1009,7 +1009,7 @@ extern HDC hdcTempAV; extern HBITMAP hbmTempAV, hbmTempOldAV;
extern LONG g_maxAV_X, g_maxAV_Y;
-void FLT_Update(struct ClcData *dat, struct ClcContact *contact)
+void FLT_Update(struct ClcData *dat, ClcContact *contact)
{
RECT rcClient, rcWindow;
POINT ptDest, ptSrc = {0};
@@ -1019,7 +1019,7 @@ void FLT_Update(struct ClcData *dat, struct ClcContact *contact) HDC hdc;
BOOL firstDrawn = TRUE;
ClcGroup *group = NULL;
- struct ClcContact *newContact = NULL;
+ ClcContact *newContact = NULL;
HRGN rgn;
HBRUSH hbrBorder;
COLORREF clrKey;
@@ -1170,8 +1170,8 @@ void FLT_Update(struct ClcData *dat, struct ClcContact *contact) void FLT_SyncWithClist()
{
- struct ClcContact *contact;
- struct ContactFloater *pCurrent = pFirstFloater;
+ ClcContact *contact;
+ ContactFloater *pCurrent = pFirstFloater;
HWND hwnd;
int iVis = pcli->pfnGetWindowVisibleState(pcli->hwndContactList, 0, 0);
@@ -1201,8 +1201,8 @@ void FLT_SyncWithClist() void FLT_ShowHideAll(int showCmd)
{
- struct ClcContact *contact;
- struct ContactFloater *pCurrent = pFirstFloater;
+ ClcContact *contact;
+ ContactFloater *pCurrent = pFirstFloater;
HWND hwnd;
if (g_floatoptions.dwFlags & FLT_AUTOHIDE){
@@ -1225,8 +1225,8 @@ void FLT_ShowHideAll(int showCmd) void FLT_RefreshAll()
{
- struct ClcContact *contact = NULL;
- struct ContactFloater *pCurrent = pFirstFloater;
+ ClcContact *contact = NULL;
+ ContactFloater *pCurrent = pFirstFloater;
while(pCurrent) {
if (FindItem(pcli->hwndContactTree, cfg::clcdat, pCurrent->hContact, &contact, NULL, 0)) {
|