diff options
Diffstat (limited to 'src/modules/clist')
-rw-r--r-- | src/modules/clist/Docking.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/clc.cpp | 12 | ||||
-rw-r--r-- | src/modules/clist/clcfiledrop.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/clcitems.cpp | 16 | ||||
-rw-r--r-- | src/modules/clist/clcutils.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/clistevents.cpp | 66 | ||||
-rw-r--r-- | src/modules/clist/clistmenus.cpp | 104 | ||||
-rw-r--r-- | src/modules/clist/clistmod.cpp | 14 | ||||
-rw-r--r-- | src/modules/clist/clistsettings.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/clisttray.cpp | 58 | ||||
-rw-r--r-- | src/modules/clist/clui.cpp | 18 | ||||
-rw-r--r-- | src/modules/clist/cluiservices.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/contact.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/genmenu.cpp | 48 | ||||
-rw-r--r-- | src/modules/clist/genmenuopt.cpp | 166 | ||||
-rw-r--r-- | src/modules/clist/groups.cpp | 12 | ||||
-rw-r--r-- | src/modules/clist/keyboard.cpp | 42 | ||||
-rw-r--r-- | src/modules/clist/movetogroup.cpp | 26 | ||||
-rw-r--r-- | src/modules/clist/protocolorder.cpp | 34 |
19 files changed, 320 insertions, 320 deletions
diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp index b02a039f3f..382794b9d7 100644 --- a/src/modules/clist/Docking.cpp +++ b/src/modules/clist/Docking.cpp @@ -232,7 +232,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) wp->y = rc.top;
wp->cy = rc.bottom - rc.top;
wp->cx = rc.right - rc.left;
- wp->flags &= ~(SWP_NOSIZE | SWP_NOMOVE);
+ wp->flags &= ~(SWP_NOSIZE | SWP_NOMOVE);
}
}
}
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index 8a50469245..56a8b66c35 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -120,13 +120,13 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) static int ClcAccountsChanged(WPARAM, LPARAM)
{
int i, cnt;
- for (i = 0, cnt = 0; i < accounts.getCount(); ++i)
+ for (i=0, cnt=0; i < accounts.getCount(); ++i)
if (Proto_IsAccountEnabled(accounts[i])) ++cnt;
cli.hClcProtoCount = cnt;
cli.clcProto = (ClcProtoStatus *) mir_realloc(cli.clcProto, sizeof(ClcProtoStatus) * cli.hClcProtoCount);
- for (i = 0, cnt = 0; i < accounts.getCount(); ++i) {
+ for (i=0, cnt=0; i < accounts.getCount(); ++i) {
if (Proto_IsAccountEnabled(accounts[i])) {
cli.clcProto[cnt].szProto = accounts[i]->szModuleName;
cli.clcProto[cnt].dwStatus = CallProtoServiceInt(NULL,accounts[i]->szModuleName, PS_GETSTATUS, 0, 0);
@@ -151,7 +151,7 @@ static int ClcProtoAck(WPARAM, LPARAM lParam) if (ack->type == ACKTYPE_STATUS) {
WindowList_BroadcastAsync(hClcWindowList, INTM_INVALIDATE, 0, 0);
if (ack->result == ACKRESULT_SUCCESS) {
- for (i = 0; i < cli.hClcProtoCount; i++) {
+ for (i=0; i < cli.hClcProtoCount; i++) {
if ( !lstrcmpA(cli.clcProto[i].szProto, ack->szModule)) {
cli.clcProto[i].dwStatus = (WORD) ack->lParam;
break;
@@ -268,7 +268,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, }
{
int i;
- for (i = 0; i <= FONTID_MAX; i++)
+ for (i=0; i <= FONTID_MAX; i++)
dat->fontInfo[i].changed = 1;
}
dat->selection = -1;
@@ -401,7 +401,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, if (cli.pfnFindItem(hwnd, dat, (HANDLE) (groupId | HCONTACT_ISGROUP), &contact, &group, NULL)) {
lstrcpy(szFullName, contact->szText);
while (group->parent) {
- for (i = 0; i < group->parent->cl.count; i++)
+ for (i=0; i < group->parent->cl.count; i++)
if (group->parent->cl.items[i]->group == group)
break;
if (i == group->parent->cl.count) {
@@ -1320,7 +1320,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, cli.pfnHideInfoTip(hwnd, dat);
{
int i;
- for (i = 0; i <= FONTID_MAX; i++)
+ for (i=0; i <= FONTID_MAX; i++)
if ( !dat->fontInfo[i].changed)
DeleteObject(dat->fontInfo[i].hFont);
}
diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp index 5c64082215..10d101e705 100644 --- a/src/modules/clist/clcfiledrop.cpp +++ b/src/modules/clist/clcfiledrop.cpp @@ -229,7 +229,7 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt fileCount = DragQueryFile(hDrop, -1, NULL, 0);
ppFiles = NULL;
- for (i = 0; i < fileCount; i++) {
+ for (i=0; i < fileCount; i++) {
DragQueryFile(hDrop, i, szFilename, SIZEOF(szFilename));
AddToFileList(&ppFiles, &totalCount, szFilename);
}
@@ -237,7 +237,7 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt if ( !CallService(MS_FILE_SENDSPECIFICFILEST, (WPARAM) hContact, (LPARAM) ppFiles))
*pdwEffect = DROPEFFECT_COPY;
- for (i = 0; ppFiles[i]; i++)
+ for (i=0; ppFiles[i]; i++)
mir_free(ppFiles[i]);
mir_free(ppFiles);
}
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index 74e951c276..37aa09bb46 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -59,7 +59,7 @@ struct ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, pNextField = pBackslash + 1;
}
compareResult = 1;
- for (i = 0; i < group->cl.count; i++) {
+ for (i=0; i < group->cl.count; i++) {
if (group->cl.items[i]->type == CLCIT_CONTACT)
break;
if (group->cl.items[i]->type != CLCIT_GROUP)
@@ -130,7 +130,7 @@ void fnFreeContact(struct ClcContact* p) void fnFreeGroup(struct ClcGroup *group)
{
int i;
- for (i = 0; i < group->cl.count; i++) {
+ for (i=0; i < group->cl.count; i++) {
cli.pfnFreeContact(group->cl.items[i]);
mir_free(group->cl.items[i]);
}
@@ -143,7 +143,7 @@ void fnFreeGroup(struct ClcGroup *group) static int iInfoItemUniqueHandle = 0;
int fnAddInfoItemToGroup(struct ClcGroup *group, int flags, const TCHAR *pszText)
{
- int i = 0;
+ int i=0;
if (flags & CLCIIF_BELOWCONTACTS)
i = group->cl.count;
@@ -309,7 +309,7 @@ struct ClcGroup* fnRemoveItemFromGroup(HWND hwnd, struct ClcGroup *group, struct int i;
if (group->parent == NULL)
return group;
- for (i = 0; i < group->parent->cl.count; i++)
+ for (i=0; i < group->parent->cl.count; i++)
if (group->parent->cl.items[i]->type == CLCIT_GROUP && group->parent->cl.items[i]->groupId == group->groupId)
break;
if (i == group->parent->cl.count)
@@ -337,7 +337,7 @@ void fnDeleteItemFromTree(HWND hwnd, HANDLE hItem) //decrease member counts of all parent groups too
group = &dat->list;
nameOffset = 0;
- for (i = 0;; i++) {
+ for (i=0;; i++) {
if (group->scanIndex == group->cl.count)
break;
if (group->cl.items[i]->type == CLCIT_GROUP) {
@@ -502,7 +502,7 @@ static void SortGroup(struct ClcData *dat, struct ClcGroup *group, int useInsert List_Remove((SortedList*)&group->cl, i);
} }
- for (i = 0; i < group->cl.count; i++)
+ for (i=0; i < group->cl.count; i++)
if (group->cl.items[i]->type != CLCIT_INFO)
break;
if (i > group->cl.count - 2)
@@ -530,7 +530,7 @@ static void SortGroup(struct ClcData *dat, struct ClcGroup *group, int useInsert qsort(group->cl.items + i, sortCount, sizeof(void*), ContactSortProc);
if (dat->exStyle & CLS_EX_DIVIDERONOFF) {
int prevContactOnline = 0;
- for (i = 0; i < group->cl.count; i++) {
+ for (i=0; i < group->cl.count; i++) {
if (group->cl.items[i]->type != CLCIT_CONTACT)
continue;
if (group->cl.items[i]->flags & CONTACTF_ONLINE)
@@ -685,7 +685,7 @@ void fnSaveStateAndRebuildList(HWND hwnd, struct ClcData *dat) group->scanIndex++;
}
- for (i = 0; i < saveInfo.getCount(); i++) {
+ for (i=0; i < saveInfo.getCount(); i++) {
if (saveInfo[i].parentId == -1)
group = &dat->list;
else {
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index e49e9621b3..8617d82f9a 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -156,7 +156,7 @@ int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcCo return hit;
}
- for (i = 0; i < dat->extraColumnsCount; i++) {
+ for (i=0; i < dat->extraColumnsCount; i++) {
if (hitcontact->iExtraImage[i] == 0xFF)
continue;
if (testx >= clRect.right - dat->extraColumnSpacing * (dat->extraColumnsCount - i) &&
@@ -723,7 +723,7 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat) SIZE fontSize;
HDC hdc = GetDC(hwnd);
- for (i = 0; i <= FONTID_MAX; i++)
+ for (i=0; i <= FONTID_MAX; i++)
{
if ( !dat->fontInfo[i].changed)
DeleteObject(dat->fontInfo[i].hFont);
@@ -824,7 +824,7 @@ void fnSetGroupChildCheckboxes(struct ClcGroup *group, int checked) {
int i;
- for (i = 0; i < group->cl.count; i++) {
+ for (i=0; i < group->cl.count; i++) {
if (group->cl.items[i]->type == CLCIT_GROUP) {
cli.pfnSetGroupChildCheckboxes(group->cl.items[i]->group, checked);
if (checked)
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp index 8177e233d4..96d5a95a9e 100644 --- a/src/modules/clist/clistevents.cpp +++ b/src/modules/clist/clistevents.cpp @@ -49,7 +49,7 @@ int fnGetImlIconIndex(HICON hIcon) {
int i;
- for (i = 0; i < imlIconCount; i++) {
+ for (i=0; i < imlIconCount; i++) {
if (imlIcon[i].hIcon == hIcon)
return imlIcon[i].index;
}
@@ -89,7 +89,7 @@ static void ShowEventsInTray() int i;
char ** pTrayProtos;
char nTrayProtoCnt;
- int nTrayCnt=cli.trayIconCount;
+ int nTrayCnt = cli.trayIconCount;
if ( !cli.events.count || !nTrayCnt) return;
if (cli.events.count == 1 || nTrayCnt == 1)
{
@@ -101,24 +101,24 @@ static void ShowEventsInTray() // lets use several icon to show events from protocols in different icons
cli.pfnLockTray();
pTrayProtos = (char**)_alloca(sizeof(char*)*cli.trayIconCount);
- nTrayProtoCnt=0;
+ nTrayProtoCnt = 0;
for (i=0; i<cli.trayIconCount; i++)
{
if (cli.trayIcon[i].id == 0 || !cli.trayIcon[i].szProto) continue;
- pTrayProtos[nTrayProtoCnt++]=cli.trayIcon[i].szProto;
+ pTrayProtos[nTrayProtoCnt++] = cli.trayIcon[i].szProto;
}
for (i=0; i<cli.events.count; i++)
{
- char * iEventProto=GetEventProtocol(i);
+ char * iEventProto = GetEventProtocol(i);
{
int j;
- for (j=0; j<nTrayProtoCnt; j++)
+ for (j = 0; j<nTrayProtoCnt; j++)
if (iEventProto && pTrayProtos[j] && !lstrcmpA(pTrayProtos[j], iEventProto))
break;
- if (j>=nTrayProtoCnt) j=0; //event was not found so assume first icon
+ if (j>=nTrayProtoCnt) j = 0; //event was not found so assume first icon
if (pTrayProtos[j]) //if not already set
ShowOneEventInTray(i); //show it
- pTrayProtos[j]=NULL; //and clear slot
+ pTrayProtos[j] = NULL; //and clear slot
}
}
cli.pfnUnlockTray();
@@ -128,7 +128,7 @@ static VOID CALLBACK IconFlashTimer(HWND, UINT, UINT_PTR idEvent, DWORD) {
int i, j;
ShowEventsInTray();
- for (i = 0; i < cli.events.count; i++) {
+ for (i=0; i < cli.events.count; i++) {
for (j = 0; j < i; j++)
if (cli.events.items[j]->cle.hContact == cli.events.items[i]->cle.hContact)
break;
@@ -157,7 +157,7 @@ struct CListEvent* fnAddEvent(CLISTEVENT *cle) return NULL;
if (cle->flags & CLEF_URGENT) {
- for (i = 0; i < cli.events.count; i++)
+ for (i=0; i < cli.events.count; i++)
if ( !(cli.events.items[i]->cle.flags & CLEF_URGENT))
break;
}
@@ -182,7 +182,7 @@ struct CListEvent* fnAddEvent(CLISTEVENT *cle) if (cle->flags&CLEF_PROTOCOLGLOBAL)
szProto = cle->lpszProtocol;
else
- szProto=NULL;
+ szProto = NULL;
}
else
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cle->hContact, 0);
@@ -201,10 +201,10 @@ int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent) {
int i;
char *szProto;
- int nSameProto=0;
+ int nSameProto = 0;
// Find the event that should be removed
- for (i = 0; i < cli.events.count; i++)
+ for (i=0; i < cli.events.count; i++)
if ((cli.events.items[i]->cle.hContact == hContact) && (cli.events.items[i]->cle.hDbEvent == dbEvent))
break;
@@ -224,12 +224,12 @@ int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent) {
//count same protocoled events
char * szEventProto;
- for (i = 0; i < cli.events.count; i++)
+ for (i=0; i < cli.events.count; i++)
{
if (cli.events.items[i]->cle.hContact)
- szEventProto=(char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)(cli.events.items[i]->cle.hContact), 0);
+ szEventProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)(cli.events.items[i]->cle.hContact), 0);
else if (cli.events.items[i]->cle.flags&CLEF_PROTOCOLGLOBAL)
- szEventProto=(char *) cli.events.items[i]->cle.lpszProtocol;
+ szEventProto = (char *) cli.events.items[i]->cle.lpszProtocol;
else
szEventProto = NULL;
if (szEventProto && szProto && !lstrcmpA(szEventProto, szProto))
@@ -262,7 +262,7 @@ CLISTEVENT* fnGetEvent(HANDLE hContact, int idx) return &cli.events.items[idx]->cle;
}
- for (int i = 0; i < cli.events.count; i++)
+ for (int i=0; i < cli.events.count; i++)
if (cli.events.items[i]->cle.hContact == hContact)
if (idx-- == 0)
return &cli.events.items[i]->cle;
@@ -271,7 +271,7 @@ CLISTEVENT* fnGetEvent(HANDLE hContact, int idx) int fnEventsProcessContactDoubleClick(HANDLE hContact)
{
- for (int i = 0; i < cli.events.count; i++) {
+ for (int i=0; i < cli.events.count; i++) {
if (cli.events.items[i]->cle.hContact == hContact) {
HANDLE hDbEvent = cli.events.items[i]->cle.hDbEvent;
CallService(cli.events.items[i]->cle.pszService, (WPARAM) (HWND) NULL, (LPARAM) & cli.events.items[i]->cle);
@@ -284,30 +284,30 @@ int fnEventsProcessContactDoubleClick(HANDLE hContact) int fnEventsProcessTrayDoubleClick(int index)
{
- BOOL click_in_first_icon=FALSE;
+ BOOL click_in_first_icon = FALSE;
if (cli.events.count) {
HANDLE hContact, hDbEvent;
- int eventIndex=0;
+ int eventIndex = 0;
cli.pfnLockTray();
if (cli.trayIconCount>1 && index>0) {
int i;
- char * szProto=NULL;
+ char * szProto = NULL;
for (i=0; i<cli.trayIconCount; i++)
if (cli.trayIcon[i].id == index) {
- szProto=cli.trayIcon[i].szProto;
- if (i == 0) click_in_first_icon=TRUE;
+ szProto = cli.trayIcon[i].szProto;
+ if (i == 0) click_in_first_icon = TRUE;
break;
}
if (szProto) {
for (i=0; i<cli.events.count; i++) {
- char * eventProto=NULL;
+ char * eventProto = NULL;
if (cli.events.items[i]->cle.hContact)
- eventProto=(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cli.events.items[i]->cle.hContact, 0);
+ eventProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cli.events.items[i]->cle.hContact, 0);
if ( !eventProto)
- eventProto=cli.events.items[i]->cle.lpszProtocol;
+ eventProto = cli.events.items[i]->cle.lpszProtocol;
if ( !eventProto || !_strcmpi(eventProto, szProto)) {
- eventIndex=i;
+ eventIndex = i;
break;
} }
@@ -316,18 +316,18 @@ int fnEventsProcessTrayDoubleClick(int index) int j;
if (click_in_first_icon)
for (i=0; i<cli.events.count; i++) {
- char * eventProto=NULL;
+ char * eventProto = NULL;
if (cli.events.items[i]->cle.hContact)
- eventProto=(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cli.events.items[i]->cle.hContact, 0);
+ eventProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cli.events.items[i]->cle.hContact, 0);
if ( !eventProto)
- eventProto=cli.events.items[i]->cle.lpszProtocol;
+ eventProto = cli.events.items[i]->cle.lpszProtocol;
if (eventProto) {
- for (j=0; j<cli.trayIconCount; j++)
+ for (j = 0; j<cli.trayIconCount; j++)
if (cli.trayIcon[j].szProto && !_strcmpi(eventProto, cli.trayIcon[j].szProto))
break;
if (j == cli.trayIconCount) {
- eventIndex=i;
+ eventIndex = i;
break;
} } }
if (i == cli.events.count) { //not found
@@ -428,7 +428,7 @@ void UninitCListEvents(void) if (cli.events.count) KillTimer(NULL, flashTimerId);
- for (i = 0; i < cli.events.count; i++)
+ for (i=0; i < cli.events.count; i++)
cli.pfnFreeEvent((struct CListEvent*)cli.events.items[i]);
List_Destroy((SortedList*)&cli.events);
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 677678d847..8abc2bd2da 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -321,7 +321,7 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam) else
mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", mi->ptszName);
}
- else buf[0]='\0';
+ else buf[0] = '\0';
if (buf[0]) MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
return (INT_PTR)menuHandle;
}
@@ -331,7 +331,7 @@ static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM) HANDLE hContact = (HANDLE)wParam;
NotifyEventHooks(hPreBuildContactMenuEvent, (WPARAM)hContact, 0);
- char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
BuildContactParam bcp;
bcp.szProto = szProto;
@@ -354,8 +354,8 @@ static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM) INT_PTR ContactMenuExecService(WPARAM wParam, LPARAM lParam)
{
if (wParam != 0) {
- lpContactMenuExecParam cmep=(lpContactMenuExecParam)wParam;
- //call with wParam=(WPARAM)(HANDLE)hContact, lparam=popupposition
+ lpContactMenuExecParam cmep = (lpContactMenuExecParam)wParam;
+ //call with wParam = (WPARAM)(HANDLE)hContact, lparam = popupposition
CallService(cmep->szServiceName, lParam, cmep->param);
}
return 0;
@@ -474,7 +474,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) MenuItemData it = {0};
if (FindMenuHandleByGlobalID(hStatusMenu, timiParent, &it)) {
- MENUITEMINFO mi ={0};
+ MENUITEMINFO mi = {0};
TCHAR d[100];
GetMenuString(it.OwnerMenu, it.position, d, SIZEOF(d), MF_BYPOSITION);
@@ -517,14 +517,14 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) timi->mi.flags &= ~CMIF_CHECKED;
}
else if (( !smep || smep->proto) && timi->mi.pszName) {
- int curProtoStatus=0;
- BOOL IconNeedDestroy=FALSE;
+ int curProtoStatus = 0;
+ BOOL IconNeedDestroy = FALSE;
char* prot;
if (smep)
prot = smep->proto;
else
{
- char *prn=mir_u2a(timi->mi.ptszName);
+ char *prn = mir_u2a(timi->mi.ptszName);
prot = NEWSTR_ALLOCA(prn);
if (prn) mir_free(prn);
}
@@ -537,7 +537,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) if (curProtoStatus >= ID_STATUS_OFFLINE && curProtoStatus < ID_STATUS_IDLE)
timi->mi.hIcon = LoadSkinProtoIcon(prot, curProtoStatus);
else {
- timi->mi.hIcon=(HICON)CallProtoServiceInt(NULL,prot, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ timi->mi.hIcon = (HICON)CallProtoServiceInt(NULL,prot, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (timi->mi.hIcon == (HICON)CALLSERVICE_NOTFOUND)
timi->mi.hIcon = NULL;
else
@@ -551,7 +551,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) DestroyIcon(timi->mi.hIcon);
timi->mi.hIcon = NULL;
}
- else IconLib_ReleaseIcon(timi->mi.hIcon, 0);
+ else IcoLib_ReleaseIcon(timi->mi.hIcon, 0);
} }
return TRUE;
@@ -569,9 +569,9 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) if (smep->status == 0 && smep->protoindex != 0 && smep->proto != NULL) {
PMO_IntMenuItem pimi;
char *prot = smep->proto;
- char szHumanName[64]={0};
+ char szHumanName[64] = {0};
PROTOACCOUNT * acc = Proto_GetAccount(smep->proto);
- int i=(DBGetContactSettingByte(NULL, prot, "LockMainStatus", 0)?0:1);
+ int i = (DBGetContactSettingByte(NULL, prot, "LockMainStatus", 0)?0:1);
DBWriteContactSettingByte(NULL, prot, "LockMainStatus", (BYTE)i);
CallProtoServiceInt(NULL,smep->proto, PS_GETNAME, (WPARAM)SIZEOF(szHumanName), (LPARAM)szHumanName);
@@ -684,7 +684,7 @@ BOOL FindMenuHanleByGlobalID(HMENU hMenu, PMO_IntMenuItem id, MenuItemData* itda int i;
PMO_IntMenuItem pimi;
MENUITEMINFO mii = {0};
- BOOL inSub=FALSE;
+ BOOL inSub = FALSE;
if ( !itdat)
return FALSE;
@@ -843,7 +843,7 @@ void RebuildMenuOrder(void) tmp.CheckService = "StatusMenuCheckService";
tmp.name = "StatusMenu";
- hStatusMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
+ hStatusMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
MO_SetOptionsMenuObject(hStatusMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, (INT_PTR)"CLISTMENUS/FreeOwnerDataStatusMenu");
hStatusMainMenuHandles = (PMO_IntMenuItem*)mir_calloc(SIZEOF(statusModeList) * sizeof(PMO_IntMenuItem*));
@@ -854,7 +854,7 @@ void RebuildMenuOrder(void) FreeMenuProtos();
- for (s=0; s < accounts.getCount(); s++) {
+ for (s = 0; s < accounts.getCount(); s++) {
i = cli.pfnGetAccountIndexByPos(s);
if (i == -1)
continue;
@@ -917,7 +917,7 @@ void RebuildMenuOrder(void) ((lpStatusMenuExecParam)tmi.ownerdata)->protoindex = (int)menuHandle;
MO_ModifyMenuItem(menuHandle, &tmi);
- cli.menuProtos=(MenuProto*)mir_realloc(cli.menuProtos, sizeof(MenuProto)*(cli.menuProtoCount+1));
+ cli.menuProtos = (MenuProto*)mir_realloc(cli.menuProtos, sizeof(MenuProto)*(cli.menuProtoCount+1));
memset(&(cli.menuProtos[cli.menuProtoCount]), 0, sizeof(MenuProto));
cli.menuProtos[cli.menuProtoCount].pMenu = rootmenu;
cli.menuProtos[cli.menuProtoCount].szProto = mir_strdup(pa->szModuleName);
@@ -931,7 +931,7 @@ void RebuildMenuOrder(void) DestroyIcon(ic);
pos += 500000;
- for (j=0; j < SIZEOF(statusModeList); j++) {
+ for (j = 0; j < SIZEOF(statusModeList); j++) {
if ( !(flags & statusModePf2List[j]))
continue;
@@ -963,14 +963,14 @@ void RebuildMenuOrder(void) mir_snprintf(buf, SIZEOF(buf), "ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMenuHandles[i].menuhandle[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
}
- IconLib_ReleaseIcon(tmi.hIcon, 0);
+ IcoLib_ReleaseIcon(tmi.hIcon, 0);
} }
NotifyEventHooks(cli.hPreBuildStatusMenuEvent, 0, 0);
int pos = 200000;
//add to root menu
- for (j=0; j < SIZEOF(statusModeList); j++) {
+ for (j = 0; j < SIZEOF(statusModeList); j++) {
for (i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[i];
if ( !bHideStatusMenu && !cli.pfnGetProtocolVisibility(pa->szModuleName))
@@ -1012,7 +1012,7 @@ void RebuildMenuOrder(void) mir_snprintf(buf, sizeof(buf), "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMainMenuHandles[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
}
- IconLib_ReleaseIcon(tmi.hIcon, 0);
+ IcoLib_ReleaseIcon(tmi.hIcon, 0);
break;
} }
@@ -1027,7 +1027,7 @@ static int sttRebuildHotkeys(WPARAM, LPARAM) tmi.cbSize = sizeof(tmi);
tmi.flags = CMIM_HOTKEY | CMIM_NAME | CMIF_TCHAR;
- for (int j=0; j < SIZEOF(statusModeList); j++) {
+ for (int j = 0; j < SIZEOF(statusModeList); j++) {
TCHAR buf[ 256 ], hotkeyName[ 100 ];
WORD hotKey = GetHotkeyValue(statusHotkeys[j]);
HotkeyToName(hotkeyName, SIZEOF(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
@@ -1055,7 +1055,7 @@ int statustopos(int status) static int MenuProtoAck(WPARAM, LPARAM lParam)
{
- ACKDATA* ack=(ACKDATA*)lParam;
+ ACKDATA* ack = (ACKDATA*)lParam;
if (ack->type != ACKTYPE_STATUS) return 0;
if (ack->result != ACKRESULT_SUCCESS) return 0;
if (hStatusMainMenuHandles == NULL) return 0;
@@ -1068,7 +1068,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) if (overallStatus >= ID_STATUS_OFFLINE) {
int pos = statustopos(cli.currentStatusMenuItem);
if (pos == -1)
- pos=0;
+ pos = 0;
// reset all current possible checked statuses
for (int pos2 = 0; pos2<hStatusMainMenuHandlesCnt; pos2++) {
@@ -1077,7 +1077,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) MO_ModifyMenuItem(hStatusMainMenuHandles[pos2], &tmi);
} }
- cli.currentStatusMenuItem=overallStatus;
+ cli.currentStatusMenuItem = overallStatus;
pos = statustopos(cli.currentStatusMenuItem);
if (pos>=0 && pos < hStatusMainMenuHandlesCnt) {
tmi.flags = CMIM_FLAGS | CMIF_ROOTHANDLE | CMIF_CHECKED;
@@ -1087,13 +1087,13 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) }
else {
int pos = statustopos(cli.currentStatusMenuItem);
- if (pos == -1) pos=0;
+ if (pos == -1) pos = 0;
if (pos >= 0 && pos < hStatusMainMenuHandlesCnt) {
tmi.flags = CMIM_FLAGS | CMIF_ROOTHANDLE;
MO_ModifyMenuItem(hStatusMainMenuHandles[pos], &tmi);
}
- cli.currentStatusMenuItem=0;
+ cli.currentStatusMenuItem = 0;
}
for (int i=0; i < accounts.getCount(); i++) {
@@ -1208,7 +1208,7 @@ static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam) } }
if (wParam) {
- int * res=(int*)wParam;
+ int * res = (int*)wParam;
*res = (int)pRoot;
}
@@ -1217,13 +1217,13 @@ static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam) if (mi->pszService) {
smep = (lpStatusMenuExecParam)mir_calloc(sizeof(StatusMenuExecParam));
smep->custom = TRUE;
- smep->svc=mir_strdup(mi->pszService);
+ smep->svc = mir_strdup(mi->pszService);
{
- char *buf=mir_strdup(mi->pszService);
+ char *buf = mir_strdup(mi->pszService);
int i=0;
while (buf[i] != '\0' && buf[i] != '/') i++;
- buf[i]='\0';
- smep->proto=mir_strdup(buf);
+ buf[i] = '\0';
+ smep->proto = mir_strdup(buf);
mir_free(buf);
}
tmi.ownerdata = smep;
@@ -1299,21 +1299,21 @@ void InitCustomMenus(void) CreateServiceFunction("CList/AddProtoMenuItem", AddProtoMenuItem);
- hPreBuildContactMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDCONTACTMENU);
- hPreBuildMainMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDMAINMENU);
- cli.hPreBuildStatusMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDSTATUSMENU);
+ hPreBuildContactMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDCONTACTMENU);
+ hPreBuildMainMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDMAINMENU);
+ cli.hPreBuildStatusMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDSTATUSMENU);
hStatusModeChangeEvent = CreateHookableEvent(ME_CLIST_STATUSMODECHANGE);
- hAckHook=(HANDLE)HookEvent(ME_PROTO_ACK, MenuProtoAck);
+ hAckHook = (HANDLE)HookEvent(ME_PROTO_ACK, MenuProtoAck);
hMainMenu = CreatePopupMenu();
hStatusMenu = CreatePopupMenu();
- hStatusMainMenuHandles=NULL;
- hStatusMainMenuHandlesCnt=0;
+ hStatusMainMenuHandles = NULL;
+ hStatusMainMenuHandlesCnt = 0;
- hStatusMenuHandles=NULL;
- hStatusMenuHandlesCnt=0;
+ hStatusMenuHandles = NULL;
+ hStatusMenuHandlesCnt = 0;
//new menu sys
InitGenMenu();
@@ -1321,11 +1321,11 @@ void InitCustomMenus(void) //main menu
{
TMenuParam tmp = { 0 };
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService=NULL;
- tmp.ExecService="MainMenuExecService";
- tmp.name="MainMenu";
- hMainMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
+ tmp.cbSize = sizeof(tmp);
+ tmp.CheckService = NULL;
+ tmp.ExecService = "MainMenuExecService";
+ tmp.name = "MainMenu";
+ hMainMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
}
MO_SetOptionsMenuObject(hMainMenuObject, OPT_USERDEFINEDITEMS, TRUE);
@@ -1334,11 +1334,11 @@ void InitCustomMenus(void) //contact menu
{
TMenuParam tmp = { 0 };
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService="ContactMenuCheckService";
- tmp.ExecService="ContactMenuExecService";
- tmp.name="ContactMenu";
- hContactMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
+ tmp.cbSize = sizeof(tmp);
+ tmp.CheckService = "ContactMenuCheckService";
+ tmp.ExecService = "ContactMenuExecService";
+ tmp.name = "ContactMenu";
+ hContactMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
}
MO_SetOptionsMenuObject(hContactMenuObject, OPT_USERDEFINEDITEMS, TRUE);
@@ -1351,7 +1351,7 @@ void InitCustomMenus(void) hkd.cbSize = sizeof(hkd);
hkd.ptszSection = _T("Status");
hkd.dwFlags = HKD_TCHAR;
- for (int i = 0; i < SIZEOF(statusHotkeys); i++) {
+ for (int i=0; i < SIZEOF(statusHotkeys); i++) {
char szName[30];
mir_snprintf(szName, SIZEOF(szName), "StatusHotKey_%d", i);
hkd.pszName = szName;
@@ -1376,8 +1376,8 @@ void InitCustomMenus(void) AddMainMenuItem(0, (LPARAM)&mi);
}
- cli.currentStatusMenuItem=ID_STATUS_OFFLINE;
- cli.currentDesiredStatusMode=ID_STATUS_OFFLINE;
+ cli.currentStatusMenuItem = ID_STATUS_OFFLINE;
+ cli.currentDesiredStatusMode = ID_STATUS_OFFLINE;
if (IsWinVer98Plus())
HookEvent(ME_SKIN_ICONSCHANGED, MenuIconsChanged);
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 39047d9331..7c8d7527d7 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -177,7 +177,7 @@ int fnIconFromStatusMode(const char *szProto, int status, HANDLE) index = 0;
if (szProto == NULL)
return index + 1;
- for (i = 0; i < protoIconIndex.getCount(); i++) {
+ for (i=0; i < protoIconIndex.getCount(); i++) {
if (strcmp(szProto, protoIconIndex[i].szProto) == 0)
return protoIconIndex[i].iIconBase + index;
}
@@ -197,7 +197,7 @@ static void AddProtoIconIndex(PROTOACCOUNT* pa) {
ProtoIconIndex *pii = new ProtoIconIndex;
pii->szProto = pa->szModuleName;
- for (int i = 0; i < SIZEOF(statusModeList); i++) {
+ for (int i=0; i < SIZEOF(statusModeList); i++) {
int iImg = ImageList_AddIcon_ProtoIconLibLoaded(hCListImages, pa->szModuleName, statusModeList[i]);
if (i == 0)
pii->iIconBase = iImg;
@@ -207,7 +207,7 @@ static void AddProtoIconIndex(PROTOACCOUNT* pa) static void RemoveProtoIconIndex(PROTOACCOUNT* pa)
{
- for (int i = 0; i < protoIconIndex.getCount(); i++)
+ for (int i=0; i < protoIconIndex.getCount(); i++)
if (strcmp(protoIconIndex[i].szProto, pa->szModuleName) == 0) {
protoIconIndex.remove(i);
break;
@@ -222,7 +222,7 @@ static int ContactListModulesLoaded(WPARAM, LPARAM) }
RebuildMenuOrder();
- for (int i = 0; i < accounts.getCount(); i++)
+ for (int i=0; i < accounts.getCount(); i++)
AddProtoIconIndex(accounts[i]);
cli.pfnLoadContactTree();
@@ -282,11 +282,11 @@ static int CListIconsChanged(WPARAM, LPARAM) {
int i, j;
- for (i = 0; i < SIZEOF(statusModeList); i++)
+ for (i=0; i < SIZEOF(statusModeList); i++)
ImageList_ReplaceIcon_IconLibLoaded(hCListImages, i + 1, LoadSkinIcon(skinIconStatusList[i]));
ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPOPEN, LoadSkinIcon(SKINICON_OTHER_GROUPOPEN));
ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPSHUT, LoadSkinIcon(SKINICON_OTHER_GROUPSHUT));
- for (i = 0; i < protoIconIndex.getCount(); i++)
+ for (i=0; i < protoIconIndex.getCount(); i++)
for (j = 0; j < SIZEOF(statusModeList); j++)
ImageList_ReplaceIcon_IconLibLoaded(hCListImages, protoIconIndex[i].iIconBase + j, LoadSkinProtoIcon(protoIconIndex[i].szProto, statusModeList[j]));
cli.pfnTrayIconIconsChanged();
@@ -533,7 +533,7 @@ int LoadContactListModule2(void) ImageList_AddIcon_NotShared(hCListImages, MAKEINTRESOURCE(IDI_BLANK));
//now all core skin icons are loaded via icon lib. so lets release them
- for (int i = 0; i < SIZEOF(statusModeList); i++)
+ for (int i=0; i < SIZEOF(statusModeList); i++)
ImageList_AddIcon_IconLibLoaded(hCListImages, skinIconStatusList[i]);
//see IMAGE_GROUP... in clist.h if you add more images above here
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp index 710bd6aaf0..2e6f065628 100644 --- a/src/modules/clist/clistsettings.cpp +++ b/src/modules/clist/clistsettings.cpp @@ -40,7 +40,7 @@ void FreeDisplayNameCache(void) {
if (clistCache != NULL) {
int i;
- for (i = 0; i < clistCache->realCount; i++) {
+ for (i=0; i < clistCache->realCount; i++) {
cli.pfnFreeCacheItem((ClcCacheEntryBase*)clistCache->items[i]);
mir_free(clistCache->items[i]);
}
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index e8a3a12d3b..91af2f6b21 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -35,7 +35,7 @@ static UINT WM_TASKBARBUTTONCREATED; static BOOL mToolTipTrayTips = FALSE;
static UINT_PTR cycleTimerId = 0;
static int cycleStep = 0;
-static UINT_PTR RefreshTimerId=0; /////by FYR
+static UINT_PTR RefreshTimerId = 0; /////by FYR
static CRITICAL_SECTION trayLockCS;
// don't move to win2k.h, need new and old versions to work on 9x/2000/XP
@@ -47,7 +47,7 @@ static CRITICAL_SECTION trayLockCS; #define initcheck if ( !fTrayInited) return
-static BOOL fTrayInited=FALSE;
+static BOOL fTrayInited = FALSE;
static TCHAR* sttGetXStatus(const char* szProto)
{
@@ -61,7 +61,7 @@ static TCHAR* sttGetXStatus(const char* szProto) char* dbTitle2 = NULL;
int xstatus = CallProtoServiceInt(NULL,szProto, "/GetXStatus", (WPARAM)&dbTitle, (LPARAM)&dbTitle2);
if (dbTitle && xstatus) {
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if ( !DBGetContactSettingTString(NULL, szProto, dbTitle, &dbv)) {
if (dbv.ptszVal[0] != 0)
result = mir_tstrdup(dbv.ptszVal);
@@ -86,7 +86,7 @@ static void SetTaskBarIcon(const HICON hIcon, const TCHAR *szNewTip) TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto)
{
TCHAR *szStatus, *szSeparator;
- TCHAR *ProtoXStatus=NULL;
+ TCHAR *ProtoXStatus = NULL;
int t;
PROTOACCOUNT* pa;
initcheck NULL;
@@ -191,7 +191,7 @@ int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int s int i;
initcheck 0;
lock;
- for (i = 0; i < cli.trayIconCount; i++)
+ for (i=0; i < cli.trayIconCount; i++)
if (cli.trayIcon[i].id == 0)
break;
@@ -228,7 +228,7 @@ void fnTrayIconRemove(HWND hwnd, const char *szProto) int i;
initcheck;
lock;
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
struct trayIconInfo_t* pii = &cli.trayIcon[i];
if (pii->id != 0 && !lstrcmpA(szProto, pii->szProto)) {
NOTIFYICONDATA nid = { 0 };
@@ -288,7 +288,7 @@ int fnTrayIconInit(HWND hwnd) (averageMode < 0 || DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
{
cli.trayIconCount = netProtoCount;
- for (int i = 0; i < accounts.getCount(); ++i)
+ for (int i=0; i < accounts.getCount(); ++i)
{
int j = cli.pfnGetAccountIndexByPos(i);
if (j >= 0)
@@ -329,7 +329,7 @@ int fnTrayIconDestroy(HWND hwnd) nid.cbSize = (cli.shellVersion >= 5) ? sizeof(nid) : NOTIFYICONDATA_V1_SIZE;
nid.hWnd = hwnd;
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
nid.uID = cli.trayIcon[i].id;
@@ -358,7 +358,7 @@ static VOID CALLBACK RefreshTimerProc(HWND, UINT, UINT_PTR, DWORD) int i;
if (RefreshTimerId) {
KillTimer(NULL, RefreshTimerId);
- RefreshTimerId=0;
+ RefreshTimerId = 0;
}
for (i=0; i < accounts.getCount(); i++) {
cli.pfnTrayIconUpdateBase(accounts[i]->szModuleName);
@@ -379,7 +379,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer if ( !hNewIcon)
{ ulock; return -1; }
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
if (lstrcmpA(cli.trayIcon[i].szProto, szPreferredProto))
@@ -404,7 +404,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer //if there wasn't a suitable icon, change all the icons
{
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
nid.uID = cli.trayIcon[i].id;
@@ -424,11 +424,11 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer cli.trayIcon[i].isBase = isBase;
if (DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
{
- DWORD time1=DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT)*200;
- DWORD time2=DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550)+1000;
- DWORD time=max(max(2000, time1), time2);
- if (RefreshTimerId) {KillTimer(NULL, RefreshTimerId); RefreshTimerId=0;}
- RefreshTimerId=SetTimer(NULL, 0, time, RefreshTimerProc); // if unknown base was changed - than show preffered proto icon for 2 sec and reset it to original one after timeout
+ DWORD time1 = DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT)*200;
+ DWORD time2 = DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550)+1000;
+ DWORD time = max(max(2000, time1), time2);
+ if (RefreshTimerId) {KillTimer(NULL, RefreshTimerId); RefreshTimerId = 0;}
+ RefreshTimerId = SetTimer(NULL, 0, time, RefreshTimerProc); // if unknown base was changed - than show preffered proto icon for 2 sec and reset it to original one after timeout
}
{ ulock; return i; }
}
@@ -443,7 +443,7 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto) lock;
if (szPreferredProto)
{
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
if (lstrcmpA(cli.trayIcon[i].szProto, szPreferredProto))
@@ -461,7 +461,7 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto) }
//if there wasn't a specific icon, there will only be one suitable
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
@@ -521,7 +521,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto) cli.cycleTimerId = 0;
}
- for (i = 0; i < accounts.getCount(); i++) {
+ for (i=0; i < accounts.getCount(); i++) {
if ( !lstrcmpA(szChangedProto, accounts[i]->szModuleName))
cycleStep = i - 1;
}
@@ -560,9 +560,9 @@ void fnTrayIconUpdateBase(const char *szChangedProto) break;
}
case SETTING_TRAYICON_CYCLE:
- cli.cycleTimerId =
+ cli.cycleTimerId =
SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cli.pfnTrayCycleTimerProc);
- changed =
+ changed =
cli.pfnTrayIconSetBaseInfo(ImageList_GetIcon
(hCListImages, cli.pfnIconFromStatusMode(szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0), NULL),
ILD_NORMAL), NULL);
@@ -595,7 +595,7 @@ void fnTrayIconSetToBase(char *szPreferredProto) initcheck;
lock;
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
if (lstrcmpA(cli.trayIcon[i].szProto, szPreferredProto))
@@ -605,7 +605,7 @@ void fnTrayIconSetToBase(char *szPreferredProto) }
//if there wasn't a specific icon, there will only be one suitable
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
cli.pfnTrayIconUpdate(cli.trayIcon[i].hBaseIcon, NULL, szPreferredProto, 1);
@@ -686,9 +686,9 @@ static void CALLBACK TrayToolTipTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD) if (n >= 0 && n < cli.trayIconCount)
szTipCur = cli.trayIcon[n].ptszToolTip;
}
- ti.rcItem.left = pt.x - 10;
- ti.rcItem.right = pt.x + 10;
- ti.rcItem.top = pt.y - 10;
+ ti.rcItem.left = pt.x - 10;
+ ti.rcItem.right = pt.x + 10;
+ ti.rcItem.top = pt.y - 10;
ti.rcItem.bottom = pt.y + 10;
ti.cbSize = sizeof(ti);
ti.isTreeFocused = GetFocus() == cli.hwndContactList ? 1 : 0;
@@ -748,7 +748,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) POINT pt;
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
- for (int i = 0; i < cli.trayIconCount; ++i)
+ for (int i=0; i < cli.trayIconCount; ++i)
{
if ((unsigned)cli.trayIcon[i].id == msg->wParam)
{
@@ -945,12 +945,12 @@ void fnInitTray(void) InitializeCriticalSection(&trayLockCS);
if (cli.shellVersion >= 5)
CreateServiceFunction(MS_CLIST_SYSTRAY_NOTIFY, pfnCListTrayNotifyStub);
- fTrayInited=TRUE;
+ fTrayInited = TRUE;
}
void fnUninitTray(void)
{
- fTrayInited=FALSE;
+ fTrayInited = FALSE;
DeleteCriticalSection(&trayLockCS);
}
void fnLockTray(void)
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index 8524a4cf3a..bdb0fe356c 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -247,10 +247,10 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l {
LRESULT result;
MSG m;
- m.hwnd=hwnd;
- m.message=msg;
- m.wParam=wParam;
- m.lParam=lParam;
+ m.hwnd = hwnd;
+ m.message = msg;
+ m.wParam = wParam;
+ m.lParam = lParam;
if (cli.pfnDocking_ProcessWindowMessage((WPARAM)&m, (LPARAM)&result))
return result;
if (cli.pfnTrayIconProcessMessage((WPARAM)&m, (LPARAM)&result))
@@ -485,7 +485,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MAINMENU);
HBITMAP hBmp = ConvertIconToBitmap(hIcon, NULL, 0);
- IconLib_ReleaseIcon(hIcon, NULL);
+ IcoLib_ReleaseIcon(hIcon, NULL);
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_BITMAP | MIIM_STRING | MIIM_DATA;
@@ -638,7 +638,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (cluiopt.transparent) {
if ( !transparentFocus && GetForegroundWindow() != hwnd && setLayeredWindowAttributes) {
setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)cluiopt.alpha, LWA_ALPHA);
- transparentFocus=1;
+ transparentFocus = 1;
SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
}
}
@@ -1049,13 +1049,13 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HICON hIcon = LoadSkinProtoIcon(szProto, status);
DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
if (Proto_IsAccountLocked(Proto_GetAccount(szProto))) {
hIcon = LoadSkinnedIcon(SKINICON_OTHER_STATUS_LOCKED);
if (hIcon != NULL) {
DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
}
}
@@ -1087,7 +1087,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (dis->itemData == MENU_MIRANDAMENU) {
HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MAINMENU);
fnDrawMenuItem(dis, CopyIcon(hIcon), NULL);
- IconLib_ReleaseIcon(hIcon, NULL);
+ IcoLib_ReleaseIcon(hIcon, NULL);
return TRUE;
}
return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp index 30f1a55322..ea3c153d36 100644 --- a/src/modules/clist/cluiservices.cpp +++ b/src/modules/clist/cluiservices.cpp @@ -170,7 +170,7 @@ void fnCluiProtocolStatusChanged(int, const char*) RECT rc;
GetClientRect(cli.hwndStatus, &rc);
rc.right -= borders[0] * 2 + (DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? GetSystemMetrics(SM_CXVSCROLL) : 0);
- for (i = 0; i < cli.menuProtoCount; i++)
+ for (i=0; i < cli.menuProtoCount; i++)
partWidths[ i ] = (i+1) * rc.right / cli.menuProtoCount - (borders[2] >> 1);
}
else {
@@ -180,7 +180,7 @@ void fnCluiProtocolStatusChanged(int, const char*) hdc = GetDC(NULL);
SelectObject(hdc, (HFONT) SendMessage(cli.hwndStatus, WM_GETFONT, 0, 0));
- for (i = 0; i < cli.menuProtoCount; i++) { //count down since built in ones tend to go at the end
+ for (i=0; i < cli.menuProtoCount; i++) { //count down since built in ones tend to go at the end
int x = 2;
if (showOpts & 1)
x += g_IconWidth;
@@ -215,7 +215,7 @@ void fnCluiProtocolStatusChanged(int, const char*) flags = SBT_OWNERDRAW;
if (DBGetContactSettingByte(NULL, "CLUI", "SBarBevel", 1) == 0)
flags |= SBT_NOBORDERS;
- for (i = 0; i < cli.menuProtoCount; i++) {
+ for (i=0; i < cli.menuProtoCount; i++) {
SendMessage(cli.hwndStatus, SB_SETTEXT, i | flags, (LPARAM)cli.menuProtos[i].szProto);
}
}
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index 5fce5cb1f4..9404446db5 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -31,7 +31,7 @@ int sortByProto; static const struct {
int status, order;
-} statusModeOrder[]={
+} statusModeOrder[] = {
{ID_STATUS_OFFLINE, 500},
{ID_STATUS_ONLINE, 10},
{ID_STATUS_AWAY, 200},
@@ -60,7 +60,7 @@ void fnChangeContactIcon(HANDLE hContact, int iIcon, int add) int GetStatusModeOrdering(int statusMode)
{
int i;
- for (i = 0; i < SIZEOF(statusModeOrder); i++)
+ for (i=0; i < SIZEOF(statusModeOrder); i++)
if (statusModeOrder[i].status == statusMode)
return statusModeOrder[i].order;
return 1000;
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index deb5de8227..33b94d6cf8 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -105,8 +105,8 @@ PMO_IntMenuItem MO_RecursiveWalkMenu(PMO_IntMenuItem parent, pfnWalkFunc func, v }
///////////////////////////////////////////////////////////////////////////////
-//wparam=0
-//lparam=LPMEASUREITEMSTRUCT
+//wparam = 0
+//lparam = LPMEASUREITEMSTRUCT
int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis)
{
// prevent win9x from ugly menus displaying when there is no icon
@@ -132,8 +132,8 @@ int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis) }
///////////////////////////////////////////////////////////////////////////////
-//wparam=0
-//lparam=LPDRAWITEMSTRUCT
+//wparam = 0
+//lparam = LPDRAWITEMSTRUCT
int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis)
{
if ( !bIsGenMenuInited)
@@ -188,7 +188,7 @@ int MO_RemoveAllObjects() return 0;
}
-//wparam=MenuObjectHandle
+//wparam = MenuObjectHandle
INT_PTR MO_RemoveMenuObject(WPARAM wParam, LPARAM)
{
if ( !bIsGenMenuInited)
@@ -204,8 +204,8 @@ INT_PTR MO_RemoveMenuObject(WPARAM wParam, LPARAM) return 0;
}
-//wparam=MenuObjectHandle
-//lparam=vKey
+//wparam = MenuObjectHandle
+//lparam = vKey
INT_PTR MO_ProcessHotKeys(HANDLE menuHandle, INT_PTR vKey)
{
if ( !bIsGenMenuInited)
@@ -253,8 +253,8 @@ INT_PTR MO_GetProtoRootMenu(WPARAM wParam, LPARAM lParam) return NULL;
}
-//wparam=MenuItemHandle
-//lparam=PMO_MenuItem
+//wparam = MenuItemHandle
+//lparam = PMO_MenuItem
INT_PTR MO_GetMenuItem(WPARAM wParam, LPARAM lParam)
{
PMO_MenuItem mi = (PMO_MenuItem)lParam;
@@ -323,7 +323,7 @@ int MO_ModifyMenuItem(PMO_IntMenuItem menuHandle, PMO_MenuItem pmi) if (hIcon != NULL) {
pimi->hIcolibItem = pmi->hIcolibItem;
pimi->iconId = ImageList_ReplaceIcon(pimi->parent->m_hMenuIcons, pimi->iconId, hIcon);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
}
else pimi->iconId = -1, pimi->hIcolibItem = NULL;
}
@@ -492,9 +492,9 @@ int MO_SetOptionsMenuObject(HANDLE handle, int setting, INT_PTR value) return res;
}
-//wparam=0;
-//lparam=PMenuParam;
-//result=MenuObjectHandle
+//wparam = 0;
+//lparam = PMenuParam;
+//result = MenuObjectHandle
INT_PTR MO_CreateNewMenuObject(WPARAM, LPARAM lParam)
{
PMenuParam pmp = (PMenuParam)lParam;
@@ -514,8 +514,8 @@ INT_PTR MO_CreateNewMenuObject(WPARAM, LPARAM lParam) return p->id;
}
-//wparam=MenuItemHandle
-//lparam=0
+//wparam = MenuItemHandle
+//lparam = 0
static int FreeMenuItem(TMO_IntMenuItem* pimi, void*)
{
@@ -593,8 +593,8 @@ static int GetNextObjectMenuItemId() return NextObjectMenuItemId++;
}
-//wparam=MenuObjectHandle
-//lparam=PMO_MenuItem
+//wparam = MenuObjectHandle
+//lparam = PMO_MenuItem
//return MenuItemHandle
PMO_IntMenuItem MO_AddNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi)
{
@@ -632,7 +632,7 @@ PMO_IntMenuItem MO_AddNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi) HICON hIcon = IcoLib_GetIconByHandle(pmi->hIcolibItem, false);
p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, hIcon);
p->hIcolibItem = pmi->hIcolibItem;
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
}
else {
HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
@@ -660,8 +660,8 @@ PMO_IntMenuItem MO_AddNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi) return p;
}
-//wparam=MenuObjectHandle
-//lparam=PMO_MenuItem
+//wparam = MenuObjectHandle
+//lparam = PMO_MenuItem
int FindRoot(PMO_IntMenuItem pimi, void* param)
{
@@ -728,7 +728,7 @@ static int WhereToPlace(HMENU hMenu, PMO_MenuItem mi) MENUITEMINFO mii = { 0 };
mii.cbSize = MENUITEMINFO_V4_SIZE;
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
- for (int i=GetMenuItemCount(hMenu)-1; i >= 0; i--) {
+ for (int i = GetMenuItemCount(hMenu)-1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
if (mii.fType != MFT_SEPARATOR) {
PMO_IntMenuItem pimi = MO_GetIntMenuItem((HGENMENU)mii.dwItemData);
@@ -1007,7 +1007,7 @@ static int MO_ReloadIcon(PMO_IntMenuItem pmi, void*) if (newIcon)
ImageList_ReplaceIcon(pmi->parent->m_hMenuIcons, pmi->iconId, newIcon);
- IconLib_ReleaseIcon(newIcon, 0);
+ IcoLib_ReleaseIcon(newIcon, 0);
}
return FALSE;
@@ -1074,7 +1074,7 @@ static int MO_RegisterIcon(PMO_IntMenuItem pmi, void*) Safe_DestroyIcon(hIcon);
if (hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)iconame)) {
ImageList_ReplaceIcon(pmi->parent->m_hMenuIcons, pmi->iconId, hIcon);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
}
}
@@ -1183,7 +1183,7 @@ int UnitGenMenu() if (bIsGenMenuInited) {
{ mir_cslock lck(csMenuHook);
MO_RemoveAllObjects();
- bIsGenMenuInited=false;
+ bIsGenMenuInited = false;
}
DeleteCriticalSection(&csMenuHook);
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 4ec48d0e20..0e45e8efa0 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -144,9 +144,9 @@ static int BuildMenuObjectsTree(HWND hwndDlg) if (g_menus[i]->id == (int)hStatusMenuObject || !g_menus[i]->m_bUseUserDefinedItems)
continue;
- tvis.item.lParam = (LPARAM)g_menus[i]->id;
+ tvis.item.lParam = (LPARAM)g_menus[i]->id;
tvis.item.pszText = Langpack_PcharToTchar(g_menus[i]->Name);
- tvis.item.iImage = tvis.item.iSelectedImage = TRUE;
+ tvis.item.iImage = tvis.item.iSelectedImage = TRUE;
TreeView_InsertItem(hTree, &tvis);
mir_free(tvis.item.pszText);
}
@@ -156,8 +156,8 @@ static int BuildMenuObjectsTree(HWND hwndDlg) static int sortfunc(const void *a, const void *b)
{
lpMenuItemOptData *sd1, *sd2;
- sd1=(lpMenuItemOptData *)a;
- sd2=(lpMenuItemOptData *)b;
+ sd1 = (lpMenuItemOptData *)a;
+ sd2 = (lpMenuItemOptData *)b;
if ((*sd1)->pos > (*sd2)->pos)
return 1;
@@ -186,10 +186,10 @@ static int InsertSeparator(HWND hwndDlg) PD = (MenuItemOptData*)mir_alloc(sizeof(MenuItemOptData));
ZeroMemory(PD, sizeof(MenuItemOptData));
- PD->id = -1;
+ PD->id = -1;
PD->name = mir_tstrdup(STR_SEPARATOR);
PD->show = TRUE;
- PD->pos = ((MenuItemOptData *)tvi.lParam)->pos-1;
+ PD->pos = ((MenuItemOptData *)tvi.lParam)->pos-1;
tvis.item.lParam = (LPARAM)(PD);
tvis.item.pszText = PD->name;
@@ -320,7 +320,7 @@ static int BuildTree(HWND hwndDlg, int MenuObjectId, BOOL bReread) HTREEITEM hti = (HTREEITEM)SendDlgItemMessage(hwndDlg, IDC_MENUITEMS, TVM_INSERTITEM, 0, (LPARAM)&tvis);
if (first) {
TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), hti);
- first=FALSE;
+ first = FALSE;
}
lastpos = PDar[i]->pos;
@@ -371,51 +371,51 @@ static HTREEITEM MoveItemAbove(HWND hTreeWnd, HTREEITEM hItem, HTREEITEM hInsert return NULL;
if ( !TreeView_DeleteItem(hTreeWnd, hItem))
return NULL;
- tvis.hParent=NULL;
- tvis.hInsertAfter=hInsertAfter;
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = hInsertAfter;
return TreeView_InsertItem(hTreeWnd, &tvis);
}
return NULL;
}
-WNDPROC MyOldWindowProc=NULL;
+WNDPROC MyOldWindowProc = NULL;
LRESULT CALLBACK LBTNDOWNProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_LBUTTONDOWN && !(GetKeyState(VK_CONTROL)&0x8000)) {
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
// ClientToScreen(hwndDlg, &hti.pt);
// ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt);
TreeView_HitTest(hwnd, &hti);
if (hti.flags&TVHT_ONITEMLABEL) {
/// LabelClicked Set/unset selection
TVITEM tvi;
- HWND tvw=hwnd;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hti.hItem;
+ HWND tvw = hwnd;
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hti.hItem;
TreeView_GetItem(tvw, &tvi);
if ( !((MenuItemOptData *)tvi.lParam)->isSelected) { /* is not Selected*/
// reset all selection except current
HTREEITEM hit;
- hit=TreeView_GetRoot(tvw);
+ hit = TreeView_GetRoot(tvw);
if (hit)
do {
- TVITEM tvi={0};
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hit;
+ TVITEM tvi = {0};
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hit;
TreeView_GetItem(tvw, &tvi);
if (hti.hItem != hit)
- ((MenuItemOptData *)tvi.lParam)->isSelected=0;
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 0;
else
- ((MenuItemOptData *)tvi.lParam)->isSelected=1;
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 1;
TreeView_SetItem(tvw, &tvi);
}
- while (hit=TreeView_GetNextSibling(tvw, hit));
+ while (hit = TreeView_GetNextSibling(tvw, hit));
} } }
return CallWindowProc(MyOldWindowProc, hwnd, uMsg, wParam, lParam);
@@ -429,7 +429,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- dat=(struct OrderData*)mir_alloc(sizeof(struct OrderData));
+ dat = (struct OrderData*)mir_alloc(sizeof(struct OrderData));
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_USERDATA, (LONG_PTR)dat);
dat->dragging = 0;
dat->iInitMenuValue = DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE);
@@ -437,7 +437,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_WNDPROC, (LONG_PTR)&LBTNDOWNProc);
{
HIMAGELIST himlCheckBoxes;
- himlCheckBoxes=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
+ himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
(IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 2, 2);
ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK);
@@ -476,12 +476,12 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HTREEITEM hti;
MenuItemOptData *iod;
- hti=TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS));
+ hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS));
if (hti == NULL)
break;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
- tvi.hItem=hti;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
+ tvi.hItem = hti;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi);
iod = (MenuItemOptData *)tvi.lParam;
@@ -557,33 +557,33 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA switch (hdr->code) {
case NM_CUSTOMDRAW:
{
- int i= handleCustomDraw(GetDlgItem(hwndDlg, IDC_MENUITEMS), (LPNMTVCUSTOMDRAW) lParam);
+ int i = handleCustomDraw(GetDlgItem(hwndDlg, IDC_MENUITEMS), (LPNMTVCUSTOMDRAW) lParam);
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, i);
return TRUE;
}
case TVN_BEGINDRAGA:
SetCapture(hwndDlg);
- dat->dragging=1;
- dat->hDragItem=((LPNMTREEVIEW)lParam)->itemNew.hItem;
+ dat->dragging = 1;
+ dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem;
TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), dat->hDragItem);
break;
case NM_CLICK:
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(hdr->hwndFrom, &hti.pt);
if (TreeView_HitTest(hdr->hwndFrom, &hti)) {
if (hti.flags&TVHT_ONITEMICON) {
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
- tvi.hItem=hti.hItem;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
+ tvi.hItem = hti.hItem;
TreeView_GetItem(hdr->hwndFrom, &tvi);
- tvi.iImage=tvi.iSelectedImage=!tvi.iImage;
- ((MenuItemOptData *)tvi.lParam)->show=tvi.iImage;
+ tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
+ ((MenuItemOptData *)tvi.lParam)->show = tvi.iImage;
TreeView_SetItem(hdr->hwndFrom, &tvi);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -594,15 +594,15 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (hti.flags&TVHT_ONITEMLABEL) {
/// LabelClicked Set/unset selection
TVITEM tvi;
- HWND tvw=hdr->hwndFrom;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hti.hItem;
+ HWND tvw = hdr->hwndFrom;
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hti.hItem;
TreeView_GetItem(tvw, &tvi);
if (GetKeyState(VK_CONTROL)&0x8000) {
if (((MenuItemOptData *)tvi.lParam)->isSelected)
- ((MenuItemOptData *)tvi.lParam)->isSelected=0;
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 0;
else
- ((MenuItemOptData *)tvi.lParam)->isSelected=1; //current selection order++.
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 1; //current selection order++.
TreeView_SetItem(tvw, &tvi);
}
else if (GetKeyState(VK_SHIFT)&0x8000) {
@@ -611,21 +611,21 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA else {
// reset all selection except current
HTREEITEM hit;
- hit=TreeView_GetRoot(tvw);
+ hit = TreeView_GetRoot(tvw);
if (hit)
do {
- TVITEM tvi={0};
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hit;
+ TVITEM tvi = {0};
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hit;
TreeView_GetItem(tvw, &tvi);
if (hti.hItem != hit)
- ((MenuItemOptData *)tvi.lParam)->isSelected=0;
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 0;
else
- ((MenuItemOptData *)tvi.lParam)->isSelected=1;
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 1;
TreeView_SetItem(tvw, &tvi);
}
- while (hit=TreeView_GetNextSibling(tvw, hit));
+ while (hit = TreeView_GetNextSibling(tvw, hit));
} } }
break;
}
@@ -633,7 +633,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA {
LPNMTREEVIEW pn;
pn = (LPNMTREEVIEW) lParam;
- //((MenuItemOptData *)(pn->itemNew.lParam))->isSelected=1;
+ //((MenuItemOptData *)(pn->itemNew.lParam))->isSelected = 1;
/*if (pn->action == NotKeyPressed)
{
remove all selection
@@ -653,12 +653,12 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_DEFAULT), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_SET), FALSE);
- hti=TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS));
+ hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS));
if (hti == NULL)
break;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
- tvi.hItem=hti;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
+ tvi.hItem = hti;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi);
if (tvi.lParam == 0)
@@ -688,8 +688,8 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA {
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg, &hti.pt);
ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt);
TreeView_HitTest(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti);
@@ -714,53 +714,53 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_MENUITEMS), NULL, 0);
- dat->dragging=0;
+ dat->dragging = 0;
ReleaseCapture();
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg, &hti.pt);
ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt);
hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_MENUITEMS))/2;
TreeView_HitTest(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti);
- if (hti.flags&TVHT_ABOVE) hti.hItem=TVI_FIRST;
+ if (hti.flags&TVHT_ABOVE) hti.hItem = TVI_FIRST;
if (dat->hDragItem == hti.hItem) break;
- dat->hDragItem=NULL;
+ dat->hDragItem = NULL;
if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) {
HWND tvw;
HTREEITEM * pSIT;
- HTREEITEM FirstItem=NULL;
+ HTREEITEM FirstItem = NULL;
UINT uITCnt, uSic;
- tvw=GetDlgItem(hwndDlg, IDC_MENUITEMS);
- uITCnt=TreeView_GetCount(tvw);
- uSic=0;
+ tvw = GetDlgItem(hwndDlg, IDC_MENUITEMS);
+ uITCnt = TreeView_GetCount(tvw);
+ uSic = 0;
if (uITCnt) {
- pSIT=(HTREEITEM *)mir_alloc(sizeof(HTREEITEM)*uITCnt);
+ pSIT = (HTREEITEM *)mir_alloc(sizeof(HTREEITEM)*uITCnt);
if (pSIT) {
HTREEITEM hit;
- hit=TreeView_GetRoot(tvw);
+ hit = TreeView_GetRoot(tvw);
if (hit)
do {
- TVITEM tvi={0};
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hit;
+ TVITEM tvi = {0};
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hit;
TreeView_GetItem(tvw, &tvi);
if (((MenuItemOptData *)tvi.lParam)->isSelected) {
- pSIT[uSic]=tvi.hItem;
+ pSIT[uSic] = tvi.hItem;
uSic++;
}
- }while (hit=TreeView_GetNextSibling(tvw, hit));
+ }while (hit = TreeView_GetNextSibling(tvw, hit));
// Proceed moving
{
UINT i;
HTREEITEM insertAfter;
- insertAfter=hti.hItem;
+ insertAfter = hti.hItem;
for (i=0; i<uSic; i++) {
- if (insertAfter) insertAfter=MoveItemAbove(tvw, pSIT[i], insertAfter);
+ if (insertAfter) insertAfter = MoveItemAbove(tvw, pSIT[i], insertAfter);
else break;
- if ( !i) FirstItem=insertAfter;
+ if ( !i) FirstItem = insertAfter;
} }
// free pointers...
mir_free(pSIT);
@@ -798,20 +798,20 @@ long handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD) HTREEITEM hItem = (HTREEITEM) pNMTVCD->nmcd.dwItemSpec;
TCHAR buf[255];
TVITEM tvi = {0};
- int k=0;
+ int k = 0;
tvi.mask = TVIF_HANDLE |TVIF_PARAM|TVIS_SELECTED|TVIF_TEXT|TVIF_IMAGE;
- tvi.stateMask=TVIS_SELECTED;
+ tvi.stateMask = TVIS_SELECTED;
tvi.hItem = hItem;
- tvi.pszText=(LPTSTR)(&buf);
- tvi.cchTextMax=254;
+ tvi.pszText = (LPTSTR)(&buf);
+ tvi.cchTextMax = 254;
TreeView_GetItem(hWndTreeView, &tvi);
if (((MenuItemOptData *)tvi.lParam)->isSelected) {
pNMTVCD->clrTextBk = GetSysColor(COLOR_HIGHLIGHT);
- pNMTVCD->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
+ pNMTVCD->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
}
else {
pNMTVCD->clrTextBk = GetSysColor(COLOR_WINDOW);
- pNMTVCD->clrText = GetSysColor(COLOR_WINDOWTEXT);
+ pNMTVCD->clrText = GetSysColor(COLOR_WINDOWTEXT);
}
/* At this point, you can change the background colors for the item
@@ -822,14 +822,14 @@ long handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD) HBRUSH br;
SIZE sz;
RECT rc;
- k=1;
+ k = 1;
GetTextExtentPoint32(pNMTVCD->nmcd.hdc, tvi.pszText, lstrlen(tvi.pszText), &sz);
- if (sz.cx+3>pNMTVCD->nmcd.rc.right-pNMTVCD->nmcd.rc.left) rc=pNMTVCD->nmcd.rc;
+ if (sz.cx+3>pNMTVCD->nmcd.rc.right-pNMTVCD->nmcd.rc.left) rc = pNMTVCD->nmcd.rc;
else SetRect(&rc, pNMTVCD->nmcd.rc.left, pNMTVCD->nmcd.rc.top, pNMTVCD->nmcd.rc.left+sz.cx+3, pNMTVCD->nmcd.rc.bottom);
- br=CreateSolidBrush(pNMTVCD->clrTextBk);
+ br = CreateSolidBrush(pNMTVCD->clrTextBk);
SetTextColor(pNMTVCD->nmcd.hdc, pNMTVCD->clrText);
SetBkColor(pNMTVCD->nmcd.hdc, pNMTVCD->clrTextBk);
FillRect(pNMTVCD->nmcd.hdc, &rc, br);
@@ -848,7 +848,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM int GenMenuOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.cbSize=sizeof(odp);
+ odp.cbSize = sizeof(odp);
odp.hInstance = hInst;
odp.pszGroup = LPGEN("Customize");
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index 714ed0e223..c3a6403fe0 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -34,7 +34,7 @@ static int CountGroups(void) int i;
char str[33];
- for (i = 0;; i++) {
+ for (i=0;; i++) {
_itoa(i, str, 10);
if (DBGetContactSetting(NULL, "CListGroups", str, &dbv))
break;
@@ -49,7 +49,7 @@ static int GroupNameExists(const TCHAR *name, int skipGroup) DBVARIANT dbv;
int i;
- for (i = 0;; i++) {
+ for (i=0;; i++) {
if (i == skipGroup)
continue;
_itoa(i, idstr, 10);
@@ -226,7 +226,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) int len;
len = lstrlen(name);
- for (i = 0;; i++) {
+ for (i=0;; i++) {
_itoa(i, str, 10);
if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
break;
@@ -291,7 +291,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) int len, i;
len = lstrlen(oldName);
- for (i = 0;; i++) {
+ for (i=0;; i++) {
if (i == groupId)
continue;
_itoa(i, idstr, 10);
@@ -314,7 +314,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) pszLastBackslash = _tcsrchr(str, '\\');
if (pszLastBackslash != NULL) {
*pszLastBackslash = '\0';
- for (i = 0;; i++) {
+ for (i=0;; i++) {
_itoa(i, idstr, 10);
if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
break;
@@ -541,7 +541,7 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM) int InitGroupServices(void)
{
- for (int i = 0;; i++)
+ for (int i=0;; i++)
{
char str[32];
_itoa(i, str, 10);
diff --git a/src/modules/clist/keyboard.cpp b/src/modules/clist/keyboard.cpp index 2942f7137e..e580681e5c 100644 --- a/src/modules/clist/keyboard.cpp +++ b/src/modules/clist/keyboard.cpp @@ -32,7 +32,7 @@ static INT_PTR hkHideShow(WPARAM, LPARAM) /*
INT_PTR hkSearch(WPARAM wParam, LPARAM lParam)
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if ( !DBGetContactSettingString(NULL, "CList", "SearchUrl", &dbv)) {
CallService(MS_UTILS_OPENURL, DBGetContactSettingByte(NULL, "CList", "HKSearchNewWnd", 0), (LPARAM)dbv.pszVal);
DBFreeVariant(&dbv);
@@ -100,11 +100,11 @@ int InitClistHotKeys(void) shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'I');
Hotkey_Register(&shk);
/*
- shk.pszDescription="Search in site";
- shk.pszName="SearchInWeb";
- shk.pszSection="Main";
- shk.pszService="CLIST/HK/Search";
- shk.DefHotKey=846;
+ shk.pszDescription = "Search in site";
+ shk.pszName = "SearchInWeb";
+ shk.pszSection = "Main";
+ shk.pszService = "CLIST/HK/Search";
+ shk.DefHotKey = 846;
Hotkey_Register(&shk);
*/
shk.ptszDescription = _T("Open Options Page");
@@ -129,25 +129,25 @@ int InitClistHotKeys(void) Hotkey_Register(&shk);
/*
- shk.pszDescription="Close Miranda";
- shk.pszName="CloseMiranda";
- shk.pszSection="Main";
- shk.pszService="CLIST/HK/CloseMiranda";
- shk.DefHotKey=0;
+ shk.pszDescription = "Close Miranda";
+ shk.pszName = "CloseMiranda";
+ shk.pszSection = "Main";
+ shk.pszService = "CLIST/HK/CloseMiranda";
+ shk.DefHotKey = 0;
Hotkey_Register(&shk);
- shk.pszDescription="Restore last status";
- shk.pszName="RestoreLastStatus";
- shk.pszSection="Status";
- shk.pszService="CLIST/HK/RestoreStatus";
- shk.DefHotKey=0;
+ shk.pszDescription = "Restore last status";
+ shk.pszName = "RestoreLastStatus";
+ shk.pszSection = "Status";
+ shk.pszService = "CLIST/HK/RestoreStatus";
+ shk.DefHotKey = 0;
Hotkey_Register(&shk);
- shk.pszDescription="Set All Offline";
- shk.pszName="AllOffline";
- shk.pszSection="Status";
- shk.pszService="CLIST/HK/AllOffline";
- shk.DefHotKey=0;
+ shk.pszDescription = "Set All Offline";
+ shk.pszName = "AllOffline";
+ shk.pszSection = "Status";
+ shk.pszService = "CLIST/HK/AllOffline";
+ shk.DefHotKey = 0;
Hotkey_Register(&shk);
*/
return 0;
diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp index 2075fa3648..eaf4bc1906 100644 --- a/src/modules/clist/movetogroup.cpp +++ b/src/modules/clist/movetogroup.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "..\..\core\commonheaders.h"
HANDLE hOnCntMenuBuild;
-HGENMENU hMoveToGroupItem=0, hPriorityItem = 0, hFloatingItem = 0;
+HGENMENU hMoveToGroupItem = 0, hPriorityItem = 0, hFloatingItem = 0;
LIST<HANDLE> lphGroupsItems(5);
@@ -56,23 +56,23 @@ static TCHAR* PrepareGroupName(TCHAR* str) d = p = (TCHAR*)mir_alloc(sizeof(TCHAR)*(2*_tcslen(str)+1));
while (*str) {
if (*str == '&')
- *d++ = '&';
- *d++ = *str++;
+ *d++='&';
+ *d++=*str++;
}
- *d++ = 0;
+ *d++=0;
return p;
}
static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, bool checked)
{
CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
- mi.hParentMenu = hRoot;
+ mi.cbSize = sizeof(mi);
+ mi.hParentMenu = hRoot;
mi.popupPosition = param; // param to pszService - only with CMIF_CHILDPOPUP !!!!!!
- mi.position = pos;
- mi.ptszName = PrepareGroupName(name);
- mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.position = pos;
+ mi.ptszName = PrepareGroupName(name);
+ mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
if (checked)
mi.flags |= CMIF_CHECKED;
mi.pszService = MTG_MOVE;
@@ -100,7 +100,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) hMoveToGroupItem = Menu_AddContactMenuItem(&mi);
}
- for (i = 0; i < lphGroupsItems.getCount(); i++)
+ for (i=0; i < lphGroupsItems.getCount(); i++)
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)lphGroupsItems[i], 0);
lphGroupsItems.destroy();
@@ -112,7 +112,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) pos += 100000; // Separator
- for (i = 0; ; ++i)
+ for (i=0; ; ++i)
{
char intname[20];
_itoa(i, intname, 10);
@@ -127,7 +127,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) mir_free(dbv.ptszVal);
}
- for (i = 0; i < groups.getCount(); ++i)
+ for (i=0; i < groups.getCount(); ++i)
{
bool checked = szContactGroup && !_tcscmp(szContactGroup, groups[i].name);
AddGroupItem(hMoveToGroupItem, groups[i].name, ++pos, groups[i].position, checked);
@@ -147,7 +147,7 @@ static INT_PTR MTG_DOMOVE(WPARAM wParam, LPARAM lParam) void MTG_OnmodulesLoad()
{
- hOnCntMenuBuild=HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnContactMenuBuild);
+ hOnCntMenuBuild = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnContactMenuBuild);
CreateServiceFunction(MTG_MOVE, MTG_DOMOVE);
}
diff --git a/src/modules/clist/protocolorder.cpp b/src/modules/clist/protocolorder.cpp index 2eeb402f42..cebda085cb 100644 --- a/src/modules/clist/protocolorder.cpp +++ b/src/modules/clist/protocolorder.cpp @@ -64,7 +64,7 @@ bool CheckProtocolOrder(void) for (;;)
{
// Find account with this id
- for (i = 0; i < accounts.getCount(); i++)
+ for (i=0; i < accounts.getCount(); i++)
if (accounts[i]->iOrder == id) break;
// Account with id not found
@@ -72,7 +72,7 @@ bool CheckProtocolOrder(void) {
// Check if this is skipped id, if it is decrement all other ids
bool found = false;
- for (i = 0; i < accounts.getCount(); i++)
+ for (i=0; i < accounts.getCount(); i++)
{
if (accounts[i]->iOrder < 1000000 && accounts[i]->iOrder > id)
{
@@ -90,7 +90,7 @@ bool CheckProtocolOrder(void) if (id < accounts.getCount())
{
// Remove huge ids
- for (i = 0; i < accounts.getCount(); i++)
+ for (i=0; i < accounts.getCount(); i++)
{
if (accounts[i]->iOrder >= 1000000)
accounts[i]->iOrder = id++;
@@ -101,7 +101,7 @@ bool CheckProtocolOrder(void) if (id < accounts.getCount())
{
// Remove duplicate ids
- for (i = 0; i < accounts.getCount(); i++)
+ for (i=0; i < accounts.getCount(); i++)
{
bool found = false;
for (int j = 0; j < accounts.getCount(); j++)
@@ -135,7 +135,7 @@ int FillTree(HWND hwnd) if (accounts.getCount() == 0)
return FALSE;
- for (i = 0; i < accounts.getCount(); i++) {
+ for (i=0; i < accounts.getCount(); i++) {
int idx = cli.pfnGetAccountIndexByPos(i);
if (idx == -1)
continue;
@@ -173,7 +173,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TranslateDialogDefault(hwndDlg);
dat = (ProtocolOrderData*)mir_calloc(sizeof(ProtocolOrderData));
SetWindowLongPtr(hwndProtoOrder, GWLP_USERDATA, (LONG_PTR)dat);
- dat->dragging=0;
+ dat->dragging = 0;
SetWindowLongPtr(hwndProtoOrder, GWL_STYLE, GetWindowLongPtr(hwndProtoOrder, GWL_STYLE) | TVS_NOHSCROLL);
{
@@ -189,7 +189,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_COMMAND:
if (LOWORD(wParam) == IDC_RESETPROTOCOLDATA && HIWORD(wParam) == BN_CLICKED)
{
- for (int i = 0; i < accounts.getCount(); i++)
+ for (int i=0; i < accounts.getCount(); i++)
accounts[i]->iOrder = i;
FillTree(hwndProtoOrder);
@@ -244,16 +244,16 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case TVN_BEGINDRAGA:
SetCapture(hwndDlg);
- dat->dragging=1;
- dat->hDragItem=((LPNMTREEVIEW)lParam)->itemNew.hItem;
+ dat->dragging = 1;
+ dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem;
TreeView_SelectItem(hwndProtoOrder, dat->hDragItem);
break;
case NM_CLICK:
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
+ 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) {
@@ -276,8 +276,8 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_MOUSEMOVE:
if (dat->dragging) {
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg, &hti.pt);
ScreenToClient(hwndProtoOrder, &hti.pt);
TreeView_HitTest(hwndProtoOrder, &hti);
@@ -333,12 +333,12 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //the pointed lParam will be freed inside TVN_DELETEITEM
//so lets substitute it with 0
- lpOldData=(ProtocolData *)tvis.item.lParam;
- tvis.item.lParam=0;
+ lpOldData = (ProtocolData *)tvis.item.lParam;
+ tvis.item.lParam = 0;
TreeView_SetItem(hwndProtoOrder, &tvis.item);
- tvis.item.lParam=(LPARAM)lpOldData;
+ tvis.item.lParam = (LPARAM)lpOldData;
- //now current item contain lParam=0 we can delete it. the memory will be kept.
+ //now current item contain lParam = 0 we can delete it. the memory will be kept.
TreeView_DeleteItem(hwndProtoOrder, dat->hDragItem);
tvis.hParent = NULL;
tvis.hInsertAfter = hti.hItem;
|