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