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_FWL_THEME_CFWL_WIDGETTP_H_ | 7 #ifndef XFA_FWL_THEME_CFWL_WIDGETTP_H_ |
8 #define XFA_FWL_THEME_CFWL_WIDGETTP_H_ | 8 #define XFA_FWL_THEME_CFWL_WIDGETTP_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 class IFWL_Widget; | 100 class IFWL_Widget; |
101 | 101 |
102 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 102 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
103 class CFX_FontSourceEnum_File; | 103 class CFX_FontSourceEnum_File; |
104 #endif | 104 #endif |
105 | 105 |
106 class CFWL_WidgetTP { | 106 class CFWL_WidgetTP { |
107 public: | 107 public: |
108 virtual ~CFWL_WidgetTP(); | 108 virtual ~CFWL_WidgetTP(); |
109 | 109 |
110 virtual FWL_Error Initialize(); | 110 virtual void Initialize(); |
111 virtual FWL_Error Finalize(); | 111 virtual void Finalize(); |
112 | 112 |
113 virtual bool IsValidWidget(IFWL_Widget* pWidget); | 113 virtual bool IsValidWidget(IFWL_Widget* pWidget); |
114 virtual uint32_t GetThemeID(IFWL_Widget* pWidget); | 114 virtual uint32_t GetThemeID(IFWL_Widget* pWidget); |
115 virtual uint32_t SetThemeID(IFWL_Widget* pWidget, uint32_t dwThemeID); | 115 virtual uint32_t SetThemeID(IFWL_Widget* pWidget, uint32_t dwThemeID); |
116 virtual FWL_Error GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); | 116 |
117 virtual FWL_Error SetThemeMatrix(IFWL_Widget* pWidget, | 117 virtual void DrawBackground(CFWL_ThemeBackground* pParams); |
118 const CFX_Matrix& matrix); | 118 virtual void DrawText(CFWL_ThemeText* pParams); |
119 virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); | |
120 virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); | |
121 virtual void* GetCapacity(CFWL_ThemePart* pThemePart, | 119 virtual void* GetCapacity(CFWL_ThemePart* pThemePart, |
122 CFWL_WidgetCapacity dwCapacity); | 120 CFWL_WidgetCapacity dwCapacity); |
123 virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget); | 121 virtual bool IsCustomizedLayout(IFWL_Widget* pWidget); |
124 virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect); | 122 virtual void CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect); |
125 | 123 |
126 FWL_Error SetFont(IFWL_Widget* pWidget, | 124 void SetFont(IFWL_Widget* pWidget, |
127 const FX_WCHAR* strFont, | 125 const FX_WCHAR* strFont, |
128 FX_FLOAT fFontSize, | 126 FX_FLOAT fFontSize, |
129 FX_ARGB rgbFont); | 127 FX_ARGB rgbFont); |
130 FWL_Error SetFont(IFWL_Widget* pWidget, | 128 void SetFont(IFWL_Widget* pWidget, |
131 CFGAS_GEFont* pFont, | 129 CFGAS_GEFont* pFont, |
132 FX_FLOAT fFontSize, | 130 FX_FLOAT fFontSize, |
133 FX_ARGB rgbFont); | 131 FX_ARGB rgbFont); |
134 CFGAS_GEFont* GetFont(IFWL_Widget* pWidget); | 132 CFGAS_GEFont* GetFont(IFWL_Widget* pWidget); |
135 | 133 |
136 protected: | 134 protected: |
137 CFWL_WidgetTP(); | 135 CFWL_WidgetTP(); |
138 FWL_Error InitTTO(); | 136 |
139 FWL_Error FinalizeTTO(); | 137 void InitTTO(); |
| 138 void FinalizeTTO(); |
| 139 |
140 void DrawEdge(CFX_Graphics* pGraphics, | 140 void DrawEdge(CFX_Graphics* pGraphics, |
141 uint32_t dwStyles, | 141 uint32_t dwStyles, |
142 const CFX_RectF* pRect, | 142 const CFX_RectF* pRect, |
143 CFX_Matrix* pMatrix = nullptr); | 143 CFX_Matrix* pMatrix = nullptr); |
144 void Draw3DRect(CFX_Graphics* pGraphics, | 144 void Draw3DRect(CFX_Graphics* pGraphics, |
145 FWLTHEME_EDGE eType, | 145 FWLTHEME_EDGE eType, |
146 FX_FLOAT fWidth, | 146 FX_FLOAT fWidth, |
147 const CFX_RectF* pRect, | 147 const CFX_RectF* pRect, |
148 FX_ARGB cr1, | 148 FX_ARGB cr1, |
149 FX_ARGB cr2, | 149 FX_ARGB cr2, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 FWLTHEME_DIRECTION eDict, | 212 FWLTHEME_DIRECTION eDict, |
213 FWLTHEME_STATE eState, | 213 FWLTHEME_STATE eState, |
214 CFX_Matrix* pMatrix = nullptr); | 214 CFX_Matrix* pMatrix = nullptr); |
215 uint32_t m_dwRefCount; | 215 uint32_t m_dwRefCount; |
216 std::unique_ptr<CFDE_TextOut> m_pTextOut; | 216 std::unique_ptr<CFDE_TextOut> m_pTextOut; |
217 CFGAS_GEFont* m_pFDEFont; | 217 CFGAS_GEFont* m_pFDEFont; |
218 FX_FLOAT m_fValue; | 218 FX_FLOAT m_fValue; |
219 uint32_t m_dwValue; | 219 uint32_t m_dwValue; |
220 CFX_RectF m_rtMargin; | 220 CFX_RectF m_rtMargin; |
221 uint32_t m_dwThemeID; | 221 uint32_t m_dwThemeID; |
222 CFX_Matrix _ctm; | |
223 }; | 222 }; |
224 | 223 |
225 void FWLTHEME_Release(); | 224 void FWLTHEME_Release(); |
226 uint32_t FWL_GetThemeLayout(uint32_t dwThemeID); | 225 uint32_t FWL_GetThemeLayout(uint32_t dwThemeID); |
227 uint32_t FWL_GetThemeColor(uint32_t dwThemeID); | 226 uint32_t FWL_GetThemeColor(uint32_t dwThemeID); |
228 | 227 |
229 class CFWL_FontData { | 228 class CFWL_FontData { |
230 public: | 229 public: |
231 CFWL_FontData(); | 230 CFWL_FontData(); |
232 virtual ~CFWL_FontData(); | 231 virtual ~CFWL_FontData(); |
(...skipping 28 matching lines...) Expand all Loading... |
261 | 260 |
262 protected: | 261 protected: |
263 CFWL_FontManager(); | 262 CFWL_FontManager(); |
264 virtual ~CFWL_FontManager(); | 263 virtual ~CFWL_FontManager(); |
265 | 264 |
266 static CFWL_FontManager* s_FontManager; | 265 static CFWL_FontManager* s_FontManager; |
267 std::vector<std::unique_ptr<CFWL_FontData>> m_FontsArray; | 266 std::vector<std::unique_ptr<CFWL_FontData>> m_FontsArray; |
268 }; | 267 }; |
269 | 268 |
270 #endif // XFA_FWL_THEME_CFWL_WIDGETTP_H_ | 269 #endif // XFA_FWL_THEME_CFWL_WIDGETTP_H_ |
OLD | NEW |