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

Side by Side Diff: xfa/fwl/theme/formtp.cpp

Issue 1830323006: Remove FX_DWORD from XFA. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « xfa/fwl/theme/datetimepickertp.cpp ('k') | xfa/fwl/theme/listboxtp.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "xfa/include/fwl/theme/formtp.h" 7 #include "xfa/include/fwl/theme/formtp.h"
8 8
9 #include "xfa/fde/tto/fde_textout.h" 9 #include "xfa/fde/tto/fde_textout.h"
10 #include "xfa/fwl/core/cfwl_themebackground.h" 10 #include "xfa/fwl/core/cfwl_themebackground.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 if (m_pDeactivebitmap) { 56 if (m_pDeactivebitmap) {
57 delete m_pDeactivebitmap; 57 delete m_pDeactivebitmap;
58 m_pDeactivebitmap = NULL; 58 m_pDeactivebitmap = NULL;
59 } 59 }
60 return CFWL_WidgetTP::Finalize(); 60 return CFWL_WidgetTP::Finalize();
61 } 61 }
62 FX_BOOL CFWL_FormTP::IsValidWidget(IFWL_Widget* pWidget) { 62 FX_BOOL CFWL_FormTP::IsValidWidget(IFWL_Widget* pWidget) {
63 if (!pWidget) 63 if (!pWidget)
64 return FALSE; 64 return FALSE;
65 FX_DWORD dwHash = pWidget->GetClassID(); 65 uint32_t dwHash = pWidget->GetClassID();
66 return dwHash == FWL_CLASSHASH_Form; 66 return dwHash == FWL_CLASSHASH_Form;
67 } 67 }
68 FX_DWORD CFWL_FormTP::SetThemeID(IFWL_Widget* pWidget, 68 uint32_t CFWL_FormTP::SetThemeID(IFWL_Widget* pWidget,
69 FX_DWORD dwThemeID, 69 uint32_t dwThemeID,
70 FX_BOOL bChildren) { 70 FX_BOOL bChildren) {
71 if (m_pThemeData) { 71 if (m_pThemeData) {
72 SetThemeData(FWL_GetThemeColor(dwThemeID)); 72 SetThemeData(FWL_GetThemeColor(dwThemeID));
73 } 73 }
74 InitCaption(TRUE); 74 InitCaption(TRUE);
75 InitCaption(FALSE); 75 InitCaption(FALSE);
76 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); 76 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren);
77 } 77 }
78 FX_BOOL CFWL_FormTP::DrawBackground(CFWL_ThemeBackground* pParams) { 78 FX_BOOL CFWL_FormTP::DrawBackground(CFWL_ThemeBackground* pParams) {
79 if (!pParams) 79 if (!pParams)
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (!m_pTextOut) 152 if (!m_pTextOut)
153 return FALSE; 153 return FALSE;
154 if (pParams->m_iPart == FWL_PART_FRM_Caption) { 154 if (pParams->m_iPart == FWL_PART_FRM_Caption) {
155 m_pTextOut->SetTextColor(0xFFFFFFFF); 155 m_pTextOut->SetTextColor(0xFFFFFFFF);
156 } else { 156 } else {
157 m_pTextOut->SetTextColor(0xFF000000); 157 m_pTextOut->SetTextColor(0xFF000000);
158 } 158 }
159 return CFWL_WidgetTP::DrawText(pParams); 159 return CFWL_WidgetTP::DrawText(pParams);
160 } 160 }
161 void* CFWL_FormTP::GetCapacity(CFWL_ThemePart* pThemePart, 161 void* CFWL_FormTP::GetCapacity(CFWL_ThemePart* pThemePart,
162 FX_DWORD dwCapacity) { 162 uint32_t dwCapacity) {
163 FX_BOOL bDefPro = FALSE; 163 FX_BOOL bDefPro = FALSE;
164 FX_BOOL bDwordVal = FALSE; 164 FX_BOOL bDwordVal = FALSE;
165 switch (dwCapacity) { 165 switch (dwCapacity) {
166 case FWL_WGTCAPACITY_CXBorder: { 166 case FWL_WGTCAPACITY_CXBorder: {
167 m_fValue = FWLTHEME_CAPACITY_CXFormBorder; 167 m_fValue = FWLTHEME_CAPACITY_CXFormBorder;
168 break; 168 break;
169 } 169 }
170 case FWL_WGTCAPACITY_CYBorder: { 170 case FWL_WGTCAPACITY_CYBorder: {
171 m_fValue = FWLTHEME_CAPACITY_CYFormBorder; 171 m_fValue = FWLTHEME_CAPACITY_CYFormBorder;
172 break; 172 break;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 case FWL_PART_FRM_Icon: { 224 case FWL_PART_FRM_Icon: {
225 CalIcon(pThemePart->m_pWidget, rtPart); 225 CalIcon(pThemePart->m_pWidget, rtPart);
226 break; 226 break;
227 } 227 }
228 default: {} 228 default: {}
229 } 229 }
230 return FWL_ERR_Succeeded; 230 return FWL_ERR_Succeeded;
231 } 231 }
232 void CFWL_FormTP::CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect) { 232 void CFWL_FormTP::CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect) {
233 FX_DWORD dwStyles = pWidget->GetStyles(); 233 uint32_t dwStyles = pWidget->GetStyles();
234 CFX_RectF rtWidget; 234 CFX_RectF rtWidget;
235 pWidget->GetWidgetRect(rtWidget); 235 pWidget->GetWidgetRect(rtWidget);
236 rtWidget.Offset(-rtWidget.left, -rtWidget.top); 236 rtWidget.Offset(-rtWidget.left, -rtWidget.top);
237 if (dwStyles & FWL_WGTSTYLE_CloseBox) { 237 if (dwStyles & FWL_WGTSTYLE_CloseBox) {
238 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Span, 238 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Span,
239 rtWidget.top + FWLTHEME_FORMBTN_Margin, FWLTHEME_FORMBTN_Size, 239 rtWidget.top + FWLTHEME_FORMBTN_Margin, FWLTHEME_FORMBTN_Size,
240 FWLTHEME_FORMBTN_Size); 240 FWLTHEME_FORMBTN_Size);
241 } else { 241 } else {
242 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Span, 242 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Span,
243 rtWidget.top + FWLTHEME_FORMBTN_Margin, 0, 0); 243 rtWidget.top + FWLTHEME_FORMBTN_Margin, 0, 0);
244 } 244 }
245 } 245 }
246 void CFWL_FormTP::CalMaxBox(IFWL_Widget* pWidget, CFX_RectF& rect) { 246 void CFWL_FormTP::CalMaxBox(IFWL_Widget* pWidget, CFX_RectF& rect) {
247 FX_DWORD dwStyles = pWidget->GetStyles(); 247 uint32_t dwStyles = pWidget->GetStyles();
248 CFX_RectF rtWidget; 248 CFX_RectF rtWidget;
249 pWidget->GetWidgetRect(rtWidget); 249 pWidget->GetWidgetRect(rtWidget);
250 rtWidget.Offset(-rtWidget.left, -rtWidget.top); 250 rtWidget.Offset(-rtWidget.left, -rtWidget.top);
251 if (dwStyles & FWL_WGTSTYLE_MaximizeBox) { 251 if (dwStyles & FWL_WGTSTYLE_MaximizeBox) {
252 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Size + 252 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Size +
253 FWLTHEME_FORMBTN_Span * 2, 253 FWLTHEME_FORMBTN_Span * 2,
254 rtWidget.top + FWLTHEME_FORMBTN_Margin, FWLTHEME_FORMBTN_Size, 254 rtWidget.top + FWLTHEME_FORMBTN_Margin, FWLTHEME_FORMBTN_Size,
255 FWLTHEME_FORMBTN_Size); 255 FWLTHEME_FORMBTN_Size);
256 } else { 256 } else {
257 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Size + 257 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Size +
258 FWLTHEME_FORMBTN_Span * 2, 258 FWLTHEME_FORMBTN_Span * 2,
259 rtWidget.top + FWLTHEME_FORMBTN_Margin, 0, 0); 259 rtWidget.top + FWLTHEME_FORMBTN_Margin, 0, 0);
260 } 260 }
261 } 261 }
262 void CFWL_FormTP::CalMinBox(IFWL_Widget* pWidget, CFX_RectF& rect) { 262 void CFWL_FormTP::CalMinBox(IFWL_Widget* pWidget, CFX_RectF& rect) {
263 FX_DWORD dwStyles = pWidget->GetStyles(); 263 uint32_t dwStyles = pWidget->GetStyles();
264 CFX_RectF rtWidget; 264 CFX_RectF rtWidget;
265 pWidget->GetWidgetRect(rtWidget); 265 pWidget->GetWidgetRect(rtWidget);
266 rtWidget.Offset(-rtWidget.left, -rtWidget.top); 266 rtWidget.Offset(-rtWidget.left, -rtWidget.top);
267 if (dwStyles & FWL_WGTSTYLE_MinimizeBox) { 267 if (dwStyles & FWL_WGTSTYLE_MinimizeBox) {
268 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + 268 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin +
269 FWLTHEME_FORMBTN_Size * 2 + FWLTHEME_FORMBTN_Span * 3, 269 FWLTHEME_FORMBTN_Size * 2 + FWLTHEME_FORMBTN_Span * 3,
270 rtWidget.top + FWLTHEME_FORMBTN_Margin, FWLTHEME_FORMBTN_Size, 270 rtWidget.top + FWLTHEME_FORMBTN_Margin, FWLTHEME_FORMBTN_Size,
271 FWLTHEME_FORMBTN_Size); 271 FWLTHEME_FORMBTN_Size);
272 } else { 272 } else {
273 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + 273 rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin +
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 } 571 }
572 } 572 }
573 void CFWL_FormTP::DrawIconImage(CFX_Graphics* pGraphics, 573 void CFWL_FormTP::DrawIconImage(CFX_Graphics* pGraphics,
574 CFX_DIBitmap* pDIBitmap, 574 CFX_DIBitmap* pDIBitmap,
575 const CFX_RectF* pRect, 575 const CFX_RectF* pRect,
576 FWLTHEME_STATE eState, 576 FWLTHEME_STATE eState,
577 CFX_Matrix* pMatrix, 577 CFX_Matrix* pMatrix,
578 int32_t iActive) { 578 int32_t iActive) {
579 pGraphics->StretchImage(pDIBitmap, *pRect, pMatrix); 579 pGraphics->StretchImage(pDIBitmap, *pRect, pMatrix);
580 } 580 }
581 void CFWL_FormTP::SetThemeData(FX_DWORD dwID) { 581 void CFWL_FormTP::SetThemeData(uint32_t dwID) {
582 m_pThemeData->clrTransWhite = ArgbEncode(0x65, 255, 255, 255); 582 m_pThemeData->clrTransWhite = ArgbEncode(0x65, 255, 255, 255);
583 m_pThemeData->clrCloseBtBKStart[0][0] = ArgbEncode(0xff, 240, 166, 148); 583 m_pThemeData->clrCloseBtBKStart[0][0] = ArgbEncode(0xff, 240, 166, 148);
584 m_pThemeData->clrCloseBtBKEnd[0][0] = ArgbEncode(0xff, 228, 61, 5); 584 m_pThemeData->clrCloseBtBKEnd[0][0] = ArgbEncode(0xff, 228, 61, 5);
585 m_pThemeData->clrCloseBtBKStart[0][1] = ArgbEncode(0xff, 255, 184, 176); 585 m_pThemeData->clrCloseBtBKStart[0][1] = ArgbEncode(0xff, 255, 184, 176);
586 m_pThemeData->clrCloseBtBKEnd[0][1] = ArgbEncode(0xff, 252, 107, 71); 586 m_pThemeData->clrCloseBtBKEnd[0][1] = ArgbEncode(0xff, 252, 107, 71);
587 m_pThemeData->clrCloseBtBKStart[0][2] = ArgbEncode(0xff, 141, 44, 20); 587 m_pThemeData->clrCloseBtBKStart[0][2] = ArgbEncode(0xff, 141, 44, 20);
588 m_pThemeData->clrCloseBtBKEnd[0][2] = ArgbEncode(0xff, 202, 72, 33); 588 m_pThemeData->clrCloseBtBKEnd[0][2] = ArgbEncode(0xff, 202, 72, 33);
589 m_pThemeData->clrCloseBtEdgeLight[0][0] = ArgbEncode(0xff, 255, 122, 107); 589 m_pThemeData->clrCloseBtEdgeLight[0][0] = ArgbEncode(0xff, 255, 122, 107);
590 m_pThemeData->clrCloseBtEdgeDark[0][0] = ArgbEncode(0xff, 218, 77, 54); 590 m_pThemeData->clrCloseBtEdgeDark[0][0] = ArgbEncode(0xff, 218, 77, 54);
591 m_pThemeData->clrCloseBtEdgeLight[0][1] = ArgbEncode(0xff, 255, 93, 74); 591 m_pThemeData->clrCloseBtEdgeLight[0][1] = ArgbEncode(0xff, 255, 93, 74);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 path.AddRectangle(0, 5, 1, 15); 890 path.AddRectangle(0, 5, 1, 15);
891 DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1], 891 DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1],
892 m_pThemeData->clrHeadBK[1][2], &path); 892 m_pThemeData->clrHeadBK[1][2], &path);
893 path.Clear(); 893 path.Clear();
894 path.AddRectangle(0, 20, 1, FWLTHEME_CAPACITY_CYCaption - 19); 894 path.AddRectangle(0, 20, 1, FWLTHEME_CAPACITY_CYCaption - 19);
895 DrawAxialShading(&gs, 0, 20, 0, FWLTHEME_CAPACITY_CYCaption, 895 DrawAxialShading(&gs, 0, 20, 0, FWLTHEME_CAPACITY_CYCaption,
896 m_pThemeData->clrHeadBK[1][2], 896 m_pThemeData->clrHeadBK[1][2],
897 m_pThemeData->clrHeadBK[1][3], &path); 897 m_pThemeData->clrHeadBK[1][3], &path);
898 } 898 }
899 } 899 }
OLDNEW
« no previous file with comments | « xfa/fwl/theme/datetimepickertp.cpp ('k') | xfa/fwl/theme/listboxtp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698