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
This commit is contained in:
Václav Slavík
2006-10-25 12:12:56 +00:00
parent 4876ba0b23
commit 69a5bc231a
9 changed files with 25 additions and 33 deletions

View File

@@ -199,17 +199,13 @@ private:
#include "wx/generic/caret.h" #include "wx/generic/caret.h"
#endif // platform #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 // 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 // restores it in the dtor, this should be used when drawing on the screen to
// avoid overdrawing the caret // 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 // we don't need to hide the caret if it's rendered using overlays
class WXDLLEXPORT wxCaretSuspend class WXDLLEXPORT wxCaretSuspend

View File

@@ -16,10 +16,8 @@
#include "wx/dc.h" #include "wx/dc.h"
#include "wx/overlay.h" #include "wx/overlay.h"
#if wxHAS_NATIVE_OVERLAY #ifdef wxHAS_NATIVE_OVERLAY
#define wxHAS_CARET_USING_OVERLAYS 1 #define wxHAS_CARET_USING_OVERLAYS
#else
#define wxHAS_CARET_USING_OVERLAYS 0
#endif #endif
class WXDLLIMPEXP_CORE wxCaret; class WXDLLIMPEXP_CORE wxCaret;
@@ -78,7 +76,7 @@ private:
// GTK specific initialization // GTK specific initialization
void InitGeneric(); void InitGeneric();
#if wxHAS_CARET_USING_OVERLAYS #ifdef wxHAS_CARET_USING_OVERLAYS
// the overlay for displaying the caret // the overlay for displaying the caret
wxOverlay m_overlay; wxOverlay m_overlay;
#else #else

View File

@@ -160,7 +160,7 @@ public:
// For efficiency, tell wxGenericDragImage to use a bitmap that's already // For efficiency, tell wxGenericDragImage to use a bitmap that's already
// created (e.g. from last drag) // created (e.g. from last drag)
void SetBackingBitmap(wxBitmap* bitmap) { void SetBackingBitmap(wxBitmap* bitmap) {
#if !wxHAS_NATIVE_OVERLAY #ifndef wxHAS_NATIVE_OVERLAY
m_pBackingBitmap = bitmap; m_pBackingBitmap = bitmap;
#endif #endif
} }
@@ -247,7 +247,7 @@ protected:
wxWindow* m_window; wxWindow* m_window;
wxDC* m_windowDC; wxDC* m_windowDC;
#if wxHAS_NATIVE_OVERLAY #ifdef wxHAS_NATIVE_OVERLAY
wxOverlay m_overlay; wxOverlay m_overlay;
wxDCOverlay* m_dcOverlay; wxDCOverlay* m_dcOverlay;
#else #else

View File

@@ -14,14 +14,12 @@
#include "wx/defs.h" #include "wx/defs.h"
#ifndef wxHAS_NATIVE_OVERLAY #if defined(wxMAC_USE_CORE_GRAPHICS) && wxMAC_USE_CORE_GRAPHICS
#if defined(wxMAC_USE_CORE_GRAPHICS) && wxMAC_USE_CORE_GRAPHICS
#define wxHAS_NATIVE_OVERLAY 1 #define wxHAS_NATIVE_OVERLAY 1
#elif defined(__WXDFB__) #elif defined(__WXDFB__)
#define wxHAS_NATIVE_OVERLAY 1 #define wxHAS_NATIVE_OVERLAY 1
#else #else
#define wxHAS_NATIVE_OVERLAY 0 // don't define wxHAS_NATIVE_OVERLAY
#endif
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -14,7 +14,7 @@
#include "wx/overlay.h" #include "wx/overlay.h"
#if wxHAS_NATIVE_OVERLAY #ifdef wxHAS_NATIVE_OVERLAY
#if defined(__WXMAC__) #if defined(__WXMAC__)
#include "wx/mac/carbon/private/overlay.h" #include "wx/mac/carbon/private/overlay.h"

View File

