* Implement dynamic loading of the Cairo DLL on Windows similar to how it was

done for GDI+.

* Enable the use of the wxCairoContext on MSW.

* Enable creating a wxGCDC from an exisiting wxGraphicsContext.

* Since it's possible for a DLL that is using wx to not be on the PATH nor in
  the same location as the .exe, change the wxDynamicLibrary::RawLoad method to
  explicitly look first in the same place as the main wx-using binary.  This way
  it will find DLLs that are in the same folder as the wx-using binary even if
  that would not be in the normal DLL search path.  

* Change wxDCImpl and wxDC::GetLogicalScale to be const methods.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-08-27 23:26:53 +00:00
parent d54f0605a9
commit 932d0768aa
9 changed files with 477 additions and 195 deletions

View File

@@ -2127,6 +2127,14 @@ WXHDC wxGCDC::AcquireHDC()
if ( !gc )
return NULL;
#if wxUSE_CAIRO
// we can't get the HDC if it is not a GDI+ context
wxGraphicsRenderer* r1 = gc->GetRenderer();
wxGraphicsRenderer* r2 = wxGraphicsRenderer::GetCairoRenderer();
if (r1 == r2)
return NULL;
#endif
Graphics * const g = static_cast<Graphics *>(gc->GetNativeContext());
return g ? g->GetHDC() : NULL;
}
@@ -2139,6 +2147,14 @@ void wxGCDC::ReleaseHDC(WXHDC hdc)
wxGraphicsContext * const gc = GetGraphicsContext();
wxCHECK_RET( gc, "can't release HDC because there is no wxGraphicsContext" );
#if wxUSE_CAIRO
// we can't get the HDC if it is not a GDI+ context
wxGraphicsRenderer* r1 = gc->GetRenderer();
wxGraphicsRenderer* r2 = wxGraphicsRenderer::GetCairoRenderer();
if (r1 == r2)
return;
#endif
Graphics * const g = static_cast<Graphics *>(gc->GetNativeContext());
wxCHECK_RET( g, "can't release HDC because there is no Graphics" );