From: Dimitri Schoolwerth Date: Tue, 23 Aug 2011 04:55:46 +0000 (+0000) Subject: Added wxBITMAP_TYPE_TIFF and wxBITMAP_TYPE_TIFF_RESOURCE. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4ca8531f6195e4daae4756a396ba00f23cad2166 Added wxBITMAP_TYPE_TIFF and wxBITMAP_TYPE_TIFF_RESOURCE. Having wxBITMAP_TYPE_TIFF and wxBITMAP_TYPE_TIFF_RESOURCE is more consistent with already using the complete short name of an image format elsewhere (e.g. wxBITMAP_TYPE_JPEG, not wxBTMAP_TYPE_JPG, and wxTIFFHandler as opposed to wxTIFHandler). Renamed all existing occurrences and kept the old enum values for backwards compatibility. Also renamed occurrences of wxBITMAP_TYPE_RESOURCE to the already existing wxBITMAP_TYPE_BMP_RESOURCE. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68859 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/doxygen/overviews/bitmap.h b/docs/doxygen/overviews/bitmap.h index 680facc5a2..2a375ca777 100644 --- a/docs/doxygen/overviews/bitmap.h +++ b/docs/doxygen/overviews/bitmap.h @@ -70,7 +70,7 @@ wxBitmap bmp(wxBITMAP(bmpname)); // which is roughly equivalent to the following #if defined(__WXMSW__) || defined(__WXPM__) - wxBitmap bmp("bmpname", wxBITMAP_TYPE_RESOURCE); + wxBitmap bmp("bmpname", wxBITMAP_TYPE_BMP_RESOURCE); #else // Unix wxBitmap bmp(bmpname_xpm, wxBITMAP_TYPE_XPM); #endif diff --git a/include/wx/bitmap.h b/include/wx/bitmap.h index 754eabc631..2ba1122fc2 100644 --- a/include/wx/bitmap.h +++ b/include/wx/bitmap.h @@ -256,10 +256,10 @@ protected: #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM #include "wx/x11/bitmap.h" #elif defined(__WXMGL__) - #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_RESOURCE + #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE #include "wx/mgl/bitmap.h" #elif defined(__WXDFB__) - #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_RESOURCE + #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE #include "wx/dfb/bitmap.h" #elif defined(__WXMAC__) #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_PICT_RESOURCE diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 5b6282d4b2..bf7fa60792 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -59,8 +59,10 @@ enum wxBitmapType wxBITMAP_TYPE_XBM_DATA, wxBITMAP_TYPE_XPM, wxBITMAP_TYPE_XPM_DATA, - wxBITMAP_TYPE_TIF, - wxBITMAP_TYPE_TIF_RESOURCE, + wxBITMAP_TYPE_TIFF, + wxBITMAP_TYPE_TIF = wxBITMAP_TYPE_TIFF, + wxBITMAP_TYPE_TIFF_RESOURCE, + wxBITMAP_TYPE_TIF_RESOURCE = wxBITMAP_TYPE_TIFF_RESOURCE, wxBITMAP_TYPE_GIF, wxBITMAP_TYPE_GIF_RESOURCE, wxBITMAP_TYPE_PNG, @@ -202,7 +204,7 @@ enum wxStockCursor */ #if defined(__WXMSW__) || defined(__WXPM__) - #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE) + #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_BMP_RESOURCE) #elif defined(__WXGTK__) || \ defined(__WXMOTIF__) || \ defined(__WXX11__) || \ diff --git a/interface/wx/gdicmn.h b/interface/wx/gdicmn.h index b660421374..c26755c304 100644 --- a/interface/wx/gdicmn.h +++ b/interface/wx/gdicmn.h @@ -24,8 +24,10 @@ enum wxBitmapType wxBITMAP_TYPE_XBM_DATA, wxBITMAP_TYPE_XPM, wxBITMAP_TYPE_XPM_DATA, - wxBITMAP_TYPE_TIF, - wxBITMAP_TYPE_TIF_RESOURCE, + wxBITMAP_TYPE_TIFF, + wxBITMAP_TYPE_TIF = wxBITMAP_TYPE_TIFF, + wxBITMAP_TYPE_TIFF_RESOURCE, + wxBITMAP_TYPE_TIF_RESOURCE = wxBITMAP_TYPE_TIFF_RESOURCE, wxBITMAP_TYPE_GIF, wxBITMAP_TYPE_GIF_RESOURCE, wxBITMAP_TYPE_PNG, diff --git a/interface/wx/image.h b/interface/wx/image.h index 7c5dcd6b2f..88175ba4fc 100644 --- a/interface/wx/image.h +++ b/interface/wx/image.h @@ -522,7 +522,7 @@ public: @li wxBITMAP_TYPE_PNG: Load a PNG bitmap file. @li wxBITMAP_TYPE_PCX: Load a PCX bitmap file. @li wxBITMAP_TYPE_PNM: Load a PNM bitmap file. - @li wxBITMAP_TYPE_TIF: Load a TIFF bitmap file. + @li wxBITMAP_TYPE_TIFF: Load a TIFF bitmap file. @li wxBITMAP_TYPE_TGA: Load a TGA bitmap file. @li wxBITMAP_TYPE_XPM: Load a XPM bitmap file. @li wxBITMAP_TYPE_ICO: Load a Windows icon file (ICO). @@ -1299,7 +1299,7 @@ public: @li wxBITMAP_TYPE_PNG: Load a PNG bitmap file. @li wxBITMAP_TYPE_PCX: Load a PCX bitmap file. @li wxBITMAP_TYPE_PNM: Load a PNM bitmap file. - @li wxBITMAP_TYPE_TIF: Load a TIFF bitmap file. + @li wxBITMAP_TYPE_TIFF: Load a TIFF bitmap file. @li wxBITMAP_TYPE_TGA: Load a TGA bitmap file. @li wxBITMAP_TYPE_XPM: Load a XPM bitmap file. @li wxBITMAP_TYPE_ICO: Load a Windows icon file (ICO). @@ -1781,7 +1781,7 @@ public: @li wxBITMAP_TYPE_PNG: Load a PNG bitmap file. @li wxBITMAP_TYPE_PCX: Load a PCX bitmap file. @li wxBITMAP_TYPE_PNM: Load a PNM bitmap file. - @li wxBITMAP_TYPE_TIF: Load a TIFF bitmap file. + @li wxBITMAP_TYPE_TIFF: Load a TIFF bitmap file. @li wxBITMAP_TYPE_TGA: Load a TGA bitmap file. @li wxBITMAP_TYPE_XPM: Load a XPM bitmap file. @li wxBITMAP_TYPE_ICO: Load a Windows icon file (ICO). diff --git a/samples/image/canvas.cpp b/samples/image/canvas.cpp index 3bff81316f..2fc194423c 100644 --- a/samples/image/canvas.cpp +++ b/samples/image/canvas.cpp @@ -243,7 +243,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_LIBTIFF image.Destroy(); - if ( !image.LoadFile( dir + wxT("horse.tif"), wxBITMAP_TYPE_TIF ) ) + if ( !image.LoadFile( dir + wxT("horse.tif"), wxBITMAP_TYPE_TIFF ) ) { wxLogError(wxT("Can't load TIFF image")); } diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index 5bbdd65f52..f0f72c147b 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -284,7 +284,7 @@ wxContextHelpButton::wxContextHelpButton(wxWindow* parent, long style) #if defined(__WXPM__) : wxBitmapButton(parent, id, wxBitmap(wxCSQUERY_BITMAP - ,wxBITMAP_TYPE_RESOURCE + ,wxBITMAP_TYPE_BMP_RESOURCE ), pos, size, style) #else diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 40083e6bab..c71497af3b 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -110,7 +110,7 @@ wxTIFFHandler::wxTIFFHandler() m_name = wxT("TIFF file"); m_extension = wxT("tif"); m_altExtensions.Add(wxT("tiff")); - m_type = wxBITMAP_TYPE_TIF; + m_type = wxBITMAP_TYPE_TIFF; m_mime = wxT("image/tiff"); TIFFSetWarningHandler((TIFFErrorHandler) TIFFwxWarningHandler); TIFFSetErrorHandler((TIFFErrorHandler) TIFFwxErrorHandler); diff --git a/src/richtext/richtexthtml.cpp b/src/richtext/richtexthtml.cpp index 06670cb486..f9a24d9c9f 100644 --- a/src/richtext/richtexthtml.cpp +++ b/src/richtext/richtexthtml.cpp @@ -588,7 +588,7 @@ const wxChar* wxRichTextHTMLHandler::GetMimeType(int imageType) { case wxBITMAP_TYPE_BMP: return wxT("image/bmp"); - case wxBITMAP_TYPE_TIF: + case wxBITMAP_TYPE_TIFF: return wxT("image/tiff"); case wxBITMAP_TYPE_GIF: return wxT("image/gif"); diff --git a/tests/image/image.cpp b/tests/image/image.cpp index 0350dcbfa9..d063621dcc 100644 --- a/tests/image/image.cpp +++ b/tests/image/image.cpp @@ -50,7 +50,7 @@ struct testData { { "horse.pcx", wxBITMAP_TYPE_PCX, 8 }, { "horse.pnm", wxBITMAP_TYPE_PNM, 24 }, { "horse.tga", wxBITMAP_TYPE_TGA, 8 }, - { "horse.tif", wxBITMAP_TYPE_TIF, 8 } + { "horse.tif", wxBITMAP_TYPE_TIFF, 8 } }; @@ -192,7 +192,7 @@ void ImageTestCase::LoadFromZipStream() case wxBITMAP_TYPE_GIF: case wxBITMAP_TYPE_PCX: case wxBITMAP_TYPE_TGA: - case wxBITMAP_TYPE_TIF: + case wxBITMAP_TYPE_TIFF: continue; // skip testing those wxImageHandlers which cannot // load data from non-seekable streams @@ -1097,7 +1097,7 @@ static void TestTIFFImage(const wxString& option, int value) wxMemoryOutputStream memOut; image.SetOption(option, value); - CPPUNIT_ASSERT(image.SaveFile(memOut, wxBITMAP_TYPE_TIF)); + CPPUNIT_ASSERT(image.SaveFile(memOut, wxBITMAP_TYPE_TIFF)); wxMemoryInputStream memIn(memOut); CPPUNIT_ASSERT(memIn.IsOk()); diff --git a/utils/emulator/src/emulator.cpp b/utils/emulator/src/emulator.cpp index e7f1545b17..f033ac1774 100644 --- a/utils/emulator/src/emulator.cpp +++ b/utils/emulator/src/emulator.cpp @@ -534,7 +534,7 @@ wxBitmapType wxDetermineImageType(const wxString& filename) if (ext == wxT("pcx")) return wxBITMAP_TYPE_PCX; if (ext == wxT("tif") || ext == wxT("tiff")) - return wxBITMAP_TYPE_TIF; + return wxBITMAP_TYPE_TIFF; return wxBITMAP_TYPE_INVALID; }