From 24671bc900cd5232e595efa87111b720d4f14237 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 1 Jun 2008 18:42:33 +0000 Subject: [PATCH] define wxHAS_RAW_BITMAP (instead of inconsistenly named wxHAVE_RAW_BITMAP) and use it to avoid test build error under ports not supporting raw bitmaps git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/doxygen/mainpages/const_cpp.h | 1 + include/wx/features.h | 9 +++++++++ include/wx/platform.h | 9 --------- tests/image/rawbmp.cpp | 4 ++++ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/doxygen/mainpages/const_cpp.h b/docs/doxygen/mainpages/const_cpp.h index 40bd2b111e..c03215e0cb 100644 --- a/docs/doxygen/mainpages/const_cpp.h +++ b/docs/doxygen/mainpages/const_cpp.h @@ -193,6 +193,7 @@ Currently the following symbols exist: @itemdef{wxHAS_POWER_EVENTS, Defined if wxPowerEvent are ever generated on the current platform.} @itemdef{wxHAS_RADIO_MENU_ITEMS, Defined if the current port supports radio menu items (see wxMenu::AppendRadioItem).} +@itemdef{wxHAS_RAW_BITMAP, Defined if direct access to bitmap data using the classes in @c wx/rawbmp.h is supported.} @itemdef{wxHAS_RAW_KEY_CODES, Defined if raw key codes (see wxKeyEvent::GetRawKeyCode are supported.} @itemdef{wxHAS_REGEX_ADVANCED, Defined if advanced syntax is available in wxRegEx.} @itemdef{wxHAS_TASK_BAR_ICON, Defined if wxTaskBarIcon is available on the current platform.} diff --git a/include/wx/features.h b/include/wx/features.h index 4d004f8829..9dc0e83b03 100644 --- a/include/wx/features.h +++ b/include/wx/features.h @@ -84,5 +84,14 @@ #undef wxHAS_XLOCALE_SUPPORT #endif +/* Direct access to bitmap data is only implemented for MSW/Mac/GTK2 */ +#if defined(__WXGTK20__) || defined(__WXMAC__) || \ + (defined(__WXMSW__) && !defined(__WATCOMC__)) + #define wxHAS_RAW_BITMAP +#endif + +/* deprecated synonym which exists for compatibility only */ +#define wxHAVE_RAW_BITMAP wxHAS_RAW_BITMAP + #endif /* _WX_FEATURES_H_ */ diff --git a/include/wx/platform.h b/include/wx/platform.h index 4db7828771..9e7d5bf4f7 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -612,15 +612,6 @@ #define wxCHECK_SUNCC_VERSION(maj, min) (0) #endif -#if defined (__WXMSW__) -# if !defined(__WATCOMC__) -# define wxHAVE_RAW_BITMAP -# endif -#endif -#if defined(__WXGTK20__) || defined(__WXMAC__) -# define wxHAVE_RAW_BITMAP -#endif - /* Handle Darwin gcc universal compilation. Don't do this in an Apple- specific case since no sane compiler should be defining either diff --git a/tests/image/rawbmp.cpp b/tests/image/rawbmp.cpp index be37a83242..00d50b2243 100644 --- a/tests/image/rawbmp.cpp +++ b/tests/image/rawbmp.cpp @@ -18,6 +18,8 @@ #pragma hdrstop #endif +#ifdef wxHAS_RAW_BITMAP + #ifndef WX_PRECOMP #endif // WX_PRECOMP @@ -82,3 +84,5 @@ void ImageRawTestCase::RGBImage() ASSERT_COL_EQUAL( 0, image.GetGreen(0, 1) ); ASSERT_COL_EQUAL( 0, image.GetGreen(1, 0) ); } + +#endif // wxHAS_RAW_BITMAP -- 2.45.2