class WXDLLIMPEXP_FWD_CORE wxPrinterDC;
class WXDLLIMPEXP_FWD_CORE wxPrintData;
+#if wxUSE_GRAPHICS_CONTEXT
+class WXDLLIMPEXP_FWD_CORE wxGraphicsContext;
+#endif
+
// Logical ops
enum wxRasterOperationMode
{
return NULL;
}
+ virtual void* GetHandle() const { return NULL; }
+
// query dimension, colour deps, resolution
virtual void DoGetSize(int *width, int *height) const = 0;
// clipping
+ // Note that this pure virtual method has an implementation that updates
+ // the values returned by DoGetClippingBox() and so can be called from the
+ // derived class overridden version if it makes sense (i.e. if the clipping
+ // box coordinates are not already updated in some other way).
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
- wxCoord width, wxCoord height) = 0;
+ wxCoord w, wxCoord h) = 0;
// NB: this function works with device coordinates, not the logical ones!
virtual void DoSetDeviceClippingRegion(const wxRegion& region) = 0;
}
virtual void SetLogicalScale(double x, double y);
- virtual void GetLogicalScale(double *x, double *y)
+ virtual void GetLogicalScale(double *x, double *y) const
{
if ( x ) *x = m_logicalScaleX;
if ( y ) *y = m_logicalScaleY;
virtual int GetResolution() const
{ return -1; }
+#if wxUSE_GRAPHICS_CONTEXT
+ virtual wxGraphicsContext* GetGraphicsContext() const
+ { return NULL; }
+ virtual void SetGraphicsContext( wxGraphicsContext* WXUNUSED(ctx) )
+ {}
+#endif
+
private:
wxDC *m_owner;
wxWindow *GetWindow() const
{ return m_pimpl->GetWindow(); }
+ void *GetHandle() const
+ { return m_pimpl->GetHandle(); }
+
bool IsOk() const
{ return m_pimpl && m_pimpl->IsOk(); }
void SetLogicalScale(double x, double y)
{ m_pimpl->SetLogicalScale( x, y ); }
- void GetLogicalScale(double *x, double *y)
+ void GetLogicalScale(double *x, double *y) const
{ m_pimpl->GetLogicalScale( x, y ); }
void SetLogicalOrigin(wxCoord x, wxCoord y)
TempHDC GetTempHDC() { return TempHDC(*this); }
#endif // __WXMSW__
+#if wxUSE_GRAPHICS_CONTEXT
+ virtual wxGraphicsContext* GetGraphicsContext() const
+ {
+ return m_pimpl->GetGraphicsContext();
+ }
+ virtual void SetGraphicsContext( wxGraphicsContext* ctx )
+ {
+ m_pimpl->SetGraphicsContext(ctx);
+ }
+#endif
+
protected:
// ctor takes ownership of the pointer
wxDC(wxDCImpl *pimpl) : m_pimpl(pimpl) { }