From f34c2e508eeaba527009e2b86bf6ef7a09a496bb Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 26 Sep 2013 18:36:45 +0000 Subject: plugins cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@6243 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TipperYM/src/bitmap_func.cpp | 3 +-- plugins/TipperYM/src/message_pump.cpp | 14 ----------- plugins/TipperYM/src/message_pump.h | 6 ----- plugins/TipperYM/src/popwin.cpp | 46 ++++++++++++++++------------------- 4 files changed, 22 insertions(+), 47 deletions(-) (limited to 'plugins/TipperYM') diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp index 16684481f0..e1d20ed86e 100644 --- a/plugins/TipperYM/src/bitmap_func.cpp +++ b/plugins/TipperYM/src/bitmap_func.cpp @@ -314,8 +314,7 @@ void CreateFromBitmaps(bool bServiceTip) skin.hbmpSkinParts[i][j] = NULL; } - if (MyUpdateLayeredWindow) - skin.bNeedLayerUpdate = true; + skin.bNeedLayerUpdate = true; DeleteDC(hdcMem); } diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index 8029b04782..3377994eb6 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -20,11 +20,6 @@ Boston, MA 02111-1307, USA. #include "common.h" -BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD) = 0; -BOOL (WINAPI *MyUpdateLayeredWindow)(HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags) = 0; -BOOL (WINAPI *MyAnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags) = 0; -HMONITOR (WINAPI *MyMonitorFromPoint)(POINT, DWORD); -BOOL (WINAPI *MyGetMonitorInfo)(HMONITOR, LPMONITORINFO); HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind) = 0; unsigned int uintMessagePumpThreadId = 0; @@ -248,15 +243,6 @@ void InitMessagePump() wcl.lpszClassName = POP_WIN_CLASS; RegisterClassEx(&wcl); - HMODULE hUserDll = LoadLibrary(_T("user32.dll")); - if (hUserDll) { - MySetLayeredWindowAttributes = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(hUserDll, "SetLayeredWindowAttributes"); - MyUpdateLayeredWindow = (BOOL (WINAPI *)(HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags))GetProcAddress(hUserDll, "UpdateLayeredWindow"); - MyAnimateWindow =(BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(hUserDll, "AnimateWindow"); - MyMonitorFromPoint = (HMONITOR (WINAPI*)(POINT, DWORD))GetProcAddress(hUserDll, "MonitorFromPoint"); - MyGetMonitorInfo = (BOOL (WINAPI*)(HMONITOR, LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfoW"); - } - HMODULE hDwmapiDll = LoadLibrary(_T("dwmapi.dll")); if (hDwmapiDll) MyDwmEnableBlurBehindWindow = (HRESULT (WINAPI *)(HWND, DWM_BLURBEHIND *))GetProcAddress(hDwmapiDll, "DwmEnableBlurBehindWindow"); diff --git a/plugins/TipperYM/src/message_pump.h b/plugins/TipperYM/src/message_pump.h index a8858e3865..e155373e84 100644 --- a/plugins/TipperYM/src/message_pump.h +++ b/plugins/TipperYM/src/message_pump.h @@ -29,12 +29,6 @@ Boston, MA 02111-1307, USA. #define MUM_GOTAVATAR (WM_USER + 0x014) #define MUM_GOTXSTATUS (WM_USER + 0x015) -extern BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD); -extern BOOL (WINAPI *MyUpdateLayeredWindow)(HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags); -extern BOOL (WINAPI *MyAnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags); -extern HMONITOR (WINAPI *MyMonitorFromPoint)(POINT, DWORD); -extern BOOL (WINAPI *MyGetMonitorInfo)(HMONITOR, LPMONITORINFO); - #define DWM_BB_ENABLE 0x00000001 #define DWM_BB_BLURREGION 0x00000002 #define DWM_BB_TRANSITIONONMAXIMIZED 0x00000004 diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index de6b1abedc..771a87d29a 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -415,8 +415,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa else SetClassLongPtr(hwnd, GCL_STYLE, 0); - if (!skin.bNeedLayerUpdate && MySetLayeredWindowAttributes) - MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), 0, LWA_ALPHA); + if (!skin.bNeedLayerUpdate) + SetLayeredWindowAttributes(hwnd, RGB(0,0,0), 0, LWA_ALPHA); if (opt.showEffect) SetTimer(hwnd, ID_TIMER_ANIMATE, ANIM_ELAPSE, 0); @@ -708,7 +708,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa POINT ptSrc = {0, 0}; SIZE szTip = {r.right - r.left, r.bottom - r.top}; blend.SourceConstantAlpha = pwd->iTrans; - MyUpdateLayeredWindow(hwnd, NULL, NULL, &szTip, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA); + UpdateLayeredWindow(hwnd, NULL, NULL, &szTip, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA); if (opt.bAeroGlass && MyDwmEnableBlurBehindWindow) { DWM_BLURBEHIND bb = {0}; @@ -718,8 +718,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa MyDwmEnableBlurBehindWindow(hwnd, &bb); } } - else if (MySetLayeredWindowAttributes) - MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), pwd->iTrans, LWA_ALPHA); + else + SetLayeredWindowAttributes(hwnd, RGB(0,0,0), pwd->iTrans, LWA_ALPHA); } SelectObject(hdc, hOldFont); @@ -880,15 +880,15 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa blend.AlphaFormat = AC_SRC_ALPHA; while (blend.SourceConstantAlpha != 0) { - MyUpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA); + UpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA); blend.SourceConstantAlpha = max(blend.SourceConstantAlpha - opt.iAnimateSpeed, 0); Sleep(ANIM_ELAPSE); } } - else if (MySetLayeredWindowAttributes) { + else { int iTrans = pwd->iTrans; while (iTrans != 0) { - MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), iTrans, LWA_ALPHA); + SetLayeredWindowAttributes(hwnd, RGB(0,0,0), iTrans, LWA_ALPHA); iTrans = max(iTrans - opt.iAnimateSpeed, 0); Sleep(ANIM_ELAPSE); } @@ -1018,10 +1018,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa blend.SourceConstantAlpha = 0; blend.AlphaFormat = AC_SRC_ALPHA; - MyUpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA); + UpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA); } - else if (MySetLayeredWindowAttributes) - MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), 0, LWA_ALPHA); + else + SetLayeredWindowAttributes(hwnd, RGB(0,0,0), 0, LWA_ALPHA); SendMessage(hwnd, PUM_REFRESHTRAYTIP, 1, 0); SendMessage(hwnd, PUM_GETHEIGHT, 0, 0); @@ -1325,10 +1325,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa pwd->iAnimStep = ANIM_STEPS; } - MyUpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA); + UpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA); } - else if (MySetLayeredWindowAttributes) + else { pwd->iCurrentTrans += opt.iAnimateSpeed; if (pwd->iCurrentTrans > pwd->iTrans) @@ -1337,7 +1337,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa pwd->iAnimStep = ANIM_STEPS; } - MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), pwd->iCurrentTrans, LWA_ALPHA); + SetLayeredWindowAttributes(hwnd, RGB(0,0,0), pwd->iCurrentTrans, LWA_ALPHA); } } @@ -1372,7 +1372,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa blend.SourceConstantAlpha = pwd->iTrans; blend.AlphaFormat = AC_SRC_ALPHA; - MyUpdateLayeredWindow(hwnd, NULL, &ptPos, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA); + UpdateLayeredWindow(hwnd, NULL, &ptPos, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA); } } @@ -1395,8 +1395,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (opt.showEffect == PSE_ANIMATE && pwd->iAnimStep == 1) { - if (MySetLayeredWindowAttributes) - MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), pwd->iTrans, LWA_ALPHA); + SetLayeredWindowAttributes(hwnd, RGB(0,0,0), pwd->iTrans, LWA_ALPHA); } } @@ -1431,14 +1430,11 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa RECT rcWork, rc; SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWork, FALSE); - if (MyMonitorFromPoint) - { - HMONITOR hMon = MyMonitorFromPoint(pwd->clcit.ptCursor, MONITOR_DEFAULTTONEAREST); - MONITORINFO mi; - mi.cbSize = sizeof(mi); - if (MyGetMonitorInfo(hMon, &mi)) - rcWork = mi.rcWork; - } + HMONITOR hMon = MonitorFromPoint(pwd->clcit.ptCursor, MONITOR_DEFAULTTONEAREST); + MONITORINFO mi; + mi.cbSize = sizeof(mi); + if (GetMonitorInfo(hMon, &mi)) + rcWork = mi.rcWork; GetWindowRect(hwnd, &rc); -- cgit v1.2.3