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

Side by Side Diff: xfa/fxfa/app/xfa_ffcheckbutton.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/fxfa/app/xfa_ffbarcode.cpp ('k') | xfa/fxfa/app/xfa_ffchoicelist.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/fxfa/app/xfa_ffcheckbutton.h" 7 #include "xfa/fxfa/app/xfa_ffcheckbutton.h"
8 8
9 #include "xfa/fwl/core/cfwl_message.h" 9 #include "xfa/fwl/core/cfwl_message.h"
10 #include "xfa/fwl/core/ifwl_notedriver.h" 10 #include "xfa/fwl/core/ifwl_notedriver.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 m_pNormalWidget->UnlockUpdate(); 45 m_pNormalWidget->UnlockUpdate();
46 return CXFA_FFField::LoadWidget(); 46 return CXFA_FFField::LoadWidget();
47 } 47 }
48 void CXFA_FFCheckButton::UpdateWidgetProperty() { 48 void CXFA_FFCheckButton::UpdateWidgetProperty() {
49 CFWL_CheckBox* pCheckBox = (CFWL_CheckBox*)m_pNormalWidget; 49 CFWL_CheckBox* pCheckBox = (CFWL_CheckBox*)m_pNormalWidget;
50 if (!m_pNormalWidget) { 50 if (!m_pNormalWidget) {
51 return; 51 return;
52 } 52 }
53 FX_FLOAT fSize = m_pDataAcc->GetCheckButtonSize(); 53 FX_FLOAT fSize = m_pDataAcc->GetCheckButtonSize();
54 pCheckBox->SetBoxSize(fSize); 54 pCheckBox->SetBoxSize(fSize);
55 FX_DWORD dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCross; 55 uint32_t dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCross;
56 int32_t iCheckMark = m_pDataAcc->GetCheckButtonMark(); 56 int32_t iCheckMark = m_pDataAcc->GetCheckButtonMark();
57 switch (iCheckMark) { 57 switch (iCheckMark) {
58 case XFA_ATTRIBUTEENUM_Check: 58 case XFA_ATTRIBUTEENUM_Check:
59 dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCheck; 59 dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCheck;
60 break; 60 break;
61 case XFA_ATTRIBUTEENUM_Circle: 61 case XFA_ATTRIBUTEENUM_Circle:
62 dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCircle; 62 dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCircle;
63 break; 63 break;
64 case XFA_ATTRIBUTEENUM_Cross: 64 case XFA_ATTRIBUTEENUM_Cross:
65 break; 65 break;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if (m_rtUI.height < fTopAddBottom) { 207 if (m_rtUI.height < fTopAddBottom) {
208 if (iCapPlacement == XFA_ATTRIBUTEENUM_Right) { 208 if (iCapPlacement == XFA_ATTRIBUTEENUM_Right) {
209 m_rtUI.left -= fTopAddBottom - m_rtUI.height; 209 m_rtUI.left -= fTopAddBottom - m_rtUI.height;
210 } 210 }
211 m_rtUI.top -= fTopAddBottom - m_rtUI.height; 211 m_rtUI.top -= fTopAddBottom - m_rtUI.height;
212 m_rtUI.height += 2 * (fTopAddBottom - m_rtUI.height); 212 m_rtUI.height += 2 * (fTopAddBottom - m_rtUI.height);
213 } 213 }
214 } 214 }
215 void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS, 215 void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS,
216 CFX_Matrix* pMatrix, 216 CFX_Matrix* pMatrix,
217 FX_DWORD dwStatus, 217 uint32_t dwStatus,
218 int32_t iRotate) { 218 int32_t iRotate) {
219 if (!IsMatchVisibleStatus(dwStatus)) { 219 if (!IsMatchVisibleStatus(dwStatus)) {
220 return; 220 return;
221 } 221 }
222 CFX_Matrix mtRotate; 222 CFX_Matrix mtRotate;
223 GetRotateMatrix(mtRotate); 223 GetRotateMatrix(mtRotate);
224 if (pMatrix) { 224 if (pMatrix) {
225 mtRotate.Concat(*pMatrix); 225 mtRotate.Concat(*pMatrix);
226 } 226 }
227 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); 227 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus);
228 CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); 228 CXFA_Border borderUI = m_pDataAcc->GetUIBorder();
229 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate, 229 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate,
230 m_pDataAcc->GetCheckButtonShape() == XFA_ATTRIBUTEENUM_Round 230 m_pDataAcc->GetCheckButtonShape() == XFA_ATTRIBUTEENUM_Round
231 ? XFA_DRAWBOX_ForceRound 231 ? XFA_DRAWBOX_ForceRound
232 : 0); 232 : 0);
233 RenderCaption(pGS, &mtRotate); 233 RenderCaption(pGS, &mtRotate);
234 DrawHighlight(pGS, &mtRotate, dwStatus, 234 DrawHighlight(pGS, &mtRotate, dwStatus,
235 m_pDataAcc->GetCheckButtonShape() == XFA_ATTRIBUTEENUM_Round); 235 m_pDataAcc->GetCheckButtonShape() == XFA_ATTRIBUTEENUM_Round);
236 CFX_Matrix mt; 236 CFX_Matrix mt;
237 mt.Set(1, 0, 0, 1, m_rtCheckBox.left, m_rtCheckBox.top); 237 mt.Set(1, 0, 0, 1, m_rtCheckBox.left, m_rtCheckBox.top);
238 mt.Concat(mtRotate); 238 mt.Concat(mtRotate);
239 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), 239 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(),
240 pGS, &mt); 240 pGS, &mt);
241 } 241 }
242 FX_BOOL CXFA_FFCheckButton::OnLButtonUp(FX_DWORD dwFlags, 242 FX_BOOL CXFA_FFCheckButton::OnLButtonUp(uint32_t dwFlags,
243 FX_FLOAT fx, 243 FX_FLOAT fx,
244 FX_FLOAT fy) { 244 FX_FLOAT fy) {
245 if (!m_pNormalWidget) { 245 if (!m_pNormalWidget) {
246 return FALSE; 246 return FALSE;
247 } 247 }
248 if (!IsButtonDown()) { 248 if (!IsButtonDown()) {
249 return FALSE; 249 return FALSE;
250 } 250 }
251 SetButtonDown(FALSE); 251 SetButtonDown(FALSE);
252 CFWL_MsgMouse ms; 252 CFWL_MsgMouse ms;
253 ms.m_dwCmd = FWL_MSGMOUSECMD_LButtonUp; 253 ms.m_dwCmd = FWL_MSGMOUSECMD_LButtonUp;
254 ms.m_dwFlags = dwFlags; 254 ms.m_dwFlags = dwFlags;
255 ms.m_fx = fx; 255 ms.m_fx = fx;
256 ms.m_fy = fy; 256 ms.m_fy = fy;
257 FWLToClient(ms.m_fx, ms.m_fy); 257 FWLToClient(ms.m_fx, ms.m_fy);
258 ms.m_pDstTarget = m_pNormalWidget->m_pIface; 258 ms.m_pDstTarget = m_pNormalWidget->m_pIface;
259 TranslateFWLMessage(&ms); 259 TranslateFWLMessage(&ms);
260 return TRUE; 260 return TRUE;
261 } 261 }
262 XFA_CHECKSTATE CXFA_FFCheckButton::FWLState2XFAState() { 262 XFA_CHECKSTATE CXFA_FFCheckButton::FWLState2XFAState() {
263 XFA_CHECKSTATE eCheckState = XFA_CHECKSTATE_Off; 263 XFA_CHECKSTATE eCheckState = XFA_CHECKSTATE_Off;
264 FX_DWORD dwState = m_pNormalWidget->GetStates(); 264 uint32_t dwState = m_pNormalWidget->GetStates();
265 if (dwState & FWL_STATE_CKB_Checked) { 265 if (dwState & FWL_STATE_CKB_Checked) {
266 eCheckState = XFA_CHECKSTATE_On; 266 eCheckState = XFA_CHECKSTATE_On;
267 } else if (dwState & FWL_STATE_CKB_Neutral) { 267 } else if (dwState & FWL_STATE_CKB_Neutral) {
268 eCheckState = XFA_CHECKSTATE_Neutral; 268 eCheckState = XFA_CHECKSTATE_Neutral;
269 } 269 }
270 return eCheckState; 270 return eCheckState;
271 } 271 }
272 FX_BOOL CXFA_FFCheckButton::CommitData() { 272 FX_BOOL CXFA_FFCheckButton::CommitData() {
273 XFA_CHECKSTATE eCheckState = FWLState2XFAState(); 273 XFA_CHECKSTATE eCheckState = FWLState2XFAState();
274 m_pDataAcc->SetCheckState(eCheckState, TRUE); 274 m_pDataAcc->SetCheckState(eCheckState, TRUE);
(...skipping 18 matching lines...) Expand all
293 XFA_CHECKSTATE eState = m_pDataAcc->GetCheckState(); 293 XFA_CHECKSTATE eState = m_pDataAcc->GetCheckState();
294 SetFWLCheckState(eState); 294 SetFWLCheckState(eState);
295 m_pNormalWidget->Update(); 295 m_pNormalWidget->Update();
296 return TRUE; 296 return TRUE;
297 } 297 }
298 int32_t CXFA_FFCheckButton::OnProcessMessage(CFWL_Message* pMessage) { 298 int32_t CXFA_FFCheckButton::OnProcessMessage(CFWL_Message* pMessage) {
299 return m_pOldDelegate->OnProcessMessage(pMessage); 299 return m_pOldDelegate->OnProcessMessage(pMessage);
300 } 300 }
301 FWL_ERR CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) { 301 FWL_ERR CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) {
302 CXFA_FFField::OnProcessEvent(pEvent); 302 CXFA_FFField::OnProcessEvent(pEvent);
303 FX_DWORD dwEventID = pEvent->GetClassID(); 303 uint32_t dwEventID = pEvent->GetClassID();
304 switch (dwEventID) { 304 switch (dwEventID) {
305 case FWL_EVTHASH_CKB_CheckStateChanged: { 305 case FWL_EVTHASH_CKB_CheckStateChanged: {
306 CXFA_EventParam eParam; 306 CXFA_EventParam eParam;
307 eParam.m_eType = XFA_EVENT_Change; 307 eParam.m_eType = XFA_EVENT_Change;
308 m_pDataAcc->GetValue(eParam.m_wsNewText, XFA_VALUEPICTURE_Raw); 308 m_pDataAcc->GetValue(eParam.m_wsNewText, XFA_VALUEPICTURE_Raw);
309 CXFA_WidgetAcc* pFFExclGroup = m_pDataAcc->GetExclGroup(); 309 CXFA_WidgetAcc* pFFExclGroup = m_pDataAcc->GetExclGroup();
310 if (ProcessCommittedData()) { 310 if (ProcessCommittedData()) {
311 eParam.m_pTarget = pFFExclGroup; 311 eParam.m_pTarget = pFFExclGroup;
312 if (pFFExclGroup) { 312 if (pFFExclGroup) {
313 m_pDocView->AddValidateWidget(pFFExclGroup); 313 m_pDocView->AddValidateWidget(pFFExclGroup);
(...skipping 14 matching lines...) Expand all
328 break; 328 break;
329 } 329 }
330 default: {} 330 default: {}
331 } 331 }
332 return m_pOldDelegate->OnProcessEvent(pEvent); 332 return m_pOldDelegate->OnProcessEvent(pEvent);
333 } 333 }
334 FWL_ERR CXFA_FFCheckButton::OnDrawWidget(CFX_Graphics* pGraphics, 334 FWL_ERR CXFA_FFCheckButton::OnDrawWidget(CFX_Graphics* pGraphics,
335 const CFX_Matrix* pMatrix) { 335 const CFX_Matrix* pMatrix) {
336 return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); 336 return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
337 } 337 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffbarcode.cpp ('k') | xfa/fxfa/app/xfa_ffchoicelist.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698