X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bf02a7f9761ce9c0a1279ae958a0e5d53f603e15..43c5b6e808f083617eb42cb48e77366844f8fb5c:/src/generic/graphicc.cpp diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index 12f147147d..e2e63d632f 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -17,11 +17,11 @@ #if wxUSE_GRAPHICS_CONTEXT +#include "wx/graphics.h" + #ifndef WX_PRECOMP #include "wx/bitmap.h" #include "wx/icon.h" - - #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/dcmemory.h" #include "wx/dcprint.h" @@ -29,37 +29,10 @@ #include "wx/private/graphics.h" #include "wx/rawbmp.h" +#include "wx/vector.h" using namespace std; -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -const double RAD2DEG = 180.0 / M_PI; - -//----------------------------------------------------------------------------- -// Local functions -//----------------------------------------------------------------------------- - -static inline double dmin(double a, double b) -{ - return a < b ? a : b; -} -static inline double dmax(double a, double b) -{ - return a > b ? a : b; -} - -static inline double DegToRad(double deg) -{ - return (deg * M_PI) / 180.0; -} -static inline double RadToDeg(double deg) -{ - return (deg * 180.0) / M_PI; -} - //----------------------------------------------------------------------------- // device context implementation // @@ -255,6 +228,8 @@ private : double *m_userLengths; wxPen m_pen; + + wxDECLARE_NO_COPY_CLASS(wxCairoPenData); }; class WXDLLIMPEXP_CORE wxCairoBrushData : public wxGraphicsObjectRefData @@ -380,11 +355,12 @@ public: wxDouble *descent, wxDouble *externalLeading ) const; virtual void GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const; +protected: + virtual void DoDrawText( const wxString &str, wxDouble x, wxDouble y ); + private: void Init(cairo_t *context); - virtual void DoDrawText( const wxString &str, wxDouble x, wxDouble y ); - cairo_t* m_context; wxVector m_layerOpacities; @@ -716,7 +692,7 @@ wxCairoFontData::wxCairoFontData( wxGraphicsRenderer* renderer, const wxFont &fo m_underlined = font.GetUnderlined(); #ifdef __WXMAC__ - m_font = cairo_atsui_font_face_create_for_atsu_font_id( font.MacGetATSUFontID() ); + m_font = cairo_quartz_font_face_create_for_cgfont( font.OSXGetCGFont() ); #elif defined(__WXGTK__) m_font = pango_font_description_copy( font.GetNativeFontInfo()->description ); #else @@ -1576,7 +1552,7 @@ bool wxCairoContext::SetCompositionMode(wxCompositionMode op) cairo_operator_t cop; switch (op) { - case wxCOMPOSITION__CLEAR: + case wxCOMPOSITION_CLEAR: cop = CAIRO_OPERATOR_CLEAR; break; case wxCOMPOSITION_SOURCE: @@ -1796,7 +1772,7 @@ wxGraphicsMatrix wxCairoRenderer::CreateMatrix( wxDouble a, wxDouble b, wxDouble wxGraphicsPen wxCairoRenderer::CreatePen(const wxPen& pen) { - if ( !pen.Ok() || pen.GetStyle() == wxTRANSPARENT ) + if ( !pen.Ok() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) return wxNullGraphicsPen; else { @@ -1808,7 +1784,7 @@ wxGraphicsPen wxCairoRenderer::CreatePen(const wxPen& pen) wxGraphicsBrush wxCairoRenderer::CreateBrush(const wxBrush& brush ) { - if ( !brush.Ok() || brush.GetStyle() == wxTRANSPARENT ) + if ( !brush.Ok() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT ) return wxNullGraphicsBrush; else {