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/src/fwl/src/core/fwl_noteimp.h" | 7 #include "xfa/src/fwl/core/fwl_noteimp.h" |
8 | 8 |
9 #include "core/include/fxcrt/fx_ext.h" | 9 #include "core/include/fxcrt/fx_ext.h" |
10 #include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h" | 10 #include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h" |
11 #include "xfa/include/fwl/basewidget/fwl_tooltipctrl.h" | 11 #include "xfa/include/fwl/basewidget/fwl_tooltipctrl.h" |
12 #include "xfa/include/fwl/core/fwl_app.h" | 12 #include "xfa/include/fwl/core/fwl_app.h" |
13 #include "xfa/include/fwl/core/fwl_grid.h" | 13 #include "xfa/include/fwl/core/fwl_grid.h" |
14 #include "xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.h" | 14 #include "xfa/src/fwl/basewidget/fwl_tooltipctrlimp.h" |
15 #include "xfa/src/fwl/src/core/fwl_appimp.h" | 15 #include "xfa/src/fwl/core/fwl_appimp.h" |
16 #include "xfa/src/fwl/src/core/fwl_formimp.h" | 16 #include "xfa/src/fwl/core/fwl_formimp.h" |
17 #include "xfa/src/fwl/src/core/fwl_panelimp.h" | 17 #include "xfa/src/fwl/core/fwl_panelimp.h" |
18 #include "xfa/src/fwl/src/core/fwl_targetimp.h" | 18 #include "xfa/src/fwl/core/fwl_targetimp.h" |
19 #include "xfa/src/fwl/src/core/fwl_threadimp.h" | 19 #include "xfa/src/fwl/core/fwl_threadimp.h" |
20 #include "xfa/src/fwl/src/core/fwl_widgetimp.h" | 20 #include "xfa/src/fwl/core/fwl_widgetimp.h" |
21 #include "xfa/src/fwl/src/core/fwl_widgetmgrimp.h" | 21 #include "xfa/src/fwl/core/fwl_widgetmgrimp.h" |
22 | 22 |
23 CFWL_NoteLoop::CFWL_NoteLoop(CFWL_WidgetImp* pForm) | 23 CFWL_NoteLoop::CFWL_NoteLoop(CFWL_WidgetImp* pForm) |
24 : m_pForm(pForm), m_bContinueModal(TRUE) {} | 24 : m_pForm(pForm), m_bContinueModal(TRUE) {} |
25 FX_BOOL CFWL_NoteLoop::PreProcessMessage(CFWL_Message* pMessage) { | 25 FX_BOOL CFWL_NoteLoop::PreProcessMessage(CFWL_Message* pMessage) { |
26 if (!m_pForm) { | 26 if (!m_pForm) { |
27 return FALSE; | 27 return FALSE; |
28 } | 28 } |
29 return TranslateAccelerator(pMessage); | 29 return TranslateAccelerator(pMessage); |
30 } | 30 } |
31 FWL_ERR CFWL_NoteLoop::Idle(int32_t count) { | 31 FWL_ERR CFWL_NoteLoop::Idle(int32_t count) { |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 IFWL_AdapterWidgetMgr* adapterWidgetMgr = pWidgetMgr->GetAdapterWidgetMgr(); | 271 IFWL_AdapterWidgetMgr* adapterWidgetMgr = pWidgetMgr->GetAdapterWidgetMgr(); |
272 CFWL_NoteLoop* pTopLoop = GetTopLoop(); | 272 CFWL_NoteLoop* pTopLoop = GetTopLoop(); |
273 if (pTopLoop) { | 273 if (pTopLoop) { |
274 CFWL_WidgetImp* formImp = pTopLoop->GetForm(); | 274 CFWL_WidgetImp* formImp = pTopLoop->GetForm(); |
275 if (formImp) { | 275 if (formImp) { |
276 IFWL_Widget* pForm = formImp->GetInterface(); | 276 IFWL_Widget* pForm = formImp->GetInterface(); |
277 adapterWidgetMgr->RunLoop(pForm); | 277 adapterWidgetMgr->RunLoop(pForm); |
278 } | 278 } |
279 } | 279 } |
280 #elif(_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_) | 280 #elif(_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_) |
281 FX_BOOL bIdle = TRUE; | 281 FX_BOOL bIdle = TRUE; |
282 int32_t iIdleCount = 0; | 282 int32_t iIdleCount = 0; |
283 CFWL_NoteLoop* pTopLoop = NULL; | 283 CFWL_NoteLoop* pTopLoop = NULL; |
284 for (;;) { | 284 for (;;) { |
285 pTopLoop = GetTopLoop(); | 285 pTopLoop = GetTopLoop(); |
286 if (!pTopLoop || !pTopLoop->ContinueModal()) { | 286 if (!pTopLoop || !pTopLoop->ContinueModal()) { |
287 break; | 287 break; |
| 288 } |
| 289 if (UnqueueMessage(pTopLoop)) { |
| 290 continue; |
| 291 } |
| 292 while (bIdle && !(pWidgetMgr->CheckMessage_Native())) { |
| 293 if (FWL_ERR_Indefinite == pTopLoop->Idle(iIdleCount++)) { |
| 294 bIdle = FALSE; |
| 295 } |
| 296 } |
| 297 do { |
| 298 if (FWL_ERR_Indefinite == pWidgetMgr->DispatchMessage_Native()) { |
| 299 break; |
| 300 } |
| 301 if (pWidgetMgr->IsIdleMessage_Native()) { |
| 302 bIdle = TRUE; |
| 303 iIdleCount = 0; |
| 304 } |
| 305 } while (pWidgetMgr->CheckMessage_Native()); |
288 } | 306 } |
289 if (UnqueueMessage(pTopLoop)) { | 307 #elif(_FX_OS_ == _FX_LINUX_DESKTOP_) |
290 continue; | 308 CFWL_NoteLoop* pTopLoop = NULL; |
291 } | 309 for (;;) { |
292 while (bIdle && !(pWidgetMgr->CheckMessage_Native())) { | 310 pTopLoop = GetTopLoop(); |
293 if (FWL_ERR_Indefinite == pTopLoop->Idle(iIdleCount++)) { | 311 if (!pTopLoop || !pTopLoop->ContinueModal()) { |
294 bIdle = FALSE; | 312 break; |
| 313 } |
| 314 if (UnqueueMessage(pTopLoop)) { |
| 315 continue; |
| 316 } |
| 317 if (pWidgetMgr->CheckMessage_Native()) { |
| 318 pWidgetMgr->DispatchMessage_Native(); |
295 } | 319 } |
296 } | 320 } |
297 do { | |
298 if (FWL_ERR_Indefinite == pWidgetMgr->DispatchMessage_Native()) { | |
299 break; | |
300 } | |
301 if (pWidgetMgr->IsIdleMessage_Native()) { | |
302 bIdle = TRUE; | |
303 iIdleCount = 0; | |
304 } | |
305 } while (pWidgetMgr->CheckMessage_Native()); | |
306 } | |
307 #elif(_FX_OS_ == _FX_LINUX_DESKTOP_) | |
308 CFWL_NoteLoop* pTopLoop = NULL; | |
309 for (;;) { | |
310 pTopLoop = GetTopLoop(); | |
311 if (!pTopLoop || !pTopLoop->ContinueModal()) { | |
312 break; | |
313 } | |
314 if (UnqueueMessage(pTopLoop)) { | |
315 continue; | |
316 } | |
317 if (pWidgetMgr->CheckMessage_Native()) { | |
318 pWidgetMgr->DispatchMessage_Native(); | |
319 } | |
320 } | |
321 #endif | 321 #endif |
322 return FWL_ERR_Succeeded; | 322 return FWL_ERR_Succeeded; |
323 } | 323 } |
324 IFWL_Widget* CFWL_NoteDriver::GetFocus() { | 324 IFWL_Widget* CFWL_NoteDriver::GetFocus() { |
325 return m_pFocus; | 325 return m_pFocus; |
326 } | 326 } |
327 IFWL_Widget* CFWL_NoteDriver::GetHover() { | 327 IFWL_Widget* CFWL_NoteDriver::GetHover() { |
328 return m_pHover; | 328 return m_pHover; |
329 } | 329 } |
330 void CFWL_NoteDriver::SetHover(IFWL_Widget* pHover) { | 330 void CFWL_NoteDriver::SetHover(IFWL_Widget* pHover) { |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 return NULL; | 1088 return NULL; |
1089 return widget->GetInterface(); | 1089 return widget->GetInterface(); |
1090 } | 1090 } |
1091 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, | 1091 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, |
1092 FWLMessageHookCallback callback, | 1092 FWLMessageHookCallback callback, |
1093 void* info) { | 1093 void* info) { |
1094 CFWL_NoteDriver* noteDriver = static_cast<CFWL_NoteDriver*>(driver); | 1094 CFWL_NoteDriver* noteDriver = static_cast<CFWL_NoteDriver*>(driver); |
1095 noteDriver->SetHook(callback, info); | 1095 noteDriver->SetHook(callback, info); |
1096 return FWL_ERR_Succeeded; | 1096 return FWL_ERR_Succeeded; |
1097 } | 1097 } |
OLD | NEW |