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 #ifndef XFA_FWL_CORE_FWL_NOTEIMP_H_ | 7 #ifndef XFA_FWL_CORE_FWL_NOTEIMP_H_ |
8 #define XFA_FWL_CORE_FWL_NOTEIMP_H_ | 8 #define XFA_FWL_CORE_FWL_NOTEIMP_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <unordered_map> | 11 #include <unordered_map> |
12 | 12 |
13 #include "xfa/fwl/core/cfwl_event.h" | 13 #include "xfa/fwl/core/cfwl_event.h" |
14 #include "xfa/fwl/core/cfwl_message.h" | 14 #include "xfa/fwl/core/cfwl_message.h" |
15 #include "xfa/fwl/core/ifwl_tooltip.h" | 15 #include "xfa/fwl/core/ifwl_tooltip.h" |
16 #include "xfa/fwl/core/ifwl_widget.h" | 16 #include "xfa/fwl/core/ifwl_widget.h" |
17 #include "xfa/fxgraphics/cfx_graphics.h" | 17 #include "xfa/fxgraphics/cfx_graphics.h" |
18 | 18 |
19 class CFWL_EventTarget; | 19 class CFWL_EventTarget; |
20 class CFWL_MsgActivate; | |
21 class CFWL_MsgDeactivate; | |
22 class CFWL_MsgDropFiles; | |
23 class CFWL_MsgKey; | 20 class CFWL_MsgKey; |
24 class CFWL_MsgKillFocus; | 21 class CFWL_MsgKillFocus; |
25 class CFWL_MsgMouse; | 22 class CFWL_MsgMouse; |
26 class CFWL_MsgMouseWheel; | 23 class CFWL_MsgMouseWheel; |
27 class CFWL_MsgSetFocus; | 24 class CFWL_MsgSetFocus; |
28 class CFWL_MsgSize; | |
29 class CFWL_MsgWindowMove; | |
30 class CFWL_TargetImp; | 25 class CFWL_TargetImp; |
31 class IFWL_ToolTip; | 26 class IFWL_ToolTip; |
32 class IFWL_Widget; | 27 class IFWL_Widget; |
33 | 28 |
34 class CFWL_NoteLoop { | 29 class CFWL_NoteLoop { |
35 public: | 30 public: |
36 CFWL_NoteLoop(); | 31 CFWL_NoteLoop(); |
37 ~CFWL_NoteLoop() {} | 32 ~CFWL_NoteLoop() {} |
38 | 33 |
39 IFWL_Widget* GetForm() const { return m_pForm; } | 34 IFWL_Widget* GetForm() const { return m_pForm; } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 71 |
77 void RegisterForm(IFWL_Widget* pForm); | 72 void RegisterForm(IFWL_Widget* pForm); |
78 void UnRegisterForm(IFWL_Widget* pForm); | 73 void UnRegisterForm(IFWL_Widget* pForm); |
79 | 74 |
80 bool QueueMessage(CFWL_Message* pMessage); | 75 bool QueueMessage(CFWL_Message* pMessage); |
81 bool UnqueueMessage(CFWL_NoteLoop* pNoteLoop); | 76 bool UnqueueMessage(CFWL_NoteLoop* pNoteLoop); |
82 bool ProcessMessage(CFWL_Message* pMessage); | 77 bool ProcessMessage(CFWL_Message* pMessage); |
83 | 78 |
84 private: | 79 private: |
85 bool DispatchMessage(CFWL_Message* pMessage, IFWL_Widget* pMessageForm); | 80 bool DispatchMessage(CFWL_Message* pMessage, IFWL_Widget* pMessageForm); |
86 bool DoActivate(CFWL_MsgActivate* pMsg, IFWL_Widget* pMessageForm); | |
87 bool DoDeactivate(CFWL_MsgDeactivate* pMsg, IFWL_Widget* pMessageForm); | |
88 bool DoSetFocus(CFWL_MsgSetFocus* pMsg, IFWL_Widget* pMessageForm); | 81 bool DoSetFocus(CFWL_MsgSetFocus* pMsg, IFWL_Widget* pMessageForm); |
89 bool DoKillFocus(CFWL_MsgKillFocus* pMsg, IFWL_Widget* pMessageForm); | 82 bool DoKillFocus(CFWL_MsgKillFocus* pMsg, IFWL_Widget* pMessageForm); |
90 bool DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm); | 83 bool DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm); |
91 bool DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); | 84 bool DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); |
92 bool DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm); | 85 bool DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm); |
93 bool DoSize(CFWL_MsgSize* pMsg); | |
94 bool DoWindowMove(CFWL_MsgWindowMove* pMsg, IFWL_Widget* pMessageForm); | |
95 bool DoDragFiles(CFWL_MsgDropFiles* pMsg, IFWL_Widget* pMessageForm); | |
96 bool DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); | 86 bool DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); |
97 void MouseSecondary(CFWL_MsgMouse* pMsg); | 87 void MouseSecondary(CFWL_MsgMouse* pMsg); |
98 bool IsValidMessage(CFWL_Message* pMessage); | 88 bool IsValidMessage(CFWL_Message* pMessage); |
99 IFWL_Widget* GetMessageForm(IFWL_Widget* pDstTarget); | 89 IFWL_Widget* GetMessageForm(IFWL_Widget* pDstTarget); |
100 | 90 |
101 CFX_ArrayTemplate<IFWL_Widget*> m_forms; | 91 CFX_ArrayTemplate<IFWL_Widget*> m_forms; |
102 CFX_ArrayTemplate<CFWL_Message*> m_noteQueue; | 92 CFX_ArrayTemplate<CFWL_Message*> m_noteQueue; |
103 CFX_ArrayTemplate<CFWL_NoteLoop*> m_noteLoopQueue; | 93 CFX_ArrayTemplate<CFWL_NoteLoop*> m_noteLoopQueue; |
104 std::unordered_map<uint32_t, CFWL_EventTarget*> m_eventTargets; | 94 std::unordered_map<uint32_t, CFWL_EventTarget*> m_eventTargets; |
105 IFWL_Widget* m_pHover; | 95 IFWL_Widget* m_pHover; |
(...skipping 16 matching lines...) Expand all Loading... |
122 | 112 |
123 private: | 113 private: |
124 bool IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) const; | 114 bool IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) const; |
125 | 115 |
126 CFX_MapPtrTemplate<void*, uint32_t> m_eventSources; | 116 CFX_MapPtrTemplate<void*, uint32_t> m_eventSources; |
127 IFWL_Widget* m_pListener; | 117 IFWL_Widget* m_pListener; |
128 bool m_bInvalid; | 118 bool m_bInvalid; |
129 }; | 119 }; |
130 | 120 |
131 #endif // XFA_FWL_CORE_FWL_NOTEIMP_H_ | 121 #endif // XFA_FWL_CORE_FWL_NOTEIMP_H_ |
OLD | NEW |