Fix wxX11 build with --disable-graphics_ctx build option.
Add missing #if wxUSE_CAIRO checks. Closes https://github.com/wxWidgets/wxWidgets/pull/1472
This commit is contained in:
@@ -107,8 +107,9 @@ public:
|
|||||||
WXWindow GetX11Window() const { return m_x11window; }
|
WXWindow GetX11Window() const { return m_x11window; }
|
||||||
|
|
||||||
virtual void ComputeScaleAndOrigin();
|
virtual void ComputeScaleAndOrigin();
|
||||||
|
#if wxUSE_CAIRO
|
||||||
virtual void* GetCairoContext() const wxOVERRIDE;
|
virtual void* GetCairoContext() const wxOVERRIDE;
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// implementation
|
// implementation
|
||||||
|
@@ -28,7 +28,9 @@
|
|||||||
#include "wx/x11/dcclient.h"
|
#include "wx/x11/dcclient.h"
|
||||||
#include "wx/x11/dcmemory.h"
|
#include "wx/x11/dcmemory.h"
|
||||||
|
|
||||||
|
#if wxUSE_CAIRO
|
||||||
#include "cairo-xlib.h"
|
#include "cairo-xlib.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
#include "glib.h"
|
#include "glib.h"
|
||||||
@@ -345,6 +347,7 @@ void wxWindowDCImpl::SetUpDC()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_CAIRO
|
||||||
void* wxWindowDCImpl::GetCairoContext() const
|
void* wxWindowDCImpl::GetCairoContext() const
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
@@ -355,6 +358,7 @@ void* wxWindowDCImpl::GetCairoContext() const
|
|||||||
cairo_t *cr = cairo_create(surface);
|
cairo_t *cr = cairo_create(surface);
|
||||||
return cr;
|
return cr;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void wxWindowDCImpl::DoGetSize( int* width, int* height ) const
|
void wxWindowDCImpl::DoGetSize( int* width, int* height ) const
|
||||||
{
|
{
|
||||||
@@ -1664,6 +1668,7 @@ void wxWindowDCImpl::DoDrawRotatedText(const wxString& text,
|
|||||||
wxCoord x, wxCoord y,
|
wxCoord x, wxCoord y,
|
||||||
double angle)
|
double angle)
|
||||||
{
|
{
|
||||||
|
#if wxUSE_CAIRO
|
||||||
// use cairo to draw rotated text
|
// use cairo to draw rotated text
|
||||||
cairo_surface_t *surface = cairo_xlib_surface_create((Display*) m_display,
|
cairo_surface_t *surface = cairo_xlib_surface_create((Display*) m_display,
|
||||||
(Drawable) m_x11window,
|
(Drawable) m_x11window,
|
||||||
@@ -1682,6 +1687,9 @@ void wxWindowDCImpl::DoDrawRotatedText(const wxString& text,
|
|||||||
cairo_show_text(cr, text.utf8_str());
|
cairo_show_text(cr, text.utf8_str());
|
||||||
cairo_restore(cr);
|
cairo_restore(cr);
|
||||||
cairo_destroy(cr);
|
cairo_destroy(cr);
|
||||||
|
#else
|
||||||
|
#warning "Drawing rotated text is not implemented without Cairo"
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDCImpl::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
|
void wxWindowDCImpl::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
|
||||||
|
Reference in New Issue
Block a user