Skip to content

Commit

Permalink
LunaSvgTest restore WIN32_LEAN_AND_MEAN
Browse files Browse the repository at this point in the history
  • Loading branch information
fdwr committed Apr 24, 2022
1 parent 59a9775 commit 6b1284e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 37 deletions.
8 changes: 7 additions & 1 deletion source/LunaSvgTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,11 @@ const std::wstring_view g_defaultMessage =
L"F5 = reload current files\r\n"
L"ctrl c = copy bitmap to clipboard\r\n"
L"\r\n"
L"left mouse click = show item & coordinate\r\n"
L"middle mouse drag = pan\r\n"
L"mouse wheel = pan vertically\r\n"
L"mouse wheel + shift = pan horizontally\r\n"
L"mouse wheel + ctrl = zoom\r\n"
L"middle mouse drag = pan\r\n"
L"arrow keys/home/end/pgup/pgdn = pan\r\n"
L"+/- = increase/decrease zoom\r\n"
L"ctrl +/- = increase/decrease object size\r\n"
Expand Down Expand Up @@ -1278,6 +1279,8 @@ HRESULT LoadImageData(
/*out*/ std::unique_ptr<std::byte[]>& pixelBytes
)
{
assert(g_wicFactory.Get() != nullptr);

pixelBytes.reset();

uint32_t const channelCount = 4;
Expand Down Expand Up @@ -1334,6 +1337,7 @@ HRESULT LoadImageData(
RETURN_IF_FAILED(pixelSource->CopyPixels(&rect, rowByteStride, bufferByteSize, /*out*/ reinterpret_cast<uint8_t*>(pixelBytes.get())));

dimensions = { uint32_t(width), uint32_t(height), uint32_t(channelCount), 1};

return S_OK;
}

Expand All @@ -1344,6 +1348,8 @@ HRESULT StoreImageData(
_In_z_ wchar_t const* outputFilename
)
{
assert(g_wicFactory.Get() != nullptr);

std::pair<std::wstring_view, GUID const*> static constexpr filenameExtensionToGuidMappings[] =
{
// The commented formats have issues on Windows 7 (hresult = 0x88982F50) or bad output.
Expand Down
40 changes: 4 additions & 36 deletions source/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include <SDKDDKVer.h>

//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
//#define NOMINMAX
#ifndef UNICODE
#define UNICODE
Expand All @@ -23,7 +23,10 @@
#include <commctrl.h> // for tooltip
#include <commdlg.h> // GetOpenFileName
#include <shellapi.h> // DragQueryFile
#include <rpc.h>
#include <rpcndr.h> // for GDI+
#include <combaseapi.h> // for GDI+
#include <wtypes.h> // for GDI+
#include <gdiplus.h>
#include <WinCodec.h>
#include <wrl/client.h>
Expand All @@ -40,41 +43,6 @@ extern "C"
);
}

/*
#include <cderr.h>
#include <dde.h>
#include <ddeml.h>
#include <dlgs.h>
#ifndef _MAC
#include <lzexpand.h>
#include <mmsystem.h>
#include <nb30.h>
#include <rpc.h>
#endif
#include <shellapi.h>
#ifndef _MAC
#include <winperf.h>
#include <winsock.h>
#endif
#ifndef NOCRYPT
#include <wincrypt.h>
#include <winefs.h>
#include <winscard.h>
#endif
#ifndef NOGDI
#ifndef _MAC
#include <winspool.h>
#ifdef INC_OLE1
#include <ole.h>
#else
#include <ole2.h>
#endif // !INC_OLE1
#endif // !MAC
#include <commdlg.h>
#endif // !NOGDI
*/

// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
Expand Down

0 comments on commit 6b1284e

Please sign in to comment.