]> git.saurik.com Git - wxWidgets.git/commitdiff
supporting content size scaling (retina display)
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 22 Feb 2011 18:51:10 +0000 (18:51 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 22 Feb 2011 18:51:10 +0000 (18:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/core/private.h
include/wx/osx/iphone/private.h
include/wx/osx/window.h
src/osx/iphone/window.mm
src/osx/window_osx.cpp

index fff53bc513cce7c54f2bff54caf94ee890434adf..285561a45d208e641eb5a752152b82d19f639eee 100644 (file)
@@ -235,6 +235,10 @@ public :
     virtual void        GetPosition( int &x, int &y ) const = 0;
     virtual void        GetSize( int &width, int &height ) const = 0;
     virtual void        SetControlSize( wxWindowVariant variant ) = 0;
+    virtual float       GetContentScaleFactor() const 
+    {
+        return 1.0;
+    }
     
     // the native coordinates may have an 'aura' for shadows etc, if this is the case the layout
     // inset indicates on which insets the real control is drawn
index fca0be2880d1fe00597d87b9cfb159c67a83b13b..f08a8917a294f5103eb2a3025d80c969a605fa45 100644 (file)
@@ -56,7 +56,8 @@ public :
     virtual void        GetPosition( int &x, int &y ) const;
     virtual void        GetSize( int &width, int &height ) const;
     virtual void        SetControlSize( wxWindowVariant variant );
-
+    virtual float       GetContentScaleFactor() const ;
+    
     virtual void        SetNeedsDisplay( const wxRect* where = NULL );
     virtual bool        GetNeedsDisplay() const;
 
index c548f2171ebb30041e470bad4840a30ea259ebca..184e13591058824eae73b906343d61eb26dcd2ea 100644 (file)
@@ -266,6 +266,9 @@ public:
     virtual bool        OSXHandleKeyEvent( wxKeyEvent& event );
 
     bool                IsNativeWindowWrapper() const { return m_isNativeWindowWrapper; }
+    
+    float               GetContentScaleFactor() const ;
+    
 protected:
     // For controls like radio buttons which are genuinely composite
     wxList              m_subControls;
index 83e902bbe1370494604cd5c43edbe48d291cb680..faebee53dd8abad1a1156f0f1fb7c995f655a928 100644 (file)
@@ -392,6 +392,8 @@ void wxWidgetIPhoneImpl::Move(int x, int y, int width, int height)
     [m_osxView setFrame:r];
 }
 
+
+
 void wxWidgetIPhoneImpl::GetPosition( int &x, int &y ) const
 {
     CGRect r = [m_osxView frame];
@@ -591,6 +593,11 @@ void wxWidgetIPhoneImpl::SetControlSize( wxWindowVariant variant )
 {
 }
 
+float wxWidgetIPhoneImpl::GetContentScaleFactor() const 
+{
+    return [m_osxView contentScaleFactor];
+}
+
 void wxWidgetIPhoneImpl::SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack )
 {
 }
index ce444b9913fe61f059964f7a0099167dd1d1f853..63ea791e8c69c6ee0bd2b162e9c3a352f421212c 100644 (file)
@@ -1115,6 +1115,11 @@ void wxWindowMac::DoSetClientSize(int clientwidth, int clientheight)
     }
 }
 
+float wxWindowMac::GetContentScaleFactor() const 
+{
+    return m_peer->GetContentScaleFactor();
+}
+
 void wxWindowMac::SetLabel(const wxString& title)
 {
     if ( title == m_label )