Merge branch 'gc-from-unknown-dc'

Add wxGraphicsRenderer::CreateContextFromUnknownDC().

See https://github.com/wxWidgets/wxWidgets/pull/1213
This commit is contained in:
Vadim Zeitlin
2019-02-03 22:14:01 +01:00
3 changed files with 46 additions and 39 deletions

View File

@@ -456,6 +456,8 @@ public:
with wxDC and doesn't known its exact type. Use Create() instead if
you know that the DC is e.g. wxWindowDC.
@see wxGraphicsRenderer::CreateContextFromUnknownDC()
@since 3.1.1
*/
static wxGraphicsContext* CreateFromUnknownDC(wxDC& dc);
@@ -1341,6 +1343,24 @@ public:
*/
virtual wxGraphicsContext* CreateContext(const wxEnhMetaFileDC& metaFileDC) = 0;
/**
Creates a wxGraphicsContext from a DC of unknown specific type.
Creates a wxGraphicsContext if @a dc is a supported type (i.e. has a
corresponding CreateContext() method, e.g. wxWindowDC or wxMemoryDC).
Returns @NULL if the DC is unsupported.
This method is only useful as a helper in generic code that operates
with wxDC and doesn't known its exact type. Use the appropriate
CreateContext() overload instead if you know that the DC is e.g.
wxWindowDC.
@see wxGraphicsContext::CreateFromUnknownDC()
@since 3.1.3
*/
static wxGraphicsContext* CreateContextFromUnknownDC(wxDC& dc);
/**
Creates a wxGraphicsContext associated with a wxImage.