From 69a5bc231ac8112dcce8947c020add2d34c1be61 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 25 Oct 2006 12:12:56 +0000 Subject: [PATCH] changed wxHAS_NATIVE_OVERLAY and wxHAS_CARET_USING_OVERLAYS to use #ifdef instead of #if ... == 1 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/caret.h | 6 +----- include/wx/generic/caret.h | 8 +++----- include/wx/generic/dragimgg.h | 4 ++-- include/wx/overlay.h | 14 ++++++-------- include/wx/private/overlay.h | 2 +- src/common/overlaycmn.cpp | 2 +- src/generic/caret.cpp | 8 ++++---- src/generic/dragimgg.cpp | 12 ++++++------ src/mac/carbon/overlay.cpp | 2 +- 9 files changed, 25 insertions(+), 33 deletions(-) diff --git a/include/wx/caret.h b/include/wx/caret.h index 3b94c92604..8cff8f2f48 100644 --- a/include/wx/caret.h +++ b/include/wx/caret.h @@ -199,17 +199,13 @@ private: #include "wx/generic/caret.h" #endif // platform -#ifndef wxHAS_CARET_USING_OVERLAYS - #define wxHAS_CARET_USING_OVERLAYS 0 -#endif - // ---------------------------------------------------------------------------- // wxCaretSuspend: a simple class which hides the caret in its ctor and // restores it in the dtor, this should be used when drawing on the screen to // avoid overdrawing the caret // ---------------------------------------------------------------------------- -#if wxHAS_CARET_USING_OVERLAYS +#ifdef wxHAS_CARET_USING_OVERLAYS // we don't need to hide the caret if it's rendered using overlays class WXDLLEXPORT wxCaretSuspend diff --git a/include/wx/generic/caret.h b/include/wx/generic/caret.h index f9dd4d3866..e19212316d 100644 --- a/include/wx/generic/caret.h +++ b/include/wx/generic/caret.h @@ -16,10 +16,8 @@ #include "wx/dc.h" #include "wx/overlay.h" -#if wxHAS_NATIVE_OVERLAY - #define wxHAS_CARET_USING_OVERLAYS 1 -#else - #define wxHAS_CARET_USING_OVERLAYS 0 +#ifdef wxHAS_NATIVE_OVERLAY + #define wxHAS_CARET_USING_OVERLAYS #endif class WXDLLIMPEXP_CORE wxCaret; @@ -78,7 +76,7 @@ private: // GTK specific initialization void InitGeneric(); -#if wxHAS_CARET_USING_OVERLAYS +#ifdef wxHAS_CARET_USING_OVERLAYS // the overlay for displaying the caret wxOverlay m_overlay; #else diff --git a/include/wx/generic/dragimgg.h b/include/wx/generic/dragimgg.h index 18b984d6d7..e680ecd305 100644 --- a/include/wx/generic/dragimgg.h +++ b/include/wx/generic/dragimgg.h @@ -160,7 +160,7 @@ public: // For efficiency, tell wxGenericDragImage to use a bitmap that's already // created (e.g. from last drag) void SetBackingBitmap(wxBitmap* bitmap) { -#if !wxHAS_NATIVE_OVERLAY +#ifndef wxHAS_NATIVE_OVERLAY m_pBackingBitmap = bitmap; #endif } @@ -247,7 +247,7 @@ protected: wxWindow* m_window; wxDC* m_windowDC; -#if wxHAS_NATIVE_OVERLAY +#ifdef wxHAS_NATIVE_OVERLAY wxOverlay m_overlay; wxDCOverlay* m_dcOverlay; #else diff --git a/include/wx/overlay.h b/include/wx/overlay.h index b99b850aa8..2b6d267824 100644 --- a/include/wx/overlay.h +++ b/include/wx/overlay.h @@ -14,14 +14,12 @@ #include "wx/defs.h" -#ifndef wxHAS_NATIVE_OVERLAY - #if defined(wxMAC_USE_CORE_GRAPHICS) && wxMAC_USE_CORE_GRAPHICS - #define wxHAS_NATIVE_OVERLAY 1 - #elif defined(__WXDFB__) - #define wxHAS_NATIVE_OVERLAY 1 - #else - #define wxHAS_NATIVE_OVERLAY 0 - #endif +#if defined(wxMAC_USE_CORE_GRAPHICS) && wxMAC_USE_CORE_GRAPHICS + #define wxHAS_NATIVE_OVERLAY 1 +#elif defined(__WXDFB__) + #define wxHAS_NATIVE_OVERLAY 1 +#else + // don't define wxHAS_NATIVE_OVERLAY #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/private/overlay.h b/include/wx/private/overlay.h index a811441fbf..71b265014f 100644 --- a/include/wx/private/overlay.h +++ b/include/wx/private/overlay.h @@ -14,7 +14,7 @@ #include "wx/overlay.h" -#if wxHAS_NATIVE_OVERLAY +#ifdef wxHAS_NATIVE_OVERLAY #if defined(__WXMAC__) #include "wx/mac/carbon/private/overlay.h" diff --git a/src/common/overlaycmn.cpp b/src/common/overlaycmn.cpp index 3936c87c10..d25a45d77f 100644 --- a/src/common/overlaycmn.cpp +++ b/src/common/overlaycmn.cpp @@ -125,7 +125,7 @@ void wxDCOverlay::Clear() // generic implementation of wxOverlayImpl // ---------------------------------------------------------------------------- -#if !wxHAS_NATIVE_OVERLAY +#ifndef wxHAS_NATIVE_OVERLAY wxOverlayImpl::wxOverlayImpl() { diff --git a/src/generic/caret.cpp b/src/generic/caret.cpp index 3391ab910e..5cad74d086 100644 --- a/src/generic/caret.cpp +++ b/src/generic/caret.cpp @@ -88,7 +88,7 @@ void wxCaret::InitGeneric() { m_hasFocus = true; m_blinkedOut = true; -#if !wxHAS_CARET_USING_OVERLAYS +#ifndef wxHAS_CARET_USING_OVERLAYS m_xOld = m_yOld = -1; m_bmpUnderCaret.Create(m_width, m_height); @@ -131,7 +131,7 @@ void wxCaret::DoHide() void wxCaret::DoMove() { -#if wxHAS_CARET_USING_OVERLAYS +#ifdef wxHAS_CARET_USING_OVERLAYS m_overlay.Reset(); #endif if ( IsVisible() ) @@ -158,7 +158,7 @@ void wxCaret::DoSize() m_countVisible = 0; DoHide(); } -#if wxHAS_CARET_USING_OVERLAYS +#ifdef wxHAS_CARET_USING_OVERLAYS m_overlay.Reset(); #else // Change bitmap size @@ -217,7 +217,7 @@ void wxCaret::Refresh() { wxClientDC dcWin(GetWindow()); // this is the new code, switch to 0 if this gives problems -#if wxHAS_CARET_USING_OVERLAYS +#ifdef wxHAS_CARET_USING_OVERLAYS wxDCOverlay dcOverlay( m_overlay, &dcWin, m_x, m_y, m_width , m_height ); if ( m_blinkedOut ) { diff --git a/src/generic/dragimgg.cpp b/src/generic/dragimgg.cpp index 6723b68a2e..7ea5a4fabc 100644 --- a/src/generic/dragimgg.cpp +++ b/src/generic/dragimgg.cpp @@ -72,7 +72,7 @@ void wxGenericDragImage::Init() m_windowDC = (wxDC*) NULL; m_window = (wxWindow*) NULL; m_fullScreen = false; -#if wxHAS_NATIVE_OVERLAY +#ifdef wxHAS_NATIVE_OVERLAY m_dcOverlay = NULL; #else m_pBackingBitmap = (wxBitmap*) NULL; @@ -288,7 +288,7 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot, } } -#if !wxHAS_NATIVE_OVERLAY +#ifndef wxHAS_NATIVE_OVERLAY wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap); if (!backing->Ok() || (backing->GetWidth() < clientSize.x || backing->GetHeight() < clientSize.y)) @@ -356,7 +356,7 @@ bool wxGenericDragImage::EndDrag() if (m_windowDC) { -#if wxHAS_NATIVE_OVERLAY +#ifdef wxHAS_NATIVE_OVERLAY m_overlay.Reset(); #else m_windowDC->DestroyClippingRegion(); @@ -365,7 +365,7 @@ bool wxGenericDragImage::EndDrag() m_windowDC = (wxDC*) NULL; } -#if !wxHAS_NATIVE_OVERLAY +#ifndef wxHAS_NATIVE_OVERLAY m_repairBitmap = wxNullBitmap; #endif @@ -409,7 +409,7 @@ bool wxGenericDragImage::Show() // This is where we restore the backing bitmap, in case // something has changed on the window. -#if !wxHAS_NATIVE_OVERLAY +#ifndef wxHAS_NATIVE_OVERLAY wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap); wxMemoryDC memDC; memDC.SelectObject(* backing); @@ -460,7 +460,7 @@ bool wxGenericDragImage::RedrawImage(const wxPoint& oldPos, const wxPoint& newPo if (!m_windowDC) return false; -#if wxHAS_NATIVE_OVERLAY +#ifdef wxHAS_NATIVE_OVERLAY wxDCOverlay dcoverlay( m_overlay, (wxWindowDC*) m_windowDC ) ; if ( eraseOld ) dcoverlay.Clear() ; diff --git a/src/mac/carbon/overlay.cpp b/src/mac/carbon/overlay.cpp index 7cb5e09e32..f1e2e046ee 100644 --- a/src/mac/carbon/overlay.cpp +++ b/src/mac/carbon/overlay.cpp @@ -32,7 +32,7 @@ #include "wx/private/overlay.h" -#if wxHAS_NATIVE_OVERLAY +#ifdef wxHAS_NATIVE_OVERLAY // ============================================================================ // implementation -- 2.47.2