diff options
author | George Hazan <george.hazan@gmail.com> | 2015-01-02 19:26:45 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-01-02 19:26:45 +0000 |
commit | 006238c7b97bd68b99667146f1b5df1f3661f470 (patch) | |
tree | 4866a23bc9ff153fa1bdd8ebf8ce841fa37a163e | |
parent | 0b3fe08754bb75dfa1552441bc2bfa958eaa3790 (diff) |
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@11725 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Clist_nicer/src/statusbar.cpp | 37 | ||||
-rw-r--r-- | src/modules/database/dbintf.cpp | 20 |
2 files changed, 25 insertions, 32 deletions
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index 2824e378d0..4f3e17f25a 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -25,40 +25,35 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <commonheaders.h>
#include "../CLUIFrames/cluiframes.h"
-static POINT ptMouse = {0};
-static RECT rcMouse = {0};
+static POINT ptMouse = { 0 };
+static RECT rcMouse = { 0 };
static int timer_set = 0, tooltip_active = 0;
extern HANDLE hStatusBarShowToolTipEvent, hStatusBarHideToolTipEvent;
extern HBRUSH g_CLUISkinnedBkColor;
-extern HANDLE (WINAPI *MyOpenThemeData)(HWND, LPCWSTR);
-extern HRESULT (WINAPI *MyCloseThemeData)(HANDLE);
-extern HRESULT (WINAPI *MyDrawThemeBackground)(HANDLE, HDC, int, int, const RECT *, const RECT *);
-
#define TIMERID_HOVER 1000
LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
+ POINT pt;
+
switch (msg) {
case WM_SETCURSOR:
- {
- POINT pt;
- GetCursorPos(&pt);
+ GetCursorPos(&pt);
- SendMessage(GetParent(hwnd), msg, wParam, lParam);
- if (pt.x == ptMouse.x && pt.y == ptMouse.y)
- return 1;//return(TestCursorOnBorders());
+ SendMessage(GetParent(hwnd), msg, wParam, lParam);
+ if (pt.x == ptMouse.x && pt.y == ptMouse.y)
+ return 1;
- ptMouse = pt;
- if (tooltip_active){
- KillTimer(hwnd, TIMERID_HOVER);
- if (!NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0))
- CallService("mToolTip/HideTip", 0, 0);
- tooltip_active = FALSE;
- }
+ ptMouse = pt;
+ if (tooltip_active){
KillTimer(hwnd, TIMERID_HOVER);
- SetTimer(hwnd, TIMERID_HOVER, 750, 0);
+ if (!NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0))
+ CallService("mToolTip/HideTip", 0, 0);
+ tooltip_active = FALSE;
}
+ KillTimer(hwnd, TIMERID_HOVER);
+ SetTimer(hwnd, TIMERID_HOVER, 750, 0);
break;
case WM_NCHITTEST:
@@ -93,7 +88,6 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HDC hdcMem = CreateCompatibleDC(hdc);
RECT rcClient, rcWindow;
DRAWITEMSTRUCT dis = {0};
- POINT pt;
BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
LONG b_offset = cfg::dat.bClipBorder + (windowStyle == SETTING_WINDOWSTYLE_NOBORDER ? 2 : (windowStyle == SETTING_WINDOWSTYLE_THINBORDER ? 1 : 0));
@@ -145,7 +139,6 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_TIMER:
if (wParam == TIMERID_HOVER) {
- POINT pt;
KillTimer(hwnd, TIMERID_HOVER);
GetCursorPos(&pt);
diff --git a/src/modules/database/dbintf.cpp b/src/modules/database/dbintf.cpp index f39e87500d..62b7db18a3 100644 --- a/src/modules/database/dbintf.cpp +++ b/src/modules/database/dbintf.cpp @@ -47,7 +47,7 @@ static INT_PTR srvGetContactCount(WPARAM, LPARAM) static INT_PTR srvDeleteContact(WPARAM wParam, LPARAM)
{
- DBVARIANT dbv = {0};
+ DBVARIANT dbv = { 0 };
if (!db_get_ts(wParam, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
@@ -70,7 +70,7 @@ static INT_PTR srvIsDbContact(WPARAM wParam, LPARAM) ///////////////////////////////////////////////////////////////////////////////
// Module chain
-static INT_PTR srvEnumModuleNames(WPARAM wParam,LPARAM lParam)
+static INT_PTR srvEnumModuleNames(WPARAM wParam, LPARAM lParam)
{
return (currDb) ? (INT_PTR)currDb->EnumModuleNames((DBMODULEENUMPROC)lParam, (void*)wParam) : 0;
}
@@ -78,12 +78,12 @@ static INT_PTR srvEnumModuleNames(WPARAM wParam,LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////
// Settings
-static INT_PTR srvEnumContactSettings(WPARAM wParam,LPARAM lParam)
+static INT_PTR srvEnumContactSettings(WPARAM wParam, LPARAM lParam)
{
return (currDb) ? (INT_PTR)currDb->EnumContactSettings(wParam, (DBCONTACTENUMSETTINGS*)lParam) : 0;
}
-static INT_PTR srvEnumResidentSettings(WPARAM wParam,LPARAM lParam)
+static INT_PTR srvEnumResidentSettings(WPARAM wParam, LPARAM lParam)
{
return (currDb) ? (INT_PTR)currDb->EnumResidentSettings((DBMODULEENUMPROC)wParam, (void*)lParam) : 0;
}
@@ -93,7 +93,7 @@ static INT_PTR srvEnumResidentSettings(WPARAM wParam,LPARAM lParam) LIST<DATABASELINK> arDbPlugins(5);
-static INT_PTR srvRegisterPlugin(WPARAM wParam,LPARAM lParam)
+static INT_PTR srvRegisterPlugin(WPARAM wParam, LPARAM lParam)
{
DATABASELINK* pPlug = (DATABASELINK*)lParam;
if (pPlug == NULL)
@@ -103,9 +103,9 @@ static INT_PTR srvRegisterPlugin(WPARAM wParam,LPARAM lParam) return 0;
}
-static INT_PTR srvFindPlugin(WPARAM wParam,LPARAM lParam)
+static INT_PTR srvFindPlugin(WPARAM wParam, LPARAM lParam)
{
- for (int i=arDbPlugins.getCount()-1; i >= 0; i--) {
+ for (int i = arDbPlugins.getCount() - 1; i >= 0; i--) {
int error = arDbPlugins[i]->grokHeader((TCHAR*)lParam);
if (error == ERROR_SUCCESS || error == EGROKPRF_OBSOLETE)
return (INT_PTR)arDbPlugins[i];
@@ -114,12 +114,12 @@ static INT_PTR srvFindPlugin(WPARAM wParam,LPARAM lParam) return NULL;
}
-static INT_PTR srvGetCurrentDb(WPARAM wParam,LPARAM lParam)
+static INT_PTR srvGetCurrentDb(WPARAM wParam, LPARAM lParam)
{
return (INT_PTR)currDb;
}
-static INT_PTR srvInitInstance(WPARAM wParam,LPARAM lParam)
+static INT_PTR srvInitInstance(WPARAM wParam, LPARAM lParam)
{
MIDatabase* pDb = (MIDatabase*)lParam;
if (pDb != NULL)
@@ -127,7 +127,7 @@ static INT_PTR srvInitInstance(WPARAM wParam,LPARAM lParam) return 0;
}
-static INT_PTR srvDestroyInstance(WPARAM wParam,LPARAM lParam)
+static INT_PTR srvDestroyInstance(WPARAM wParam, LPARAM lParam)
{
MIDatabase* pDb = (MIDatabase*)lParam;
if (pDb != NULL) {
|