OLD | NEW |
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_widget.h" | 7 #include "xfa/fwl/core/cfwl_widget.h" |
8 | 8 |
9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
10 #include "xfa/fwl/core/cfwl_themetext.h" | 10 #include "xfa/fwl/core/cfwl_themetext.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 | 32 |
33 IFWL_Widget* CFWL_Widget::GetWidget() { | 33 IFWL_Widget* CFWL_Widget::GetWidget() { |
34 return m_pIface.get(); | 34 return m_pIface.get(); |
35 } | 35 } |
36 | 36 |
37 const IFWL_Widget* CFWL_Widget::GetWidget() const { | 37 const IFWL_Widget* CFWL_Widget::GetWidget() const { |
38 return m_pIface.get(); | 38 return m_pIface.get(); |
39 } | 39 } |
40 | 40 |
41 FWL_Error CFWL_Widget::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { | 41 void CFWL_Widget::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { |
42 if (!m_pIface) | 42 if (m_pIface) |
43 return FWL_Error::Indefinite; | 43 m_pIface->GetWidgetRect(rect, bAutoSize); |
44 return m_pIface->GetWidgetRect(rect, bAutoSize); | |
45 } | 44 } |
46 | 45 |
47 FWL_Error CFWL_Widget::GetGlobalRect(CFX_RectF& rect) { | 46 void CFWL_Widget::GetGlobalRect(CFX_RectF& rect) { |
48 if (!m_pIface) | 47 if (m_pIface) |
49 return FWL_Error::Indefinite; | 48 m_pIface->GetGlobalRect(rect); |
50 return m_pIface->GetGlobalRect(rect); | |
51 } | 49 } |
52 | 50 |
53 FWL_Error CFWL_Widget::SetWidgetRect(const CFX_RectF& rect) { | 51 void CFWL_Widget::SetWidgetRect(const CFX_RectF& rect) { |
54 if (!m_pIface) | 52 if (m_pIface) |
55 return FWL_Error::Indefinite; | 53 m_pIface->SetWidgetRect(rect); |
56 return m_pIface->SetWidgetRect(rect); | |
57 } | 54 } |
58 | 55 |
59 FWL_Error CFWL_Widget::GetClientRect(CFX_RectF& rect) { | 56 void CFWL_Widget::GetClientRect(CFX_RectF& rect) { |
60 if (!m_pIface) | 57 if (m_pIface) |
61 return FWL_Error::Indefinite; | 58 m_pIface->GetClientRect(rect); |
62 return m_pIface->GetClientRect(rect); | |
63 } | 59 } |
64 | 60 |
65 FWL_Error CFWL_Widget::ModifyStyles(uint32_t dwStylesAdded, | 61 void CFWL_Widget::ModifyStyles(uint32_t dwStylesAdded, |
66 uint32_t dwStylesRemoved) { | 62 uint32_t dwStylesRemoved) { |
67 if (!m_pIface) | 63 if (m_pIface) |
68 return FWL_Error::Indefinite; | 64 m_pIface->ModifyStyles(dwStylesAdded, dwStylesRemoved); |
69 return m_pIface->ModifyStyles(dwStylesAdded, dwStylesRemoved); | |
70 } | 65 } |
71 | 66 |
72 uint32_t CFWL_Widget::GetStylesEx() { | 67 uint32_t CFWL_Widget::GetStylesEx() { |
73 if (!m_pIface) | 68 if (!m_pIface) |
74 return 0; | 69 return 0; |
75 return m_pIface->GetStylesEx(); | 70 return m_pIface->GetStylesEx(); |
76 } | 71 } |
77 | 72 |
78 FWL_Error CFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded, | 73 void CFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded, |
79 uint32_t dwStylesExRemoved) { | 74 uint32_t dwStylesExRemoved) { |
80 return m_pIface->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); | 75 m_pIface->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); |
81 } | 76 } |
82 | 77 |
83 uint32_t CFWL_Widget::GetStates() { | 78 uint32_t CFWL_Widget::GetStates() { |
84 return m_pIface ? m_pIface->GetStates() : 0; | 79 return m_pIface ? m_pIface->GetStates() : 0; |
85 } | 80 } |
86 | 81 |
87 void CFWL_Widget::SetStates(uint32_t dwStates, bool bSet) { | 82 void CFWL_Widget::SetStates(uint32_t dwStates, bool bSet) { |
88 if (m_pIface) | 83 if (m_pIface) |
89 m_pIface->SetStates(dwStates, bSet); | 84 m_pIface->SetStates(dwStates, bSet); |
90 } | 85 } |
(...skipping 20 matching lines...) Expand all Loading... |
111 return; | 106 return; |
112 m_pIface->UnlockUpdate(); | 107 m_pIface->UnlockUpdate(); |
113 } | 108 } |
114 | 109 |
115 FWL_WidgetHit CFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 110 FWL_WidgetHit CFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
116 if (!m_pIface) | 111 if (!m_pIface) |
117 return FWL_WidgetHit::Unknown; | 112 return FWL_WidgetHit::Unknown; |
118 return m_pIface->HitTest(fx, fy); | 113 return m_pIface->HitTest(fx, fy); |
119 } | 114 } |
120 | 115 |
121 FWL_Error CFWL_Widget::DrawWidget(CFX_Graphics* pGraphics, | 116 void CFWL_Widget::DrawWidget(CFX_Graphics* pGraphics, |
122 const CFX_Matrix* pMatrix) { | 117 const CFX_Matrix* pMatrix) { |
123 if (!m_pIface) | 118 if (m_pIface) |
124 return FWL_Error::Indefinite; | 119 m_pIface->DrawWidget(pGraphics, pMatrix); |
125 return m_pIface->DrawWidget(pGraphics, pMatrix); | |
126 } | 120 } |
127 | 121 |
128 IFWL_WidgetDelegate* CFWL_Widget::GetDelegate() const { | 122 IFWL_WidgetDelegate* CFWL_Widget::GetDelegate() const { |
129 return m_pIface ? m_pIface->GetDelegate() : nullptr; | 123 return m_pIface ? m_pIface->GetDelegate() : nullptr; |
130 } | 124 } |
131 | 125 |
132 void CFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) { | 126 void CFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) { |
133 if (m_pIface) | 127 if (m_pIface) |
134 m_pIface->SetDelegate(pDelegate); | 128 m_pIface->SetDelegate(pDelegate); |
135 } | 129 } |
OLD | NEW |