class WXDLLIMPEXP_FWD_CORE wxPrinterDC;
class WXDLLIMPEXP_FWD_CORE wxPrintData;
+
+#if wxUSE_GRAPHICS_CONTEXT
+class WXDLLIMPEXP_FWD_CORE wxGraphicsContext;
+#endif
+
//-----------------------------------------------------------------------------
// wxDrawObject helper class
//-----------------------------------------------------------------------------
virtual bool CanDrawBitmap() const = 0;
virtual bool CanGetTextExtent() const = 0;
+ // get graphics context from
+
+#if wxUSE_GRAPHICS_CONTEXT
+ virtual wxGraphicsContext* CreateGraphicsContext()
+ {
+ return NULL;
+ }
+#endif
+
// query dimension, colour deps, resolution
virtual void DoGetSize(int *width, int *height) const = 0;
bool IsOk() const
{ return m_pimpl && m_pimpl->IsOk(); }
+#if wxUSE_GRAPHICS_CONTEXT
+ wxGraphicsContext* CreateGraphicsContext()
+ { return m_pimpl->CreateGraphicsContext(); }
+#endif
+
// query capabilities
bool CanDrawBitmap() const
virtual ~wxWindowDCImpl();
+#if wxUSE_GRAPHICS_CONTEXT
+ virtual wxGraphicsContext* CreateGraphicsContext();
+#endif
+
virtual bool CanDrawBitmap() const { return true; }
virtual bool CanGetTextExtent() const { return true; }
virtual ~wxMemoryDCImpl();
+#if wxUSE_GRAPHICS_CONTEXT
+ virtual wxGraphicsContext* CreateGraphicsContext();
+#endif
+
// these get reimplemented for mono-bitmaps to behave
// more like their Win32 couterparts. They now interpret
// wxWHITE, wxWHITE_BRUSH and wxWHITE_PEN as drawing 0
bool Ok() const { return IsOk(); }
bool IsOk() const;
+#if wxUSE_GRAPHICS_CONTEXT
+ virtual wxGraphicsContext* CreateGraphicsContext();
+#endif
+
bool CanDrawBitmap() const { return true; }
void Clear();
void SetFont( const wxFont& font );
// Create a DC corresponding to the whole window
wxWindowDCImpl( wxDC *owner, wxWindow *win );
+#if wxUSE_GRAPHICS_CONTEXT
+ virtual wxGraphicsContext* CreateGraphicsContext();
+#endif
+
virtual void DoGetSize(int *width, int *height) const;
protected:
wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc ); // Create compatible DC
+#if wxUSE_GRAPHICS_CONTEXT
+ virtual wxGraphicsContext* CreateGraphicsContext();
+#endif
+
// override some base class virtuals
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoGetSize(int* width, int* height) const;
#include <gdk/gdkx.h>
+#if wxUSE_GRAPHICS_CONTEXT
+#include "wx/graphics.h"
+#endif
+
+
//-----------------------------------------------------------------------------
// local defines
//-----------------------------------------------------------------------------
pango_font_description_free( m_fontdesc );
}
+#if wxUSE_GRAPHICS_CONTEXT
+wxGraphicsContext* wxWindowDCImpl::CreateGraphicsContext()
+{
+ wxWindowDC *windowdc = (wxWindowDC*) GetOwner();
+ return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext( *windowdc );
+}
+#endif
+
void wxWindowDCImpl::SetUpDC( bool isMemDC )
{
m_ok = true;
#include <gdk/gdk.h>
#include <gtk/gtk.h>
+#if wxUSE_GRAPHICS_CONTEXT
+#include "wx/graphics.h"
+#endif
+
//-----------------------------------------------------------------------------
// wxMemoryDCImpl
//-----------------------------------------------------------------------------
m_fontdesc = pango_font_description_copy( pango_context_get_font_description( m_context ) );
}
+#if wxUSE_GRAPHICS_CONTEXT
+wxGraphicsContext* wxMemoryDCImpl::CreateGraphicsContext()
+{
+ wxMemoryDC *memdc = (wxMemoryDC*) GetOwner();
+ return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext( *memdc );
+}
+#endif
+
void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
{
Destroy();
#include <gtk/gtk.h>
#include <gtk/gtkpagesetupunixdialog.h>
+#if wxUSE_GRAPHICS_CONTEXT
+#include "wx/graphics.h"
+#endif
+
#include "wx/link.h"
wxFORCE_LINK_THIS_MODULE(gtk_print)
return m_gpc != NULL;
}
+#if wxUSE_GRAPHICS_CONTEXT
+wxGraphicsContext* wxGtkPrinterDCImpl::CreateGraphicsContext()
+{
+ return wxGraphicsRenderer::GetDefaultRenderer()->CreateContextFromNativeContext( (void*) m_cairo );
+}
+#endif
+
bool wxGtkPrinterDCImpl::DoFloodFill(wxCoord WXUNUSED(x1),
wxCoord WXUNUSED(y1),
const wxColour& WXUNUSED(col),
#include "wx/window.h"
#endif
+#if wxUSE_GRAPHICS_CONTEXT
+#include "wx/graphics.h"
+#endif
+
#include "wx/msw/private.h"
// ----------------------------------------------------------------------------
#endif
}
+#if wxUSE_GRAPHICS_CONTEXT
+wxGraphicsContext* wxWindowDCImpl::CreateGraphicsContext()
+{
+ wxWindowDC *windowdc = (wxWindowDC*) GetOwner();
+ return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext( *windowdc );
+}
+#endif
+
void wxWindowDCImpl::DoGetSize(int *width, int *height) const
{
wxCHECK_RET( m_window, _T("wxWindowDCImpl without a window?") );
#include "wx/log.h"
#endif
+#if wxUSE_GRAPHICS_CONTEXT
+#include "wx/graphics.h"
+#endif
+
#include "wx/msw/private.h"
// ----------------------------------------------------------------------------
}
}
+#if wxUSE_GRAPHICS_CONTEXT
+wxGraphicsContext* wxMemoryDCImpl::CreateGraphicsContext()
+{
+ wxMemoryDC *memdc = (wxMemoryDC*) GetOwner();
+ return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext( *memdc );
+}
+#endif
+
bool wxMemoryDCImpl::CreateCompatible(wxDC *dc)
{
wxDCImpl *impl = dc ? dc->GetImpl() : NULL ;