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:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
// don't define wxHAS_NATIVE_OVERLAY
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -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"
|
||||
|
@@ -125,7 +125,7 @@ void wxDCOverlay::Clear()
|
||||
// generic implementation of wxOverlayImpl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if !wxHAS_NATIVE_OVERLAY
|
||||
#ifndef wxHAS_NATIVE_OVERLAY
|
||||
|
||||
wxOverlayImpl::wxOverlayImpl()
|
||||
{
|
||||
|
@@ -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 )
|
||||
{
|
||||
|
@@ -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() ;
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "wx/private/overlay.h"
|
||||
|
||||
#if wxHAS_NATIVE_OVERLAY
|
||||
#ifdef wxHAS_NATIVE_OVERLAY
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
|
Reference in New Issue
Block a user