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 /protocols/VKontakte | |
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 'protocols/VKontakte')
-rw-r--r-- | protocols/VKontakte/src/main.cpp | 3 | ||||
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 12 | ||||
-rw-r--r-- | protocols/VKontakte/src/stdafx.h | 1 | ||||
-rw-r--r-- | protocols/VKontakte/vk.vcxproj | 3 |
4 files changed, 10 insertions, 9 deletions
diff --git a/protocols/VKontakte/src/main.cpp b/protocols/VKontakte/src/main.cpp index 28ce73acae..8f367d6c02 100644 --- a/protocols/VKontakte/src/main.cpp +++ b/protocols/VKontakte/src/main.cpp @@ -21,7 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. HINSTANCE hInst;
int hLangpack;
CLIST_INTERFACE *pcli;
-FI_INTERFACE *fii;
PLUGININFOEX pluginInfo =
{
@@ -71,7 +70,7 @@ extern "C" int __declspec(dllexport) Load() {
mir_getLP(&pluginInfo);
pcli = Clist_GetInterface();
- CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fii);
+
InitIcons();
// Register protocol module
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index b9d155e48b..1169de5b01 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -1469,16 +1469,16 @@ void CVkProto::ShowCaptchaInBrowser(HBITMAP hBitmap) if (pFile == nullptr)
return;
- FIBITMAP *dib = fii->FI_CreateDIBFromHBITMAP(hBitmap);
- FIMEMORY *hMem = fii->FI_OpenMemory(nullptr, 0);
- fii->FI_SaveToMemory(FIF_PNG, dib, hMem, 0);
+ FIBITMAP *dib = FreeImage_CreateDIBFromHBITMAP(hBitmap);
+ FIMEMORY *hMem = FreeImage_OpenMemory(nullptr, 0);
+ FreeImage_SaveToMemory(FIF_PNG, dib, hMem, 0);
BYTE *buf = nullptr;
DWORD bufLen;
- fii->FI_AcquireMemory(hMem, &buf, &bufLen);
+ FreeImage_AcquireMemory(hMem, &buf, &bufLen);
ptrA base64(mir_base64_encode(buf, bufLen));
- fii->FI_CloseMemory(hMem);
- fii->FI_Unload(dib);
+ FreeImage_CloseMemory(hMem);
+ FreeImage_Unload(dib);
CMStringA szHTML(FORMAT, "<html><body><img src=\"data:image/png;base64,%s\" /></body></html>", base64);
fwrite(szHTML, 1, szHTML.GetLength(), pFile);
diff --git a/protocols/VKontakte/src/stdafx.h b/protocols/VKontakte/src/stdafx.h index 6a78386a59..148637c0a0 100644 --- a/protocols/VKontakte/src/stdafx.h +++ b/protocols/VKontakte/src/stdafx.h @@ -56,7 +56,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "win2k.h"
-extern FI_INTERFACE *fii;
extern HINSTANCE hInst;
#include "resource.h"
diff --git a/protocols/VKontakte/vk.vcxproj b/protocols/VKontakte/vk.vcxproj index b4090002ff..7452affb5e 100644 --- a/protocols/VKontakte/vk.vcxproj +++ b/protocols/VKontakte/vk.vcxproj @@ -34,5 +34,8 @@ <ProjectReference Include="..\..\libs\libjson\libjson.vcxproj">
<Project>{f6a9340e-b8d9-4c75-be30-47dc66d0abc7}</Project>
</ProjectReference>
+ <ProjectReference Include="..\..\libs\freeimage\freeimage.vcxproj">
+ <Project>{5D14CFF3-0D17-4528-99EA-DE9DCA47CC2E}</Project>
+ </ProjectReference>
</ItemGroup>
</Project>
\ No newline at end of file |