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

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

Issue 2492563002: Continue IFWL cleanup (Closed)
Patch Set: Rebase to master 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
« no previous file with comments | « xfa/fwl/core/ifwl_picturebox.h ('k') | xfa/fwl/core/ifwl_pushbutton.h » ('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/fwl/core/ifwl_picturebox.h" 7 #include "xfa/fwl/core/ifwl_picturebox.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_picturebox.h" 10 #include "xfa/fwl/core/cfwl_picturebox.h"
11 #include "xfa/fwl/core/fwl_noteimp.h" 11 #include "xfa/fwl/core/fwl_noteimp.h"
12 12
13 IFWL_PictureBox::IFWL_PictureBox( 13 IFWL_PictureBox::IFWL_PictureBox(
14 const IFWL_App* app, 14 const IFWL_App* app,
15 std::unique_ptr<CFWL_WidgetProperties> properties) 15 std::unique_ptr<CFWL_WidgetProperties> properties)
16 : IFWL_Widget(app, std::move(properties), nullptr), 16 : IFWL_Widget(app, std::move(properties), nullptr) {
17 m_bTop(false),
18 m_bVCenter(false),
19 m_bButton(false) {
20 m_rtClient.Reset(); 17 m_rtClient.Reset();
21 m_rtImage.Reset(); 18 m_rtImage.Reset();
22 m_matrix.SetIdentity(); 19 m_matrix.SetIdentity();
23 } 20 }
24 21
25 IFWL_PictureBox::~IFWL_PictureBox() {} 22 IFWL_PictureBox::~IFWL_PictureBox() {}
26 23
27 FWL_Type IFWL_PictureBox::GetClassID() const { 24 FWL_Type IFWL_PictureBox::GetClassID() const {
28 return FWL_Type::PictureBox; 25 return FWL_Type::PictureBox;
29 } 26 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 fx = m_rtClient.width; 90 fx = m_rtClient.width;
94 } 91 }
95 if (fy > m_rtClient.height) { 92 if (fy > m_rtClient.height) {
96 fy = m_rtClient.height; 93 fy = m_rtClient.height;
97 } 94 }
98 pGraphics->DrawImage(pPicture, CFX_PointF((m_rtClient.width - fx) / 2, 95 pGraphics->DrawImage(pPicture, CFX_PointF((m_rtClient.width - fx) / 2,
99 (m_rtClient.height - fy) / 2), 96 (m_rtClient.height - fy) / 2),
100 &matrix); 97 &matrix);
101 } 98 }
102 99
103 bool IFWL_PictureBox::VStyle(uint32_t dwStyle) {
104 switch (dwStyle & FWL_STYLEEXT_PTB_VAlignMask) {
105 case FWL_STYLEEXT_PTB_Top:
106 m_bTop = true;
107 return true;
108 case FWL_STYLEEXT_PTB_Vcenter:
109 m_bVCenter = true;
110 return true;
111 case FWL_STYLEEXT_PTB_Bottom:
112 m_bButton = true;
113 return true;
114 }
115 return false;
116 }
117
118 void IFWL_PictureBox::OnDrawWidget(CFX_Graphics* pGraphics, 100 void IFWL_PictureBox::OnDrawWidget(CFX_Graphics* pGraphics,
119 const CFX_Matrix* pMatrix) { 101 const CFX_Matrix* pMatrix) {
120 DrawWidget(pGraphics, pMatrix); 102 DrawWidget(pGraphics, pMatrix);
121 } 103 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/ifwl_picturebox.h ('k') | xfa/fwl/core/ifwl_pushbutton.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698