| 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" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } else { | 154 } else { |
| 155 if (!pNote->m_pDstTarget) | 155 if (!pNote->m_pDstTarget) |
| 156 return FALSE; | 156 return FALSE; |
| 157 IFWL_WidgetDelegate* pDelegate = pNote->m_pDstTarget->SetDelegate(NULL); | 157 IFWL_WidgetDelegate* pDelegate = pNote->m_pDstTarget->SetDelegate(NULL); |
| 158 if (pDelegate) { | 158 if (pDelegate) { |
| 159 pDelegate->OnProcessMessage(static_cast<CFWL_Message*>(pNote)); | 159 pDelegate->OnProcessMessage(static_cast<CFWL_Message*>(pNote)); |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 return TRUE; | 162 return TRUE; |
| 163 } | 163 } |
| 164 extern void FWL_PostMessageToMainRoop(CFWL_Message* pMessage); | 164 |
| 165 FX_BOOL CFWL_NoteDriver::PostMessage(CFWL_Message* pMessage) { | |
| 166 FWL_PostMessageToMainRoop(pMessage); | |
| 167 return TRUE; | |
| 168 } | |
| 169 #define FWL_NoteDriver_EventKey 1100 | 165 #define FWL_NoteDriver_EventKey 1100 |
| 170 FWL_ERR CFWL_NoteDriver::RegisterEventTarget(IFWL_Widget* pListener, | 166 FWL_ERR CFWL_NoteDriver::RegisterEventTarget(IFWL_Widget* pListener, |
| 171 IFWL_Widget* pEventSource, | 167 IFWL_Widget* pEventSource, |
| 172 FX_DWORD dwFilter) { | 168 FX_DWORD dwFilter) { |
| 173 FX_DWORD dwkey = (FX_DWORD)(uintptr_t)pListener->GetPrivateData( | 169 FX_DWORD dwkey = (FX_DWORD)(uintptr_t)pListener->GetPrivateData( |
| 174 (void*)(uintptr_t)FWL_NoteDriver_EventKey); | 170 (void*)(uintptr_t)FWL_NoteDriver_EventKey); |
| 175 if (dwkey == 0) { | 171 if (dwkey == 0) { |
| 176 void* random = FX_Random_MT_Start(0); | 172 void* random = FX_Random_MT_Start(0); |
| 177 dwkey = rand(); | 173 dwkey = rand(); |
| 178 FX_Random_MT_Close(random); | 174 FX_Random_MT_Close(random); |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 return NULL; | 1086 return NULL; |
| 1091 return widget->GetInterface(); | 1087 return widget->GetInterface(); |
| 1092 } | 1088 } |
| 1093 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, | 1089 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, |
| 1094 FWLMessageHookCallback callback, | 1090 FWLMessageHookCallback callback, |
| 1095 void* info) { | 1091 void* info) { |
| 1096 CFWL_NoteDriver* noteDriver = static_cast<CFWL_NoteDriver*>(driver); | 1092 CFWL_NoteDriver* noteDriver = static_cast<CFWL_NoteDriver*>(driver); |
| 1097 noteDriver->SetHook(callback, info); | 1093 noteDriver->SetHook(callback, info); |
| 1098 return FWL_ERR_Succeeded; | 1094 return FWL_ERR_Succeeded; |
| 1099 } | 1095 } |
| OLD | NEW |