implement wxHAVE_RAW_BITMAP

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Chris Elliott
2003-05-02 12:58:00 +00:00
parent 7a311019db
commit 1e3c12d774
4 changed files with 24 additions and 4 deletions

View File

@@ -305,6 +305,11 @@
#endif #endif
#endif #endif
#if defined (__WXMSW__)
#if !defined(__DIGITALMARS__) && !defined(__WATCOMC__)
#define wxHAVE_RAW_BITMAP
#endif
#endif
#endif /* _WX_PLATFORM_H_ */ #endif /* _WX_PLATFORM_H_ */

View File

@@ -34,10 +34,8 @@
#if !defined(__WINDOWS__) || wxUSE_XPM_IN_MSW #if !defined(__WINDOWS__) || wxUSE_XPM_IN_MSW
#include "smile.xpm" #include "smile.xpm"
#endif #endif
#include "wx/rawbmp.h"
#if defined(__WXMSW__)
#define wxHAVE_RAW_BITMAP
#endif
// derived classes // derived classes
@@ -833,6 +831,7 @@ MyFrame::MyFrame()
wxMenu *menuImage = new wxMenu; wxMenu *menuImage = new wxMenu;
menuImage->Append( ID_NEW, _T("&Show any image...\tCtrl-O")); menuImage->Append( ID_NEW, _T("&Show any image...\tCtrl-O"));
#ifdef wxHAVE_RAW_BITMAP #ifdef wxHAVE_RAW_BITMAP
menuImage->Append( ID_SHOWRAW, _T("Test &raw bitmap...\tCtrl-R")); menuImage->Append( ID_SHOWRAW, _T("Test &raw bitmap...\tCtrl-R"));
#endif #endif

View File

@@ -50,7 +50,9 @@
#include "wx/image.h" #include "wx/image.h"
#include "wx/xpmdecod.h" #include "wx/xpmdecod.h"
#ifdef wxHAVE_RAW_BITMAP
#include "wx/rawbmp.h" #include "wx/rawbmp.h"
#endif
// missing from mingw32 header // missing from mingw32 header
#ifndef CLR_INVALID #ifndef CLR_INVALID
@@ -1187,6 +1189,7 @@ void wxBitmap::SetQuality(int WXUNUSED(quality))
// raw bitmap access support // raw bitmap access support
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifdef wxHAVE_RAW_BITMAP
void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
{ {
if ( !Ok() ) if ( !Ok() )
@@ -1317,6 +1320,7 @@ void wxBitmap::UngetRawData(wxPixelDataBase& dataBase)
} }
} }
} }
#endif // #ifdef wxHAVE_RAW_BITMAP
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxMask // wxMask

View File

@@ -44,7 +44,10 @@
#include "wx/dcprint.h" #include "wx/dcprint.h"
#include "wx/module.h" #include "wx/module.h"
#include "wx/dynload.h" #include "wx/dynload.h"
#ifdef wxHAVE_RAW_BITMAP
#include "wx/rawbmp.h" #include "wx/rawbmp.h"
#endif
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
@@ -114,9 +117,12 @@ static const int MM_METRIC = 10;
// convert degrees to radians // convert degrees to radians
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; } static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
#ifdef wxHAVE_RAW_BITMAP
// our (limited) AlphaBlend() replacement // our (limited) AlphaBlend() replacement
static void static void
wxAlphaBlend(wxDC& dc, int x, int y, int w, int h, const wxBitmap& bmp); wxAlphaBlend(wxDC& dc, int x, int y, int w, int h, const wxBitmap& bmp);
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// private classes // private classes
@@ -656,7 +662,7 @@ void wxDC::DoDrawCheckMark(wxCoord x1, wxCoord y1,
wxCoord x2 = x1 + width, wxCoord x2 = x1 + width,
y2 = y1 + height; y2 = y1 + height;
#if defined(__WIN32__) && !defined(__SC__) && !defined(__WXMICROWIN__) #if defined(__WIN32__) && !defined(__SYMANTEC__) && !defined(__WXMICROWIN__)
RECT rect; RECT rect;
rect.left = x1; rect.left = x1;
rect.top = y1; rect.top = y1;
@@ -1007,7 +1013,11 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask
} }
else // use our own (probably much slower) implementation else // use our own (probably much slower) implementation
{ {
#ifdef wxHAVE_RAW_BITMAP
wxAlphaBlend(*this, x, y, width, height, bmp); wxAlphaBlend(*this, x, y, width, height, bmp);
#else
wxLogLastError(_T("AlphaBlend not available with this compiler setup"));
#endif //#ifdef wxHAVE_RAW_BITMAP
} }
return; return;
@@ -2299,6 +2309,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDCModule, wxModule)
// wxAlphaBlend: our fallback if ::AlphaBlend() is unavailable // wxAlphaBlend: our fallback if ::AlphaBlend() is unavailable
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifdef wxHAVE_RAW_BITMAP
static void static void
wxAlphaBlend(wxDC& dc, int xDst, int yDst, int w, int h, const wxBitmap& bmpSrc) wxAlphaBlend(wxDC& dc, int xDst, int yDst, int w, int h, const wxBitmap& bmpSrc)
{ {
@@ -2354,3 +2365,4 @@ wxAlphaBlend(wxDC& dc, int xDst, int yDst, int w, int h, const wxBitmap& bmpSrc)
} }
} }
#endif // #ifdef wxHAVE_RAW_BITMAP