]> git.saurik.com Git - wxWidgets.git/commitdiff
corrected return type of wxDetermineImageType
authorGilles Depeyrot <gilles_depeyrot@mac.com>
Sat, 13 Jul 2002 12:14:07 +0000 (12:14 +0000)
committerGilles Depeyrot <gilles_depeyrot@mac.com>
Sat, 13 Jul 2002 12:14:07 +0000 (12:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16165 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/emulator/src/emulator.cpp
utils/emulator/src/emulator.h

index ecfd4b2903f226acacfcb14d9167860accb71d72..785bc8bda7455d310b513e7c264c8f90c1fb880a 100644 (file)
@@ -37,6 +37,7 @@
 #include "wx/confbase.h"
 #include "wx/fileconf.h"
 #include "wx/cmdline.h"
+#include "wx/image.h"
 
 #ifdef __WXX11__    
 #include "wx/x11/reparent.h"
@@ -487,8 +488,8 @@ bool wxEmulatorInfo::Load(const wxString& appDir)
             return FALSE;
         }
         
-        int type = wxDetermineImageType(m_emulatorBackgroundBitmapName);
-        if (type == -1)
+        wxBitmapType type = wxDetermineImageType(m_emulatorBackgroundBitmapName);
+        if (type == wxBITMAP_TYPE_INVALID)
             return FALSE;
         
         if (!m_emulatorBackgroundBitmap.LoadFile(m_emulatorBackgroundBitmapName, type))
@@ -505,7 +506,7 @@ bool wxEmulatorInfo::Load(const wxString& appDir)
 }
 
 // Returns the image type, or -1, determined from the extension.
-int wxDetermineImageType(const wxString& filename)
+wxBitmapType wxDetermineImageType(const wxString& filename)
 {
     wxString path, name, ext;
 
@@ -514,18 +515,18 @@ int wxDetermineImageType(const wxString& filename)
     ext.MakeLower();
     if (ext == "jpg" || ext == "jpeg")
         return wxBITMAP_TYPE_JPEG;
-    else if (ext == "gif")
+    if (ext == "gif")
         return wxBITMAP_TYPE_GIF;
-    else if (ext == "bmp")
+    if (ext == "bmp")
         return wxBITMAP_TYPE_BMP;
-    else if (ext == "png")
+    if (ext == "png")
         return wxBITMAP_TYPE_PNG;
-    else if (ext == "pcx")
+    if (ext == "pcx")
         return wxBITMAP_TYPE_PCX;
-    else if (ext == "tif" || ext == "tiff")
+    if (ext == "tif" || ext == "tiff")
         return wxBITMAP_TYPE_TIF;
-    else
-        return -1;
+    
+    return wxBITMAP_TYPE_INVALID;
 }
 
 // Convert a colour to a 6-digit hex string
index ee02672792a267d6b5cebea6f1420290f01f266d..5e14259c65d8d95d29b286ec496dd8c6b589e46b 100644 (file)
@@ -152,7 +152,7 @@ enum
 };
 
 // Returns the image type, or -1, determined from the extension.
-int wxDetermineImageType(const wxString& filename);
+wxBitmapType wxDetermineImageType(const wxString& filename);
 
 // Convert a colour to a 6-digit hex string
 wxString wxColourToHexString(const wxColour& col);