diff options
author | slotwin <slotwin@users.noreply.github.com> | 2014-06-08 16:15:46 +0000 |
---|---|---|
committer | slotwin <slotwin@users.noreply.github.com> | 2014-06-08 16:15:46 +0000 |
commit | 2f7760a079e0f1fd713ed46c58239e47b8f7f65a (patch) | |
tree | 155362b6cc83de84e0b707641bc9fe8534e61616 | |
parent | e964f60be38a8a92cba9fc93c2247a052e40d21b (diff) |
Clist_nicer: code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@9424 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp | 12 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistmenus.cpp | 55 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clisttray.cpp | 27 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clui.cpp | 97 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/init.cpp | 103 |
5 files changed, 146 insertions, 148 deletions
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp index 94ac7d1bab..59ce2d1064 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp @@ -51,10 +51,8 @@ typedef struct { int Param1,Param2;
} GroupMenuExecParam, *lpGroupMenuExecParam;
-/*
-wparam=handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
-return 0 on success.
-*/
+//wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
+//return 0 on success.
static INT_PTR RemoveGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
CallService(MO_REMOVEMENUITEM, wParam, 0);
@@ -389,10 +387,8 @@ typedef struct { int Param1, Param2;
} SubGroupMenuExecParam, *lpSubGroupMenuExecParam;
-/*
-wparam=handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
-return 0 on success.
-*/
+//wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
+//return 0 on success.
static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
CallService(MO_REMOVEMENUITEM, wParam, 0);
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index ef24d740b7..6181e3f600 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -36,23 +36,23 @@ extern IconItemT iconItem[]; void DestroyTrayMenu(HMENU hMenu)
{
- int i, cnt;
-
- cnt = GetMenuItemCount(hMenu);
- for (i=0; i<cnt; ++i)
- {
- HMENU hSubMenu = GetSubMenu(hMenu, i);
- if (hSubMenu == hMainStatusMenu || hSubMenu == hMainMenu)
- RemoveMenu(hMenu, i--, MF_BYPOSITION);
- }
- DestroyMenu(hMenu);
+ int i, cnt;
+
+ cnt = GetMenuItemCount(hMenu);
+ for (i = 0; i < cnt; ++i)
+ {
+ HMENU hSubMenu = GetSubMenu(hMenu, i);
+ if (hSubMenu == hMainStatusMenu || hSubMenu == hMainMenu)
+ RemoveMenu(hMenu, i--, MF_BYPOSITION);
+ }
+ DestroyMenu(hMenu);
}
-INT_PTR CloseAction(WPARAM wParam,LPARAM lParam)
+INT_PTR CloseAction(WPARAM wParam, LPARAM lParam)
{
int k;
cfg::shutDown = 1;
- k=CallService(MS_SYSTEM_OKTOEXIT,0,0);
+ k = CallService(MS_SYSTEM_OKTOEXIT, 0, 0);
if (k) {
DestroyWindow(pcli->hwndContactList);
PostQuitMessage(0);
@@ -64,11 +64,7 @@ INT_PTR CloseAction(WPARAM wParam,LPARAM lParam) static HANDLE hWindowListIGN = 0;
-/*
- * dialog procedure for handling the contact ignore dialog (available from the contact
- * menu
- */
-
+// dialog procedure for handling the contact ignore dialog (available from the contact menu
static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hWnd, GWLP_USERDATA);
@@ -120,9 +116,9 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA else {
TCHAR szTitle[512];
DWORD dwFlags = cfg::getDword(hContact, "CList", "CLN_Flags", 0);
- BYTE bSecondLine = cfg::getByte(hContact, "CList", "CLN_2ndline", -1);
+ BYTE bSecondLine = cfg::getByte(hContact, "CList", "CLN_2ndline", -1);
DWORD dwXMask = cfg::getDword(hContact, "CList", "CLN_xmask", 0);
- int i = 0;
+ int i = 0;
mir_sntprintf(szTitle, 512, TranslateT("Contact list display and ignore options for %s"), contact ? contact->szText : (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
@@ -168,7 +164,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA return TRUE;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_IGN_PRIORITY:
SendMessage(pcli->hwndContactTree, CLM_TOGGLEPRIORITYCONTACT, hContact, 0);
return 0;
@@ -177,7 +173,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA return 0;
case IDC_IGN_NONE:
SendMessage(hWnd, WM_USER + 100, hContact, 0);
- return 0;
+ return 0;
case IDC_IGN_ALWAYSONLINE:
if (IsDlgButtonChecked(hWnd, IDC_IGN_ALWAYSONLINE))
CheckDlgButton(hWnd, IDC_IGN_ALWAYSOFFLINE, FALSE);
@@ -221,7 +217,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA LRESULT iSel = SendDlgItemMessage(hWnd, IDC_AVATARDISPMODE, CB_GETCURSEL, 0, 0);
DWORD dwFlags = cfg::getDword(hContact, "CList", "CLN_Flags", 0), dwXMask = 0;
LRESULT checked = 0;
- int i = 0;
+ int i = 0;
FindItem(pcli->hwndContactTree, cfg::clcdat, (HANDLE)hContact, &contact, NULL, NULL);
if (iSel != CB_ERR) {
@@ -282,7 +278,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA break;
}
break;
- case WM_USER + 100: // fill dialog (wParam = hContact, lParam = mask)
+ case WM_USER + 100: // fill dialog (wParam = hContact, lParam = mask)
{
CheckDlgButton(hWnd, IDC_IGN_MSGEVENTS, lParam & (1 << (IGNOREEVENT_MESSAGE - 1)) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_IGN_FILEEVENTS, lParam & (1 << (IGNOREEVENT_FILE - 1)) ? BST_CHECKED : BST_UNCHECKED);
@@ -292,7 +288,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA CheckDlgButton(hWnd, IDC_IGN_ONLINE, lParam & (1 << (IGNOREEVENT_USERONLINE - 1)) ? BST_CHECKED : BST_UNCHECKED);
return 0;
}
- case WM_USER + 110: // retrieve value
+ case WM_USER + 110: // retrieve value
{
DWORD *dwNewMask = (DWORD *)lParam, dwMask = 0;
@@ -307,7 +303,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA *dwNewMask = dwMask;
return 0;
}
- case WM_USER + 120: // set visibility status
+ case WM_USER + 120: // set visibility status
{
ClcContact *contact = NULL;
if (FindItem(pcli->hwndContactTree, cfg::clcdat, (HANDLE)hContact, &contact, NULL, NULL)) {
@@ -320,7 +316,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA }
return 0;
}
- case WM_USER + 130: // update apparent mode
+ case WM_USER + 130: // update apparent mode
{
ClcContact *contact = NULL;
@@ -360,7 +356,6 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA *
* if dialog is already open, focus it.
*/
-
static INT_PTR SetContactIgnore(WPARAM wParam, LPARAM lParam)
{
HWND hWnd = 0;
@@ -369,10 +364,10 @@ static INT_PTR SetContactIgnore(WPARAM wParam, LPARAM lParam) hWindowListIGN = WindowList_Create();
hWnd = WindowList_Find(hWindowListIGN, wParam);
- if ( wParam ) {
- if ( hWnd == 0 )
+ if (wParam) {
+ if (hWnd == 0)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_QUICKIGNORE), 0, IgnoreDialogProc, (LPARAM)wParam);
- else if ( IsWindow( hWnd ))
+ else if (IsWindow(hWnd))
SetFocus(hWnd);
}
return 0;
diff --git a/plugins/Clist_nicer/src/clisttray.cpp b/plugins/Clist_nicer/src/clisttray.cpp index ac955750cd..3f5c45cb79 100644 --- a/plugins/Clist_nicer/src/clisttray.cpp +++ b/plugins/Clist_nicer/src/clisttray.cpp @@ -24,15 +24,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h"
-#define TRAYICON_ID_BASE 100
-#define TIM_CALLBACK (WM_USER+1857)
-#define TIM_CREATE (WM_USER+1858)
+#define TRAYICON_ID_BASE 100
+#define TIM_CALLBACK (WM_USER+1857)
+#define TIM_CREATE (WM_USER+1858)
extern HIMAGELIST hCListImages;
// don't move to win2k.h, need new and old versions to work on 9x/2000/XP
-#define NIF_STATE 0x00000008
-#define NIF_INFO 0x00000010
+#define NIF_STATE 0x00000008
+#define NIF_INFO 0x00000010
int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount)
{
@@ -71,7 +71,7 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
case SETTING_TRAYICON_MULTI:
- if ( !pcli->trayIcon )
+ if (!pcli->trayIcon)
pcli->pfnTrayIconRemove(NULL, NULL);
else if (cfg::getByte("CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)) {
iIcon = IconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), 0, &hIcon);
@@ -83,7 +83,7 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou break;
case SETTING_TRAYICON_SINGLE:
- ptrA szProto( db_get_sa(NULL,"CList","PrimaryStatus"));
+ ptrA szProto( db_get_sa(NULL, "CList", "PrimaryStatus"));
int iIcon = IconFromStatusMode(szProto, szProto ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0), 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
@@ -101,16 +101,17 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou /////////////////////////////////////////////////////////////////////////////////////////
-extern INT_PTR ( *saveTrayIconProcessMessage )(WPARAM wParam, LPARAM lParam);
+extern INT_PTR (*saveTrayIconProcessMessage)(WPARAM wParam, LPARAM lParam);
INT_PTR TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
{
- MSG* msg = ( MSG* )wParam;
- if ( msg->message == TIM_CALLBACK && msg->lParam == WM_MOUSEMOVE ) {
- if ( cfg::dat.bNoTrayTips ) {
- *((LRESULT *) lParam) = 0;
+ MSG *msg = (MSG *)wParam;
+ if (msg->message == TIM_CALLBACK && msg->lParam == WM_MOUSEMOVE ) {
+ if (cfg::dat.bNoTrayTips) {
+ *((LRESULT *)lParam) = 0;
return TRUE;
- } }
+ }
+ }
return saveTrayIconProcessMessage(wParam, lParam);
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 5c1271a650..af7cf779c3 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -87,8 +87,7 @@ static HBITMAP hbmLockedPoint = 0, hbmOldLockedPoint = 0; HICON overlayicons[10];
-static IconItem myIcons[] =
-{
+static IconItem myIcons[] = {
{ LPGEN("Toggle show online/offline"), "CLN_online", IDI_HIDEOFFLINE },
{ LPGEN("Toggle groups"), "CLN_groups", IDI_HIDEGROUPS },
{ LPGEN("Find contacts"), "CLN_findadd", IDI_FINDANDADD },
@@ -169,10 +168,10 @@ static HWND PreCreateCLC(HWND parent) WS_CHILD | CLS_CONTACTLIST
| (cfg::getByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
| CLS_HIDEOFFLINE
- //|(db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CLS_HIDEOFFLINE:0)
+ //| (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
| (cfg::getByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? CLS_HIDEEMPTYGROUPS : 0)
- | CLS_MULTICOLUMN
- , 0, 0, 0, 0, parent, NULL, g_hInst, (LPVOID)0xff00ff00);
+ | CLS_MULTICOLUMN,
+ 0, 0, 0, 0, parent, NULL, g_hInst, (LPVOID)0xff00ff00);
cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0);
return pcli->hwndContactTree;
@@ -194,9 +193,9 @@ static int CreateCLC(HWND parent) frame.height = 20;
frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_TCHAR;
frame.align = alBottom;
- frame.hWnd = CreateWindowExA(0, "EventAreaClass", "evt", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, pcli->hwndContactList, (HMENU) 0, g_hInst, NULL);
+ frame.hWnd = CreateWindowExA(0, "EventAreaClass", "evt", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)0, g_hInst, NULL);
g_hwndEventArea = frame.hWnd;
- hNotifyFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM) & frame, 0);
+ hNotifyFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hNotifyFrame, FU_FMPOS);
HideShowNotifyFrame();
CreateViewModeFrame();
@@ -213,7 +212,7 @@ static int CreateCLC(HWND parent) Frame.tname = _T("My contacts");
Frame.TBtname = TranslateT("My contacts");
Frame.height = 200;
- hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM) & Frame, 0);
+ hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
//free(Frame.name);
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME, hFrameContactTree), (LPARAM)Translate("My contacts"));
@@ -439,12 +438,12 @@ void SetDBButtonStates(MCONTACT hPassedContact) }
case DBVT_WORD: {
WORD val = cfg::getWord(hFinalContact, szModule, szSetting, 0);
- result = (val == *((WORD *) & buttonItem->bValuePush));
+ result = (val == *((WORD *)&buttonItem->bValuePush));
break;
}
case DBVT_DWORD: {
DWORD val = cfg::getDword(hFinalContact, szModule, szSetting, 0);
- result = (val == *((DWORD *) & buttonItem->bValuePush));
+ result = (val == *((DWORD *)&buttonItem->bValuePush));
break;
}
}
@@ -512,11 +511,13 @@ void BlitWallpaper(HDC hdc, RECT *rc, RECT *rcPaint, struct ClcData *dat) if (width * bmp->bmHeight < height * bmp->bmWidth) {
desth = height;
destw = desth * bmp->bmWidth / bmp->bmHeight;
- } else {
+ }
+ else {
destw = width;
desth = destw * bmp->bmHeight / bmp->bmWidth;
}
- } else {
+ }
+ else {
destw = width;
desth = height;
}
@@ -525,7 +526,8 @@ void BlitWallpaper(HDC hdc, RECT *rc, RECT *rcPaint, struct ClcData *dat) if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
destw = width;
desth = destw * bmp->bmHeight / bmp->bmWidth;
- } else {
+ }
+ else {
destw = width;
desth = bmp->bmHeight;
}
@@ -534,7 +536,8 @@ void BlitWallpaper(HDC hdc, RECT *rc, RECT *rcPaint, struct ClcData *dat) if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
desth = height;
destw = desth * bmp->bmWidth / bmp->bmHeight;
- } else {
+ }
+ else {
destw = bmp->bmWidth;
desth = height;
}
@@ -624,12 +627,13 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc) if (newHeight == (rcWindow.bottom - rcWindow.top) && show_on_first_autosize == FALSE)
return;
- if (newHeight > (rcWorkArea.bottom - rcWorkArea.top)*maxHeight / 100)
+ if (newHeight > (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100)
newHeight = (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100;
if (cfg::getByte("CLUI", "AutoSizeUpward", 0)) {
rcWindow.top = rcWindow.bottom - newHeight;
if (rcWindow.top < rcWorkArea.top) rcWindow.top = rcWorkArea.top;
- } else {
+ }
+ else {
rcWindow.bottom = rcWindow.top + newHeight;
if (rcWindow.bottom > rcWorkArea.bottom) rcWindow.bottom = rcWorkArea.bottom;
}
@@ -807,7 +811,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l CluiProtocolStatusChanged(0, 0);
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
- statusNames[i-ID_STATUS_OFFLINE] = pcli->pfnGetStatusModeDescription(i, 0);
+ statusNames[i - ID_STATUS_OFFLINE] = pcli->pfnGetStatusModeDescription(i, 0);
//delay creation of CLC so that it can get the status icons right the first time (needs protocol modules loaded)
if (cfg::dat.bLayeredHack) {
@@ -1089,7 +1093,8 @@ skipbg: SendMessage(hwnd, CLUIINTM_STATUSBARUPDATE, 0, 0);
RedrawWindow(pcli->hwndStatus, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
}
- else cfg::dat.statusBarHeight = 0;
+ else
+ cfg::dat.statusBarHeight = 0;
SizeFramesByWindowRect(&new_window_rect);
dock_prevent_moving = 0;
@@ -1130,7 +1135,7 @@ skipbg: RECT rc;
GetWindowRect(hwnd, &rc);
- if ( !Docking_IsDocked(0, 0)) {
+ if (!Docking_IsDocked(0, 0)) {
cluiPos.bottom = (DWORD)(rc.bottom - rc.top);
cluiPos.left = rc.left;
cluiPos.top = rc.top;
@@ -1143,8 +1148,8 @@ skipbg: // if docked, dont remember pos (except for width)
if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
cfg::writeDword("CList", "Height", (DWORD)(rc.bottom - rc.top));
- cfg::writeDword("CList", "x", (DWORD) rc.left);
- cfg::writeDword("CList", "y", (DWORD) rc.top);
+ cfg::writeDword("CList", "x", (DWORD)rc.left);
+ cfg::writeDword("CList", "y", (DWORD)rc.top);
}
cfg::writeDword("CList", "Width", (DWORD)(rc.right - rc.left));
}
@@ -1168,7 +1173,7 @@ skipbg: return DefWindowProc(hwnd, msg, wParam, lParam);
}
if (wParam == WA_INACTIVE) {
- if ((HWND) wParam != hwnd)
+ if ((HWND)wParam != hwnd)
if (cfg::dat.isTransparent)
if (transparentFocus)
SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
@@ -1210,7 +1215,6 @@ skipbg: return HTBOTTOMLEFT;
if (pt.x > r.right - clip - 10)
return HTBOTTOMRIGHT;
-
}
else if (pt.y >= r.top && pt.y <= r.top + 3 && !cfg::getByte("CLUI", "AutoSize", 0)) {
if (pt.x > r.left + clip + 10 && pt.x < r.right - clip - 10)
@@ -1281,7 +1285,8 @@ skipbg: ShowWindow(hwnd, SW_SHOW);
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);
SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), 255, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
- } else {
+ }
+ else {
SendMessage(hwnd, WM_SIZE, 0, 0);
PostMessage(hwnd, CLUIINTM_REDRAW, 0, 0);
}
@@ -1313,13 +1318,13 @@ skipbg: for (startTick = GetTickCount(); ;) {
thisTick = GetTickCount();
if (thisTick >= startTick + 200) {
- SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)(destAlpha), LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
+ SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)destAlpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
g_fading_active = 0;
return DefWindowProc(hwnd, msg, wParam, lParam);
}
SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)(sourceAlpha + (destAlpha - sourceAlpha) * (int)(thisTick - startTick) / 200), LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
}
- SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)(destAlpha), LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
+ SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)destAlpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
}
return DefWindowProc(hwnd, msg, wParam, lParam);
@@ -1408,7 +1413,8 @@ skipbg: szModule = GetContactProto(hContact);
finalhContact = hContact;
}
- else contactOK = 1;
+ else
+ contactOK = 1;
if (contactOK) {
BOOL fDelete = FALSE;
@@ -1446,11 +1452,11 @@ skipbg: SendMessage(item->hWnd, BM_SETCHECK, 0, 0);
}
if (!contactOK)
- MessageBox(0, TranslateT("The requested action requires a valid contact selection. Please select a contact from the contact list and repeat"), TranslateT("Parameter mismatch"), MB_OK);
+ MessageBox(0, TranslateT("The requested action requires a valid contact selection. Please select a contact from the contact list and repeat."), TranslateT("Parameter mismatch"), MB_OK);
if (serviceFailure) {
char szError[512];
- mir_snprintf(szError, SIZEOF(szError), Translate("The service %s specified by the %s button definition was not found. You may need to install additional plugins"), item->szService, item->szName);
+ mir_snprintf(szError, SIZEOF(szError), Translate("The service %s specified by the %s button definition was not found. You may need to install additional plugins."), item->szService, item->szName);
MessageBoxA(0, szError, Translate("Service failure"), MB_OK);
}
break;
@@ -1612,7 +1618,7 @@ buttons_done: if (((LPNMHDR)lParam)->hwndFrom == pcli->hwndContactTree) {
switch (((LPNMHDR)lParam)->code) {
case CLN_LISTSIZECHANGE:
- sttProcessResize(hwnd, (NMCLISTCONTROL*)lParam);
+ sttProcessResize(hwnd, (NMCLISTCONTROL *)lParam);
return FALSE;
case NM_CLICK:
@@ -1621,7 +1627,7 @@ buttons_done: DWORD hitFlags;
HANDLE hItem;
- hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_HITTEST, (WPARAM) & hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
+ hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
if ((hitFlags & (CLCHT_NOWHERE | CLCHT_INLEFTMARGIN | CLCHT_BELOWITEMS)) == 0)
break;
@@ -1666,9 +1672,9 @@ buttons_done: if (PtInRect(&rc, pt)) {
HMENU hMenu;
if (cfg::getByte("CLUI", "SBarRightClk", 0))
- hMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
else
- hMenu = (HMENU) CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
return 0;
}
@@ -1676,9 +1682,9 @@ buttons_done: break;
case WM_MEASUREITEM:
- if (((LPMEASUREITEMSTRUCT) lParam)->itemData == MENU_MIRANDAMENU) {
- ((LPMEASUREITEMSTRUCT) lParam)->itemWidth = g_cxsmIcon * 4 / 3;
- ((LPMEASUREITEMSTRUCT) lParam)->itemHeight = 0;
+ if (((LPMEASUREITEMSTRUCT)lParam)->itemData == MENU_MIRANDAMENU) {
+ ((LPMEASUREITEMSTRUCT)lParam)->itemWidth = g_cxsmIcon * 4 / 3;
+ ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = 0;
return TRUE;
}
return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
@@ -1727,7 +1733,8 @@ buttons_done: else
hIcon = LoadSkinnedProtoIcon(szProto, status);
}
- else hIcon = LoadSkinnedProtoIcon(szProto, status);
+ else
+ hIcon = LoadSkinnedProtoIcon(szProto, status);
if (!(showOpts & 6) && cfg::dat.bEqualSections)
x = (dis->rcItem.left + dis->rcItem.right - 16) >> 1;
@@ -1761,10 +1768,11 @@ buttons_done: TCHAR szName[64];
PROTOACCOUNT *pa = ProtoGetAccount(szProto);
if (pa) {
- lstrcpyn( szName, pa->tszAccountName, SIZEOF(szName));
- szName[ SIZEOF(szName)-1 ] = 0;
+ lstrcpyn(szName, pa->tszAccountName, SIZEOF(szName));
+ szName[SIZEOF(szName) - 1] = 0;
}
- else szName[0] = 0;
+ else
+ szName[0] = 0;
if (lstrlen(szName) < sizeof(szName) - 1)
lstrcat(szName, _T(" "));
@@ -1773,7 +1781,7 @@ buttons_done: x += textSize.cx;
}
if (showOpts & 4) {
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription( status, 0 );
+ TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
GetTextExtentPoint32(dis->hDC, szStatus, lstrlen(szStatus), &textSize);
TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, lstrlen(szStatus));
}
@@ -1983,7 +1991,7 @@ void LoadCLUIModule(void) wndclass.hInstance = g_hInst;
wndclass.hIcon = 0;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
- wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE);
+ wndclass.hbrBackground = (HBRUSH)COLOR_3DFACE;
wndclass.lpszMenuName = 0;
wndclass.lpszClassName = _T("EventAreaClass");
RegisterClass(&wndclass);
@@ -2003,7 +2011,7 @@ void LoadCLUIModule(void) if (cfg::getByte("CLUI", "FloaterMode", 0)) {
MessageBox(NULL,
- TranslateT("You need the FloatingContacts plugin, cause the embedded floating contacts were removed"),
+ TranslateT("You need the FloatingContacts plugin, cause the embedded floating contacts were removed."),
TranslateT("Warning"), MB_OK | MB_ICONWARNING);
db_unset(NULL, "CLUI", "FloaterMode");
}
@@ -2024,8 +2032,7 @@ struct const TCHAR *tszName;
int iMask;
}
-static clistFontDescr[] =
-{
+static clistFontDescr[] = {
{ LPGENT("Standard contacts"), FIDF_CLASSGENERAL },
{ LPGENT("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
{ LPGENT("Offline contacts"), FIDF_CLASSGENERAL },
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index e8726d7194..d19ea44be7 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../cluiframes/cluiframes.h"
HINSTANCE g_hInst = 0;
-CLIST_INTERFACE* pcli = NULL;
+CLIST_INTERFACE *pcli = NULL;
int hLangpack;
#define DEFAULT_TB_VISIBILITY (1 | 2 | 4 | 8 | 16 | 32 | 64 | 8192)
@@ -40,18 +40,18 @@ extern DWORD g_gdiplusToken; TIME_API tmi;
-HMENU BuildGroupPopupMenu( ClcGroup* group );
-ClcContact* CreateClcContact( void );
-CListEvent* fnCreateEvent( void );
-void ReloadThemedOptions();
-int TrayCalcChanged(const char *szChangedProto, int averageMode, int iProtoCount);
-void RegisterCLUIFrameClasses();
-void LoadButtonModule();
+HMENU BuildGroupPopupMenu(ClcGroup *group);
+ClcContact *CreateClcContact(void);
+CListEvent *fnCreateEvent(void);
+void ReloadThemedOptions();
+int TrayCalcChanged(const char *szChangedProto, int averageMode, int iProtoCount);
+void RegisterCLUIFrameClasses();
+void LoadButtonModule();
void GetDefaultFontSetting(int i, LOGFONT *lf, COLORREF *colour);
-int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY);
-int ShowHide(WPARAM wParam, LPARAM lParam);
-int ClcShutdown(WPARAM wParam, LPARAM lParam);
+int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY);
+int ShowHide(WPARAM wParam, LPARAM lParam);
+int ClcShutdown(WPARAM wParam, LPARAM lParam);
void (*saveLoadClcOptions)(HWND hwnd, struct ClcData *dat);
void LoadClcOptions(HWND hwnd, struct ClcData *dat);
@@ -59,14 +59,14 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat); int (*saveAddContactToGroup)(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
-CListEvent* (*saveAddEvent)(CLISTEVENT *cle);
-CListEvent* AddEvent(CLISTEVENT *cle);
+CListEvent *(*saveAddEvent)(CLISTEVENT *cle);
+CListEvent *AddEvent(CLISTEVENT *cle);
int (*saveAddInfoItemToGroup)(ClcGroup *group, int flags, const TCHAR *pszText);
int AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
-ClcGroup* (*saveAddGroup)(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
-ClcGroup* AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
+ClcGroup *(*saveAddGroup)(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
+ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
LRESULT (CALLBACK *saveContactListWndProc)(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
@@ -76,7 +76,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L int (*saveIconFromStatusMode)(const char *szProto, int status, MCONTACT hContact);
-LRESULT(*saveProcessExternalMessages)(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
+LRESULT (*saveProcessExternalMessages)(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
int (*saveRemoveEvent)(MCONTACT hContact, HANDLE hDbEvent);
@@ -107,44 +107,44 @@ PLUGININFOEX pluginInfo = void _DebugTraceW(const wchar_t *fmt, ...)
{
#ifdef _DEBUG
- wchar_t debug[2048];
- int ibsize = 2047;
- va_list va;
- va_start(va, fmt);
+ wchar_t debug[2048];
+ int ibsize = 2047;
+ va_list va;
+ va_start(va, fmt);
lstrcpyW(debug, L"CLN: ");
- mir_vsnwprintf(&debug[5], ibsize - 10, fmt, va);
- OutputDebugStringW(debug);
+ mir_vsnwprintf(&debug[5], ibsize - 10, fmt, va);
+ OutputDebugStringW(debug);
#endif
}
void _DebugTraceA(const char *fmt, ...)
{
- char debug[2048];
- int ibsize = 2047;
- va_list va;
- va_start(va, fmt);
+ char debug[2048];
+ int ibsize = 2047;
+ va_list va;
+ va_start(va, fmt);
lstrcpyA(debug, "CLN: ");
mir_vsnprintf(&debug[5], ibsize - 10, fmt, va);
#ifdef _DEBUG
- OutputDebugStringA(debug);
+ OutputDebugStringA(debug);
#else
- {
- char szLogFileName[MAX_PATH], szDataPath[MAX_PATH];
- FILE *f;
-
- CallService(MS_DB_GETPROFILEPATH, MAX_PATH, (LPARAM)szDataPath);
- mir_snprintf(szLogFileName, MAX_PATH, "%s\\%s", szDataPath, "clist_nicer.log");
- f = fopen(szLogFileName, "a+");
- if (f) {
- fputs(debug, f);
- fputs("\n", f);
- fclose(f);
- }
- }
+ {
+ char szLogFileName[MAX_PATH], szDataPath[MAX_PATH];
+ FILE *f;
+
+ CallService(MS_DB_GETPROFILEPATH, MAX_PATH, (LPARAM)szDataPath);
+ mir_snprintf(szLogFileName, MAX_PATH, "%s\\%s", szDataPath, "clist_nicer.log");
+ f = fopen(szLogFileName, "a+");
+ if (f) {
+ fputs(debug, f);
+ fputs("\n", f);
+ fclose(f);
+ }
+ }
#endif
}
@@ -155,18 +155,18 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID reserved) return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CLIST, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_CLIST, MIID_LAST };
-int PreloadContactListModule(void);
-int LoadContactListModule(void);
-int LoadCLCModule(void);
-void LoadCLUIModule( void );
-void OnCreateClc( void );
+int PreloadContactListModule(void);
+int LoadContactListModule(void);
+int LoadCLCModule(void);
+void LoadCLUIModule(void);
+void OnCreateClc(void);
static int systemModulesLoaded(WPARAM wParam, LPARAM lParam)
{
@@ -186,7 +186,7 @@ static int systemModulesLoaded(WPARAM wParam, LPARAM lParam) return 0;
}
-static int fnIconFromStatusMode(const char* szProto, int status, MCONTACT hContact)
+static int fnIconFromStatusMode(const char *szProto, int status, MCONTACT hContact)
{
return IconFromStatusMode(szProto, status, hContact, NULL);
}
@@ -200,12 +200,12 @@ extern "C" int __declspec(dllexport) CListInitialise() API::onInit();
RegisterCLUIFrameClasses();
- ZeroMemory((void*) &cfg::dat, sizeof(cfg::dat));
+ ZeroMemory((void *)&cfg::dat, sizeof(cfg::dat));
int iCount = CallService(MS_DB_CONTACT_GETCOUNT, 0, 0);
iCount += 20;
- if ( iCount < 300 )
+ if (iCount < 300)
iCount = 300;
cfg::init();
@@ -252,8 +252,7 @@ extern "C" int __declspec(dllexport) CListInitialise() ReloadThemedOptions();
Reload3dBevelColors();
- cfg::dat.dwFlags = cfg::getDword("CLUI", "Frameflags", CLUI_FRAME_STATUSICONS | CLUI_FRAME_SHOWBOTTOMBUTTONS |
- CLUI_FRAME_BUTTONSFLAT | CLUI_FRAME_CLISTSUNKEN);
+ cfg::dat.dwFlags = cfg::getDword("CLUI", "Frameflags", CLUI_FRAME_STATUSICONS | CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_BUTTONSFLAT | CLUI_FRAME_CLISTSUNKEN);
cfg::dat.dwFlags |= (cfg::getByte("CLUI", "ShowSBar", 1) ? CLUI_FRAME_SBARSHOW : 0);
cfg::dat.soundsOff = cfg::getByte("Skin", "UseSound", 1) ? 0 : 1;
|