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 XFA_INCLUDE_FWL_THEME_WIDGETTP_H_ | 7 #ifndef XFA_INCLUDE_FWL_THEME_WIDGETTP_H_ |
8 #define XFA_INCLUDE_FWL_THEME_WIDGETTP_H_ | 8 #define XFA_INCLUDE_FWL_THEME_WIDGETTP_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 14 matching lines...) Expand all Loading... |
25 class CFWL_ThemePart; | 25 class CFWL_ThemePart; |
26 class CFWL_ThemeText; | 26 class CFWL_ThemeText; |
27 | 27 |
28 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 28 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
29 class IFX_FontSourceEnum; | 29 class IFX_FontSourceEnum; |
30 #endif | 30 #endif |
31 | 31 |
32 class CFWL_WidgetTP { | 32 class CFWL_WidgetTP { |
33 public: | 33 public: |
34 virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); | 34 virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); |
35 virtual FX_DWORD GetThemeID(IFWL_Widget* pWidget); | 35 virtual uint32_t GetThemeID(IFWL_Widget* pWidget); |
36 virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, | 36 virtual uint32_t SetThemeID(IFWL_Widget* pWidget, |
37 FX_DWORD dwThemeID, | 37 uint32_t dwThemeID, |
38 FX_BOOL bChildren = TRUE); | 38 FX_BOOL bChildren = TRUE); |
39 virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); | 39 virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); |
40 virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, | 40 virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, |
41 const CFX_Matrix& matrix); | 41 const CFX_Matrix& matrix); |
42 virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); | 42 virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); |
43 virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); | 43 virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); |
44 virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); | 44 virtual void* GetCapacity(CFWL_ThemePart* pThemePart, uint32_t dwCapacity); |
45 virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget); | 45 virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget); |
46 virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart); | 46 virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart); |
47 virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, | 47 virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, |
48 FX_FLOAT fx, | 48 FX_FLOAT fx, |
49 FX_FLOAT fy); | 49 FX_FLOAT fy); |
50 virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect); | 50 virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect); |
51 virtual FWL_ERR Initialize(); | 51 virtual FWL_ERR Initialize(); |
52 virtual FWL_ERR Finalize(); | 52 virtual FWL_ERR Finalize(); |
53 virtual ~CFWL_WidgetTP(); | 53 virtual ~CFWL_WidgetTP(); |
54 FWL_ERR SetFont(IFWL_Widget* pWidget, | 54 FWL_ERR SetFont(IFWL_Widget* pWidget, |
55 const FX_WCHAR* strFont, | 55 const FX_WCHAR* strFont, |
56 FX_FLOAT fFontSize, | 56 FX_FLOAT fFontSize, |
57 FX_ARGB rgbFont); | 57 FX_ARGB rgbFont); |
58 FWL_ERR SetFont(IFWL_Widget* pWidget, | 58 FWL_ERR SetFont(IFWL_Widget* pWidget, |
59 IFX_Font* pFont, | 59 IFX_Font* pFont, |
60 FX_FLOAT fFontSize, | 60 FX_FLOAT fFontSize, |
61 FX_ARGB rgbFont); | 61 FX_ARGB rgbFont); |
62 IFX_Font* GetFont(IFWL_Widget* pWidget); | 62 IFX_Font* GetFont(IFWL_Widget* pWidget); |
63 | 63 |
64 protected: | 64 protected: |
65 CFWL_WidgetTP(); | 65 CFWL_WidgetTP(); |
66 FX_ERR InitTTO(); | 66 FX_ERR InitTTO(); |
67 FX_ERR FinalizeTTO(); | 67 FX_ERR FinalizeTTO(); |
68 void DrawEdge(CFX_Graphics* pGraphics, | 68 void DrawEdge(CFX_Graphics* pGraphics, |
69 FX_DWORD dwStyles, | 69 uint32_t dwStyles, |
70 const CFX_RectF* pRect, | 70 const CFX_RectF* pRect, |
71 CFX_Matrix* pMatrix = NULL); | 71 CFX_Matrix* pMatrix = NULL); |
72 void Draw3DRect(CFX_Graphics* pGraphics, | 72 void Draw3DRect(CFX_Graphics* pGraphics, |
73 FWLTHEME_EDGE eType, | 73 FWLTHEME_EDGE eType, |
74 FX_FLOAT fWidth, | 74 FX_FLOAT fWidth, |
75 const CFX_RectF* pRect, | 75 const CFX_RectF* pRect, |
76 FX_ARGB cr1, | 76 FX_ARGB cr1, |
77 FX_ARGB cr2, | 77 FX_ARGB cr2, |
78 FX_ARGB cr3, | 78 FX_ARGB cr3, |
79 FX_ARGB cr4, | 79 FX_ARGB cr4, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void DrawBtn(CFX_Graphics* pGraphics, | 134 void DrawBtn(CFX_Graphics* pGraphics, |
135 const CFX_RectF* pRect, | 135 const CFX_RectF* pRect, |
136 FWLTHEME_STATE eState, | 136 FWLTHEME_STATE eState, |
137 CFX_Matrix* pMatrix = NULL); | 137 CFX_Matrix* pMatrix = NULL); |
138 void DrawArrowBtn(CFX_Graphics* pGraphics, | 138 void DrawArrowBtn(CFX_Graphics* pGraphics, |
139 const CFX_RectF* pRect, | 139 const CFX_RectF* pRect, |
140 FWLTHEME_DIRECTION eDict, | 140 FWLTHEME_DIRECTION eDict, |
141 FWLTHEME_STATE eState, | 141 FWLTHEME_STATE eState, |
142 CFX_Matrix* pMatrix = NULL); | 142 CFX_Matrix* pMatrix = NULL); |
143 FWLCOLOR BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, uint8_t scale); | 143 FWLCOLOR BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, uint8_t scale); |
144 FX_DWORD m_dwRefCount; | 144 uint32_t m_dwRefCount; |
145 IFDE_TextOut* m_pTextOut; | 145 IFDE_TextOut* m_pTextOut; |
146 IFX_Font* m_pFDEFont; | 146 IFX_Font* m_pFDEFont; |
147 FX_FLOAT m_fValue; | 147 FX_FLOAT m_fValue; |
148 FX_DWORD m_dwValue; | 148 uint32_t m_dwValue; |
149 CFX_RectF m_rtMargin; | 149 CFX_RectF m_rtMargin; |
150 FX_DWORD m_dwThemeID; | 150 uint32_t m_dwThemeID; |
151 CFX_Matrix _ctm; | 151 CFX_Matrix _ctm; |
152 }; | 152 }; |
153 FX_BOOL FWLTHEME_Init(); | 153 FX_BOOL FWLTHEME_Init(); |
154 void FWLTHEME_Release(); | 154 void FWLTHEME_Release(); |
155 FX_DWORD FWL_GetThemeLayout(FX_DWORD dwThemeID); | 155 uint32_t FWL_GetThemeLayout(uint32_t dwThemeID); |
156 FX_DWORD FWL_GetThemeColor(FX_DWORD dwThemeID); | 156 uint32_t FWL_GetThemeColor(uint32_t dwThemeID); |
157 FX_DWORD FWL_MakeThemeID(FX_DWORD dwLayout, FX_DWORD dwColor); | 157 uint32_t FWL_MakeThemeID(uint32_t dwLayout, uint32_t dwColor); |
158 | 158 |
159 class CFWL_ArrowData { | 159 class CFWL_ArrowData { |
160 public: | 160 public: |
161 static CFWL_ArrowData* GetInstance(); | 161 static CFWL_ArrowData* GetInstance(); |
162 static FX_BOOL IsInstance(); | 162 static FX_BOOL IsInstance(); |
163 static void DestroyInstance(); | 163 static void DestroyInstance(); |
164 virtual ~CFWL_ArrowData(); | 164 virtual ~CFWL_ArrowData(); |
165 void SetColorData(FX_DWORD dwID); | 165 void SetColorData(uint32_t dwID); |
166 | 166 |
167 class CColorData { | 167 class CColorData { |
168 public: | 168 public: |
169 FX_ARGB clrBorder[4]; | 169 FX_ARGB clrBorder[4]; |
170 FX_ARGB clrStart[4]; | 170 FX_ARGB clrStart[4]; |
171 FX_ARGB clrEnd[4]; | 171 FX_ARGB clrEnd[4]; |
172 FX_ARGB clrSign[4]; | 172 FX_ARGB clrSign[4]; |
173 } * m_pColorData; | 173 } * m_pColorData; |
174 | 174 |
175 protected: | 175 protected: |
176 CFWL_ArrowData(); | 176 CFWL_ArrowData(); |
177 static CFWL_ArrowData* m_pInstance; | 177 static CFWL_ArrowData* m_pInstance; |
178 }; | 178 }; |
179 | 179 |
180 class CFWL_FontData { | 180 class CFWL_FontData { |
181 public: | 181 public: |
182 CFWL_FontData(); | 182 CFWL_FontData(); |
183 virtual ~CFWL_FontData(); | 183 virtual ~CFWL_FontData(); |
184 FX_BOOL Equal(const CFX_WideStringC& wsFontFamily, | 184 FX_BOOL Equal(const CFX_WideStringC& wsFontFamily, |
185 FX_DWORD dwFontStyles, | 185 uint32_t dwFontStyles, |
186 uint16_t wCodePage); | 186 uint16_t wCodePage); |
187 FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily, | 187 FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily, |
188 FX_DWORD dwFontStyles, | 188 uint32_t dwFontStyles, |
189 uint16_t wCodePage); | 189 uint16_t wCodePage); |
190 IFX_Font* GetFont() const { return m_pFont; } | 190 IFX_Font* GetFont() const { return m_pFont; } |
191 | 191 |
192 protected: | 192 protected: |
193 CFX_WideString m_wsFamily; | 193 CFX_WideString m_wsFamily; |
194 FX_DWORD m_dwStyles; | 194 uint32_t m_dwStyles; |
195 FX_DWORD m_dwCodePage; | 195 uint32_t m_dwCodePage; |
196 IFX_Font* m_pFont; | 196 IFX_Font* m_pFont; |
197 IFX_FontMgr* m_pFontMgr; | 197 IFX_FontMgr* m_pFontMgr; |
198 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 198 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
199 IFX_FontSourceEnum* m_pFontSource; | 199 IFX_FontSourceEnum* m_pFontSource; |
200 #endif | 200 #endif |
201 }; | 201 }; |
202 | 202 |
203 class CFWL_FontManager { | 203 class CFWL_FontManager { |
204 public: | 204 public: |
205 static CFWL_FontManager* GetInstance(); | 205 static CFWL_FontManager* GetInstance(); |
206 static void DestroyInstance(); | 206 static void DestroyInstance(); |
207 | 207 |
208 IFX_Font* FindFont(const CFX_WideStringC& wsFontFamily, | 208 IFX_Font* FindFont(const CFX_WideStringC& wsFontFamily, |
209 FX_DWORD dwFontStyles, | 209 uint32_t dwFontStyles, |
210 uint16_t dwCodePage); | 210 uint16_t dwCodePage); |
211 | 211 |
212 protected: | 212 protected: |
213 CFWL_FontManager(); | 213 CFWL_FontManager(); |
214 virtual ~CFWL_FontManager(); | 214 virtual ~CFWL_FontManager(); |
215 | 215 |
216 static CFWL_FontManager* s_FontManager; | 216 static CFWL_FontManager* s_FontManager; |
217 std::vector<std::unique_ptr<CFWL_FontData>> m_FontsArray; | 217 std::vector<std::unique_ptr<CFWL_FontData>> m_FontsArray; |
218 }; | 218 }; |
219 | 219 |
220 #endif // XFA_INCLUDE_FWL_THEME_WIDGETTP_H_ | 220 #endif // XFA_INCLUDE_FWL_THEME_WIDGETTP_H_ |
OLD | NEW |