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

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

Issue 1952693003: Convert FWL_ERR into an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « xfa/fwl/core/fwl_widgetimp.h ('k') | xfa/fwl/core/fwl_widgetmgrimp.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/fwl_widgetimp.h" 7 #include "xfa/fwl/core/fwl_widgetimp.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "xfa/fwl/core/ifwl_app.h" 21 #include "xfa/fwl/core/ifwl_app.h"
22 #include "xfa/fwl/core/ifwl_form.h" 22 #include "xfa/fwl/core/ifwl_form.h"
23 #include "xfa/fwl/core/ifwl_themeprovider.h" 23 #include "xfa/fwl/core/ifwl_themeprovider.h"
24 #include "xfa/fxfa/include/xfa_ffapp.h" 24 #include "xfa/fxfa/include/xfa_ffapp.h"
25 25
26 #define FWL_CLASSHASH_Menu 3957949655 26 #define FWL_CLASSHASH_Menu 3957949655
27 #define FWL_STYLEEXT_MNU_Vert (1L << 0) 27 #define FWL_STYLEEXT_MNU_Vert (1L << 0)
28 28
29 IFWL_Widget::~IFWL_Widget() {} 29 IFWL_Widget::~IFWL_Widget() {}
30 30
31 FWL_ERR IFWL_Widget::GetClassName(CFX_WideString& wsClass) const { 31 FWL_Error IFWL_Widget::GetClassName(CFX_WideString& wsClass) const {
32 return m_pImpl->GetClassName(wsClass); 32 return m_pImpl->GetClassName(wsClass);
33 } 33 }
34 34
35 uint32_t IFWL_Widget::GetClassID() const { 35 uint32_t IFWL_Widget::GetClassID() const {
36 return m_pImpl->GetClassID(); 36 return m_pImpl->GetClassID();
37 } 37 }
38 38
39 FX_BOOL IFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const { 39 FX_BOOL IFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const {
40 return m_pImpl->IsInstance(wsClass); 40 return m_pImpl->IsInstance(wsClass);
41 } 41 }
42 42
43 FWL_ERR IFWL_Widget::Initialize() { 43 FWL_Error IFWL_Widget::Initialize() {
44 return m_pImpl->Initialize(); 44 return m_pImpl->Initialize();
45 } 45 }
46 46
47 FWL_ERR IFWL_Widget::Finalize() { 47 FWL_Error IFWL_Widget::Finalize() {
48 return m_pImpl->Finalize(); 48 return m_pImpl->Finalize();
49 } 49 }
50 50
51 FWL_ERR IFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { 51 FWL_Error IFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
52 return static_cast<CFWL_WidgetImp*>(GetImpl()) 52 return static_cast<CFWL_WidgetImp*>(GetImpl())
53 ->GetWidgetRect(rect, bAutoSize); 53 ->GetWidgetRect(rect, bAutoSize);
54 } 54 }
55 FWL_ERR IFWL_Widget::GetGlobalRect(CFX_RectF& rect) { 55 FWL_Error IFWL_Widget::GetGlobalRect(CFX_RectF& rect) {
56 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetGlobalRect(rect); 56 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetGlobalRect(rect);
57 } 57 }
58 FWL_ERR IFWL_Widget::SetWidgetRect(const CFX_RectF& rect) { 58 FWL_Error IFWL_Widget::SetWidgetRect(const CFX_RectF& rect) {
59 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetWidgetRect(rect); 59 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetWidgetRect(rect);
60 } 60 }
61 FWL_ERR IFWL_Widget::GetClientRect(CFX_RectF& rect) { 61 FWL_Error IFWL_Widget::GetClientRect(CFX_RectF& rect) {
62 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetClientRect(rect); 62 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetClientRect(rect);
63 } 63 }
64 IFWL_Widget* IFWL_Widget::GetParent() { 64 IFWL_Widget* IFWL_Widget::GetParent() {
65 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetParent(); 65 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetParent();
66 } 66 }
67 FWL_ERR IFWL_Widget::SetParent(IFWL_Widget* pParent) { 67 FWL_Error IFWL_Widget::SetParent(IFWL_Widget* pParent) {
68 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetParent(pParent); 68 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetParent(pParent);
69 } 69 }
70 IFWL_Widget* IFWL_Widget::GetOwner() { 70 IFWL_Widget* IFWL_Widget::GetOwner() {
71 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOwner(); 71 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOwner();
72 } 72 }
73 FWL_ERR IFWL_Widget::SetOwner(IFWL_Widget* pOwner) { 73 FWL_Error IFWL_Widget::SetOwner(IFWL_Widget* pOwner) {
74 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetOwner(pOwner); 74 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetOwner(pOwner);
75 } 75 }
76 IFWL_Widget* IFWL_Widget::GetOuter() { 76 IFWL_Widget* IFWL_Widget::GetOuter() {
77 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOuter(); 77 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOuter();
78 } 78 }
79 uint32_t IFWL_Widget::GetStyles() { 79 uint32_t IFWL_Widget::GetStyles() {
80 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStyles(); 80 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStyles();
81 } 81 }
82 FWL_ERR IFWL_Widget::ModifyStyles(uint32_t dwStylesAdded, 82 FWL_Error IFWL_Widget::ModifyStyles(uint32_t dwStylesAdded,
83 uint32_t dwStylesRemoved) { 83 uint32_t dwStylesRemoved) {
84 return static_cast<CFWL_WidgetImp*>(GetImpl()) 84 return static_cast<CFWL_WidgetImp*>(GetImpl())
85 ->ModifyStyles(dwStylesAdded, dwStylesRemoved); 85 ->ModifyStyles(dwStylesAdded, dwStylesRemoved);
86 } 86 }
87 uint32_t IFWL_Widget::GetStylesEx() { 87 uint32_t IFWL_Widget::GetStylesEx() {
88 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStylesEx(); 88 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStylesEx();
89 } 89 }
90 FWL_ERR IFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded, 90 FWL_Error IFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded,
91 uint32_t dwStylesExRemoved) { 91 uint32_t dwStylesExRemoved) {
92 return static_cast<CFWL_WidgetImp*>(GetImpl()) 92 return static_cast<CFWL_WidgetImp*>(GetImpl())
93 ->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); 93 ->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
94 } 94 }
95 uint32_t IFWL_Widget::GetStates() { 95 uint32_t IFWL_Widget::GetStates() {
96 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStates(); 96 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStates();
97 } 97 }
98 void IFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) { 98 void IFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) {
99 static_cast<CFWL_WidgetImp*>(GetImpl())->SetStates(dwStates, bSet); 99 static_cast<CFWL_WidgetImp*>(GetImpl())->SetStates(dwStates, bSet);
100 } 100 }
101 FWL_ERR IFWL_Widget::SetPrivateData(void* module_id, 101 FWL_Error IFWL_Widget::SetPrivateData(void* module_id,
102 void* pData, 102 void* pData,
103 PD_CALLBACK_FREEDATA callback) { 103 PD_CALLBACK_FREEDATA callback) {
104 return static_cast<CFWL_WidgetImp*>(GetImpl()) 104 return static_cast<CFWL_WidgetImp*>(GetImpl())
105 ->SetPrivateData(module_id, pData, callback); 105 ->SetPrivateData(module_id, pData, callback);
106 } 106 }
107 void* IFWL_Widget::GetPrivateData(void* module_id) { 107 void* IFWL_Widget::GetPrivateData(void* module_id) {
108 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetPrivateData(module_id); 108 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetPrivateData(module_id);
109 } 109 }
110 FWL_ERR IFWL_Widget::Update() { 110 FWL_Error IFWL_Widget::Update() {
111 return static_cast<CFWL_WidgetImp*>(GetImpl())->Update(); 111 return static_cast<CFWL_WidgetImp*>(GetImpl())->Update();
112 } 112 }
113 FWL_ERR IFWL_Widget::LockUpdate() { 113 FWL_Error IFWL_Widget::LockUpdate() {
114 return static_cast<CFWL_WidgetImp*>(GetImpl())->LockUpdate(); 114 return static_cast<CFWL_WidgetImp*>(GetImpl())->LockUpdate();
115 } 115 }
116 FWL_ERR IFWL_Widget::UnlockUpdate() { 116 FWL_Error IFWL_Widget::UnlockUpdate() {
117 return static_cast<CFWL_WidgetImp*>(GetImpl())->UnlockUpdate(); 117 return static_cast<CFWL_WidgetImp*>(GetImpl())->UnlockUpdate();
118 } 118 }
119 FWL_WidgetHit IFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) { 119 FWL_WidgetHit IFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
120 return static_cast<CFWL_WidgetImp*>(GetImpl())->HitTest(fx, fy); 120 return static_cast<CFWL_WidgetImp*>(GetImpl())->HitTest(fx, fy);
121 } 121 }
122 FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, 122 FWL_Error IFWL_Widget::TransformTo(IFWL_Widget* pWidget,
123 FX_FLOAT& fx, 123 FX_FLOAT& fx,
124 FX_FLOAT& fy) { 124 FX_FLOAT& fy) {
125 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, fx, fy); 125 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, fx, fy);
126 } 126 }
127 FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) { 127 FWL_Error IFWL_Widget::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) {
128 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, rt); 128 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, rt);
129 } 129 }
130 FWL_ERR IFWL_Widget::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) { 130 FWL_Error IFWL_Widget::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) {
131 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetMatrix(matrix, bGlobal); 131 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetMatrix(matrix, bGlobal);
132 } 132 }
133 FWL_ERR IFWL_Widget::SetMatrix(const CFX_Matrix& matrix) { 133 FWL_Error IFWL_Widget::SetMatrix(const CFX_Matrix& matrix) {
134 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetMatrix(matrix); 134 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetMatrix(matrix);
135 } 135 }
136 FWL_ERR IFWL_Widget::DrawWidget(CFX_Graphics* pGraphics, 136 FWL_Error IFWL_Widget::DrawWidget(CFX_Graphics* pGraphics,
137 const CFX_Matrix* pMatrix) { 137 const CFX_Matrix* pMatrix) {
138 return static_cast<CFWL_WidgetImp*>(GetImpl()) 138 return static_cast<CFWL_WidgetImp*>(GetImpl())
139 ->DrawWidget(pGraphics, pMatrix); 139 ->DrawWidget(pGraphics, pMatrix);
140 } 140 }
141 IFWL_ThemeProvider* IFWL_Widget::GetThemeProvider() { 141 IFWL_ThemeProvider* IFWL_Widget::GetThemeProvider() {
142 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetThemeProvider(); 142 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetThemeProvider();
143 } 143 }
144 FWL_ERR IFWL_Widget::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { 144 FWL_Error IFWL_Widget::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
145 return static_cast<CFWL_WidgetImp*>(GetImpl()) 145 return static_cast<CFWL_WidgetImp*>(GetImpl())
146 ->SetThemeProvider(pThemeProvider); 146 ->SetThemeProvider(pThemeProvider);
147 } 147 }
148 FWL_ERR IFWL_Widget::SetDataProvider(IFWL_DataProvider* pDataProvider) { 148 FWL_Error IFWL_Widget::SetDataProvider(IFWL_DataProvider* pDataProvider) {
149 return static_cast<CFWL_WidgetImp*>(GetImpl()) 149 return static_cast<CFWL_WidgetImp*>(GetImpl())
150 ->SetDataProvider(pDataProvider); 150 ->SetDataProvider(pDataProvider);
151 } 151 }
152 IFWL_WidgetDelegate* IFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) { 152 IFWL_WidgetDelegate* IFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) {
153 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetDelegate(pDelegate); 153 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetDelegate(pDelegate);
154 } 154 }
155 IFWL_App* IFWL_Widget::GetOwnerApp() const { 155 IFWL_App* IFWL_Widget::GetOwnerApp() const {
156 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOwnerApp(); 156 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOwnerApp();
157 } 157 }
158 CFX_SizeF IFWL_Widget::GetOffsetFromParent(IFWL_Widget* pParent) { 158 CFX_SizeF IFWL_Widget::GetOffsetFromParent(IFWL_Widget* pParent) {
159 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOffsetFromParent(pParent); 159 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOffsetFromParent(pParent);
160 } 160 }
161 161
162 FWL_ERR CFWL_WidgetImp::Initialize() { 162 FWL_Error CFWL_WidgetImp::Initialize() {
163 IFWL_App* pApp = FWL_GetApp(); 163 IFWL_App* pApp = FWL_GetApp();
164 if (!pApp) 164 if (!pApp)
165 return FWL_ERR_Indefinite; 165 return FWL_Error::Indefinite;
166
166 CXFA_FFApp* pAdapter = pApp->GetAdapterNative(); 167 CXFA_FFApp* pAdapter = pApp->GetAdapterNative();
167 if (!pAdapter) 168 if (!pAdapter)
168 return FWL_ERR_Indefinite; 169 return FWL_Error::Indefinite;
169 170
170 SetOwnerApp(static_cast<CFWL_AppImp*>(FWL_GetApp()->GetImpl())); 171 SetOwnerApp(static_cast<CFWL_AppImp*>(FWL_GetApp()->GetImpl()));
172
171 IFWL_Widget* pParent = m_pProperties->m_pParent; 173 IFWL_Widget* pParent = m_pProperties->m_pParent;
172 m_pWidgetMgr->InsertWidget(pParent, m_pInterface); 174 m_pWidgetMgr->InsertWidget(pParent, m_pInterface);
173 if (!IsChild()) { 175 if (!IsChild()) {
174 IFWL_Widget* pOwner = m_pProperties->m_pOwner; 176 IFWL_Widget* pOwner = m_pProperties->m_pOwner;
175 if (pOwner) 177 if (pOwner)
176 m_pWidgetMgr->SetOwner(pOwner, m_pInterface); 178 m_pWidgetMgr->SetOwner(pOwner, m_pInterface);
177 } 179 }
178 return FWL_ERR_Succeeded; 180 return FWL_Error::Succeeded;
179 } 181 }
180 182
181 FWL_ERR CFWL_WidgetImp::Finalize() { 183 FWL_Error CFWL_WidgetImp::Finalize() {
182 NotifyDriver(); 184 NotifyDriver();
183 m_pWidgetMgr->RemoveWidget(m_pInterface); 185 m_pWidgetMgr->RemoveWidget(m_pInterface);
184 return FWL_ERR_Succeeded; 186 return FWL_Error::Succeeded;
185 } 187 }
186 188
187 FWL_ERR CFWL_WidgetImp::GetClassName(CFX_WideString& wsClass) const { 189 FWL_Error CFWL_WidgetImp::GetClassName(CFX_WideString& wsClass) const {
188 wsClass.clear(); 190 wsClass.clear();
189 return FWL_ERR_Succeeded; 191 return FWL_Error::Succeeded;
190 } 192 }
191 193
192 uint32_t CFWL_WidgetImp::GetClassID() const { 194 uint32_t CFWL_WidgetImp::GetClassID() const {
193 return 0; 195 return 0;
194 } 196 }
195 197
196 FX_BOOL CFWL_WidgetImp::IsInstance(const CFX_WideStringC& wsClass) const { 198 FX_BOOL CFWL_WidgetImp::IsInstance(const CFX_WideStringC& wsClass) const {
197 return FALSE; 199 return FALSE;
198 } 200 }
199 201
200 FWL_ERR CFWL_WidgetImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { 202 FWL_Error CFWL_WidgetImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
201 if (bAutoSize) { 203 if (bAutoSize) {
202 if (HasEdge()) { 204 if (HasEdge()) {
203 FX_FLOAT fEdge = GetEdgeWidth(); 205 FX_FLOAT fEdge = GetEdgeWidth();
204 rect.Inflate(fEdge, fEdge); 206 rect.Inflate(fEdge, fEdge);
205 } 207 }
206 if (HasBorder()) { 208 if (HasBorder()) {
207 FX_FLOAT fBorder = GetBorderSize(); 209 FX_FLOAT fBorder = GetBorderSize();
208 rect.Inflate(fBorder, fBorder); 210 rect.Inflate(fBorder, fBorder);
209 } 211 }
210 } else { 212 } else {
211 rect = m_pProperties->m_rtWidget; 213 rect = m_pProperties->m_rtWidget;
212 } 214 }
213 return FWL_ERR_Succeeded; 215 return FWL_Error::Succeeded;
214 } 216 }
215 FWL_ERR CFWL_WidgetImp::GetGlobalRect(CFX_RectF& rect) { 217 FWL_Error CFWL_WidgetImp::GetGlobalRect(CFX_RectF& rect) {
216 IFWL_Widget* pForm = 218 IFWL_Widget* pForm =
217 m_pWidgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_SystemForm); 219 m_pWidgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_SystemForm);
218 if (!pForm) 220 if (!pForm)
219 return FWL_ERR_Indefinite; 221 return FWL_Error::Indefinite;
220 rect.Set(0, 0, m_pProperties->m_rtWidget.width, 222 rect.Set(0, 0, m_pProperties->m_rtWidget.width,
221 m_pProperties->m_rtWidget.height); 223 m_pProperties->m_rtWidget.height);
222 if (pForm == m_pInterface) { 224 if (pForm == m_pInterface) {
223 return FWL_ERR_Succeeded; 225 return FWL_Error::Succeeded;
224 } 226 }
225 return TransformTo(pForm, rect); 227 return TransformTo(pForm, rect);
226 } 228 }
227 FWL_ERR CFWL_WidgetImp::SetWidgetRect(const CFX_RectF& rect) { 229 FWL_Error CFWL_WidgetImp::SetWidgetRect(const CFX_RectF& rect) {
228 CFX_RectF rtOld = m_pProperties->m_rtWidget; 230 CFX_RectF rtOld = m_pProperties->m_rtWidget;
229 m_pProperties->m_rtWidget = rect; 231 m_pProperties->m_rtWidget = rect;
230 if (IsChild()) { 232 if (IsChild()) {
231 if (FXSYS_fabs(rtOld.width - rect.width) > 0.5f || 233 if (FXSYS_fabs(rtOld.width - rect.width) > 0.5f ||
232 FXSYS_fabs(rtOld.height - rect.height) > 0.5f) { 234 FXSYS_fabs(rtOld.height - rect.height) > 0.5f) {
233 CFWL_EvtSizeChanged ev; 235 CFWL_EvtSizeChanged ev;
234 ev.m_pSrcTarget = m_pInterface; 236 ev.m_pSrcTarget = m_pInterface;
235 ev.m_rtOld = rtOld; 237 ev.m_rtOld = rtOld;
236 ev.m_rtNew = rect; 238 ev.m_rtNew = rect;
237 IFWL_WidgetDelegate* pDelegate = SetDelegate(NULL); 239 IFWL_WidgetDelegate* pDelegate = SetDelegate(NULL);
238 if (pDelegate) { 240 if (pDelegate) {
239 pDelegate->OnProcessEvent(&ev); 241 pDelegate->OnProcessEvent(&ev);
240 } 242 }
241 } 243 }
242 return FWL_ERR_Succeeded; 244 return FWL_Error::Succeeded;
243 } 245 }
244 m_pWidgetMgr->SetWidgetRect_Native(m_pInterface, rect); 246 m_pWidgetMgr->SetWidgetRect_Native(m_pInterface, rect);
245 return FWL_ERR_Succeeded; 247 return FWL_Error::Succeeded;
246 } 248 }
247 FWL_ERR CFWL_WidgetImp::GetClientRect(CFX_RectF& rect) { 249 FWL_Error CFWL_WidgetImp::GetClientRect(CFX_RectF& rect) {
248 GetEdgeRect(rect); 250 GetEdgeRect(rect);
249 if (HasEdge()) { 251 if (HasEdge()) {
250 FX_FLOAT fEdge = GetEdgeWidth(); 252 FX_FLOAT fEdge = GetEdgeWidth();
251 rect.Deflate(fEdge, fEdge); 253 rect.Deflate(fEdge, fEdge);
252 } 254 }
253 return FWL_ERR_Succeeded; 255 return FWL_Error::Succeeded;
254 } 256 }
255 IFWL_Widget* CFWL_WidgetImp::GetParent() { 257 IFWL_Widget* CFWL_WidgetImp::GetParent() {
256 return m_pWidgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_Parent); 258 return m_pWidgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_Parent);
257 } 259 }
258 FWL_ERR CFWL_WidgetImp::SetParent(IFWL_Widget* pParent) { 260 FWL_Error CFWL_WidgetImp::SetParent(IFWL_Widget* pParent) {
259 m_pProperties->m_pParent = pParent; 261 m_pProperties->m_pParent = pParent;
260 m_pWidgetMgr->SetParent(pParent, m_pInterface); 262 m_pWidgetMgr->SetParent(pParent, m_pInterface);
261 return FWL_ERR_Succeeded; 263 return FWL_Error::Succeeded;
262 } 264 }
263 IFWL_Widget* CFWL_WidgetImp::GetOwner() { 265 IFWL_Widget* CFWL_WidgetImp::GetOwner() {
264 return m_pWidgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_Owner); 266 return m_pWidgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_Owner);
265 } 267 }
266 FWL_ERR CFWL_WidgetImp::SetOwner(IFWL_Widget* pOwner) { 268 FWL_Error CFWL_WidgetImp::SetOwner(IFWL_Widget* pOwner) {
267 m_pProperties->m_pOwner = pOwner; 269 m_pProperties->m_pOwner = pOwner;
268 m_pWidgetMgr->SetOwner(pOwner, m_pInterface); 270 m_pWidgetMgr->SetOwner(pOwner, m_pInterface);
269 return FWL_ERR_Succeeded; 271 return FWL_Error::Succeeded;
270 } 272 }
271 IFWL_Widget* CFWL_WidgetImp::GetOuter() { 273 IFWL_Widget* CFWL_WidgetImp::GetOuter() {
272 return m_pOuter; 274 return m_pOuter;
273 } 275 }
274 uint32_t CFWL_WidgetImp::GetStyles() { 276 uint32_t CFWL_WidgetImp::GetStyles() {
275 return m_pProperties->m_dwStyles; 277 return m_pProperties->m_dwStyles;
276 } 278 }
277 FWL_ERR CFWL_WidgetImp::ModifyStyles(uint32_t dwStylesAdded, 279 FWL_Error CFWL_WidgetImp::ModifyStyles(uint32_t dwStylesAdded,
278 uint32_t dwStylesRemoved) { 280 uint32_t dwStylesRemoved) {
279 m_pProperties->m_dwStyles = 281 m_pProperties->m_dwStyles =
280 (m_pProperties->m_dwStyles & ~dwStylesRemoved) | dwStylesAdded; 282 (m_pProperties->m_dwStyles & ~dwStylesRemoved) | dwStylesAdded;
281 return FWL_ERR_Succeeded; 283 return FWL_Error::Succeeded;
282 } 284 }
283 uint32_t CFWL_WidgetImp::GetStylesEx() { 285 uint32_t CFWL_WidgetImp::GetStylesEx() {
284 return m_pProperties->m_dwStyleExes; 286 return m_pProperties->m_dwStyleExes;
285 } 287 }
286 FWL_ERR CFWL_WidgetImp::ModifyStylesEx(uint32_t dwStylesExAdded, 288 FWL_Error CFWL_WidgetImp::ModifyStylesEx(uint32_t dwStylesExAdded,
287 uint32_t dwStylesExRemoved) { 289 uint32_t dwStylesExRemoved) {
288 m_pProperties->m_dwStyleExes = 290 m_pProperties->m_dwStyleExes =
289 (m_pProperties->m_dwStyleExes & ~dwStylesExRemoved) | dwStylesExAdded; 291 (m_pProperties->m_dwStyleExes & ~dwStylesExRemoved) | dwStylesExAdded;
290 return FWL_ERR_Succeeded; 292 return FWL_Error::Succeeded;
291 } 293 }
292 uint32_t CFWL_WidgetImp::GetStates() { 294 uint32_t CFWL_WidgetImp::GetStates() {
293 return m_pProperties->m_dwStates; 295 return m_pProperties->m_dwStates;
294 } 296 }
295 static void NotifyHideChildWidget(IFWL_WidgetMgr* widgetMgr, 297 static void NotifyHideChildWidget(IFWL_WidgetMgr* widgetMgr,
296 IFWL_Widget* widget, 298 IFWL_Widget* widget,
297 CFWL_NoteDriver* noteDriver) { 299 CFWL_NoteDriver* noteDriver) {
298 IFWL_Widget* child = widgetMgr->GetWidget(widget, FWL_WGTRELATION_FirstChild); 300 IFWL_Widget* child = widgetMgr->GetWidget(widget, FWL_WGTRELATION_FirstChild);
299 while (child) { 301 while (child) {
300 noteDriver->NotifyTargetHide(child); 302 noteDriver->NotifyTargetHide(child);
301 NotifyHideChildWidget(widgetMgr, child, noteDriver); 303 NotifyHideChildWidget(widgetMgr, child, noteDriver);
302 child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); 304 child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling);
303 } 305 }
304 } 306 }
307
305 void CFWL_WidgetImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { 308 void CFWL_WidgetImp::SetStates(uint32_t dwStates, FX_BOOL bSet) {
306 bSet ? (m_pProperties->m_dwStates |= dwStates) 309 bSet ? (m_pProperties->m_dwStates |= dwStates)
307 : (m_pProperties->m_dwStates &= ~dwStates); 310 : (m_pProperties->m_dwStates &= ~dwStates);
308 if (!(dwStates & FWL_WGTSTATE_Invisible) || !bSet) 311 if (!(dwStates & FWL_WGTSTATE_Invisible) || !bSet)
309 return; 312 return;
310 313
311 CFWL_NoteDriver* noteDriver = 314 CFWL_NoteDriver* noteDriver =
312 static_cast<CFWL_NoteDriver*>(GetOwnerApp()->GetNoteDriver()); 315 static_cast<CFWL_NoteDriver*>(GetOwnerApp()->GetNoteDriver());
313 IFWL_WidgetMgr* widgetMgr = FWL_GetWidgetMgr(); 316 IFWL_WidgetMgr* widgetMgr = FWL_GetWidgetMgr();
314 noteDriver->NotifyTargetHide(m_pInterface); 317 noteDriver->NotifyTargetHide(m_pInterface);
315 IFWL_Widget* child = 318 IFWL_Widget* child =
316 widgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_FirstChild); 319 widgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_FirstChild);
317 while (child) { 320 while (child) {
318 noteDriver->NotifyTargetHide(child); 321 noteDriver->NotifyTargetHide(child);
319 NotifyHideChildWidget(widgetMgr, child, noteDriver); 322 NotifyHideChildWidget(widgetMgr, child, noteDriver);
320 child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); 323 child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling);
321 } 324 }
322 return; 325 return;
323 } 326 }
324 FWL_ERR CFWL_WidgetImp::SetPrivateData(void* module_id, 327 FWL_Error CFWL_WidgetImp::SetPrivateData(void* module_id,
325 void* pData, 328 void* pData,
326 PD_CALLBACK_FREEDATA callback) { 329 PD_CALLBACK_FREEDATA callback) {
327 if (!m_pPrivateData) { 330 if (!m_pPrivateData) {
328 m_pPrivateData = new CFX_PrivateData; 331 m_pPrivateData = new CFX_PrivateData;
329 } 332 }
330 m_pPrivateData->SetPrivateData(module_id, pData, callback); 333 m_pPrivateData->SetPrivateData(module_id, pData, callback);
331 return FWL_ERR_Succeeded; 334 return FWL_Error::Succeeded;
332 } 335 }
333 void* CFWL_WidgetImp::GetPrivateData(void* module_id) { 336 void* CFWL_WidgetImp::GetPrivateData(void* module_id) {
334 if (!m_pPrivateData) 337 if (!m_pPrivateData)
335 return NULL; 338 return NULL;
336 return m_pPrivateData->GetPrivateData(module_id); 339 return m_pPrivateData->GetPrivateData(module_id);
337 } 340 }
338 FWL_ERR CFWL_WidgetImp::Update() { 341 FWL_Error CFWL_WidgetImp::Update() {
339 return FWL_ERR_Succeeded; 342 return FWL_Error::Succeeded;
340 } 343 }
341 FWL_ERR CFWL_WidgetImp::LockUpdate() { 344 FWL_Error CFWL_WidgetImp::LockUpdate() {
342 m_iLock++; 345 m_iLock++;
343 return FWL_ERR_Succeeded; 346 return FWL_Error::Succeeded;
344 } 347 }
345 FWL_ERR CFWL_WidgetImp::UnlockUpdate() { 348 FWL_Error CFWL_WidgetImp::UnlockUpdate() {
346 if (IsLocked()) { 349 if (IsLocked()) {
347 m_iLock--; 350 m_iLock--;
348 } 351 }
349 return FWL_ERR_Succeeded; 352 return FWL_Error::Succeeded;
350 } 353 }
351 FWL_WidgetHit CFWL_WidgetImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { 354 FWL_WidgetHit CFWL_WidgetImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
352 CFX_RectF rtClient; 355 CFX_RectF rtClient;
353 GetClientRect(rtClient); 356 GetClientRect(rtClient);
354 if (rtClient.Contains(fx, fy)) 357 if (rtClient.Contains(fx, fy))
355 return FWL_WidgetHit::Client; 358 return FWL_WidgetHit::Client;
356 if (HasEdge()) { 359 if (HasEdge()) {
357 CFX_RectF rtEdge; 360 CFX_RectF rtEdge;
358 GetEdgeRect(rtEdge); 361 GetEdgeRect(rtEdge);
359 if (rtEdge.Contains(fx, fy)) 362 if (rtEdge.Contains(fx, fy))
360 return FWL_WidgetHit::Edge; 363 return FWL_WidgetHit::Edge;
361 } 364 }
362 if (HasBorder()) { 365 if (HasBorder()) {
363 CFX_RectF rtRelative; 366 CFX_RectF rtRelative;
364 GetRelativeRect(rtRelative); 367 GetRelativeRect(rtRelative);
365 if (rtRelative.Contains(fx, fy)) 368 if (rtRelative.Contains(fx, fy))
366 return FWL_WidgetHit::Border; 369 return FWL_WidgetHit::Border;
367 } 370 }
368 return FWL_WidgetHit::Unknown; 371 return FWL_WidgetHit::Unknown;
369 } 372 }
370 FWL_ERR CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget, 373 FWL_Error CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget,
371 FX_FLOAT& fx, 374 FX_FLOAT& fx,
372 FX_FLOAT& fy) { 375 FX_FLOAT& fy) {
373 if (m_pWidgetMgr->IsFormDisabled()) { 376 if (m_pWidgetMgr->IsFormDisabled()) {
374 CFX_SizeF szOffset; 377 CFX_SizeF szOffset;
375 if (IsParent(pWidget)) { 378 if (IsParent(pWidget)) {
376 szOffset = GetOffsetFromParent(pWidget); 379 szOffset = GetOffsetFromParent(pWidget);
377 } else { 380 } else {
378 szOffset = pWidget->GetOffsetFromParent(m_pInterface); 381 szOffset = pWidget->GetOffsetFromParent(m_pInterface);
379 szOffset.x = -szOffset.x; 382 szOffset.x = -szOffset.x;
380 szOffset.y = -szOffset.y; 383 szOffset.y = -szOffset.y;
381 } 384 }
382 fx += szOffset.x; 385 fx += szOffset.x;
383 fy += szOffset.y; 386 fy += szOffset.y;
384 return FWL_ERR_Succeeded; 387 return FWL_Error::Succeeded;
385 } 388 }
386 CFX_RectF r; 389 CFX_RectF r;
387 CFX_Matrix m; 390 CFX_Matrix m;
388 IFWL_Widget* parent = GetParent(); 391 IFWL_Widget* parent = GetParent();
389 if (parent) { 392 if (parent) {
390 GetWidgetRect(r); 393 GetWidgetRect(r);
391 fx += r.left; 394 fx += r.left;
392 fy += r.top; 395 fy += r.top;
393 GetMatrix(m, TRUE); 396 GetMatrix(m, TRUE);
394 m.TransformPoint(fx, fy); 397 m.TransformPoint(fx, fy);
395 } 398 }
396 IFWL_Widget* form1 = 399 IFWL_Widget* form1 =
397 m_pWidgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_SystemForm); 400 m_pWidgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_SystemForm);
398 if (!form1) 401 if (!form1)
399 return FWL_ERR_Indefinite; 402 return FWL_Error::Indefinite;
400 if (!pWidget) { 403 if (!pWidget) {
401 form1->GetWidgetRect(r); 404 form1->GetWidgetRect(r);
402 fx += r.left; 405 fx += r.left;
403 fy += r.top; 406 fy += r.top;
404 return FWL_ERR_Succeeded; 407 return FWL_Error::Succeeded;
405 } 408 }
406 IFWL_Widget* form2 = 409 IFWL_Widget* form2 =
407 m_pWidgetMgr->GetWidget(pWidget, FWL_WGTRELATION_SystemForm); 410 m_pWidgetMgr->GetWidget(pWidget, FWL_WGTRELATION_SystemForm);
408 if (!form2) 411 if (!form2)
409 return FWL_ERR_Indefinite; 412 return FWL_Error::Indefinite;
410 if (form1 != form2) { 413 if (form1 != form2) {
411 form1->GetWidgetRect(r); 414 form1->GetWidgetRect(r);
412 fx += r.left; 415 fx += r.left;
413 fy += r.top; 416 fy += r.top;
414 form2->GetWidgetRect(r); 417 form2->GetWidgetRect(r);
415 fx -= r.left; 418 fx -= r.left;
416 fy -= r.top; 419 fy -= r.top;
417 } 420 }
418 parent = pWidget->GetParent(); 421 parent = pWidget->GetParent();
419 if (parent) { 422 if (parent) {
420 pWidget->GetMatrix(m, TRUE); 423 pWidget->GetMatrix(m, TRUE);
421 CFX_Matrix m1; 424 CFX_Matrix m1;
422 m1.SetIdentity(); 425 m1.SetIdentity();
423 m1.SetReverse(m); 426 m1.SetReverse(m);
424 m1.TransformPoint(fx, fy); 427 m1.TransformPoint(fx, fy);
425 pWidget->GetWidgetRect(r); 428 pWidget->GetWidgetRect(r);
426 fx -= r.left; 429 fx -= r.left;
427 fy -= r.top; 430 fy -= r.top;
428 } 431 }
429 return FWL_ERR_Succeeded; 432 return FWL_Error::Succeeded;
430 } 433 }
431 FWL_ERR CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) { 434 FWL_Error CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) {
432 return TransformTo(pWidget, rt.left, rt.top); 435 return TransformTo(pWidget, rt.left, rt.top);
433 } 436 }
434 FWL_ERR CFWL_WidgetImp::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) { 437 FWL_Error CFWL_WidgetImp::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) {
435 if (!m_pProperties) 438 if (!m_pProperties)
436 return FWL_ERR_Indefinite; 439 return FWL_Error::Indefinite;
437 if (bGlobal) { 440 if (bGlobal) {
438 IFWL_Widget* parent = GetParent(); 441 IFWL_Widget* parent = GetParent();
439 CFX_ArrayTemplate<IFWL_Widget*> parents; 442 CFX_ArrayTemplate<IFWL_Widget*> parents;
440 while (parent) { 443 while (parent) {
441 parents.Add(parent); 444 parents.Add(parent);
442 parent = parent->GetParent(); 445 parent = parent->GetParent();
443 } 446 }
444 matrix.SetIdentity(); 447 matrix.SetIdentity();
445 CFX_Matrix ctmOnParent; 448 CFX_Matrix ctmOnParent;
446 CFX_RectF rect; 449 CFX_RectF rect;
447 int32_t count = parents.GetSize(); 450 int32_t count = parents.GetSize();
448 for (int32_t i = count - 2; i >= 0; i--) { 451 for (int32_t i = count - 2; i >= 0; i--) {
449 parent = parents.GetAt(i); 452 parent = parents.GetAt(i);
450 parent->GetMatrix(ctmOnParent, FALSE); 453 parent->GetMatrix(ctmOnParent, FALSE);
451 parent->GetWidgetRect(rect); 454 parent->GetWidgetRect(rect);
452 matrix.Concat(ctmOnParent, TRUE); 455 matrix.Concat(ctmOnParent, TRUE);
453 matrix.Translate(rect.left, rect.top, TRUE); 456 matrix.Translate(rect.left, rect.top, TRUE);
454 } 457 }
455 matrix.Concat(m_pProperties->m_ctmOnParent, TRUE); 458 matrix.Concat(m_pProperties->m_ctmOnParent, TRUE);
456 parents.RemoveAll(); 459 parents.RemoveAll();
457 } else { 460 } else {
458 matrix = m_pProperties->m_ctmOnParent; 461 matrix = m_pProperties->m_ctmOnParent;
459 } 462 }
460 return FWL_ERR_Succeeded; 463 return FWL_Error::Succeeded;
461 } 464 }
462 FWL_ERR CFWL_WidgetImp::SetMatrix(const CFX_Matrix& matrix) { 465 FWL_Error CFWL_WidgetImp::SetMatrix(const CFX_Matrix& matrix) {
463 if (!m_pProperties) 466 if (!m_pProperties)
464 return FWL_ERR_Indefinite; 467 return FWL_Error::Indefinite;
465 IFWL_Widget* parent = GetParent(); 468 IFWL_Widget* parent = GetParent();
466 if (!parent) { 469 if (!parent) {
467 return FWL_ERR_Indefinite; 470 return FWL_Error::Indefinite;
468 } 471 }
469 m_pProperties->m_ctmOnParent = matrix; 472 m_pProperties->m_ctmOnParent = matrix;
470 return FWL_ERR_Succeeded; 473 return FWL_Error::Succeeded;
471 } 474 }
472 FWL_ERR CFWL_WidgetImp::DrawWidget(CFX_Graphics* pGraphics, 475 FWL_Error CFWL_WidgetImp::DrawWidget(CFX_Graphics* pGraphics,
473 const CFX_Matrix* pMatrix) { 476 const CFX_Matrix* pMatrix) {
474 return FWL_ERR_Indefinite; 477 return FWL_Error::Indefinite;
475 } 478 }
476 IFWL_ThemeProvider* CFWL_WidgetImp::GetThemeProvider() { 479 IFWL_ThemeProvider* CFWL_WidgetImp::GetThemeProvider() {
477 return m_pProperties->m_pThemeProvider; 480 return m_pProperties->m_pThemeProvider;
478 } 481 }
479 FWL_ERR CFWL_WidgetImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { 482 FWL_Error CFWL_WidgetImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
480 m_pProperties->m_pThemeProvider = pThemeProvider; 483 m_pProperties->m_pThemeProvider = pThemeProvider;
481 return FWL_ERR_Succeeded; 484 return FWL_Error::Succeeded;
482 } 485 }
483 FWL_ERR CFWL_WidgetImp::SetDataProvider(IFWL_DataProvider* pDataProvider) { 486 FWL_Error CFWL_WidgetImp::SetDataProvider(IFWL_DataProvider* pDataProvider) {
484 m_pProperties->m_pDataProvider = pDataProvider; 487 m_pProperties->m_pDataProvider = pDataProvider;
485 return FWL_ERR_Succeeded; 488 return FWL_Error::Succeeded;
486 } 489 }
487 IFWL_WidgetDelegate* CFWL_WidgetImp::SetDelegate( 490 IFWL_WidgetDelegate* CFWL_WidgetImp::SetDelegate(
488 IFWL_WidgetDelegate* pDelegate) { 491 IFWL_WidgetDelegate* pDelegate) {
489 if (!m_pCurDelegate) { 492 if (!m_pCurDelegate) {
490 m_pCurDelegate = m_pDelegate; 493 m_pCurDelegate = m_pDelegate;
491 } 494 }
492 if (!pDelegate) { 495 if (!pDelegate) {
493 return m_pCurDelegate; 496 return m_pCurDelegate;
494 } 497 }
495 IFWL_WidgetDelegate* pOldDelegate = m_pCurDelegate; 498 IFWL_WidgetDelegate* pOldDelegate = m_pCurDelegate;
496 m_pCurDelegate = pDelegate; 499 m_pCurDelegate = pDelegate;
497 return pOldDelegate; 500 return pOldDelegate;
498 } 501 }
499 IFWL_App* CFWL_WidgetImp::GetOwnerApp() const { 502 IFWL_App* CFWL_WidgetImp::GetOwnerApp() const {
500 return static_cast<IFWL_App*>(m_pOwnerApp->GetInterface()); 503 return static_cast<IFWL_App*>(m_pOwnerApp->GetInterface());
501 } 504 }
502 FWL_ERR CFWL_WidgetImp::SetOwnerApp(CFWL_AppImp* pOwnerApp) { 505 FWL_Error CFWL_WidgetImp::SetOwnerApp(CFWL_AppImp* pOwnerApp) {
503 m_pOwnerApp = pOwnerApp; 506 m_pOwnerApp = pOwnerApp;
504 return FWL_ERR_Succeeded; 507 return FWL_Error::Succeeded;
505 } 508 }
506 IFWL_Widget* CFWL_WidgetImp::GetInterface() const { 509 IFWL_Widget* CFWL_WidgetImp::GetInterface() const {
507 return m_pInterface; 510 return m_pInterface;
508 } 511 }
509 void CFWL_WidgetImp::SetInterface(IFWL_Widget* pInterface) { 512 void CFWL_WidgetImp::SetInterface(IFWL_Widget* pInterface) {
510 m_pInterface = pInterface; 513 m_pInterface = pInterface;
511 } 514 }
512 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, 515 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties,
513 IFWL_Widget* pOuter) 516 IFWL_Widget* pOuter)
514 : m_pProperties(new CFWL_WidgetImpProperties), 517 : m_pProperties(new CFWL_WidgetImpProperties),
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 while (pUpWidget) { 959 while (pUpWidget) {
957 if (pUpWidget == pParent) 960 if (pUpWidget == pParent)
958 return TRUE; 961 return TRUE;
959 pUpWidget = pUpWidget->GetParent(); 962 pUpWidget = pUpWidget->GetParent();
960 } 963 }
961 return FALSE; 964 return FALSE;
962 } 965 }
963 966
964 CFWL_WidgetImpDelegate::CFWL_WidgetImpDelegate() {} 967 CFWL_WidgetImpDelegate::CFWL_WidgetImpDelegate() {}
965 968
966 int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { 969 void CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
967 if (!pMessage->m_pDstTarget) 970 if (!pMessage->m_pDstTarget)
968 return 0; 971 return;
969 972
970 CFWL_WidgetImp* pWidget = 973 CFWL_WidgetImp* pWidget =
971 static_cast<CFWL_WidgetImp*>(pMessage->m_pDstTarget->GetImpl()); 974 static_cast<CFWL_WidgetImp*>(pMessage->m_pDstTarget->GetImpl());
972 CFWL_MessageType dwMsgCode = pMessage->GetClassID(); 975 CFWL_MessageType dwMsgCode = pMessage->GetClassID();
973 switch (dwMsgCode) { 976 switch (dwMsgCode) {
974 case CFWL_MessageType::Mouse: { 977 case CFWL_MessageType::Mouse: {
975 CFWL_MsgMouse* pMsgMouse = static_cast<CFWL_MsgMouse*>(pMessage); 978 CFWL_MsgMouse* pMsgMouse = static_cast<CFWL_MsgMouse*>(pMessage);
976 CFWL_EvtMouse evt; 979 CFWL_EvtMouse evt;
977 evt.m_pSrcTarget = pWidget->m_pInterface; 980 evt.m_pSrcTarget = pWidget->m_pInterface;
978 evt.m_pDstTarget = pWidget->m_pInterface; 981 evt.m_pDstTarget = pWidget->m_pInterface;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 CFWL_EvtKillFocus evt; 1026 CFWL_EvtKillFocus evt;
1024 evt.m_pSrcTarget = pMsgKillFocus->m_pDstTarget; 1027 evt.m_pSrcTarget = pMsgKillFocus->m_pDstTarget;
1025 evt.m_pDstTarget = pMsgKillFocus->m_pDstTarget; 1028 evt.m_pDstTarget = pMsgKillFocus->m_pDstTarget;
1026 evt.m_pKillFocus = pWidget->m_pInterface; 1029 evt.m_pKillFocus = pWidget->m_pInterface;
1027 pWidget->DispatchEvent(&evt); 1030 pWidget->DispatchEvent(&evt);
1028 break; 1031 break;
1029 } 1032 }
1030 default: 1033 default:
1031 break; 1034 break;
1032 } 1035 }
1033 return 1;
1034 } 1036 }
1035 1037
1036 FWL_ERR CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { 1038 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {}
1037 return FWL_ERR_Succeeded;
1038 }
1039 1039
1040 FWL_ERR CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, 1040 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
1041 const CFX_Matrix* pMatrix) { 1041 const CFX_Matrix* pMatrix) {
1042 CFWL_EvtDraw evt; 1042 CFWL_EvtDraw evt;
1043 evt.m_pGraphics = pGraphics; 1043 evt.m_pGraphics = pGraphics;
1044 return FWL_ERR_Succeeded;
1045 } 1044 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/fwl_widgetimp.h ('k') | xfa/fwl/core/fwl_widgetmgrimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698