summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-04-02 19:28:00 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-04-02 19:28:00 +0000
commit830d54f9e030a7cf06e5ec7b51a52aa21ab5e457 (patch)
treefebc7488fa1ef41f5d7b3a228f85c01313c1d316
parentc76a072915bed0c625aea31cc38029b97dcb4157 (diff)
- implements #622 (zero email counter is not displayed in clist modern's status bar);
- BYTE variables became bool when possible git-svn-id: http://svn.miranda-ng.org/main/trunk@8829 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Clist_modern/src/hdr/modern_statusbar.h26
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp130
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp800
-rw-r--r--plugins/Clist_modern/src/version.h10
6 files changed, 487 insertions, 483 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_statusbar.h b/plugins/Clist_modern/src/hdr/modern_statusbar.h
index 65d0ca2e57..9291f2d2c3 100644
--- a/plugins/Clist_modern/src/hdr/modern_statusbar.h
+++ b/plugins/Clist_modern/src/hdr/modern_statusbar.h
@@ -11,23 +11,23 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC);
typedef struct tagSTATUSBARDATA
{
- BOOL sameWidth;
- RECT rectBorders;
- BYTE extraspace;
- BYTE Align;
- BYTE VAlign;
- BYTE showProtoIcon;
- BYTE showProtoName;
- BYTE showStatusName;
+ BOOL sameWidth;
+ RECT rectBorders;
+ BYTE extraspace;
+ BYTE Align;
+ BYTE VAlign;
+ bool bShowProtoIcon;
+ bool bShowProtoName;
+ bool bShowStatusName;
+ bool bConnectingIcon;
HFONT BarFont;
DWORD fontColor;
- BYTE connectingIcon;
- BYTE TextEffectID;
+ BYTE TextEffectID;
DWORD TextEffectColor1;
DWORD TextEffectColor2;
- BYTE xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
- BYTE nProtosPerLine;
- BYTE showProtoEmails;
+ BYTE xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
+ BYTE nProtosPerLine;
+ bool bShowProtoEmails;
HBITMAP hBmpBackground;
COLORREF bkColour;
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index 7cdd633ee3..3d20e0e738 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -551,7 +551,7 @@ void CLCPaint::_AddParamShort( MODERNMASK *mpModernMask, DWORD dwParamIndex, DW
}
-MODERNMASK *CLCPaint::_GetCLCContactRowBackModernMask( ClcGroup *group, ClcContact *Drawing, int indent, int index, BOOL selected, BOOL hottrack, ClcData *dat )
+MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask( ClcGroup *group, ClcContact *Drawing, int indent, int index, BOOL selected, BOOL hottrack, ClcData *dat )
{
MODERNMASK *mpModernMask = NULL;
char buf[BUF2SIZE] = {0};
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 8a24bab33f..7ce4366044 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -172,11 +172,11 @@ int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProto
}
}
else {
- switch( db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT)) {
+ switch (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT)) {
case SETTING_TRAYICON_SINGLE:
- status = CallProtoService(szChangedProto,PS_GETSTATUS, 0, 0);
+ status = CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0);
- if ((g_StatusBarData.connectingIcon == 1) && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
+ if (g_StatusBarData.bConnectingIcon && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
// 1 check if multi connecting icon
CListTray_GetGlobalStatus(0, 0);
if (g_bMultiConnectionMode) {
@@ -185,70 +185,70 @@ int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProto
hIcon = (HICON)CLUI_GetConnectingIconService(NULL, 1);
}
- else hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);
+ else hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0);
}
else {
- ptrA szProto( db_get_sa(NULL,"CList","PrimaryStatus"));
- hIcon = cliGetIconFromStatusMode(NULL, szProto, (szProto) ? CallProtoService(szProto,PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
+ ptrA szProto(db_get_sa(NULL, "CList", "PrimaryStatus"));
+ hIcon = cliGetIconFromStatusMode(NULL, szProto, (szProto) ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
}
if (hIcon)
- return pcli->pfnTrayIconSetBaseInfo(hIcon,NULL);
+ return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
break;
case SETTING_TRAYICON_CYCLE:
- status = szChangedProto ? CallProtoService(szChangedProto,PS_GETSTATUS, 0, 0) : averageMode;
- if ((g_StatusBarData.connectingIcon == 1 && CListTray_GetGlobalStatus(0, 0)
- && ((status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) || g_bMultiConnectionMode )))
+ status = szChangedProto ? CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0) : averageMode;
+ if (g_StatusBarData.bConnectingIcon && CListTray_GetGlobalStatus(0, 0) &&
+ ((status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) || g_bMultiConnectionMode))
{
//stop cycling
if (pcli->cycleTimerId)
- KillTimer(NULL,pcli->cycleTimerId);
+ KillTimer(NULL, pcli->cycleTimerId);
pcli->cycleTimerId = 0;
// 1 check if multi connecting icon
if (g_bMultiConnectionMode) {
- if (_strcmpi(szChangedProto,g_szConnectingProto))
+ if (_strcmpi(szChangedProto, g_szConnectingProto))
return -1;
- hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)"",1);
+ hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)"", 1);
}
else hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0);
if (hIcon)
return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
}
else {
- pcli->cycleTimerId = CLUI_SafeSetTimer(NULL, 0, db_get_w(NULL,"CList","CycleTime",SETTING_CYCLETIME_DEFAULT)*1000, pcli->pfnTrayCycleTimerProc);
- return pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szChangedProto,status),NULL);
+ pcli->cycleTimerId = CLUI_SafeSetTimer(NULL, 0, db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, pcli->pfnTrayCycleTimerProc);
+ return pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL, szChangedProto, status), NULL);
}
break;
case SETTING_TRAYICON_MULTI:
if (!pcli->trayIcon)
- pcli->pfnTrayIconRemove(NULL,NULL);
- else if ( db_get_b(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT )) {
+ pcli->pfnTrayIconRemove(NULL, NULL);
+ else if (db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)) {
if (!pcli->pfnGetProtocolVisibility(szChangedProto))
return -1;
- status = CallProtoService(szChangedProto,PS_GETSTATUS, 0, 0);
- if ((g_StatusBarData.connectingIcon == 1) && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
+ status = CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0);
+ if (g_StatusBarData.bConnectingIcon && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)
hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0);
else
- hIcon = cliGetIconFromStatusMode(NULL,szChangedProto,CallProtoService(szChangedProto,PS_GETSTATUS, 0, 0));
+ hIcon = cliGetIconFromStatusMode(NULL, szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0));
if (hIcon)
- return pcli->pfnTrayIconSetBaseInfo(hIcon,szChangedProto);
+ return pcli->pfnTrayIconSetBaseInfo(hIcon, szChangedProto);
}
else if (pcli->pfnGetProtocolVisibility(szChangedProto)) {
int avg = pcli->pfnGetAverageMode(NULL);
- int i = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szChangedProto,CallProtoService(szChangedProto,PS_GETSTATUS, 0, 0)),szChangedProto);
+ int i = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL, szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0)), szChangedProto);
if (i < 0) {
pcli->pfnTrayIconDestroy(hwnd);
pcli->pfnTrayIconInit(hwnd);
return -1;
}
- status = CallProtoService(szChangedProto,PS_GETSTATUS, 0, 0);
- if ((g_StatusBarData.connectingIcon == 1) && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
+ status = CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0);
+ if (g_StatusBarData.bConnectingIcon && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
if (hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0))
- return pcli->pfnTrayIconSetBaseInfo(hIcon,szChangedProto);
+ return pcli->pfnTrayIconSetBaseInfo(hIcon, szChangedProto);
}
return i;
}
@@ -256,16 +256,16 @@ int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProto
}
}
}
- else if ( pcli->pfnGetProtocolVisibility(szChangedProto)) {
- status = CallProtoService(szChangedProto,PS_GETSTATUS, 0, 0);
+ else if (pcli->pfnGetProtocolVisibility(szChangedProto)) {
+ status = CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0);
- if ((g_StatusBarData.connectingIcon == 1) && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
+ if (g_StatusBarData.bConnectingIcon && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
if (hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0))
- return pcli->pfnTrayIconSetBaseInfo(hIcon,NULL);
+ return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
}
else if (status >= ID_STATUS_OFFLINE && status <= ID_STATUS_IDLE) {
- ptrA szProto( db_get_sa(NULL,"CList","PrimaryStatus"));
- return pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szProto,status),NULL);
+ ptrA szProto(db_get_sa(NULL, "CList", "PrimaryStatus"));
+ return pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL, szProto, status), NULL);
}
}
@@ -274,24 +274,24 @@ int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProto
static UINT_PTR autoHideTimerId;
-static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd,UINT message,UINT_PTR idEvent,DWORD dwTime)
+static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime)
{
- KillTimer(hwnd,idEvent);
+ KillTimer(hwnd, idEvent);
HWND hwndClui = pcli->hwndContactList;
HWND ActiveWindow = GetActiveWindow();
if (ActiveWindow == hwndClui) return;
if (CLUI_CheckOwnedByClui(ActiveWindow)) return;
CListMod_HideWindow(hwndClui, SW_HIDE);
- SetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
+ SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
int cliTrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam)
{
- if ( db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
- if (GetActiveWindow() != pcli->hwndContactList && GetWindow(GetParent(GetActiveWindow()),GW_OWNER) != pcli->hwndContactList) {
- KillTimer(NULL,autoHideTimerId);
- autoHideTimerId = CLUI_SafeSetTimer(NULL, 0, 1000*db_get_w(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),TrayIconAutoHideTimer);
+ if (db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
+ if (GetActiveWindow() != pcli->hwndContactList && GetWindow(GetParent(GetActiveWindow()), GW_OWNER) != pcli->hwndContactList) {
+ KillTimer(NULL, autoHideTimerId);
+ autoHideTimerId = CLUI_SafeSetTimer(NULL, 0, 1000 * db_get_w(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
}
}
@@ -301,7 +301,7 @@ int cliTrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam)
void DestroyTrayMenu(HMENU hMenu)
{
int cnt = GetMenuItemCount(hMenu);
- for (int i=0; i < cnt; ++i) {
+ for (int i = 0; i < cnt; ++i) {
HMENU hSubMenu = GetSubMenu(hMenu, i);
if (hSubMenu && hSubMenu == hStatusMenu || hSubMenu == hMainMenu)
RemoveMenu(hMenu, i--, MF_BYPOSITION);
@@ -312,23 +312,23 @@ void DestroyTrayMenu(HMENU hMenu)
INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
{
MSG *msg = (MSG*)wParam;
- switch(msg->message) {
+ switch (msg->message) {
case WM_EXITMENULOOP:
if (pcli->bTrayMenuOnScreen)
pcli->bTrayMenuOnScreen = FALSE;
break;
case WM_ACTIVATE:
+ SetCursor(LoadCursor(NULL, IDC_ARROW));
{
- SetCursor(LoadCursor(NULL, IDC_ARROW));
HWND h1 = (HWND)msg->lParam;
HWND h2 = h1 ? GetParent(h1) : NULL;
HWND h4 = pcli->hwndContactList;
- if ( db_get_b(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT)) {
+ if (db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
if (LOWORD(msg->wParam) == WA_INACTIVE && h2 != h4)
- autoHideTimerId = CLUI_SafeSetTimer(NULL, 0, 1000*db_get_w(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),TrayIconAutoHideTimer);
+ autoHideTimerId = CLUI_SafeSetTimer(NULL, 0, 1000 * db_get_w(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
else {
- KillTimer(NULL,autoHideTimerId);
+ KillTimer(NULL, autoHideTimerId);
autoHideTimerId = 0;
}
}
@@ -340,7 +340,7 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
return FALSE; //to avoid autohideTimer in core
case TIM_CALLBACK:
- if ((GetAsyncKeyState(VK_CONTROL)&0x8000) && msg->lParam == WM_LBUTTONDOWN && !db_get_b(NULL,"CList","Tray1Click",SETTING_TRAY1CLICK_DEFAULT)) {
+ if ((GetAsyncKeyState(VK_CONTROL) & 0x8000) && msg->lParam == WM_LBUTTONDOWN && !db_get_b(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT)) {
POINT pt;
HMENU hMenu;
hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
@@ -350,12 +350,12 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
SetFocus(msg->hwnd);
GetCursorPos(&pt);
pcli->bTrayMenuOnScreen = TRUE;
- TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL);
+ TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL);
PostMessage(msg->hwnd, WM_NULL, 0, 0);
g_mutex_bOnTrayRightClick = 0;
IS_WM_MOUSE_DOWN_IN_TRAY = 0;
}
- else if (msg->lParam == WM_MBUTTONDOWN || msg->lParam == WM_LBUTTONDOWN || msg->lParam == WM_RBUTTONDOWN) {
+ else if (msg->lParam == WM_MBUTTONDOWN || msg->lParam == WM_LBUTTONDOWN || msg->lParam == WM_RBUTTONDOWN) {
IS_WM_MOUSE_DOWN_IN_TRAY = 1;
}
else if (msg->lParam == WM_RBUTTONUP) {
@@ -369,7 +369,7 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
GetCursorPos(&pt);
pcli->bTrayMenuOnScreen = TRUE;
- TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL);
+ TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL);
DestroyTrayMenu(hMenu);
PostMessage(msg->hwnd, WM_NULL, 0, 0);
}
@@ -392,7 +392,7 @@ typedef struct{
char *szServiceName;
int Param1;
}
- TrayMenuExecParam,*lpTrayMenuExecParam;
+TrayMenuExecParam, *lpTrayMenuExecParam;
/*
wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
@@ -401,7 +401,7 @@ return 0 on success.
static INT_PTR RemoveTrayMenuItem(WPARAM wParam, LPARAM lParam)
{
- CallService(MO_REMOVEMENUITEM,wParam,0);
+ CallService(MO_REMOVEMENUITEM, wParam, 0);
return 0;
}
@@ -414,9 +414,9 @@ static INT_PTR BuildTrayMenu(WPARAM wParam, LPARAM lParam)
ListParam param = { 0 };
param.MenuObjectHandle = hTrayMenuObject;
- CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)&param);
+ CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)&param);
- tick = GetTickCount()-tick;
+ tick = GetTickCount() - tick;
return (INT_PTR)hMenu;
}
@@ -429,7 +429,7 @@ static INT_PTR AddTrayMenuItem(WPARAM wParam, LPARAM lParam)
return NULL;
lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)mir_alloc(sizeof(TrayMenuExecParam));
- if ( mmep == NULL)
+ if (mmep == NULL)
return 0;
//we need just one parametr.
@@ -438,7 +438,7 @@ static INT_PTR AddTrayMenuItem(WPARAM wParam, LPARAM lParam)
tmi.ownerdata = mmep;
OptParam op;
- op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hTrayMenuObject,(LPARAM)&tmi);
+ op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hTrayMenuObject, (LPARAM)&tmi);
op.Setting = OPT_MENUITEMSETUNIQNAME;
op.Value = (INT_PTR)mi->pszService;
CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op);
@@ -447,7 +447,7 @@ static INT_PTR AddTrayMenuItem(WPARAM wParam, LPARAM lParam)
INT_PTR TrayMenuonAddService(WPARAM wParam, LPARAM lParam)
{
- MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
+ MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
if (mii == NULL)
return 0;
@@ -478,11 +478,11 @@ INT_PTR TrayMenuExecService(WPARAM wParam, LPARAM lParam)
{
if (wParam != 0) {
lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)wParam;
- if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand")) {
+ if (!mir_strcmp(mmep->szServiceName, "Help/AboutCommand")) {
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
}
- CallService(mmep->szServiceName,mmep->Param1,lParam);
+ CallService(mmep->szServiceName, mmep->Param1, lParam);
}
return(1);
}
@@ -500,13 +500,13 @@ INT_PTR FreeOwnerDataTrayMenu(WPARAM wParam, LPARAM lParam)
void InitTrayMenus(void)
{
- CreateServiceFunction("CLISTMENUSTRAY/ExecService",TrayMenuExecService);
- CreateServiceFunction("CLISTMENUSTRAY/FreeOwnerDataTrayMenu",FreeOwnerDataTrayMenu);
- CreateServiceFunction("CLISTMENUSTRAY/TrayMenuonAddService",TrayMenuonAddService);
+ CreateServiceFunction("CLISTMENUSTRAY/ExecService", TrayMenuExecService);
+ CreateServiceFunction("CLISTMENUSTRAY/FreeOwnerDataTrayMenu", FreeOwnerDataTrayMenu);
+ CreateServiceFunction("CLISTMENUSTRAY/TrayMenuonAddService", TrayMenuonAddService);
- CreateServiceFunction("CList/AddTrayMenuItem",AddTrayMenuItem);
- CreateServiceFunction(MS_CLIST_REMOVETRAYMENUITEM,RemoveTrayMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDTRAY,BuildTrayMenu);
+ CreateServiceFunction("CList/AddTrayMenuItem", AddTrayMenuItem);
+ CreateServiceFunction(MS_CLIST_REMOVETRAYMENUITEM, RemoveTrayMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDTRAY, BuildTrayMenu);
// Tray menu
hTrayMenuObject = MO_CreateMenuObject("TrayMenu", LPGEN("Tray menu"), 0, "CLISTMENUSTRAY/ExecService");
@@ -565,8 +565,6 @@ void InitTrayMenus(void)
void UninitTrayMenu()
{
if (hTrayMenuObject && ServiceExists(MO_REMOVEMENUOBJECT))
- CallService(MO_REMOVEMENUOBJECT,(WPARAM)hTrayMenuObject,0);
+ CallService(MO_REMOVEMENUOBJECT, (WPARAM)hTrayMenuObject, 0);
hTrayMenuObject = NULL;
}
-
-//////////////////////////////END TRAY MENU/////////////////////////
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index e241b27d11..0b881617bc 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -1030,7 +1030,7 @@ static int CLUI_CreateTimerForConnectingIcon(WPARAM wParam, LPARAM lParam)
if (!szProto || !status)
return 0;
- if ((g_StatusBarData.connectingIcon == 1) && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
+ if (g_StatusBarData.bConnectingIcon && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
PROTOTICKS *pt = CLUI_GetProtoTicksByProto(szProto);
if (pt != NULL) {
if (pt->nCycleStartTick == 0) {
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index f8dabf6331..1f83fca3b3 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -32,29 +32,29 @@ struct ProtoItemData : public MZeroedObject
HICON icon;
HICON extraIcon;
int iconIndex;
- ptrA ProtoName;
- ptrA AccountName;
- int ProtoStatus;
- ptrT ProtoHumanName;
- ptrA ProtoEMailCount;
- ptrT ProtoStatusText;
- ptrT ProtoXStatus;
- int ProtoPos;
+ ptrA szProtoName;
+ ptrA szAccountName;
+ int iProtoStatus;
+ ptrT tszProtoHumanName;
+ ptrA szProtoEMailCount;
+ ptrT tszProtoStatusText;
+ ptrT tszProtoXStatus;
+ int iProtoPos;
int fullWidth;
RECT protoRect;
- BOOL DoubleIcons;
-
- BYTE showProtoIcon;
- BYTE showProtoName;
- BYTE showStatusName;
+
BYTE xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
- BYTE connectingIcon;
- BYTE showProtoEmails;
- BYTE SBarRightClk;
+ bool bDoubleIcons;
+ bool bShowProtoIcon;
+ bool bShowProtoName;
+ bool bShowStatusName;
+ bool bConnectingIcon;
+ bool bShowProtoEmails;
+ bool SBarRightClk;
+ bool bIsDimmed;
+
int PaddingLeft;
int PaddingRight;
-
- bool isDimmed;
};
static OBJLIST<ProtoItemData> ProtosData(5);
@@ -69,60 +69,61 @@ char* ApendSubSetting(char * buf, int size, char *first, char *second)
int LoadStatusBarData()
{
- g_StatusBarData.perProtoConfig = db_get_b(NULL,"CLUI","SBarPerProto",SETTING_SBARPERPROTO_DEFAULT);
- g_StatusBarData.showProtoIcon = db_get_b(NULL,"CLUI","SBarShow",SETTING_SBARSHOW_DEFAULT)&1;
- g_StatusBarData.showProtoName = db_get_b(NULL,"CLUI","SBarShow",SETTING_SBARSHOW_DEFAULT)&2;
- g_StatusBarData.showStatusName = db_get_b(NULL,"CLUI","SBarShow",SETTING_SBARSHOW_DEFAULT)&4;
- g_StatusBarData.xStatusMode = (BYTE)( db_get_b(NULL,"CLUI","ShowXStatus",SETTING_SHOWXSTATUS_DEFAULT));
- g_StatusBarData.connectingIcon = db_get_b(NULL,"CLUI","UseConnectingIcon",SETTING_USECONNECTINGICON_DEFAULT);
- g_StatusBarData.showProtoEmails = db_get_b(NULL,"CLUI","ShowUnreadEmails",SETTING_SHOWUNREADEMAILS_DEFAULT);
- g_StatusBarData.SBarRightClk = db_get_b(NULL,"CLUI","SBarRightClk",SETTING_SBARRIGHTCLK_DEFAULT);
-
- g_StatusBarData.nProtosPerLine = db_get_b(NULL,"CLUI","StatusBarProtosPerLine",SETTING_PROTOSPERLINE_DEFAULT);
- g_StatusBarData.Align = db_get_b(NULL,"CLUI","Align",SETTING_ALIGN_DEFAULT);
- g_StatusBarData.VAlign = db_get_b(NULL,"CLUI","VAlign",SETTING_VALIGN_DEFAULT);
- g_StatusBarData.sameWidth = db_get_b(NULL,"CLUI","EqualSections",SETTING_EQUALSECTIONS_DEFAULT);
- g_StatusBarData.rectBorders.left = db_get_dw(NULL,"CLUI","LeftOffset",SETTING_LEFTOFFSET_DEFAULT);
- g_StatusBarData.rectBorders.right = db_get_dw(NULL,"CLUI","RightOffset",SETTING_RIGHTOFFSET_DEFAULT);
- g_StatusBarData.rectBorders.top = db_get_dw(NULL,"CLUI","TopOffset",SETTING_TOPOFFSET_DEFAULT);
- g_StatusBarData.rectBorders.bottom = db_get_dw(NULL,"CLUI","BottomOffset",SETTING_BOTTOMOFFSET_DEFAULT);
- g_StatusBarData.extraspace = (BYTE)db_get_dw(NULL,"CLUI","SpaceBetween",SETTING_SPACEBETWEEN_DEFAULT);
-
- if (g_StatusBarData.BarFont) DeleteObject(g_StatusBarData.BarFont);
- g_StatusBarData.BarFont = NULL;//LoadFontFromDB("ModernData","StatusBar",&g_StatusBarData.fontColor);
-
- int vis = db_get_b(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT);
- int frameopt;
- int frameID = Sync( FindFrameID, hModernStatusBar );
- frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,frameID),0);
+ g_StatusBarData.perProtoConfig = db_get_b(NULL, "CLUI", "SBarPerProto", SETTING_SBARPERPROTO_DEFAULT);
+ g_StatusBarData.bShowProtoIcon = (db_get_b(NULL, "CLUI", "SBarShow", SETTING_SBARSHOW_DEFAULT) & 1) != 0;
+ g_StatusBarData.bShowProtoName = (db_get_b(NULL, "CLUI", "SBarShow", SETTING_SBARSHOW_DEFAULT) & 2) != 0;
+ g_StatusBarData.bShowStatusName = (db_get_b(NULL, "CLUI", "SBarShow", SETTING_SBARSHOW_DEFAULT) & 4) != 0;
+ g_StatusBarData.xStatusMode = db_get_b(NULL, "CLUI", "ShowXStatus", SETTING_SHOWXSTATUS_DEFAULT);
+ g_StatusBarData.bConnectingIcon = db_get_b(NULL, "CLUI", "UseConnectingIcon", SETTING_USECONNECTINGICON_DEFAULT) != 0;
+ g_StatusBarData.bShowProtoEmails = db_get_b(NULL, "CLUI", "ShowUnreadEmails", SETTING_SHOWUNREADEMAILS_DEFAULT) != 0;
+ g_StatusBarData.SBarRightClk = db_get_b(NULL, "CLUI", "SBarRightClk", SETTING_SBARRIGHTCLK_DEFAULT);
+
+ g_StatusBarData.nProtosPerLine = db_get_b(NULL, "CLUI", "StatusBarProtosPerLine", SETTING_PROTOSPERLINE_DEFAULT);
+ g_StatusBarData.Align = db_get_b(NULL, "CLUI", "Align", SETTING_ALIGN_DEFAULT);
+ g_StatusBarData.VAlign = db_get_b(NULL, "CLUI", "VAlign", SETTING_VALIGN_DEFAULT);
+ g_StatusBarData.sameWidth = db_get_b(NULL, "CLUI", "EqualSections", SETTING_EQUALSECTIONS_DEFAULT);
+ g_StatusBarData.rectBorders.left = db_get_dw(NULL, "CLUI", "LeftOffset", SETTING_LEFTOFFSET_DEFAULT);
+ g_StatusBarData.rectBorders.right = db_get_dw(NULL, "CLUI", "RightOffset", SETTING_RIGHTOFFSET_DEFAULT);
+ g_StatusBarData.rectBorders.top = db_get_dw(NULL, "CLUI", "TopOffset", SETTING_TOPOFFSET_DEFAULT);
+ g_StatusBarData.rectBorders.bottom = db_get_dw(NULL, "CLUI", "BottomOffset", SETTING_BOTTOMOFFSET_DEFAULT);
+ g_StatusBarData.extraspace = (BYTE)db_get_dw(NULL, "CLUI", "SpaceBetween", SETTING_SPACEBETWEEN_DEFAULT);
+
+ if (g_StatusBarData.BarFont) {
+ DeleteObject(g_StatusBarData.BarFont);
+ g_StatusBarData.BarFont = NULL;
+ }
+
+ int vis = db_get_b(NULL, "CLUI", "ShowSBar", SETTING_SHOWSBAR_DEFAULT);
+ int frameID = Sync(FindFrameID, hModernStatusBar);
+ int frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, frameID), 0);
frameopt = frameopt & (~F_VISIBLE);
if (vis) {
- ShowWindow(hModernStatusBar,SW_SHOW);
+ ShowWindow(hModernStatusBar, SW_SHOW);
frameopt |= F_VISIBLE;
}
- else ShowWindow(hModernStatusBar,SW_HIDE);
- CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,frameID),frameopt);
+ else ShowWindow(hModernStatusBar, SW_HIDE);
+ CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, frameID), frameopt);
- g_StatusBarData.TextEffectID = db_get_b(NULL,"StatusBar","TextEffectID",SETTING_TEXTEFFECTID_DEFAULT);
- g_StatusBarData.TextEffectColor1 = db_get_dw(NULL,"StatusBar","TextEffectColor1",SETTING_TEXTEFFECTCOLOR1_DEFAULT);
- g_StatusBarData.TextEffectColor2 = db_get_dw(NULL,"StatusBar","TextEffectColor2",SETTING_TEXTEFFECTCOLOR2_DEFAULT);
+ g_StatusBarData.TextEffectID = db_get_b(NULL, "StatusBar", "TextEffectID", SETTING_TEXTEFFECTID_DEFAULT);
+ g_StatusBarData.TextEffectColor1 = db_get_dw(NULL, "StatusBar", "TextEffectColor1", SETTING_TEXTEFFECTCOLOR1_DEFAULT);
+ g_StatusBarData.TextEffectColor2 = db_get_dw(NULL, "StatusBar", "TextEffectColor2", SETTING_TEXTEFFECTCOLOR2_DEFAULT);
- if (g_StatusBarData.hBmpBackground) {DeleteObject(g_StatusBarData.hBmpBackground); g_StatusBarData.hBmpBackground = NULL;}
+ if (g_StatusBarData.hBmpBackground) { DeleteObject(g_StatusBarData.hBmpBackground); g_StatusBarData.hBmpBackground = NULL; }
if (g_CluiData.fDisableSkinEngine) {
DBVARIANT dbv;
- g_StatusBarData.bkColour = sttGetColor("StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
- if ( db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if (!db_get_s(NULL,"StatusBar","BkBitmap",&dbv)) {
+ g_StatusBarData.bkColour = sttGetColor("StatusBar", "BkColour", CLCDEFAULT_BKCOLOUR);
+ if (db_get_b(NULL, "StatusBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
+ if (!db_get_s(NULL, "StatusBar", "BkBitmap", &dbv)) {
g_StatusBarData.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
}
- g_StatusBarData.bkUseWinColors = db_get_b(NULL,"StatusBar", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
- g_StatusBarData.backgroundBmpUse = db_get_w(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ g_StatusBarData.bkUseWinColors = db_get_b(NULL, "StatusBar", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
+ g_StatusBarData.backgroundBmpUse = db_get_w(NULL, "StatusBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- SendMessage(pcli->hwndContactList,WM_SIZE, 0, 0);
-
+
+ SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
return 1;
}
@@ -130,24 +131,24 @@ int BgStatusBarChange(WPARAM wParam, LPARAM lParam)
{
if (MirandaExiting())
return 0;
-
+
LoadStatusBarData();
return 0;
}
-//ProtocolData;
+// ProtocolData;
int NewStatusPaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData)
{
- return ModernDrawStatusBar(hWnd,hDC);
+ return ModernDrawStatusBar(hWnd, hDC);
}
int ModernDrawStatusBar(HWND hwnd, HDC hDC)
{
if (hwnd == (HWND)-1) return 0;
if (GetParent(hwnd) == pcli->hwndContactList)
- return ModernDrawStatusBarWorker(hwnd,hDC);
-
- CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
+ return ModernDrawStatusBarWorker(hwnd, hDC);
+
+ CLUI__cliInvalidateRect(hwnd, NULL, FALSE);
return 0;
}
@@ -161,115 +162,121 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
GetClientRect(hWnd, &rc);
if (g_CluiData.fDisableSkinEngine) {
if (g_StatusBarData.bkUseWinColors && xpt_IsThemed(g_StatusBarData.hTheme))
- xpt_DrawTheme(g_StatusBarData.hTheme, hWnd, hDC, 0, 0, &rc, &rc);
+ xpt_DrawTheme(g_StatusBarData.hTheme, hWnd, hDC, 0, 0, &rc, &rc);
else
- DrawBackGround(hWnd, hDC, g_StatusBarData.hBmpBackground, g_StatusBarData.bkColour, g_StatusBarData.backgroundBmpUse);
+ DrawBackGround(hWnd, hDC, g_StatusBarData.hBmpBackground, g_StatusBarData.bkColour, g_StatusBarData.backgroundBmpUse);
}
else SkinDrawGlyph(hDC, &rc, &rc, "Main,ID=StatusBar"); //TBD
- g_StatusBarData.nProtosPerLine = db_get_b(NULL,"CLUI","StatusBarProtosPerLine",SETTING_PROTOSPERLINE_DEFAULT);
- HFONT hOldFont = g_clcPainter.ChangeToFont(hDC,NULL,FONTID_STATUSBAR_PROTONAME,NULL);
+ g_StatusBarData.nProtosPerLine = db_get_b(NULL, "CLUI", "StatusBarProtosPerLine", SETTING_PROTOSPERLINE_DEFAULT);
+ HFONT hOldFont = g_clcPainter.ChangeToFont(hDC, NULL, FONTID_STATUSBAR_PROTONAME, NULL);
- SIZE textSize = {0};
+ SIZE textSize = { 0 };
GetTextExtentPoint32A(hDC, " ", 1, &textSize);
int spaceWidth = textSize.cx;
- int textY = rc.top+((rc.bottom-rc.top-textSize.cy)>>1);
- int iconY = rc.top+((rc.bottom-rc.top-GetSystemMetrics(SM_CXSMICON))>>1);
+ int textY = rc.top + ((rc.bottom - rc.top - textSize.cy) >> 1);
+ int iconY = rc.top + ((rc.bottom - rc.top - GetSystemMetrics(SM_CXSMICON)) >> 1);
ProtosData.destroy();
int protoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts( &protoCount, &accs );
+ ProtoEnumAccounts(&protoCount, &accs);
if (protoCount == 0)
return 0;
for (int j = 0; j < protoCount; j++) {
int i = pcli->pfnGetAccountIndexByPos(j);
- if (i == -1 || !pcli->pfnGetProtocolVisibility(accs[i]->szModuleName))
+ if (i == -1)
continue;
-
+
+ char *szProto = accs[i]->szModuleName;
+ if (!pcli->pfnGetProtocolVisibility(szProto))
+ continue;
+
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "SBarAccountIsCustom_%s", accs[i]->szModuleName);
+ mir_snprintf(buf, SIZEOF(buf), "SBarAccountIsCustom_%s", szProto);
ProtoItemData *p = new ProtoItemData;
if (g_StatusBarData.perProtoConfig && db_get_b(NULL, "CLUI", buf, SETTING_SBARACCOUNTISCUSTOM_DEFAULT)) {
- mir_snprintf(buf, SIZEOF(buf), "HideAccount_%s", accs[i]->szModuleName);
- if ( db_get_b(NULL, "CLUI", buf, SETTING_SBARHIDEACCOUNT_DEFAULT))
+ mir_snprintf(buf, SIZEOF(buf), "HideAccount_%s", szProto);
+ if (db_get_b(NULL, "CLUI", buf, SETTING_SBARHIDEACCOUNT_DEFAULT))
continue;
- mir_snprintf(buf, SIZEOF(buf), "SBarShow_%s", accs[i]->szModuleName);
+ mir_snprintf(buf, SIZEOF(buf), "SBarShow_%s", szProto);
- BYTE showOps = db_get_b(NULL,"CLUI", buf, SETTING_SBARSHOW_DEFAULT);
- p->showProtoIcon = showOps & 1;
- p->showProtoName = showOps & 2;
- p->showStatusName = showOps & 4;
+ BYTE showOps = db_get_b(NULL, "CLUI", buf, SETTING_SBARSHOW_DEFAULT);
+ p->bShowProtoIcon = (showOps & 1) != 0;
+ p->bShowProtoName = (showOps & 2) != 0;
+ p->bShowStatusName = (showOps & 4) != 0;
- mir_snprintf(buf, SIZEOF(buf), "ShowXStatus_%s", accs[i]->szModuleName);
- p->xStatusMode = db_get_b(NULL,"CLUI", buf, SETTING_SBARSHOW_DEFAULT);
+ mir_snprintf(buf, SIZEOF(buf), "ShowXStatus_%s", szProto);
+ p->xStatusMode = db_get_b(NULL, "CLUI", buf, SETTING_SBARSHOW_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "UseConnectingIcon_%s", accs[i]->szModuleName);
- p->connectingIcon = db_get_b(NULL,"CLUI", buf, SETTING_USECONNECTINGICON_DEFAULT);
+ mir_snprintf(buf, SIZEOF(buf), "UseConnectingIcon_%s", szProto);
+ p->bConnectingIcon = db_get_b(NULL, "CLUI", buf, SETTING_USECONNECTINGICON_DEFAULT) != 0;
- mir_snprintf(buf, SIZEOF(buf), "ShowUnreadEmails_%s", accs[i]->szModuleName);
- p->showProtoEmails = db_get_b(NULL,"CLUI", buf, SETTING_SHOWUNREADEMAILS_DEFAULT);
+ mir_snprintf(buf, SIZEOF(buf), "ShowUnreadEmails_%s", szProto);
+ p->bShowProtoEmails = db_get_b(NULL, "CLUI", buf, SETTING_SHOWUNREADEMAILS_DEFAULT) != 0;
- mir_snprintf(buf, SIZEOF(buf), "SBarRightClk_%s", accs[i]->szModuleName);
- p->SBarRightClk = db_get_b(NULL,"CLUI", buf, SETTING_SBARRIGHTCLK_DEFAULT);
+ mir_snprintf(buf, SIZEOF(buf), "SBarRightClk_%s", szProto);
+ p->SBarRightClk = db_get_b(NULL, "CLUI", buf, SETTING_SBARRIGHTCLK_DEFAULT) != 0;
- mir_snprintf(buf, SIZEOF(buf), "PaddingLeft_%s", accs[i]->szModuleName);
- p->PaddingLeft = db_get_dw(NULL,"CLUI", buf, SETTING_PADDINGLEFT_DEFAULT);
+ mir_snprintf(buf, SIZEOF(buf), "PaddingLeft_%s", szProto);
+ p->PaddingLeft = db_get_dw(NULL, "CLUI", buf, SETTING_PADDINGLEFT_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "PaddingRight_%s", accs[i]->szModuleName);
- p->PaddingRight = db_get_dw(NULL,"CLUI", buf, SETTING_PADDINGRIGHT_DEFAULT);
+ mir_snprintf(buf, SIZEOF(buf), "PaddingRight_%s", szProto);
+ p->PaddingRight = db_get_dw(NULL, "CLUI", buf, SETTING_PADDINGRIGHT_DEFAULT);
}
else {
- p->showProtoIcon = g_StatusBarData.showProtoIcon;
- p->showProtoName = g_StatusBarData.showProtoName;
- p->showStatusName = g_StatusBarData.showStatusName;
+ p->bShowProtoIcon = g_StatusBarData.bShowProtoIcon;
+ p->bShowProtoName = g_StatusBarData.bShowProtoName;
+ p->bShowStatusName = g_StatusBarData.bShowStatusName;
p->xStatusMode = g_StatusBarData.xStatusMode;
- p->connectingIcon = g_StatusBarData.connectingIcon;
- p->showProtoEmails = g_StatusBarData.showProtoEmails;
+ p->bConnectingIcon = g_StatusBarData.bConnectingIcon;
+ p->bShowProtoEmails = g_StatusBarData.bShowProtoEmails;
p->SBarRightClk = 0;
p->PaddingLeft = 0;
p->PaddingRight = 0;
}
- p->ProtoStatus = CallProtoService(accs[i]->szModuleName,PS_GETSTATUS, 0, 0);
+ p->iProtoStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
- if (p->ProtoStatus > ID_STATUS_OFFLINE) {
- if (p->showProtoEmails == 1 && ProtoServiceExists(accs[i]->szModuleName, PS_GETUNREADEMAILCOUNT)) {
- char buf[40];
- mir_snprintf(buf, SIZEOF(buf),"[%d]", (int)ProtoCallService(accs[i]->szModuleName, PS_GETUNREADEMAILCOUNT, 0, 0));
- p->ProtoEMailCount = mir_strdup(buf);
+ if (p->iProtoStatus > ID_STATUS_OFFLINE)
+ if (p->bShowProtoEmails == 1 && ProtoServiceExists(szProto, PS_GETUNREADEMAILCOUNT)) {
+ int nEmails = (int)ProtoCallService(szProto, PS_GETUNREADEMAILCOUNT, 0, 0);
+ if (nEmails > 0) {
+ char buf[40];
+ mir_snprintf(buf, SIZEOF(buf), "[%d]", nEmails);
+ p->szProtoEMailCount = mir_strdup(buf);
+ }
}
- }
- p->ProtoHumanName = mir_tstrdup(accs[i]->tszAccountName);
- p->AccountName = mir_strdup(accs[i]->szModuleName);
- p->ProtoName = mir_strdup(accs[i]->szProtoName);
- p->ProtoStatusText = mir_tstrdup(pcli->pfnGetStatusModeDescription(p->ProtoStatus, 0));
- p->ProtoPos = ProtosData.getCount();
+ p->tszProtoHumanName = mir_tstrdup(accs[i]->tszAccountName);
+ p->szAccountName = mir_strdup(szProto);
+ p->szProtoName = mir_strdup(accs[i]->szProtoName);
+ p->tszProtoStatusText = mir_tstrdup(pcli->pfnGetStatusModeDescription(p->iProtoStatus, 0));
+ p->iProtoPos = ProtosData.getCount();
- p->isDimmed = 0;
+ p->bIsDimmed = 0;
if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) {
char szTemp[2048];
- mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", p->AccountName );
- p->isDimmed = strstr(g_CluiData.protoFilter, szTemp) ? 0 : 1;
+ mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", p->szAccountName);
+ p->bIsDimmed = strstr(g_CluiData.protoFilter, szTemp) ? 0 : 1;
}
ProtosData.insert(p);
}
- if ( ProtosData.getCount() == 0)
+ if (ProtosData.getCount() == 0)
return 0;
//START MULTILINE HERE
int orig_protoCount = protoCount;
int orig_visProtoCount = ProtosData.getCount();
int protosperline = 0;
-
+
if (g_StatusBarData.nProtosPerLine)
protosperline = g_StatusBarData.nProtosPerLine;
else if (orig_visProtoCount)
@@ -282,14 +289,14 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
protosperline = 1;
orig_visProtoCount = 1;
}
- protosperline = min(protosperline,orig_visProtoCount);
+ protosperline = min(protosperline, orig_visProtoCount);
- int linecount = protosperline ? (orig_visProtoCount+(protosperline-1))/protosperline : 1; //divide with rounding to up
- for (int line = 0; line < linecount; line++) {
- int rowheight = max(textSize.cy+2, iconHeight);
- protoCount = min(protosperline,(orig_protoCount-line*protosperline));
- int visProtoCount = min(protosperline,(orig_visProtoCount-line*protosperline));
- GetClientRect(hWnd,&rc);
+ int linecount = protosperline ? (orig_visProtoCount + (protosperline - 1)) / protosperline : 1; //divide with rounding to up
+ for (int line = 0; line < linecount; line++) {
+ int rowheight = max(textSize.cy + 2, iconHeight);
+ protoCount = min(protosperline, (orig_protoCount - line*protosperline));
+ int visProtoCount = min(protosperline, (orig_visProtoCount - line*protosperline));
+ GetClientRect(hWnd, &rc);
rc.top += g_StatusBarData.rectBorders.top;
rc.bottom -= g_StatusBarData.rectBorders.bottom;
@@ -302,87 +309,87 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
height = (rowheight*linecount);
}
- int rowsdy = ((rc.bottom-rc.top)-height)/2;
- if (rowheight*(line)+rowsdy < rc.top-rowheight) continue;
- if (rowheight*(line+1)+rowsdy>rc.bottom+rowheight)
+ int rowsdy = ((rc.bottom - rc.top) - height) / 2;
+ if (rowheight*(line)+rowsdy < rc.top - rowheight) continue;
+ if (rowheight*(line + 1) + rowsdy>rc.bottom + rowheight)
break;
if (g_StatusBarData.VAlign == 0) { //top
- rc.bottom = rc.top+rowheight*(line+1);
- rc.top = rc.top+rowheight*line+1;
+ rc.bottom = rc.top + rowheight*(line + 1);
+ rc.top = rc.top + rowheight*line + 1;
}
else if (g_StatusBarData.VAlign == 1) { //center
- rc.bottom = rc.top+rowsdy+rowheight*(line+1);
- rc.top = rc.top+rowsdy+rowheight*line+1;
+ rc.bottom = rc.top + rowsdy + rowheight*(line + 1);
+ rc.top = rc.top + rowsdy + rowheight*line + 1;
}
else if (g_StatusBarData.VAlign == 2) { //bottom
rc.top = rc.bottom - (rowheight*(linecount - line));
- rc.bottom = rc.bottom - (rowheight*(linecount - line - 1)+1);
+ rc.bottom = rc.bottom - (rowheight*(linecount - line - 1) + 1);
}
- textY = rc.top + (((rc.bottom-rc.top) - textSize.cy)/2);
- iconY = rc.top + (((rc.bottom-rc.top) - iconHeight)/2);
+ textY = rc.top + (((rc.bottom - rc.top) - textSize.cy) / 2);
+ iconY = rc.top + (((rc.bottom - rc.top) - iconHeight) / 2);
//Code for each line
DWORD sw;
int rectwidth = rc.right - rc.left - g_StatusBarData.rectBorders.left - g_StatusBarData.rectBorders.right;
if (visProtoCount > 1)
- sw = (rectwidth - (g_StatusBarData.extraspace*(visProtoCount-1))) / visProtoCount;
+ sw = (rectwidth - (g_StatusBarData.extraspace*(visProtoCount - 1))) / visProtoCount;
else
sw = rectwidth;
-
+
int *ProtoWidth = (int*)mir_alloc(sizeof(int)*visProtoCount);
- for (i=0; i < visProtoCount; i++) {
+ for (i = 0; i < visProtoCount; i++) {
ProtoItemData &p = ProtosData[line*protosperline + i];
DWORD w = p.PaddingLeft;
w += p.PaddingRight;
- if (p.showProtoIcon) {
- w += GetSystemMetrics(SM_CXSMICON)+1;
+ if (p.bShowProtoIcon) {
+ w += GetSystemMetrics(SM_CXSMICON) + 1;
p.extraIcon = NULL;
- if ((p.xStatusMode & 8) && p.ProtoStatus > ID_STATUS_OFFLINE) {
+ if ((p.xStatusMode & 8) && p.iProtoStatus > ID_STATUS_OFFLINE) {
TCHAR str[512];
CUSTOM_STATUS cs = { sizeof(cs) };
cs.flags = CSSF_MASK_NAME | CSSF_TCHAR;
cs.ptszName = str;
- if ( CallProtoService(p.AccountName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0)
- p.ProtoXStatus = mir_tstrdup(str);
+ if (CallProtoService(p.szAccountName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0)
+ p.tszProtoXStatus = mir_tstrdup(str);
}
-
+
if ((p.xStatusMode & 3)) {
- if (p.ProtoStatus > ID_STATUS_OFFLINE) {
- if ( ProtoServiceExists(p.AccountName, PS_GETCUSTOMSTATUSICON))
- p.extraIcon = (HICON)ProtoCallService(p.AccountName, PS_GETCUSTOMSTATUSICON, 0, 0);
+ if (p.iProtoStatus > ID_STATUS_OFFLINE) {
+ if (ProtoServiceExists(p.szAccountName, PS_GETCUSTOMSTATUSICON))
+ p.extraIcon = (HICON)ProtoCallService(p.szAccountName, PS_GETCUSTOMSTATUSICON, 0, 0);
if (p.extraIcon && (p.xStatusMode & 3) == 3)
- w += GetSystemMetrics(SM_CXSMICON)+1;
+ w += GetSystemMetrics(SM_CXSMICON) + 1;
}
}
}
SIZE textSize;
- if (p.showProtoName) {
- GetTextExtentPoint32(hDC, p.ProtoHumanName, lstrlen(p.ProtoHumanName), &textSize);
+ if (p.bShowProtoName) {
+ GetTextExtentPoint32(hDC, p.tszProtoHumanName, lstrlen(p.tszProtoHumanName), &textSize);
w += textSize.cx + 3 + spaceWidth;
}
- if (p.showProtoEmails && p.ProtoEMailCount) {
- GetTextExtentPoint32A(hDC, p.ProtoEMailCount, lstrlenA(p.ProtoEMailCount), &textSize);
+ if (p.bShowProtoEmails && p.szProtoEMailCount) {
+ GetTextExtentPoint32A(hDC, p.szProtoEMailCount, lstrlenA(p.szProtoEMailCount), &textSize);
w += textSize.cx + 3 + spaceWidth;
}
- if (p.showStatusName) {
- GetTextExtentPoint32(hDC, p.ProtoStatusText, lstrlen(p.ProtoStatusText), &textSize);
+ if (p.bShowStatusName) {
+ GetTextExtentPoint32(hDC, p.tszProtoStatusText, lstrlen(p.tszProtoStatusText), &textSize);
w += textSize.cx + 3 + spaceWidth;
}
- if ((p.xStatusMode & 8) && p.ProtoXStatus) {
- GetTextExtentPoint32(hDC, p.ProtoXStatus, lstrlen(p.ProtoXStatus), &textSize);
+ if ((p.xStatusMode & 8) && p.tszProtoXStatus) {
+ GetTextExtentPoint32(hDC, p.tszProtoXStatus, lstrlen(p.tszProtoXStatus), &textSize);
w += textSize.cx + 3 + spaceWidth;
}
- if (p.showProtoName || (p.showProtoEmails && p.ProtoEMailCount) || p.showStatusName || ((p.xStatusMode & 8) && p.ProtoXStatus))
+ if (p.bShowProtoName || (p.bShowProtoEmails && p.szProtoEMailCount) || p.bShowStatusName || ((p.xStatusMode & 8) && p.tszProtoXStatus))
w -= spaceWidth;
p.fullWidth = w;
@@ -397,36 +404,36 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
}
// Reposition rects
- for (i=0; i < visProtoCount; i++)
+ for (i = 0; i < visProtoCount; i++)
if (ProtoWidth[i] > maxwidth)
maxwidth = ProtoWidth[i];
if (g_StatusBarData.sameWidth) {
- for (i=0; i < visProtoCount; i++)
+ for (i = 0; i < visProtoCount; i++)
ProtoWidth[i] = maxwidth;
SumWidth = maxwidth * visProtoCount;
}
- SumWidth += (visProtoCount-1) * (g_StatusBarData.extraspace+1);
+ SumWidth += (visProtoCount - 1) * (g_StatusBarData.extraspace + 1);
if (SumWidth > rectwidth) {
- float f = (float)rectwidth/SumWidth;
+ float f = (float)rectwidth / SumWidth;
SumWidth = 0;
- for (i=0; i < visProtoCount; i++) {
- ProtoWidth[i] = (int)((float)ProtoWidth[i]*f);
+ for (i = 0; i < visProtoCount; i++) {
+ ProtoWidth[i] = (int)((float)ProtoWidth[i] * f);
SumWidth += ProtoWidth[i];
}
- SumWidth += (visProtoCount-1)*(g_StatusBarData.extraspace+1);
+ SumWidth += (visProtoCount - 1)*(g_StatusBarData.extraspace + 1);
}
if (g_StatusBarData.Align == 1) //center
- aligndx = (rectwidth-SumWidth)>>1;
+ aligndx = (rectwidth - SumWidth) >> 1;
else if (g_StatusBarData.Align == 2) //right
- aligndx = (rectwidth-SumWidth);
+ aligndx = (rectwidth - SumWidth);
// Draw in rects
RECT r = rc;
- r.left += g_StatusBarData.rectBorders.left+aligndx;
- for (i=0; i < visProtoCount; i++) {
+ r.left += g_StatusBarData.rectBorders.left + aligndx;
+ for (i = 0; i < visProtoCount; i++) {
ProtoItemData& p = ProtosData[line*protosperline + i];
HRGN rgn;
HICON hIcon = NULL;
@@ -434,15 +441,15 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
BOOL NeedDestroy = FALSE;
int x = r.left;
x += p.PaddingLeft;
- r.right = r.left+ProtoWidth[i];
+ r.right = r.left + ProtoWidth[i];
- if (p.showProtoIcon) {
- if (p.ProtoStatus > ID_STATUS_OFFLINE && (p.xStatusMode & 3) > 0) {
- if ( ProtoServiceExists(p.AccountName, PS_GETCUSTOMSTATUSICON)) {
+ if (p.bShowProtoIcon) {
+ if (p.iProtoStatus > ID_STATUS_OFFLINE && (p.xStatusMode & 3) > 0) {
+ if (ProtoServiceExists(p.szAccountName, PS_GETCUSTOMSTATUSICON)) {
hxIcon = p.extraIcon;
if (hxIcon) {
if ((p.xStatusMode & 3) == 2) {
- hIcon = GetMainStatusOverlay(p.ProtoStatus);
+ hIcon = GetMainStatusOverlay(p.iProtoStatus);
NeedDestroy = TRUE;
}
else if ((p.xStatusMode & 3) == 1) {
@@ -455,55 +462,55 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
}
if (hIcon == NULL && (hxIcon == NULL || ((p.xStatusMode & 3) == 3))) {
- if ((p.connectingIcon == 1) && p.ProtoStatus >= ID_STATUS_CONNECTING && p.ProtoStatus <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
- hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)p.AccountName,0);
+ if ((p.bConnectingIcon == 1) && p.iProtoStatus >= ID_STATUS_CONNECTING && p.iProtoStatus <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
+ hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)p.szAccountName, 0);
if (hIcon)
NeedDestroy = TRUE;
else
- hIcon = LoadSkinnedProtoIcon(p.AccountName,p.ProtoStatus);
+ hIcon = LoadSkinnedProtoIcon(p.szAccountName, p.iProtoStatus);
}
- else hIcon = LoadSkinnedProtoIcon(p.AccountName,p.ProtoStatus);
+ else hIcon = LoadSkinnedProtoIcon(p.szAccountName, p.iProtoStatus);
}
- rgn = CreateRectRgn(r.left,r.top,r.right,r.bottom);
+ rgn = CreateRectRgn(r.left, r.top, r.right, r.bottom);
if (g_StatusBarData.sameWidth) {
int fw = p.fullWidth;
- int rw = r.right-r.left;
+ int rw = r.right - r.left;
if (g_StatusBarData.Align == 1)
- x = r.left+((rw-fw)/2);
+ x = r.left + ((rw - fw) / 2);
else if (g_StatusBarData.Align == 2)
- x = r.left+((rw-fw));
- else
+ x = r.left + ((rw - fw));
+ else
x = r.left;
}
- SelectClipRgn(hDC,rgn);
- p.DoubleIcons = FALSE;
+ SelectClipRgn(hDC, rgn);
+ p.bDoubleIcons = false;
- DWORD dim = p.isDimmed ? (( 64 << 24 ) | 0x80 ) : 0;
+ DWORD dim = p.bIsDimmed ? ((64 << 24) | 0x80) : 0;
- if ((p.xStatusMode&3) == 3) {
+ if ((p.xStatusMode & 3) == 3) {
if (hIcon)
- mod_DrawIconEx_helper(hDC,x,iconY,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL|dim );
+ mod_DrawIconEx_helper(hDC, x, iconY, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL | dim);
if (hxIcon) {
- mod_DrawIconEx_helper(hDC,x+GetSystemMetrics(SM_CXSMICON)+1,iconY,hxIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), 0, NULL,DI_NORMAL|dim);
- x += GetSystemMetrics(SM_CXSMICON)+1;
+ mod_DrawIconEx_helper(hDC, x + GetSystemMetrics(SM_CXSMICON) + 1, iconY, hxIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL | dim);
+ x += GetSystemMetrics(SM_CXSMICON) + 1;
}
- p.DoubleIcons = hIcon && hxIcon;
+ p.bDoubleIcons = hIcon && hxIcon;
}
else {
if (hxIcon)
- mod_DrawIconEx_helper(hDC,x,iconY,hxIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), 0, NULL,DI_NORMAL|dim);
+ mod_DrawIconEx_helper(hDC, x, iconY, hxIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL | dim);
if (hIcon)
- mod_DrawIconEx_helper(hDC,x,iconY,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), 0, NULL,DI_NORMAL| ((hxIcon && (p.xStatusMode&4))?(192 << 24):0 ) | dim );
+ mod_DrawIconEx_helper(hDC, x, iconY, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL | ((hxIcon && (p.xStatusMode & 4)) ? (192 << 24) : 0) | dim);
}
if (hxIcon || hIcon) { /* TODO g_StatusBarData.bDrawLockOverlay options to draw locked proto*/
- if ( db_get_b(NULL, p.AccountName,"LockMainStatus", 0)) {
+ if (db_get_b(NULL, p.szAccountName, "LockMainStatus", 0)) {
HICON hLockOverlay = LoadSkinnedIcon(SKINICON_OTHER_STATUS_LOCKED);
if (hLockOverlay != NULL) {
- mod_DrawIconEx_helper(hDC, x, iconY, hLockOverlay, GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), 0, NULL,DI_NORMAL | dim);
+ mod_DrawIconEx_helper(hDC, x, iconY, hLockOverlay, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL | dim);
Skin_ReleaseIcon(hLockOverlay);
}
}
@@ -511,62 +518,62 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
if (hxIcon) DestroyIcon_protect(hxIcon);
if (NeedDestroy) DestroyIcon_protect(hIcon);
else Skin_ReleaseIcon(hIcon);
- x += GetSystemMetrics(SM_CXSMICON)+1;
+ x += GetSystemMetrics(SM_CXSMICON) + 1;
}
- if (p.showProtoName) {
+ if (p.bShowProtoName) {
SIZE textSize;
RECT rt = r;
- rt.left = x+(spaceWidth>>1);
+ rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawText(hDC, p.ProtoHumanName, lstrlen(p.ProtoHumanName), &rt, 0);
+ ske_DrawText(hDC, p.tszProtoHumanName, lstrlen(p.tszProtoHumanName), &rt, 0);
- if ((p.showProtoEmails && p.ProtoEMailCount != NULL) || p.showStatusName || ((p.xStatusMode & 8) && p.ProtoXStatus)) {
- GetTextExtentPoint32(hDC, p.ProtoHumanName, lstrlen(p.ProtoHumanName), &textSize);
+ if ((p.bShowProtoEmails && p.szProtoEMailCount != NULL) || p.bShowStatusName || ((p.xStatusMode & 8) && p.tszProtoXStatus)) {
+ GetTextExtentPoint32(hDC, p.tszProtoHumanName, lstrlen(p.tszProtoHumanName), &textSize);
x += textSize.cx + 3;
}
}
- if (p.showProtoEmails && p.ProtoEMailCount != NULL) {
+ if (p.bShowProtoEmails && p.szProtoEMailCount != NULL) {
SIZE textSize;
RECT rt = r;
- rt.left = x+(spaceWidth>>1);
+ rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawTextA(hDC, p.ProtoEMailCount, lstrlenA(p.ProtoEMailCount), &rt, 0);
- if (p.showStatusName || ((p.xStatusMode & 8) && p.ProtoXStatus)) {
- GetTextExtentPoint32A(hDC,p.ProtoEMailCount,lstrlenA(p.ProtoEMailCount),&textSize);
- x += textSize.cx+3;
+ ske_DrawTextA(hDC, p.szProtoEMailCount, lstrlenA(p.szProtoEMailCount), &rt, 0);
+ if (p.bShowStatusName || ((p.xStatusMode & 8) && p.tszProtoXStatus)) {
+ GetTextExtentPoint32A(hDC, p.szProtoEMailCount, lstrlenA(p.szProtoEMailCount), &textSize);
+ x += textSize.cx + 3;
}
}
- if (p.showStatusName) {
+ if (p.bShowStatusName) {
SIZE textSize;
RECT rt = r;
- rt.left = x+(spaceWidth>>1);
+ rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawText(hDC, p.ProtoStatusText, lstrlen(p.ProtoStatusText), &rt, 0);
- if (((p.xStatusMode & 8) && p.ProtoXStatus)) {
- GetTextExtentPoint32(hDC, p.ProtoStatusText, lstrlen(p.ProtoStatusText), &textSize);
- x += textSize.cx+3;
+ ske_DrawText(hDC, p.tszProtoStatusText, lstrlen(p.tszProtoStatusText), &rt, 0);
+ if (((p.xStatusMode & 8) && p.tszProtoXStatus)) {
+ GetTextExtentPoint32(hDC, p.tszProtoStatusText, lstrlen(p.tszProtoStatusText), &textSize);
+ x += textSize.cx + 3;
}
}
- if ((p.xStatusMode&8) && p.ProtoXStatus) {
+ if ((p.xStatusMode & 8) && p.tszProtoXStatus) {
RECT rt = r;
- rt.left = x+(spaceWidth>>1);
+ rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawText(hDC, p.ProtoXStatus, lstrlen(p.ProtoXStatus), &rt, 0);
+ ske_DrawText(hDC, p.tszProtoXStatus, lstrlen(p.tszProtoXStatus), &rt, 0);
}
p.protoRect = r;
- r.left = r.right+g_StatusBarData.extraspace;
+ r.left = r.right + g_StatusBarData.extraspace;
DeleteObject(rgn);
}
mir_free(ProtoWidth);
}
- SelectObject(hDC,hOldFont);
+ SelectObject(hDC, hOldFont);
ske_ResetTextEffect(hDC);
return 0;
}
@@ -574,37 +581,37 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
static BOOL _ModernStatus_OnExtraIconClick(int protoIndex)
{
ProtoItemData &p = ProtosData[protoIndex];
- if (!mir_strcmpi(p.ProtoName, "ICQ")) {
- if (p.ProtoStatus < ID_STATUS_ONLINE)
+ if (!mir_strcmpi(p.szProtoName, "ICQ")) {
+ if (p.iProtoStatus < ID_STATUS_ONLINE)
return FALSE;
HMENU hMainStatusMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
if (!hMainStatusMenu)
return FALSE;
- HMENU hProtoStatusMenu = GetSubMenu( hMainStatusMenu, protoIndex );
+ HMENU hProtoStatusMenu = GetSubMenu(hMainStatusMenu, protoIndex);
if (!hProtoStatusMenu)
return FALSE;
int extraStatusMenuIndex = 1;
- HMENU hExtraStatusMenu = GetSubMenu( hProtoStatusMenu, extraStatusMenuIndex );
+ HMENU hExtraStatusMenu = GetSubMenu(hProtoStatusMenu, extraStatusMenuIndex);
if (!hExtraStatusMenu)
return FALSE;
- POINT pt; GetCursorPos( &pt );
- HWND hWnd = (HWND) CallService(MS_CLUI_GETHWND, 0 ,0 );
- TrackPopupMenu(hExtraStatusMenu, TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, hWnd, NULL);
+ POINT pt; GetCursorPos(&pt);
+ HWND hWnd = (HWND)CallService(MS_CLUI_GETHWND, 0, 0);
+ TrackPopupMenu(hExtraStatusMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, hWnd, NULL);
return TRUE;
- }
-
- if (!mir_strcmpi(p.ProtoName, "JABBER")) {
- if (p.ProtoStatus < ID_STATUS_ONLINE)
+ }
+
+ if (!mir_strcmpi(p.szProtoName, "JABBER")) {
+ if (p.iProtoStatus < ID_STATUS_ONLINE)
return FALSE;
// Show Moods
#define PS_JABBER_MOOD "/AdvStatusSet/Mood"
- if ( ProtoServiceExists(p.AccountName, PS_JABBER_MOOD)) {
- ProtoCallService(p.AccountName, PS_JABBER_MOOD, 0, 0);
+ if (ProtoServiceExists(p.szAccountName, PS_JABBER_MOOD)) {
+ ProtoCallService(p.szAccountName, PS_JABBER_MOOD, 0, 0);
return TRUE;
}
}
@@ -612,11 +619,12 @@ static BOOL _ModernStatus_OnExtraIconClick(int protoIndex)
}
#define TOOLTIP_TOLERANCE 5
-LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam, LPARAM lParam)
+
+LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- static POINT ptToolTipShow = {0};
- switch (msg) {
- case WM_CREATE:
+ static POINT ptToolTipShow = { 0 };
+ switch (msg) {
+ case WM_CREATE:
g_StatusBarData.hTheme = xpt_AddThemeHandle(hwnd, L"STATUS");
break;
@@ -635,55 +643,55 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam, LPARAM lPara
case WM_PAINT:
if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered)
- CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)hwnd,0);
+ CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)hwnd, 0);
else if (GetParent(hwnd) == pcli->hwndContactList && !g_CluiData.fLayered) {
- RECT rc = {0};
+ RECT rc = { 0 };
GetClientRect(hwnd, &rc);
rc.right++;
rc.bottom++;
HDC hdc = GetDC(hwnd);
HDC hdc2 = CreateCompatibleDC(hdc);
HBITMAP hbmp = ske_CreateDIB32(rc.right, rc.bottom);
- HBITMAP hbmpo = (HBITMAP)SelectObject(hdc2, hbmp);
- SetBkMode(hdc2,TRANSPARENT);
+ HBITMAP hbmpo = (HBITMAP)SelectObject(hdc2, hbmp);
+ SetBkMode(hdc2, TRANSPARENT);
ske_BltBackImage(hwnd, hdc2, &rc);
- ModernDrawStatusBarWorker(hwnd,hdc2);
- BitBlt(hdc, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, hdc2, rc.left, rc.top, SRCCOPY);
+ ModernDrawStatusBarWorker(hwnd, hdc2);
+ BitBlt(hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, hdc2, rc.left, rc.top, SRCCOPY);
SelectObject(hdc2, hbmpo);
DeleteObject(hbmp);
DeleteDC(hdc2);
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
- ReleaseDC(hwnd,hdc);
- ValidateRect(hwnd,NULL);
+ SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
+ ReleaseDC(hwnd, hdc);
+ ValidateRect(hwnd, NULL);
}
else {
RECT rc;
- GetClientRect(hwnd,&rc);
+ GetClientRect(hwnd, &rc);
PAINTSTRUCT ps;
- HDC hdc = BeginPaint(hwnd,&ps);
+ HDC hdc = BeginPaint(hwnd, &ps);
HDC hdc2 = CreateCompatibleDC(hdc);
- HBITMAP hbmp = ske_CreateDIB32(rc.right,rc.bottom);
- HBITMAP hbmpo = (HBITMAP) SelectObject(hdc2,hbmp);
+ HBITMAP hbmp = ske_CreateDIB32(rc.right, rc.bottom);
+ HBITMAP hbmpo = (HBITMAP)SelectObject(hdc2, hbmp);
HBRUSH br = GetSysColorBrush(COLOR_3DFACE);
- FillRect(hdc2,&ps.rcPaint,br);
- ModernDrawStatusBarWorker(hwnd,hdc2);
- BitBlt(hdc,ps.rcPaint.left,ps.rcPaint.top,ps.rcPaint.right-ps.rcPaint.left,ps.rcPaint.bottom-ps.rcPaint.top,
- hdc2,ps.rcPaint.left,ps.rcPaint.top,SRCCOPY);
- SelectObject(hdc2,hbmpo);
+ FillRect(hdc2, &ps.rcPaint, br);
+ ModernDrawStatusBarWorker(hwnd, hdc2);
+ BitBlt(hdc, ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top,
+ hdc2, ps.rcPaint.left, ps.rcPaint.top, SRCCOPY);
+ SelectObject(hdc2, hbmpo);
DeleteObject(hbmp);
DeleteDC(hdc2);
ps.fErase = FALSE;
- EndPaint(hwnd,&ps);
+ EndPaint(hwnd, &ps);
}
return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_GETMINMAXINFO:
{
RECT rct;
- GetWindowRect(hwnd,&rct);
+ GetWindowRect(hwnd, &rct);
memset((LPMINMAXINFO)lParam, 0, sizeof(MINMAXINFO));
((LPMINMAXINFO)lParam)->ptMinTrackSize.x = 16;
((LPMINMAXINFO)lParam)->ptMinTrackSize.y = 16;
@@ -693,23 +701,23 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam, LPARAM lPara
return 0;
case WM_SHOWWINDOW:
+ if (tooltipshoing) {
+ NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip, 0, 0);
+ tooltipshoing = FALSE;
+ }
{
- if (tooltipshoing) {
- NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip, 0, 0);
- tooltipshoing = FALSE;
- }
int ID = Sync(FindFrameID, hwnd);
if (ID) {
- int res = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS,ID),0);
+ int res = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, ID), 0);
if (res >= 0)
- db_set_b(0, "CLUI","ShowSBar",(BYTE)(wParam/*(res&F_VISIBLE)*/?1:0));
+ db_set_b(0, "CLUI", "ShowSBar", (BYTE)(wParam/*(res&F_VISIBLE)*/ ? 1 : 0));
}
}
break;
case WM_TIMER:
if (wParam == TM_STATUSBARHIDE) {
- KillTimer(hwnd,TM_STATUSBARHIDE);
+ KillTimer(hwnd, TM_STATUSBARHIDE);
if (tooltipshoing) {
NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip, 0, 0);
tooltipshoing = FALSE;
@@ -718,18 +726,18 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam, LPARAM lPara
}
else if (wParam == TM_STATUSBAR) {
POINT pt;
- KillTimer(hwnd,TM_STATUSBAR);
+ KillTimer(hwnd, TM_STATUSBAR);
GetCursorPos(&pt);
if (pt.x == lastpnt.x && pt.y == lastpnt.y) {
RECT rc;
ScreenToClient(hwnd, &pt);
- for (int i=0; i < ProtosData.getCount(); i++) {
+ for (int i = 0; i < ProtosData.getCount(); i++) {
rc = ProtosData[i].protoRect;
- if (PtInRect(&rc,pt)) {
- NotifyEventHooks(g_CluiData.hEventStatusBarShowToolTip,(WPARAM)ProtosData[i].AccountName,0);
- CLUI_SafeSetTimer(hwnd,TM_STATUSBARHIDE,db_get_w(NULL,"CLUIFrames","HideToolTipTime",SETTING_HIDETOOLTIPTIME_DEFAULT),0);
+ if (PtInRect(&rc, pt)) {
+ NotifyEventHooks(g_CluiData.hEventStatusBarShowToolTip, (WPARAM)ProtosData[i].szAccountName, 0);
+ CLUI_SafeSetTimer(hwnd, TM_STATUSBARHIDE, db_get_w(NULL, "CLUIFrames", "HideToolTipTime", SETTING_HIDETOOLTIPTIME_DEFAULT), 0);
tooltipshoing = TRUE;
- ClientToScreen(hwnd,&pt);
+ ClientToScreen(hwnd, &pt);
ptToolTipShow = pt;
SetCapture(hwnd);
return 0;
@@ -744,8 +752,8 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam, LPARAM lPara
if (tooltipshoing) {
POINT pt;
GetCursorPos(&pt);
- if ( abs(pt.x-ptToolTipShow.x) > TOOLTIP_TOLERANCE || abs(pt.y-ptToolTipShow.y) > TOOLTIP_TOLERANCE) {
- KillTimer(hwnd,TM_STATUSBARHIDE);
+ if (abs(pt.x - ptToolTipShow.x) > TOOLTIP_TOLERANCE || abs(pt.y - ptToolTipShow.y) > TOOLTIP_TOLERANCE) {
+ KillTimer(hwnd, TM_STATUSBARHIDE);
NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip, 0, 0);
tooltipshoing = FALSE;
ReleaseCapture();
@@ -754,173 +762,171 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam, LPARAM lPara
break;
case WM_SETCURSOR:
- if (g_CluiData.bBehindEdgeSettings) CLUI_UpdateTimer(0);
+ if (g_CluiData.bBehindEdgeSettings) CLUI_UpdateTimer(0);
{
POINT pt;
GetCursorPos(&pt);
- SendMessage(GetParent(hwnd),msg,wParam,lParam);
+ SendMessage(GetParent(hwnd), msg, wParam, lParam);
if (pt.x == lastpnt.x && pt.y == lastpnt.y)
return(CLUI_TestCursorOnBorders());
lastpnt = pt;
if (tooltipshoing)
- if ( abs(pt.x-ptToolTipShow.x) > TOOLTIP_TOLERANCE || abs(pt.y-ptToolTipShow.y) > TOOLTIP_TOLERANCE) {
- KillTimer(hwnd,TM_STATUSBARHIDE);
+ if (abs(pt.x - ptToolTipShow.x) > TOOLTIP_TOLERANCE || abs(pt.y - ptToolTipShow.y) > TOOLTIP_TOLERANCE) {
+ KillTimer(hwnd, TM_STATUSBARHIDE);
NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip, 0, 0);
tooltipshoing = FALSE;
ReleaseCapture();
}
- KillTimer(hwnd,TM_STATUSBAR);
- CLUI_SafeSetTimer(hwnd, TM_STATUSBAR, db_get_w(NULL,"CLC","InfoTipHoverTime", CLCDEFAULT_INFOTIPTIME),0);
+ KillTimer(hwnd, TM_STATUSBAR);
+ CLUI_SafeSetTimer(hwnd, TM_STATUSBAR, db_get_w(NULL, "CLC", "InfoTipHoverTime", CLCDEFAULT_INFOTIPTIME), 0);
}
return CLUI_TestCursorOnBorders();
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
- {
- RECT rc;
- POINT pt = UNPACK_POINT(lParam);
- KillTimer(hwnd,TM_STATUSBARHIDE);
- KillTimer(hwnd,TM_STATUSBAR);
-
- if (tooltipshoing)
- NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip, 0, 0);
-
- tooltipshoing = FALSE;
- for (int i=0; i < ProtosData.getCount(); i++) {
- ProtoItemData& p = ProtosData[i];
- BOOL isOnExtra = FALSE;
-
- rc = p.protoRect;
- RECT rc1 = rc;
- rc1.left = rc.left+16;
- rc1.right = rc1.left+16;
- if ( PtInRect(&rc, pt) && PtInRect(&rc1,pt) && p.DoubleIcons)
- isOnExtra = TRUE;
-
- if ( PtInRect(&rc,pt)) {
- HMENU hMenu = NULL;
-
- BOOL bShift = ( GetKeyState( VK_SHIFT ) & 0x8000);
- BOOL bCtrl = ( GetKeyState( VK_CONTROL ) & 0x8000);
-
- if ((msg == WM_MBUTTONDOWN || (msg == WM_RBUTTONDOWN && bCtrl) || isOnExtra) && _ModernStatus_OnExtraIconClick( i ))
- return TRUE;
-
- if (msg == WM_LBUTTONDOWN && bCtrl) {
- if ( g_CluiData.bFilterEffective != CLVM_FILTER_PROTOS || !bShift ) {
- ApplyViewMode("");
- mir_snprintf( g_CluiData.protoFilter, SIZEOF(g_CluiData.protoFilter), "%s|", p.AccountName );
- g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
+ RECT rc;
+ POINT pt = UNPACK_POINT(lParam);
+ KillTimer(hwnd, TM_STATUSBARHIDE);
+ KillTimer(hwnd, TM_STATUSBAR);
+
+ if (tooltipshoing)
+ NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip, 0, 0);
+
+ tooltipshoing = FALSE;
+ for (int i = 0; i < ProtosData.getCount(); i++) {
+ ProtoItemData& p = ProtosData[i];
+ bool isOnExtra = false;
+
+ rc = p.protoRect;
+ RECT rc1 = rc;
+ rc1.left = rc.left + 16;
+ rc1.right = rc1.left + 16;
+ if (PtInRect(&rc, pt) && PtInRect(&rc1, pt) && p.bDoubleIcons)
+ isOnExtra = true;
+
+ if (PtInRect(&rc, pt)) {
+ HMENU hMenu = NULL;
+
+ BOOL bShift = (GetKeyState(VK_SHIFT) & 0x8000);
+ BOOL bCtrl = (GetKeyState(VK_CONTROL) & 0x8000);
+
+ if ((msg == WM_MBUTTONDOWN || (msg == WM_RBUTTONDOWN && bCtrl) || isOnExtra) && _ModernStatus_OnExtraIconClick(i))
+ return TRUE;
+
+ if (msg == WM_LBUTTONDOWN && bCtrl) {
+ if (g_CluiData.bFilterEffective != CLVM_FILTER_PROTOS || !bShift) {
+ ApplyViewMode("");
+ mir_snprintf(g_CluiData.protoFilter, SIZEOF(g_CluiData.protoFilter), "%s|", p.szAccountName);
+ g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
+ }
+ else {
+ char protoF[sizeof(g_CluiData.protoFilter)];
+ mir_snprintf(protoF, SIZEOF(protoF), "%s|", p.szAccountName);
+ char *pos = strstri(g_CluiData.protoFilter, p.szAccountName);
+ if (pos) {
+ // remove filter
+ int len = strlen(protoF);
+ memmove(pos, pos + len, strlen(pos + len) + 1);
+
+ if (strlen(g_CluiData.protoFilter) == 0)
+ ApplyViewMode("");
+ else
+ g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
}
else {
- char protoF[ sizeof(g_CluiData.protoFilter) ];
- mir_snprintf( protoF, SIZEOF(protoF), "%s|", p.AccountName );
- char *pos = strstri( g_CluiData.protoFilter, p.AccountName );
- if (pos) {
- // remove filter
- int len = strlen( protoF );
- memmove( pos, pos + len, strlen( pos + len ) + 1 );
-
- if ( strlen( g_CluiData.protoFilter ) == 0 )
- ApplyViewMode("");
- else
- g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
- }
- else {
- //add filter
- mir_snprintf( g_CluiData.protoFilter, SIZEOF(g_CluiData.protoFilter), "%s%s", g_CluiData.protoFilter, protoF );
- g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
- }
+ //add filter
+ mir_snprintf(g_CluiData.protoFilter, SIZEOF(g_CluiData.protoFilter), "%s%s", g_CluiData.protoFilter, protoF);
+ g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
}
+ }
- if (g_CluiData.bFilterEffective == CLVM_FILTER_PROTOS) {
- char filterName[ sizeof(g_CluiData.protoFilter) ] = { 0 };
- filterName[0] = (char)13;
-
- int protoCount;
- PROTOACCOUNT ** accs;
- ProtoEnumAccounts( &protoCount, &accs );
-
- bool first = true;
- for (int pos = 0; pos < protoCount; pos++) {
- int i = pcli->pfnGetAccountIndexByPos( pos );
- if ( i < 0 && i >= protoCount )
- continue;
-
- char protoF[ sizeof(g_CluiData.protoFilter) ];
- mir_snprintf( protoF, SIZEOF(protoF), "%s|", accs[i]->szModuleName );
- if ( strstri(g_CluiData.protoFilter, protoF)) {
- char * temp = mir_utf8encodeT( accs[i]->tszAccountName );
- if (!first )
- strncat( filterName, "; ", SIZEOF(filterName) - strlen(filterName));
- strncat( filterName, temp, SIZEOF(filterName) - strlen(filterName));
- first = false;
- mir_free( temp );
- }
+ if (g_CluiData.bFilterEffective == CLVM_FILTER_PROTOS) {
+ char filterName[sizeof(g_CluiData.protoFilter)] = { 0 };
+ filterName[0] = (char)13;
+
+ int protoCount;
+ PROTOACCOUNT **accs;
+ ProtoEnumAccounts(&protoCount, &accs);
+
+ bool first = true;
+ for (int pos = 0; pos < protoCount; pos++) {
+ int i = pcli->pfnGetAccountIndexByPos(pos);
+ if (i < 0 && i >= protoCount)
+ continue;
+
+ char protoF[sizeof(g_CluiData.protoFilter)];
+ mir_snprintf(protoF, SIZEOF(protoF), "%s|", accs[i]->szModuleName);
+ if (strstri(g_CluiData.protoFilter, protoF)) {
+ char * temp = mir_utf8encodeT(accs[i]->tszAccountName);
+ if (!first)
+ strncat(filterName, "; ", SIZEOF(filterName) - strlen(filterName));
+ strncat(filterName, temp, SIZEOF(filterName) - strlen(filterName));
+ first = false;
+ mir_free(temp);
}
+ }
- SaveViewMode( filterName, _T(""), g_CluiData.protoFilter, 0, -1, 0, 0, 0, 0 );
+ SaveViewMode(filterName, _T(""), g_CluiData.protoFilter, 0, -1, 0, 0, 0, 0);
- ApplyViewMode( filterName );
- }
- pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
- CLUI__cliInvalidateRect( hwnd, NULL, FALSE );
- SetCapture( NULL );
- return 0;
+ ApplyViewMode(filterName);
}
+ pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
+ CLUI__cliInvalidateRect(hwnd, NULL, FALSE);
+ SetCapture(NULL);
+ return 0;
+ }
- if (!hMenu) {
- if (msg == WM_RBUTTONDOWN) {
- BOOL a = ((g_StatusBarData.perProtoConfig && p.SBarRightClk) || g_StatusBarData.SBarRightClk );
- if ( a ^ bShift )
- hMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
- else
- hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
- }
- else {
- hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
- unsigned int cpnl = 0;
- int mcnt = GetMenuItemCount(hMenu);
- for (int j = 0; j < mcnt; ++j) {
- HMENU hMenus = GetSubMenu(hMenu, j);
- if (hMenus && cpnl++ == i) {
- hMenu = hMenus;
- break;
- }
+ if (!hMenu) {
+ if (msg == WM_RBUTTONDOWN) {
+ BOOL a = ((g_StatusBarData.perProtoConfig && p.SBarRightClk) || g_StatusBarData.SBarRightClk);
+ if (a ^ bShift)
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
+ else
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
+ }
+ else {
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
+ unsigned int cpnl = 0;
+ int mcnt = GetMenuItemCount(hMenu);
+ for (int j = 0; j < mcnt; ++j) {
+ HMENU hMenus = GetSubMenu(hMenu, j);
+ if (hMenus && cpnl++ == i) {
+ hMenu = hMenus;
+ break;
}
}
}
-
- ClientToScreen(hwnd,&pt);
-
- HWND parent = GetParent(hwnd);
- if (parent != pcli->hwndContactList) parent = GetParent(parent);
- TrackPopupMenu(hMenu,TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON,pt.x,pt.y, 0, parent,NULL);
- return 0;
}
- }
- GetClientRect(hwnd, &rc);
- if ( PtInRect( &rc, pt ) && msg == WM_LBUTTONDOWN && g_CluiData.bFilterEffective == CLVM_FILTER_PROTOS) {
- ApplyViewMode("");
- CLUI__cliInvalidateRect( hwnd, NULL, FALSE );
- SetCapture( NULL );
+ ClientToScreen(hwnd, &pt);
+
+ HWND parent = GetParent(hwnd);
+ if (parent != pcli->hwndContactList) parent = GetParent(parent);
+ TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, parent, NULL);
return 0;
}
- return SendMessage(GetParent(hwnd), msg, wParam, lParam);
}
+
+ GetClientRect(hwnd, &rc);
+ if (PtInRect(&rc, pt) && msg == WM_LBUTTONDOWN && g_CluiData.bFilterEffective == CLVM_FILTER_PROTOS) {
+ ApplyViewMode("");
+ CLUI__cliInvalidateRect(hwnd, NULL, FALSE);
+ SetCapture(NULL);
+ return 0;
+ }
+ return SendMessage(GetParent(hwnd), msg, wParam, lParam);
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
HWND StatusBar_Create(HWND parent)
{
- WNDCLASS wndclass = {0};
+ WNDCLASS wndclass = { 0 };
TCHAR pluginname[] = _T("ModernStatusBar");
- int h = GetSystemMetrics(SM_CYSMICON)+2;
- if ( GetClassInfo(g_hInst, pluginname, &wndclass) == 0) {
+ int h = GetSystemMetrics(SM_CYSMICON) + 2;
+ if (GetClassInfo(g_hInst, pluginname, &wndclass) == 0) {
wndclass.lpfnWndProc = ModernStatusProc;
wndclass.hInstance = g_hInst;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
@@ -935,18 +941,18 @@ HWND StatusBar_Create(HWND parent)
CLISTFrame Frame = { sizeof(Frame) };
Frame.hWnd = hModernStatusBar;
Frame.align = alBottom;
- Frame.hIcon = LoadSkinnedIcon (SKINICON_OTHER_FRAME);
+ Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
Frame.Flags = F_LOCKED | F_NOBORDER | F_NO_SUBCONTAINER | F_TCHAR;
- if ( db_get_b(NULL, "CLUI", "ShowSBar", SETTING_SHOWSBAR_DEFAULT))
+ if (db_get_b(NULL, "CLUI", "ShowSBar", SETTING_SHOWSBAR_DEFAULT))
Frame.Flags |= F_VISIBLE;
Frame.height = h;
Frame.tname = _T("Status Bar");
Frame.TBtname = TranslateT("Status Bar");
- hFramehModernStatusBar = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,0);
- CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)Frame.hWnd,(LPARAM)NewStatusPaintCallbackProc); //$$$$$ register sub for frame
+ hFramehModernStatusBar = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+ CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)Frame.hWnd, (LPARAM)NewStatusPaintCallbackProc); //$$$$$ register sub for frame
LoadStatusBarData();
cliCluiProtocolStatusChanged(0, 0);
- CallService(MS_CLIST_FRAMES_UPDATEFRAME,-1,0);
+ CallService(MS_CLIST_FRAMES_UPDATEFRAME, -1, 0);
return hModernStatusBar;
}
diff --git a/plugins/Clist_modern/src/version.h b/plugins/Clist_modern/src/version.h
index d1f5bccbdf..4b2f4379d6 100644
--- a/plugins/Clist_modern/src/version.h
+++ b/plugins/Clist_modern/src/version.h
@@ -1,14 +1,14 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 9
#define __RELEASE_NUM 0
-#define __BUILD_NUM 12
+#define __BUILD_NUM 13
#include <stdver.h>
#define __PLUGIN_NAME "Modern contact list"
#define __FILENAME "Clist_modern.dll"
-#define __DESCRIPTION "Displays contacts, event notifications, protocol status with advantage visual modifications. Supported MW modifications, enhanced metacontact cooperation."
-#define __AUTHOR "Artem Shpynov, Ricardo Pescuma Domenecci and Anton Senko based on clist_mw by Bethoven"
+#define __DESCRIPTION "Displays contacts, event notifications, protocol status with advantage visual modifications. Supported MW modifications, enhanced metacontact cooperation."
+#define __AUTHOR "Artem Shpynov, Ricardo Pescuma Domenecci and Anton Senko based on clist_mw by Bethoven"
#define __AUTHOREMAIL "ashpynov@gmail.com"
-#define __AUTHORWEB "http://miranda-ng.org/p/Clist_modern/"
-#define __COPYRIGHT "Copyright 2000-2010 Miranda-IM project"
+#define __AUTHORWEB "http://miranda-ng.org/p/Clist_modern/"
+#define __COPYRIGHT "Copyright 2000-2010 Miranda-IM project"