2018-03-11 20:17:39 -05:00
|
|
|
// 11 march 2018
|
|
|
|
#include "../common/attrstr.h"
|
|
|
|
|
2018-03-17 13:44:38 -05:00
|
|
|
// dwrite.cpp
|
|
|
|
extern IDWriteFactory *dwfactory;
|
|
|
|
extern HRESULT uiprivInitDrawText(void);
|
|
|
|
extern void uiprivUninitDrawText(void);
|
|
|
|
struct fontCollection {
|
|
|
|
IDWriteFontCollection *fonts;
|
|
|
|
WCHAR userLocale[LOCALE_NAME_MAX_LENGTH];
|
|
|
|
int userLocaleSuccess;
|
|
|
|
};
|
|
|
|
extern fontCollection *uiprivLoadFontCollection(void);
|
|
|
|
extern WCHAR *uiprivFontCollectionFamilyName(fontCollection *fc, IDWriteFontFamily *family);
|
|
|
|
extern void uiprivFontCollectionFree(fontCollection *fc);
|
|
|
|
extern WCHAR *uiprivFontCollectionCorrectString(fontCollection *fc, IDWriteLocalizedStrings *names);
|
|
|
|
|
2018-03-11 20:17:39 -05:00
|
|
|
// opentype.cpp
|
|
|
|
extern IDWriteTypography *uiprivOpenTypeFeaturesToIDWriteTypography(const uiOpenTypeFeatures *otf);
|
2018-03-11 21:11:19 -05:00
|
|
|
|
|
|
|
// fontmatch.cpp
|
|
|
|
extern DWRITE_FONT_WEIGHT uiprivWeightToDWriteWeight(uiTextWeight w);
|
|
|
|
extern DWRITE_FONT_STYLE uiprivItalicToDWriteStyle(uiTextItalic i);
|
|
|
|
extern DWRITE_FONT_STRETCH uiprivStretchToDWriteStretch(uiTextStretch s);
|
2018-03-11 21:36:31 -05:00
|
|
|
extern void uiprivFontDescriptorFromIDWriteFont(IDWriteFont *font, uiFontDescriptor *uidesc);
|
2018-03-13 21:01:15 -05:00
|
|
|
|
|
|
|
// attrstr.cpp
|
2018-03-14 20:08:19 -05:00
|
|
|
// TODO
|
|
|
|
struct drawTextBackgroundParams;
|
|
|
|
extern void uiprivAttributedStringApplyAttributesToDWriteTextLayout(uiDrawTextLayoutParams *p, IDWriteTextLayout *layout, std::vector<struct drawTextBackgroundParams *> **backgroundFuncs);
|
2018-03-13 21:01:15 -05:00
|
|
|
|
|
|
|
// drawtext.cpp
|
|
|
|
class drawingEffectsAttr : public IUnknown {
|
|
|
|
ULONG refcount;
|
|
|
|
|
|
|
|
bool hasColor;
|
|
|
|
double r;
|
|
|
|
double g;
|
|
|
|
double b;
|
|
|
|
double a;
|
|
|
|
|
|
|
|
bool hasUnderline;
|
|
|
|
uiUnderline u;
|
|
|
|
|
|
|
|
bool hasUnderlineColor;
|
|
|
|
double ur;
|
|
|
|
double ug;
|
|
|
|
double ub;
|
|
|
|
double ua;
|
|
|
|
public:
|
2018-03-13 21:56:30 -05:00
|
|
|
drawingEffectsAttr(void);
|
2018-03-13 21:01:15 -05:00
|
|
|
|
|
|
|
// IUnknown
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject);
|
|
|
|
virtual ULONG STDMETHODCALLTYPE AddRef(void);
|
|
|
|
virtual ULONG STDMETHODCALLTYPE Release(void);
|
|
|
|
|
|
|
|
void setColor(double r, double g, double b, double a);
|
|
|
|
void setUnderline(uiUnderline u);
|
|
|
|
void setUnderlineColor(double r, double g, double b, double a);
|
2018-03-13 21:56:30 -05:00
|
|
|
HRESULT mkColorBrush(ID2D1RenderTarget *rt, ID2D1SolidColorBrush **b);
|
|
|
|
HRESULT underline(uiUnderline *u);
|
|
|
|
HRESULT mkUnderlineBrush(ID2D1RenderTarget *rt, ID2D1SolidColorBrush **b);
|
2018-03-13 21:01:15 -05:00
|
|
|
};
|
2018-03-14 20:08:19 -05:00
|
|
|
// TODO figure out where this type should *really* go in all the headers...
|
|
|
|
struct drawTextBackgroundParams {
|
|
|
|
size_t start;
|
|
|
|
size_t end;
|
|
|
|
double r;
|
|
|
|
double g;
|
|
|
|
double b;
|
|
|
|
double a;
|
|
|
|
};
|
2018-03-16 19:06:23 -05:00
|
|
|
|
|
|
|
// fontdialog.cpp
|
|
|
|
struct fontDialogParams {
|
|
|
|
IDWriteFont *font;
|
|
|
|
double size;
|
|
|
|
WCHAR *familyName;
|
|
|
|
WCHAR *styleName;
|
|
|
|
};
|
|
|
|
extern BOOL uiprivShowFontDialog(HWND parent, struct fontDialogParams *params);
|
|
|
|
extern void uiprivLoadInitialFontDialogParams(struct fontDialogParams *params);
|
|
|
|
extern void uiprivDestroyFontDialogParams(struct fontDialogParams *params);
|
|
|
|
extern WCHAR *uiprivFontDialogParamsToString(struct fontDialogParams *params);
|