]> git.saurik.com Git - wxWidgets.git/commitdiff
moved AddFile(wxImage) to GUI part of library, too
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 25 Jun 2003 14:59:02 +0000 (14:59 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 25 Jun 2003 14:59:02 +0000 (14:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/fs_mem.h
src/common/fs_mem.cpp

index d800a80782cf858c746cb133d61b424b39c99502..62aff0c71c2e6e5e46b31390adab662b5681718e 100644 (file)
@@ -39,9 +39,6 @@ public:
     // Add file to list of files stored in memory. Stored data (bitmap, text or
     // raw data) will be copied into private memory stream and available under
     // name "memory:" + filename
-#if wxUSE_IMAGE
-    static void AddFile(const wxString& filename, wxImage& image, long type);
-#endif // wxUSE_IMAGE
     static void AddFile(const wxString& filename, const wxString& textdata);
     static void AddFile(const wxString& filename, const void *binarydata, size_t size);
 
@@ -63,6 +60,9 @@ class wxMemoryFSHandler : public wxMemoryFSHandlerBase
 {
 public:
 #if wxUSE_GUI
+#if wxUSE_IMAGE
+    static void AddFile(const wxString& filename, wxImage& image, long type);
+#endif // wxUSE_IMAGE
     static void AddFile(const wxString& filename, const wxBitmap& bitmap, long type);
 #endif // wxUSE_GUI
 };
index 70fd638425cd067ee4eadffd05d3e281530d6b45..c94c250e4bbcf84d457f7825870369ab80d3e39f 100644 (file)
@@ -172,28 +172,6 @@ bool wxMemoryFSHandlerBase::CheckHash(const wxString& filename)
 }
 
 
-#if wxUSE_IMAGE
-
-/*static*/ void
-wxMemoryFSHandlerBase::AddFile(const wxString& filename, wxImage& image, long type)
-{
-    if (!CheckHash(filename)) return;
-
-
-    wxMemoryOutputStream mems;
-    if (image.Ok() && image.SaveFile(mems, (int)type))
-        m_Hash -> Put(filename, new MemFSHashObj(mems));
-    else
-    {
-        wxString s;
-        s.Printf(_("Failed to store image '%s' to memory VFS!"), filename.c_str());
-        wxPrintf(wxT("'%s'\n"), s.c_str());
-        wxLogError(s);
-    }
-}
-
-#endif // wxUSE_IMAGE
-
 /*static*/ void wxMemoryFSHandlerBase::AddFile(const wxString& filename, const wxString& textdata)
 {
     AddFile(filename, (const void*) textdata.mb_str(), textdata.Length());
@@ -226,6 +204,26 @@ wxMemoryFSHandlerBase::AddFile(const wxString& filename, wxImage& image, long ty
 
 #if wxUSE_GUI
 
+#if wxUSE_IMAGE
+/*static*/ void
+wxMemoryFSHandlerBase::AddFile(const wxString& filename, wxImage& image, long type)
+{
+    if (!CheckHash(filename)) return;
+
+
+    wxMemoryOutputStream mems;
+    if (image.Ok() && image.SaveFile(mems, (int)type))
+        m_Hash -> Put(filename, new MemFSHashObj(mems));
+    else
+    {
+        wxString s;
+        s.Printf(_("Failed to store image '%s' to memory VFS!"), filename.c_str());
+        wxPrintf(wxT("'%s'\n"), s.c_str());
+        wxLogError(s);
+    }
+}
+#endif // wxUSE_IMAGE
+
 /*static*/ void wxMemoryFSHandler::AddFile(const wxString& filename, const wxBitmap& bitmap, long type)
 {
     wxImage img = bitmap.ConvertToImage();