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 _FWL_WIDGETTP_H | 7 #ifndef XFA_INCLUDE_FWL_THEME_WIDGETTP_H_ |
8 #define _FWL_WIDGETTP_H | 8 #define XFA_INCLUDE_FWL_THEME_WIDGETTP_H_ |
| 9 |
| 10 #include <memory> |
| 11 #include <vector> |
| 12 |
9 class IFWL_ThemeProvider; | 13 class IFWL_ThemeProvider; |
10 class IFWL_Widget; | 14 class IFWL_Widget; |
11 class IFDE_TextOut; | 15 class IFDE_TextOut; |
12 class IFX_Font; | 16 class IFX_Font; |
13 class IFX_FontMgr; | 17 class IFX_FontMgr; |
14 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 18 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
15 class IFX_FontSourceEnum; | 19 class IFX_FontSourceEnum; |
16 #endif | 20 #endif |
17 class CFWL_WidgetTP; | 21 class CFWL_WidgetTP; |
18 class CFWL_ArrowData; | 22 class CFWL_ArrowData; |
| 23 |
19 class CFWL_WidgetTP { | 24 class CFWL_WidgetTP { |
20 public: | 25 public: |
21 virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); | 26 virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); |
22 virtual FX_DWORD GetThemeID(IFWL_Widget* pWidget); | 27 virtual FX_DWORD GetThemeID(IFWL_Widget* pWidget); |
23 virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, | 28 virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, |
24 FX_DWORD dwThemeID, | 29 FX_DWORD dwThemeID, |
25 FX_BOOL bChildren = TRUE); | 30 FX_BOOL bChildren = TRUE); |
26 virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); | 31 virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); |
27 virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, | 32 virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, |
28 const CFX_Matrix& matrix); | 33 const CFX_Matrix& matrix); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 FX_DWORD m_dwValue; | 140 FX_DWORD m_dwValue; |
136 CFX_RectF m_rtMargin; | 141 CFX_RectF m_rtMargin; |
137 FX_DWORD m_dwThemeID; | 142 FX_DWORD m_dwThemeID; |
138 CFX_Matrix _ctm; | 143 CFX_Matrix _ctm; |
139 }; | 144 }; |
140 FX_BOOL FWLTHEME_Init(); | 145 FX_BOOL FWLTHEME_Init(); |
141 void FWLTHEME_Release(); | 146 void FWLTHEME_Release(); |
142 FX_DWORD FWL_GetThemeLayout(FX_DWORD dwThemeID); | 147 FX_DWORD FWL_GetThemeLayout(FX_DWORD dwThemeID); |
143 FX_DWORD FWL_GetThemeColor(FX_DWORD dwThemeID); | 148 FX_DWORD FWL_GetThemeColor(FX_DWORD dwThemeID); |
144 FX_DWORD FWL_MakeThemeID(FX_DWORD dwLayout, FX_DWORD dwColor); | 149 FX_DWORD FWL_MakeThemeID(FX_DWORD dwLayout, FX_DWORD dwColor); |
| 150 |
145 class CFWL_ArrowData { | 151 class CFWL_ArrowData { |
146 public: | 152 public: |
147 static CFWL_ArrowData* GetInstance(); | 153 static CFWL_ArrowData* GetInstance(); |
148 static FX_BOOL IsInstance(); | 154 static FX_BOOL IsInstance(); |
149 static void DestroyInstance(); | 155 static void DestroyInstance(); |
150 virtual ~CFWL_ArrowData(); | 156 virtual ~CFWL_ArrowData(); |
151 void SetColorData(FX_DWORD dwID); | 157 void SetColorData(FX_DWORD dwID); |
152 | 158 |
153 class CColorData { | 159 class CColorData { |
154 public: | 160 public: |
155 FX_ARGB clrBorder[4]; | 161 FX_ARGB clrBorder[4]; |
156 FX_ARGB clrStart[4]; | 162 FX_ARGB clrStart[4]; |
157 FX_ARGB clrEnd[4]; | 163 FX_ARGB clrEnd[4]; |
158 FX_ARGB clrSign[4]; | 164 FX_ARGB clrSign[4]; |
159 } * m_pColorData; | 165 } * m_pColorData; |
160 | 166 |
161 protected: | 167 protected: |
162 CFWL_ArrowData(); | 168 CFWL_ArrowData(); |
163 static CFWL_ArrowData* m_pInstance; | 169 static CFWL_ArrowData* m_pInstance; |
164 }; | 170 }; |
| 171 |
165 class CFWL_FontData { | 172 class CFWL_FontData { |
166 public: | 173 public: |
167 CFWL_FontData(); | 174 CFWL_FontData(); |
168 virtual ~CFWL_FontData(); | 175 virtual ~CFWL_FontData(); |
169 FX_BOOL Equal(const CFX_WideStringC& wsFontFamily, | 176 FX_BOOL Equal(const CFX_WideStringC& wsFontFamily, |
170 FX_DWORD dwFontStyles, | 177 FX_DWORD dwFontStyles, |
171 FX_WORD wCodePage); | 178 FX_WORD wCodePage); |
172 FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily, | 179 FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily, |
173 FX_DWORD dwFontStyles, | 180 FX_DWORD dwFontStyles, |
174 FX_WORD wCodePage); | 181 FX_WORD wCodePage); |
175 IFX_Font* GetFont() const { return m_pFont; } | 182 IFX_Font* GetFont() const { return m_pFont; } |
176 | 183 |
177 protected: | 184 protected: |
178 CFX_WideString m_wsFamily; | 185 CFX_WideString m_wsFamily; |
179 FX_DWORD m_dwStyles; | 186 FX_DWORD m_dwStyles; |
180 FX_DWORD m_dwCodePage; | 187 FX_DWORD m_dwCodePage; |
181 IFX_Font* m_pFont; | 188 IFX_Font* m_pFont; |
182 IFX_FontMgr* m_pFontMgr; | 189 IFX_FontMgr* m_pFontMgr; |
183 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 190 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
184 IFX_FontSourceEnum* m_pFontSource; | 191 IFX_FontSourceEnum* m_pFontSource; |
185 #endif | 192 #endif |
186 }; | 193 }; |
| 194 |
187 class CFWL_FontManager { | 195 class CFWL_FontManager { |
188 public: | 196 public: |
189 CFWL_FontManager(); | 197 static CFWL_FontManager* GetInstance(); |
190 virtual ~CFWL_FontManager(); | 198 static void DestroyInstance(); |
| 199 |
191 IFX_Font* FindFont(const CFX_WideStringC& wsFontFamily, | 200 IFX_Font* FindFont(const CFX_WideStringC& wsFontFamily, |
192 FX_DWORD dwFontStyles, | 201 FX_DWORD dwFontStyles, |
193 FX_WORD dwCodePage); | 202 FX_WORD dwCodePage); |
194 | 203 |
195 protected: | 204 protected: |
196 CFX_PtrArray m_arrFonts; | 205 CFWL_FontManager(); |
| 206 virtual ~CFWL_FontManager(); |
| 207 |
| 208 static CFWL_FontManager* s_FontManager; |
| 209 std::vector<std::unique_ptr<CFWL_FontData>> m_FontsArray; |
197 }; | 210 }; |
198 CFWL_FontManager* FWL_GetFontManager(); | 211 |
199 #endif | 212 #endif // XFA_INCLUDE_FWL_THEME_WIDGETTP_H_ |
OLD | NEW |