Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: xfa/include/fwl/theme/widgettp.h

Issue 1834323003: Move xfa/include/fwl/{theme,lightwidget} to xfa/fwl (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #ifndef XFA_INCLUDE_FWL_THEME_WIDGETTP_H_
8 #define XFA_INCLUDE_FWL_THEME_WIDGETTP_H_
9
10 #include <memory>
11 #include <vector>
12
13 #include "core/fxcrt/include/fx_coordinates.h"
14 #include "core/fxcrt/include/fx_system.h"
15 #include "xfa/fwl/core/fwl_error.h"
16 #include "xfa/fxgraphics/include/cfx_graphics.h"
17 #include "xfa/include/fwl/theme/utils.h"
18
19 class IFWL_Widget;
20 class IFDE_TextOut;
21 class IFX_Font;
22 class IFX_FontMgr;
23 class CFWL_ArrowData;
24 class CFWL_ThemeBackground;
25 class CFWL_ThemePart;
26 class CFWL_ThemeText;
27
28 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
29 class IFX_FontSourceEnum;
30 #endif
31
32 class CFWL_WidgetTP {
33 public:
34 virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget);
35 virtual uint32_t GetThemeID(IFWL_Widget* pWidget);
36 virtual uint32_t SetThemeID(IFWL_Widget* pWidget,
37 uint32_t dwThemeID,
38 FX_BOOL bChildren = TRUE);
39 virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix);
40 virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget,
41 const CFX_Matrix& matrix);
42 virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams);
43 virtual FX_BOOL DrawText(CFWL_ThemeText* pParams);
44 virtual void* GetCapacity(CFWL_ThemePart* pThemePart, uint32_t dwCapacity);
45 virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget);
46 virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart);
47 virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart,
48 FX_FLOAT fx,
49 FX_FLOAT fy);
50 virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect);
51 virtual FWL_ERR Initialize();
52 virtual FWL_ERR Finalize();
53 virtual ~CFWL_WidgetTP();
54 FWL_ERR SetFont(IFWL_Widget* pWidget,
55 const FX_WCHAR* strFont,
56 FX_FLOAT fFontSize,
57 FX_ARGB rgbFont);
58 FWL_ERR SetFont(IFWL_Widget* pWidget,
59 IFX_Font* pFont,
60 FX_FLOAT fFontSize,
61 FX_ARGB rgbFont);
62 IFX_Font* GetFont(IFWL_Widget* pWidget);
63
64 protected:
65 CFWL_WidgetTP();
66 FX_ERR InitTTO();
67 FX_ERR FinalizeTTO();
68 void DrawEdge(CFX_Graphics* pGraphics,
69 uint32_t dwStyles,
70 const CFX_RectF* pRect,
71 CFX_Matrix* pMatrix = NULL);
72 void Draw3DRect(CFX_Graphics* pGraphics,
73 FWLTHEME_EDGE eType,
74 FX_FLOAT fWidth,
75 const CFX_RectF* pRect,
76 FX_ARGB cr1,
77 FX_ARGB cr2,
78 FX_ARGB cr3,
79 FX_ARGB cr4,
80 CFX_Matrix* pMatrix = NULL);
81 void Draw3DCircle(CFX_Graphics* pGraphics,
82 FWLTHEME_EDGE eType,
83 FX_FLOAT fWidth,
84 const CFX_RectF* pRect,
85 FX_ARGB cr1,
86 FX_ARGB cr2,
87 FX_ARGB cr3,
88 FX_ARGB cr4,
89 CFX_Matrix* pMatrix = NULL);
90 void DrawBorder(CFX_Graphics* pGraphics,
91 const CFX_RectF* pRect,
92 CFX_Matrix* pMatrix = NULL);
93 void FillBackground(CFX_Graphics* pGraphics,
94 const CFX_RectF* pRect,
95 CFX_Matrix* pMatrix = NULL);
96 void FillSoildRect(CFX_Graphics* pGraphics,
97 FX_ARGB fillColor,
98 const CFX_RectF* pRect,
99 CFX_Matrix* pMatrix = NULL);
100 void DrawAxialShading(CFX_Graphics* pGraphics,
101 FX_FLOAT fx1,
102 FX_FLOAT fy1,
103 FX_FLOAT fx2,
104 FX_FLOAT fy2,
105 FX_ARGB beginColor,
106 FX_ARGB endColor,
107 CFX_Path* path,
108 int32_t fillMode = FXFILL_WINDING,
109 CFX_Matrix* pMatrix = NULL);
110 void DrawAnnulusRect(CFX_Graphics* pGraphics,
111 FX_ARGB fillColor,
112 const CFX_RectF* pRect,
113 FX_FLOAT fRingWidth = 1,
114 CFX_Matrix* pMatrix = NULL);
115 void DrawAnnulusCircle(CFX_Graphics* pGraphics,
116 FX_ARGB fillColor,
117 const CFX_RectF* pRect,
118 FX_FLOAT fWidth = 1,
119 CFX_Matrix* pMatrix = NULL);
120 void DrawFocus(CFX_Graphics* pGraphics,
121 const CFX_RectF* pRect,
122 CFX_Matrix* pMatrix = NULL);
123 void DrawArrow(CFX_Graphics* pGraphics,
124 const CFX_RectF* pRect,
125 FWLTHEME_DIRECTION eDict,
126 FX_ARGB argbFill,
127 FX_BOOL bPressed,
128 CFX_Matrix* pMatrix = NULL);
129 void DrawArrow(CFX_Graphics* pGraphics,
130 const CFX_RectF* pRect,
131 FWLTHEME_DIRECTION eDict,
132 FX_ARGB argSign,
133 CFX_Matrix* pMatrix = NULL);
134 void DrawBtn(CFX_Graphics* pGraphics,
135 const CFX_RectF* pRect,
136 FWLTHEME_STATE eState,
137 CFX_Matrix* pMatrix = NULL);
138 void DrawArrowBtn(CFX_Graphics* pGraphics,
139 const CFX_RectF* pRect,
140 FWLTHEME_DIRECTION eDict,
141 FWLTHEME_STATE eState,
142 CFX_Matrix* pMatrix = NULL);
143 FWLCOLOR BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, uint8_t scale);
144 uint32_t m_dwRefCount;
145 IFDE_TextOut* m_pTextOut;
146 IFX_Font* m_pFDEFont;
147 FX_FLOAT m_fValue;
148 uint32_t m_dwValue;
149 CFX_RectF m_rtMargin;
150 uint32_t m_dwThemeID;
151 CFX_Matrix _ctm;
152 };
153 FX_BOOL FWLTHEME_Init();
154 void FWLTHEME_Release();
155 uint32_t FWL_GetThemeLayout(uint32_t dwThemeID);
156 uint32_t FWL_GetThemeColor(uint32_t dwThemeID);
157 uint32_t FWL_MakeThemeID(uint32_t dwLayout, uint32_t dwColor);
158
159 class CFWL_ArrowData {
160 public:
161 static CFWL_ArrowData* GetInstance();
162 static FX_BOOL IsInstance();
163 static void DestroyInstance();
164 virtual ~CFWL_ArrowData();
165 void SetColorData(uint32_t dwID);
166
167 class CColorData {
168 public:
169 FX_ARGB clrBorder[4];
170 FX_ARGB clrStart[4];
171 FX_ARGB clrEnd[4];
172 FX_ARGB clrSign[4];
173 } * m_pColorData;
174
175 protected:
176 CFWL_ArrowData();
177 static CFWL_ArrowData* m_pInstance;
178 };
179
180 class CFWL_FontData {
181 public:
182 CFWL_FontData();
183 virtual ~CFWL_FontData();
184 FX_BOOL Equal(const CFX_WideStringC& wsFontFamily,
185 uint32_t dwFontStyles,
186 uint16_t wCodePage);
187 FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily,
188 uint32_t dwFontStyles,
189 uint16_t wCodePage);
190 IFX_Font* GetFont() const { return m_pFont; }
191
192 protected:
193 CFX_WideString m_wsFamily;
194 uint32_t m_dwStyles;
195 uint32_t m_dwCodePage;
196 IFX_Font* m_pFont;
197 IFX_FontMgr* m_pFontMgr;
198 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
199 IFX_FontSourceEnum* m_pFontSource;
200 #endif
201 };
202
203 class CFWL_FontManager {
204 public:
205 static CFWL_FontManager* GetInstance();
206 static void DestroyInstance();
207
208 IFX_Font* FindFont(const CFX_WideStringC& wsFontFamily,
209 uint32_t dwFontStyles,
210 uint16_t dwCodePage);
211
212 protected:
213 CFWL_FontManager();
214 virtual ~CFWL_FontManager();
215
216 static CFWL_FontManager* s_FontManager;
217 std::vector<std::unique_ptr<CFWL_FontData>> m_FontsArray;
218 };
219
220 #endif // XFA_INCLUDE_FWL_THEME_WIDGETTP_H_
OLDNEW
« xfa/fwl/theme/cfwl_scrollbartp.h ('K') | « xfa/include/fwl/theme/utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698