From d38d8f4f9c204ffcd5b025e37f026ecdf0ad0d6c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 Oct 2019 01:44:29 +0200 Subject: [PATCH] Remove Carbon-specific code from wxScreenDC implementation Carbon is not supported any more and defining m_overlayWindow, which was only used by Carbon code, resulted in "unused private variable" warning from clang. --- include/wx/osx/dcscreen.h | 2 -- src/osx/carbon/dcscreen.cpp | 20 -------------------- 2 files changed, 22 deletions(-) diff --git a/include/wx/osx/dcscreen.h b/include/wx/osx/dcscreen.h index 77d7832f70..1ebcc5e75d 100644 --- a/include/wx/osx/dcscreen.h +++ b/include/wx/osx/dcscreen.h @@ -21,8 +21,6 @@ public: virtual ~wxScreenDCImpl(); virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const wxOVERRIDE; -private: - void* m_overlayWindow; private: wxDECLARE_CLASS(wxScreenDCImpl); diff --git a/src/osx/carbon/dcscreen.cpp b/src/osx/carbon/dcscreen.cpp index df7b09db24..3db95c5a51 100644 --- a/src/osx/carbon/dcscreen.cpp +++ b/src/osx/carbon/dcscreen.cpp @@ -26,37 +26,17 @@ wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl); wxScreenDCImpl::wxScreenDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) { -#if wxOSX_USE_COCOA_OR_CARBON CGRect cgbounds ; cgbounds = CGDisplayBounds(CGMainDisplayID()); m_width = (wxCoord)cgbounds.size.width; m_height = (wxCoord)cgbounds.size.height; -#else - wxDisplaySize( &m_width, &m_height ); -#endif -#if wxOSX_USE_COCOA_OR_IPHONE SetGraphicsContext( wxGraphicsContext::Create() ); -#else - Rect bounds; - bounds.top = (short)cgbounds.origin.y; - bounds.left = (short)cgbounds.origin.x; - bounds.bottom = bounds.top + (short)cgbounds.size.height; - bounds.right = bounds.left + (short)cgbounds.size.width; - WindowAttributes overlayAttributes = kWindowIgnoreClicksAttribute; - CreateNewWindow( kOverlayWindowClass, overlayAttributes, &bounds, (WindowRef*) &m_overlayWindow ); - ShowWindow((WindowRef)m_overlayWindow); - SetGraphicsContext( wxGraphicsContext::CreateFromNativeWindow( m_overlayWindow ) ); -#endif m_ok = true ; } wxScreenDCImpl::~wxScreenDCImpl() { wxDELETE(m_graphicContext); -#if wxOSX_USE_COCOA_OR_IPHONE -#else - DisposeWindow((WindowRef) m_overlayWindow ); -#endif } #if wxOSX_USE_IPHONE