Changeset 31f4d2216a81…
Parent 3c5afd3c0bbf…
by
Changes to 6 files · Browse files at 31f4d2216a81 Showing diff from parent 3c5afd3c0bbf Diff from another changeset...
@@ -7,9 +7,12 @@ #include "InitStatus.h"
#include "SysInfo.h"
#include "ShellExt.h"
+#include "RegistryConfig.h"
+#include "TortoiseIconBitmap.h"
+
+#include <map>
+
#include "CShellExtCMenu.h"
-#include "RegistryConfig.h"
-#include <map>
struct MenuDescription
|
@@ -10,6 +10,7 @@ InitStatus.obj \
CShellExtCMenu.obj \
CShellExtOverlay.obj \
+ TortoiseIconBitmap.obj \
IconBitmapUtils.obj \
Registry.obj \
ShellExt.obj \
|
|
@@ -0,0 +1,45 @@ + #include "stdafx.h"
+#include "TortoiseUtils.h"
+
+#include <map>
+
+#include "IconBitmapUtils.h"
+
+
+HBITMAP GetTortoiseIconBitmap(const std::string& iconname)
+{
+ IconBitmapUtils bmpUtils;
+ typedef std::map<std::string, HBITMAP> BitmapCacheT;
+ static BitmapCacheT bmpcache_;
+
+ BitmapCacheT::const_iterator i = bmpcache_.find(iconname);
+ if (i != bmpcache_.end())
+ return i->second;
+
+ if (bmpcache_.size() > 200)
+ {
+ TDEBUG_TRACE("**** GetTortoiseIconBitmap: error: too many bitmaps in cache");
+ return 0;
+ }
+
+ HICON hIcon = GetTortoiseIcon(iconname);
+ if (!hIcon)
+ return 0;
+
+ HBITMAP hBmp = bmpUtils.IconToBitmapPARGB32(hIcon);
+ if (!hBmp)
+ {
+ TDEBUG_TRACE("**** GetTortoiseIconBitmap: error: something wrong in bmpUtils.ConvertToPARGB32(hIcon)");
+ return 0;
+ }
+
+ bmpcache_[iconname] = hBmp;
+
+ TDEBUG_TRACE(
+ "GetTortoiseIconBitmap: added '" << iconname << "' to bmpcache_"
+ " (" << bmpcache_.size() << " bitmaps in cache)"
+ );
+
+ return hBmp;
+}
+
|
|
@@ -0,0 +1,9 @@ + #ifndef TORTOISE_ICON_BITMAP_H_
+#define TORTOISE_ICON_BITMAP_H_
+
+#include <windows.h>
+#include <string>
+
+HBITMAP GetTortoiseIconBitmap(const std::string& iconname);
+
+#endif
|
@@ -9,7 +9,6 @@ #include "FCNTL.H"
#include "shlwapi.h"
-#include "IconBitmapUtils.h"
LPWSTR hf_mbtowc(LPWSTR lpw, LPCSTR lpa, int nChars)
@@ -191,43 +190,6 @@ return h;
}
-HBITMAP GetTortoiseIconBitmap(const std::string& iconname)
-{
- IconBitmapUtils bmpUtils;
- typedef std::map<std::string, HBITMAP> BitmapCacheT;
- static BitmapCacheT bmpcache_;
-
- BitmapCacheT::const_iterator i = bmpcache_.find(iconname);
- if (i != bmpcache_.end())
- return i->second;
-
- if (bmpcache_.size() > 200)
- {
- TDEBUG_TRACE("**** GetTortoiseIconBitmap: error: too many bitmaps in cache");
- return 0;
- }
-
- HICON hIcon = GetTortoiseIcon(iconname);
- if (!hIcon)
- return 0;
-
- HBITMAP hBmp = bmpUtils.IconToBitmapPARGB32(hIcon);
- if (!hBmp)
- {
- TDEBUG_TRACE("**** GetTortoiseIconBitmap: error: something wrong in bmpUtils.ConvertToPARGB32(hIcon)");
- return 0;
- }
-
- bmpcache_[iconname] = hBmp;
-
- TDEBUG_TRACE(
- "GetTortoiseIconBitmap: added '" << iconname << "' to bmpcache_"
- " (" << bmpcache_.size() << " bitmaps in cache)"
- );
-
- return hBmp;
-}
-
std::string GetHgRepoRoot(const std::string& path)
{
|
@@ -19,7 +19,6 @@ std::string BaseName(const std::string&);
bool LaunchCommand(const std::string& command, const std::string& cwd);
HICON GetTortoiseIcon(const std::string & iconname);
-HBITMAP GetTortoiseIconBitmap(const std::string& iconname);
std::string GetHgRepoRoot(const std::string& path);
bool IsHgRepo(const std::string& path);
FILE* fopenReadRenameAllowed(const char* path);
|
Loading...