Add support for using Direct2D in wxStyledTextCtrl

Use D2D if available, notably for better ligatures support.

See https://github.com/wxWidgets/wxWidgets/pull/689

Closes #17804.
This commit is contained in:
VZ
2018-01-26 15:09:35 +01:00
committed by GitHub
12 changed files with 1454 additions and 16 deletions

View File

@@ -0,0 +1,28 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/graphicsd2d.h
// Purpose: Allow functions from graphicsd2d.cpp to be used in othe files
// Author: New Pagodi
// Created: 2017-10-31
// Copyright: (c) 2017 wxWidgets development team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef WX_MSW_PRIVATE_GRAPHICSD2D_H_
#define WX_MSW_PRIVATE_GRAPHICSD2D_H_
#if wxUSE_GRAPHICS_DIRECT2D
// Ensure no previous defines interfere with the Direct2D API headers
#undef GetHwnd
#include <d2d1.h>
#include <dwrite.h>
#include <wincodec.h>
WXDLLIMPEXP_CORE IWICImagingFactory* wxWICImagingFactory();
WXDLLIMPEXP_CORE ID2D1Factory* wxD2D1Factory();
WXDLLIMPEXP_CORE IDWriteFactory* wxDWriteFactory();
#endif // wxUSE_GRAPHICS_DIRECT2D
#endif // WX_MSW_PRIVATE_GRAPHICSD2D_H_

View File

@@ -3963,6 +3963,12 @@ public:
// to overlap from one line to the next.
void SetPhasesDraw(int phases);
// Choose the quality level for text.
void SetFontQuality(int fontQuality);
// Retrieve the quality level for text.
int GetFontQuality() const;
// Scroll so that a display line is at the top of the display.
void SetFirstVisibleLine(int displayLine);