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 "../../../foxitlib.h" | 7 #include "../../../foxitlib.h" |
8 #include "include/fwl_targetimp.h" | 8 #include "include/fwl_targetimp.h" |
9 #include "include/fwl_widgetimp.h" | 9 #include "include/fwl_widgetimp.h" |
10 #include "include/fwl_widgetmgrimp.h" | 10 #include "include/fwl_widgetmgrimp.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 IFWL_NoteThread* pThread = m_pForm->GetOwnerThread(); | 86 IFWL_NoteThread* pThread = m_pForm->GetOwnerThread(); |
87 _FWL_RETURN_IF_FAIL(pThread); | 87 _FWL_RETURN_IF_FAIL(pThread); |
88 IFWL_NoteDriver* pDriver = pThread->GetNoteDriver(); | 88 IFWL_NoteDriver* pDriver = pThread->GetNoteDriver(); |
89 _FWL_RETURN_IF_FAIL(pDriver); | 89 _FWL_RETURN_IF_FAIL(pDriver); |
90 pDriver->SendNote(&ev); | 90 pDriver->SendNote(&ev); |
91 } | 91 } |
92 CFWL_NoteDriver::CFWL_NoteDriver() | 92 CFWL_NoteDriver::CFWL_NoteDriver() |
93 : m_sendEventCalled(0), | 93 : m_sendEventCalled(0), |
94 m_maxSize(500), | 94 m_maxSize(500), |
95 m_bFullScreen(FALSE), | 95 m_bFullScreen(FALSE), |
96 m_pFocus(NULL), | 96 m_pHover(nullptr), |
97 m_pHover(NULL), | 97 m_pFocus(nullptr), |
98 m_pGrab(NULL), | 98 m_pGrab(nullptr), |
99 m_hook(NULL) { | 99 m_hook(nullptr) { |
100 m_pNoteLoop = new CFWL_NoteLoop; | 100 m_pNoteLoop = new CFWL_NoteLoop; |
101 PushNoteLoop((IFWL_NoteLoop*)m_pNoteLoop); | 101 PushNoteLoop((IFWL_NoteLoop*)m_pNoteLoop); |
102 } | 102 } |
103 CFWL_NoteDriver::~CFWL_NoteDriver() { | 103 CFWL_NoteDriver::~CFWL_NoteDriver() { |
104 if (m_pNoteLoop) { | 104 if (m_pNoteLoop) { |
105 delete m_pNoteLoop; | 105 delete m_pNoteLoop; |
106 m_pNoteLoop = NULL; | 106 m_pNoteLoop = NULL; |
107 } | 107 } |
108 ClearInvalidEventTargets(TRUE); | 108 ClearInvalidEventTargets(TRUE); |
109 } | 109 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 213 } |
214 FX_BOOL CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify) { | 214 FX_BOOL CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify) { |
215 if (m_pFocus == pFocus) { | 215 if (m_pFocus == pFocus) { |
216 return TRUE; | 216 return TRUE; |
217 } | 217 } |
218 IFWL_Widget* pPrev = m_pFocus; | 218 IFWL_Widget* pPrev = m_pFocus; |
219 m_pFocus = pFocus; | 219 m_pFocus = pFocus; |
220 if (pPrev) { | 220 if (pPrev) { |
221 IFWL_Widget* pWidget = | 221 IFWL_Widget* pWidget = |
222 FWL_GetWidgetMgr()->GetWidget(m_pFocus, FWL_WGTRELATION_SystemForm); | 222 FWL_GetWidgetMgr()->GetWidget(m_pFocus, FWL_WGTRELATION_SystemForm); |
223 CFWL_FormImp* pForm = | |
224 pWidget ? (CFWL_FormImp*)((IFWL_TargetData*)pWidget)->GetData() : NULL; | |
225 CFWL_MsgKillFocus ms; | 223 CFWL_MsgKillFocus ms; |
226 ms.m_pDstTarget = pPrev; | 224 ms.m_pDstTarget = pPrev; |
227 ms.m_pSrcTarget = pPrev; | 225 ms.m_pSrcTarget = pPrev; |
228 if (bNotify) { | 226 if (bNotify) { |
229 ms.m_dwExtend = 1; | 227 ms.m_dwExtend = 1; |
230 } | 228 } |
231 IFWL_WidgetDelegate* pDelegate = pPrev->SetDelegate(NULL); | 229 IFWL_WidgetDelegate* pDelegate = pPrev->SetDelegate(NULL); |
232 if (pDelegate) { | 230 if (pDelegate) { |
233 pDelegate->OnProcessMessage(&ms); | 231 pDelegate->OnProcessMessage(&ms); |
234 } | 232 } |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 _FWL_RETURN_VALUE_IF_FAIL(widget, NULL); | 1071 _FWL_RETURN_VALUE_IF_FAIL(widget, NULL); |
1074 return widget->GetInterface(); | 1072 return widget->GetInterface(); |
1075 } | 1073 } |
1076 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, | 1074 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, |
1077 FWLMessageHookCallback callback, | 1075 FWLMessageHookCallback callback, |
1078 void* info) { | 1076 void* info) { |
1079 CFWL_NoteDriver* noteDriver = (CFWL_NoteDriver*)driver; | 1077 CFWL_NoteDriver* noteDriver = (CFWL_NoteDriver*)driver; |
1080 noteDriver->SetHook(callback, info); | 1078 noteDriver->SetHook(callback, info); |
1081 return FWL_ERR_Succeeded; | 1079 return FWL_ERR_Succeeded; |
1082 } | 1080 } |
OLD | NEW |