]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcgraph.cpp
Make wxTextEntryDialog resizable.
[wxWidgets.git] / src / common / dcgraph.cpp
index 3b49dce031cac84073b59f4d6c920eba148ad99b..2388f3ec8cd671925355acecb5ca99eb277e035b 100644 (file)
 
 #if wxUSE_GRAPHICS_CONTEXT
 
-#include "wx/graphics.h"
 #include "wx/dcgraph.h"
 
 #ifndef WX_PRECOMP
     #include "wx/icon.h"
-    #include "wx/bitmap.h"
+    #include "wx/dcclient.h"
     #include "wx/dcmemory.h"
-    #include "wx/region.h"
 #endif
 
-#include "wx/dcclient.h"
-
-#ifdef __WXOSX_OR_COCOA__
-#ifdef __WXOSX_IPHONE__
-    #include <CoreGraphics/CoreGraphics.h>
-#else
-    #include <ApplicationServices/ApplicationServices.h>
-#endif
-#endif
-
-#include <limits.h>     // for INT_MAX
-
 //-----------------------------------------------------------------------------
 // constants
 //-----------------------------------------------------------------------------
@@ -433,6 +419,16 @@ void wxGCDCImpl::ComputeScaleAndOrigin()
     }
 }
 
+void* wxGCDCImpl::GetHandle() const
+{
+    void* cgctx = NULL;
+    wxGraphicsContext* gc = GetGraphicsContext();
+    if (gc) {
+        cgctx = gc->GetNativeContext();
+    }
+    return cgctx;
+}
+
 void wxGCDCImpl::SetPalette( const wxPalette& WXUNUSED(palette) )
 {
 
@@ -1050,7 +1046,10 @@ void wxGCDCImpl::Clear(void)
     m_graphicContext->SetPen( p );
     wxCompositionMode formerMode = m_graphicContext->GetCompositionMode();
     m_graphicContext->SetCompositionMode(wxCOMPOSITION_SOURCE);
-    DoDrawRectangle( 0, 0, INT_MAX , INT_MAX );
+    // maximum positive coordinate Cairo can handle is 2^23 - 1
+    DoDrawRectangle(
+        DeviceToLogicalX(0), DeviceToLogicalY(0),
+        DeviceToLogicalXRel(0x007fffff), DeviceToLogicalYRel(0x007fffff));
     m_graphicContext->SetCompositionMode(formerMode);
     m_graphicContext->SetPen( m_pen );
     m_graphicContext->SetBrush( m_brush );