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

Side by Side Diff: xfa/fwl/core/ifwl_caret.cpp

Issue 2501033005: Continue fwl/core nit cleanup. (Closed)
Patch Set: Created 4 years, 1 month 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
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/fwl/core/ifwl_caret.h" 7 #include "xfa/fwl/core/ifwl_caret.h"
8 8
9 #include "third_party/base/ptr_util.h" 9 #include "third_party/base/ptr_util.h"
10 #include "xfa/fwl/core/cfwl_themebackground.h" 10 #include "xfa/fwl/core/cfwl_themebackground.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 SetStates(FWL_WGTSTATE_Invisible, !bFlag); 62 SetStates(FWL_WGTSTATE_Invisible, !bFlag);
63 } 63 }
64 64
65 void IFWL_Caret::DrawCaretBK(CFX_Graphics* pGraphics, 65 void IFWL_Caret::DrawCaretBK(CFX_Graphics* pGraphics,
66 IFWL_ThemeProvider* pTheme, 66 IFWL_ThemeProvider* pTheme,
67 const CFX_Matrix* pMatrix) { 67 const CFX_Matrix* pMatrix) {
68 CFX_RectF rect; 68 CFX_RectF rect;
69 GetWidgetRect(rect); 69 GetWidgetRect(rect);
70 rect.Set(0, 0, rect.width, rect.height); 70 rect.Set(0, 0, rect.width, rect.height);
71
72 if (!(m_pProperties->m_dwStates & FWL_STATE_CAT_HightLight))
Tom Sepez 2016/11/15 22:49:32 can this move to line 68?
dsinclair 2016/11/16 15:18:33 Done.
73 return;
74
71 CFWL_ThemeBackground param; 75 CFWL_ThemeBackground param;
72 param.m_pWidget = this; 76 param.m_pWidget = this;
73 param.m_pGraphics = pGraphics; 77 param.m_pGraphics = pGraphics;
74 param.m_rtPart = rect; 78 param.m_rtPart = rect;
75 if (!(m_pProperties->m_dwStates & FWL_STATE_CAT_HightLight))
76 return;
77
78 param.m_iPart = CFWL_Part::Background; 79 param.m_iPart = CFWL_Part::Background;
79 param.m_dwStates = CFWL_PartState_HightLight; 80 param.m_dwStates = CFWL_PartState_HightLight;
80 if (pMatrix) 81 if (pMatrix)
81 param.m_matrix.Concat(*pMatrix); 82 param.m_matrix.Concat(*pMatrix);
82
83 pTheme->DrawBackground(&param); 83 pTheme->DrawBackground(&param);
84 } 84 }
85 85
86 void IFWL_Caret::OnProcessMessage(CFWL_Message* pMessage) {} 86 void IFWL_Caret::OnProcessMessage(CFWL_Message* pMessage) {}
87 87
88 void IFWL_Caret::OnDrawWidget(CFX_Graphics* pGraphics, 88 void IFWL_Caret::OnDrawWidget(CFX_Graphics* pGraphics,
89 const CFX_Matrix* pMatrix) { 89 const CFX_Matrix* pMatrix) {
90 DrawWidget(pGraphics, pMatrix); 90 DrawWidget(pGraphics, pMatrix);
91 } 91 }
92 92
93 IFWL_Caret::Timer::Timer(IFWL_Caret* pCaret) : IFWL_Timer(pCaret) {} 93 IFWL_Caret::Timer::Timer(IFWL_Caret* pCaret) : IFWL_Timer(pCaret) {}
94 94
95 void IFWL_Caret::Timer::Run(IFWL_TimerInfo* pTimerInfo) { 95 void IFWL_Caret::Timer::Run(IFWL_TimerInfo* pTimerInfo) {
96 IFWL_Caret* pCaret = static_cast<IFWL_Caret*>(m_pWidget); 96 IFWL_Caret* pCaret = static_cast<IFWL_Caret*>(m_pWidget);
97 bool toggle = !(pCaret->GetStates() & FWL_STATE_CAT_HightLight); 97 pCaret->SetStates(FWL_STATE_CAT_HightLight,
98 pCaret->SetStates(FWL_STATE_CAT_HightLight, toggle); 98 !(pCaret->GetStates() & FWL_STATE_CAT_HightLight));
99 99
100 CFX_RectF rt; 100 CFX_RectF rt;
101 pCaret->GetWidgetRect(rt); 101 pCaret->GetWidgetRect(rt);
102 rt.Set(0, 0, rt.width + 1, rt.height); 102 rt.Set(0, 0, rt.width + 1, rt.height);
103 pCaret->Repaint(&rt); 103 pCaret->Repaint(&rt);
104 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698