wxCairoContext doesn't need to know about wxPizza
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49819 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -11,12 +11,14 @@
|
|||||||
|
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#include "wx/dc.h"
|
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_GRAPHICS_CONTEXT
|
||||||
|
|
||||||
|
#include "wx/dc.h"
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/image.h"
|
#include "wx/image.h"
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
@@ -32,15 +34,9 @@
|
|||||||
#include "wx/module.h"
|
#include "wx/module.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
|
||||||
#include <gtk/gtk.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/graphics.h"
|
#include "wx/graphics.h"
|
||||||
#include "wx/rawbmp.h"
|
#include "wx/rawbmp.h"
|
||||||
|
|
||||||
#if wxUSE_GRAPHICS_CONTEXT
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -101,7 +97,6 @@ static inline double RadToDeg(double deg)
|
|||||||
|
|
||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
#include "wx/gtk/win_gtk.h"
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include "wx/fontutil.h"
|
#include "wx/fontutil.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -1072,22 +1067,17 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, wxWindow *window)
|
|||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
// something along these lines (copied from dcclient)
|
// something along these lines (copied from dcclient)
|
||||||
|
|
||||||
GtkWidget *widget = window->m_wxwindow;
|
|
||||||
|
|
||||||
// Some controls don't have m_wxwindow - like wxStaticBox, but the user
|
// Some controls don't have m_wxwindow - like wxStaticBox, but the user
|
||||||
// code should still be able to create wxClientDCs for them, so we will
|
// code should still be able to create wxClientDCs for them, so we will
|
||||||
// use the parent window here then.
|
// use the parent window here then.
|
||||||
if ( !widget )
|
if (window->m_wxwindow == NULL)
|
||||||
{
|
{
|
||||||
window = window->GetParent();
|
window = window->GetParent();
|
||||||
widget = window->m_wxwindow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxASSERT_MSG( widget, wxT("wxCairoContext needs a widget") );
|
wxASSERT_MSG( window->m_wxwindow, wxT("wxCairoContext needs a widget") );
|
||||||
|
|
||||||
wxPizza *pizza = WX_PIZZA( widget );
|
Init(gdk_cairo_create(window->GTKGetDrawingWindow()));
|
||||||
GdkDrawable* drawable = pizza->m_backing_window;
|
|
||||||
Init( gdk_cairo_create( drawable ) ) ;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1117,7 +1107,7 @@ void wxCairoContext::Clip( const wxRegion& region )
|
|||||||
while (ri)
|
while (ri)
|
||||||
{
|
{
|
||||||
path.AddRectangle(ri.GetX(), ri.GetY(), ri.GetW(), ri.GetH());
|
path.AddRectangle(ri.GetX(), ri.GetY(), ri.GetW(), ri.GetH());
|
||||||
ri++;
|
++ri;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put it in the context
|
// Put it in the context
|
||||||
|
Reference in New Issue
Block a user