diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-26 17:38:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-26 17:38:31 +0300 |
commit | dea9c030340e50324eba97c72a27c151bed12e1c (patch) | |
tree | 6fc156f40f52a9fc6e6b29e60001959477ee1a5e /plugins/TabSRMM | |
parent | c6e8f8223cab9d799593b7b2cfa22134aa9745d6 (diff) |
AdvaImg:
- freeimage extracted to the separate library;
- FI_INTERFACE removed, all references to it are replaced with direct calls of FreeImage_* functions;
- unified project for AdvaImg
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/mim.cpp | 1 | ||||
-rw-r--r-- | plugins/TabSRMM/src/mim.h | 5 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 5 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sidebar.cpp | 11 | ||||
-rw-r--r-- | plugins/TabSRMM/src/themes.cpp | 16 | ||||
-rw-r--r-- | plugins/TabSRMM/tabsrmm.vcxproj | 5 |
6 files changed, 19 insertions, 24 deletions
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 925ab7033f..f703b02e2c 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -526,4 +526,3 @@ nowindowcreate: } CMimAPI M; -FI_INTERFACE *FIF = nullptr; diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h index c3adebe267..91d3b13f67 100644 --- a/plugins/TabSRMM/src/mim.h +++ b/plugins/TabSRMM/src/mim.h @@ -30,8 +30,6 @@ #ifndef __MIM_H
#define __MIM_H
-extern FI_INTERFACE *FIF;
-
/*
* Win32 API definitions of functions dynamically obtained via GetProcAddress()
* - uxtheme
@@ -78,9 +76,6 @@ public: InitAPI();
getAeroState();
- LRESULT fi_version = CallService(MS_IMG_GETIFVERSION, 0, 0);
- CallService(MS_IMG_GETINTERFACE, fi_version, (LPARAM)&FIF);
-
::QueryPerformanceFrequency((LARGE_INTEGER *)&m_tFreq);
m_dFreq = (double)(1.0f / m_tFreq);
m_hChatLogLock = INVALID_HANDLE_VALUE;
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 0c5148a635..416c2a1641 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -1040,11 +1040,6 @@ static void TSAPI InitAPI() int LoadSendRecvMessageModule(void)
{
- if (FIF == nullptr) {
- MessageBox(nullptr, TranslateT("The image service plugin (AdvaImg) is not properly installed.\n\nTabSRMM is disabled."), TranslateT("TabSRMM fatal error"), MB_OK | MB_ICONERROR);
- return 1;
- }
-
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES;
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index a2a1ab2219..f736e20e98 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -214,12 +214,13 @@ void CSideBarButton::RenderThis(const HDC hdc) const if (fVertical) {
::SelectObject(hdcMem, hbmOld);
- FIBITMAP *fib = FIF->FI_CreateDIBFromHBITMAP(hbmMem);
- FIBITMAP *fib_new = FIF->FI_RotateClassic(fib, 90.0f);
- FIF->FI_Unload(fib);
+ FIBITMAP *fib = FreeImage_CreateDIBFromHBITMAP(hbmMem);
+ FIBITMAP *fib_new = FreeImage_Rotate(fib, 90.0f, nullptr);
+ FreeImage_Unload(fib);
::DeleteObject(hbmMem);
- hbmMem = FIF->FI_CreateHBITMAPFromDIB(fib_new);
- FIF->FI_Unload(fib_new);
+ hbmMem = FreeImage_CreateHBITMAPFromDIB(fib_new);
+ FreeImage_Unload(fib_new);
+
hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(hdcMem, hbmMem));
::BitBlt(hdc, 0, 0, cy, cx, hdcMem, 0, 0, SRCCOPY);
::SelectObject(hdcMem, hbmOld);
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 82a5cece9a..81df273536 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1734,7 +1734,7 @@ void CSkin::setupAeroSkins() FIBITMAP *fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_WCHAR | IMGL_RETURNDIB);
- HBITMAP hbm = FIF->FI_CreateHBITMAPFromDIB(fib);
+ HBITMAP hbm = FreeImage_CreateHBITMAPFromDIB(fib);
CImageItem::Colorize(hbm, GetRValue(m_dwmColorRGB),
GetGValue(m_dwmColorRGB),
@@ -1751,16 +1751,16 @@ void CSkin::setupAeroSkins() m_tabTop->setMetrics(bm.bmWidth, bm.bmHeight);
// created inverted bitmap for bottom tabs
- FIF->FI_FlipVertical(fib);
+ FreeImage_FlipVertical(fib);
- hbm = FIF->FI_CreateHBITMAPFromDIB(fib);
+ hbm = FreeImage_CreateHBITMAPFromDIB(fib);
CImageItem::Colorize(hbm, GetRValue(m_dwmColorRGB),
GetGValue(m_dwmColorRGB),
GetBValue(m_dwmColorRGB));
CImageItem::PreMultiply(hbm, 1);
- FIF->FI_Unload(fib);
+ FreeImage_Unload(fib);
GetObject(hbm, sizeof(bm), &bm);
m_tabBottom = new CImageItem(4, 4, 4, 4, nullptr, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
@@ -1777,7 +1777,7 @@ void CSkin::setupAeroSkins() fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_WCHAR | IMGL_RETURNDIB);
COLORREF glowColor = M.GetDword(FONTMODULE, "aeroGlow", RGB(40, 40, 255));
- hbm = FIF->FI_CreateHBITMAPFromDIB(fib);
+ hbm = FreeImage_CreateHBITMAPFromDIB(fib);
CImageItem::Colorize(hbm, GetRValue(glowColor), GetGValue(glowColor), GetBValue(glowColor));
CImageItem::PreMultiply(hbm, 1);
@@ -1788,12 +1788,12 @@ void CSkin::setupAeroSkins() m_tabGlowTop->setAlphaFormat(AC_SRC_ALPHA, 255);
m_tabGlowTop->setMetrics(bm.bmWidth, bm.bmHeight);
- FIF->FI_FlipVertical(fib);
+ FreeImage_FlipVertical(fib);
- hbm = FIF->FI_CreateHBITMAPFromDIB(fib);
+ hbm = FreeImage_CreateHBITMAPFromDIB(fib);
CImageItem::Colorize(hbm, GetRValue(glowColor), GetGValue(glowColor), GetBValue(glowColor));
CImageItem::PreMultiply(hbm, 1);
- FIF->FI_Unload(fib);
+ FreeImage_Unload(fib);
GetObject(hbm, sizeof(bm), &bm);
m_tabGlowBottom = new CImageItem(4, 4, 4, 4, nullptr, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
diff --git a/plugins/TabSRMM/tabsrmm.vcxproj b/plugins/TabSRMM/tabsrmm.vcxproj index 76cba54dd6..f2533dc33b 100644 --- a/plugins/TabSRMM/tabsrmm.vcxproj +++ b/plugins/TabSRMM/tabsrmm.vcxproj @@ -25,6 +25,11 @@ <ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" />
</ImportGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\libs\freeimage\freeimage.vcxproj">
+ <Project>{5D14CFF3-0D17-4528-99EA-DE9DCA47CC2E}</Project>
+ </ProjectReference>
+ </ItemGroup>
<ItemDefinitionGroup>
<ClCompile>
<ExceptionHandling>Sync</ExceptionHandling>
|