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

Side by Side Diff: xfa/fwl/core/cfwl_form.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/fwl/core/cfwl_form.h" 7 #include "xfa/fwl/core/cfwl_form.h"
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 22 matching lines...) Expand all
33 } // namespace 33 } // namespace
34 34
35 namespace { 35 namespace {
36 36
37 const uint8_t kCornerEnlarge = 10; 37 const uint8_t kCornerEnlarge = 10;
38 38
39 } // namespace 39 } // namespace
40 40
41 CFWL_Form::CFWL_Form(const CFWL_App* app, 41 CFWL_Form::CFWL_Form(const CFWL_App* app,
42 std::unique_ptr<CFWL_WidgetProperties> properties, 42 std::unique_ptr<CFWL_WidgetProperties> properties,
43 IFWL_Widget* pOuter) 43 CFWL_Widget* pOuter)
44 : IFWL_Widget(app, std::move(properties), pOuter), 44 : CFWL_Widget(app, std::move(properties), pOuter),
45 #if (_FX_OS_ == _FX_MACOSX_) 45 #if (_FX_OS_ == _FX_MACOSX_)
46 m_bMouseIn(false), 46 m_bMouseIn(false),
47 #endif 47 #endif
48 m_pCloseBox(nullptr), 48 m_pCloseBox(nullptr),
49 m_pMinBox(nullptr), 49 m_pMinBox(nullptr),
50 m_pMaxBox(nullptr), 50 m_pMaxBox(nullptr),
51 m_pSubFocus(nullptr), 51 m_pSubFocus(nullptr),
52 m_fCXBorder(0), 52 m_fCXBorder(0),
53 m_fCYBorder(0), 53 m_fCYBorder(0),
54 m_iCaptureBtn(-1), 54 m_iCaptureBtn(-1),
(...skipping 15 matching lines...) Expand all
70 RemoveSysButtons(); 70 RemoveSysButtons();
71 } 71 }
72 72
73 FWL_Type CFWL_Form::GetClassID() const { 73 FWL_Type CFWL_Form::GetClassID() const {
74 return FWL_Type::Form; 74 return FWL_Type::Form;
75 } 75 }
76 76
77 bool CFWL_Form::IsInstance(const CFX_WideStringC& wsClass) const { 77 bool CFWL_Form::IsInstance(const CFX_WideStringC& wsClass) const {
78 if (wsClass == CFX_WideStringC(FWL_CLASS_Form)) 78 if (wsClass == CFX_WideStringC(FWL_CLASS_Form))
79 return true; 79 return true;
80 return IFWL_Widget::IsInstance(wsClass); 80 return CFWL_Widget::IsInstance(wsClass);
81 } 81 }
82 82
83 void CFWL_Form::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { 83 void CFWL_Form::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
84 if (!bAutoSize) { 84 if (!bAutoSize) {
85 rect = m_pProperties->m_rtWidget; 85 rect = m_pProperties->m_rtWidget;
86 return; 86 return;
87 } 87 }
88 88
89 rect.Reset(); 89 rect.Reset();
90 FX_FLOAT fCXBorder = GetBorderSize(true); 90 FX_FLOAT fCXBorder = GetBorderSize(true);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (m_pMinBox) { 260 if (m_pMinBox) {
261 param.m_iPart = CFWL_Part::MinimizeBox; 261 param.m_iPart = CFWL_Part::MinimizeBox;
262 param.m_dwStates = m_pMinBox->GetPartState(); 262 param.m_dwStates = m_pMinBox->GetPartState();
263 param.m_rtPart = m_pMinBox->m_rtBtn; 263 param.m_rtPart = m_pMinBox->m_rtBtn;
264 pTheme->DrawBackground(&param); 264 pTheme->DrawBackground(&param);
265 } 265 }
266 } 266 }
267 #endif 267 #endif
268 } 268 }
269 269
270 IFWL_Widget* CFWL_Form::DoModal() { 270 CFWL_Widget* CFWL_Form::DoModal() {
271 const CFWL_App* pApp = GetOwnerApp(); 271 const CFWL_App* pApp = GetOwnerApp();
272 if (!pApp) 272 if (!pApp)
273 return nullptr; 273 return nullptr;
274 274
275 CFWL_NoteDriver* pDriver = pApp->GetNoteDriver(); 275 CFWL_NoteDriver* pDriver = pApp->GetNoteDriver();
276 if (!pDriver) 276 if (!pDriver)
277 return nullptr; 277 return nullptr;
278 278
279 m_pNoteLoop = pdfium::MakeUnique<CFWL_NoteLoop>(); 279 m_pNoteLoop = pdfium::MakeUnique<CFWL_NoteLoop>();
280 m_pNoteLoop->SetMainForm(this); 280 m_pNoteLoop->SetMainForm(this);
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) { 630 HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) {
631 if (m_bMaximized) 631 if (m_bMaximized)
632 SetWidgetRect(m_rtRestore); 632 SetWidgetRect(m_rtRestore);
633 else 633 else
634 SetWorkAreaRect(); 634 SetWorkAreaRect();
635 635
636 Update(); 636 Update();
637 m_bMaximized = !m_bMaximized; 637 m_bMaximized = !m_bMaximized;
638 } 638 }
639 } 639 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698