summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/modern_clc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_modern/modern_clc.cpp')
-rw-r--r--plugins/Clist_modern/modern_clc.cpp904
1 files changed, 452 insertions, 452 deletions
diff --git a/plugins/Clist_modern/modern_clc.cpp b/plugins/Clist_modern/modern_clc.cpp
index e124c2c4fe..88996ec28b 100644
--- a/plugins/Clist_modern/modern_clc.cpp
+++ b/plugins/Clist_modern/modern_clc.cpp
@@ -47,15 +47,15 @@ static HANDLE hShowInfoTipEvent;
static HANDLE hSettingChanged;
static POINT HitPoint;
static BOOL fMouseUpped;
-static BYTE IsDragToScrollMode=0;
-static int StartDragPos=0;
-static int StartScrollPos=0;
-HANDLE hSmileyAddOptionsChangedHook=NULL;
-HANDLE hIconChangedHook=NULL;
-HANDLE hAckHook=NULL;
-HANDLE hAvatarChanged=NULL;
+static BYTE IsDragToScrollMode = 0;
+static int StartDragPos = 0;
+static int StartScrollPos = 0;
+HANDLE hSmileyAddOptionsChangedHook = NULL;
+HANDLE hIconChangedHook = NULL;
+HANDLE hAckHook = NULL;
+HANDLE hAvatarChanged = NULL;
static BOOL g_bSortTimerIsSet = FALSE;
-static struct ClcContact * hitcontact=NULL;
+static struct ClcContact * hitcontact = NULL;
static int clcHookSmileyAddOptionsChanged(WPARAM wParam,LPARAM lParam);
@@ -84,7 +84,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam)
TCHAR szMyPath[MAX_PATH];
GetModuleFileName(g_hInst, szMyPath, SIZEOF(szMyPath));
- SKINICONDESC sid={0};
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(sid);
sid.cx = 16;
sid.cy = 16;
@@ -98,7 +98,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam)
Skin_AddIcon(&sid);
sid.pszSection = LPGEN("Contact List/Avatar Overlay");
- for (i=0; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++) {
+ for (i = 0; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++) {
sid.pszDescription = g_pAvatarOverlayIcons[i].description;
sid.pszName = g_pAvatarOverlayIcons[i].name;
sid.iDefaultIndex = - g_pAvatarOverlayIcons[i].id;
@@ -106,7 +106,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam)
}
sid.pszSection = LPGEN("Contact List/Status Overlay");
- for (i=0; i < MAX_REGS(g_pStatusOverlayIcons); i++) {
+ for (i = 0; i < MAX_REGS(g_pStatusOverlayIcons); i++) {
sid.pszDescription = g_pStatusOverlayIcons[i].description;
sid.pszName = g_pStatusOverlayIcons[i].name;
sid.iDefaultIndex = - g_pStatusOverlayIcons[i].id;
@@ -115,7 +115,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam)
clcHookIconsChanged(0,0);
- hIconChangedHook=ModernHookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
+ hIconChangedHook = ModernHookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
// Register smiley category
if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY)) {
@@ -127,7 +127,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam)
CallService(MS_SMILEYADD_REGISTERCATEGORY, 0, (LPARAM)&rc);
- hSmileyAddOptionsChangedHook=ModernHookEvent(ME_SMILEYADD_OPTIONSCHANGED,clcHookSmileyAddOptionsChanged);
+ hSmileyAddOptionsChangedHook = ModernHookEvent(ME_SMILEYADD_OPTIONSCHANGED,clcHookSmileyAddOptionsChanged);
}
CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"List Background/CLC",0);
@@ -163,18 +163,18 @@ static int clcHookIconsChanged(WPARAM wParam, LPARAM lParam)
if (MirandaExiting()) return 0;
for (i = 0 ; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++)
{
- g_pAvatarOverlayIcons[i].listID=-1;
- g_pStatusOverlayIcons[i].listID=-1;
+ g_pAvatarOverlayIcons[i].listID = -1;
+ g_pStatusOverlayIcons[i].listID = -1;
}
if (hAvatarOverlays) ImageList_Destroy(hAvatarOverlays);
- hAvatarOverlays=ImageList_Create(16,16,ILC_MASK|ILC_COLOR32,MAX_REGS(g_pAvatarOverlayIcons)*2,1);
+ hAvatarOverlays = ImageList_Create(16,16,ILC_MASK|ILC_COLOR32,MAX_REGS(g_pAvatarOverlayIcons)*2,1);
for (i = 0 ; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++)
{
- HICON hIcon=(HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)g_pAvatarOverlayIcons[i].name);
+ HICON hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)g_pAvatarOverlayIcons[i].name);
g_pAvatarOverlayIcons[i].listID = ImageList_AddIcon(hAvatarOverlays,hIcon);
CallService(MS_SKIN2_RELEASEICON, 0, (LPARAM)g_pAvatarOverlayIcons[i].name);
- hIcon=(HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)g_pStatusOverlayIcons[i].name);
+ hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)g_pStatusOverlayIcons[i].name);
g_pStatusOverlayIcons[i].listID = ImageList_AddIcon(hAvatarOverlays,hIcon);
CallService(MS_SKIN2_RELEASEICON, 0, (LPARAM)g_pStatusOverlayIcons[i].name);
}
@@ -188,9 +188,9 @@ static int clcHookIconsChanged(WPARAM wParam, LPARAM lParam)
static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam)
{
- DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if (MirandaExiting()) return 0;
- if ((HANDLE)wParam==NULL)
+ if ((HANDLE)wParam == NULL)
{
if (g_szMetaModuleName && !mir_strcmp(cws->szModule, g_szMetaModuleName))
{
@@ -206,7 +206,7 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam)
CLUIServices_ProtocolStatusChanged(0,(LPARAM)cws->szModule);
}
}
- else // (HANDLE)wParam != NULL
+ else // (HANDLE)wParam !=NULL
{
if (!strcmp(cws->szSetting,"TickTS"))
{
@@ -259,7 +259,7 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam)
if (!strcmp(cws->szSetting,"File"))
pcli->pfnClcBroadcast( INTM_AVATARCHANGED,wParam,0);
}
- else //if(0) //turn off
+ else //if (0) //turn off
{
{
// if (!strcmp(cws->szSetting,"UIN"))
@@ -296,18 +296,18 @@ static int clcHookDbEventAdded(WPARAM wParam,LPARAM lParam)
{
DBEVENTINFO dbei = {0};
g_CluiData.t_now = time(NULL);
- if(wParam && lParam)
+ if (wParam && lParam)
{
dbei.cbSize = sizeof(dbei);
dbei.pBlob = 0;
dbei.cbBlob = 0;
CallService(MS_DB_EVENT_GET, (WPARAM)lParam, (LPARAM)&dbei);
- if(dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
+ if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
{
- PDNCE pdnce=(PDNCE)pcli->pfnGetCacheEntry((HANDLE)wParam);
+ PDNCE pdnce = (PDNCE)pcli->pfnGetCacheEntry((HANDLE)wParam);
db_set_dw((HANDLE)wParam, "CList", "mf_lastmsg", dbei.timestamp);
if (pdnce)
- pdnce->dwLastMsgTime=dbei.timestamp;
+ pdnce->dwLastMsgTime = dbei.timestamp;
}
}
return 0;
@@ -336,7 +336,7 @@ static int clcHookAvatarChanged(WPARAM wParam, LPARAM lParam)
static int clcExitDragToScroll()
{
if (!IsDragToScrollMode) return 0;
- IsDragToScrollMode=0;
+ IsDragToScrollMode = 0;
ReleaseCapture();
return 1;
}
@@ -346,11 +346,11 @@ static int clcProceedDragToScroll(HWND hwnd, int Y)
{
int pos,dy;
if (!IsDragToScrollMode) return 0;
- if(GetCapture()!=hwnd) clcExitDragToScroll();
- dy=StartDragPos-Y;
- pos=StartScrollPos+dy;
- if (pos<0)
- pos=0;
+ if (GetCapture() != hwnd) clcExitDragToScroll();
+ dy = StartDragPos-Y;
+ pos = StartScrollPos+dy;
+ if (pos < 0)
+ pos = 0;
SendMessage(hwnd, WM_VSCROLL,MAKEWPARAM(SB_THUMBTRACK,pos),0);
return 1;
}
@@ -361,9 +361,9 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const
{
struct ClcGroup *group = &dat->list;
int testlen = lstrlen(text);
- BOOL fReturnAsFound=FALSE;
- int nLastFound=-1;
- if (index==-1) fReturnAsFound=TRUE;
+ BOOL fReturnAsFound = FALSE;
+ int nLastFound = -1;
+ if (index == -1) fReturnAsFound = TRUE;
group->scanIndex = 0;
for (;;)
{
@@ -375,9 +375,9 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const
group->scanIndex++;
continue;
}
- if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER)
+ if (group->cl.items[group->scanIndex]->type !=CLCIT_DIVIDER)
{
- if ((prefixOk && CSTR_EQUAL==CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, text, -1, group->cl.items[group->scanIndex]->szText, testlen)) ||
+ if ((prefixOk && CSTR_EQUAL == CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, text, -1, group->cl.items[group->scanIndex]->szText, testlen)) ||
(!prefixOk && !lstrcmpi(text, group->cl.items[group->scanIndex]->szText)))
{
struct ClcGroup *contactGroup = group;
@@ -385,17 +385,17 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const
int foundindex;
for (; group; group = group->parent)
pcli->pfnSetGroupExpand(hwnd, dat, group, 1);
- foundindex=pcli->pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
+ foundindex = pcli->pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
if (fReturnAsFound)
return foundindex;
- else if (nLastFound!=-1 && fSearchUp && foundindex==index)
+ else if (nLastFound != -1 && fSearchUp && foundindex == index)
return nLastFound;
- else if (!fSearchUp && foundindex==index)
- fReturnAsFound=TRUE;
+ else if (!fSearchUp && foundindex == index)
+ fReturnAsFound = TRUE;
else
- nLastFound=foundindex;
- group=contactGroup;
- group->scanIndex=contactScanIndex;
+ nLastFound = foundindex;
+ group = contactGroup;
+ group->scanIndex = contactScanIndex;
}
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP)
{
@@ -423,7 +423,7 @@ static BOOL clcItemNotHiddenOffline(struct ClcData * dat, struct ClcGroup* group
if (CLCItems_IsShowOfflineGroup(group)) return TRUE;
- pdnce=(PDNCE)pcli->pfnGetCacheEntry( contact->hContact);
+ pdnce = (PDNCE)pcli->pfnGetCacheEntry( contact->hContact);
if (!pdnce) return FALSE;
if (pdnce->m_cache_nNoHiddenOffline) return TRUE;
@@ -432,16 +432,16 @@ static BOOL clcItemNotHiddenOffline(struct ClcData * dat, struct ClcGroup* group
}
static LRESULT clcOnCreate(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- dat=(struct ClcData*)mir_calloc(sizeof(struct ClcData));
+ dat = (struct ClcData*)mir_calloc(sizeof(struct ClcData));
SetWindowLongPtr(hwnd,0,(LONG_PTR)dat);
- dat->hCheckBoxTheme=xpt_AddThemeHandle(hwnd, L"BUTTON");
- dat->m_paintCouter=0;
- dat->hWnd=hwnd;
+ dat->hCheckBoxTheme = xpt_AddThemeHandle(hwnd, L"BUTTON");
+ dat->m_paintCouter = 0;
+ dat->hWnd = hwnd;
dat->use_avatar_service = ServiceExists(MS_AV_GETAVATARBITMAP);
if (dat->use_avatar_service)
{
if (!hAvatarChanged)
- hAvatarChanged=ModernHookEvent(ME_AV_AVATARCHANGED, clcHookAvatarChanged);
+ hAvatarChanged = ModernHookEvent(ME_AV_AVATARCHANGED, clcHookAvatarChanged);
}
//else
//{
@@ -450,21 +450,21 @@ static LRESULT clcOnCreate(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPar
RowHeights_Initialize(dat);
- dat->NeedResort=1;
- dat->MetaIgnoreEmptyExtra=db_get_b(NULL,"CLC","MetaIgnoreEmptyExtra",SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
+ dat->NeedResort = 1;
+ dat->MetaIgnoreEmptyExtra = db_get_b(NULL,"CLC","MetaIgnoreEmptyExtra",SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
- dat->IsMetaContactsEnabled=(!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) &&
+ dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) &&
g_szMetaModuleName && db_get_b(NULL,g_szMetaModuleName,"Enabled",1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
- dat->expandMeta=db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
- dat->useMetaIcon=db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT);
- dat->drawOverlayedStatus=db_get_b(NULL,"CLC","DrawOverlayedStatus",SETTING_DRAWOVERLAYEDSTATUS_DEFAULT);
- g_CluiData.bSortByOrder[0]=db_get_b(NULL,"CList","SortBy1",SETTING_SORTBY1_DEFAULT);
- g_CluiData.bSortByOrder[1]=db_get_b(NULL,"CList","SortBy2",SETTING_SORTBY2_DEFAULT);
- g_CluiData.bSortByOrder[2]=db_get_b(NULL,"CList","SortBy3",SETTING_SORTBY3_DEFAULT);
- g_CluiData.fSortNoOfflineBottom=db_get_b(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT);
- dat->menuOwnerID=-1;
- dat->menuOwnerType=CLCIT_INVALID;
+ dat->expandMeta = db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
+ dat->useMetaIcon = db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT);
+ dat->drawOverlayedStatus = db_get_b(NULL,"CLC","DrawOverlayedStatus",SETTING_DRAWOVERLAYEDSTATUS_DEFAULT);
+ g_CluiData.bSortByOrder[0] = db_get_b(NULL,"CList","SortBy1",SETTING_SORTBY1_DEFAULT);
+ g_CluiData.bSortByOrder[1] = db_get_b(NULL,"CList","SortBy2",SETTING_SORTBY2_DEFAULT);
+ g_CluiData.bSortByOrder[2] = db_get_b(NULL,"CList","SortBy3",SETTING_SORTBY3_DEFAULT);
+ g_CluiData.fSortNoOfflineBottom = db_get_b(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT);
+ dat->menuOwnerID = -1;
+ dat->menuOwnerType = CLCIT_INVALID;
//InitDisplayNameCache(&dat->lCLCContactsCache);
//LoadCLCOptions(hwnd,dat);
corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
@@ -495,7 +495,7 @@ static LRESULT clcOnCommand(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa
switch (LOWORD(wParam))
{
case POPUP_NEWSUBGROUP:
- if (contact->type != CLCIT_GROUP)
+ if (contact->type !=CLCIT_GROUP)
return 0;
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_USEGROUPS);
@@ -505,19 +505,19 @@ static LRESULT clcOnCommand(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa
pcli->pfnBeginRenameSelection(hwnd, dat);
return 0;
case POPUP_DELETEGROUP:
- if (contact->type != CLCIT_GROUP)
+ if (contact->type !=CLCIT_GROUP)
return 0;
CallService(MS_CLIST_GROUPDELETE, contact->groupId, 0);
return 0;
case POPUP_GROUPSHOWOFFLINE:
- if (contact->type != CLCIT_GROUP)
+ if (contact->type !=CLCIT_GROUP)
return 0;
CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId,
MAKELPARAM(CLCItems_IsShowOfflineGroup(contact->group) ? 0 : GROUPF_SHOWOFFLINE, GROUPF_SHOWOFFLINE));
pcli->pfnClcBroadcast(CLM_AUTOREBUILD,0, 0);
return 0;
case POPUP_GROUPHIDEOFFLINE:
- if (contact->type != CLCIT_GROUP)
+ if (contact->type !=CLCIT_GROUP)
return 0;
CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId,
MAKELPARAM(contact->group->hideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE));
@@ -540,7 +540,7 @@ static LRESULT clcOnSize(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam
{
HBITMAP hBmp, hBmpMask, hoBmp, hoMaskBmp;
HDC hdc,hdcMem;
- RECT rc={0};
+ RECT rc = {0};
int depth;
HBRUSH hBrush;
@@ -549,8 +549,8 @@ static LRESULT clcOnSize(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam
return corecli.pfnContactListControlWndProc(hwnd,msg,wParam,lParam);;
rc.bottom = max ( dat->row_min_heigh, 1 );
- //rc.bottom=8;
- //rc.right=8;
+ //rc.bottom = 8;
+ //rc.right = 8;
hdc = GetDC(hwnd);
depth = GetDeviceCaps(hdc, BITSPIXEL);
if (depth < 16)
@@ -586,7 +586,7 @@ static LRESULT clcOnSize(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam
static LRESULT clcOnChar(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if (wParam==27 && dat->szQuickSearch[0] == '\0') //escape and not quick search
+ if (wParam == 27 && dat->szQuickSearch[0] == '\0') //escape and not quick search
{
// minimize clist
CListMod_HideWindow(pcli->hwndContactList, SW_HIDE);
@@ -599,9 +599,9 @@ static LRESULT clcOnPaint(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPara
PAINTSTRUCT ps;
if (IsWindowVisible(hwnd))
{
- if (!g_CluiData.fLayered || GetParent(hwnd)!=pcli->hwndContactList)
+ if (!g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList)
{
- hdc=BeginPaint(hwnd,&ps);
+ hdc = BeginPaint(hwnd,&ps);
g_clcPainter.cliPaintClc(hwnd,dat,hdc,&ps.rcPaint);
EndPaint(hwnd,&ps);
}
@@ -617,24 +617,24 @@ static LRESULT clcOnEraseBkGround(struct ClcData *dat, HWND hwnd, UINT msg, WPAR
static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int selMoved=0;
- int changeGroupExpand=0;
+ int selMoved = 0;
+ int changeGroupExpand = 0;
int pageSize;
- if (wParam==VK_CONTROL)
+ if (wParam == VK_CONTROL)
return 0;
pcli->pfnHideInfoTip(hwnd,dat);
KillTimer(hwnd,TIMERID_INFOTIP);
KillTimer(hwnd,TIMERID_RENAME);
- if(CallService(MS_CLIST_MENUPROCESSHOTKEY,wParam,MPCF_CONTACTMENU))
+ if (CallService(MS_CLIST_MENUPROCESSHOTKEY,wParam,MPCF_CONTACTMENU))
return 0;
{
RECT clRect;
GetClientRect(hwnd,&clRect);
- if (dat->max_row_height) pageSize=clRect.bottom/dat->max_row_height;
- else pageSize=0;
+ if (dat->max_row_height) pageSize = clRect.bottom/dat->max_row_height;
+ else pageSize = 0;
}
switch(wParam)
@@ -642,18 +642,18 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa
case VK_DOWN:
case VK_UP:
{
- if (dat->szQuickSearch[0]!='\0' && dat->selection!=-1) //get next contact
+ if (dat->szQuickSearch[0] != '\0' && dat->selection != -1) //get next contact
{
//get next contact
- int index=clcSearchNextContact(hwnd,dat,dat->selection,dat->szQuickSearch,1,(wParam==VK_UP));
- if (index==-1)
+ int index = clcSearchNextContact(hwnd,dat,dat->selection,dat->szQuickSearch,1,(wParam == VK_UP));
+ if (index == -1)
{
MessageBeep(MB_OK);
return 0;
}
else
{
- dat->selection=index;
+ dat->selection = index;
pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
return 0;
@@ -662,27 +662,27 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa
}
else
{
- if (wParam==VK_DOWN) dat->selection++;
- if (wParam==VK_UP) dat->selection--;
- selMoved=1; break;
+ if (wParam == VK_DOWN) dat->selection++;
+ if (wParam == VK_UP) dat->selection--;
+ selMoved = 1; break;
}
}
- case VK_PRIOR: dat->selection-=pageSize; selMoved=1; break;
- case VK_NEXT: dat->selection+=pageSize; selMoved=1; break;
- case VK_HOME: dat->selection=0; selMoved=1; break;
- case VK_END: dat->selection=pcli->pfnGetGroupContentsCount(&dat->list,1)-1; selMoved=1; break;
- case VK_LEFT: changeGroupExpand=1; break;
- case VK_RIGHT: changeGroupExpand=2; break;
+ case VK_PRIOR: dat->selection -= pageSize; selMoved = 1; break;
+ case VK_NEXT: dat->selection += pageSize; selMoved = 1; break;
+ case VK_HOME: dat->selection = 0; selMoved = 1; break;
+ case VK_END: dat->selection = pcli->pfnGetGroupContentsCount(&dat->list,1)-1; selMoved = 1; break;
+ case VK_LEFT: changeGroupExpand = 1; break;
+ case VK_RIGHT: changeGroupExpand = 2; break;
case VK_RETURN: pcli->pfnDoSelectionDefaultAction(hwnd,dat); SetCapture(hwnd); return 0;
case VK_F2: cliBeginRenameSelection(hwnd,dat); /*SetCapture(hwnd);*/ return 0;
case VK_DELETE: pcli->pfnDeleteFromContactList(hwnd,dat); SetCapture(hwnd);return 0;
case VK_ESCAPE:
{
- if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
+ if ((dat->dragStage&DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE)
{
- dat->iDragItem=-1;
- dat->iInsertionMark=-1;
- dat->dragStage=0;
+ dat->iDragItem = -1;
+ dat->iInsertionMark = -1;
+ dat->dragStage = 0;
ReleaseCapture();
}
return 0;
@@ -690,113 +690,113 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa
default:
{
NMKEY nmkey;
- nmkey.hdr.hwndFrom=hwnd;
- nmkey.hdr.idFrom=GetDlgCtrlID(hwnd);
- nmkey.hdr.code=NM_KEYDOWN;
- nmkey.nVKey=wParam;
- nmkey.uFlags=HIWORD(lParam);
+ nmkey.hdr.hwndFrom = hwnd;
+ nmkey.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nmkey.hdr.code = NM_KEYDOWN;
+ nmkey.nVKey = wParam;
+ nmkey.uFlags = HIWORD(lParam);
- if(SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nmkey))
+ if (SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nmkey))
{
SetCapture(hwnd);
return 0;
}
}
}
- if(changeGroupExpand)
+ if (changeGroupExpand)
{
int hit;
struct ClcContact *contact;
struct ClcGroup *group;
- dat->szQuickSearch[0]=0;
- hit=cliGetRowByIndex(dat,dat->selection,&contact,&group);
- if(hit!=-1)
+ dat->szQuickSearch[0] = 0;
+ hit = cliGetRowByIndex(dat,dat->selection,&contact,&group);
+ if (hit != -1)
{
- if (contact->type==CLCIT_CONTACT &&(contact->isSubcontact || contact->SubAllocated>0))
+ if (contact->type == CLCIT_CONTACT &&(contact->isSubcontact || contact->SubAllocated>0))
{
- if (contact->isSubcontact && changeGroupExpand==1)
+ if (contact->isSubcontact && changeGroupExpand == 1)
{
- dat->selection-=contact->isSubcontact;
- selMoved=1;
+ dat->selection -= contact->isSubcontact;
+ selMoved = 1;
}
else if (!contact->isSubcontact && contact->SubAllocated>0)
{
- if (changeGroupExpand==1 && !contact->SubExpanded)
+ if (changeGroupExpand == 1 && !contact->SubExpanded)
{
- dat->selection=cliGetRowsPriorTo(&dat->list,group,-1);
- selMoved=1;
+ dat->selection = cliGetRowsPriorTo(&dat->list,group,-1);
+ selMoved = 1;
}
- else if (changeGroupExpand==1 && contact->SubExpanded)
+ else if (changeGroupExpand == 1 && contact->SubExpanded)
{
//Contract
- struct ClcContact * ht=NULL;
+ struct ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
- contact->SubExpanded=0;
+ contact->SubExpanded = 0;
db_set_b(contact->hContact,"CList","Expanded",0);
- ht=contact;
- dat->NeedResort=1;
+ ht = contact;
+ dat->NeedResort = 1;
pcli->pfnSortCLC(hwnd,dat,1);
cliRecalcScrollBar(hwnd,dat);
- hitcontact=NULL;
+ hitcontact = NULL;
}
- else if (changeGroupExpand==2 && contact->SubExpanded)
+ else if (changeGroupExpand == 2 && contact->SubExpanded)
{
dat->selection++;
- selMoved=1;
+ selMoved = 1;
}
- else if (changeGroupExpand==2 && !contact->SubExpanded && dat->expandMeta)
+ else if (changeGroupExpand == 2 && !contact->SubExpanded && dat->expandMeta)
{
- struct ClcContact * ht=NULL;
+ struct ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
- contact->SubExpanded=1;
+ contact->SubExpanded = 1;
db_set_b(contact->hContact,"CList","Expanded",1);
- ht=contact;
- dat->NeedResort=1;
+ ht = contact;
+ dat->NeedResort = 1;
pcli->pfnSortCLC(hwnd,dat,1);
cliRecalcScrollBar(hwnd,dat);
if (ht)
{
- int i=0;
+ int i = 0;
struct ClcContact *contact2;
struct ClcGroup *group2;
- if(FindItem(hwnd,dat,contact->hContact,&contact2,&group2,NULL,FALSE))
+ if (FindItem(hwnd,dat,contact->hContact,&contact2,&group2,NULL,FALSE))
{
- i=cliGetRowsPriorTo(&dat->list,group2,GetContactIndex(group2,contact2));
+ i = cliGetRowsPriorTo(&dat->list,group2,GetContactIndex(group2,contact2));
pcli->pfnEnsureVisible(hwnd,dat,i+contact->SubAllocated,0);
}
}
- hitcontact=NULL;
+ hitcontact = NULL;
}
}
}
else
{
- if(changeGroupExpand==1 && contact->type==CLCIT_CONTACT) {
- if(group==&dat->list) {SetCapture(hwnd); return 0;}
- dat->selection=cliGetRowsPriorTo(&dat->list,group,-1);
- selMoved=1;
+ if (changeGroupExpand == 1 && contact->type == CLCIT_CONTACT) {
+ if (group == &dat->list) {SetCapture(hwnd); return 0;}
+ dat->selection = cliGetRowsPriorTo(&dat->list,group,-1);
+ selMoved = 1;
}
else {
- if(contact->type==CLCIT_GROUP)
+ if (contact->type == CLCIT_GROUP)
{
- if (changeGroupExpand==1)
+ if (changeGroupExpand == 1)
{
if (!contact->group->expanded)
{
dat->selection--;
- selMoved=1;
+ selMoved = 1;
}
else
{
pcli->pfnSetGroupExpand(hwnd,dat,contact->group,0);
}
}
- else if (changeGroupExpand==2)
+ else if (changeGroupExpand == 2)
{
pcli->pfnSetGroupExpand(hwnd,dat,contact->group,1);
dat->selection++;
- selMoved=1;
+ selMoved = 1;
}
else {SetCapture(hwnd);return 0;}
}//
@@ -807,12 +807,12 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa
}
else {SetCapture(hwnd);return 0; }
}
- if(selMoved)
+ if (selMoved)
{
- dat->szQuickSearch[0]=0;
- if(dat->selection>=pcli->pfnGetGroupContentsCount(&dat->list,1))
- dat->selection=pcli->pfnGetGroupContentsCount(&dat->list,1)-1;
- if(dat->selection<0) dat->selection=0;
+ dat->szQuickSearch[0] = 0;
+ if (dat->selection >= pcli->pfnGetGroupContentsCount(&dat->list,1))
+ dat->selection = pcli->pfnGetGroupContentsCount(&dat->list,1)-1;
+ if (dat->selection < 0) dat->selection = 0;
if (dat->bCompactMode)
SendMessage(hwnd,WM_SIZE,0,0);
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
@@ -856,41 +856,41 @@ static LRESULT clcOnTimer(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPara
}
case TIMERID_INVALIDATE:
{
- time_t cur_time=(time(NULL)/60);
- if (cur_time!=dat->last_tick_time)
+ time_t cur_time = (time(NULL)/60);
+ if (cur_time != dat->last_tick_time)
{
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- dat->last_tick_time=cur_time;
+ dat->last_tick_time = cur_time;
}
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
case TIMERID_SUBEXPAND:
{
- struct ClcContact * ht=NULL;
+ struct ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
if (hitcontact && dat->expandMeta)
{
- if (hitcontact->SubExpanded) hitcontact->SubExpanded=0; else hitcontact->SubExpanded=1;
+ if (hitcontact->SubExpanded) hitcontact->SubExpanded = 0; else hitcontact->SubExpanded = 1;
db_set_b(hitcontact->hContact,"CList","Expanded",hitcontact->SubExpanded);
if (hitcontact->SubExpanded)
- ht=&(hitcontact->subcontacts[hitcontact->SubAllocated-1]);
+ ht = &(hitcontact->subcontacts[hitcontact->SubAllocated-1]);
}
- dat->NeedResort=1;
+ dat->NeedResort = 1;
pcli->pfnSortCLC(hwnd,dat,1);
cliRecalcScrollBar(hwnd,dat);
if (ht)
{
- int i=0;
+ int i = 0;
struct ClcContact *contact;
struct ClcGroup *group;
- if(FindItem(hwnd,dat,hitcontact->hContact,&contact,&group,NULL,FALSE))
+ if (FindItem(hwnd,dat,hitcontact->hContact,&contact,&group,NULL,FALSE))
{
- i=cliGetRowsPriorTo(&dat->list,group,GetContactIndex(group,contact));
+ i = cliGetRowsPriorTo(&dat->list,group,GetContactIndex(group,contact));
pcli->pfnEnsureVisible(hwnd,dat,i+hitcontact->SubAllocated,0);
}
}
- hitcontact=NULL;
+ hitcontact = NULL;
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
case TIMERID_DELAYEDRESORTCLC:
@@ -923,7 +923,7 @@ static LRESULT clcOnActivate(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wP
if ( dat->hwndRenameEdit == NULL )
PostMessage( hwnd, WM_SIZE, 0, 0);
}
- dat->dragStage|= DRAGSTAGEF_SKIPRENAME;
+ dat->dragStage |= DRAGSTAGEF_SKIPRENAME;
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
static LRESULT clcOnSetCursor(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -939,27 +939,27 @@ static LRESULT clcOnSetCursor(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if (g_CluiData.bBehindEdgeSettings)
CLUI_UpdateTimer(0);
- lResult=CLUI_TestCursorOnBorders();
+ lResult = CLUI_TestCursorOnBorders();
return lResult ? lResult : DefWindowProc(hwnd,msg,wParam,lParam);
}
static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
{
POINT pt;
- int k=0;
+ int k = 0;
pt.x = LOWORD(lParam);
pt.y = HIWORD(lParam);
ClientToScreen(hwnd,&pt);
- k=CLUI_SizingOnBorder(pt,0);
+ k = CLUI_SizingOnBorder(pt,0);
if (k)
{
- int io=dat->iHotTrack;
- dat->iHotTrack=0;
- if(dat->exStyle&CLS_EX_TRACKSELECT)
+ int io = dat->iHotTrack;
+ dat->iHotTrack = 0;
+ if (dat->exStyle&CLS_EX_TRACKSELECT)
{
pcli->pfnInvalidateItem(hwnd,dat,io);
}
- if (k && GetCapture()==hwnd)
+ if (k && GetCapture() == hwnd)
{
SendMessage(GetParent(hwnd),WM_PARENTNOTIFY,WM_LBUTTONDOWN,lParam);
}
@@ -971,69 +971,69 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM
struct ClcGroup *group;
int hit;
DWORD hitFlags;
- fMouseUpped=FALSE;
+ fMouseUpped = FALSE;
pcli->pfnHideInfoTip(hwnd,dat);
KillTimer(hwnd,TIMERID_INFOTIP);
KillTimer(hwnd,TIMERID_RENAME);
KillTimer(hwnd,TIMERID_SUBEXPAND);
pcli->pfnEndRename(hwnd,dat,1);
- dat->ptDragStart.x=(short)LOWORD(lParam);
- dat->ptDragStart.y=(short)HIWORD(lParam);
- dat->szQuickSearch[0]=0;
- hit=cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),&contact,&group,&hitFlags);
- if(GetFocus()!=hwnd) SetFocus(hwnd);
- if(hit!=-1 && !(hitFlags&CLCHT_NOWHERE))
+ dat->ptDragStart.x = (short)LOWORD(lParam);
+ dat->ptDragStart.y = (short)HIWORD(lParam);
+ dat->szQuickSearch[0] = 0;
+ hit = cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),&contact,&group,&hitFlags);
+ if (GetFocus() != hwnd) SetFocus(hwnd);
+ if (hit != -1 && !(hitFlags&CLCHT_NOWHERE))
{
- if ( hit==dat->selection && hitFlags&CLCHT_ONITEMLABEL && dat->exStyle&CLS_EX_EDITLABELS)
+ if ( hit == dat->selection && hitFlags&CLCHT_ONITEMLABEL && dat->exStyle&CLS_EX_EDITLABELS)
{
if ( !(dat->dragStage&DRAGSTAGEF_SKIPRENAME))
{
SetCapture(hwnd);
- dat->iDragItem=dat->selection;
- dat->dragStage=DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME;
- dat->dragAutoScrolling=0;
+ dat->iDragItem = dat->selection;
+ dat->dragStage = DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME;
+ dat->dragAutoScrolling = 0;
return TRUE;
}
else
{
- dat->dragStage&= ~DRAGSTAGEF_SKIPRENAME;
+ dat->dragStage &= ~DRAGSTAGEF_SKIPRENAME;
return TRUE;
}
}
}
- if(hit!=-1 && !(hitFlags&CLCHT_NOWHERE) && contact->type==CLCIT_CONTACT && contact->SubAllocated && !contact->isSubcontact)
- if(hitFlags&CLCHT_ONITEMICON && dat->expandMeta)
+ if (hit != -1 && !(hitFlags&CLCHT_NOWHERE) && contact->type == CLCIT_CONTACT && contact->SubAllocated && !contact->isSubcontact)
+ if (hitFlags&CLCHT_ONITEMICON && dat->expandMeta)
{
- BYTE doubleClickExpand=db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT);
+ BYTE doubleClickExpand = db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT);
- hitcontact=contact;
- HitPoint.x= (short)LOWORD(lParam);
- HitPoint.y= (short)HIWORD(lParam);
- fMouseUpped=FALSE;
+ hitcontact = contact;
+ HitPoint.x = (short)LOWORD(lParam);
+ HitPoint.y = (short)HIWORD(lParam);
+ fMouseUpped = FALSE;
if ((GetKeyState(VK_SHIFT)&0x8000)||(GetKeyState(VK_CONTROL)&0x8000) || (GetKeyState(VK_MENU)&0x8000))
{
- fMouseUpped=TRUE;
- hitcontact=contact;
+ fMouseUpped = TRUE;
+ hitcontact = contact;
KillTimer(hwnd,TIMERID_SUBEXPAND);
CLUI_SafeSetTimer(hwnd,TIMERID_SUBEXPAND,0,NULL);
}
}
else
- hitcontact=NULL;
+ hitcontact = NULL;
- if(hit!=-1 && !(hitFlags&CLCHT_NOWHERE) && contact->type==CLCIT_GROUP)
- if(hitFlags&CLCHT_ONITEMICON)
+ if (hit != -1 && !(hitFlags&CLCHT_NOWHERE) && contact->type == CLCIT_GROUP)
+ if (hitFlags&CLCHT_ONITEMICON)
{
struct ClcGroup *selgroup;
struct ClcContact *selcontact;
- dat->selection=cliGetRowByIndex(dat,dat->selection,&selcontact,&selgroup);
+ dat->selection = cliGetRowByIndex(dat,dat->selection,&selcontact,&selgroup);
pcli->pfnSetGroupExpand(hwnd,dat,contact->group,-1);
- if(dat->selection!=-1)
+ if (dat->selection != -1)
{
- dat->selection=cliGetRowsPriorTo(&dat->list,selgroup,GetContactIndex(selgroup,selcontact));
- if(dat->selection==-1) dat->selection=cliGetRowsPriorTo(&dat->list,contact->group,-1);
+ dat->selection = cliGetRowsPriorTo(&dat->list,selgroup,GetContactIndex(selgroup,selcontact));
+ if (dat->selection == -1) dat->selection = cliGetRowsPriorTo(&dat->list,contact->group,-1);
}
if (dat->bCompactMode)
{
@@ -1046,52 +1046,52 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM
}
return TRUE;
}
- if(hit!=-1 && !(hitFlags&CLCHT_NOWHERE) && hitFlags&CLCHT_ONITEMCHECK)
+ if (hit != -1 && !(hitFlags&CLCHT_NOWHERE) && hitFlags&CLCHT_ONITEMCHECK)
{
NMCLISTCONTROL nm;
- contact->flags^=CONTACTF_CHECKED;
- if(contact->type==CLCIT_GROUP) pcli->pfnSetGroupChildCheckboxes(contact->group,contact->flags&CONTACTF_CHECKED);
+ contact->flags ^= CONTACTF_CHECKED;
+ if (contact->type == CLCIT_GROUP) pcli->pfnSetGroupChildCheckboxes(contact->group,contact->flags&CONTACTF_CHECKED);
pcli->pfnRecalculateGroupCheckboxes(hwnd,dat);
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- nm.hdr.code=CLN_CHECKCHANGED;
- nm.hdr.hwndFrom=hwnd;
- nm.hdr.idFrom=GetDlgCtrlID(hwnd);
- nm.flags=0;
- nm.hItem=ContactToItemHandle(contact,&nm.flags);
+ nm.hdr.code = CLN_CHECKCHANGED;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ nm.hItem = ContactToItemHandle(contact,&nm.flags);
SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
}
if (!(hitFlags&(CLCHT_ONITEMICON|CLCHT_ONITEMLABEL|CLCHT_ONITEMCHECK)))
{
NMCLISTCONTROL nm;
- nm.hdr.code=NM_CLICK;
- nm.hdr.hwndFrom=hwnd;
- nm.hdr.idFrom=GetDlgCtrlID(hwnd);
- nm.flags=0;
- if(hit==-1 || hitFlags&CLCHT_NOWHERE) nm.hItem=NULL;
- else nm.hItem=ContactToItemHandle(contact,&nm.flags);
- nm.iColumn=hitFlags&CLCHT_ONITEMEXTRA?HIBYTE(HIWORD(hitFlags)):-1;
- nm.pt=dat->ptDragStart;
+ nm.hdr.code = NM_CLICK;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ if (hit == -1 || hitFlags&CLCHT_NOWHERE) nm.hItem = NULL;
+ else nm.hItem = ContactToItemHandle(contact,&nm.flags);
+ nm.iColumn = hitFlags&CLCHT_ONITEMEXTRA?HIBYTE(HIWORD(hitFlags)):-1;
+ nm.pt = dat->ptDragStart;
SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
}
- if(hitFlags&(CLCHT_ONITEMCHECK|CLCHT_ONITEMEXTRA))
+ if (hitFlags&(CLCHT_ONITEMCHECK|CLCHT_ONITEMEXTRA))
return FALSE;
- dat->selection=(hitFlags&CLCHT_NOWHERE)?-1:hit;
+ dat->selection = (hitFlags&CLCHT_NOWHERE)?-1:hit;
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
UpdateWindow(hwnd);
- if(dat->selection!=-1 && (contact->type==CLCIT_CONTACT || contact->type==CLCIT_GROUP) && !(hitFlags&(CLCHT_ONITEMEXTRA|CLCHT_ONITEMCHECK|CLCHT_NOWHERE)))
+ if (dat->selection != -1 && (contact->type == CLCIT_CONTACT || contact->type == CLCIT_GROUP) && !(hitFlags&(CLCHT_ONITEMEXTRA|CLCHT_ONITEMCHECK|CLCHT_NOWHERE)))
{
SetCapture(hwnd);
- dat->iDragItem=dat->selection;
- dat->dragStage=DRAGSTAGE_NOTMOVED;
- dat->dragAutoScrolling=0;
+ dat->iDragItem = dat->selection;
+ dat->dragStage = DRAGSTAGE_NOTMOVED;
+ dat->dragAutoScrolling = 0;
}
if (dat->bCompactMode)
{
SendMessage(hwnd,WM_SIZE,0,0);
}
- if(dat->selection!=-1) pcli->pfnEnsureVisible(hwnd,dat,hit,0);
+ if (dat->selection != -1) pcli->pfnEnsureVisible(hwnd,dat,hit,0);
return TRUE;
}
}
@@ -1100,13 +1100,13 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM
static LRESULT clcOnCaptureChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if ((HWND)lParam!=hwnd)
+ if ((HWND)lParam != hwnd)
{
- if (dat->iHotTrack!=-1)
+ if (dat->iHotTrack != -1)
{
int i;
- i=dat->iHotTrack;
- dat->iHotTrack=-1;
+ i = dat->iHotTrack;
+ dat->iHotTrack = -1;
pcli->pfnInvalidateItem(hwnd,dat,i);
pcli->pfnHideInfoTip(hwnd,dat);
}
@@ -1116,7 +1116,7 @@ static LRESULT clcOnCaptureChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPA
static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL isOutside=FALSE;
+ BOOL isOutside = FALSE;
if (CLUI_IsInMainWindow(hwnd))
{
if (g_CluiData.bBehindEdgeSettings) CLUI_UpdateTimer(0);
@@ -1128,74 +1128,74 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if ( dat->dragStage&DRAGSTAGEF_MAYBERENAME )
{
POINT pt;
- pt.x= (short)LOWORD(lParam);
- pt.y= (short)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
if ( abs(pt.x-dat->ptDragStart.x)>GetSystemMetrics(SM_CXDOUBLECLK)
||abs(pt.y-dat->ptDragStart.y)>GetSystemMetrics(SM_CYDOUBLECLK))
{
KillTimer( hwnd, TIMERID_RENAME );
- dat->dragStage&=(~DRAGSTAGEF_MAYBERENAME);
+ dat->dragStage &= (~DRAGSTAGEF_MAYBERENAME);
}
}
- if (dat->iDragItem==-1)
+ if (dat->iDragItem == -1)
{
POINT pt;
HWND window;
- pt.x= (short)LOWORD(lParam);
- pt.y= (short)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
ClientToScreen(hwnd,&pt);
- window=WindowFromPoint(pt);
- if (window!=hwnd) isOutside=TRUE;
+ window = WindowFromPoint(pt);
+ if (window != hwnd) isOutside = TRUE;
}
- if(hitcontact!=NULL)
+ if (hitcontact != NULL)
{
int x,y,xm,ym;
- x= (short)LOWORD(lParam);
- y= (short)HIWORD(lParam);
- xm=GetSystemMetrics(SM_CXDOUBLECLK);
- ym=GetSystemMetrics(SM_CYDOUBLECLK);
- if(abs(HitPoint.x-x)>xm || abs(HitPoint.y-y)>ym)
+ x = (short)LOWORD(lParam);
+ y = (short)HIWORD(lParam);
+ xm = GetSystemMetrics(SM_CXDOUBLECLK);
+ ym = GetSystemMetrics(SM_CYDOUBLECLK);
+ if (abs(HitPoint.x-x)>xm || abs(HitPoint.y-y)>ym)
{
if (fMouseUpped)
{
KillTimer(hwnd,TIMERID_SUBEXPAND);
CLUI_SafeSetTimer(hwnd,TIMERID_SUBEXPAND,0,NULL);
- fMouseUpped=FALSE;
+ fMouseUpped = FALSE;
}
else
{
KillTimer(hwnd,TIMERID_SUBEXPAND);
- hitcontact=NULL;
- fMouseUpped=FALSE;
+ hitcontact = NULL;
+ fMouseUpped = FALSE;
}
}
}
- if(dat->iDragItem==-1)
+ if (dat->iDragItem == -1)
{
- DWORD flag=0;
- int iOldHotTrack=dat->iHotTrack;
+ DWORD flag = 0;
+ int iOldHotTrack = dat->iHotTrack;
- if(dat->hwndRenameEdit!=NULL || GetKeyState(VK_MENU)&0x8000 || GetKeyState(VK_F10)&0x8000)
+ if (dat->hwndRenameEdit != NULL || GetKeyState(VK_MENU)&0x8000 || GetKeyState(VK_F10)&0x8000)
return 0;
- dat->iHotTrack= isOutside ? -1 : cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),NULL,NULL,&flag);
+ dat->iHotTrack = isOutside ? -1 : cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),NULL,NULL,&flag);
if (flag&CLCHT_NOWHERE)
- dat->iHotTrack=-1;
+ dat->iHotTrack = -1;
- if(iOldHotTrack!=dat->iHotTrack || isOutside)
+ if (iOldHotTrack != dat->iHotTrack || isOutside)
{
- if(iOldHotTrack==-1 && !isOutside)
+ if (iOldHotTrack == -1 && !isOutside)
SetCapture(hwnd);
- if (dat->iHotTrack==-1 || isOutside)
+ if (dat->iHotTrack == -1 || isOutside)
ReleaseCapture();
- if(dat->exStyle&CLS_EX_TRACKSELECT)
+ if (dat->exStyle&CLS_EX_TRACKSELECT)
{
pcli->pfnInvalidateItem(hwnd,dat,iOldHotTrack);
pcli->pfnInvalidateItem(hwnd,dat,dat->iHotTrack);
@@ -1206,21 +1206,21 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
KillTimer(hwnd,TIMERID_INFOTIP);
- if(wParam==0 && dat->hInfoTipItem==NULL)
+ if (wParam == 0 && dat->hInfoTipItem == NULL)
{
- dat->ptInfoTip.x=(short)LOWORD(lParam);
- dat->ptInfoTip.y=(short)HIWORD(lParam);
+ dat->ptInfoTip.x = (short)LOWORD(lParam);
+ dat->ptInfoTip.y = (short)HIWORD(lParam);
CLUI_SafeSetTimer(hwnd,TIMERID_INFOTIP,dat->infoTipTimeout,NULL);
}
return 0;
}
- if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_NOTMOVED && !(dat->exStyle&CLS_EX_DISABLEDRAGDROP))
+ if ((dat->dragStage&DRAGSTAGEM_STAGE) == DRAGSTAGE_NOTMOVED && !(dat->exStyle&CLS_EX_DISABLEDRAGDROP))
{
- if(abs((short)LOWORD(lParam)-dat->ptDragStart.x)>=GetSystemMetrics(SM_CXDRAG) || abs((short)HIWORD(lParam)-dat->ptDragStart.y)>=GetSystemMetrics(SM_CYDRAG))
- dat->dragStage=(dat->dragStage&~DRAGSTAGEM_STAGE)|DRAGSTAGE_ACTIVE;
+ if (abs((short)LOWORD(lParam)-dat->ptDragStart.x) >= GetSystemMetrics(SM_CXDRAG) || abs((short)HIWORD(lParam)-dat->ptDragStart.y) >= GetSystemMetrics(SM_CYDRAG))
+ dat->dragStage = (dat->dragStage&~DRAGSTAGEM_STAGE)|DRAGSTAGE_ACTIVE;
}
- if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
+ if ((dat->dragStage&DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE)
{
HCURSOR hNewCursor;
RECT clRect;
@@ -1228,24 +1228,24 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
int target;
GetClientRect(hwnd,&clRect);
- pt.x=(short)LOWORD(lParam); pt.y=(short)HIWORD(lParam);
- hNewCursor=LoadCursor(NULL, IDC_NO);
+ pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam);
+ hNewCursor = LoadCursor(NULL, IDC_NO);
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- if(dat->dragAutoScrolling)
- {KillTimer(hwnd,TIMERID_DRAGAUTOSCROLL); dat->dragAutoScrolling=0;}
- target=GetDropTargetInformation(hwnd,dat,pt);
- if(dat->dragStage&DRAGSTAGEF_OUTSIDE && target!=DROPTARGET_OUTSIDE)
+ if (dat->dragAutoScrolling)
+ {KillTimer(hwnd,TIMERID_DRAGAUTOSCROLL); dat->dragAutoScrolling = 0;}
+ target = GetDropTargetInformation(hwnd,dat,pt);
+ if (dat->dragStage&DRAGSTAGEF_OUTSIDE && target != DROPTARGET_OUTSIDE)
{
NMCLISTCONTROL nm;
struct ClcContact *contact;
cliGetRowByIndex(dat,dat->iDragItem,&contact,NULL);
- nm.hdr.code=CLN_DRAGSTOP;
- nm.hdr.hwndFrom=hwnd;
- nm.hdr.idFrom=GetDlgCtrlID(hwnd);
- nm.flags=0;
- nm.hItem=ContactToItemHandle(contact,&nm.flags);
+ nm.hdr.code = CLN_DRAGSTOP;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ nm.hItem = ContactToItemHandle(contact,&nm.flags);
SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
- dat->dragStage&=~DRAGSTAGEF_OUTSIDE;
+ dat->dragStage &= ~DRAGSTAGEF_OUTSIDE;
}
switch(target)
{
@@ -1257,12 +1257,12 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
{
struct ClcContact *contSour;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
- if (contSour->type==CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
+ if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
if (!contSour->isSubcontact)
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
- hNewCursor=LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DROPMETA));
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DROPMETA));
}
}
@@ -1274,15 +1274,15 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
struct ClcContact *contSour,*contDest;
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
- if (contSour->type==CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
+ if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
if (!contSour->isSubcontact)
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
- if (contSour->subcontacts==contDest)
- hNewCursor=LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DEFAULTSUB)); ///MakeDefault
+ if (contSour->subcontacts == contDest)
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DEFAULTSUB)); ///MakeDefault
else
- hNewCursor=LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
}
}
break;
@@ -1292,25 +1292,25 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
struct ClcContact *contSour,*contDest;
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
- if (contSour->type==CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
+ if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
if (!contSour->isSubcontact)
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
- if (contDest->subcontacts==contSour->subcontacts)
+ if (contDest->subcontacts == contSour->subcontacts)
break;
else
- hNewCursor=LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
}
}
break;
case DROPTARGET_ONGROUP:
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER));
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER));
break;
case DROPTARGET_INSERTION:
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROP));
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROP));
break;
case DROPTARGET_OUTSIDE:
@@ -1318,39 +1318,39 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
NMCLISTCONTROL nm;
struct ClcContact *contact;
- if(pt.x>=0 && pt.x<clRect.right && ((pt.y<0 && pt.y>-dat->dragAutoScrollHeight) || (pt.y>=clRect.bottom && pt.y<clRect.bottom+dat->dragAutoScrollHeight)))
+ if (pt.x >= 0 && pt.x < clRect.right && ((pt.y < 0 && pt.y>-dat->dragAutoScrollHeight) || (pt.y >= clRect.bottom && pt.y < clRect.bottom+dat->dragAutoScrollHeight)))
{
if (!dat->dragAutoScrolling)
{
- if(pt.y<0) dat->dragAutoScrolling=-1;
- else dat->dragAutoScrolling=1;
+ if (pt.y < 0) dat->dragAutoScrolling = -1;
+ else dat->dragAutoScrolling = 1;
CLUI_SafeSetTimer(hwnd,TIMERID_DRAGAUTOSCROLL,dat->scrollTime,NULL);
}
SendMessage(hwnd,WM_TIMER,TIMERID_DRAGAUTOSCROLL,0);
}
- dat->dragStage|=DRAGSTAGEF_OUTSIDE;
+ dat->dragStage |= DRAGSTAGEF_OUTSIDE;
cliGetRowByIndex(dat,dat->iDragItem,&contact,NULL);
- nm.hdr.code=CLN_DRAGGING;
- nm.hdr.hwndFrom=hwnd;
- nm.hdr.idFrom=GetDlgCtrlID(hwnd);
- nm.flags=0;
- nm.hItem=ContactToItemHandle(contact,&nm.flags);
- nm.pt=pt;
- if(SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm))
+ nm.hdr.code = CLN_DRAGGING;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ nm.hItem = ContactToItemHandle(contact,&nm.flags);
+ nm.pt = pt;
+ if (SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm))
return 0;
break;
}
default:
{
- struct ClcGroup *group=NULL;
+ struct ClcGroup *group = NULL;
cliGetRowByIndex(dat,dat->iDragItem,NULL,&group);
- if(group && group->parent)
+ if (group && group->parent)
{
struct ClcContact *contSour;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
if (!contSour->isSubcontact)
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER));
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER));
}
break;
}
@@ -1364,37 +1364,37 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if (clcExitDragToScroll())
return 0;
- fMouseUpped=TRUE;
+ fMouseUpped = TRUE;
- if (hitcontact!=NULL && dat->expandMeta)
+ if (hitcontact != NULL && dat->expandMeta)
{
- BYTE doubleClickExpand=db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT);
+ BYTE doubleClickExpand = db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT);
CLUI_SafeSetTimer(hwnd,TIMERID_SUBEXPAND,GetDoubleClickTime()*doubleClickExpand,NULL);
}
- else if (dat->iHotTrack==-1 && dat->iDragItem==-1)
+ else if (dat->iHotTrack == -1 && dat->iDragItem == -1)
ReleaseCapture();
- if(dat->iDragItem==-1) return 0;
+ if (dat->iDragItem == -1) return 0;
SetCursor((HCURSOR)GetClassLongPtr(hwnd,GCLP_HCURSOR));
- if(dat->exStyle&CLS_EX_TRACKSELECT)
+ if (dat->exStyle&CLS_EX_TRACKSELECT)
{
DWORD flags;
- dat->iHotTrack=cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),NULL,NULL,&flags);
- if(dat->iHotTrack==-1)
+ dat->iHotTrack = cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),NULL,NULL,&flags);
+ if (dat->iHotTrack == -1)
ReleaseCapture();
}
- else if (hitcontact==NULL)
+ else if (hitcontact == NULL)
ReleaseCapture();
KillTimer(hwnd,TIMERID_DRAGAUTOSCROLL);
- if(dat->dragStage==(DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME))
+ if (dat->dragStage == (DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME))
CLUI_SafeSetTimer(hwnd,TIMERID_RENAME,GetDoubleClickTime(),NULL);
- else if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
+ else if ((dat->dragStage&DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE)
{
POINT pt;
int target;
TCHAR Wording[500];
- int res=0;
- pt.x=(short)LOWORD(lParam); pt.y=(short)HIWORD(lParam);
- target=GetDropTargetInformation(hwnd,dat,pt);
+ int res = 0;
+ pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam);
+ target = GetDropTargetInformation(hwnd,dat,pt);
switch(target)
{
case DROPTARGET_ONSELF:
@@ -1408,20 +1408,20 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
- hcontact=contSour->hContact;
- if (contSour->type==CLCIT_CONTACT)
+ hcontact = contSour->hContact;
+ if (contSour->type == CLCIT_CONTACT)
{
if (g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
if (!contSour->isSubcontact)
{
- HANDLE hDest=contDest->hContact;
+ HANDLE hDest = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be converted to MetaContact and '%s' be added to it?"),contDest->szText, contSour->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
- handle=(HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hDest,0);
+ handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hDest,0);
if (!handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
@@ -1429,15 +1429,15 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
else
{
HANDLE handle,hcontact,hfrom,hdest;
- hcontact=contSour->hContact;
- hfrom=contSour->subcontacts->hContact;
- hdest=contDest->hContact;
+ hcontact = contSour->hContact;
+ hfrom = contSour->subcontacts->hContact;
+ hdest = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be converted to MetaContact and '%s' be added to it (remove it from '%s')?"), contDest->szText,contSour->szText,contSour->subcontacts->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
- handle=(HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hdest,0);
+ handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hdest,0);
if (!handle) return 0;
CallService(MS_MC_REMOVEFROMMETA,(WPARAM)0,(LPARAM)hcontact);
@@ -1455,7 +1455,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
int res;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
- if (contSour->type==CLCIT_CONTACT)
+ if (contSour->type == CLCIT_CONTACT)
{
if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName))
@@ -1463,11 +1463,11 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if (!contSour->isSubcontact)
{
HANDLE handle,hcontact;
- hcontact=contSour->hContact;
- handle=contDest->hContact;
+ hcontact = contSour->hContact;
+ handle = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do you want to contact '%s' be added to metacontact '%s'?"),contSour->szText, contDest->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Adding contact to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Adding contact to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
if (!handle) return 0;
@@ -1476,14 +1476,14 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
}
else
{
- if (contSour->subcontacts==contDest)
+ if (contSour->subcontacts == contDest)
{
HANDLE hsour;
- hsour=contSour->hContact;
+ hsour = contSour->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be default ?"),contSour->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Set default contact"),MB_OKCANCEL|MB_ICONQUESTION);
+ res = MessageBox(hwnd,Wording,TranslateT("Set default contact"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ if (res == 1)
{
CallService(MS_MC_SETDEFAULTCONTACT,(WPARAM)contDest->hContact,(LPARAM)hsour);
}
@@ -1491,12 +1491,12 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
else
{
HANDLE handle,hcontact,hfrom;
- hcontact=contSour->hContact;
- hfrom=contSour->subcontacts->hContact;
- handle=contDest->hContact;
+ hcontact = contSour->hContact;
+ hfrom = contSour->subcontacts->hContact;
+ handle = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be removed from MetaContact '%s' and added to '%s'?"), contSour->szText,contSour->subcontacts->szText,contDest->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
if (!handle) return 0;
@@ -1516,18 +1516,18 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
int res;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
- if (contSour->type==CLCIT_CONTACT)
+ if (contSour->type == CLCIT_CONTACT)
{
if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName))
{
if (!contSour->isSubcontact)
{
HANDLE handle,hcontact;
- hcontact=contSour->hContact;
- handle=contDest->subcontacts->hContact;
+ hcontact = contSour->hContact;
+ handle = contDest->subcontacts->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be added to MetaContact '%s'?"), contSour->szText,contDest->subcontacts->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
if (!handle) return 0;
@@ -1536,15 +1536,15 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
}
else
{
- if (contSour->subcontacts!=contDest->subcontacts)
+ if (contSour->subcontacts != contDest->subcontacts)
{
HANDLE handle,hcontact,hfrom;
- hcontact=contSour->hContact;
- hfrom=contSour->subcontacts->hContact;
- handle=contDest->subcontacts->hContact;
+ hcontact = contSour->hContact;
+ hfrom = contSour->subcontacts->hContact;
+ handle = contDest->subcontacts->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be removed from MetaContact '%s' and added to '%s'?"), contSour->szText,contSour->subcontacts->szText,contDest->subcontacts->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
if (!handle) return 0;
@@ -1565,26 +1565,26 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
{
struct ClcContact *contact, *destcontact;
struct ClcGroup *group, *destgroup;
- BOOL NeedRename=FALSE;
- TCHAR newName[128]={0};
+ BOOL NeedRename = FALSE;
+ TCHAR newName[128] = {0};
int newIndex,i;
pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
- i=pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
- if (i!=-1 && group->groupId!=destgroup->groupId)
+ i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
+ if (i != -1 && group->groupId != destgroup->groupId)
{
- TCHAR * groupName=mir_tstrdup(pcli->pfnGetGroupName(contact->groupId,0));
- TCHAR * shortGroup=NULL;
- TCHAR * sourceGrName=mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId,0));
+ TCHAR * groupName = mir_tstrdup(pcli->pfnGetGroupName(contact->groupId,0));
+ TCHAR * shortGroup = NULL;
+ TCHAR * sourceGrName = mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId,0));
if (groupName)
{
- int len=(int)_tcslen(groupName);
- do {len--;}while(len>=0 && groupName[len]!='\\');
- if (len>=0) shortGroup=groupName+len+1;
- else shortGroup=groupName;
+ int len = (int)_tcslen(groupName);
+ do {len--;}while(len >= 0 && groupName[len] != '\\');
+ if (len >= 0) shortGroup = groupName+len+1;
+ else shortGroup = groupName;
}
if (shortGroup)
{
- NeedRename=TRUE;
+ NeedRename = TRUE;
if (sourceGrName)
mir_sntprintf(newName,SIZEOF(newName),_T("%s\\%s"),sourceGrName,shortGroup);
else
@@ -1593,8 +1593,8 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if (groupName) mir_free_and_nill(groupName);
if (sourceGrName) mir_free_and_nill(sourceGrName);
}
- newIndex=CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact&&i!=-1)?destcontact->groupId:0);
- newIndex=newIndex?newIndex:contact->groupId;
+ newIndex = CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact&&i != -1)?destcontact->groupId:0);
+ newIndex = newIndex?newIndex:contact->groupId;
if (NeedRename) pcli->pfnRenameGroup(newIndex,newName);
break;
}
@@ -1609,34 +1609,34 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
}
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- dat->iDragItem=-1;
- dat->iInsertionMark=-1;
+ dat->iDragItem = -1;
+ dat->iInsertionMark = -1;
return 0;
}
static LRESULT clcOnLButtonDblClick(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
KillTimer(hwnd,TIMERID_SUBEXPAND);
- hitcontact=NULL;
+ hitcontact = NULL;
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
static LRESULT clcOnDestroy(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int i=0;
+ int i = 0;
- for(i=0;i<=FONTID_MODERN_MAX;i++)
+ for(i = 0;i <= FONTID_MODERN_MAX;i++)
{
- if(dat->fontModernInfo[i].hFont) DeleteObject(dat->fontModernInfo[i].hFont);
- dat->fontModernInfo[i].hFont=NULL;
+ if (dat->fontModernInfo[i].hFont) DeleteObject(dat->fontModernInfo[i].hFont);
+ dat->fontModernInfo[i].hFont = NULL;
}
if (dat->hMenuBackground)
{
DeleteObject(dat->hMenuBackground);
- dat->hMenuBackground=NULL;
+ dat->hMenuBackground = NULL;
}
if (!dat->bkChanged && dat->hBmpBackground)
{
DeleteObject(dat->hBmpBackground);
- dat->hBmpBackground=NULL;
+ dat->hBmpBackground = NULL;
}
ImageArray_Clear(&dat->avatar_cache);
@@ -1673,7 +1673,7 @@ static LRESULT clcOnIntmGroupChanged(struct ClcData *dat, HWND hwnd, UINT msg, W
if (pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL)) {
CopyMemory(contact->iExtraImage, iExtraImage, SIZEOF(iExtraImage));
CopyMemory((void*)contact->iWideExtraImage, (void*)iWideExtraImage, sizeof(iWideExtraImage));
- if(flags & CONTACTF_CHECKED)
+ if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
}
nm.hdr.code = CLN_CONTACTMOVED;
@@ -1692,13 +1692,13 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP
struct ClcContact *contact = NULL;
struct ClcGroup *group = NULL;
int recalcScrollBar = 0, shouldShow;
- BOOL needRepaint=FALSE;
+ BOOL needRepaint = FALSE;
WORD status;
char *szProto;
- int nHiddenStatus=0;
- BOOL image_is_special=FALSE;
- RECT iconRect={0};
- int contacticon=CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
+ int nHiddenStatus = 0;
+ BOOL image_is_special = FALSE;
+ RECT iconRect = {0};
+ int contacticon = CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
HANDLE hSelItem = NULL;
struct ClcContact *selcontact = NULL;
@@ -1706,16 +1706,16 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP
if (szProto == NULL)
status = ID_STATUS_OFFLINE;
else
- status=GetContactCachedStatus((HANDLE) wParam);
- image_is_special=(LOWORD(contacticon) != (LOWORD(lParam))); //check only base icons
+ status = GetContactCachedStatus((HANDLE) wParam);
+ image_is_special = (LOWORD(contacticon) !=(LOWORD(lParam))); //check only base icons
- nHiddenStatus=CLVM_GetContactHiddenStatus((HANDLE)wParam, szProto, dat);
+ nHiddenStatus = CLVM_GetContactHiddenStatus((HANDLE)wParam, szProto, dat);
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- bool isVisiblebyFilter = ( ( ( style & CLS_SHOWHIDDEN ) && nHiddenStatus != -1 ) || !nHiddenStatus );
+ bool isVisiblebyFilter = ( ( ( style & CLS_SHOWHIDDEN ) && nHiddenStatus !=-1 ) || !nHiddenStatus );
bool ifVisibleByClui = !pcli->pfnIsHiddenMode( dat, status );
bool isVisible = g_CluiData.bFilterEffective&CLVM_FILTER_STATUS ? TRUE : ifVisibleByClui;
- bool isIconChanged = CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != LOWORD(lParam);
+ bool isIconChanged = CallService(MS_CLIST_GETCONTACTICON, wParam, 0) !=LOWORD(lParam);
shouldShow = isVisiblebyFilter && ( isVisible || isIconChanged ) ;
@@ -1725,16 +1725,16 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP
{
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0))
{
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
+ if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) !=-1)
hSelItem = pcli->pfnContactToHItem(selcontact);
pcli->pfnAddContactToTree(hwnd, dat, (HANDLE) wParam, (style & CLS_CONTACTLIST) == 0, 0);
recalcScrollBar = 1;
- needRepaint=TRUE;
+ needRepaint = TRUE;
pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL);
if (contact)
{
contact->iImage = lParam;
- contact->image_is_special=image_is_special;
+ contact->image_is_special = image_is_special;
pcli->pfnNotifyNewContact(hwnd, (HANDLE) wParam);
dat->NeedResort = 1;
}
@@ -1747,14 +1747,14 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP
return 0;
if ( !shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE) && clcItemNotHiddenOffline(dat, group, contact))
{
- shouldShow=TRUE;
+ shouldShow = TRUE;
}
if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline || g_CluiData.bFilterEffective)) // CLVM changed
{
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
+ if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) !=-1)
hSelItem = pcli->pfnContactToHItem(selcontact);
pcli->pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
- needRepaint=TRUE;
+ needRepaint = TRUE;
recalcScrollBar = 1;
dat->NeedResort = 1;
}
@@ -1764,16 +1764,16 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP
if (!pcli->pfnIsHiddenMode(dat, status))
contact->flags |= CONTACTF_ONLINE;
else
- contact->flags &= ~CONTACTF_ONLINE;
- contact->image_is_special=image_is_special;
+ contact->flags &= ~CONTACTF_ONLINE;
+ contact->image_is_special = image_is_special;
if (!image_is_special) //Only if it is status changing
{
dat->NeedResort = 1;
- needRepaint=TRUE;
+ needRepaint = TRUE;
}
- else if (dat->m_paintCouter==contact->lastPaintCounter) //if contacts is visible
+ else if (dat->m_paintCouter == contact->lastPaintCounter) //if contacts is visible
{
- needRepaint=TRUE;
+ needRepaint = TRUE;
}
}
@@ -1794,7 +1794,7 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP
}
else if (needRepaint)
{
- if (contact && contact->pos_icon.bottom!=0 && contact->pos_icon.right!=0)
+ if (contact && contact->pos_icon.bottom != 0 && contact->pos_icon.right != 0)
CLUI__cliInvalidateRect(hwnd,&(contact->pos_icon),FALSE);
else
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
@@ -1836,7 +1836,7 @@ static LRESULT clcOnIntmTimeZoneChanged(struct ClcData *dat, HWND hwnd, UINT msg
static LRESULT clcOnIntmNameChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct ClcContact *contact;
- int ret=corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
+ int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
@@ -1848,7 +1848,7 @@ static LRESULT clcOnIntmNameChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP
Cache_GetText(dat,contact,1);
cliRecalcScrollBar(hwnd,dat);
}
- dat->NeedResort=1;
+ dat->NeedResort = 1;
pcli->pfnSortContacts();
return ret;
@@ -1856,7 +1856,7 @@ static LRESULT clcOnIntmNameChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP
static LRESULT clcOnIntmApparentModeChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int lResult=corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
+ int lResult = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (!ServiceExists("ExtraIcon/Register"))
ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
return lResult;
@@ -1881,19 +1881,19 @@ static LRESULT clcOnIntmStatusMsgChanged(struct ClcData *dat, HWND hwnd, UINT ms
static LRESULT clcOnIntmNotOnListChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
+ DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
struct ClcContact *contact;
if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- if(contact->type!=CLCIT_CONTACT)
+ if (contact->type != CLCIT_CONTACT)
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- if(dbcws->value.type==DBVT_DELETED || dbcws->value.bVal==0)
- contact->flags&=~CONTACTF_NOTONLIST;
+ if (dbcws->value.type == DBVT_DELETED || dbcws->value.bVal == 0)
+ contact->flags &= ~CONTACTF_NOTONLIST;
else
- contact->flags|=CONTACTF_NOTONLIST;
+ contact->flags |= CONTACTF_NOTONLIST;
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
@@ -1911,29 +1911,29 @@ static LRESULT clcOnIntmScrollBarChanged(struct ClcData *dat, HWND hwnd, UINT ms
static LRESULT clcOnIntmStatusChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int ret=corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- if (wParam != 0)
+ int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
+ if (wParam !=0)
{
pdisplayNameCacheEntry pdnce = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry((HANDLE)wParam);
if (pdnce && pdnce->m_cache_cszProto)
{
- struct ClcContact *contact=NULL;
+ struct ClcContact *contact = NULL;
pdnce___SetStatus( pdnce, GetStatusForContact(pdnce->m_cache_hContact,pdnce->m_cache_cszProto));
if (!dat->force_in_dialog && (
- (dat->second_line_show)// && dat->second_line_type==TEXT_STATUS)
- || (dat->third_line_show)// && dat->third_line_type==TEXT_STATUS)
+ (dat->second_line_show)// && dat->second_line_type == TEXT_STATUS)
+ || (dat->third_line_show)// && dat->third_line_type == TEXT_STATUS)
))
gtaRenewText(pdnce->m_cache_hContact);
SendMessage(hwnd,INTM_ICONCHANGED, wParam, (LPARAM) CallService(MS_CLIST_GETCONTACTICON, wParam, 1));
- if(FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
+ if (FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
{
- if (contact && contact->type==CLCIT_CONTACT)
+ if (contact && contact->type == CLCIT_CONTACT)
{
if (!contact->image_is_special && pdnce___GetStatus( pdnce )>ID_STATUS_OFFLINE)
- contact->iImage=CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
+ contact->iImage = CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
if (contact->isSubcontact
&& contact->subcontacts
- && contact->subcontacts->type==CLCIT_CONTACT)
+ && contact->subcontacts->type == CLCIT_CONTACT)
pcli->pfnClcBroadcast( INTM_STATUSCHANGED,(WPARAM)contact->subcontacts->hContact,0); //forward status changing to host meta contact
}
}
@@ -1976,10 +1976,10 @@ static LRESULT clcOnIntmReloadOptions(struct ClcData *dat, HWND hwnd, UINT msg,
HRESULT ClcLoadModule()
{
- g_himlCListClc=(HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
- hSettingChanged=ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED,clcHookSettingChanged);
+ g_himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
+ hSettingChanged = ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED,clcHookSettingChanged);
ModernHookEvent(ME_OPT_INITIALISE,ClcOptInit);
- hAckHook=(HANDLE)ModernHookEvent(ME_PROTO_ACK,clcHookProtoAck);
+ hAckHook = (HANDLE)ModernHookEvent(ME_PROTO_ACK,clcHookProtoAck);
ModernHookEvent(ME_SYSTEM_MODULESLOADED, clcHookModulesLoaded);
ModernHookEvent(ME_DB_EVENT_ADDED, clcHookDbEventAdded);
ModernHookEvent(ME_SYSTEM_SHUTDOWN,clcHookSystemShutdown);
@@ -1989,16 +1989,16 @@ HRESULT ClcLoadModule()
int ClcUnloadModule()
{
- if(hAvatarChanged!=0)
+ if (hAvatarChanged != 0)
ModernUnhookEvent(hAvatarChanged);
- if(hSmileyAddOptionsChangedHook!=0)
+ if (hSmileyAddOptionsChangedHook != 0)
ModernUnhookEvent(hSmileyAddOptionsChangedHook);
- if(hIconChangedHook!=0)
+ if (hIconChangedHook != 0)
ModernUnhookEvent(hIconChangedHook);
- if ( g_CluiData.bOldUseGroups != (BYTE)-1 )
+ if ( g_CluiData.bOldUseGroups !=(BYTE)-1 )
db_set_b(NULL,"CList","UseGroups",(BYTE)g_CluiData.bOldUseGroups );
- if ( g_CluiData.boldHideOffline != (BYTE)-1 )
+ if ( g_CluiData.boldHideOffline !=(BYTE)-1 )
db_set_b(NULL,"CList","HideOffline",(BYTE)g_CluiData.boldHideOffline );
return 0;
@@ -2016,22 +2016,22 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack)
if (!lstrcmpA(pcli->clcProto[i].szProto, ack->szModule))
{
pcli->clcProto[i].dwStatus = (WORD) ack->lParam;
- if (pcli->clcProto[i].dwStatus>=ID_STATUS_OFFLINE)
+ if (pcli->clcProto[i].dwStatus >= ID_STATUS_OFFLINE)
pcli->pfnTrayIconUpdateBase(pcli->clcProto[i].szProto);
if (!ServiceExists("ExtraIcon/Register"))
- if(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE)!=-1)
+ if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE) != -1)
ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)NULL);
return 0;
}
}
}
}
- else if (ack->type==ACKTYPE_AWAYMSG)
+ else if (ack->type == ACKTYPE_AWAYMSG)
{
- if (ack->result==ACKRESULT_SUCCESS && ack->lParam) {
+ if (ack->result == ACKRESULT_SUCCESS && ack->lParam) {
{//Do not change DB if it is IRC protocol
- if (ack->szModule!= NULL)
- if(db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) != 0) return 0;
+ if (ack->szModule != NULL)
+ if (db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) !=0) return 0;
}
db_set_ws(ack->hContact,"CList","StatusMsg",(const TCHAR *)ack->lParam);
@@ -2040,14 +2040,14 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack)
else
{
//DBDeleteContactSetting(ack->hContact,"CList","StatusMsg");
- //char a='\0';
+ //char a = '\0';
{//Do not change DB if it is IRC protocol
- if (ack->szModule!= NULL)
- if(db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) != 0) return 0;
+ if (ack->szModule != NULL)
+ if (db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) !=0) return 0;
}
if (ack->hContact)
{
- char * val= db_get_sa(ack->hContact,"CList","StatusMsg");
+ char * val = db_get_sa(ack->hContact,"CList","StatusMsg");
if (val)
{
if (!mir_bool_strcmpi(val,""))
@@ -2060,12 +2060,12 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack)
//pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,(WPARAM)ack->hContact,&a);
}
}
- else if (ack->type==ACKTYPE_AVATAR)
+ else if (ack->type == ACKTYPE_AVATAR)
{
- if (ack->result==ACKRESULT_SUCCESS)
+ if (ack->result == ACKRESULT_SUCCESS)
{
PROTO_AVATAR_INFORMATIONT *pai = (PROTO_AVATAR_INFORMATIONT*)ack->hProcess;
- if (pai != NULL && pai->hContact != NULL)
+ if (pai !=NULL && pai->hContact !=NULL)
pcli->pfnClcBroadcast( INTM_AVATARCHANGED,(WPARAM)pai->hContact,0);
}
}
@@ -2079,33 +2079,33 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack)
int ClcGetShortData(struct ClcData* pData, struct SHORTDATA *pShortData)
{
if (!pData|| !pShortData) return -1;
- pShortData->hWnd=pData->hWnd;
- pShortData->text_replace_smileys=pData->text_replace_smileys;
- pShortData->text_smiley_height=pData->text_smiley_height;
- pShortData->text_use_protocol_smileys=pData->text_use_protocol_smileys;
- pShortData->contact_time_show_only_if_different=pData->contact_time_show_only_if_different;
+ pShortData->hWnd = pData->hWnd;
+ pShortData->text_replace_smileys = pData->text_replace_smileys;
+ pShortData->text_smiley_height = pData->text_smiley_height;
+ pShortData->text_use_protocol_smileys = pData->text_use_protocol_smileys;
+ pShortData->contact_time_show_only_if_different = pData->contact_time_show_only_if_different;
// Second line
- pShortData->second_line_show=pData->second_line_show;
- pShortData->second_line_draw_smileys=pData->second_line_draw_smileys;
- pShortData->second_line_type=pData->second_line_type;
+ pShortData->second_line_show = pData->second_line_show;
+ pShortData->second_line_draw_smileys = pData->second_line_draw_smileys;
+ pShortData->second_line_type = pData->second_line_type;
_tcsncpy(pShortData->second_line_text,pData->second_line_text,TEXT_TEXT_MAX_LENGTH);
- pShortData->second_line_xstatus_has_priority=pData->second_line_xstatus_has_priority;
- pShortData->second_line_show_status_if_no_away=pData->second_line_show_status_if_no_away;
- pShortData->second_line_show_listening_if_no_away=pData->second_line_show_listening_if_no_away;
- pShortData->second_line_use_name_and_message_for_xstatus=pData->second_line_use_name_and_message_for_xstatus;
+ pShortData->second_line_xstatus_has_priority = pData->second_line_xstatus_has_priority;
+ pShortData->second_line_show_status_if_no_away = pData->second_line_show_status_if_no_away;
+ pShortData->second_line_show_listening_if_no_away = pData->second_line_show_listening_if_no_away;
+ pShortData->second_line_use_name_and_message_for_xstatus = pData->second_line_use_name_and_message_for_xstatus;
- pShortData->third_line_show=pData->third_line_show;
- pShortData->third_line_draw_smileys=pData->third_line_draw_smileys;
- pShortData->third_line_type=pData->third_line_type;
+ pShortData->third_line_show = pData->third_line_show;
+ pShortData->third_line_draw_smileys = pData->third_line_draw_smileys;
+ pShortData->third_line_type = pData->third_line_type;
_tcsncpy(pShortData->third_line_text,pData->third_line_text,TEXT_TEXT_MAX_LENGTH);
- pShortData->third_line_xstatus_has_priority=pData->third_line_xstatus_has_priority;
- pShortData->third_line_show_status_if_no_away=pData->third_line_show_status_if_no_away;
- pShortData->third_line_show_listening_if_no_away=pData->third_line_show_listening_if_no_away;
- pShortData->third_line_use_name_and_message_for_xstatus=pData->third_line_use_name_and_message_for_xstatus;
+ pShortData->third_line_xstatus_has_priority = pData->third_line_xstatus_has_priority;
+ pShortData->third_line_show_status_if_no_away = pData->third_line_show_status_if_no_away;
+ pShortData->third_line_show_listening_if_no_away = pData->third_line_show_listening_if_no_away;
+ pShortData->third_line_use_name_and_message_for_xstatus = pData->third_line_use_name_and_message_for_xstatus;
return 0;
}
@@ -2116,11 +2116,11 @@ int ClcEnterDragToScroll(HWND hwnd, int Y)
{
struct ClcData * dat;
if (IsDragToScrollMode) return 0;
- dat=(struct ClcData*)GetWindowLongPtr(hwnd,0);
+ dat = (struct ClcData*)GetWindowLongPtr(hwnd,0);
if (!dat) return 0;
- StartDragPos=Y;
- StartScrollPos=dat->yScroll;
- IsDragToScrollMode=1;
+ StartDragPos = Y;
+ StartScrollPos = dat->yScroll;
+ IsDragToScrollMode = 1;
SetCapture(hwnd);
return 1;
}
@@ -2135,9 +2135,9 @@ LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wPara
#define CASE_MSG_RET(msg, handler) case msg: return handler(dat, hwnd, msg, wParam, lParam);
struct ClcData *dat;
- dat=(struct ClcData*)GetWindowLongPtr(hwnd,0);
+ dat = (struct ClcData*)GetWindowLongPtr(hwnd,0);
- if(msg>=CLM_FIRST && msg<CLM_LAST)
+ if (msg >= CLM_FIRST && msg < CLM_LAST)
return cli_ProcessExternalMessages(hwnd,dat,msg,wParam,lParam);
switch (msg)