using common GetContentScaleFactor throughout part 2/2

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2013-06-19 20:29:56 +00:00
parent f082dcd598
commit 1829d71c40
5 changed files with 13 additions and 24 deletions

View File

@@ -1035,16 +1035,6 @@ void wxNonOwnedWindowCocoaImpl::WindowToScreen( int *x, int *y )
*y = p.y;
}
double wxNonOwnedWindowCocoaImpl::GetMagnificationFactor() const
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if ( [ m_macWindow respondsToSelector:@selector(backingScaleFactor) ] )
return [m_macWindow backingScaleFactor];
else
#endif
return 1.0;
}
bool wxNonOwnedWindowCocoaImpl::IsActive()
{
return [m_macWindow isKeyWindow];

View File

@@ -1703,6 +1703,17 @@ void wxWidgetCocoaImpl::SetVisibility( bool visible )
[m_osxView setHidden:(visible ? NO:YES)];
}
double wxWidgetCocoaImpl::GetContentScaleFactor() const
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSWindow* tlw = [m_osxView window];
if ( [ tlw respondsToSelector:@selector(backingScaleFactor) ] )
return [tlw backingScaleFactor];
else
#endif
return 1.0;
}
// ----------------------------------------------------------------------------
// window animation stuff
// ----------------------------------------------------------------------------

View File

@@ -609,7 +609,7 @@ void wxWidgetIPhoneImpl::SetControlSize( wxWindowVariant variant )
{
}
float wxWidgetIPhoneImpl::GetContentScaleFactor() const
double wxWidgetIPhoneImpl::GetContentScaleFactor() const
{
if ( [m_osxView respondsToSelector:@selector(contentScaleFactor) ])
return [m_osxView contentScaleFactor];

View File

@@ -478,11 +478,6 @@ void wxNonOwnedWindow::DoGetClientSize( int *width, int *height ) const
*height = h ;
}
double wxNonOwnedWindow::GetMagnificationFactor() const
{
return m_nowpeer->GetMagnificationFactor();
}
void wxNonOwnedWindow::WindowWasPainted()
{
s_lastFlush = clock();

View File

@@ -877,13 +877,6 @@ void wxWindowMac::DoGetClientSize( int *x, int *y ) const
*y = hh;
}
double wxWindowMac::GetMagnificationFactor() const
{
wxNonOwnedWindow* tlw = MacGetTopLevelWindow() ;
wxCHECK_MSG( tlw , 1.0, wxT("TopLevel Window missing") ) ;
return tlw->GetMagnificationFactor();
}
bool wxWindowMac::SetCursor(const wxCursor& cursor)
{
if (m_cursor.IsSameAs(cursor))
@@ -1226,7 +1219,7 @@ void wxWindowMac::DoSetClientSize(int clientwidth, int clientheight)
}
}
float wxWindowMac::GetContentScaleFactor() const
double wxWindowMac::GetContentScaleFactor() const
{
return GetPeer()->GetContentScaleFactor();
}