minor cleanup - reformat

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36782 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Surovell
2006-01-08 18:52:03 +00:00
parent 5fa7a49ce3
commit 7fe44deeab

View File

@@ -1131,7 +1131,7 @@ wxImage wxBitmap::ConvertToImage() const
// The following masking algorithm is the same as well in msw/gtk: // The following masking algorithm is the same as well in msw/gtk:
// the colour used as transparent one in wxImage and the one it is // the colour used as transparent one in wxImage and the one it is
// replaced with when it really occurs in the bitmap // replaced with when it actually occurs in the bitmap
static const int MASK_RED = 1; static const int MASK_RED = 1;
static const int MASK_GREEN = 2; static const int MASK_GREEN = 2;
static const int MASK_BLUE = 3; static const int MASK_BLUE = 3;
@@ -1161,6 +1161,7 @@ wxImage wxBitmap::ConvertToImage() const
} }
else if ( r == MASK_RED && g == MASK_GREEN && b == MASK_BLUE ) else if ( r == MASK_RED && g == MASK_GREEN && b == MASK_BLUE )
b = MASK_BLUE_REPLACEMENT ; b = MASK_BLUE_REPLACEMENT ;
maskp++ ; maskp++ ;
maskp++ ; maskp++ ;
} }
@@ -1184,8 +1185,8 @@ wxImage wxBitmap::ConvertToImage() const
#endif //wxUSE_IMAGE #endif //wxUSE_IMAGE
bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, bool wxBitmap::SaveFile( const wxString& filename,
const wxPalette *palette) const wxBitmapType type, const wxPalette *palette ) const
{ {
bool success = false; bool success = false;
wxBitmapHandler *handler = FindHandler(type); wxBitmapHandler *handler = FindHandler(type);
@@ -1374,8 +1375,8 @@ void *wxMask::GetRawAccess() const
return m_memBuf.GetData() ; return m_memBuf.GetData() ;
} }
// The default ColorTable for k8IndexedGrayPixelFormat in Intel seems to be broken, so we'll use an non-indexed // The default ColorTable for k8IndexedGrayPixelFormat in Intel appears to be broken, so we'll use an non-indexed
// bitmap mask instead, in order to keep the code simple, the change is done for ppc implementations as well // bitmap mask instead; in order to keep the code simple, the change applies to PowerPC implementations as well
void wxMask::RealizeNative() void wxMask::RealizeNative()
{ {
@@ -1387,8 +1388,10 @@ void wxMask::RealizeNative()
Rect rect = { 0 , 0 , m_height , m_width } ; Rect rect = { 0 , 0 , m_height , m_width } ;
verify_noerr( NewGWorldFromPtr( (GWorldPtr*) &m_maskBitmap , k24RGBPixelFormat , &rect , NULL , NULL , 0 , OSStatus err = NewGWorldFromPtr(
(char*) m_memBuf.GetData() , m_bytesPerRow ) ) ; (GWorldPtr*) &m_maskBitmap , k24RGBPixelFormat , &rect , NULL , NULL , 0 ,
(char*) m_memBuf.GetData() , m_bytesPerRow ) ;
verify_noerr( err ) ;
} }
// Create a mask from a mono bitmap (copies the bitmap). // Create a mask from a mono bitmap (copies the bitmap).
@@ -1549,6 +1552,7 @@ public:
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight); int desiredWidth, int desiredHeight);
}; };
IMPLEMENT_DYNAMIC_CLASS(wxPICTResourceHandler, wxBitmapHandler) IMPLEMENT_DYNAMIC_CLASS(wxPICTResourceHandler, wxBitmapHandler)
@@ -1563,6 +1567,7 @@ bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lon
if ( thePict ) if ( thePict )
{ {
wxMetafile mf ; wxMetafile mf ;
mf.SetHMETAFILE( (WXHMETAFILE) thePict ) ; mf.SetHMETAFILE( (WXHMETAFILE) thePict ) ;
bitmap->Create( mf.GetWidth() , mf.GetHeight() ) ; bitmap->Create( mf.GetWidth() , mf.GetHeight() ) ;
wxMemoryDC dc ; wxMemoryDC dc ;
@@ -1572,7 +1577,7 @@ bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lon
return true ; return true ;
} }
#endif //wxUSE_METAFILE #endif
return false ; return false ;
} }