summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/modern_skinbutton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_modern/modern_skinbutton.cpp')
-rw-r--r--plugins/Clist_modern/modern_skinbutton.cpp55
1 files changed, 27 insertions, 28 deletions
diff --git a/plugins/Clist_modern/modern_skinbutton.cpp b/plugins/Clist_modern/modern_skinbutton.cpp
index 4dfd16484c..d4a7dfe5f5 100644
--- a/plugins/Clist_modern/modern_skinbutton.cpp
+++ b/plugins/Clist_modern/modern_skinbutton.cpp
@@ -85,14 +85,13 @@ int ModernSkinButtonLoadModule()
wc.style = CS_GLOBALCLASS;
RegisterClassEx(&wc);
InitializeCriticalSection(&csTips);
- hookSystemShutdown_ModernSkinButton = ModernHookEvent(ME_SYSTEM_SHUTDOWN, ModernSkinButtonUnloadModule);
+ hookSystemShutdown_ModernSkinButton = HookEvent(ME_SYSTEM_SHUTDOWN, ModernSkinButtonUnloadModule);
ModernSkinButtonModuleIsLoaded = TRUE;
return 0;
}
int ModernSkinButtonUnloadModule(WPARAM wParam, LPARAM lParam)
{
- ModernUnhookEvent(hookSystemShutdown_ModernSkinButton);
DeleteCriticalSection(&csTips);
return 0;
}
@@ -104,9 +103,9 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
RECT rc;
HDC sdc = NULL;
ModernSkinButtonCtrl* bct = (ModernSkinButtonCtrl *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (!bct) return 0;
- if (!IsWindowVisible(hwnd)) return 0;
- if (!whdc && !g_CluiData.fLayered) InvalidateRect(hwnd,NULL,FALSE);
+ if ( !bct) return 0;
+ if ( !IsWindowVisible(hwnd)) return 0;
+ if ( !whdc && !g_CluiData.fLayered) InvalidateRect(hwnd,NULL,FALSE);
if (whdc && g_CluiData.fLayered) hdc = whdc;
else
@@ -117,7 +116,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
GetClientRect(hwnd,&rc);
bmp = ske_CreateDIB32(rc.right,rc.bottom);
oldbmp = (HBITMAP)SelectObject(hdc,bmp);
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
ske_BltBackImage(bct->hwnd,hdc,NULL);
{
MODERNMASK Request = {0};
@@ -146,7 +145,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
case 's':
{
Value = db_get_sa(NULL,section,key);
- if (!Value)
+ if ( !Value)
Value = mir_strdup(bct->ValueTypeDef+1);
break;
}
@@ -181,7 +180,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
// DeleteObject(br);
}
- if (!whdc && g_CluiData.fLayered)
+ if ( !whdc && g_CluiData.fLayered)
{
RECT r;
SetRect(&r,bct->Left,bct->Top,bct->Right,bct->Bottom);
@@ -196,7 +195,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
}
SelectObject(hdc,oldbmp);
DeleteObject(bmp);
- if (!whdc || !g_CluiData.fLayered)
+ if ( !whdc || !g_CluiData.fLayered)
{
SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
mod_DeleteDC(hdc);
@@ -243,7 +242,7 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection,char *ValueTypeDe
switch (ValueTypeDef[0]) {
case 's':
Value = db_get_sa(NULL,section,key);
- if (!Value || (Value && mir_bool_strcmpi(Value,val2)))
+ if ( !Value || (Value && mir_bool_strcmpi(Value,val2)))
Value = mir_strdup(val);
else
Value = mir_strdup(val2);
@@ -312,7 +311,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
_skipblank(param1);
if (strlen(param1) == 0) param1 = NULL;
}
- if (!pszService) return 0;
+ if ( !pszService) return 0;
if (strlen(pszService) == 0) {
mir_free(pszService);
return 0;
@@ -339,7 +338,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
param1 = param2;
param2 = NULL;
}
- if (!ServiceExists(pszService))
+ if ( !ServiceExists(pszService))
{
result = 0;
}
@@ -463,7 +462,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM
// }
case WM_MOUSEMOVE:
{
- if (!bct->hover)
+ if ( !bct->hover)
{
SetCapture(bct->hwnd);
bct->hover = 1;
@@ -499,7 +498,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM
if (bct->CommandService)
{
- if (!_CallServiceStrParams(bct->CommandService, NULL) && (bct->ValueDBSection && bct->ValueTypeDef))
+ if ( !_CallServiceStrParams(bct->CommandService, NULL) && (bct->ValueDBSection && bct->ValueTypeDef))
ModernSkinButtonToggleDBValue(bct->ValueDBSection,bct->ValueTypeDef);
}
bct->down = 0;
@@ -536,9 +535,9 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM
HWND SetToolTip(HWND hwnd, TCHAR * tip)
{
TOOLINFO ti;
- if (!tip) return 0;
+ if ( !tip) return 0;
EnterCriticalSection(&csTips);
- if (!hwndToolTips) {
+ if ( !hwndToolTips) {
// hwndToolTips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""), WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandle(NULL), NULL);
hwndToolTips = CreateWindowEx(0, TOOLTIPS_CLASS, NULL,
@@ -601,9 +600,9 @@ int ModernSkinButton_AddButton(HWND parent,
char * TypeDef,
int MinWidth, int MinHeight)
{
- // if (!parent) return 0;
- if (!ModernSkinButtonModuleIsLoaded) return 0;
- if (!Buttons)
+ // if ( !parent) return 0;
+ if ( !ModernSkinButtonModuleIsLoaded) return 0;
+ if ( !Buttons)
Buttons = (MButton*)mir_alloc(sizeof(MButton));
else
Buttons = (MButton*)mir_realloc(Buttons,sizeof(MButton)*(ButtonsCount+1));
@@ -662,11 +661,11 @@ int ModernSkinButton_AddButton(HWND parent,
static int ModernSkinButtonErase(int l,int t,int r, int b)
{
DWORD i;
- if (!ModernSkinButtonModuleIsLoaded) return 0;
- if (!g_CluiData.fLayered) return 0;
- if (!g_pCachedWindow) return 0;
- if (!g_pCachedWindow->hImageDC || !g_pCachedWindow->hBackDC) return 0;
- if (!(l || r || t || b))
+ if ( !ModernSkinButtonModuleIsLoaded) return 0;
+ if ( !g_CluiData.fLayered) return 0;
+ if ( !g_pCachedWindow) return 0;
+ if ( !g_pCachedWindow->hImageDC || !g_pCachedWindow->hBackDC) return 0;
+ if ( !(l || r || t || b))
{
for (i=0; i < ButtonsCount; i++)
{
@@ -706,7 +705,7 @@ static HWND ModernSkinButtonCreateWindow(ModernSkinButtonCtrl * bct, HWND parent
int ModernSkinButtonRedrawAll(HDC hdc)
{
DWORD i;
- if (!ModernSkinButtonModuleIsLoaded) return 0;
+ if ( !ModernSkinButtonModuleIsLoaded) return 0;
g_mutex_bLockUpdating++;
for (i=0; i < ButtonsCount; i++)
{
@@ -720,7 +719,7 @@ int ModernSkinButtonRedrawAll(HDC hdc)
int ModernSkinButtonDeleteAll()
{
- if (!ModernSkinButtonModuleIsLoaded)
+ if ( !ModernSkinButtonModuleIsLoaded)
return 0;
for (size_t i=0; i < ButtonsCount; i++)
@@ -740,10 +739,10 @@ int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT * r)
RECT rd;
BOOL altDraw = FALSE;
static SIZE oldWndSize = {0};
- if (!ModernSkinButtonModuleIsLoaded) return 0;
+ if ( !ModernSkinButtonModuleIsLoaded) return 0;
GetWindowRect(parent,&rd);
GetClientRect(parent,&clr);
- if (!r)
+ if ( !r)
GetWindowRect(parent,&rc);
else
rc = *r;