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

Side by Side Diff: xfa/fwl/lightwidget/cfwl_scrollbar.cpp

Issue 1834323003: Move xfa/include/fwl/{theme,lightwidget} to xfa/fwl (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months 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/include/fwl/lightwidget/scrollbar.h" 7 #include "xfa/fwl/lightwidget/cfwl_scrollbar.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "xfa/fwl/basewidget/ifwl_scrollbar.h" 11 #include "xfa/fwl/basewidget/ifwl_scrollbar.h"
12 12
13 CFWL_ScrollBar* CFWL_ScrollBar::Create() { 13 CFWL_ScrollBar* CFWL_ScrollBar::Create() {
14 return new CFWL_ScrollBar; 14 return new CFWL_ScrollBar;
15 } 15 }
16
17 CFWL_ScrollBar::CFWL_ScrollBar() {}
18
19 CFWL_ScrollBar::~CFWL_ScrollBar() {}
20
16 FWL_ERR CFWL_ScrollBar::Initialize(const CFWL_WidgetProperties* pProperties) { 21 FWL_ERR CFWL_ScrollBar::Initialize(const CFWL_WidgetProperties* pProperties) {
17 if (m_pIface) 22 if (m_pIface)
18 return FWL_ERR_Indefinite; 23 return FWL_ERR_Indefinite;
19 if (pProperties) { 24 if (pProperties) {
20 *m_pProperties = *pProperties; 25 *m_pProperties = *pProperties;
21 } 26 }
22 std::unique_ptr<IFWL_ScrollBar> pScrollBar(IFWL_ScrollBar::Create( 27 std::unique_ptr<IFWL_ScrollBar> pScrollBar(IFWL_ScrollBar::Create(
23 m_pProperties->MakeWidgetImpProperties(nullptr), nullptr)); 28 m_pProperties->MakeWidgetImpProperties(nullptr), nullptr));
24 FWL_ERR ret = pScrollBar->Initialize(); 29 FWL_ERR ret = pScrollBar->Initialize();
25 if (ret != FWL_ERR_Succeeded) { 30 if (ret != FWL_ERR_Succeeded) {
26 return ret; 31 return ret;
27 } 32 }
28 m_pIface = pScrollBar.release(); 33 m_pIface = pScrollBar.release();
29 CFWL_Widget::Initialize(); 34 CFWL_Widget::Initialize();
30 return FWL_ERR_Succeeded; 35 return FWL_ERR_Succeeded;
31 } 36 }
37
32 FX_BOOL CFWL_ScrollBar::IsVertical() { 38 FX_BOOL CFWL_ScrollBar::IsVertical() {
33 if (!m_pIface) 39 if (!m_pIface)
34 return FALSE; 40 return FALSE;
35 return static_cast<IFWL_ScrollBar*>(m_pIface)->IsVertical(); 41 return static_cast<IFWL_ScrollBar*>(m_pIface)->IsVertical();
36 } 42 }
43
37 FWL_ERR CFWL_ScrollBar::GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax) { 44 FWL_ERR CFWL_ScrollBar::GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax) {
38 if (!m_pIface) 45 if (!m_pIface)
39 return FWL_ERR_Indefinite; 46 return FWL_ERR_Indefinite;
40 return static_cast<IFWL_ScrollBar*>(m_pIface)->GetRange(fMin, fMax); 47 return static_cast<IFWL_ScrollBar*>(m_pIface)->GetRange(fMin, fMax);
41 } 48 }
49
42 FWL_ERR CFWL_ScrollBar::SetRange(FX_FLOAT fMin, FX_FLOAT fMax) { 50 FWL_ERR CFWL_ScrollBar::SetRange(FX_FLOAT fMin, FX_FLOAT fMax) {
43 if (!m_pIface) 51 if (!m_pIface)
44 return FWL_ERR_Indefinite; 52 return FWL_ERR_Indefinite;
45 return static_cast<IFWL_ScrollBar*>(m_pIface)->SetRange(fMin, fMax); 53 return static_cast<IFWL_ScrollBar*>(m_pIface)->SetRange(fMin, fMax);
46 } 54 }
55
47 FX_FLOAT CFWL_ScrollBar::GetPageSize() { 56 FX_FLOAT CFWL_ScrollBar::GetPageSize() {
48 if (!m_pIface) 57 if (!m_pIface)
49 return 0; 58 return 0;
50 return static_cast<IFWL_ScrollBar*>(m_pIface)->GetPageSize(); 59 return static_cast<IFWL_ScrollBar*>(m_pIface)->GetPageSize();
51 } 60 }
61
52 FWL_ERR CFWL_ScrollBar::SetPageSize(FX_FLOAT fPageSize) { 62 FWL_ERR CFWL_ScrollBar::SetPageSize(FX_FLOAT fPageSize) {
53 if (!m_pIface) 63 if (!m_pIface)
54 return FWL_ERR_Indefinite; 64 return FWL_ERR_Indefinite;
55 return static_cast<IFWL_ScrollBar*>(m_pIface)->SetPageSize(fPageSize); 65 return static_cast<IFWL_ScrollBar*>(m_pIface)->SetPageSize(fPageSize);
56 } 66 }
67
57 FX_FLOAT CFWL_ScrollBar::GetStepSize() { 68 FX_FLOAT CFWL_ScrollBar::GetStepSize() {
58 if (!m_pIface) 69 if (!m_pIface)
59 return 0; 70 return 0;
60 return static_cast<IFWL_ScrollBar*>(m_pIface)->GetStepSize(); 71 return static_cast<IFWL_ScrollBar*>(m_pIface)->GetStepSize();
61 } 72 }
73
62 FWL_ERR CFWL_ScrollBar::SetStepSize(FX_FLOAT fStepSize) { 74 FWL_ERR CFWL_ScrollBar::SetStepSize(FX_FLOAT fStepSize) {
63 if (!m_pIface) 75 if (!m_pIface)
64 return FWL_ERR_Indefinite; 76 return FWL_ERR_Indefinite;
65 return static_cast<IFWL_ScrollBar*>(m_pIface)->SetStepSize(fStepSize); 77 return static_cast<IFWL_ScrollBar*>(m_pIface)->SetStepSize(fStepSize);
66 } 78 }
79
67 FX_FLOAT CFWL_ScrollBar::GetPos() { 80 FX_FLOAT CFWL_ScrollBar::GetPos() {
68 if (!m_pIface) 81 if (!m_pIface)
69 return -1; 82 return -1;
70 return static_cast<IFWL_ScrollBar*>(m_pIface)->GetPos(); 83 return static_cast<IFWL_ScrollBar*>(m_pIface)->GetPos();
71 } 84 }
85
72 FWL_ERR CFWL_ScrollBar::SetPos(FX_FLOAT fPos) { 86 FWL_ERR CFWL_ScrollBar::SetPos(FX_FLOAT fPos) {
73 if (!m_pIface) 87 if (!m_pIface)
74 return FWL_ERR_Indefinite; 88 return FWL_ERR_Indefinite;
75 return static_cast<IFWL_ScrollBar*>(m_pIface)->SetPos(fPos); 89 return static_cast<IFWL_ScrollBar*>(m_pIface)->SetPos(fPos);
76 } 90 }
91
77 FX_FLOAT CFWL_ScrollBar::GetTrackPos() { 92 FX_FLOAT CFWL_ScrollBar::GetTrackPos() {
78 if (!m_pIface) 93 if (!m_pIface)
79 return -1; 94 return -1;
80 return static_cast<IFWL_ScrollBar*>(m_pIface)->GetTrackPos(); 95 return static_cast<IFWL_ScrollBar*>(m_pIface)->GetTrackPos();
81 } 96 }
97
82 FWL_ERR CFWL_ScrollBar::SetTrackPos(FX_FLOAT fTrackPos) { 98 FWL_ERR CFWL_ScrollBar::SetTrackPos(FX_FLOAT fTrackPos) {
83 if (!m_pIface) 99 if (!m_pIface)
84 return FWL_ERR_Indefinite; 100 return FWL_ERR_Indefinite;
85 return static_cast<IFWL_ScrollBar*>(m_pIface)->SetTrackPos(fTrackPos); 101 return static_cast<IFWL_ScrollBar*>(m_pIface)->SetTrackPos(fTrackPos);
86 } 102 }
103
87 FX_BOOL CFWL_ScrollBar::DoScroll(uint32_t dwCode, FX_FLOAT fPos) { 104 FX_BOOL CFWL_ScrollBar::DoScroll(uint32_t dwCode, FX_FLOAT fPos) {
88 if (!m_pIface) 105 if (!m_pIface)
89 return FALSE; 106 return FALSE;
90 return static_cast<IFWL_ScrollBar*>(m_pIface)->DoScroll(dwCode, fPos); 107 return static_cast<IFWL_ScrollBar*>(m_pIface)->DoScroll(dwCode, fPos);
91 } 108 }
92 CFWL_ScrollBar::CFWL_ScrollBar() {}
93 CFWL_ScrollBar::~CFWL_ScrollBar() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698