@@ -125,7 +125,7 @@ void wxDCOverlay::Clear()
// generic implementation of wxOverlayImpl // generic implementation of wxOverlayImpl
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if !wxHAS_NATIVE_OVERLAY #ifndef wxHAS_NATIVE_OVERLAY
wxOverlayImpl::wxOverlayImpl() wxOverlayImpl::wxOverlayImpl()
{ {

View File

@@ -88,7 +88,7 @@ void wxCaret::InitGeneric()
{ {
m_hasFocus = true; m_hasFocus = true;
m_blinkedOut = true; m_blinkedOut = true;
#if !wxHAS_CARET_USING_OVERLAYS #ifndef wxHAS_CARET_USING_OVERLAYS
m_xOld = m_xOld =
m_yOld = -1; m_yOld = -1;
m_bmpUnderCaret.Create(m_width, m_height); m_bmpUnderCaret.Create(m_width, m_height);
@@ -131,7 +131,7 @@ void wxCaret::DoHide()
void wxCaret::DoMove() void wxCaret::DoMove()
{ {
#if wxHAS_CARET_USING_OVERLAYS #ifdef wxHAS_CARET_USING_OVERLAYS
m_overlay.Reset(); m_overlay.Reset();
#endif #endif
if ( IsVisible() ) if ( IsVisible() )
@@ -158,7 +158,7 @@ void wxCaret::DoSize()
m_countVisible = 0; m_countVisible = 0;
DoHide(); DoHide();
} }
#if wxHAS_CARET_USING_OVERLAYS #ifdef wxHAS_CARET_USING_OVERLAYS
m_overlay.Reset(); m_overlay.Reset();
#else #else
// Change bitmap size // Change bitmap size
@@ -217,7 +217,7 @@ void wxCaret::Refresh()
{ {
wxClientDC dcWin(GetWindow()); wxClientDC dcWin(GetWindow());
// this is the new code, switch to 0 if this gives problems // 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 ); wxDCOverlay dcOverlay( m_overlay, &dcWin, m_x, m_y, m_width , m_height );
if ( m_blinkedOut ) if ( m_blinkedOut )
{ {

View File

@@ -72,7 +72,7 @@ void wxGenericDragImage::Init()
m_windowDC = (wxDC*) NULL; m_windowDC = (wxDC*) NULL;
m_window = (wxWindow*) NULL; m_window = (wxWindow*) NULL;
m_fullScreen = false; m_fullScreen = false;
#if wxHAS_NATIVE_OVERLAY #ifdef wxHAS_NATIVE_OVERLAY
m_dcOverlay = NULL; m_dcOverlay = NULL;
#else #else
m_pBackingBitmap = (wxBitmap*) NULL; 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); wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
if (!backing->Ok() || (backing->GetWidth() < clientSize.x || backing->GetHeight() < clientSize.y)) if (!backing->Ok() || (backing->GetWidth() < clientSize.x || backing->GetHeight() < clientSize.y))
@@ -356,7 +356,7 @@ bool wxGenericDragImage::EndDrag()
if (m_windowDC) if (m_windowDC)
{ {
#if wxHAS_NATIVE_OVERLAY #ifdef wxHAS_NATIVE_OVERLAY
m_overlay.Reset(); m_overlay.Reset();
#else #else
m_windowDC->DestroyClippingRegion(); m_windowDC->DestroyClippingRegion();
@@ -365,7 +365,7 @@ bool wxGenericDragImage::EndDrag()
m_windowDC = (wxDC*) NULL; m_windowDC = (wxDC*) NULL;
} }
#if !wxHAS_NATIVE_OVERLAY #ifndef wxHAS_NATIVE_OVERLAY
m_repairBitmap = wxNullBitmap; m_repairBitmap = wxNullBitmap;
#endif #endif
@@ -409,7 +409,7 @@ bool wxGenericDragImage::Show()
// This is where we restore the backing bitmap, in case // This is where we restore the backing bitmap, in case
// something has changed on the window. // something has changed on the window.
#if !wxHAS_NATIVE_OVERLAY #ifndef wxHAS_NATIVE_OVERLAY
wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap); wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
wxMemoryDC memDC; wxMemoryDC memDC;
memDC.SelectObject(* backing); memDC.SelectObject(* backing);
@@ -460,7 +460,7 @@ bool wxGenericDragImage::RedrawImage(const wxPoint& oldPos, const wxPoint& newPo
if (!m_windowDC) if (!m_windowDC)
return false; return false;
#if wxHAS_NATIVE_OVERLAY #ifdef wxHAS_NATIVE_OVERLAY
wxDCOverlay dcoverlay( m_overlay, (wxWindowDC*) m_windowDC ) ; wxDCOverlay dcoverlay( m_overlay, (wxWindowDC*) m_windowDC ) ;
if ( eraseOld ) if ( eraseOld )
dcoverlay.Clear() ; dcoverlay.Clear() ;

View File

@@ -32,7 +32,7 @@
#include "wx/private/overlay.h" #include "wx/private/overlay.h"
#if wxHAS_NATIVE_OVERLAY #ifdef wxHAS_NATIVE_OVERLAY
// ============================================================================ // ============================================================================
// implementation // implementation