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/fwl_noteimp.h" | 7 #include "xfa/fwl/core/fwl_noteimp.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h" | 10 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h" |
11 #include "xfa/fwl/basewidget/ifwl_tooltip.h" | 11 #include "xfa/fwl/basewidget/ifwl_tooltip.h" |
12 #include "xfa/fwl/core/cfwl_message.h" | 12 #include "xfa/fwl/core/cfwl_message.h" |
13 #include "xfa/fwl/core/fwl_appimp.h" | 13 #include "xfa/fwl/core/fwl_appimp.h" |
14 #include "xfa/fwl/core/fwl_formimp.h" | 14 #include "xfa/fwl/core/fwl_formimp.h" |
15 #include "xfa/fwl/core/fwl_widgetimp.h" | 15 #include "xfa/fwl/core/fwl_widgetimp.h" |
16 #include "xfa/fwl/core/fwl_widgetmgrimp.h" | 16 #include "xfa/fwl/core/fwl_widgetmgrimp.h" |
17 #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" | |
18 #include "xfa/fwl/core/ifwl_app.h" | 17 #include "xfa/fwl/core/ifwl_app.h" |
19 #include "xfa/fwl/core/ifwl_tooltiptarget.h" | 18 #include "xfa/fwl/core/ifwl_tooltiptarget.h" |
20 | 19 |
21 CFWL_NoteLoop::CFWL_NoteLoop(CFWL_WidgetImp* pForm) | 20 CFWL_NoteLoop::CFWL_NoteLoop(CFWL_WidgetImp* pForm) |
22 : m_pForm(pForm), m_bContinueModal(TRUE) {} | 21 : m_pForm(pForm), m_bContinueModal(TRUE) {} |
23 | 22 |
24 FWL_ERR CFWL_NoteLoop::Idle(int32_t count) { | 23 FWL_ERR CFWL_NoteLoop::Idle(int32_t count) { |
25 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) | 24 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) |
26 if (count <= 0) { | 25 if (count <= 0) { |
27 #endif | 26 #endif |
(...skipping 13 matching lines...) Expand all Loading... |
41 CFWL_WidgetImp* CFWL_NoteLoop::GetForm() { | 40 CFWL_WidgetImp* CFWL_NoteLoop::GetForm() { |
42 return m_pForm; | 41 return m_pForm; |
43 } | 42 } |
44 FX_BOOL CFWL_NoteLoop::ContinueModal() { | 43 FX_BOOL CFWL_NoteLoop::ContinueModal() { |
45 return m_bContinueModal; | 44 return m_bContinueModal; |
46 } | 45 } |
47 FWL_ERR CFWL_NoteLoop::EndModalLoop() { | 46 FWL_ERR CFWL_NoteLoop::EndModalLoop() { |
48 m_bContinueModal = FALSE; | 47 m_bContinueModal = FALSE; |
49 #if (_FX_OS_ == _FX_MACOSX_) | 48 #if (_FX_OS_ == _FX_MACOSX_) |
50 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); | 49 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
51 IFWL_AdapterWidgetMgr* adapterWidgetMgr = pWidgetMgr->GetAdapterWidgetMgr(); | 50 CXFA_FWLAdapterWidgetMgr* adapterWidgetMgr = |
| 51 pWidgetMgr->GetAdapterWidgetMgr(); |
52 adapterWidgetMgr->EndLoop(); | 52 adapterWidgetMgr->EndLoop(); |
53 #endif | 53 #endif |
54 return FWL_ERR_Succeeded; | 54 return FWL_ERR_Succeeded; |
55 } | 55 } |
56 | 56 |
57 FWL_ERR CFWL_NoteLoop::SetMainForm(CFWL_WidgetImp* pForm) { | 57 FWL_ERR CFWL_NoteLoop::SetMainForm(CFWL_WidgetImp* pForm) { |
58 m_pForm = pForm; | 58 m_pForm = pForm; |
59 return FWL_ERR_Succeeded; | 59 return FWL_ERR_Succeeded; |
60 } | 60 } |
61 void CFWL_NoteLoop::GenerateCommondEvent(uint32_t dwCommand) { | 61 void CFWL_NoteLoop::GenerateCommondEvent(uint32_t dwCommand) { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 if (pWidgetMgr->IsIdleMessage_Native()) { | 247 if (pWidgetMgr->IsIdleMessage_Native()) { |
248 bIdle = TRUE; | 248 bIdle = TRUE; |
249 iIdleCount = 0; | 249 iIdleCount = 0; |
250 } | 250 } |
251 } while (pWidgetMgr->CheckMessage_Native()); | 251 } while (pWidgetMgr->CheckMessage_Native()); |
252 } | 252 } |
253 #elif(_FX_OS_ == _FX_LINUX_DESKTOP_) | 253 #elif(_FX_OS_ == _FX_LINUX_DESKTOP_) |
254 CFWL_NoteLoop* pTopLoop = NULL; | 254 CFWL_NoteLoop* pTopLoop = NULL; |
255 for (;;) { | 255 for (;;) { |
256 pTopLoop = GetTopLoop(); | 256 pTopLoop = GetTopLoop(); |
257 if (!pTopLoop || !pTopLoop->ContinueModal()) { | 257 if (!pTopLoop || !pTopLoop->ContinueModal()) |
258 break; | 258 break; |
259 } | 259 if (UnqueueMessage(pTopLoop)) |
260 if (UnqueueMessage(pTopLoop)) { | |
261 continue; | 260 continue; |
262 } | |
263 if (pWidgetMgr->CheckMessage_Native()) { | |
264 pWidgetMgr->DispatchMessage_Native(); | |
265 } | |
266 } | 261 } |
267 #endif | 262 #endif |
268 return FWL_ERR_Succeeded; | 263 return FWL_ERR_Succeeded; |
269 } | 264 } |
270 IFWL_Widget* CFWL_NoteDriver::GetFocus() { | 265 IFWL_Widget* CFWL_NoteDriver::GetFocus() { |
271 return m_pFocus; | 266 return m_pFocus; |
272 } | 267 } |
273 IFWL_Widget* CFWL_NoteDriver::GetHover() { | 268 IFWL_Widget* CFWL_NoteDriver::GetHover() { |
274 return m_pHover; | 269 return m_pHover; |
275 } | 270 } |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 if (HasToolTip(pEvt->m_pDstTarget) && NULL != m_pToolTipImp) { | 963 if (HasToolTip(pEvt->m_pDstTarget) && NULL != m_pToolTipImp) { |
969 m_pToolTipImp->Hide(); | 964 m_pToolTipImp->Hide(); |
970 pCurTarget = NULL; | 965 pCurTarget = NULL; |
971 return TRUE; | 966 return TRUE; |
972 } | 967 } |
973 return FALSE; | 968 return FALSE; |
974 } | 969 } |
975 IFWL_ToolTipTarget* CFWL_ToolTipContainer::GetCurrentToolTipTarget() { | 970 IFWL_ToolTipTarget* CFWL_ToolTipContainer::GetCurrentToolTipTarget() { |
976 return pCurTarget; | 971 return pCurTarget; |
977 } | 972 } |
OLD | NEW |