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 #include "xfa/fxfa/include/xfa_ffwidget.h" | 7 #include "xfa/fxfa/include/xfa_ffwidget.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 m_pDocView->AddInvalidateRect(m_pPageView, rtWidget); | 165 m_pDocView->AddInvalidateRect(m_pPageView, rtWidget); |
166 } | 166 } |
167 FX_BOOL CXFA_FFWidget::GetCaptionText(CFX_WideString& wsCap) { | 167 FX_BOOL CXFA_FFWidget::GetCaptionText(CFX_WideString& wsCap) { |
168 CXFA_TextLayout* pCapTextlayout = m_pDataAcc->GetCaptionTextLayout(); | 168 CXFA_TextLayout* pCapTextlayout = m_pDataAcc->GetCaptionTextLayout(); |
169 if (!pCapTextlayout) { | 169 if (!pCapTextlayout) { |
170 return FALSE; | 170 return FALSE; |
171 } | 171 } |
172 pCapTextlayout->GetText(wsCap); | 172 pCapTextlayout->GetText(wsCap); |
173 return TRUE; | 173 return TRUE; |
174 } | 174 } |
175 FX_BOOL CXFA_FFWidget::IsFocused() { | 175 FX_BOOL CXFA_FFWidget::IsFocused() { |
dsinclair
2016/05/04 13:11:51
nit: Can these return bool (possibly in a followup
Tom Sepez
2016/05/04 20:21:26
This one yes, the others have overrides .
| |
176 return m_dwStatus & XFA_WIDGETSTATUS_Focused; | 176 return !!(m_dwStatus & XFA_WIDGETSTATUS_Focused); |
177 } | 177 } |
178 FX_BOOL CXFA_FFWidget::OnMouseEnter() { | 178 FX_BOOL CXFA_FFWidget::OnMouseEnter() { |
179 return FALSE; | 179 return FALSE; |
180 } | 180 } |
181 FX_BOOL CXFA_FFWidget::OnMouseExit() { | 181 FX_BOOL CXFA_FFWidget::OnMouseExit() { |
182 return FALSE; | 182 return FALSE; |
183 } | 183 } |
184 FX_BOOL CXFA_FFWidget::OnLButtonDown(uint32_t dwFlags, | 184 FX_BOOL CXFA_FFWidget::OnLButtonDown(uint32_t dwFlags, |
185 FX_FLOAT fx, | 185 FX_FLOAT fx, |
186 FX_FLOAT fy) { | 186 FX_FLOAT fy) { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
393 void CXFA_FFWidget::GetMinMaxHeight(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight) { | 393 void CXFA_FFWidget::GetMinMaxHeight(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight) { |
394 fMinHeight = fMaxHeight = 0; | 394 fMinHeight = fMaxHeight = 0; |
395 FX_FLOAT fHeight = 0; | 395 FX_FLOAT fHeight = 0; |
396 if (m_pDataAcc->GetHeight(fHeight)) { | 396 if (m_pDataAcc->GetHeight(fHeight)) { |
397 fMinHeight = fMaxHeight = fHeight; | 397 fMinHeight = fMaxHeight = fHeight; |
398 } else { | 398 } else { |
399 m_pDataAcc->GetMinHeight(fMinHeight); | 399 m_pDataAcc->GetMinHeight(fMinHeight); |
400 m_pDataAcc->GetMaxHeight(fMaxHeight); | 400 m_pDataAcc->GetMaxHeight(fMaxHeight); |
401 } | 401 } |
402 } | 402 } |
403 FX_BOOL CXFA_FFWidget::IsMatchVisibleStatus(uint32_t dwStatus) { | 403 FX_BOOL CXFA_FFWidget::IsMatchVisibleStatus(uint32_t dwStatus) { |
dsinclair
2016/05/04 13:11:51
nit: bool?
Tom Sepez
2016/05/04 20:21:26
Done.
| |
404 return m_dwStatus & XFA_WIDGETSTATUS_Visible; | 404 return !!(m_dwStatus & XFA_WIDGETSTATUS_Visible); |
405 } | 405 } |
406 void CXFA_FFWidget::EventKillFocus() { | 406 void CXFA_FFWidget::EventKillFocus() { |
407 if (m_dwStatus & XFA_WIDGETSTATUS_Access) { | 407 if (m_dwStatus & XFA_WIDGETSTATUS_Access) { |
408 m_dwStatus &= ~XFA_WIDGETSTATUS_Access; | 408 m_dwStatus &= ~XFA_WIDGETSTATUS_Access; |
409 return; | 409 return; |
410 } | 410 } |
411 CXFA_EventParam eParam; | 411 CXFA_EventParam eParam; |
412 eParam.m_eType = XFA_EVENT_Exit; | 412 eParam.m_eType = XFA_EVENT_Exit; |
413 eParam.m_pTarget = m_pDataAcc; | 413 eParam.m_pTarget = m_pDataAcc; |
414 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Exit, &eParam); | 414 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Exit, &eParam); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
664 void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, | 664 void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, |
665 int left, | 665 int left, |
666 int top, | 666 int top, |
667 FX_ARGB mask_argb, | 667 FX_ARGB mask_argb, |
668 int bitmap_alpha, | 668 int bitmap_alpha, |
669 int blend_mode, | 669 int blend_mode, |
670 int Transparency) { | 670 int Transparency) { |
671 if (pDIBitmap == NULL) { | 671 if (pDIBitmap == NULL) { |
672 return; | 672 return; |
673 } | 673 } |
674 FX_BOOL bIsolated = Transparency & PDFTRANS_ISOLATED; | 674 bool bIsolated = !!(Transparency & PDFTRANS_ISOLATED); |
675 FX_BOOL bGroup = Transparency & PDFTRANS_GROUP; | 675 bool bGroup = !!(Transparency & PDFTRANS_GROUP); |
676 if (blend_mode == FXDIB_BLEND_NORMAL) { | 676 if (blend_mode == FXDIB_BLEND_NORMAL) { |
677 if (!pDIBitmap->IsAlphaMask()) { | 677 if (!pDIBitmap->IsAlphaMask()) { |
678 if (bitmap_alpha < 255) { | 678 if (bitmap_alpha < 255) { |
679 pDIBitmap->MultiplyAlpha(bitmap_alpha); | 679 pDIBitmap->MultiplyAlpha(bitmap_alpha); |
680 } | 680 } |
681 if (m_pDevice->SetDIBits(pDIBitmap, left, top)) { | 681 if (m_pDevice->SetDIBits(pDIBitmap, left, top)) { |
682 return; | 682 return; |
683 } | 683 } |
684 } else { | 684 } else { |
685 uint32_t fill_argb = (mask_argb); | 685 uint32_t fill_argb = (mask_argb); |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1955 iType != XFA_ELEMENT_Rectangle) { | 1955 iType != XFA_ELEMENT_Rectangle) { |
1956 return; | 1956 return; |
1957 } | 1957 } |
1958 CXFA_StrokeArray strokes; | 1958 CXFA_StrokeArray strokes; |
1959 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { | 1959 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { |
1960 box.GetStrokes(strokes); | 1960 box.GetStrokes(strokes); |
1961 } | 1961 } |
1962 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 1962 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
1963 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 1963 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
1964 } | 1964 } |
OLD | NEW |