diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 1efb9d9de0..8a21bce9ab 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -44,7 +44,11 @@ #include "wx/stc/stc.h" #include "wx/stc/private.h" -#if wxUSE_GRAPHICS_DIRECT2D +#if defined(__WXMSW__) && wxUSE_GRAPHICS_DIRECT2D +#define HAVE_DIRECTWRITE_TECHNOLOGY +#endif + +#ifdef HAVE_DIRECTWRITE_TECHNOLOGY #include "ScintillaWX.h" #include #include "wx/dcscreen.h" @@ -165,11 +169,11 @@ void Font::Create(const FontParameters &fp) { wxFontWithAscent* newFont = new wxFontWithAscent(font); fid = newFont; -#if wxUSE_GRAPHICS_DIRECT2D +#ifdef HAVE_DIRECTWRITE_TECHNOLOGY if ( fp.technology == wxSTC_TECHNOLOGY_DIRECTWRITE ) { newFont->SetSurfaceFontData(new SurfaceFontDataD2D(fp)); } -#endif // wxUSE_GRAPHICS_DIRECT2D +#endif // HAVE_DIRECTWRITE_TECHNOLOGY } @@ -694,7 +698,7 @@ void SurfaceImpl::SetDBCSMode(int WXUNUSED(codePage)) { // dbcsMode = codePage == SC_CP_DBCS; } -#if wxUSE_GRAPHICS_DIRECT2D +#ifdef HAVE_DIRECTWRITE_TECHNOLOGY //---------------------------------------------------------------------- // SurfaceFontDataD2D @@ -1805,16 +1809,16 @@ void SurfaceD2D::DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, } } -#endif // wxUSE_GRAPHICS_DIRECT2D +#endif // HAVE_DIRECTWRITE_TECHNOLOGY Surface *Surface::Allocate(int technology) { wxUnusedVar(technology); -#if wxUSE_GRAPHICS_DIRECT2D +#ifdef HAVE_DIRECTWRITE_TECHNOLOGY if ( technology == wxSTC_TECHNOLOGY_DIRECTWRITE ) { return new SurfaceD2D; } -#endif // wxUSE_GRAPHICS_DIRECT2D +#endif // HAVE_DIRECTWRITE_TECHNOLOGY return new SurfaceImpl; } diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index ad5f506c35..dc65fcedf9 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -825,7 +825,7 @@ sptr_t ScintillaWX::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) } #endif -#if wxUSE_GRAPHICS_DIRECT2D +#if defined(__WXMSW__) && wxUSE_GRAPHICS_DIRECT2D case SCI_SETTECHNOLOGY: if ((wParam == SC_TECHNOLOGY_DEFAULT) || (wParam == SC_TECHNOLOGY_DIRECTWRITE)) { if (technology != static_cast(wParam)) {