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

Side by Side Diff: xfa/fxfa/app/xfa_ffpushbutton.cpp

Issue 2524173002: Merge IFWL and CFWL classes. (Closed)
Patch Set: make chrome build happy Created 4 years 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/fxfa/app/xfa_ffpushbutton.h" 7 #include "xfa/fxfa/app/xfa_ffpushbutton.h"
8 8
9 #include "xfa/fwl/core/cfwl_notedriver.h" 9 #include "xfa/fwl/core/cfwl_notedriver.h"
10 #include "xfa/fwl/core/cfwl_pushbutton.h" 10 #include "xfa/fwl/core/cfwl_pushbutton.h"
(...skipping 29 matching lines...) Expand all
40 if (pMatrix) { 40 if (pMatrix) {
41 mtRotate.Concat(*pMatrix); 41 mtRotate.Concat(*pMatrix);
42 } 42 }
43 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); 43 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus);
44 RenderHighlightCaption(pGS, &mtRotate); 44 RenderHighlightCaption(pGS, &mtRotate);
45 CFX_RectF rtWidget; 45 CFX_RectF rtWidget;
46 GetRectWithoutRotate(rtWidget); 46 GetRectWithoutRotate(rtWidget);
47 CFX_Matrix mt; 47 CFX_Matrix mt;
48 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); 48 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top);
49 mt.Concat(mtRotate); 49 mt.Concat(mtRotate);
50 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), 50 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget, pGS, &mt);
51 pGS, &mt);
52 } 51 }
53 bool CXFA_FFPushButton::LoadWidget() { 52 bool CXFA_FFPushButton::LoadWidget() {
54 ASSERT(!m_pNormalWidget); 53 ASSERT(!m_pNormalWidget);
55 CFWL_PushButton* pPushButton = new CFWL_PushButton(GetFWLApp()); 54 CFWL_PushButton* pPushButton = new CFWL_PushButton(GetFWLApp());
56 pPushButton->Initialize();
57
58 m_pOldDelegate = pPushButton->GetDelegate(); 55 m_pOldDelegate = pPushButton->GetDelegate();
59 pPushButton->SetDelegate(this); 56 pPushButton->SetDelegate(this);
60 57
61 m_pNormalWidget = pPushButton; 58 m_pNormalWidget = pPushButton;
62 m_pNormalWidget->SetLayoutItem(this); 59 m_pNormalWidget->SetLayoutItem(this);
63 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); 60
64 CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); 61 CFWL_NoteDriver* pNoteDriver =
65 pNoteDriver->RegisterEventTarget(pWidget, pWidget); 62 m_pNormalWidget->GetOwnerApp()->GetNoteDriver();
63 pNoteDriver->RegisterEventTarget(m_pNormalWidget, m_pNormalWidget);
66 m_pNormalWidget->LockUpdate(); 64 m_pNormalWidget->LockUpdate();
67 UpdateWidgetProperty(); 65 UpdateWidgetProperty();
68 LoadHighlightCaption(); 66 LoadHighlightCaption();
69 m_pNormalWidget->UnlockUpdate(); 67 m_pNormalWidget->UnlockUpdate();
70 return CXFA_FFField::LoadWidget(); 68 return CXFA_FFField::LoadWidget();
71 } 69 }
72 void CXFA_FFPushButton::UpdateWidgetProperty() { 70 void CXFA_FFPushButton::UpdateWidgetProperty() {
73 uint32_t dwStyleEx = 0; 71 uint32_t dwStyleEx = 0;
74 switch (m_pDataAcc->GetButtonHighlight()) { 72 switch (m_pDataAcc->GetButtonHighlight()) {
75 case XFA_ATTRIBUTEENUM_Inverted: 73 case XFA_ATTRIBUTEENUM_Inverted:
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 pGraphics->SetLineWidth(fLineWidth); 236 pGraphics->SetLineWidth(fLineWidth);
239 CFX_Path path; 237 CFX_Path path;
240 path.Create(); 238 path.Create();
241 CFX_RectF rect; 239 CFX_RectF rect;
242 m_pNormalWidget->GetWidgetRect(rect); 240 m_pNormalWidget->GetWidgetRect(rect);
243 path.AddRectangle(0, 0, rect.width, rect.height); 241 path.AddRectangle(0, 0, rect.width, rect.height);
244 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); 242 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix);
245 } 243 }
246 } 244 }
247 } 245 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698