summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-09-21 12:34:16 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-09-21 12:34:16 +0000
commit97785d35abe98c765a0b879af4b4429492f0947b (patch)
tree5ec30656ec01342f745928695da384bb9013748f
parentdddd0ff9353634d7935b29f81f497df4566085f0 (diff)
using Uxtheme in tabsrmm
git-svn-id: http://svn.miranda-ng.org/main/trunk@6152 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/TabSRMM/src/TSButton.cpp21
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp9
-rw-r--r--plugins/TabSRMM/src/container.cpp43
-rw-r--r--plugins/TabSRMM/src/controls.cpp13
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp33
-rw-r--r--plugins/TabSRMM/src/globals.cpp4
-rw-r--r--plugins/TabSRMM/src/globals.h2
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp7
-rw-r--r--plugins/TabSRMM/src/mim.cpp60
-rw-r--r--plugins/TabSRMM/src/mim.h60
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp9
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp26
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp5
-rw-r--r--plugins/TabSRMM/src/msgs.cpp5
-rw-r--r--plugins/TabSRMM/src/sidebar.cpp16
-rw-r--r--plugins/TabSRMM/src/tabctrl.cpp49
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp2
-rw-r--r--plugins/TabSRMM/src/themes.cpp126
-rw-r--r--plugins/TabSRMM/src/themes.h1
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp9
-rw-r--r--plugins/TabSRMM/src/utils.cpp6
-rw-r--r--plugins/TabSRMM/tabsrmm_10.vcxproj8
-rw-r--r--plugins/TabSRMM/tabsrmm_11.vcxproj8
24 files changed, 161 insertions, 363 deletions
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp
index 8eea888d8f..f5f5fc9c22 100644
--- a/plugins/TabSRMM/src/TSButton.cpp
+++ b/plugins/TabSRMM/src/TSButton.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -165,9 +162,9 @@ flat_themed:
}
if (ctl->hThemeToolbar && ctl->bIsThemed && 1 == dat->pContainer->bTBRenderingMode) {
if (bAero || PluginConfig.m_WinVerMajor >= 6)
- CMimAPI::m_pfnDrawThemeBackground(ctl->hThemeToolbar, hdcMem, 8, RBStateConvert2Flat(state), &rcClient, &rcClient);
+ DrawThemeBackground(ctl->hThemeToolbar, hdcMem, 8, RBStateConvert2Flat(state), &rcClient, &rcClient);
else
- CMimAPI::m_pfnDrawThemeBackground(ctl->hThemeToolbar, hdcMem, TP_BUTTON, TBStateConvert2Flat(state), &rcClient, &rcClient);
+ DrawThemeBackground(ctl->hThemeToolbar, hdcMem, TP_BUTTON, TBStateConvert2Flat(state), &rcClient, &rcClient);
}
else {
CSkin::m_switchBarItem->setAlphaFormat(AC_SRC_ALPHA, state == PBS_HOT ? 220 : 180);
@@ -209,8 +206,8 @@ nonflat_themed:
int state = IsWindowEnabled(ctl->hwnd) ? (ctl->stateId == PBS_NORMAL && ctl->bIsDefault ? PBS_DEFAULTED : ctl->stateId) : PBS_DISABLED;
if (ctl->hThemeButton && ctl->bIsThemed && 0 == PluginConfig.m_fillColor) {
- CMimAPI::m_pfnDrawThemeBackground(ctl->hThemeButton, hdcMem, BP_PUSHBUTTON, state, &rcClient, &rcClient);
- CMimAPI::m_pfnGetThemeBackgroundContentRect(ctl->hThemeToolbar, hdcMem, BP_PUSHBUTTON, PBS_NORMAL, &rcClient, &rcContent);
+ DrawThemeBackground(ctl->hThemeButton, hdcMem, BP_PUSHBUTTON, state, &rcClient, &rcClient);
+ GetThemeBackgroundContentRect(ctl->hThemeToolbar, hdcMem, BP_PUSHBUTTON, PBS_NORMAL, &rcClient, &rcContent);
}
else {
CSkin::m_switchBarItem->setAlphaFormat(AC_SRC_ALPHA, state == PBS_NORMAL ? 140 : 240);
@@ -262,7 +259,7 @@ nonflat_themed:
if (ctl->bDimmed && PluginConfig.m_IdleDetect)
CSkin::DrawDimmedIcon(hdcMem, ix, iy, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, hIconNew, 180);
else {
- if (ctl->stateId != PBS_DISABLED || CMimAPI::m_MyAlphaBlend == 0) {
+ if (ctl->stateId != PBS_DISABLED) {
DrawIconEx(hdcMem, ix, iy, hIconNew, 16, 16, 0, 0, DI_NORMAL);
if (ctl->overlay)
DrawIconEx(hdcMem, ix, iy, ctl->overlay, 16, 16, 0, 0, DI_NORMAL);
@@ -272,7 +269,7 @@ nonflat_themed:
DrawIconEx(hdc_buttonglyph, 0, 0, hIconNew, 16, 16, 0, 0, DI_NORMAL);
if (ctl->overlay)
DrawIconEx(hdc_buttonglyph, 0, 0, ctl->overlay, 16, 16, 0, 0, DI_NORMAL);
- CMimAPI::m_MyAlphaBlend(hdcMem, ix, iy, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, hdc_buttonglyph, 0, 0, 16, 16, bf_buttonglyph);
+ GdiAlphaBlend(hdcMem, ix, iy, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, hdc_buttonglyph, 0, 0, 16, 16, bf_buttonglyph);
}
}
}
@@ -356,7 +353,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
BITMAP bm;
GetObject(ii.hbmColor, sizeof(bm), &bm);
if (bm.bmWidth != PluginConfig.m_smcxicon || bm.bmHeight != PluginConfig.m_smcyicon) {
- HIMAGELIST hImageList = ImageList_Create(PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, PluginConfig.m_bIsXP ? ILC_COLOR32 | ILC_MASK : ILC_COLOR16 | ILC_MASK, 1, 0);
+ HIMAGELIST hImageList = ImageList_Create(PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, ILC_COLOR32 | ILC_MASK, 1, 0);
ImageList_AddIcon(hImageList, (HICON)lParam);
bct->hIconPrivate = ImageList_GetIcon(hImageList, 0, ILD_NORMAL);
ImageList_RemoveAll(hImageList);
@@ -520,7 +517,7 @@ void CustomizeButton(HWND hwndButton)
mir_subclassWindow(hwndButton, TSButtonWndProc);
TSButtonCtrl *bct = (TSButtonCtrl*)GetWindowLongPtr(hwndButton, 0);
- if (bct && M.isVSAPIState())
- bct->hThemeToolbar = (M.isAero() || IsWinVerVistaPlus()) ? CMimAPI::m_pfnOpenThemeData(bct->hwnd, L"MENU") : CMimAPI::m_pfnOpenThemeData(bct->hwnd, L"TOOLBAR");
+ if (bct)
+ bct->hThemeToolbar = (M.isAero() || IsWinVerVistaPlus()) ? OpenThemeData(bct->hwnd, L"MENU") : OpenThemeData(bct->hwnd, L"TOOLBAR");
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index 27b3fa1c16..ea0974c040 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -526,7 +526,7 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat)
POINT ptSplitter;
int splitterY;
BYTE gap = DPISCALEX_S(PluginConfig.g_iButtonsBarGap);
- BOOL isThemed = PluginConfig.m_bIsXP;
+ BOOL isThemed = TRUE;
int cx = 0, cy = 0;
int lcount = LButtonsList->realCount;
int rcount = RButtonsList->realCount;
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index 3ab0d326bd..165af30def 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -240,9 +237,9 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg)
HWND hwndTab = GetParent(hwndDlg);
if (msg == WM_ACTIVATE) {
- if (dat->pContainer->dwFlags & CNT_TRANSPARENCY && CMimAPI::m_pSetLayeredWindowAttributes != NULL) {
+ if (dat->pContainer->dwFlags & CNT_TRANSPARENCY) {
DWORD trans = LOWORD(dat->pContainer->settings->dwTransparency);
- CMimAPI::m_pSetLayeredWindowAttributes(dat->pContainer->hwnd, CSkin::m_ContainerColorKey, (BYTE)trans, (dat->pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
+ SetLayeredWindowAttributes(dat->pContainer->hwnd, CSkin::m_ContainerColorKey, (BYTE)trans, (dat->pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
}
@@ -1957,7 +1954,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
GetMYUIN(dat);
GetMyNick(dat);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETASTHEMEDBTN, PluginConfig.m_bIsXP, 0);
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETASTHEMEDBTN, 1, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETCONTAINER, (LPARAM)dat->pContainer, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETASFLATBTN, FALSE, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETASTOOLBARBUTTON, TRUE, 0);
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 42010b65a1..e40271ac87 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -1085,8 +1082,7 @@ panel_found:
LONG dwNewLeft;
BOOL skinnedMode = bSkinned;
- if (CMimAPI::m_pfnIsThemeActive)
- skinnedMode |= (CMimAPI::m_pfnIsThemeActive() ? 1 : 0);
+ skinnedMode |= (IsThemeActive() ? 1 : 0);
GetWindowRect(hwndDlg, &rc);
@@ -1184,17 +1180,15 @@ panel_found:
int monitorXOffset = 0;
WINDOWPLACEMENT wp = {0};
- if (CMimAPI::m_pfnMonitorFromWindow && CMimAPI::m_pfnGetMonitorInfoA) {
- HMONITOR hMonitor = CMimAPI::m_pfnMonitorFromWindow(hwndDlg, 2);
- if (hMonitor) {
- MONITORINFO mi = { 0 };
- mi.cbSize = sizeof(mi);
- CMimAPI::m_pfnGetMonitorInfoA(hMonitor, &mi);
- rcDesktop = mi.rcWork;
- OffsetRect(&rcDesktop, -mi.rcMonitor.left, -mi.rcMonitor.top);
- monitorXOffset = mi.rcMonitor.left;
- fDesktopValid = TRUE;
- }
+ HMONITOR hMonitor = MonitorFromWindow(hwndDlg, 2);
+ if (hMonitor) {
+ MONITORINFO mi = { 0 };
+ mi.cbSize = sizeof(mi);
+ GetMonitorInfoA(hMonitor, &mi);
+ rcDesktop = mi.rcWork;
+ OffsetRect(&rcDesktop, -mi.rcMonitor.left, -mi.rcMonitor.top);
+ monitorXOffset = mi.rcMonitor.left;
+ fDesktopValid = TRUE;
}
if (!fDesktopValid)
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcDesktop, 0);
@@ -1427,8 +1421,8 @@ panel_found:
if (LOWORD(wParam == WA_INACTIVE) && (HWND)lParam != PluginConfig.g_hwndHotkeyHandler && GetParent((HWND)lParam) != hwndDlg) {
BOOL fTransAllowed = !bSkinned || PluginConfig.m_bIsVista;
- if (pContainer->dwFlags & CNT_TRANSPARENCY && CMimAPI::m_pSetLayeredWindowAttributes != NULL && fTransAllowed) {
- CMimAPI::m_pSetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)HIWORD(pContainer->settings->dwTransparency), (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
+ if (pContainer->dwFlags & CNT_TRANSPARENCY && fTransAllowed) {
+ SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)HIWORD(pContainer->settings->dwTransparency), (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
}
pContainer->hwndSaved = 0;
@@ -1463,9 +1457,9 @@ panel_found:
SendMessage(hwndDlg, WM_SIZE, 0, 0);
}
- if (pContainer->dwFlags & CNT_TRANSPARENCY && CMimAPI::m_pSetLayeredWindowAttributes != NULL && fTransAllowed) {
+ if (pContainer->dwFlags & CNT_TRANSPARENCY && fTransAllowed) {
DWORD trans = LOWORD(pContainer->settings->dwTransparency);
- CMimAPI::m_pSetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)trans, (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
+ SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)trans, (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
if (pContainer->dwFlags & CNT_NEED_UPDATETITLE) {
HANDLE hContact = 0;
@@ -1651,7 +1645,7 @@ panel_found:
pContainer->tBorder_outer_bottom = g_ButtonSet.bottom + M.GetByte((bSkinned ? "S_tborder_outer_bottom" : "tborder_outer_bottom"), 2);
sBarHeight = (UINT)M.GetByte((bSkinned ? "S_sbarheight" : "sbarheight"), 0);
- if (LOBYTE(LOWORD(GetVersion())) >= 5 && CMimAPI::m_pSetLayeredWindowAttributes != NULL) {
+ if (LOBYTE(LOWORD(GetVersion())) >= 5) {
BOOL fTransAllowed = !bSkinned || PluginConfig.m_WinVerMajor >= 6;
DWORD exold;
@@ -1663,7 +1657,7 @@ panel_found:
SetWindowLongPtr(hwndDlg, GWL_EXSTYLE, ex);
if (pContainer->dwFlags & CNT_TRANSPARENCY && fTransAllowed) {
DWORD trans = LOWORD(pContainer->settings->dwTransparency);
- CMimAPI::m_pSetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)trans, (/* pContainer->bSkinned ? LWA_COLORKEY : */ 0) | (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
+ SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)trans, (/* pContainer->bSkinned ? LWA_COLORKEY : */ 0) | (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
}
@@ -2550,9 +2544,6 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg)
void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iCount)
{
- if (CMimAPI::m_MyFlashWindowEx == NULL)
- return;
-
if (pContainer->dwFlags & CNT_NOFLASH) // container should never flash
return;
@@ -2573,7 +2564,7 @@ void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iCount)
fwi.hwnd = pContainer->hwnd;
pContainer->dwFlashingStarted = GetTickCount();
- CMimAPI::m_MyFlashWindowEx(&fwi);
+ FlashWindowEx(&fwi);
}
void TSAPI ReflashContainer(TContainerData *pContainer)
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index 2b20e61e14..f269d6a11d 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -241,7 +238,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
m_rcItem.bottom -= 4;
m_hbmDraw = CSkin::CreateAeroCompatibleBitmap(m_rcItem, nmtb->nmcd.hdc);
m_hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(m_hdcDraw, m_hbmDraw));
- m_hTheme = M.isAero() || M.isVSThemed() ? CMimAPI::m_pfnOpenThemeData(m_hwndToolbar, L"REBAR") : 0;
+ m_hTheme = M.isAero() || M.isVSThemed() ? OpenThemeData(m_hwndToolbar, L"REBAR") : 0;
m_hOldFont = reinterpret_cast<HFONT>(::SelectObject(m_hdcDraw, reinterpret_cast<HFONT>(::GetStockObject(DEFAULT_GUI_FONT))));
if (m_isAero) {
nm->rc.bottom--;
@@ -258,7 +255,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
if (PluginConfig.m_fillColor)
CSkin::FillBack(m_hdcDraw, &m_rcItem);
else if (M.isVSThemed())
- M.m_pfnDrawThemeBackground(m_hTheme, m_hdcDraw, 6, 1, &m_rcItem, &m_rcItem);
+ DrawThemeBackground(m_hTheme, m_hdcDraw, 6, 1, &m_rcItem, &m_rcItem);
else
FillRect(m_hdcDraw, &m_rcItem, GetSysColorBrush(COLOR_3DFACE));
}
@@ -352,7 +349,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
::DeleteDC(m_hdcDraw);
m_hdcDraw = 0;
if (m_hTheme)
- CMimAPI::m_pfnCloseThemeData(m_hTheme);
+ CloseThemeData(m_hTheme);
return(CDRF_SKIPDEFAULT);
}
else
@@ -770,7 +767,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
COLORREF clr = 0;
BOOL bAero = M.isAero();
- HANDLE hTheme = bAero ? CMimAPI::m_pfnOpenThemeData(hWnd, L"ButtonStyle") : 0;
+ HANDLE hTheme = bAero ? OpenThemeData(hWnd, L"ButtonStyle") : 0;
TWindowData *dat = 0;
if (pContainer)
@@ -911,7 +908,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
}
if (hTheme)
- CMimAPI::m_pfnCloseThemeData(hTheme);
+ CloseThemeData(hTheme);
EndPaint(hWnd, &ps);
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 727408080d..dd136f9eb7 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -1227,19 +1224,17 @@ LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, TWindowData *mwda
void TSAPI DM_FreeTheme(TWindowData *dat)
{
if (dat) {
- if (CMimAPI::m_pfnCloseThemeData) {
- if (dat->hTheme) {
- CMimAPI::m_pfnCloseThemeData(dat->hTheme);
- dat->hTheme = 0;
- }
- if (dat->hThemeIP) {
- CMimAPI::m_pfnCloseThemeData(dat->hThemeIP);
- dat->hThemeIP = 0;
- }
- if (dat->hThemeToolbar) {
- CMimAPI::m_pfnCloseThemeData(dat->hThemeToolbar);
- dat->hThemeToolbar = 0;
- }
+ if (dat->hTheme) {
+ CloseThemeData(dat->hTheme);
+ dat->hTheme = 0;
+ }
+ if (dat->hThemeIP) {
+ CloseThemeData(dat->hThemeIP);
+ dat->hThemeIP = 0;
+ }
+ if (dat->hThemeToolbar) {
+ CloseThemeData(dat->hThemeToolbar);
+ dat->hThemeToolbar = 0;
}
}
}
@@ -1251,7 +1246,7 @@ LRESULT TSAPI DM_ThemeChanged(TWindowData *dat)
HWND hwnd = dat->hwnd;
- dat->hTheme = (M.isVSAPIState() && CMimAPI::m_pfnOpenThemeData) ? CMimAPI::m_pfnOpenThemeData(hwnd, L"EDIT") : 0;
+ dat->hTheme = OpenThemeData(hwnd, L"EDIT");
if (dat->bType == SESSIONTYPE_IM) {
if (dat->hTheme != 0 || (CSkin::m_skinEnabled && !item_log->IGNORED))
@@ -1267,8 +1262,8 @@ LRESULT TSAPI DM_ThemeChanged(TWindowData *dat)
if (dat->hTheme != 0 || (CSkin::m_skinEnabled && !item_msg->IGNORED))
SetWindowLongPtr(GetDlgItem(hwnd, IDC_CHAT_MESSAGE), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(hwnd, IDC_CHAT_MESSAGE), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
}
- dat->hThemeIP = M.isAero() ? CMimAPI::m_pfnOpenThemeData(hwnd, L"ButtonStyle") : 0;
- dat->hThemeToolbar = (M.isAero() || (!CSkin::m_skinEnabled && M.isVSThemed())) ? CMimAPI::m_pfnOpenThemeData(hwnd, L"REBAR") : 0;
+ dat->hThemeIP = M.isAero() ? OpenThemeData(hwnd, L"ButtonStyle") : 0;
+ dat->hThemeToolbar = (M.isAero() || (!CSkin::m_skinEnabled && M.isVSThemed())) ? OpenThemeData(hwnd, L"REBAR") : 0;
return 0;
}
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index ac6a93d4ab..8def3fb880 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -76,7 +73,6 @@ void CGlobals::reloadSystemStartup()
m_WinVerMajor = WinVerMajor();
m_WinVerMinor = WinVerMinor();
- m_bIsXP = IsWinVerXPPlus();
m_bIsVista = IsWinVerVistaPlus();
m_bIsWin7 = IsWinVer7Plus();
diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h
index 9e841f3eec..4343c5d1c4 100644
--- a/plugins/TabSRMM/src/globals.h
+++ b/plugins/TabSRMM/src/globals.h
@@ -124,7 +124,7 @@ public:
BYTE g_iButtonsBarGap;
BYTE m_WinVerMajor;
BYTE m_WinVerMinor;
- bool m_bIsXP, m_bIsVista, m_bIsWin7;
+ bool m_bIsVista, m_bIsWin7;
HWND m_hwndClist;
int m_TabAppearance;
myTabCtrl tabConfig;
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 8074a91c2a..dace238737 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -1596,7 +1593,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
CSkin::ApplyAeroEffect(hdcMem, &rcText, CSkin::AERO_EFFECT_AREA_MENUBAR, 0);
::FillRect(hdcMem, &m_rcRich, br);
- hTheme = CMimAPI::m_pfnOpenThemeData(m_hwnd, L"BUTTON");
+ hTheme = OpenThemeData(m_hwnd, L"BUTTON");
MARGINS m;
m.cxLeftWidth = LEFT_BORDER + m_leftWidth;
m.cxRightWidth = RIGHT_BORDER;
@@ -1627,7 +1624,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
CSkin::RenderText(hdcMem, hTheme, szTitle, &rcText, DT_SINGLELINE|DT_END_ELLIPSIS|DT_VCENTER, CSkin::m_glowSize, clr);
if (hTheme)
- CMimAPI::m_pfnCloseThemeData(hTheme);
+ CloseThemeData(hTheme);
::SelectObject(hdcMem, hOldFont);
::BitBlt(hdc, 0, 0, cx, cy, hdcMem, 0, 0, SRCCOPY);
::SelectObject(hdcMem, hbmOld);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index dbaadce2df..8738e681e4 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -33,24 +30,9 @@
#include "commonheaders.h"
-PITA CMimAPI::m_pfnIsThemeActive = 0;
-POTD CMimAPI::m_pfnOpenThemeData = 0;
-PDTB CMimAPI::m_pfnDrawThemeBackground = 0;
-PCTD CMimAPI::m_pfnCloseThemeData = 0;
-PDTT CMimAPI::m_pfnDrawThemeText = 0;
PDTTE CMimAPI::m_pfnDrawThemeTextEx = 0;
-PITBPT CMimAPI::m_pfnIsThemeBackgroundPartiallyTransparent = 0;
-PDTPB CMimAPI::m_pfnDrawThemeParentBackground = 0;
-PGTBCR CMimAPI::m_pfnGetThemeBackgroundContentRect = 0;
-ETDT CMimAPI::m_pfnEnableThemeDialogTexture = 0;
-PSLWA CMimAPI::m_pSetLayeredWindowAttributes = 0;
-PFWEX CMimAPI::m_MyFlashWindowEx = 0;
-PAB CMimAPI::m_MyAlphaBlend = 0;
-PGF CMimAPI::m_MyGradientFill = 0;
DEFICA CMimAPI::m_pfnDwmExtendFrameIntoClientArea = 0;
DICE CMimAPI::m_pfnDwmIsCompositionEnabled = 0;
-MMFW CMimAPI::m_pfnMonitorFromWindow = 0;
-GMIA CMimAPI::m_pfnGetMonitorInfoA = 0;
DRT CMimAPI::m_pfnDwmRegisterThumbnail = 0;
BPI CMimAPI::m_pfnBufferedPaintInit = 0;
BPU CMimAPI::m_pfnBufferedPaintUninit = 0;
@@ -59,7 +41,6 @@ EBP CMimAPI::m_pfnEndBufferedPaint = 0;
BBW CMimAPI::m_pfnDwmBlurBehindWindow = 0;
DGC CMimAPI::m_pfnDwmGetColorizationColor = 0;
BPSA CMimAPI::m_pfnBufferedPaintSetAlpha = 0;
-GLIX CMimAPI::m_pfnGetLocaleInfoEx = 0;
DWMIIB CMimAPI::m_pfnDwmInvalidateIconicBitmaps = 0;
DWMSWA CMimAPI::m_pfnDwmSetWindowAttribute = 0;
DWMUT CMimAPI::m_pfnDwmUpdateThumbnailProperties = 0;
@@ -307,7 +288,7 @@ bool CMimAPI::getAeroState()
m_isAero = (CSkin::m_skinEnabled == false) && GetByte("useAero", 1) && CSkin::m_fAeroSkinsValid && m_DwmActive;
}
- m_isVsThemed = (m_VsAPI && m_pfnIsThemeActive && m_pfnIsThemeActive());
+ m_isVsThemed = IsThemeActive();
return m_isAero;
}
@@ -319,47 +300,10 @@ bool CMimAPI::getAeroState()
void CMimAPI::InitAPI()
{
m_hUxTheme = 0;
- m_VsAPI = false;
-
- HMODULE hDLL = GetModuleHandleA("user32");
- m_pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL, "SetLayeredWindowAttributes");
- m_MyFlashWindowEx = (PFWEX) GetProcAddress(hDLL, "FlashWindowEx");
-
- m_MyAlphaBlend = (PAB) GetProcAddress(GetModuleHandleA("gdi32"), "GdiAlphaBlend");
- if (m_MyAlphaBlend == 0)
- m_MyAlphaBlend = (PAB) GetProcAddress(LoadLibraryA("msimg32.dll"), "AlphaBlend");
-
- m_MyGradientFill = (PGF) GetProcAddress(GetModuleHandleA("gdi32"), "GdiGradientFill");
- if (m_MyGradientFill == 0)
- m_MyGradientFill = (PGF) GetProcAddress(GetModuleHandleA("msimg32"), "GradientFill");
-
- m_pfnMonitorFromWindow = (MMFW)GetProcAddress(GetModuleHandleA("USER32"), "MonitorFromWindow");
- m_pfnGetMonitorInfoA = (GMIA)GetProcAddress(GetModuleHandleA("USER32"), "GetMonitorInfoA");
-
- if (IsWinVerXPPlus()) {
- if ((m_hUxTheme = Utils::loadSystemLibrary(L"\\uxtheme.dll")) != 0) {
- m_pfnIsThemeActive = (PITA)GetProcAddress(m_hUxTheme, "IsThemeActive");
- m_pfnOpenThemeData = (POTD)GetProcAddress(m_hUxTheme, "OpenThemeData");
- m_pfnDrawThemeBackground = (PDTB)GetProcAddress(m_hUxTheme, "DrawThemeBackground");
- m_pfnCloseThemeData = (PCTD)GetProcAddress(m_hUxTheme, "CloseThemeData");
- m_pfnDrawThemeText = (PDTT)GetProcAddress(m_hUxTheme, "DrawThemeText");
- m_pfnIsThemeBackgroundPartiallyTransparent = (PITBPT)GetProcAddress(m_hUxTheme, "IsThemeBackgroundPartiallyTransparent");
- m_pfnDrawThemeParentBackground = (PDTPB)GetProcAddress(m_hUxTheme, "DrawThemeParentBackground");
- m_pfnGetThemeBackgroundContentRect = (PGTBCR)GetProcAddress(m_hUxTheme, "GetThemeBackgroundContentRect");
- m_pfnEnableThemeDialogTexture = (ETDT)GetProcAddress(m_hUxTheme, "EnableThemeDialogTexture");
-
- if (m_pfnIsThemeActive != 0 && m_pfnOpenThemeData != 0 && m_pfnDrawThemeBackground != 0 && m_pfnCloseThemeData != 0
- && m_pfnDrawThemeText != 0 && m_pfnIsThemeBackgroundPartiallyTransparent != 0 && m_pfnDrawThemeParentBackground != 0
- && m_pfnGetThemeBackgroundContentRect != 0) {
- m_VsAPI = true;
- }
- }
- }
/*
* vista+ DWM API
*/
-
m_hDwmApi = 0;
if (IsWinVerVistaPlus()) {
m_hDwmApi = Utils::loadSystemLibrary(L"\\dwmapi.dll");
@@ -379,6 +323,7 @@ void CMimAPI::InitAPI()
/*
* additional uxtheme APIs (Vista+)
*/
+ m_hUxTheme = Utils::loadSystemLibrary(L"\\uxtheme.dll");
if (m_hUxTheme) {
m_pfnDrawThemeTextEx = (PDTTE)GetProcAddress(m_hUxTheme, "DrawThemeTextEx");
m_pfnBeginBufferedPaint = (BBP)GetProcAddress(m_hUxTheme, "BeginBufferedPaint");
@@ -390,7 +335,6 @@ void CMimAPI::InitAPI()
if (m_haveBufferedPaint)
m_pfnBufferedPaintInit();
}
- m_pfnGetLocaleInfoEx = (GLIX)GetProcAddress(GetModuleHandleA("kernel32"), "GetLocaleInfoEx");
}
else m_haveBufferedPaint = false;
}
diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h
index 8c3f34828c..8f84731d54 100644
--- a/plugins/TabSRMM/src/mim.h
+++ b/plugins/TabSRMM/src/mim.h
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -42,43 +39,27 @@ extern FI_INTERFACE *FIF;
* - dwmapi
* - some GDI functions (AlphaBlend()..)
*/
-typedef BOOL (WINAPI *SMI)( HMENU hmenu, LPCMENUINFO lpcmi );
+//dwmapi
typedef HRESULT (WINAPI *DEFICA)(HWND hwnd, const MARGINS *margins);
typedef HRESULT (WINAPI *DICE)(BOOL *);
-typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);
-typedef BOOL (WINAPI *PULW)(HWND, HDC, POINT *, SIZE *, HDC, POINT *, COLORREF, BLENDFUNCTION *, DWORD);
-typedef BOOL (WINAPI *PFWEX)(FLASHWINFO *);
-typedef BOOL (WINAPI *PAB)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION);
-typedef BOOL (WINAPI *PGF)(HDC, PTRIVERTEX, ULONG, PVOID, ULONG, ULONG);
-
-typedef BOOL (WINAPI *PITA)();
-typedef HANDLE (WINAPI *POTD)(HWND, LPCWSTR);
-typedef UINT (WINAPI *PDTB)(HANDLE, HDC, int, int, RECT *, RECT *);
-typedef UINT (WINAPI *PCTD)(HANDLE);
-typedef UINT (WINAPI *PDTT)(HANDLE, HDC, int, int, LPCWSTR, int, DWORD, DWORD, RECT *);
-typedef UINT (WINAPI *PDTTE)(HANDLE, HDC, int, int, LPCWSTR, int, DWORD, RECT *, const DTTOPTS *);
-typedef BOOL (WINAPI *PITBPT)(HANDLE, int, int);
-typedef HRESULT (WINAPI *PDTPB)(HWND, HDC, RECT *);
-typedef HRESULT (WINAPI *PGTBCR)(HANDLE, HDC, int, int, const RECT *, const RECT *);
-
-typedef HMONITOR(WINAPI *MMFW)(HWND, DWORD);
-typedef BOOL (WINAPI *GMIA)(HMONITOR, LPMONITORINFO);
typedef HRESULT (WINAPI *DRT)(HWND, HWND, PHTHUMBNAIL);
-typedef BOOL (WINAPI *ETDT)(HANDLE, DWORD);
-typedef HANDLE (WINAPI *BBP)(HDC, RECT *, BP_BUFFERFORMAT, BP_PAINTPARAMS *, HDC *);
-typedef HRESULT (WINAPI *EBP)(HANDLE, BOOL);
-typedef HRESULT (WINAPI *BPI)(void);
-typedef HRESULT (WINAPI *BPU)(void);
typedef HRESULT (WINAPI *BBW)(HWND, DWM_BLURBEHIND *);
typedef HRESULT (WINAPI *DGC)(DWORD *, BOOL *);
-typedef HRESULT (WINAPI *BPSA)(HANDLE, const RECT *, BYTE);
-typedef int (WINAPI *GLIX)(LPCWSTR, LCTYPE, LPCWSTR, int);
-typedef HRESULT (WINAPI *DWMSWA)(HWND, DWORD, LPCVOID, DWORD);
typedef HRESULT (WINAPI *DWMIIB)(HWND);
+typedef HRESULT (WINAPI *DWMSWA)(HWND, DWORD, LPCVOID, DWORD);
typedef HRESULT (WINAPI *DWMUT)(HTHUMBNAIL, DWM_THUMBNAIL_PROPERTIES *);
typedef HRESULT (WINAPI *DURT)(HTHUMBNAIL);
typedef HRESULT (WINAPI *DSIT)(HWND, HBITMAP, DWORD);
typedef HRESULT (WINAPI *DSILP)(HWND, HBITMAP, POINT *, DWORD);
+//uxtheme
+typedef UINT (WINAPI *PDTTE)(HANDLE, HDC, int, int, LPCWSTR, int, DWORD, RECT *, const DTTOPTS *);
+typedef HANDLE (WINAPI *BBP)(HDC, RECT *, BP_BUFFERFORMAT, BP_PAINTPARAMS *, HDC *);
+typedef HRESULT (WINAPI *EBP)(HANDLE, BOOL);
+typedef HRESULT (WINAPI *BPI)(void);
+typedef HRESULT (WINAPI *BPU)(void);
+typedef HRESULT (WINAPI *BPSA)(HANDLE, const RECT *, BYTE);
+//kernel32
+typedef int (WINAPI *GLIX)(LPCWSTR, LCTYPE, LPCWSTR, int);
/*
* used to encapsulate some parts of the Miranda API
@@ -169,7 +150,6 @@ public:
* os dependant stuff (aero, visual styles etc.)
*/
- const bool isVSAPIState() const { return m_VsAPI; }
/**
* return status of Vista Aero
*
@@ -220,24 +200,9 @@ public:
/*
various function pointers
*/
- static PITA m_pfnIsThemeActive;
- static POTD m_pfnOpenThemeData;
- static PDTB m_pfnDrawThemeBackground;
- static PCTD m_pfnCloseThemeData;
- static PDTT m_pfnDrawThemeText;
static PDTTE m_pfnDrawThemeTextEx;
- static PITBPT m_pfnIsThemeBackgroundPartiallyTransparent;
- static PDTPB m_pfnDrawThemeParentBackground;
- static PGTBCR m_pfnGetThemeBackgroundContentRect;
- static ETDT m_pfnEnableThemeDialogTexture;
- static PSLWA m_pSetLayeredWindowAttributes;
- static PFWEX m_MyFlashWindowEx;
- static PAB m_MyAlphaBlend;
- static PGF m_MyGradientFill;
static DEFICA m_pfnDwmExtendFrameIntoClientArea;
static DICE m_pfnDwmIsCompositionEnabled;
- static MMFW m_pfnMonitorFromWindow;
- static GMIA m_pfnGetMonitorInfoA;
static DRT m_pfnDwmRegisterThumbnail;
static BPI m_pfnBufferedPaintInit;
static BPU m_pfnBufferedPaintUninit;
@@ -246,7 +211,6 @@ public:
static BBW m_pfnDwmBlurBehindWindow;
static DGC m_pfnDwmGetColorizationColor;
static BPSA m_pfnBufferedPaintSetAlpha;
- static GLIX m_pfnGetLocaleInfoEx;
static DWMSWA m_pfnDwmSetWindowAttribute;
static DWMIIB m_pfnDwmInvalidateIconicBitmaps;
static DWMUT m_pfnDwmUpdateThumbnailProperties;
@@ -258,7 +222,7 @@ public:
private:
TCHAR m_szProfilePath[MAX_PATH + 2], m_szSkinsPath[MAX_PATH + 2], m_szSavedAvatarsPath[MAX_PATH + 2], m_szChatLogsPath[MAX_PATH + 2];
HMODULE m_hUxTheme, m_hDwmApi;
- bool m_VsAPI, m_isAero, m_DwmActive, m_isVsThemed;
+ bool m_isAero, m_DwmActive, m_isVsThemed;
HANDLE m_hDataPath, m_hSkinsPath, m_hAvatarsPath, m_hChatLogsPath;
__int64 m_tStart, m_tStop, m_tFreq;
double m_dFreq;
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 40e8722576..ea8a1cda5e 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -324,9 +321,9 @@ static void MsgWindowUpdateState(TWindowData *dat, UINT msg)
HWND hwndTab = GetParent(hwndDlg);
if (msg == WM_ACTIVATE) {
- if (dat->pContainer->dwFlags & CNT_TRANSPARENCY && CMimAPI::m_pSetLayeredWindowAttributes != NULL) {
+ if (dat->pContainer->dwFlags & CNT_TRANSPARENCY) {
DWORD trans = LOWORD(dat->pContainer->settings->dwTransparency);
- CMimAPI::m_pSetLayeredWindowAttributes(dat->pContainer->hwnd, 0, (BYTE)trans, (dat->pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
+ SetLayeredWindowAttributes(dat->pContainer->hwnd, 0, (BYTE)trans, (dat->pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
}
#if defined(__FEAT_EXP_AUTOSPLITTER)
@@ -1266,7 +1263,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
{
RECT rc;
int i;
- BOOL isThemed = PluginConfig.m_bIsXP;
+ BOOL isThemed = TRUE;
int dwLocalSmAdd = 0;
DBVARIANT dbv = {0};
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index b2928e20e8..fd9c2a39d6 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -1959,14 +1956,9 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat)
rb.max_width, rb.max_height, SWP_SHOWWINDOW | SWP_ASYNCWINDOWPOS | SWP_DEFERERASE | SWP_NOSENDCHANGING);
}
else {
- if (CMimAPI::m_MyAlphaBlend) {
- CMimAPI::m_MyAlphaBlend(dis->hDC, rcClient.left + rcFrame.left + border_off, rcClient.top + rcFrame.top + border_off,
+ GdiAlphaBlend(dis->hDC, rcClient.left + rcFrame.left + border_off, rcClient.top + rcFrame.top + border_off,
rb.max_width, rb.max_height, hdcMem, 0, 0,
rb.max_width, rb.max_height, CSkin::m_default_bf);
- }
- else
- CSkin::MY_AlphaBlend(dis->hDC, rcClient.left + rcFrame.left + border_off, rcClient.top + rcFrame.top + border_off,
- rb.max_width, rb.max_height, rb.max_width, rb.max_height, hdcMem);
}
SelectObject(hdcMem, hbmMem);
//DeleteObject(hbmMem);
@@ -1979,9 +1971,19 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat)
LONG width_off = 0; //= CSkin::m_bAvatarBorderType ? 0 : 2;
SetStretchBltMode(hdcDraw, HALFTONE);
- if (aceFlags & AVS_PREMULTIPLIED)
- CSkin::MY_AlphaBlend(hdcDraw, xy_off, top + xy_off, (int)dNewWidth + width_off,
- iMaxHeight + width_off, bminfo.bmWidth, bminfo.bmHeight, hdcMem);
+ if (aceFlags & AVS_PREMULTIPLIED) {
+ HDC hdcTemp = CreateCompatibleDC(hdcDraw);
+ HBITMAP hbmTemp = CreateCompatibleBitmap(hdcMem, bminfo.bmWidth, bminfo.bmHeight);
+ HBITMAP hbmOld = (HBITMAP)SelectObject(hdcTemp, hbmTemp);
+
+ SetStretchBltMode(hdcTemp, HALFTONE);
+ StretchBlt(hdcTemp, 0, 0, bminfo.bmWidth, bminfo.bmHeight, hdcDraw, xy_off, top + xy_off, (int)dNewWidth + width_off, iMaxHeight + width_off, SRCCOPY);
+ GdiAlphaBlend(hdcTemp, 0, 0, bminfo.bmWidth, bminfo.bmHeight, hdcMem, 0, 0, bminfo.bmWidth, bminfo.bmHeight, CSkin::m_default_bf);
+ StretchBlt(hdcDraw, xy_off, top + xy_off, (int)dNewWidth + width_off, iMaxHeight + width_off, hdcTemp, 0, 0, bminfo.bmWidth, bminfo.bmHeight, SRCCOPY);
+ SelectObject(hdcTemp, hbmOld);
+ DeleteObject(hbmTemp);
+ DeleteDC(hdcTemp);
+ }
else
StretchBlt(hdcDraw, xy_off, top + xy_off, (int)dNewWidth + width_off,
iMaxHeight + width_off, hdcMem, 0, 0, bminfo.bmWidth, bminfo.bmHeight, SRCCOPY);
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 65c3deb1f7..2968002b44 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -52,7 +49,7 @@ static HIMAGELIST g_himlStates = 0;
HIMAGELIST CreateStateImageList()
{
if (g_himlStates == 0) {
- g_himlStates = ImageList_Create(16, 16, PluginConfig.m_bIsXP ? ILC_COLOR32 | ILC_MASK : ILC_COLOR8 | ILC_MASK, 4, 0);
+ g_himlStates = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 4, 0);
ImageList_AddIcon(g_himlStates, PluginConfig.g_IconFolder);
ImageList_AddIcon(g_himlStates, PluginConfig.g_IconFolder);
ImageList_AddIcon(g_himlStates, PluginConfig.g_IconUnchecked);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index f7e933b826..1e1981aebb 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -873,7 +870,7 @@ void TSAPI CreateImageList(BOOL bInitial)
*/
if (bInitial) {
- PluginConfig.g_hImageList = ImageList_Create(16, 16, PluginConfig.m_bIsXP ? ILC_COLOR32 | ILC_MASK : ILC_COLOR8 | ILC_MASK, 2, 0);
+ PluginConfig.g_hImageList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 2, 0);
HICON hIcon = CreateIcon(g_hInst, 16, 16, 1, 4, NULL, NULL);
ImageList_AddIcon(PluginConfig.g_hImageList, hIcon);
DestroyIcon(hIcon);
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp
index 7eab1ccba3..60ced8c387 100644
--- a/plugins/TabSRMM/src/sidebar.cpp
+++ b/plugins/TabSRMM/src/sidebar.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -281,8 +278,7 @@ void CSideBarButton::renderIconAndNick(const HDC hdc, const RECT *rcItem) const
if (m_sideBar->getHoveredClose() != this)
CSkin::m_default_bf.SourceConstantAlpha = 150;
- CMimAPI::m_MyAlphaBlend(hdc, rc.right - 20, (rc.bottom + rc.top - 16) / 2, 16, 16, CSkin::m_tabCloseHDC,
- 0, 0, 16, 16, CSkin::m_default_bf);
+ GdiAlphaBlend(hdc, rc.right - 20, (rc.bottom + rc.top - 16) / 2, 16, 16, CSkin::m_tabCloseHDC, 0, 0, 16, 16, CSkin::m_default_bf);
rc.right -= 19;
CSkin::m_default_bf.SourceConstantAlpha = 255;
@@ -1032,16 +1028,16 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT
else {
CSkin::FillBack(hdc, rcDraw);
- if (CMimAPI::m_pfnIsThemeBackgroundPartiallyTransparent(item->m_buttonControl->hThemeToolbar, TP_BUTTON, stateId))
- CMimAPI::m_pfnDrawThemeParentBackground(item->getHwnd(), hdc, rcDraw);
+ if (IsThemeBackgroundPartiallyTransparent(item->m_buttonControl->hThemeToolbar, TP_BUTTON, stateId))
+ DrawThemeParentBackground(item->getHwnd(), hdc, rcDraw);
if (M.isAero() || PluginConfig.m_WinVerMajor >= 6) {
stateId = (fIsActiveItem ? PBS_PRESSED : PBS_HOT);
- CMimAPI::m_pfnDrawThemeBackground(item->m_buttonControl->hThemeToolbar, hdc, 8, RBStateConvert2Flat(stateId), rcDraw, rcDraw);
+ DrawThemeBackground(item->m_buttonControl->hThemeToolbar, hdc, 8, RBStateConvert2Flat(stateId), rcDraw, rcDraw);
}
else {
stateId = (fIsActiveItem ? PBS_PRESSED : PBS_HOT);
- CMimAPI::m_pfnDrawThemeBackground(item->m_buttonControl->hThemeToolbar, hdc, TP_BUTTON, TBStateConvert2Flat(stateId), rcDraw, rcDraw);
+ DrawThemeBackground(item->m_buttonControl->hThemeToolbar, hdc, TP_BUTTON, TBStateConvert2Flat(stateId), rcDraw, rcDraw);
}
}
}
@@ -1114,7 +1110,7 @@ void __fastcall CSideBar::m_AdvancedContentRenderer(const HDC hdc, const RECT *r
LONG xOff = (cx - maxHeight) + (maxHeight - (LONG)dNewWidth) / 2 - 4;
LONG yOff = (cy - (LONG)dNewHeight) / 2;
- CMimAPI::m_MyAlphaBlend(hdc, xOff, yOff, (LONG)dNewWidth, (LONG)dNewHeight, dc, 0, 0, (LONG)dNewWidth, (LONG)dNewHeight, CSkin::m_default_bf);
+ GdiAlphaBlend(hdc, xOff, yOff, (LONG)dNewWidth, (LONG)dNewHeight, dc, 0, 0, (LONG)dNewWidth, (LONG)dNewHeight, CSkin::m_default_bf);
::SelectObject(dc, hbmOld);
if (hbmResized != dat->ace->hbmPic)
::DeleteObject(hbmResized);
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp
index 0218261176..d1154b760d 100644
--- a/plugins/TabSRMM/src/tabctrl.cpp
+++ b/plugins/TabSRMM/src/tabctrl.cpp
@@ -1,6 +1,4 @@
-/* astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
+/*
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -218,7 +216,7 @@ static void DrawItem(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, in
if (tabdat->iHoveredCloseIcon != nItem)
CSkin::m_default_bf.SourceConstantAlpha = 150;
- CMimAPI::m_MyAlphaBlend(dc, rcItem->right - 16 - tabdat->m_xpad, (rcItem->bottom + rcItem->top - 16) / 2, 16, 16, CSkin::m_tabCloseHDC,
+ GdiAlphaBlend(dc, rcItem->right - 16 - tabdat->m_xpad, (rcItem->bottom + rcItem->top - 16) / 2, 16, 16, CSkin::m_tabCloseHDC,
0, 0, 16, 16, CSkin::m_default_bf);
rcItem->right -= (18 + tabdat->m_xpad);
@@ -316,7 +314,7 @@ b_nonskinned:
FillRect(dc, rcItem, CSkin::m_BrushBack);
else
CSkin::FillBack(dc, rcItem);
- CMimAPI::m_pfnDrawThemeBackground(tabdat->hThemeButton, dc, 1, nHint & HINT_ACTIVE_ITEM ? 3 : (nHint & HINT_HOTTRACK ? 2 : 1), rcItem, rcItem);
+ DrawThemeBackground(tabdat->hThemeButton, dc, 1, nHint & HINT_ACTIVE_ITEM ? 3 : (nHint & HINT_HOTTRACK ? 2 : 1), rcItem, rcItem);
}
return;
}
@@ -423,9 +421,8 @@ static HRESULT DrawThemesPartWithAero(const TabControlData *tabdat, HDC hDC, int
if (iStateId != PBS_NORMAL)
tabdat->helperGlowItem->Render(hDC, prcBox, true);
}
- else if (CMimAPI::m_pfnDrawThemeBackground) {
- if (tabdat->hTheme != 0)
- hResult = CMimAPI::m_pfnDrawThemeBackground(tabdat->hTheme, hDC, iPartId, iStateId, prcBox, NULL);
+ else if (tabdat->hTheme != 0) {
+ hResult = DrawThemeBackground(tabdat->hTheme, hDC, iPartId, iStateId, prcBox, NULL);
}
return hResult;
@@ -438,11 +435,8 @@ static HRESULT DrawThemesPart(const TabControlData *tabdat, HDC hDC, int iPartId
{
HRESULT hResult = 0;
- if (CMimAPI::m_pfnDrawThemeBackground == 0)
- return 0;
-
if (tabdat->hTheme != 0)
- hResult = CMimAPI::m_pfnDrawThemeBackground(tabdat->hTheme, hDC, iPartId, iStateId, prcBox, NULL);
+ hResult = DrawThemeBackground(tabdat->hTheme, hDC, iPartId, iStateId, prcBox, NULL);
return hResult;
}
@@ -1006,19 +1000,14 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
case EM_THEMECHANGED:
tabdat->m_xpad = M.GetByte("x-pad", 3);
tabdat->m_VisualStyles = FALSE;
- if (PluginConfig.m_bIsXP && M.isVSAPIState()) {
- if (CMimAPI::m_pfnIsThemeActive != 0)
- if (CMimAPI::m_pfnIsThemeActive()) {
- tabdat->m_VisualStyles = TRUE;
- if (tabdat->hTheme != 0 && CMimAPI::m_pfnCloseThemeData != 0) {
- CMimAPI::m_pfnCloseThemeData(tabdat->hTheme);
- CMimAPI::m_pfnCloseThemeData(tabdat->hThemeButton);
- }
- if (CMimAPI::m_pfnOpenThemeData != 0) {
- if ((tabdat->hTheme = CMimAPI::m_pfnOpenThemeData(hwnd, L"TAB")) == 0 || (tabdat->hThemeButton = CMimAPI::m_pfnOpenThemeData(hwnd, L"BUTTON")) == 0)
- tabdat->m_VisualStyles = FALSE;
- }
- }
+ if (IsThemeActive()) {
+ tabdat->m_VisualStyles = TRUE;
+ if (tabdat->hTheme != 0) {
+ CloseThemeData(tabdat->hTheme);
+ CloseThemeData(tabdat->hThemeButton);
+ }
+ if ((tabdat->hTheme = OpenThemeData(hwnd, L"TAB")) == 0 || (tabdat->hThemeButton = OpenThemeData(hwnd, L"BUTTON")) == 0)
+ tabdat->m_VisualStyles = FALSE;
}
return 0;
@@ -1075,9 +1064,9 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
case WM_DESTROY:
if (tabdat) {
- if (tabdat->hTheme != 0 && CMimAPI::m_pfnCloseThemeData != 0) {
- CMimAPI::m_pfnCloseThemeData(tabdat->hTheme);
- CMimAPI::m_pfnCloseThemeData(tabdat->hThemeButton);
+ if (tabdat->hTheme != 0) {
+ CloseThemeData(tabdat->hTheme);
+ CloseThemeData(tabdat->hThemeButton);
}
}
break;
@@ -1186,7 +1175,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
tabdat->hwndDrag = (HWND)tc.lParam;
tabdat->dragDat = dat;
tabdat->fSavePos = TRUE;
- tabdat->himlDrag = ImageList_Create(16, 16, ILC_MASK | (PluginConfig.m_bIsXP ? ILC_COLOR32 : ILC_COLOR16), 1, 0);
+ tabdat->himlDrag = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 1, 0);
ImageList_AddIcon(tabdat->himlDrag, dat->hTabIcon);
ImageList_BeginDrag(tabdat->himlDrag, 0, 8, 8);
ImageList_DragEnter(hwnd, tci.pt.x, tci.pt.y);
@@ -1219,7 +1208,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
tabdat->iBeginIndex = i;
tabdat->hwndDrag = (HWND)tc.lParam;
tabdat->dragDat = dat;
- tabdat->himlDrag = ImageList_Create(16, 16, ILC_MASK | (PluginConfig.m_bIsXP ? ILC_COLOR32 : ILC_COLOR16), 1, 0);
+ tabdat->himlDrag = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 1, 0);
tabdat->fSavePos = FALSE;
ImageList_AddIcon(tabdat->himlDrag, dat->hTabIcon);
ImageList_BeginDrag(tabdat->himlDrag, 0, 8, 8);
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index 62f94b91fd..a54762960b 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -796,7 +796,7 @@ void CThumbIM::renderContent()
hRgn = ::CreateRectRgn(xOff - 1, yOff - 1, xOff + (LONG)dNewWidth + 2, yOff + (LONG)dNewHeight + 2);
CSkin::m_default_bf.SourceConstantAlpha = 150;
- CMimAPI::m_MyAlphaBlend(m_hdc, xOff, yOff, (LONG)dNewWidth, (LONG)dNewHeight, dc, 0, 0, (LONG)dNewWidth, (LONG)dNewHeight, CSkin::m_default_bf);
+ GdiAlphaBlend(m_hdc, xOff, yOff, (LONG)dNewWidth, (LONG)dNewHeight, dc, 0, 0, (LONG)dNewWidth, (LONG)dNewHeight, CSkin::m_default_bf);
CSkin::m_default_bf.SourceConstantAlpha = 255;
::FrameRgn(m_hdc, hRgn, reinterpret_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)), 1, 1);
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index 6df580e003..647d3d4caf 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -357,7 +354,7 @@ void TSAPI DrawAlpha(HDC hDC, PRECT rc, DWORD clr_base, int alpha, DWORD clr_de
LONG realWidth = (rc->right - rc->left);
LONG realHeightHalf = realHeight >> 1;
- if (rc == NULL || CMimAPI::m_MyGradientFill == 0 || CMimAPI::m_MyAlphaBlend == 0)
+ if (rc == NULL)
return;
if (imageItem) {
@@ -400,7 +397,7 @@ void TSAPI DrawAlpha(HDC hDC, PRECT rc, DWORD clr_base, int alpha, DWORD clr_de
grect.UpperLeft = 0;
grect.LowerRight = 1;
- CMimAPI::m_MyGradientFill(hDC, tvtx, 2, &grect, 1, (bGradient & GRADIENT_TB || bGradient & GRADIENT_BT) ? GRADIENT_FILL_RECT_V : GRADIENT_FILL_RECT_H);
+ GdiGradientFill(hDC, tvtx, 2, &grect, 1, (bGradient & GRADIENT_TB || bGradient & GRADIENT_BT) ? GRADIENT_FILL_RECT_V : GRADIENT_FILL_RECT_H);
return;
}
@@ -480,7 +477,7 @@ void TSAPI DrawAlpha(HDC hDC, PRECT rc, DWORD clr_base, int alpha, DWORD clr_de
bf.SourceConstantAlpha = (UCHAR)(clr_base >> 24);
bf.AlphaFormat = AC_SRC_ALPHA; // so it will use our specified alpha value
- CMimAPI::m_MyAlphaBlend(hDC, rc->left + realHeightHalf, rc->top, (realWidth - realHeightHalf * 2), realHeight, hdc, 0, 0, ulBitmapWidth, ulBitmapHeight, bf);
+ GdiAlphaBlend(hDC, rc->left + realHeightHalf, rc->top, (realWidth - realHeightHalf * 2), realHeight, hdc, 0, 0, ulBitmapWidth, ulBitmapHeight, bf);
SelectObject(hdc, holdbitmap);
DeleteObject(hbitmap);
@@ -534,7 +531,7 @@ void TSAPI DrawAlpha(HDC hDC, PRECT rc, DWORD clr_base, int alpha, DWORD clr_de
}
}
}
- CMimAPI::m_MyAlphaBlend(hDC, rc->left, rc->top, ulBitmapWidth, ulBitmapHeight, hdc, 0, 0, ulBitmapWidth, ulBitmapHeight, bf);
+ GdiAlphaBlend(hDC, rc->left, rc->top, ulBitmapWidth, ulBitmapHeight, hdc, 0, 0, ulBitmapWidth, ulBitmapHeight, bf);
SelectObject(hdc, holdbitmap);
DeleteObject(hbitmap);
@@ -570,7 +567,7 @@ void TSAPI DrawAlpha(HDC hDC, PRECT rc, DWORD clr_base, int alpha, DWORD clr_de
}
}
}
- CMimAPI::m_MyAlphaBlend(hDC, rc->right - realHeightHalf, rc->top, ulBitmapWidth, ulBitmapHeight, hdc, 0, 0, ulBitmapWidth, ulBitmapHeight, bf);
+ GdiAlphaBlend(hDC, rc->right - realHeightHalf, rc->top, ulBitmapWidth, ulBitmapHeight, hdc, 0, 0, ulBitmapWidth, ulBitmapHeight, bf);
}
SelectObject(hdc, holdbitmap);
DeleteObject(hbitmap);
@@ -655,9 +652,6 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl
LONG srcOrigX = isGlyph ? m_glyphMetrics[0] : 0;
LONG srcOrigY = isGlyph ? m_glyphMetrics[1] : 0;
- if (CMimAPI::m_MyAlphaBlend == 0)
- return;
-
if (m_hdc == 0) {
hdcSrc = CreateCompatibleDC(hdc);
hbmOld = (HBITMAP)SelectObject(hdcSrc, isGlyph ? Skin->getGlyphItem()->getHbm() : m_hbm);
@@ -672,13 +666,13 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl
if (m_dwFlags & IMAGE_FLAG_DIVIDED) {
// top 3 items
- CMimAPI::m_MyAlphaBlend(hdc, rc->left, rc->top, l, t, hdcSrc, srcOrigX, srcOrigY, l, t, m_bf);
- CMimAPI::m_MyAlphaBlend(hdc, rc->left + l, rc->top, width - l - r, t, hdcSrc, srcOrigX + l, srcOrigY, m_inner_width, t, m_bf);
- CMimAPI::m_MyAlphaBlend(hdc, rc->right - r, rc->top, r, t, hdcSrc, srcOrigX + (m_width - r), srcOrigY, r, t, m_bf);
+ GdiAlphaBlend(hdc, rc->left, rc->top, l, t, hdcSrc, srcOrigX, srcOrigY, l, t, m_bf);
+ GdiAlphaBlend(hdc, rc->left + l, rc->top, width - l - r, t, hdcSrc, srcOrigX + l, srcOrigY, m_inner_width, t, m_bf);
+ GdiAlphaBlend(hdc, rc->right - r, rc->top, r, t, hdcSrc, srcOrigX + (m_width - r), srcOrigY, r, t, m_bf);
// middle 3 items
- CMimAPI::m_MyAlphaBlend(hdc, rc->left, rc->top + t, l, height - t - b, hdcSrc, srcOrigX, srcOrigY + t, l, m_inner_height, m_bf);
+ GdiAlphaBlend(hdc, rc->left, rc->top + t, l, height - t - b, hdcSrc, srcOrigX, srcOrigY + t, l, m_inner_height, m_bf);
if ((m_dwFlags & IMAGE_FILLSOLID) && m_fillBrush) {
RECT rcFill;
@@ -688,15 +682,15 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl
rcFill.bottom = rc->bottom - b;
FillRect(hdc, &rcFill, m_fillBrush);
} else
- CMimAPI::m_MyAlphaBlend(hdc, rc->left + l, rc->top + t, width - l - r, height - t - b, hdcSrc, srcOrigX + l, srcOrigY + t, m_inner_width, m_inner_height, m_bf);
+ GdiAlphaBlend(hdc, rc->left + l, rc->top + t, width - l - r, height - t - b, hdcSrc, srcOrigX + l, srcOrigY + t, m_inner_width, m_inner_height, m_bf);
- CMimAPI::m_MyAlphaBlend(hdc, rc->right - r, rc->top + t, r, height - t - b, hdcSrc, srcOrigX + (m_width - r), srcOrigY + t, r, m_inner_height, m_bf);
+ GdiAlphaBlend(hdc, rc->right - r, rc->top + t, r, height - t - b, hdcSrc, srcOrigX + (m_width - r), srcOrigY + t, r, m_inner_height, m_bf);
// bottom 3 items
- CMimAPI::m_MyAlphaBlend(hdc, rc->left, rc->bottom - b, l, b, hdcSrc, srcOrigX, srcOrigY + (m_height - b), l, b, m_bf);
- CMimAPI::m_MyAlphaBlend(hdc, rc->left + l, rc->bottom - b, width - l - r, b, hdcSrc, srcOrigX + l, srcOrigY + (m_height - b), m_inner_width, b, m_bf);
- CMimAPI::m_MyAlphaBlend(hdc, rc->right - r, rc->bottom - b, r, b, hdcSrc, srcOrigX + (m_width - r), srcOrigY + (m_height - b), r, b, m_bf);
+ GdiAlphaBlend(hdc, rc->left, rc->bottom - b, l, b, hdcSrc, srcOrigX, srcOrigY + (m_height - b), l, b, m_bf);
+ GdiAlphaBlend(hdc, rc->left + l, rc->bottom - b, width - l - r, b, hdcSrc, srcOrigX + l, srcOrigY + (m_height - b), m_inner_width, b, m_bf);
+ GdiAlphaBlend(hdc, rc->right - r, rc->bottom - b, r, b, hdcSrc, srcOrigX + (m_width - r), srcOrigY + (m_height - b), r, b, m_bf);
}
else switch (m_bStretch) {
case IMAGE_STRETCH_H:
@@ -706,10 +700,10 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl
do {
if (top + m_height <= rc->bottom) {
- CMimAPI::m_MyAlphaBlend(hdc, rc->left, top, width, m_height, hdcSrc, srcOrigX, srcOrigY, m_width, m_height, m_bf);
+ GdiAlphaBlend(hdc, rc->left, top, width, m_height, hdcSrc, srcOrigX, srcOrigY, m_width, m_height, m_bf);
top += m_height;
} else {
- CMimAPI::m_MyAlphaBlend(hdc, rc->left, top, width, rc->bottom - top, hdcSrc, srcOrigX, srcOrigY, m_width, rc->bottom - top, m_bf);
+ GdiAlphaBlend(hdc, rc->left, top, width, rc->bottom - top, hdcSrc, srcOrigX, srcOrigY, m_width, rc->bottom - top, m_bf);
break;
}
} while (TRUE);
@@ -722,10 +716,10 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl
do {
if (left + m_width <= rc->right) {
- CMimAPI::m_MyAlphaBlend(hdc, left, rc->top, m_width, height, hdcSrc, srcOrigX, srcOrigY, m_width, m_height, m_bf);
+ GdiAlphaBlend(hdc, left, rc->top, m_width, height, hdcSrc, srcOrigX, srcOrigY, m_width, m_height, m_bf);
left += m_width;
} else {
- CMimAPI::m_MyAlphaBlend(hdc, left, rc->top, rc->right - left, height, hdcSrc, srcOrigX, srcOrigY, rc->right - left, m_height, m_bf);
+ GdiAlphaBlend(hdc, left, rc->top, rc->right - left, height, hdcSrc, srcOrigX, srcOrigY, rc->right - left, m_height, m_bf);
break;
}
} while (TRUE);
@@ -733,7 +727,7 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl
}
case IMAGE_STRETCH_B:
// stretch the image in both directions...
- CMimAPI::m_MyAlphaBlend(hdc, rc->left, rc->top, width, height, hdcSrc, srcOrigX, srcOrigY, m_width, m_height, m_bf);
+ GdiAlphaBlend(hdc, rc->left, rc->top, width, height, hdcSrc, srcOrigX, srcOrigY, m_width, m_height, m_bf);
break;
}
@@ -1662,12 +1656,12 @@ void CSkin::setupTabCloseBitmap(bool fDeleteOnly)
if (M.isVSThemed() || M.isAero()) {
::FillRect(m_tabCloseHDC, &rc, M.isAero() ? reinterpret_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)) : ::GetSysColorBrush(COLOR_3DFACE));
- HANDLE hTheme = CMimAPI::m_pfnOpenThemeData(PluginConfig.g_hwndHotkeyHandler, L"BUTTON");
+ HANDLE hTheme = OpenThemeData(PluginConfig.g_hwndHotkeyHandler, L"BUTTON");
rc.left--; rc.right++;
rc.top--; rc.bottom++;
- CMimAPI::m_pfnDrawThemeParentBackground(PluginConfig.g_hwndHotkeyHandler, m_tabCloseHDC, &rc);
- CMimAPI::m_pfnDrawThemeBackground(hTheme, m_tabCloseHDC, 1, 1, &rc, &rc);
- CMimAPI::m_pfnCloseThemeData(hTheme);
+ DrawThemeParentBackground(PluginConfig.g_hwndHotkeyHandler, m_tabCloseHDC, &rc);
+ DrawThemeBackground(hTheme, m_tabCloseHDC, 1, 1, &rc, &rc);
+ CloseThemeData(hTheme);
}
else if (CSkin::m_skinEnabled)
CSkin::DrawItem(m_tabCloseHDC, &rc, &SkinItems[ID_EXTBKBUTTONSNPRESSED]);
@@ -1958,34 +1952,6 @@ void CSkin::SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdc
}
/**
- * draw transparent avatar image. Get around crappy image rescaling quality of the
- * AlphaBlend() API.
- *
- * hdcMem contains the bitmap to draw (must be premultiplied for proper per-pixel alpha
- * rendering in AlphaBlend().
- */
-
-void CSkin::MY_AlphaBlend(HDC hdcDraw, DWORD left, DWORD top, int width, int height, int bmWidth, int bmHeight, HDC hdcMem)
-{
- HDC hdcTemp = CreateCompatibleDC(hdcDraw);
- HBITMAP hbmTemp = CreateCompatibleBitmap(hdcMem, bmWidth, bmHeight);
- HBITMAP hbmOld = (HBITMAP)SelectObject(hdcTemp, hbmTemp);
-
- SetStretchBltMode(hdcTemp, HALFTONE);
- StretchBlt(hdcTemp, 0, 0, bmWidth, bmHeight, hdcDraw, left, top, width, height, SRCCOPY);
- if (CMimAPI::m_MyAlphaBlend)
- CMimAPI::m_MyAlphaBlend(hdcTemp, 0, 0, bmWidth, bmHeight, hdcMem, 0, 0, bmWidth, bmHeight, CSkin::m_default_bf);
- else {
- SetStretchBltMode(hdcTemp, HALFTONE);
- StretchBlt(hdcTemp, 0, 0, bmWidth, bmHeight, hdcMem, 0, 0, bmWidth, bmHeight, SRCCOPY);
- }
- StretchBlt(hdcDraw, left, top, width, height, hdcTemp, 0, 0, bmWidth, bmHeight, SRCCOPY);
- SelectObject(hdcTemp, hbmOld);
- DeleteObject(hbmTemp);
- DeleteDC(hdcTemp);
-}
-
-/**
* draw an icon "bDimmed" (small amount of transparency applied)
*/
@@ -1997,16 +1963,10 @@ void CSkin::DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON
hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(dcMem, hbm));
::DrawIconEx(dcMem, 0, 0, hIcon, dx, dy, 0, 0, DI_NORMAL);
m_default_bf.SourceConstantAlpha = alpha;
- if (CMimAPI::m_MyAlphaBlend) {
- HBITMAP hbm = (HBITMAP)SelectObject(dcMem, hbmOld);
- CImageItem::PreMultiply(hbm, 1); // for AlphaBlend()...
- hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(dcMem, hbm));
- CMimAPI::m_MyAlphaBlend(hdc, left, top, dx, dy, dcMem, 0, 0, dx, dy, m_default_bf);
- }
- else {
- SetStretchBltMode(hdc, HALFTONE);
- StretchBlt(hdc, left, top, dx, dy, dcMem, 0, 0, dx, dy, SRCCOPY);
- }
+ hbm = (HBITMAP)SelectObject(dcMem, hbmOld);
+ CImageItem::PreMultiply(hbm, 1); // for AlphaBlend()...
+ hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(dcMem, hbm));
+ GdiAlphaBlend(hdc, left, top, dx, dy, dcMem, 0, 0, dx, dy, m_default_bf);
m_default_bf.SourceConstantAlpha = 255;
SelectObject(dcMem, hbmOld);
DeleteObject(hbm);
@@ -2033,11 +1993,11 @@ UINT CSkin::NcCalcRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID
if (!item->IGNORED)
return WVR_REDRAW;
}
- if (mwdat->hTheme && wParam && CMimAPI::m_pfnGetThemeBackgroundContentRect) {
+ if (mwdat->hTheme && wParam) {
RECT rcClient;
HDC hdc = GetDC(GetParent(hwnd));
- if (CMimAPI::m_pfnGetThemeBackgroundContentRect(mwdat->hTheme, hdc, 1, 1, &nccp->rgrc[0], &rcClient) == S_OK) {
+ if (GetThemeBackgroundContentRect(mwdat->hTheme, hdc, 1, 1, &nccp->rgrc[0], &rcClient) == S_OK) {
if (EqualRect(&rcClient, &nccp->rgrc[0]))
InflateRect(&rcClient, -1, -1);
CopyRect(&nccp->rgrc[0], &rcClient);
@@ -2107,25 +2067,18 @@ UINT CSkin::DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID,
ReleaseDC(hwnd, hdc);
return result;
}
- if (CMimAPI::m_pfnDrawThemeBackground) {
- if (isMultipleReason || isEditNotesReason || isSendLaterReason) {
- HBRUSH br = CreateSolidBrush(isMultipleReason ? RGB(255, 130, 130) : (isEditNotesReason ? RGB(80, 255, 80) : RGB(80, 80, 255)));
+ if (isMultipleReason || isEditNotesReason || isSendLaterReason) {
+ HBRUSH br = CreateSolidBrush(isMultipleReason ? RGB(255, 130, 130) : (isEditNotesReason ? RGB(80, 255, 80) : RGB(80, 80, 255)));
+ FillRect(hdc, &rcWindow, br);
+ DeleteObject(br);
+ } else {
+ if (PluginConfig.m_cRichBorders) {
+ HBRUSH br = CreateSolidBrush(PluginConfig.m_cRichBorders);
FillRect(hdc, &rcWindow, br);
DeleteObject(br);
- } else {
- if (PluginConfig.m_cRichBorders) {
- HBRUSH br = CreateSolidBrush(PluginConfig.m_cRichBorders);
- FillRect(hdc, &rcWindow, br);
- DeleteObject(br);
- }
- else
- CMimAPI::m_pfnDrawThemeBackground(mwdat->hTheme, hdc, 1, 1, &rcWindow, &rcWindow);
}
- }
- else {
- HBRUSH br = CreateSolidBrush(PluginConfig.m_cRichBorders ? PluginConfig.m_cRichBorders : ::GetSysColor(COLOR_3DSHADOW));
- FillRect(hdc, &rcWindow, br);
- DeleteObject(br);
+ else
+ DrawThemeBackground(mwdat->hTheme, hdc, 1, 1, &rcWindow, &rcWindow);
}
ReleaseDC(hwnd, hdc);
return result;
@@ -2366,8 +2319,7 @@ void CSkin::RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindo
dat->pContainer->szOldToolbarSize.cy = cy;
if (!fMustDrawNonThemed && M.isVSThemed()) {
- CMimAPI::m_pfnDrawThemeBackground(dat->hThemeToolbar, dat->pContainer->cachedToolbarDC, 6, 1,
- &rcCachedToolbar, &rcCachedToolbar);
+ DrawThemeBackground(dat->hThemeToolbar, dat->pContainer->cachedToolbarDC, 6, 1, &rcCachedToolbar, &rcCachedToolbar);
dat->pContainer->bTBRenderingMode = 1; // tell TSButton how to render the tool bar buttons
}
else {
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h
index e96e62146d..c611bfcdb2 100644
--- a/plugins/TabSRMM/src/themes.h
+++ b/plugins/TabSRMM/src/themes.h
@@ -289,7 +289,6 @@ public:
*/
static void TSAPI SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdcTarget);
static void TSAPI SkinDrawBG(HWND hwndClient, HWND hwnd, TContainerData *pContainer, RECT *rcClient, HDC hdcTarget);
- static void TSAPI MY_AlphaBlend(HDC hdcDraw, DWORD left, DWORD top, int width, int height, int bmWidth, int bmHeight, HDC hdcMem);
static void TSAPI DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, BYTE alpha);
static DWORD __fastcall HexStringToLong(const TCHAR *szSource);
static UINT TSAPI DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc);
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index 54d4d334e9..651a3f02aa 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -488,16 +485,14 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA
TabCtrl_InsertItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), 0, &tci);
MoveWindow((HWND)tci.lParam, 6, DPISCALEY_S(32), rcClient.right - 12, rcClient.bottom - DPISCALEY_S(80), 1);
ShowWindow((HWND)tci.lParam, SW_SHOW);
- if (CMimAPI::m_pfnEnableThemeDialogTexture)
- CMimAPI::m_pfnEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
+ EnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
tci.lParam = (LPARAM)CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_USERPREFS1), hwndDlg, DlgProcUserPrefsLogOptions, (LPARAM)hContact);
tci.pszText = TranslateT("Message Log");
TabCtrl_InsertItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), 1, &tci);
MoveWindow((HWND)tci.lParam, 6, DPISCALEY_S(32), rcClient.right - 12, rcClient.bottom - DPISCALEY_S(80), 1);
ShowWindow((HWND)tci.lParam, SW_HIDE);
- if (CMimAPI::m_pfnEnableThemeDialogTexture)
- CMimAPI::m_pfnEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
+ EnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
}
TabCtrl_SetCurSel(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), 0);
ShowWindow(hwndDlg, SW_SHOW);
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 0d818bf251..71f0a0d158 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -1,7 +1,4 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -883,8 +880,7 @@ HICON Utils::iconFromAvatar(const TWindowData *dat)
LONG ix = (lIconSize - (LONG)dNewWidth) / 2;
LONG iy = (lIconSize - (LONG)dNewHeight) / 2;
CSkin::m_default_bf.SourceConstantAlpha = M.GetByte("taskBarIconAlpha", 255);
- CMimAPI::m_MyAlphaBlend(dc, ix, iy, (LONG)dNewWidth, (LONG)dNewHeight, dcResized,
- 0, 0, (LONG)dNewWidth, (LONG)dNewHeight, CSkin::m_default_bf);
+ GdiAlphaBlend(dc, ix, iy, (LONG)dNewWidth, (LONG)dNewHeight, dcResized, 0, 0, (LONG)dNewWidth, (LONG)dNewHeight, CSkin::m_default_bf);
CSkin::m_default_bf.SourceConstantAlpha = 255;
::SelectObject(dc, hbmOld);
diff --git a/plugins/TabSRMM/tabsrmm_10.vcxproj b/plugins/TabSRMM/tabsrmm_10.vcxproj
index 7026368532..abaa2f20f9 100644
--- a/plugins/TabSRMM/tabsrmm_10.vcxproj
+++ b/plugins/TabSRMM/tabsrmm_10.vcxproj
@@ -90,7 +90,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>shlwapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -123,7 +123,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>shlwapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -155,7 +155,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>shlwapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
@@ -183,7 +183,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>shlwapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
diff --git a/plugins/TabSRMM/tabsrmm_11.vcxproj b/plugins/TabSRMM/tabsrmm_11.vcxproj
index 7516622a41..114daa0607 100644
--- a/plugins/TabSRMM/tabsrmm_11.vcxproj
+++ b/plugins/TabSRMM/tabsrmm_11.vcxproj
@@ -94,7 +94,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>shlwapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -126,7 +126,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>shlwapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -157,7 +157,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>shlwapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
@@ -186,7 +186,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>shlwapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>