Add wxGraphicsContext::CreateFromUnknownDC()

A convenience helper for writing generic code that may operate on
different kinds of DCs, all supported by wxGraphicsContext, but without
knowing its specific type.
This commit is contained in:
Václav Slavík
2016-11-21 13:38:34 +01:00
committed by Václav Slavík
parent 6615c06d31
commit 7833c65c2a
3 changed files with 52 additions and 0 deletions

View File

@@ -70,6 +70,7 @@ enum wxCompositionMode
wxCOMPOSITION_ADD /* R = S + D */
};
class WXDLLIMPEXP_FWD_CORE wxDC;
class WXDLLIMPEXP_FWD_CORE wxWindowDC;
class WXDLLIMPEXP_FWD_CORE wxMemoryDC;
#if wxUSE_PRINTING_ARCHITECTURE
@@ -437,6 +438,11 @@ public:
#endif
#endif
#ifndef wxNO_RTTI
// Create a context from a DC of unknown type, if supported, returns NULL otherwise
static wxGraphicsContext* CreateFromUnknownDC(const wxDC& dc);
#endif
static wxGraphicsContext* CreateFromNative( void * context );
static wxGraphicsContext* CreateFromNativeWindow( void * window );