From 8bb8f76facb2a3d1f9a79663f017d6ed4de292de Mon Sep 17 00:00:00 2001 From: mosfet80 Date: Fri, 17 Mar 2023 11:06:21 +0100 Subject: [PATCH] Delete deprecated thumbnailer (#8798) Remove thumbs --- .../ThumbnailProvider/CMakeLists.txt | 0 .../ThumbnailProvider/ClassFactory.cpp | 216 +++--- .../ThumbnailProvider/ClassFactory.h | 88 +-- .../{thumbs => }/ThumbnailProvider/Common.h | 78 +-- .../{thumbs => }/ThumbnailProvider/FCConfig.h | 348 +++++----- .../{thumbs => }/ThumbnailProvider/Main.cpp | 388 +++++------ .../ThumbnailProvider/ThumbnailProvider.cpp | 650 +++++++++--------- .../ThumbnailProvider/ThumbnailProvider.def | 12 +- .../ThumbnailProvider/ThumbnailProvider.h | 110 +-- .../ThumbnailProvider/ThumbnailProvider.sln | 62 +- .../ThumbnailProvider.vcxproj | 488 ++++++------- src/Tools/thumbs/FCStdExtractor.cpp | 308 --------- src/Tools/thumbs/FCStdExtractor.h | 99 --- src/Tools/thumbs/FCThumbs.def | 11 - src/Tools/thumbs/FCThumbs.dsp | 392 ----------- src/Tools/thumbs/FCThumbs.rc | 160 ----- src/Tools/thumbs/FCThumbs.rgs | 35 - src/Tools/thumbs/FCThumbs.sln | 43 -- src/Tools/thumbs/FCThumbs.vcxproj | 582 ---------------- src/Tools/thumbs/IExtractImage.h | 55 -- src/Tools/thumbs/Resource.h | 40 -- src/Tools/thumbs/StdAfx.cpp | 35 - src/Tools/thumbs/StdAfx.h | 47 -- src/Tools/thumbs/ThumbFCStd.idl | 38 - 24 files changed, 1220 insertions(+), 3065 deletions(-) rename src/Tools/{thumbs => }/ThumbnailProvider/CMakeLists.txt (100%) rename src/Tools/{thumbs => }/ThumbnailProvider/ClassFactory.cpp (96%) rename src/Tools/{thumbs => }/ThumbnailProvider/ClassFactory.h (97%) rename src/Tools/{thumbs => }/ThumbnailProvider/Common.h (98%) rename src/Tools/{thumbs => }/ThumbnailProvider/FCConfig.h (96%) rename src/Tools/{thumbs => }/ThumbnailProvider/Main.cpp (97%) rename src/Tools/{thumbs => }/ThumbnailProvider/ThumbnailProvider.cpp (96%) rename src/Tools/{thumbs => }/ThumbnailProvider/ThumbnailProvider.def (95%) rename src/Tools/{thumbs => }/ThumbnailProvider/ThumbnailProvider.h (97%) rename src/Tools/{thumbs => }/ThumbnailProvider/ThumbnailProvider.sln (97%) rename src/Tools/{thumbs => }/ThumbnailProvider/ThumbnailProvider.vcxproj (98%) delete mode 100644 src/Tools/thumbs/FCStdExtractor.cpp delete mode 100644 src/Tools/thumbs/FCStdExtractor.h delete mode 100644 src/Tools/thumbs/FCThumbs.def delete mode 100644 src/Tools/thumbs/FCThumbs.dsp delete mode 100644 src/Tools/thumbs/FCThumbs.rc delete mode 100644 src/Tools/thumbs/FCThumbs.rgs delete mode 100644 src/Tools/thumbs/FCThumbs.sln delete mode 100644 src/Tools/thumbs/FCThumbs.vcxproj delete mode 100644 src/Tools/thumbs/IExtractImage.h delete mode 100644 src/Tools/thumbs/Resource.h delete mode 100644 src/Tools/thumbs/StdAfx.cpp delete mode 100644 src/Tools/thumbs/StdAfx.h delete mode 100644 src/Tools/thumbs/ThumbFCStd.idl diff --git a/src/Tools/thumbs/ThumbnailProvider/CMakeLists.txt b/src/Tools/ThumbnailProvider/CMakeLists.txt similarity index 100% rename from src/Tools/thumbs/ThumbnailProvider/CMakeLists.txt rename to src/Tools/ThumbnailProvider/CMakeLists.txt diff --git a/src/Tools/thumbs/ThumbnailProvider/ClassFactory.cpp b/src/Tools/ThumbnailProvider/ClassFactory.cpp similarity index 96% rename from src/Tools/thumbs/ThumbnailProvider/ClassFactory.cpp rename to src/Tools/ThumbnailProvider/ClassFactory.cpp index 524e37dd58..54108c983c 100644 --- a/src/Tools/thumbs/ThumbnailProvider/ClassFactory.cpp +++ b/src/Tools/ThumbnailProvider/ClassFactory.cpp @@ -1,109 +1,109 @@ -/*************************************************************************** - * Copyright (c) 2011 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -#define INITGUID -#include "Common.h" -#include "ClassFactory.h" - -STDAPI CThumbnailProvider_CreateInstance(REFIID riid, void** ppvObject); - - -CClassFactory::CClassFactory() -{ - m_cRef = 1; - DllAddRef(); -} - - -CClassFactory::~CClassFactory() -{ - DllRelease(); -} - - -STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, - void** ppvObject) -{ - static const QITAB qit[] = - { - QITABENT(CClassFactory, IClassFactory), - {0}, - }; - return QISearch(this, qit, riid, ppvObject); -} - - -STDMETHODIMP_(ULONG) CClassFactory::AddRef() -{ - LONG cRef = InterlockedIncrement(&m_cRef); - return (ULONG)cRef; -} - - -STDMETHODIMP_(ULONG) CClassFactory::Release() -{ - LONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - delete this; - return (ULONG)cRef; -} - - -STDMETHODIMP CClassFactory::CreateInstance(IUnknown* punkOuter, - REFIID riid, - void** ppvObject) -{ - if (NULL != punkOuter) - return CLASS_E_NOAGGREGATION; - - return CThumbnailProvider_CreateInstance(riid, ppvObject); -} - - -STDMETHODIMP CClassFactory::LockServer(BOOL fLock) -{ - return E_NOTIMPL; -} - - -STDAPI DllGetClassObject(REFCLSID rclsid, - REFIID riid, - void **ppv) -{ - if (NULL == ppv) - return E_INVALIDARG; - - if (!IsEqualCLSID(CLSID_SampleThumbnailProvider, rclsid)) - return CLASS_E_CLASSNOTAVAILABLE; - - CClassFactory *pcf; - HRESULT hr; - - pcf = new CClassFactory(); - if (NULL == pcf) - return E_OUTOFMEMORY; - - hr = pcf->QueryInterface(riid, ppv); - pcf->Release(); - return hr; +/*************************************************************************** + * Copyright (c) 2011 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#define INITGUID +#include "Common.h" +#include "ClassFactory.h" + +STDAPI CThumbnailProvider_CreateInstance(REFIID riid, void** ppvObject); + + +CClassFactory::CClassFactory() +{ + m_cRef = 1; + DllAddRef(); +} + + +CClassFactory::~CClassFactory() +{ + DllRelease(); +} + + +STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, + void** ppvObject) +{ + static const QITAB qit[] = + { + QITABENT(CClassFactory, IClassFactory), + {0}, + }; + return QISearch(this, qit, riid, ppvObject); +} + + +STDMETHODIMP_(ULONG) CClassFactory::AddRef() +{ + LONG cRef = InterlockedIncrement(&m_cRef); + return (ULONG)cRef; +} + + +STDMETHODIMP_(ULONG) CClassFactory::Release() +{ + LONG cRef = InterlockedDecrement(&m_cRef); + if (0 == cRef) + delete this; + return (ULONG)cRef; +} + + +STDMETHODIMP CClassFactory::CreateInstance(IUnknown* punkOuter, + REFIID riid, + void** ppvObject) +{ + if (NULL != punkOuter) + return CLASS_E_NOAGGREGATION; + + return CThumbnailProvider_CreateInstance(riid, ppvObject); +} + + +STDMETHODIMP CClassFactory::LockServer(BOOL fLock) +{ + return E_NOTIMPL; +} + + +STDAPI DllGetClassObject(REFCLSID rclsid, + REFIID riid, + void **ppv) +{ + if (NULL == ppv) + return E_INVALIDARG; + + if (!IsEqualCLSID(CLSID_SampleThumbnailProvider, rclsid)) + return CLASS_E_CLASSNOTAVAILABLE; + + CClassFactory *pcf; + HRESULT hr; + + pcf = new CClassFactory(); + if (NULL == pcf) + return E_OUTOFMEMORY; + + hr = pcf->QueryInterface(riid, ppv); + pcf->Release(); + return hr; } \ No newline at end of file diff --git a/src/Tools/thumbs/ThumbnailProvider/ClassFactory.h b/src/Tools/ThumbnailProvider/ClassFactory.h similarity index 97% rename from src/Tools/thumbs/ThumbnailProvider/ClassFactory.h rename to src/Tools/ThumbnailProvider/ClassFactory.h index 6ee6097681..b6e75c8833 100644 --- a/src/Tools/thumbs/ThumbnailProvider/ClassFactory.h +++ b/src/Tools/ThumbnailProvider/ClassFactory.h @@ -1,44 +1,44 @@ -/*************************************************************************** - * Copyright (c) 2011 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -#pragma once - -class CClassFactory : public IClassFactory -{ -private: - LONG m_cRef; - - ~CClassFactory(); - -public: - CClassFactory(); - - // IUnknown methods - STDMETHOD(QueryInterface)(REFIID, void**); - STDMETHOD_(ULONG, AddRef)(); - STDMETHOD_(ULONG, Release)(); - - // IClassFactory methods - STDMETHOD(CreateInstance)(IUnknown*, REFIID, void**); - STDMETHOD(LockServer)(BOOL); -}; +/*************************************************************************** + * Copyright (c) 2011 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#pragma once + +class CClassFactory : public IClassFactory +{ +private: + LONG m_cRef; + + ~CClassFactory(); + +public: + CClassFactory(); + + // IUnknown methods + STDMETHOD(QueryInterface)(REFIID, void**); + STDMETHOD_(ULONG, AddRef)(); + STDMETHOD_(ULONG, Release)(); + + // IClassFactory methods + STDMETHOD(CreateInstance)(IUnknown*, REFIID, void**); + STDMETHOD(LockServer)(BOOL); +}; diff --git a/src/Tools/thumbs/ThumbnailProvider/Common.h b/src/Tools/ThumbnailProvider/Common.h similarity index 98% rename from src/Tools/thumbs/ThumbnailProvider/Common.h rename to src/Tools/ThumbnailProvider/Common.h index 770e652934..6df80b8480 100644 --- a/src/Tools/thumbs/ThumbnailProvider/Common.h +++ b/src/Tools/ThumbnailProvider/Common.h @@ -1,39 +1,39 @@ -/*************************************************************************** - * Copyright (c) 2011 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -#pragma once - -#include -#include -#include -#include -#include -#include - -STDAPI_(ULONG) DllAddRef(); -STDAPI_(ULONG) DllRelease(); -STDAPI_(HINSTANCE) DllInstance(); - -// {4BBBEAB5-BE00-41f4-A209-FE838660B9B1} -#define szCLSID_SampleThumbnailProvider L"{4BBBEAB5-BE00-41f4-A209-FE838660B9B1}" -DEFINE_GUID(CLSID_SampleThumbnailProvider, 0x4bbbeab5, 0xbe00, 0x41f4, 0xa2, 0x9, 0xfe, 0x83, 0x86, 0x60, 0xb9, 0xb1); +/*************************************************************************** + * Copyright (c) 2011 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#pragma once + +#include +#include +#include +#include +#include +#include + +STDAPI_(ULONG) DllAddRef(); +STDAPI_(ULONG) DllRelease(); +STDAPI_(HINSTANCE) DllInstance(); + +// {4BBBEAB5-BE00-41f4-A209-FE838660B9B1} +#define szCLSID_SampleThumbnailProvider L"{4BBBEAB5-BE00-41f4-A209-FE838660B9B1}" +DEFINE_GUID(CLSID_SampleThumbnailProvider, 0x4bbbeab5, 0xbe00, 0x41f4, 0xa2, 0x9, 0xfe, 0x83, 0x86, 0x60, 0xb9, 0xb1); diff --git a/src/Tools/thumbs/ThumbnailProvider/FCConfig.h b/src/Tools/ThumbnailProvider/FCConfig.h similarity index 96% rename from src/Tools/thumbs/ThumbnailProvider/FCConfig.h rename to src/Tools/ThumbnailProvider/FCConfig.h index dcccffa2a3..30403c7ba3 100644 --- a/src/Tools/thumbs/ThumbnailProvider/FCConfig.h +++ b/src/Tools/ThumbnailProvider/FCConfig.h @@ -1,174 +1,174 @@ -/*************************************************************************** - * Copyright (c) 2004 Jürgen Riegel * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ -/** \file FCConfig.h - * \brief Include all needed defines and macros - * Here all defines and macro switching is done for FreeCAD. - * Every used library has its own section to define the configuration. - * This file keeps the makefiles and project files cleaner. - */ - - -#ifndef FC_CONFIG_H -#define FC_CONFIG_H - - - -//************************************************************************** -// switching the operating systems - -// First check for *WIN64* since the *WIN32* are also set on 64-bit platforms -#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) -# ifndef FC_OS_WIN32 -# define FC_OS_WIN32 -# endif -# ifndef FC_OS_WIN64 -# define FC_OS_WIN64 -# endif -#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) -# ifndef FC_OS_WIN32 -# define FC_OS_WIN32 -# endif -# if defined(__MINGW32__) -# if HAVE_CONFIG_H -# include -# endif // HAVE_CONFIG_H -# endif -#elif defined(__MWERKS__) && defined(__INTEL__) -# ifndef FC_OS_WIN32 -# define FC_OS_WIN32 -# endif -#elif defined(__APPLE__) -# ifndef FC_OS_MACOSX -# define FC_OS_MACOSX -# endif -#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__GLIBC__) -# ifndef FC_OS_LINUX -# define FC_OS_LINUX -# endif -#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) -# ifndef FC_OS_BSD -# define FC_OS_BSD -# endif -#elif defined(__CYGWIN__) -# ifndef FC_OS_CYGWIN -# define FC_OS_CYGWIN -// Avoid conflicts with Inventor -# define HAVE_INT8_T -# define HAVE_UINT8_T -# define HAVE_INT16_T -# define HAVE_UINT16_T -# define HAVE_INT32_T -# define HAVE_UINT32_T -# define HAVE_INT64_T -# define HAVE_UINT64_T -# define HAVE_INTPTR_T -# define HAVE_UINTPTR_T -#endif -#else -# error "FreeCAD is not ported to this OS yet. For help see www.freecadweb.org" -#endif - -#ifdef FC_OS_WIN32 -# define PATHSEP '\\' -#else -# define PATHSEP '/' -#endif - -//************************************************************************** -// Standard types for Windows - -#if defined(__MINGW32__) -// nothing specific here -#elif defined (FC_OS_WIN64) || defined (FC_OS_WIN32) - -#ifndef HAVE_INT8_T -#define HAVE_INT8_T -typedef signed char int8_t; -#endif - -#ifndef HAVE_UINT8_T -#define HAVE_UINT8_T -typedef unsigned char uint8_t; -#endif - -#ifndef HAVE_INT16_T -#define HAVE_INT16_T -typedef short int16_t; -#endif - -#ifndef HAVE_UINT16_T -#define HAVE_UINT16_T -typedef unsigned short uint16_t; -#endif - -#ifndef HAVE_INT32_T -#define HAVE_INT32_T -typedef int int32_t; -#endif - -#ifndef HAVE_UINT32_T -#define HAVE_UINT32_T -typedef unsigned int uint32_t; -#endif - -#ifndef HAVE_INT64_T -#define HAVE_INT64_T -typedef __int64 int64_t; -#endif - -#ifndef HAVE_UINT64_T -#define HAVE_UINT64_T -typedef unsigned __int64 uint64_t; -#endif - -#endif - - -//************************************************************************** -// Windows import export DLL defines -#ifndef BaseExport -# define BaseExport -#endif -#ifndef GuiExport -# define GuiExport -#endif -#ifndef AppExport -# define AppExport -#endif -#ifndef DataExport -# define DataExport -#endif - - -//************************************************************************** -// point at which warnings of overly long specifiers disabled (needed for VC6) -#ifdef _MSC_VER -# pragma warning( disable : 4251 ) -# pragma warning( disable : 4996 ) // suppress deprecated warning for e.g. open() -#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) -# pragma warning( disable : 4244 ) -# pragma warning( disable : 4267 ) -#endif -#endif - - -#endif //FC_CONFIG_H +/*************************************************************************** + * Copyright (c) 2004 Jürgen Riegel * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ +/** \file FCConfig.h + * \brief Include all needed defines and macros + * Here all defines and macro switching is done for FreeCAD. + * Every used library has its own section to define the configuration. + * This file keeps the makefiles and project files cleaner. + */ + + +#ifndef FC_CONFIG_H +#define FC_CONFIG_H + + + +//************************************************************************** +// switching the operating systems + +// First check for *WIN64* since the *WIN32* are also set on 64-bit platforms +#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) +# ifndef FC_OS_WIN32 +# define FC_OS_WIN32 +# endif +# ifndef FC_OS_WIN64 +# define FC_OS_WIN64 +# endif +#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) +# ifndef FC_OS_WIN32 +# define FC_OS_WIN32 +# endif +# if defined(__MINGW32__) +# if HAVE_CONFIG_H +# include +# endif // HAVE_CONFIG_H +# endif +#elif defined(__MWERKS__) && defined(__INTEL__) +# ifndef FC_OS_WIN32 +# define FC_OS_WIN32 +# endif +#elif defined(__APPLE__) +# ifndef FC_OS_MACOSX +# define FC_OS_MACOSX +# endif +#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__GLIBC__) +# ifndef FC_OS_LINUX +# define FC_OS_LINUX +# endif +#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) +# ifndef FC_OS_BSD +# define FC_OS_BSD +# endif +#elif defined(__CYGWIN__) +# ifndef FC_OS_CYGWIN +# define FC_OS_CYGWIN +// Avoid conflicts with Inventor +# define HAVE_INT8_T +# define HAVE_UINT8_T +# define HAVE_INT16_T +# define HAVE_UINT16_T +# define HAVE_INT32_T +# define HAVE_UINT32_T +# define HAVE_INT64_T +# define HAVE_UINT64_T +# define HAVE_INTPTR_T +# define HAVE_UINTPTR_T +#endif +#else +# error "FreeCAD is not ported to this OS yet. For help see www.freecadweb.org" +#endif + +#ifdef FC_OS_WIN32 +# define PATHSEP '\\' +#else +# define PATHSEP '/' +#endif + +//************************************************************************** +// Standard types for Windows + +#if defined(__MINGW32__) +// nothing specific here +#elif defined (FC_OS_WIN64) || defined (FC_OS_WIN32) + +#ifndef HAVE_INT8_T +#define HAVE_INT8_T +typedef signed char int8_t; +#endif + +#ifndef HAVE_UINT8_T +#define HAVE_UINT8_T +typedef unsigned char uint8_t; +#endif + +#ifndef HAVE_INT16_T +#define HAVE_INT16_T +typedef short int16_t; +#endif + +#ifndef HAVE_UINT16_T +#define HAVE_UINT16_T +typedef unsigned short uint16_t; +#endif + +#ifndef HAVE_INT32_T +#define HAVE_INT32_T +typedef int int32_t; +#endif + +#ifndef HAVE_UINT32_T +#define HAVE_UINT32_T +typedef unsigned int uint32_t; +#endif + +#ifndef HAVE_INT64_T +#define HAVE_INT64_T +typedef __int64 int64_t; +#endif + +#ifndef HAVE_UINT64_T +#define HAVE_UINT64_T +typedef unsigned __int64 uint64_t; +#endif + +#endif + + +//************************************************************************** +// Windows import export DLL defines +#ifndef BaseExport +# define BaseExport +#endif +#ifndef GuiExport +# define GuiExport +#endif +#ifndef AppExport +# define AppExport +#endif +#ifndef DataExport +# define DataExport +#endif + + +//************************************************************************** +// point at which warnings of overly long specifiers disabled (needed for VC6) +#ifdef _MSC_VER +# pragma warning( disable : 4251 ) +# pragma warning( disable : 4996 ) // suppress deprecated warning for e.g. open() +#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) +# pragma warning( disable : 4244 ) +# pragma warning( disable : 4267 ) +#endif +#endif + + +#endif //FC_CONFIG_H diff --git a/src/Tools/thumbs/ThumbnailProvider/Main.cpp b/src/Tools/ThumbnailProvider/Main.cpp similarity index 97% rename from src/Tools/thumbs/ThumbnailProvider/Main.cpp rename to src/Tools/ThumbnailProvider/Main.cpp index 7aacc17622..38cc6a7374 100644 --- a/src/Tools/thumbs/ThumbnailProvider/Main.cpp +++ b/src/Tools/ThumbnailProvider/Main.cpp @@ -1,195 +1,195 @@ -/*************************************************************************** - * Copyright (c) 2011 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -#define INITGUID -#include "Common.h" - -HINSTANCE g_hinstDll = NULL; -LONG g_cRef = 0; - - -typedef struct _REGKEY_DELETEKEY -{ - HKEY hKey; - LPCWSTR lpszSubKey; -} REGKEY_DELETEKEY; - - -typedef struct _REGKEY_SUBKEY_AND_VALUE -{ - HKEY hKey; - LPCWSTR lpszSubKey; - LPCWSTR lpszValue; - DWORD dwType; - DWORD_PTR dwData; -; -} REGKEY_SUBKEY_AND_VALUE; - -STDAPI CreateRegistryKeys(REGKEY_SUBKEY_AND_VALUE* aKeys, ULONG cKeys); -STDAPI DeleteRegistryKeys(REGKEY_DELETEKEY* aKeys, ULONG cKeys); - - -BOOL APIENTRY DllMain(HINSTANCE hinstDll, - DWORD dwReason, - LPVOID pvReserved) -{ - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - g_hinstDll = hinstDll; - break; - } - return TRUE; -} - -STDAPI_(HINSTANCE) DllInstance() -{ - return g_hinstDll; -} - -STDAPI DllCanUnloadNow() -{ - return g_cRef ? S_FALSE : S_OK; -} - -STDAPI_(ULONG) DllAddRef() -{ - LONG cRef = InterlockedIncrement(&g_cRef); - return cRef; -} - -STDAPI_(ULONG) DllRelease() -{ - LONG cRef = InterlockedDecrement(&g_cRef); - if (0 > cRef) - cRef = 0; - return cRef; -} - -STDAPI DllRegisterServer() -{ - // This tells the shell to invalidate the thumbnail cache. This is important because any .recipe files - // viewed before registering this handler would otherwise show cached blank thumbnails. - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); - - WCHAR szModule[MAX_PATH]; - - ZeroMemory(szModule, sizeof(szModule)); - GetModuleFileName(g_hinstDll, szModule, ARRAYSIZE(szModule)); - - //uncomment the following - REGKEY_SUBKEY_AND_VALUE keys[] = { - {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider, NULL, REG_SZ, (DWORD_PTR)L"FCStd Thumbnail Provider"}, -#if 1 - //{HKEY_CLASSES_ROOT, L"CLSID\\DisableProcessIsolation", NULL, REG_DWORD, (DWORD) 1}, - {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider, L"DisableProcessIsolation", REG_DWORD, (DWORD) 1}, -#endif - {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider L"\\InprocServer32", NULL, REG_SZ, (DWORD_PTR)szModule}, - {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider L"\\InprocServer32", L"ThreadingModel", REG_SZ, (DWORD_PTR)L"Apartment"}, - //{HKEY_CLASSES_ROOT, L".FCStd\\shellex", L"Trick only here to create shellex when not existing",REG_DWORD, 1}, - {HKEY_CLASSES_ROOT, L".FCStd\\shellex\\{E357FCCD-A995-4576-B01F-234630154E96}", NULL, REG_SZ, (DWORD_PTR)szCLSID_SampleThumbnailProvider}, - {HKEY_CLASSES_ROOT, L".FCBak\\shellex\\{E357FCCD-A995-4576-B01F-234630154E96}", NULL, REG_SZ, (DWORD_PTR)szCLSID_SampleThumbnailProvider} - }; - - return CreateRegistryKeys(keys, ARRAYSIZE(keys)); -} - -STDAPI DllUnregisterServer() -{ - REGKEY_DELETEKEY keys[] = {{HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider}}; - return DeleteRegistryKeys(keys, ARRAYSIZE(keys)); -} - - -STDAPI CreateRegistryKey(REGKEY_SUBKEY_AND_VALUE* pKey) -{ - size_t cbData; - LPVOID pvData = NULL; - HRESULT hr = S_OK; - - switch(pKey->dwType) - { - case REG_DWORD: - pvData = (LPVOID)(LPDWORD)&pKey->dwData; - cbData = sizeof(DWORD); - break; - - case REG_SZ: - case REG_EXPAND_SZ: - hr = StringCbLength((LPCWSTR)pKey->dwData, STRSAFE_MAX_CCH, &cbData); - if (SUCCEEDED(hr)) - { - pvData = (LPVOID)(LPCWSTR)pKey->dwData; - cbData += sizeof(WCHAR); - } - break; - - default: - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr)) - { - LSTATUS status = SHSetValue(pKey->hKey, pKey->lpszSubKey, pKey->lpszValue, pKey->dwType, pvData, (DWORD)cbData); - if (NOERROR != status) - { - hr = HRESULT_FROM_WIN32(status); - } - } - - return hr; -} - - - -STDAPI CreateRegistryKeys(REGKEY_SUBKEY_AND_VALUE* aKeys, ULONG cKeys) -{ - HRESULT hr = S_OK; - - for (ULONG iKey = 0; iKey < cKeys; iKey++) - { - HRESULT hrTemp = CreateRegistryKey(&aKeys[iKey]); - if (FAILED(hrTemp)) - { - hr = hrTemp; - } - } - return hr; -} - - -STDAPI DeleteRegistryKeys(REGKEY_DELETEKEY* aKeys, ULONG cKeys) -{ - HRESULT hr = S_OK; - LSTATUS status; - - for (ULONG iKey = 0; iKey < cKeys; iKey++) - { - status = RegDeleteTree(aKeys[iKey].hKey, aKeys[iKey].lpszSubKey); - if (NOERROR != status) - { - hr = HRESULT_FROM_WIN32(status); - } - } - return hr; +/*************************************************************************** + * Copyright (c) 2011 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#define INITGUID +#include "Common.h" + +HINSTANCE g_hinstDll = NULL; +LONG g_cRef = 0; + + +typedef struct _REGKEY_DELETEKEY +{ + HKEY hKey; + LPCWSTR lpszSubKey; +} REGKEY_DELETEKEY; + + +typedef struct _REGKEY_SUBKEY_AND_VALUE +{ + HKEY hKey; + LPCWSTR lpszSubKey; + LPCWSTR lpszValue; + DWORD dwType; + DWORD_PTR dwData; +; +} REGKEY_SUBKEY_AND_VALUE; + +STDAPI CreateRegistryKeys(REGKEY_SUBKEY_AND_VALUE* aKeys, ULONG cKeys); +STDAPI DeleteRegistryKeys(REGKEY_DELETEKEY* aKeys, ULONG cKeys); + + +BOOL APIENTRY DllMain(HINSTANCE hinstDll, + DWORD dwReason, + LPVOID pvReserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + g_hinstDll = hinstDll; + break; + } + return TRUE; +} + +STDAPI_(HINSTANCE) DllInstance() +{ + return g_hinstDll; +} + +STDAPI DllCanUnloadNow() +{ + return g_cRef ? S_FALSE : S_OK; +} + +STDAPI_(ULONG) DllAddRef() +{ + LONG cRef = InterlockedIncrement(&g_cRef); + return cRef; +} + +STDAPI_(ULONG) DllRelease() +{ + LONG cRef = InterlockedDecrement(&g_cRef); + if (0 > cRef) + cRef = 0; + return cRef; +} + +STDAPI DllRegisterServer() +{ + // This tells the shell to invalidate the thumbnail cache. This is important because any .recipe files + // viewed before registering this handler would otherwise show cached blank thumbnails. + SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); + + WCHAR szModule[MAX_PATH]; + + ZeroMemory(szModule, sizeof(szModule)); + GetModuleFileName(g_hinstDll, szModule, ARRAYSIZE(szModule)); + + //uncomment the following + REGKEY_SUBKEY_AND_VALUE keys[] = { + {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider, NULL, REG_SZ, (DWORD_PTR)L"FCStd Thumbnail Provider"}, +#if 1 + //{HKEY_CLASSES_ROOT, L"CLSID\\DisableProcessIsolation", NULL, REG_DWORD, (DWORD) 1}, + {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider, L"DisableProcessIsolation", REG_DWORD, (DWORD) 1}, +#endif + {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider L"\\InprocServer32", NULL, REG_SZ, (DWORD_PTR)szModule}, + {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider L"\\InprocServer32", L"ThreadingModel", REG_SZ, (DWORD_PTR)L"Apartment"}, + //{HKEY_CLASSES_ROOT, L".FCStd\\shellex", L"Trick only here to create shellex when not existing",REG_DWORD, 1}, + {HKEY_CLASSES_ROOT, L".FCStd\\shellex\\{E357FCCD-A995-4576-B01F-234630154E96}", NULL, REG_SZ, (DWORD_PTR)szCLSID_SampleThumbnailProvider}, + {HKEY_CLASSES_ROOT, L".FCBak\\shellex\\{E357FCCD-A995-4576-B01F-234630154E96}", NULL, REG_SZ, (DWORD_PTR)szCLSID_SampleThumbnailProvider} + }; + + return CreateRegistryKeys(keys, ARRAYSIZE(keys)); +} + +STDAPI DllUnregisterServer() +{ + REGKEY_DELETEKEY keys[] = {{HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider}}; + return DeleteRegistryKeys(keys, ARRAYSIZE(keys)); +} + + +STDAPI CreateRegistryKey(REGKEY_SUBKEY_AND_VALUE* pKey) +{ + size_t cbData; + LPVOID pvData = NULL; + HRESULT hr = S_OK; + + switch(pKey->dwType) + { + case REG_DWORD: + pvData = (LPVOID)(LPDWORD)&pKey->dwData; + cbData = sizeof(DWORD); + break; + + case REG_SZ: + case REG_EXPAND_SZ: + hr = StringCbLength((LPCWSTR)pKey->dwData, STRSAFE_MAX_CCH, &cbData); + if (SUCCEEDED(hr)) + { + pvData = (LPVOID)(LPCWSTR)pKey->dwData; + cbData += sizeof(WCHAR); + } + break; + + default: + hr = E_INVALIDARG; + } + + if (SUCCEEDED(hr)) + { + LSTATUS status = SHSetValue(pKey->hKey, pKey->lpszSubKey, pKey->lpszValue, pKey->dwType, pvData, (DWORD)cbData); + if (NOERROR != status) + { + hr = HRESULT_FROM_WIN32(status); + } + } + + return hr; +} + + + +STDAPI CreateRegistryKeys(REGKEY_SUBKEY_AND_VALUE* aKeys, ULONG cKeys) +{ + HRESULT hr = S_OK; + + for (ULONG iKey = 0; iKey < cKeys; iKey++) + { + HRESULT hrTemp = CreateRegistryKey(&aKeys[iKey]); + if (FAILED(hrTemp)) + { + hr = hrTemp; + } + } + return hr; +} + + +STDAPI DeleteRegistryKeys(REGKEY_DELETEKEY* aKeys, ULONG cKeys) +{ + HRESULT hr = S_OK; + LSTATUS status; + + for (ULONG iKey = 0; iKey < cKeys; iKey++) + { + status = RegDeleteTree(aKeys[iKey].hKey, aKeys[iKey].lpszSubKey); + if (NOERROR != status) + { + hr = HRESULT_FROM_WIN32(status); + } + } + return hr; } \ No newline at end of file diff --git a/src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.cpp b/src/Tools/ThumbnailProvider/ThumbnailProvider.cpp similarity index 96% rename from src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.cpp rename to src/Tools/ThumbnailProvider/ThumbnailProvider.cpp index 4a0fda8f89..acf1d60b68 100644 --- a/src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.cpp +++ b/src/Tools/ThumbnailProvider/ThumbnailProvider.cpp @@ -1,325 +1,325 @@ -/*************************************************************************** - * Copyright (c) 2011 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -#pragma warning(disable : 4995) - -#include "Common.h" -#include "ThumbnailProvider.h" - -#include -#include -#include -#include -#include -#pragma comment(lib, "WindowsCodecs.lib") - -// The functions -// * CreateStreamOnResource -// * LoadBitmapFromStream -// * CreateHBITMAP -// are taken from https://faithlife.codes/blog/2008/09/displaying_a_splash_screen_with_c_part_i/ -// The code is released under an MIT-style license - -// Creates a stream object initialized with the data from an executable resource. -IStream* CreateStreamOnResource(void* buffer, size_t length) -{ - // initialize return value - IStream* ipStream = NULL; - - // allocate memory to hold the resource data - HGLOBAL hgblResourceData = GlobalAlloc(GMEM_MOVEABLE, length); - if (hgblResourceData == NULL) - goto Return; - - // get a pointer to the allocated memory - LPVOID pvResourceData = GlobalLock(hgblResourceData); - if (pvResourceData == NULL) - goto FreeData; - - // copy the data from the resource to the new memory block - CopyMemory(pvResourceData, buffer, length); - GlobalUnlock(hgblResourceData); - - // create a stream on the HGLOBAL containing the data - - if (SUCCEEDED(CreateStreamOnHGlobal(hgblResourceData, TRUE, &ipStream))) - goto Return; - -FreeData: - // couldn't create stream; free the memory - - GlobalFree(hgblResourceData); - -Return: - // no need to unlock or free the resource - return ipStream; -} - -IWICBitmapSource* LoadBitmapFromStream(IStream* ipImageStream) -{ - // initialize return value - IWICBitmapSource* ipBitmap = NULL; - - // load WIC's PNG decoder - IWICBitmapDecoder* ipDecoder = NULL; - if (FAILED(CoCreateInstance(CLSID_WICPngDecoder, NULL, CLSCTX_INPROC_SERVER, __uuidof(ipDecoder), reinterpret_cast(&ipDecoder)))) - goto Return; - - // load the PNG - if (FAILED(ipDecoder->Initialize(ipImageStream, WICDecodeMetadataCacheOnLoad))) - goto ReleaseDecoder; - - // check for the presence of the first frame in the bitmap - UINT nFrameCount = 0; - if (FAILED(ipDecoder->GetFrameCount(&nFrameCount)) || nFrameCount != 1) - goto ReleaseDecoder; - - // load the first frame (i.e., the image) - IWICBitmapFrameDecode* ipFrame = NULL; - if (FAILED(ipDecoder->GetFrame(0, &ipFrame))) - goto ReleaseDecoder; - - // convert the image to 32bpp BGRA format with pre-multiplied alpha - // (it may not be stored in that format natively in the PNG resource, - // but we need this format to create the DIB to use on-screen) - WICConvertBitmapSource(GUID_WICPixelFormat32bppPBGRA, ipFrame, &ipBitmap); - ipFrame->Release(); - -ReleaseDecoder: - ipDecoder->Release(); -Return: - return ipBitmap; -} - -HBITMAP CreateHBITMAP(IWICBitmapSource* ipBitmap) -{ - // initialize return value - HBITMAP hbmp = NULL; - - // get image attributes and check for valid image - UINT width = 0; - UINT height = 0; - if (FAILED(ipBitmap->GetSize(&width, &height)) || width == 0 || height == 0) - goto Return; - - // prepare structure giving bitmap information (negative height indicates a top-down DIB) - BITMAPINFO bminfo; - ZeroMemory(&bminfo, sizeof(bminfo)); - bminfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bminfo.bmiHeader.biWidth = width; - bminfo.bmiHeader.biHeight = -((LONG)height); - bminfo.bmiHeader.biPlanes = 1; - bminfo.bmiHeader.biBitCount = 32; - bminfo.bmiHeader.biCompression = BI_RGB; - - // create a DIB section that can hold the image - void* pvImageBits = NULL; - HDC hdcScreen = GetDC(NULL); - hbmp = CreateDIBSection(hdcScreen, &bminfo, DIB_RGB_COLORS, &pvImageBits, NULL, 0); - ReleaseDC(NULL, hdcScreen); - if (hbmp == NULL) - goto Return; - - // extract the image into the HBITMAP - - const UINT cbStride = width * 4; - const UINT cbImage = cbStride * height; - if (FAILED(ipBitmap->CopyPixels(NULL, cbStride, cbImage, static_cast(pvImageBits)))) - { - // couldn't extract image; delete HBITMAP - - DeleteObject(hbmp); - hbmp = NULL; - } - -Return: - return hbmp; -} - -CThumbnailProvider::CThumbnailProvider() -{ - DllAddRef(); - m_cRef = 1; - m_pSite = NULL; -} - - -CThumbnailProvider::~CThumbnailProvider() -{ - if (m_pSite) - { - m_pSite->Release(); - m_pSite = NULL; - } - DllRelease(); -} - - -STDMETHODIMP CThumbnailProvider::QueryInterface(REFIID riid, - void** ppvObject) -{ - static const QITAB qit[] = - { - //QITABENT(CThumbnailProvider, IInitializeWithStream), - QITABENT(CThumbnailProvider, IInitializeWithFile), - QITABENT(CThumbnailProvider, IThumbnailProvider), - QITABENT(CThumbnailProvider, IObjectWithSite), - {0}, - }; - return QISearch(this, qit, riid, ppvObject); -} - - -STDMETHODIMP_(ULONG) CThumbnailProvider::AddRef() -{ - LONG cRef = InterlockedIncrement(&m_cRef); - return (ULONG)cRef; -} - - -STDMETHODIMP_(ULONG) CThumbnailProvider::Release() -{ - LONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - delete this; - return (ULONG)cRef; -} - - -STDMETHODIMP CThumbnailProvider::Initialize(IStream *pstm, - DWORD grfMode) -{ - return S_OK; -} - -STDMETHODIMP CThumbnailProvider::Initialize(LPCWSTR pszFilePath, - DWORD grfMode) -{ - wcscpy_s(m_szFile, pszFilePath); - return S_OK; -} - -bool CThumbnailProvider::CheckZip() const -{ - // open file and check magic number (PK\x03\x04) - std::ifstream zip(m_szFile, std::ios::in | std::ios::binary); - unsigned char pk[4] = {0x50, 0x4b, 0x03, 0x04}; - for (int i=0; i<4; i++) { - unsigned char c; - if (!zip.get((char&)c)) - return false; - if (c != pk[i]) - return false; - } - - return true; -} - -STDMETHODIMP CThumbnailProvider::GetThumbnail(UINT cx, - HBITMAP *phbmp, - WTS_ALPHATYPE *pdwAlpha) -{ - try { - // first make sure we have a zip file but that might still be invalid - if (!CheckZip()) - return NOERROR; - - std::ifstream file(m_szFile, std::ios::in | std::ios::binary); - zipios::ZipInputStream zipstream(file); - zipios::ConstEntryPointer entry; - entry = zipstream.getNextEntry(); - while (entry->isValid() && entry->getName() != "thumbnails/Thumbnail.png") - entry = zipstream.getNextEntry(); - if (entry && entry->isValid()) { - // ok, we have found the file. Now, read it in byte for byte - std::istream *str = &zipstream; - std::vector content; - unsigned char c; - while (str->get((char&)c)) { - content.push_back(c); - } - - // pass the memory buffer to an IStream to create the bitmap handle - IStream* stream = CreateStreamOnResource(&(content[0]), content.size()); - if (stream) { - IWICBitmapSource* bmpSrc = LoadBitmapFromStream(stream); - stream->Release(); - if (bmpSrc) { - *phbmp = CreateHBITMAP(bmpSrc); - *pdwAlpha = WTSAT_UNKNOWN; - bmpSrc->Release(); - } - } - } - } - catch(...) { - // This may happen if the file is corrupted, not a valid zip file - // or whatever could go wrong - } - - return NOERROR; -} - - -STDMETHODIMP CThumbnailProvider::GetSite(REFIID riid, - void** ppvSite) -{ - if (m_pSite) - { - return m_pSite->QueryInterface(riid, ppvSite); - } - return E_NOINTERFACE; -} - - -STDMETHODIMP CThumbnailProvider::SetSite(IUnknown* pUnkSite) -{ - if (m_pSite) - { - m_pSite->Release(); - m_pSite = NULL; - } - - m_pSite = pUnkSite; - if (m_pSite) - { - m_pSite->AddRef(); - } - return S_OK; -} - - -STDAPI CThumbnailProvider_CreateInstance(REFIID riid, void** ppvObject) -{ - *ppvObject = NULL; - - CThumbnailProvider* ptp = new CThumbnailProvider(); - if (!ptp) - { - return E_OUTOFMEMORY; - } - - HRESULT hr = ptp->QueryInterface(riid, ppvObject); - ptp->Release(); - return hr; -} +/*************************************************************************** + * Copyright (c) 2011 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#pragma warning(disable : 4995) + +#include "Common.h" +#include "ThumbnailProvider.h" + +#include +#include +#include +#include +#include +#pragma comment(lib, "WindowsCodecs.lib") + +// The functions +// * CreateStreamOnResource +// * LoadBitmapFromStream +// * CreateHBITMAP +// are taken from https://faithlife.codes/blog/2008/09/displaying_a_splash_screen_with_c_part_i/ +// The code is released under an MIT-style license + +// Creates a stream object initialized with the data from an executable resource. +IStream* CreateStreamOnResource(void* buffer, size_t length) +{ + // initialize return value + IStream* ipStream = NULL; + + // allocate memory to hold the resource data + HGLOBAL hgblResourceData = GlobalAlloc(GMEM_MOVEABLE, length); + if (hgblResourceData == NULL) + goto Return; + + // get a pointer to the allocated memory + LPVOID pvResourceData = GlobalLock(hgblResourceData); + if (pvResourceData == NULL) + goto FreeData; + + // copy the data from the resource to the new memory block + CopyMemory(pvResourceData, buffer, length); + GlobalUnlock(hgblResourceData); + + // create a stream on the HGLOBAL containing the data + + if (SUCCEEDED(CreateStreamOnHGlobal(hgblResourceData, TRUE, &ipStream))) + goto Return; + +FreeData: + // couldn't create stream; free the memory + + GlobalFree(hgblResourceData); + +Return: + // no need to unlock or free the resource + return ipStream; +} + +IWICBitmapSource* LoadBitmapFromStream(IStream* ipImageStream) +{ + // initialize return value + IWICBitmapSource* ipBitmap = NULL; + + // load WIC's PNG decoder + IWICBitmapDecoder* ipDecoder = NULL; + if (FAILED(CoCreateInstance(CLSID_WICPngDecoder, NULL, CLSCTX_INPROC_SERVER, __uuidof(ipDecoder), reinterpret_cast(&ipDecoder)))) + goto Return; + + // load the PNG + if (FAILED(ipDecoder->Initialize(ipImageStream, WICDecodeMetadataCacheOnLoad))) + goto ReleaseDecoder; + + // check for the presence of the first frame in the bitmap + UINT nFrameCount = 0; + if (FAILED(ipDecoder->GetFrameCount(&nFrameCount)) || nFrameCount != 1) + goto ReleaseDecoder; + + // load the first frame (i.e., the image) + IWICBitmapFrameDecode* ipFrame = NULL; + if (FAILED(ipDecoder->GetFrame(0, &ipFrame))) + goto ReleaseDecoder; + + // convert the image to 32bpp BGRA format with pre-multiplied alpha + // (it may not be stored in that format natively in the PNG resource, + // but we need this format to create the DIB to use on-screen) + WICConvertBitmapSource(GUID_WICPixelFormat32bppPBGRA, ipFrame, &ipBitmap); + ipFrame->Release(); + +ReleaseDecoder: + ipDecoder->Release(); +Return: + return ipBitmap; +} + +HBITMAP CreateHBITMAP(IWICBitmapSource* ipBitmap) +{ + // initialize return value + HBITMAP hbmp = NULL; + + // get image attributes and check for valid image + UINT width = 0; + UINT height = 0; + if (FAILED(ipBitmap->GetSize(&width, &height)) || width == 0 || height == 0) + goto Return; + + // prepare structure giving bitmap information (negative height indicates a top-down DIB) + BITMAPINFO bminfo; + ZeroMemory(&bminfo, sizeof(bminfo)); + bminfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bminfo.bmiHeader.biWidth = width; + bminfo.bmiHeader.biHeight = -((LONG)height); + bminfo.bmiHeader.biPlanes = 1; + bminfo.bmiHeader.biBitCount = 32; + bminfo.bmiHeader.biCompression = BI_RGB; + + // create a DIB section that can hold the image + void* pvImageBits = NULL; + HDC hdcScreen = GetDC(NULL); + hbmp = CreateDIBSection(hdcScreen, &bminfo, DIB_RGB_COLORS, &pvImageBits, NULL, 0); + ReleaseDC(NULL, hdcScreen); + if (hbmp == NULL) + goto Return; + + // extract the image into the HBITMAP + + const UINT cbStride = width * 4; + const UINT cbImage = cbStride * height; + if (FAILED(ipBitmap->CopyPixels(NULL, cbStride, cbImage, static_cast(pvImageBits)))) + { + // couldn't extract image; delete HBITMAP + + DeleteObject(hbmp); + hbmp = NULL; + } + +Return: + return hbmp; +} + +CThumbnailProvider::CThumbnailProvider() +{ + DllAddRef(); + m_cRef = 1; + m_pSite = NULL; +} + + +CThumbnailProvider::~CThumbnailProvider() +{ + if (m_pSite) + { + m_pSite->Release(); + m_pSite = NULL; + } + DllRelease(); +} + + +STDMETHODIMP CThumbnailProvider::QueryInterface(REFIID riid, + void** ppvObject) +{ + static const QITAB qit[] = + { + //QITABENT(CThumbnailProvider, IInitializeWithStream), + QITABENT(CThumbnailProvider, IInitializeWithFile), + QITABENT(CThumbnailProvider, IThumbnailProvider), + QITABENT(CThumbnailProvider, IObjectWithSite), + {0}, + }; + return QISearch(this, qit, riid, ppvObject); +} + + +STDMETHODIMP_(ULONG) CThumbnailProvider::AddRef() +{ + LONG cRef = InterlockedIncrement(&m_cRef); + return (ULONG)cRef; +} + + +STDMETHODIMP_(ULONG) CThumbnailProvider::Release() +{ + LONG cRef = InterlockedDecrement(&m_cRef); + if (0 == cRef) + delete this; + return (ULONG)cRef; +} + + +STDMETHODIMP CThumbnailProvider::Initialize(IStream *pstm, + DWORD grfMode) +{ + return S_OK; +} + +STDMETHODIMP CThumbnailProvider::Initialize(LPCWSTR pszFilePath, + DWORD grfMode) +{ + wcscpy_s(m_szFile, pszFilePath); + return S_OK; +} + +bool CThumbnailProvider::CheckZip() const +{ + // open file and check magic number (PK\x03\x04) + std::ifstream zip(m_szFile, std::ios::in | std::ios::binary); + unsigned char pk[4] = {0x50, 0x4b, 0x03, 0x04}; + for (int i=0; i<4; i++) { + unsigned char c; + if (!zip.get((char&)c)) + return false; + if (c != pk[i]) + return false; + } + + return true; +} + +STDMETHODIMP CThumbnailProvider::GetThumbnail(UINT cx, + HBITMAP *phbmp, + WTS_ALPHATYPE *pdwAlpha) +{ + try { + // first make sure we have a zip file but that might still be invalid + if (!CheckZip()) + return NOERROR; + + std::ifstream file(m_szFile, std::ios::in | std::ios::binary); + zipios::ZipInputStream zipstream(file); + zipios::ConstEntryPointer entry; + entry = zipstream.getNextEntry(); + while (entry->isValid() && entry->getName() != "thumbnails/Thumbnail.png") + entry = zipstream.getNextEntry(); + if (entry && entry->isValid()) { + // ok, we have found the file. Now, read it in byte for byte + std::istream *str = &zipstream; + std::vector content; + unsigned char c; + while (str->get((char&)c)) { + content.push_back(c); + } + + // pass the memory buffer to an IStream to create the bitmap handle + IStream* stream = CreateStreamOnResource(&(content[0]), content.size()); + if (stream) { + IWICBitmapSource* bmpSrc = LoadBitmapFromStream(stream); + stream->Release(); + if (bmpSrc) { + *phbmp = CreateHBITMAP(bmpSrc); + *pdwAlpha = WTSAT_UNKNOWN; + bmpSrc->Release(); + } + } + } + } + catch(...) { + // This may happen if the file is corrupted, not a valid zip file + // or whatever could go wrong + } + + return NOERROR; +} + + +STDMETHODIMP CThumbnailProvider::GetSite(REFIID riid, + void** ppvSite) +{ + if (m_pSite) + { + return m_pSite->QueryInterface(riid, ppvSite); + } + return E_NOINTERFACE; +} + + +STDMETHODIMP CThumbnailProvider::SetSite(IUnknown* pUnkSite) +{ + if (m_pSite) + { + m_pSite->Release(); + m_pSite = NULL; + } + + m_pSite = pUnkSite; + if (m_pSite) + { + m_pSite->AddRef(); + } + return S_OK; +} + + +STDAPI CThumbnailProvider_CreateInstance(REFIID riid, void** ppvObject) +{ + *ppvObject = NULL; + + CThumbnailProvider* ptp = new CThumbnailProvider(); + if (!ptp) + { + return E_OUTOFMEMORY; + } + + HRESULT hr = ptp->QueryInterface(riid, ppvObject); + ptp->Release(); + return hr; +} diff --git a/src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.def b/src/Tools/ThumbnailProvider/ThumbnailProvider.def similarity index 95% rename from src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.def rename to src/Tools/ThumbnailProvider/ThumbnailProvider.def index f29fc4ef2d..10044d84ed 100644 --- a/src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.def +++ b/src/Tools/ThumbnailProvider/ThumbnailProvider.def @@ -1,7 +1,7 @@ -LIBRARY "FCStdThumbnail" - -EXPORTS - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE - DllGetClassObject PRIVATE +LIBRARY "FCStdThumbnail" + +EXPORTS + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE + DllGetClassObject PRIVATE DllCanUnloadNow PRIVATE \ No newline at end of file diff --git a/src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.h b/src/Tools/ThumbnailProvider/ThumbnailProvider.h similarity index 97% rename from src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.h rename to src/Tools/ThumbnailProvider/ThumbnailProvider.h index dc16c8b4b7..bae9b1284b 100644 --- a/src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.h +++ b/src/Tools/ThumbnailProvider/ThumbnailProvider.h @@ -1,56 +1,56 @@ -/*************************************************************************** - * Copyright (c) 2011 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -#pragma once - -//class CThumbnailProvider : public IThumbnailProvider, IObjectWithSite, IInitializeWithStream -class CThumbnailProvider : public IThumbnailProvider, IObjectWithSite, IInitializeWithFile -{ -private: - LONG m_cRef; - IUnknown* m_pSite; - TCHAR m_szFile[1000]; - - ~CThumbnailProvider(); - bool CheckZip() const; - -public: - CThumbnailProvider(); - - // IUnknown methods - STDMETHOD(QueryInterface)(REFIID, void**); - STDMETHOD_(ULONG, AddRef)(); - STDMETHOD_(ULONG, Release)(); - - // IInitializeWithSteam methods - STDMETHOD(Initialize)(IStream*, DWORD); - // IInitializeWithFile methods - STDMETHOD(Initialize)(LPCWSTR , DWORD); - - // IThumbnailProvider methods - STDMETHOD(GetThumbnail)(UINT, HBITMAP*, WTS_ALPHATYPE*); - - // IObjectWithSite methods - STDMETHOD(GetSite)(REFIID, void**); - STDMETHOD(SetSite)(IUnknown*); +/*************************************************************************** + * Copyright (c) 2011 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#pragma once + +//class CThumbnailProvider : public IThumbnailProvider, IObjectWithSite, IInitializeWithStream +class CThumbnailProvider : public IThumbnailProvider, IObjectWithSite, IInitializeWithFile +{ +private: + LONG m_cRef; + IUnknown* m_pSite; + TCHAR m_szFile[1000]; + + ~CThumbnailProvider(); + bool CheckZip() const; + +public: + CThumbnailProvider(); + + // IUnknown methods + STDMETHOD(QueryInterface)(REFIID, void**); + STDMETHOD_(ULONG, AddRef)(); + STDMETHOD_(ULONG, Release)(); + + // IInitializeWithSteam methods + STDMETHOD(Initialize)(IStream*, DWORD); + // IInitializeWithFile methods + STDMETHOD(Initialize)(LPCWSTR , DWORD); + + // IThumbnailProvider methods + STDMETHOD(GetThumbnail)(UINT, HBITMAP*, WTS_ALPHATYPE*); + + // IObjectWithSite methods + STDMETHOD(GetSite)(REFIID, void**); + STDMETHOD(SetSite)(IUnknown*); }; \ No newline at end of file diff --git a/src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.sln b/src/Tools/ThumbnailProvider/ThumbnailProvider.sln similarity index 97% rename from src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.sln rename to src/Tools/ThumbnailProvider/ThumbnailProvider.sln index f95f8943f2..76e3be9bcf 100644 --- a/src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.sln +++ b/src/Tools/ThumbnailProvider/ThumbnailProvider.sln @@ -1,31 +1,31 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31410.357 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FCStdThumbnail", "ThumbnailProvider.vcxproj", "{B4F22D8C-736E-46BF-85FB-259EF73EA0FC}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Debug|x64.ActiveCfg = Debug|x64 - {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Debug|x64.Build.0 = Debug|x64 - {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Debug|x86.ActiveCfg = Debug|Win32 - {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Debug|x86.Build.0 = Debug|Win32 - {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Release|x64.ActiveCfg = Release|x64 - {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Release|x64.Build.0 = Release|x64 - {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Release|x86.ActiveCfg = Release|Win32 - {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7336F399-F2B2-4F65-A701-52024EB9A7A0} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31410.357 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FCStdThumbnail", "ThumbnailProvider.vcxproj", "{B4F22D8C-736E-46BF-85FB-259EF73EA0FC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Debug|x64.ActiveCfg = Debug|x64 + {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Debug|x64.Build.0 = Debug|x64 + {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Debug|x86.ActiveCfg = Debug|Win32 + {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Debug|x86.Build.0 = Debug|Win32 + {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Release|x64.ActiveCfg = Release|x64 + {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Release|x64.Build.0 = Release|x64 + {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Release|x86.ActiveCfg = Release|Win32 + {B4F22D8C-736E-46BF-85FB-259EF73EA0FC}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7336F399-F2B2-4F65-A701-52024EB9A7A0} + EndGlobalSection +EndGlobal diff --git a/src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.vcxproj b/src/Tools/ThumbnailProvider/ThumbnailProvider.vcxproj similarity index 98% rename from src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.vcxproj rename to src/Tools/ThumbnailProvider/ThumbnailProvider.vcxproj index bf1f65f19a..93613f786d 100644 --- a/src/Tools/thumbs/ThumbnailProvider/ThumbnailProvider.vcxproj +++ b/src/Tools/ThumbnailProvider/ThumbnailProvider.vcxproj @@ -1,245 +1,245 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - FCStdThumbnail - {B4F22D8C-736E-46BF-85FB-259EF73EA0FC} - ThumbnailProvider - Win32Proj - - - - DynamicLibrary - v142 - Unicode - true - - - DynamicLibrary - v142 - Unicode - - - DynamicLibrary - v142 - Unicode - true - - - DynamicLibrary - v142 - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>16.0.31401.40 - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - Disabled - ..\..\..\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;THUMBNAILPROVIDER_EXPORTS;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - Level3 - EditAndContinue - - - shlwapi.lib;comctl32.lib;propsys.lib;zlibstatic.lib;%(AdditionalDependencies) - ThumbnailProvider.def - true - Windows - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\;%(AdditionalIncludeDirectories) - WIN64;_DEBUG;_WINDOWS;_USRDLL;THUMBNAILPROVIDER_EXPORTS;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - Level3 - ProgramDatabase - - - shlwapi.lib;comctl32.lib;propsys.lib;zlibstatic.lib;%(AdditionalDependencies) - ThumbnailProvider.def - true - Windows - MachineX64 - - - - - MaxSpeed - true - .;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;THUMBNAILPROVIDER_EXPORTS;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - Level3 - ProgramDatabase - - - shlwapi.lib;comctl32.lib;propsys.lib;%(AdditionalDependencies) - ThumbnailProvider.def - true - Windows - true - true - MachineX86 - - - - - X64 - - - MaxSpeed - true - .;..\..\..\;%(AdditionalIncludeDirectories) - WIN64;NDEBUG;_WINDOWS;THUMBNAILPROVIDER_EXPORTS;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - Level3 - ProgramDatabase - - - shlwapi.lib;comctl32.lib;propsys.lib;zlibstatic.lib;%(AdditionalDependencies) - ThumbnailProvider.def - true - Windows - true - true - MachineX64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + FCStdThumbnail + {B4F22D8C-736E-46BF-85FB-259EF73EA0FC} + ThumbnailProvider + Win32Proj + + + + DynamicLibrary + v142 + Unicode + true + + + DynamicLibrary + v142 + Unicode + + + DynamicLibrary + v142 + Unicode + true + + + DynamicLibrary + v142 + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>16.0.31401.40 + + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ..\..\..\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;THUMBNAILPROVIDER_EXPORTS;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + Level3 + EditAndContinue + + + shlwapi.lib;comctl32.lib;propsys.lib;zlibstatic.lib;%(AdditionalDependencies) + ThumbnailProvider.def + true + Windows + MachineX86 + + + + + X64 + + + Disabled + ..\..\..\;%(AdditionalIncludeDirectories) + WIN64;_DEBUG;_WINDOWS;_USRDLL;THUMBNAILPROVIDER_EXPORTS;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + Level3 + ProgramDatabase + + + shlwapi.lib;comctl32.lib;propsys.lib;zlibstatic.lib;%(AdditionalDependencies) + ThumbnailProvider.def + true + Windows + MachineX64 + + + + + MaxSpeed + true + .;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;THUMBNAILPROVIDER_EXPORTS;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + Level3 + ProgramDatabase + + + shlwapi.lib;comctl32.lib;propsys.lib;%(AdditionalDependencies) + ThumbnailProvider.def + true + Windows + true + true + MachineX86 + + + + + X64 + + + MaxSpeed + true + .;..\..\..\;%(AdditionalIncludeDirectories) + WIN64;NDEBUG;_WINDOWS;THUMBNAILPROVIDER_EXPORTS;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + Level3 + ProgramDatabase + + + shlwapi.lib;comctl32.lib;propsys.lib;zlibstatic.lib;%(AdditionalDependencies) + ThumbnailProvider.def + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Tools/thumbs/FCStdExtractor.cpp b/src/Tools/thumbs/FCStdExtractor.cpp deleted file mode 100644 index 4fd7622262..0000000000 --- a/src/Tools/thumbs/FCStdExtractor.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2008 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -#include "stdafx.h" -#include "resource.h" -#include "ThumbFCStd_i.h" -#include -#include "ThumbFCStd_i.c" -#include "FCStdExtractor.h" -#include - -#include -#include -#include -#include -#include -#pragma comment(lib, "WindowsCodecs.lib") - - // The functions - // * CreateStreamOnResource - // * LoadBitmapFromStream - // * CreateHBITMAP - // are taken from https://faithlife.codes/blog/2008/09/displaying_a_splash_screen_with_c_part_i/ - // The code is released under an MIT-style license - - // Creates a stream object initialized with the data from an executable resource. -IStream* CreateStreamOnResource(void* buffer, size_t length) -{ - // initialize return value - IStream* ipStream = NULL; - - // allocate memory to hold the resource data - HGLOBAL hgblResourceData = GlobalAlloc(GMEM_MOVEABLE, length); - if (hgblResourceData == NULL) - goto Return; - - // get a pointer to the allocated memory - LPVOID pvResourceData = GlobalLock(hgblResourceData); - if (pvResourceData == NULL) - goto FreeData; - - // copy the data from the resource to the new memory block - CopyMemory(pvResourceData, buffer, length); - GlobalUnlock(hgblResourceData); - - // create a stream on the HGLOBAL containing the data - - if (SUCCEEDED(CreateStreamOnHGlobal(hgblResourceData, TRUE, &ipStream))) - goto Return; - -FreeData: - // couldn't create stream; free the memory - - GlobalFree(hgblResourceData); - -Return: - // no need to unlock or free the resource - return ipStream; -} - -IWICBitmapSource* LoadBitmapFromStream(IStream* ipImageStream) -{ - // initialize return value - IWICBitmapSource* ipBitmap = NULL; - - // load WIC's PNG decoder - IWICBitmapDecoder* ipDecoder = NULL; - if (FAILED(CoCreateInstance(CLSID_WICPngDecoder, NULL, CLSCTX_INPROC_SERVER, __uuidof(ipDecoder), reinterpret_cast(&ipDecoder)))) - goto Return; - - // load the PNG - if (FAILED(ipDecoder->Initialize(ipImageStream, WICDecodeMetadataCacheOnLoad))) - goto ReleaseDecoder; - - // check for the presence of the first frame in the bitmap - UINT nFrameCount = 0; - if (FAILED(ipDecoder->GetFrameCount(&nFrameCount)) || nFrameCount != 1) - goto ReleaseDecoder; - - // load the first frame (i.e., the image) - IWICBitmapFrameDecode* ipFrame = NULL; - if (FAILED(ipDecoder->GetFrame(0, &ipFrame))) - goto ReleaseDecoder; - - // convert the image to 32bpp BGRA format with pre-multiplied alpha - // (it may not be stored in that format natively in the PNG resource, - // but we need this format to create the DIB to use on-screen) - WICConvertBitmapSource(GUID_WICPixelFormat32bppPBGRA, ipFrame, &ipBitmap); - ipFrame->Release(); - -ReleaseDecoder: - ipDecoder->Release(); -Return: - return ipBitmap; -} - -HBITMAP CreateHBITMAP(IWICBitmapSource* ipBitmap) -{ - // initialize return value - HBITMAP hbmp = NULL; - - // get image attributes and check for valid image - UINT width = 0; - UINT height = 0; - if (FAILED(ipBitmap->GetSize(&width, &height)) || width == 0 || height == 0) - goto Return; - - // prepare structure giving bitmap information (negative height indicates a top-down DIB) - BITMAPINFO bminfo; - ZeroMemory(&bminfo, sizeof(bminfo)); - bminfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bminfo.bmiHeader.biWidth = width; - bminfo.bmiHeader.biHeight = -((LONG)height); - bminfo.bmiHeader.biPlanes = 1; - bminfo.bmiHeader.biBitCount = 32; - bminfo.bmiHeader.biCompression = BI_RGB; - - // create a DIB section that can hold the image - void* pvImageBits = NULL; - HDC hdcScreen = GetDC(NULL); - hbmp = CreateDIBSection(hdcScreen, &bminfo, DIB_RGB_COLORS, &pvImageBits, NULL, 0); - ReleaseDC(NULL, hdcScreen); - if (hbmp == NULL) - goto Return; - - // extract the image into the HBITMAP - - const UINT cbStride = width * 4; - const UINT cbImage = cbStride * height; - if (FAILED(ipBitmap->CopyPixels(NULL, cbStride, cbImage, static_cast(pvImageBits)))) - { - // couldn't extract image; delete HBITMAP - - DeleteObject(hbmp); - hbmp = NULL; - } - -Return: - return hbmp; -} - -CComModule _Module; - -BEGIN_OBJECT_MAP(ObjectMap) - OBJECT_ENTRY(CLSID_FCStdExtractor, CFCStdExtractor) -END_OBJECT_MAP() - -///////////////////////////////////////////////////////////////////////////// -// DLL Entry Point - -extern "C" -BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) -{ - if (dwReason == DLL_PROCESS_ATTACH) { - _Module.Init(ObjectMap, hInstance, &LIBID_THUMBFCSTDLib); - DisableThreadLibraryCalls(hInstance); - } - else if (dwReason == DLL_PROCESS_DETACH) - _Module.Term(); - return TRUE; // ok -} - -///////////////////////////////////////////////////////////////////////////// -// Used to determine whether the DLL can be unloaded by OLE - -STDAPI DllCanUnloadNow(void) -{ - return (_Module.GetLockCount()==0) ? S_OK : S_FALSE; -} - -///////////////////////////////////////////////////////////////////////////// -// Returns a class factory to create an object of the requested type - -STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) -{ - return _Module.GetClassObject(rclsid, riid, ppv); -} - -///////////////////////////////////////////////////////////////////////////// -// DllRegisterServer - Adds entries to the system registry - -STDAPI DllRegisterServer(void) -{ - // registers object, typelib and all interfaces in typelib - return _Module.RegisterServer(TRUE); -} - -///////////////////////////////////////////////////////////////////////////// -// DllUnregisterServer - Removes entries from the system registry - -STDAPI DllUnregisterServer(void) -{ - return _Module.UnregisterServer(TRUE); -} - -///////////////////////////////////////////////////////////////////////////// -// CFCStdExtractor - -HRESULT CFCStdExtractor::GetLocation(LPWSTR pszPathBuffer, - DWORD cchMax, DWORD *pdwPriority, - const SIZE *prgSize, DWORD dwRecClrDepth, - DWORD *pdwFlags) -{ - m_bmSize = *prgSize; - if (*pdwFlags & IEIFLAG_ASYNC) - return E_PENDING; - return NOERROR; -} - -HRESULT CFCStdExtractor::Load(LPCOLESTR wszFile, DWORD dwMode) -{ - USES_CONVERSION; - _tcscpy(m_szFile, OLE2T((WCHAR*)wszFile)); - return S_OK; -}; - -bool CFCStdExtractor::CheckZip() const -{ - // open file and check magic number (PK\x03\x04) - std::ifstream zip(m_szFile, std::ios::in | std::ios::binary); - unsigned char pk[4] = {0x50, 0x4b, 0x03, 0x04}; - for (int i=0; i<4; i++) { - unsigned char c; - if (!zip.get((char&)c)) - return false; - if (c != pk[i]) - return false; - } - - return true; -} - -// IExtractImage::Extract -HRESULT CFCStdExtractor::Extract(HBITMAP* phBmpThumbnail) -{ - try { - // first make sure we have a zip file but that might still be invalid - if (!CheckZip()) - return NOERROR; - - zipios::ZipFile file(m_szFile); - zipios::ConstEntries files = file.entries(); - // search for a special file name in the project file - zipios::ConstEntryPointer entry = file.getEntry("thumbnails/Thumbnail.png"); - if (entry && entry->isValid()) { - // ok, we have found the file. Now, read it in byte for byte - std::istream *str = file.getInputStream(entry); - std::vector content; - unsigned char c; - while (str->get((char&)c)) { - content.push_back(c); - } - - // pass the memory buffer to an IStream to create the bitmap handle - IStream* stream = CreateStreamOnResource(&(content[0]), content.size()); - if (stream) { - IWICBitmapSource* bmpSrc = LoadBitmapFromStream(stream); - stream->Release(); - if (bmpSrc) { - m_hPreview = CreateHBITMAP(bmpSrc); - *phBmpThumbnail = m_hPreview; - bmpSrc->Release(); - } - } - } - } - catch(...) { - // This may happen if the file is corrupted, not a valid zip file - // or whatever could go wrong - } - - return NOERROR; -} - -HRESULT CFCStdExtractor::GetDateStamp(FILETIME *pDateStamp) -{ - FILETIME ftCreationTime,ftLastAccessTime,ftLastWriteTime; - // open the file and get last write time - HANDLE hFile = CreateFile(m_szFile,GENERIC_READ,FILE_SHARE_READ,NULL, - OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); - if(!hFile) - return E_FAIL; - GetFileTime(hFile,&ftCreationTime,&ftLastAccessTime,&ftLastWriteTime); - CloseHandle(hFile); - *pDateStamp = ftLastWriteTime; - return NOERROR; -} - diff --git a/src/Tools/thumbs/FCStdExtractor.h b/src/Tools/thumbs/FCStdExtractor.h deleted file mode 100644 index 9b7412ffb8..0000000000 --- a/src/Tools/thumbs/FCStdExtractor.h +++ /dev/null @@ -1,99 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2008 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -#ifndef FC_STD_EXTRACTOR_H -#define FC_STD_EXTRACTOR_H - -#include "resource.h" // main symbols -#include -#include -#include -#include "IExtractImage.h" - -///////////////////////////////////////////////////////////////////////////// -// CFCStdExtractor -class ATL_NO_VTABLE CFCStdExtractor : - public CComObjectRootEx, - public CComCoClass, - public IPersistFile, - public IExtractImage2 -{ -public: - CFCStdExtractor() - { - } - -DECLARE_REGISTRY_RESOURCEID(IDR_THUMBSCB) - -DECLARE_PROTECT_FINAL_CONSTRUCT() - -BEGIN_COM_MAP(CFCStdExtractor) - COM_INTERFACE_ENTRY(IPersistFile) - COM_INTERFACE_ENTRY(IExtractImage) - COM_INTERFACE_ENTRY(IExtractImage2) -END_COM_MAP() - -// IExtractImage -public: - - STDMETHOD(GetLocation)(LPWSTR pszPathBuffer, - DWORD cchMax, - DWORD *pdwPriority, - const SIZE *prgSize, - DWORD dwRecClrDepth, - DWORD *pdwFlags); - STDMETHOD(Extract)(HBITMAP*); - // IExtractImage2 - STDMETHOD(GetDateStamp)(FILETIME *pDateStamp); - - // IPersistFile - STDMETHOD(Load)(LPCOLESTR wszFile, DWORD dwMode); - - STDMETHOD(GetClassID)(LPCLSID clsid) - { MessageBox(0,"GetClassID",0,0); - return E_NOTIMPL; } - - STDMETHOD(IsDirty)(VOID) - { MessageBox(0,"IsDirty",0,0); - return E_NOTIMPL; } - - STDMETHOD(Save)(LPCOLESTR, BOOL) - { MessageBox(0,"Save",0,0); - return E_NOTIMPL; } - - STDMETHOD(SaveCompleted)(LPCOLESTR) - { MessageBox(0,"SaveCompleted",0,0); - return E_NOTIMPL; } - - STDMETHOD(GetCurFile)(LPOLESTR FAR*) - { MessageBox(0,"GetCurFile",0,0); - return E_NOTIMPL; } - -private: - bool CheckZip() const; - SIZE m_bmSize; - HBITMAP m_hPreview; - TCHAR m_szFile[1000]; -}; - -#endif //FC_STD_EXTRACTOR_H diff --git a/src/Tools/thumbs/FCThumbs.def b/src/Tools/thumbs/FCThumbs.def deleted file mode 100644 index c83d067c17..0000000000 --- a/src/Tools/thumbs/FCThumbs.def +++ /dev/null @@ -1,11 +0,0 @@ -; FCThumbs.def : Declares the module parameters for the DLL. - -LIBRARY "FCThumbs" -DESCRIPTION 'ThumbScb Windows Dynamic Link Library' - -EXPORTS - ; Explicit exports can go here - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE diff --git a/src/Tools/thumbs/FCThumbs.dsp b/src/Tools/thumbs/FCThumbs.dsp deleted file mode 100644 index d9d209e1a8..0000000000 --- a/src/Tools/thumbs/FCThumbs.dsp +++ /dev/null @@ -1,392 +0,0 @@ -# Microsoft Developer Studio Project File - Name="FCThumbs" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=FCThumbs - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "FCThumbs.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "FCThumbs.mak" CFG="FCThumbs - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "FCThumbs - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "FCThumbs - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "FCThumbs - Win32 Release" - -# PROP BASE Use_MFC 2 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 2 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../" /I "../../3rdParty/CxImage/zlib" /I "../../3rdParty/CxImage" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /D "FCBase" /Yu"stdafx.h" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /D "NDEBUG" /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x407 /d "NDEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 qt-mt323.lib gdi32.lib /nologo /subsystem:windows /dll /machine:I386 -# Begin Custom Build - Performing Registration on $(InputPath) -OutDir=.\Release -TargetPath=.\Release\FCThumbs.dll -InputPath=.\Release\FCThumbs.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - -# End Custom Build - -!ELSEIF "$(CFG)" == "FCThumbs - Win32 Debug" - -# PROP BASE Use_MFC 2 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 2 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../3rdParty/CxImage/zlib" /I "../../3rdParty/CxImage" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /D "FCBase" /Yu"stdafx.h" /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /D "_DEBUG" /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" /d "_AFXDLL" -# ADD RSC /l 0x407 /d "_DEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 gdi32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# Begin Custom Build - Performing Registration on $(InputPath) -OutDir=.\Debug -TargetPath=.\Debug\FCThumbs.dll -InputPath=.\Debug\FCThumbs.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "FCThumbs - Win32 Release" -# Name "FCThumbs - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\FCStdExtractor.cpp -# End Source File -# Begin Source File - -SOURCE=.\FCThumbs.def -# End Source File -# Begin Source File - -SOURCE=.\FCThumbs.rc -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# ADD CPP /Yc"stdafx.h" -# End Source File -# Begin Source File - -SOURCE=.\ThumbFCStd.idl -# ADD MTL /tlb "./ThumbFCStd.tlb" /h "ThumbFCStd_i.h" /iid "ThumbFCStd_i.c" /Oicf -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\FCStdExtractor.h -# End Source File -# Begin Source File - -SOURCE=.\IExtractImage.h -# End Source File -# Begin Source File - -SOURCE=.\Resource.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\FCThumbs.rgs -# End Source File -# End Group -# Begin Group "zipios" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\Base\zipios\backbuffer.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\basicentry.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\basicentry.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\collcoll.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\collcoll.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\deflateoutputstreambuf.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\deflateoutputstreambuf.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\dircoll.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\dircoll.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\directory.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\directory.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\fcoll.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\fcoll.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\fcollexceptions.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\fcollexceptions.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\fileentry.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\fileentry.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\filepath.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\filepath.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\filterinputstreambuf.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\filterinputstreambuf.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\filteroutputstreambuf.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\filteroutputstreambuf.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\gzipoutputstream.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\gzipoutputstream.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\gzipoutputstreambuf.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\gzipoutputstreambuf.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\inflateinputstreambuf.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\inflateinputstreambuf.h -# End Source File -# Begin Source File - -SOURCE="..\..\Base\zipios\meta-iostreams.h" -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\outputstringstream.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\simplesmartptr.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\virtualseeker.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipfile.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipfile.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\ziphead.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\ziphead.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipheadio.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipheadio.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipinputstream.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipinputstream.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipinputstreambuf.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipinputstreambuf.h -# End Source File -# Begin Source File - -SOURCE="..\..\Base\zipios\zipios-config.h" -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipios_common.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipios_defs.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipoutputstream.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipoutputstream.h -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipoutputstreambuf.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\Base\zipios\zipoutputstreambuf.h -# End Source File -# End Group -# End Target -# End Project diff --git a/src/Tools/thumbs/FCThumbs.rc b/src/Tools/thumbs/FCThumbs.rc deleted file mode 100644 index ff0fd81f8d..0000000000 --- a/src/Tools/thumbs/FCThumbs.rc +++ /dev/null @@ -1,160 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "ThumbFCStd DLL\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "ThumbFCStd\0" - VALUE "LegalCopyright", "Copyright (C) 2002\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "ThumbFCStd.DLL\0" - VALUE "ProductName", "ThumbFCStd Dynamic Link Library\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// Greek resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ELL) -#ifdef _WIN32 -LANGUAGE LANG_GREEK, SUBLANG_DEFAULT -#pragma code_page(1253) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif //_WIN32\r\n" - "#include ""res\\FCThumbs.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\r\n" - "1 TYPELIB ""ThumbFCStd.tlb""\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// REGISTRY -// - -IDR_THUMBSCB REGISTRY DISCARDABLE "FCThumbs.rgs" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDR_FCSTD_TYPE "\nFCStd\nFCStd\nFCStd Files (*.FCStd)\n.FCSTD\nFCStd.Document\nFCStd Document" -END - -#endif // Greek resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif //_WIN32 -#include "afxres.rc" // Standard components -#endif -1 TYPELIB "ThumbFCStd.tlb" -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/src/Tools/thumbs/FCThumbs.rgs b/src/Tools/thumbs/FCThumbs.rgs deleted file mode 100644 index 5406453b30..0000000000 --- a/src/Tools/thumbs/FCThumbs.rgs +++ /dev/null @@ -1,35 +0,0 @@ -HKCR -{ - ThumbFCThumbs.Extractor.1 = s 'FCThumbs Thumbnail Extractor Class' - { - CLSID = s '{287CC8A6-B380-4765-8EB1-AFC82D90DF68}' - } - ThumbFCThumbs.Extractor = s 'FCThumbs Thumbnail Extractor Class' - { - CLSID = s '{287CC8A6-B380-4765-8EB1-AFC82D90DF68}' - CurVer = s 'ThumbFCThumbs.Extractor.1' - } - NoRemove CLSID - { - ForceRemove {287CC8A6-B380-4765-8EB1-AFC82D90DF68} = s 'Extractor Class' - { - ProgID = s 'ThumbFCThumbs.Extractor.1' - VersionIndependentProgID = s 'ThumbFCThumbs.Extractor' - ForceRemove 'Programmable' - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Apartment' - } - 'TypeLib' = s '{1C52B730-EC75-423F-A300-4A42CDF1C985}' - } - } - - NoRemove .FCStd - { - shellex - { - {BB2E617C-0920-11d1-9A0B-00C04FC2D6C1} = s '{287CC8A6-B380-4765-8EB1-AFC82D90DF68}' - } - } - -} diff --git a/src/Tools/thumbs/FCThumbs.sln b/src/Tools/thumbs/FCThumbs.sln deleted file mode 100644 index 9fcb00fda8..0000000000 --- a/src/Tools/thumbs/FCThumbs.sln +++ /dev/null @@ -1,43 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31410.357 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FCThumbs", "FCThumbs.vcxproj", "{5E406625-AFD6-4849-875F-C5740E98A28E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - Unicode Debug|Win32 = Unicode Debug|Win32 - Unicode Debug|x64 = Unicode Debug|x64 - Unicode Release|Win32 = Unicode Release|Win32 - Unicode Release|x64 = Unicode Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5E406625-AFD6-4849-875F-C5740E98A28E}.Debug|Win32.ActiveCfg = Debug|Win32 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Debug|Win32.Build.0 = Debug|Win32 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Debug|x64.ActiveCfg = Debug|x64 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Debug|x64.Build.0 = Debug|x64 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Release|Win32.ActiveCfg = Release|Win32 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Release|Win32.Build.0 = Release|Win32 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Release|x64.ActiveCfg = Release|x64 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Release|x64.Build.0 = Release|x64 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Unicode Debug|Win32.ActiveCfg = Debug|Win32 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Unicode Debug|Win32.Build.0 = Debug|Win32 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Unicode Debug|x64.ActiveCfg = Debug|x64 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Unicode Debug|x64.Build.0 = Debug|x64 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Unicode Release|Win32.ActiveCfg = Release|Win32 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Unicode Release|Win32.Build.0 = Release|Win32 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Unicode Release|x64.ActiveCfg = Release|x64 - {5E406625-AFD6-4849-875F-C5740E98A28E}.Unicode Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A0E0D5A0-B2A9-4F06-8772-5B26FF1EC437} - EndGlobalSection -EndGlobal diff --git a/src/Tools/thumbs/FCThumbs.vcxproj b/src/Tools/thumbs/FCThumbs.vcxproj deleted file mode 100644 index 4cd2e990aa..0000000000 --- a/src/Tools/thumbs/FCThumbs.vcxproj +++ /dev/null @@ -1,582 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {5E406625-AFD6-4849-875F-C5740E98A28E} - MFCProj - - - - DynamicLibrary - v142 - false - MultiByte - - - DynamicLibrary - v142 - false - MultiByte - - - DynamicLibrary - v142 - Dynamic - MultiByte - - - DynamicLibrary - v142 - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>16.0.31401.40 - - - .\Release\ - .\Release\ - false - - - false - - - .\Debug\ - .\Debug\ - true - - - true - - - - Performing Registration on $(ProjectPath) - regsvr32 /s /c "$(TargetPath)" -echo regsvr32 exec. time > "$(OutDir)regsvr32.trg" - - $(OutDir)regsvr32.trg;%(Outputs) - - - NDEBUG;%(PreprocessorDefinitions) - Win32 - .\Release/FCThumbs.tlb - - - - MaxSpeed - OnlyExplicitInline - ../../;$(ProgramFiles)\Microsoft Platform SDK\Include\atl;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\Release/FCThumbs.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0407 - - - gdi32.lib;%(AdditionalDependencies) - .\Release/FCThumbs.dll - true - .\FCThumbs.def - .\Release/FCThumbs.pdb - Windows - false - - .\Release/FCThumbs.lib - MachineX86 - - - true - .\Release/FCThumbs.bsc - - - - - Performing Registration on $(ProjectPath) - regsvr32 /s /c "$(TargetPath)" -echo regsvr32 exec. time > "$(OutDir)regsvr32.trg" - - $(OutDir)regsvr32.trg;%(Outputs) - - - NDEBUG;%(PreprocessorDefinitions) - .\Release/FCThumbs.tlb - - - - - MaxSpeed - OnlyExplicitInline - ../../;$(ProgramFiles)\Microsoft Platform SDK\Include\atl;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\Release/FCThumbs.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0407 - - - gdi32.lib;zlibstatic.lib;%(AdditionalDependencies) - .\Release/FCThumbs.dll - true - .\FCThumbs.def - .\Release/FCThumbs.pdb - Windows - false - - - .\Release/FCThumbs.lib - - - true - .\Release/FCThumbs.bsc - - - - - Performing Registration on $(ProjectPath) - regsvr32 /s /c "$(TargetPath)" -echo regsvr32 exec. time > "$(OutDir)regsvr32.trg" - - $(OutDir)regsvr32.trg;%(Outputs) - - - _DEBUG;%(PreprocessorDefinitions) - Win32 - .\Debug/FCThumbs.tlb - - - - Disabled - ../../;$(ProgramFiles)\Microsoft Platform SDK\Include\atl;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\Debug/FCThumbs.pch - .\Debug/ - .\Debug/ - .\Debug/ - Level3 - true - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0407 - - - gdi32.lib;%(AdditionalDependencies) - .\Debug/FCThumbs.dll - true - .\FCThumbs.def - true - .\Debug/FCThumbs.pdb - Windows - false - - .\Debug/FCThumbs.lib - MachineX86 - - - true - .\Debug/FCThumbs.bsc - - - - - Performing Registration on $(ProjectPath) - regsvr32 /s /c "$(TargetPath)" -echo regsvr32 exec. time > "$(OutDir)regsvr32.trg" - - $(OutDir)regsvr32.trg;%(Outputs) - - - _DEBUG;%(PreprocessorDefinitions) - .\Debug/FCThumbs.tlb - - - - - Disabled - ../../;$(ProgramFiles)\Microsoft Platform SDK\Include\atl;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;FreeCADBase_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\Debug/FCThumbs.pch - .\Debug/ - .\Debug/ - .\Debug/ - Level3 - true - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0407 - - - gdi32.lib;zlibstatic.lib;%(AdditionalDependencies) - .\Debug/FCThumbs.dll - true - .\FCThumbs.def - true - .\Debug/FCThumbs.pdb - Windows - false - - - .\Debug/FCThumbs.lib - - - true - .\Debug/FCThumbs.bsc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - - - - Win32 - true - true - ./ThumbFCStd.tlb - ./ThumbFCStd.tlb - ThumbFCStd_i.h - ThumbFCStd_i.h - ThumbFCStd_i.c - ThumbFCStd_i.c - Win32 - true - true - ./ThumbFCStd.tlb - ./ThumbFCStd.tlb - ThumbFCStd_i.h - ThumbFCStd_i.h - ThumbFCStd_i.c - ThumbFCStd_i.c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Tools/thumbs/IExtractImage.h b/src/Tools/thumbs/IExtractImage.h deleted file mode 100644 index ce6faed266..0000000000 --- a/src/Tools/thumbs/IExtractImage.h +++ /dev/null @@ -1,55 +0,0 @@ -// IExtractImage.h -// content taken by shobjidl.h -// Philip Sakellaropoulos 2002 - -#ifndef __IExtractImage_FWD_DEFINED__ -#define __IExtractImage_FWD_DEFINED__ - -//BB2E617C-0920-11d1-9A0B-00C04FC2D6C1 -DEFINE_GUID(IID_IExtractImage, -0xBB2E617C, 0x0920, 0x11d1, 0x9A, 0x0B, 0x00, 0xC0, 0x4F, 0xC2, 0xD6, 0xC1); - -#define IEIFLAG_ASYNC 0x0001 // ask the extractor if it supports ASYNC extract (free threaded) -#define IEIFLAG_CACHE 0x0002 // returned from the extractor if it does NOT cache the thumbnail -#define IEIFLAG_ASPECT 0x0004 // passed to the extractor to beg it to render to the aspect ratio of the supplied rect -#define IEIFLAG_OFFLINE 0x0008 // if the extractor shouldn't hit the net to get any content needed for the rendering -#define IEIFLAG_GLEAM 0x0010 // does the image have a gleam ? this will be returned if it does -#define IEIFLAG_SCREEN 0x0020 // render as if for the screen (this is exclusive with IEIFLAG_ASPECT ) -#define IEIFLAG_ORIGSIZE 0x0040 // render to the approx size passed, but crop if necessary -#define IEIFLAG_NOSTAMP 0x0080 // returned from the extractor if it does NOT want an icon stamp on the thumbnail -#define IEIFLAG_NOBORDER 0x0100 // returned from the extractor if it does NOT want an a border around the thumbnail -#define IEIFLAG_QUALITY 0x0200 // passed to the Extract method to indicate that a slower, higher quality image is desired, re-compute the thumbnail -#define IEIFLAG_REFRESH 0x0400 // returned from the extractor if it would like to have Refresh Thumbnail available - -//#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BB2E617C-0920-11d1-9A0B-00C04FC2D6C1") - IExtractImage : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetLocation( - /* [size_is][out] */ LPWSTR pszPathBuffer, - /* [in] */ DWORD cch, - /* [unique][out][in] */ DWORD *pdwPriority, - /* [in] */ const SIZE *prgSize, - /* [in] */ DWORD dwRecClrDepth, - /* [in] */ DWORD *pdwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Extract( - /* [out] */ HBITMAP *phBmpThumbnail) = 0; - - }; - - DEFINE_GUID(IID_IExtractImage2, - 0x953BB1EE, 0x93B4, 0x11d1, 0x98, 0xA3, 0x00, 0xC0, 0x4F, 0xB6, 0x87, 0xDA); - - MIDL_INTERFACE("953BB1EE-93B4-11d1-98A3-00C04FB687DA") - IExtractImage2 : public IExtractImage - { - public: - virtual HRESULT STDMETHODCALLTYPE GetDateStamp( - /* [out] */ FILETIME *pDateStamp) = 0; - - }; - -#endif \ No newline at end of file diff --git a/src/Tools/thumbs/Resource.h b/src/Tools/thumbs/Resource.h deleted file mode 100644 index aeab9ce5b1..0000000000 --- a/src/Tools/thumbs/Resource.h +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2008 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by FCThumbs.rc -// -#define IDR_FCSTD_TYPE 100 -#define IDR_THUMBSCB 2000 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 2007 -#define _APS_NEXT_COMMAND_VALUE 32772 -#define _APS_NEXT_CONTROL_VALUE 2000 -#define _APS_NEXT_SYMED_VALUE 2001 -#endif -#endif diff --git a/src/Tools/thumbs/StdAfx.cpp b/src/Tools/thumbs/StdAfx.cpp deleted file mode 100644 index 88be242ec6..0000000000 --- a/src/Tools/thumbs/StdAfx.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2008 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -// stdafx.cpp : source file that includes just the standard includes -// stdafx.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -#ifdef _ATL_STATIC_REGISTRY -#include -#endif - -#include - diff --git a/src/Tools/thumbs/StdAfx.h b/src/Tools/thumbs/StdAfx.h deleted file mode 100644 index acbd782847..0000000000 --- a/src/Tools/thumbs/StdAfx.h +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2008 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently -// -#if !defined(AFX_STDAFX_H__BA56C57E_75FC_4E34_A374_AEA259EB50FA__INCLUDED_) -#define AFX_STDAFX_H__BA56C57E_75FC_4E34_A374_AEA259EB50FA__INCLUDED_ - -#pragma once - -// Disable warnings -#pragma warning(disable : 4996) - -#define _ATL_APARTMENT_THREADED - -#include -//You may derive a class from CComModule and use it if you want to override -//something, but do not change the name of _Module -extern CComModule _Module; -#include - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__BA56C57E_75FC_4E34_A374_AEA259EB50FA__INCLUDED_) diff --git a/src/Tools/thumbs/ThumbFCStd.idl b/src/Tools/thumbs/ThumbFCStd.idl deleted file mode 100644 index a5039ba5bf..0000000000 --- a/src/Tools/thumbs/ThumbFCStd.idl +++ /dev/null @@ -1,38 +0,0 @@ - - // ThumbFCStd.idl : IDL source for FCThumbs.exe -// -// This file will be processed by the MIDL tool to -// produce the type library (FCThumbs.tlb) and marshalling code. -import "oaidl.idl"; -import "ocidl.idl"; - - [ - object, - uuid(08FB392E-6B54-4796-A960-10399D754C93), - dual, - helpstring("IFCStdExtractor Interface"), - pointer_default(unique) - ] - interface IFCStdExtractor : IDispatch - { - }; - -[ - uuid(1C52B730-EC75-423F-A300-4A42CDF1C985), - version(1.0), - helpstring("ThumbFCStd 1.0 Type Library") -] -library THUMBFCSTDLib -{ - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - - [ - uuid(287CC8A6-B380-4765-8EB1-AFC82D90DF68), - helpstring("FCStdExtractor Class") - ] - coclass FCStdExtractor - { - [default] interface IFCStdExtractor; - }; -};