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> |
(...skipping 21 matching lines...) Expand all Loading... |
32 class IFWL_ToolTip; | 32 class IFWL_ToolTip; |
33 class IFWL_Widget; | 33 class IFWL_Widget; |
34 | 34 |
35 class CFWL_NoteLoop { | 35 class CFWL_NoteLoop { |
36 public: | 36 public: |
37 CFWL_NoteLoop(IFWL_Widget* pForm = nullptr); | 37 CFWL_NoteLoop(IFWL_Widget* pForm = nullptr); |
38 ~CFWL_NoteLoop() {} | 38 ~CFWL_NoteLoop() {} |
39 | 39 |
40 FWL_Error Idle(int32_t count); | 40 FWL_Error Idle(int32_t count); |
41 IFWL_Widget* GetForm(); | 41 IFWL_Widget* GetForm(); |
42 FX_BOOL ContinueModal(); | 42 bool ContinueModal(); |
43 FWL_Error EndModalLoop(); | 43 FWL_Error EndModalLoop(); |
44 FWL_Error SetMainForm(IFWL_Widget* pForm); | 44 FWL_Error SetMainForm(IFWL_Widget* pForm); |
45 | 45 |
46 protected: | 46 protected: |
47 void GenerateCommondEvent(uint32_t dwCommand); | 47 void GenerateCommondEvent(uint32_t dwCommand); |
48 | 48 |
49 IFWL_Widget* m_pForm; | 49 IFWL_Widget* m_pForm; |
50 FX_BOOL m_bContinueModal; | 50 bool m_bContinueModal; |
51 }; | 51 }; |
52 | 52 |
53 class CFWL_NoteDriver { | 53 class CFWL_NoteDriver { |
54 public: | 54 public: |
55 CFWL_NoteDriver(); | 55 CFWL_NoteDriver(); |
56 ~CFWL_NoteDriver(); | 56 ~CFWL_NoteDriver(); |
57 | 57 |
58 void SendEvent(CFWL_Event* pNote); | 58 void SendEvent(CFWL_Event* pNote); |
59 FWL_Error RegisterEventTarget(IFWL_Widget* pListener, | 59 FWL_Error RegisterEventTarget(IFWL_Widget* pListener, |
60 IFWL_Widget* pEventSource = nullptr, | 60 IFWL_Widget* pEventSource = nullptr, |
61 uint32_t dwFilter = FWL_EVENT_ALL_MASK); | 61 uint32_t dwFilter = FWL_EVENT_ALL_MASK); |
62 FWL_Error UnregisterEventTarget(IFWL_Widget* pListener); | 62 FWL_Error UnregisterEventTarget(IFWL_Widget* pListener); |
63 void ClearEventTargets(FX_BOOL bRemoveAll); | 63 void ClearEventTargets(bool bRemoveAll); |
64 FWL_Error PushNoteLoop(CFWL_NoteLoop* pNoteLoop); | 64 FWL_Error PushNoteLoop(CFWL_NoteLoop* pNoteLoop); |
65 CFWL_NoteLoop* PopNoteLoop(); | 65 CFWL_NoteLoop* PopNoteLoop(); |
66 IFWL_Widget* GetFocus(); | 66 IFWL_Widget* GetFocus(); |
67 FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE); | 67 bool SetFocus(IFWL_Widget* pFocus, bool bNotify = false); |
68 void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet); | 68 void SetGrab(IFWL_Widget* pGrab, bool bSet); |
69 FWL_Error Run(); | 69 FWL_Error Run(); |
70 | 70 |
71 IFWL_Widget* GetHover(); | 71 IFWL_Widget* GetHover(); |
72 void SetHover(IFWL_Widget* pHover); | 72 void SetHover(IFWL_Widget* pHover); |
73 void NotifyTargetHide(IFWL_Widget* pNoteTarget); | 73 void NotifyTargetHide(IFWL_Widget* pNoteTarget); |
74 void NotifyTargetDestroy(IFWL_Widget* pNoteTarget); | 74 void NotifyTargetDestroy(IFWL_Widget* pNoteTarget); |
75 FWL_Error RegisterForm(IFWL_Widget* pForm); | 75 FWL_Error RegisterForm(IFWL_Widget* pForm); |
76 FWL_Error UnRegisterForm(IFWL_Widget* pForm); | 76 FWL_Error UnRegisterForm(IFWL_Widget* pForm); |
77 FX_BOOL QueueMessage(CFWL_Message* pMessage); | 77 bool QueueMessage(CFWL_Message* pMessage); |
78 FX_BOOL UnqueueMessage(CFWL_NoteLoop* pNoteLoop); | 78 bool UnqueueMessage(CFWL_NoteLoop* pNoteLoop); |
79 CFWL_NoteLoop* GetTopLoop(); | 79 CFWL_NoteLoop* GetTopLoop(); |
80 int32_t CountLoop(); | 80 int32_t CountLoop(); |
81 FX_BOOL ProcessMessage(CFWL_Message* pMessage); | 81 bool ProcessMessage(CFWL_Message* pMessage); |
82 | 82 |
83 protected: | 83 protected: |
84 FX_BOOL DispatchMessage(CFWL_Message* pMessage, IFWL_Widget* pMessageForm); | 84 bool DispatchMessage(CFWL_Message* pMessage, IFWL_Widget* pMessageForm); |
85 FX_BOOL DoActivate(CFWL_MsgActivate* pMsg, IFWL_Widget* pMessageForm); | 85 bool DoActivate(CFWL_MsgActivate* pMsg, IFWL_Widget* pMessageForm); |
86 FX_BOOL DoDeactivate(CFWL_MsgDeactivate* pMsg, IFWL_Widget* pMessageForm); | 86 bool DoDeactivate(CFWL_MsgDeactivate* pMsg, IFWL_Widget* pMessageForm); |
87 FX_BOOL DoSetFocus(CFWL_MsgSetFocus* pMsg, IFWL_Widget* pMessageForm); | 87 bool DoSetFocus(CFWL_MsgSetFocus* pMsg, IFWL_Widget* pMessageForm); |
88 FX_BOOL DoKillFocus(CFWL_MsgKillFocus* pMsg, IFWL_Widget* pMessageForm); | 88 bool DoKillFocus(CFWL_MsgKillFocus* pMsg, IFWL_Widget* pMessageForm); |
89 FX_BOOL DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm); | 89 bool DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm); |
90 FX_BOOL DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); | 90 bool DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); |
91 FX_BOOL DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm); | 91 bool DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm); |
92 FX_BOOL DoSize(CFWL_MsgSize* pMsg); | 92 bool DoSize(CFWL_MsgSize* pMsg); |
93 FX_BOOL DoWindowMove(CFWL_MsgWindowMove* pMsg, IFWL_Widget* pMessageForm); | 93 bool DoWindowMove(CFWL_MsgWindowMove* pMsg, IFWL_Widget* pMessageForm); |
94 FX_BOOL DoDragFiles(CFWL_MsgDropFiles* pMsg, IFWL_Widget* pMessageForm); | 94 bool DoDragFiles(CFWL_MsgDropFiles* pMsg, IFWL_Widget* pMessageForm); |
95 FX_BOOL DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); | 95 bool DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); |
96 void MouseSecondary(CFWL_MsgMouse* pMsg); | 96 void MouseSecondary(CFWL_MsgMouse* pMsg); |
97 FX_BOOL IsValidMessage(CFWL_Message* pMessage); | 97 bool IsValidMessage(CFWL_Message* pMessage); |
98 IFWL_Widget* GetMessageForm(IFWL_Widget* pDstTarget); | 98 IFWL_Widget* GetMessageForm(IFWL_Widget* pDstTarget); |
99 void ClearInvalidEventTargets(FX_BOOL bRemoveAll); | 99 void ClearInvalidEventTargets(bool bRemoveAll); |
100 | 100 |
101 CFX_ArrayTemplate<IFWL_Widget*> m_forms; | 101 CFX_ArrayTemplate<IFWL_Widget*> m_forms; |
102 CFX_ArrayTemplate<CFWL_Message*> m_noteQueue; | 102 CFX_ArrayTemplate<CFWL_Message*> m_noteQueue; |
103 CFX_ArrayTemplate<CFWL_NoteLoop*> m_noteLoopQueue; | 103 CFX_ArrayTemplate<CFWL_NoteLoop*> m_noteLoopQueue; |
104 std::unordered_map<uint32_t, CFWL_EventTarget*> m_eventTargets; | 104 std::unordered_map<uint32_t, CFWL_EventTarget*> m_eventTargets; |
105 IFWL_Widget* m_pHover; | 105 IFWL_Widget* m_pHover; |
106 IFWL_Widget* m_pFocus; | 106 IFWL_Widget* m_pFocus; |
107 IFWL_Widget* m_pGrab; | 107 IFWL_Widget* m_pGrab; |
108 std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop; | 108 std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop; |
109 }; | 109 }; |
110 | 110 |
111 class CFWL_EventTarget { | 111 class CFWL_EventTarget { |
112 public: | 112 public: |
113 CFWL_EventTarget(CFWL_NoteDriver* pNoteDriver, IFWL_Widget* pListener); | 113 CFWL_EventTarget(CFWL_NoteDriver* pNoteDriver, IFWL_Widget* pListener); |
114 ~CFWL_EventTarget(); | 114 ~CFWL_EventTarget(); |
115 | 115 |
116 int32_t SetEventSource(IFWL_Widget* pSource, | 116 int32_t SetEventSource(IFWL_Widget* pSource, |
117 uint32_t dwFilter = FWL_EVENT_ALL_MASK); | 117 uint32_t dwFilter = FWL_EVENT_ALL_MASK); |
118 FX_BOOL ProcessEvent(CFWL_Event* pEvent); | 118 bool ProcessEvent(CFWL_Event* pEvent); |
119 FX_BOOL IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter); | 119 bool IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter); |
120 FX_BOOL IsInvalid() { return m_bInvalid; } | 120 bool IsInvalid() { return m_bInvalid; } |
121 void FlagInvalid() { m_bInvalid = TRUE; } | 121 void FlagInvalid() { m_bInvalid = true; } |
122 | 122 |
123 protected: | 123 protected: |
124 CFX_MapPtrTemplate<void*, uint32_t> m_eventSources; | 124 CFX_MapPtrTemplate<void*, uint32_t> m_eventSources; |
125 IFWL_Widget* m_pListener; | 125 IFWL_Widget* m_pListener; |
126 CFWL_NoteDriver* m_pNoteDriver; | 126 CFWL_NoteDriver* m_pNoteDriver; |
127 FX_BOOL m_bInvalid; | 127 bool m_bInvalid; |
128 }; | 128 }; |
129 | 129 |
130 class CFWL_ToolTipContainer final { | 130 class CFWL_ToolTipContainer final { |
131 public: | 131 public: |
132 static CFWL_ToolTipContainer* getInstance(); | 132 static CFWL_ToolTipContainer* getInstance(); |
133 static void DeleteInstance(); | 133 static void DeleteInstance(); |
134 | 134 |
135 protected: | 135 protected: |
136 CFWL_ToolTipContainer(); | 136 CFWL_ToolTipContainer(); |
137 ~CFWL_ToolTipContainer(); | 137 ~CFWL_ToolTipContainer(); |
138 | 138 |
139 std::unique_ptr<CFWL_CoreToolTipDP> m_pToolTipDp; | 139 std::unique_ptr<CFWL_CoreToolTipDP> m_pToolTipDp; |
140 | 140 |
141 private: | 141 private: |
142 static CFWL_ToolTipContainer* s_pInstance; | 142 static CFWL_ToolTipContainer* s_pInstance; |
143 }; | 143 }; |
144 | 144 |
145 #endif // XFA_FWL_CORE_FWL_NOTEIMP_H_ | 145 #endif // XFA_FWL_CORE_FWL_NOTEIMP_H_ |
OLD | NEW |