Initial commit.
[pdfium.git] / core / src / fxge / win32 / dwrite_int.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4  \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _FX_DIRECT_WRITE_\r
8 #define _FX_DIRECT_WRITE_\r
9 #ifndef DECLSPEC_UUID\r
10 #if (_MSC_VER >= 1100) && defined (__cplusplus)\r
11 #define DECLSPEC_UUID(x)    __declspec(uuid(x))\r
12 #else\r
13 #define DECLSPEC_UUID(x)\r
14 #endif\r
15 #endif\r
16 #ifndef DECLSPEC_NOVTABLE\r
17 #if (_MSC_VER >= 1100) && defined(__cplusplus)\r
18 #define DECLSPEC_NOVTABLE   __declspec(novtable)\r
19 #else\r
20 #define DECLSPEC_NOVTABLE\r
21 #endif\r
22 #endif\r
23 #if(WINVER < 0x0500)\r
24 #ifndef _MAC\r
25 DECLARE_HANDLE(HMONITOR);\r
26 #endif\r
27 #endif\r
28 class CDWriteExt\r
29 {\r
30 public:\r
31     CDWriteExt();\r
32     ~CDWriteExt();\r
33 \r
34     void                        Load();\r
35     void            Unload();\r
36 \r
37     FX_BOOL                     IsAvailable()\r
38     {\r
39         return m_pDWriteFactory != NULL;\r
40     }\r
41 \r
42     void*                       DwCreateFontFaceFromStream(FX_LPBYTE pData, FX_DWORD size, int simulation_style);\r
43     FX_BOOL         DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget);\r
44     void            DwDeleteRenderingTarget(void* renderTarget);\r
45     FX_BOOL                     DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix,\r
46                                     void *font, FX_FLOAT font_size, FX_ARGB text_color,\r
47                                     int glyph_count, unsigned short* glyph_indices,\r
48                                     FX_FLOAT baselineOriginX, FX_FLOAT baselineOriginY,\r
49                                     void* glyph_offsets,\r
50                                     FX_FLOAT* glyph_advances);\r
51     void                        DwDeleteFont(void* pFont);\r
52 \r
53 protected:\r
54     void*                       m_hModule;\r
55     void*                       m_pDWriteFactory;\r
56     void*                   m_pDwFontContext;\r
57     void*               m_pDwTextRenderer;\r
58 };\r
59 #endif\r