X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..2cf3a6d7bef6f20bea35062dd3d4dbf0aec9efb5:/src/mac/classic/bitmap.cpp diff --git a/src/mac/classic/bitmap.cpp b/src/mac/classic/bitmap.cpp index ae5a46bc3d..beae4cbe2d 100644 --- a/src/mac/classic/bitmap.cpp +++ b/src/mac/classic/bitmap.cpp @@ -1,24 +1,28 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: bitmap.cpp +// Name: src/mac/classic/bitmap.cpp // Purpose: wxBitmap // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "bitmap.h" -#endif +#include "wx/wxprec.h" -#include "wx/defs.h" +#ifdef __BORLANDC__ + #pragma hdrstop +#endif #include "wx/bitmap.h" -#include "wx/icon.h" -#include "wx/log.h" -#include "wx/image.h" + +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/icon.h" + #include "wx/image.h" +#endif + #include "wx/xpmdecod.h" #include "wx/rawbmp.h" @@ -168,7 +172,7 @@ OSErr SetupCIconHandlePixMap( CIconHandle icon , short depth , Rect *bounds , C else newColors = nil; - /* If no errors occured, return a handle to the new off-screen PixMap */ + /* If no errors occurred, return a handle to the new off-screen PixMap */ if (error != noErr) { if (newColors != nil) @@ -357,7 +361,7 @@ wxBitmapRefData::wxBitmapRefData() : m_width(0) , m_height(0) , m_depth(0) - , m_ok(FALSE) + , m_ok(false) , m_numColors(0) , m_quality(0) { @@ -512,12 +516,12 @@ wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type) bool wxBitmap::CreateFromXpm(const char **bits) { - wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid bitmap data") ) + wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ); wxXPMDecoder decoder; wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid bitmap data") ) + wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") ); *this = wxBitmap(img); - return TRUE; + return true; } wxBitmap::wxBitmap(const char **bits) @@ -714,7 +718,7 @@ bool wxBitmap::Create(void *data, wxBitmapType type, int width, int height, int if ( handler == NULL ) { wxLogWarning(wxT("no bitmap handler for type %d defined."), type); - return FALSE; + return false; } return handler->Create(this, data, type, width, height, depth); @@ -722,8 +726,8 @@ bool wxBitmap::Create(void *data, wxBitmapType type, int width, int height, int wxBitmap::wxBitmap(const wxImage& image, int depth) { - wxCHECK_RET( image.Ok(), wxT("invalid image") ) - wxCHECK_RET( depth == -1, wxT("invalid bitmap depth") ) + wxCHECK_RET( image.Ok(), wxT("invalid image") ); + wxCHECK_RET( depth == -1, wxT("invalid bitmap depth") ); m_refData = new wxBitmapRefData(); @@ -1166,7 +1170,7 @@ bool wxMask::Create(const wxBitmap& bitmap) UnlockPixels( GetGWorldPixMap( (GWorldPtr) m_maskBitmap) ); UnlockPixels( GetGWorldPixMap( (GWorldPtr) bitmap.GetHBITMAP()) ); - return FALSE; + return false; } // Create a mask from a bitmap and a palette index indicating @@ -1175,7 +1179,7 @@ bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex) { // TODO wxCHECK_MSG( 0, false, wxT("wxMask::Create not yet implemented")); - return FALSE; + return false; } // Create a mask from a bitmap and a colour indicating @@ -1230,7 +1234,7 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) UnlockPixels( GetGWorldPixMap( (GWorldPtr) bitmap.GetHBITMAP() ) ) ; SetGWorld( origPort , origDevice ) ; - return TRUE; + return true; } bool wxMask::PointMasked(int x, int y) @@ -1264,18 +1268,18 @@ wxBitmapHandler::~wxBitmapHandler() bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth) { - return FALSE; + return false; } bool wxBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, int desiredWidth, int desiredHeight) { - return FALSE; + return false; } bool wxBitmapHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette) { - return FALSE; + return false; } /* @@ -1321,9 +1325,9 @@ bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo M_BITMAPHANDLERDATA->m_numColors = theInfo.uniqueColors ; // M_BITMAPHANDLERDATA->m_bitmapPalette; // M_BITMAPHANDLERDATA->m_quality; - return TRUE ; + return true ; } - return FALSE ; + return false ; } void wxBitmap::InitStandardHandlers() @@ -1433,4 +1437,3 @@ void wxBitmap::UseAlpha() // mask in UngetRawData() M_BITMAPDATA->m_hasAlpha = true; } -