| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #pragma once |
| 4 | |
| 5 | #include "BsCorePrerequisites.h" |
| 6 | |
| 7 | namespace bs |
| 8 | { |
| 9 | /** @addtogroup Utility-Core-Internal |
| 10 | * @{ |
| 11 | */ |
| 12 | |
| 13 | /** Manipulates icons in executable files. */ |
| 14 | class BS_CORE_EXPORT IconUtility |
| 15 | { |
| 16 | public: |
| 17 | /** |
| 18 | * Updates icons in the provided executable. Only icons that already exist in the executable can be updated, no new |
| 19 | * icons can be inserted. Icons must be square. |
| 20 | * |
| 21 | * @param[in] filePath Path to the executable. |
| 22 | * @param[in] icons Pixels of images to replace. Each entry maps an icon width (and height, since they're |
| 23 | * square) to its pixels. |
| 24 | */ |
| 25 | static void updateIconExe(const Path& filePath, const Map<UINT32, SPtr<PixelData>>& icons); |
| 26 | |
| 27 | private: |
| 28 | /** |
| 29 | * Updates data of an existing icon with new pixels. |
| 30 | * |
| 31 | * @param[in] iconData Existing icon bytes, in Windows ICO format. |
| 32 | * @param[in] icons Pixels of images to replace. Each entry maps an icon width (and height, since they're |
| 33 | * square) to its pixels. |
| 34 | */ |
| 35 | static void updateIconData(UINT8* iconData, const Map<UINT32, SPtr<PixelData>>& icons); |
| 36 | }; |
| 37 | |
| 38 | /** @} */ |
| 39 | } |