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 "xfa/fwl/core/ifwl_notedriver.h" | 10 #include "xfa/fwl/core/cfwl_event.h" |
11 #include "xfa/fwl/core/ifwl_noteloop.h" | 11 #include "xfa/fwl/core/cfwl_message.h" |
| 12 #include "xfa/fwl/core/fwl_error.h" |
| 13 #include "xfa/fwl/core/ifwl_widget.h" |
12 #include "xfa/fxgraphics/include/cfx_graphics.h" | 14 #include "xfa/fxgraphics/include/cfx_graphics.h" |
13 | 15 |
| 16 #define FWL_KEYFLAG_Ctrl (1 << 0) |
| 17 #define FWL_KEYFLAG_Alt (1 << 1) |
| 18 #define FWL_KEYFLAG_Shift (1 << 2) |
| 19 #define FWL_KEYFLAG_Command (1 << 3) |
| 20 #define FWL_KEYFLAG_LButton (1 << 4) |
| 21 #define FWL_KEYFLAG_RButton (1 << 5) |
| 22 #define FWL_KEYFLAG_MButton (1 << 6) |
| 23 |
14 class CFWL_CoreToolTipDP; | 24 class CFWL_CoreToolTipDP; |
15 class CFWL_MsgActivate; | 25 class CFWL_MsgActivate; |
16 class CFWL_MsgDeactivate; | 26 class CFWL_MsgDeactivate; |
17 class CFWL_MsgDropFiles; | 27 class CFWL_MsgDropFiles; |
18 class CFWL_MsgKey; | 28 class CFWL_MsgKey; |
19 class CFWL_MsgKillFocus; | 29 class CFWL_MsgKillFocus; |
20 class CFWL_MsgMouse; | 30 class CFWL_MsgMouse; |
21 class CFWL_MsgMouseWheel; | 31 class CFWL_MsgMouseWheel; |
22 class CFWL_MsgSetFocus; | 32 class CFWL_MsgSetFocus; |
23 class CFWL_MsgSize; | 33 class CFWL_MsgSize; |
24 class CFWL_MsgWindowMove; | 34 class CFWL_MsgWindowMove; |
25 class CFWL_TargetImp; | 35 class CFWL_TargetImp; |
26 class CFWL_ToolTipImp; | 36 class CFWL_ToolTipImp; |
27 class CFWL_WidgetImp; | 37 class CFWL_WidgetImp; |
28 class IFWL_ToolTipTarget; | 38 class IFWL_ToolTipTarget; |
29 | 39 |
30 class CFWL_NoteLoop : public IFWL_NoteLoop { | 40 class CFWL_NoteLoop { |
31 public: | 41 public: |
32 CFWL_NoteLoop(CFWL_WidgetImp* pForm = nullptr); | 42 CFWL_NoteLoop(CFWL_WidgetImp* pForm = nullptr); |
33 ~CFWL_NoteLoop() override {} | 43 ~CFWL_NoteLoop() {} |
34 | 44 |
35 // IFWL_NoteLoop: | 45 FWL_ERR Idle(int32_t count); |
36 FWL_ERR Idle(int32_t count) override; | |
37 | |
38 CFWL_WidgetImp* GetForm(); | 46 CFWL_WidgetImp* GetForm(); |
39 FX_BOOL ContinueModal(); | 47 FX_BOOL ContinueModal(); |
40 FWL_ERR EndModalLoop(); | 48 FWL_ERR EndModalLoop(); |
41 FWL_ERR SetMainForm(CFWL_WidgetImp* pForm); | 49 FWL_ERR SetMainForm(CFWL_WidgetImp* pForm); |
42 | 50 |
43 protected: | 51 protected: |
44 void GenerateCommondEvent(uint32_t dwCommand); | 52 void GenerateCommondEvent(uint32_t dwCommand); |
45 | 53 |
46 CFWL_WidgetImp* m_pForm; | 54 CFWL_WidgetImp* m_pForm; |
47 FX_BOOL m_bContinueModal; | 55 FX_BOOL m_bContinueModal; |
48 }; | 56 }; |
49 | 57 |
50 class CFWL_NoteDriver : public IFWL_NoteDriver { | 58 class CFWL_NoteDriver { |
51 public: | 59 public: |
52 CFWL_NoteDriver(); | 60 CFWL_NoteDriver(); |
53 ~CFWL_NoteDriver() override; | 61 ~CFWL_NoteDriver(); |
54 | 62 |
55 // IFWL_NoteDriver: | 63 FX_BOOL SendEvent(CFWL_Event* pNote); |
56 FX_BOOL SendEvent(CFWL_Event* pNote) override; | |
57 FWL_ERR RegisterEventTarget(IFWL_Widget* pListener, | 64 FWL_ERR RegisterEventTarget(IFWL_Widget* pListener, |
58 IFWL_Widget* pEventSource = nullptr, | 65 IFWL_Widget* pEventSource = nullptr, |
59 uint32_t dwFilter = FWL_EVENT_ALL_MASK) override; | 66 uint32_t dwFilter = FWL_EVENT_ALL_MASK); |
60 FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener) override; | 67 FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener); |
61 void ClearEventTargets(FX_BOOL bRemoveAll) override; | 68 void ClearEventTargets(FX_BOOL bRemoveAll); |
62 IFWL_Thread* GetOwnerThread() const override; | 69 IFWL_App* GetOwnerApp() const; |
63 FWL_ERR PushNoteLoop(IFWL_NoteLoop* pNoteLoop) override; | 70 FWL_ERR PushNoteLoop(CFWL_NoteLoop* pNoteLoop); |
64 IFWL_NoteLoop* PopNoteLoop() override; | 71 CFWL_NoteLoop* PopNoteLoop(); |
65 IFWL_Widget* GetFocus() override; | 72 IFWL_Widget* GetFocus(); |
66 FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE) override; | 73 FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE); |
67 void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet) override; | 74 void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet); |
68 FWL_ERR Run() override; | 75 FWL_ERR Run(); |
69 | 76 |
70 IFWL_Widget* GetHover(); | 77 IFWL_Widget* GetHover(); |
71 void SetHover(IFWL_Widget* pHover); | 78 void SetHover(IFWL_Widget* pHover); |
72 void NotifyTargetHide(IFWL_Widget* pNoteTarget); | 79 void NotifyTargetHide(IFWL_Widget* pNoteTarget); |
73 void NotifyTargetDestroy(IFWL_Widget* pNoteTarget); | 80 void NotifyTargetDestroy(IFWL_Widget* pNoteTarget); |
74 FWL_ERR RegisterForm(CFWL_WidgetImp* pForm); | 81 FWL_ERR RegisterForm(CFWL_WidgetImp* pForm); |
75 FWL_ERR UnRegisterForm(CFWL_WidgetImp* pForm); | 82 FWL_ERR UnRegisterForm(CFWL_WidgetImp* pForm); |
76 FX_BOOL QueueMessage(CFWL_Message* pMessage); | 83 FX_BOOL QueueMessage(CFWL_Message* pMessage); |
77 FX_BOOL UnqueueMessage(CFWL_NoteLoop* pNoteLoop); | 84 FX_BOOL UnqueueMessage(CFWL_NoteLoop* pNoteLoop); |
78 CFWL_NoteLoop* GetTopLoop(); | 85 CFWL_NoteLoop* GetTopLoop(); |
(...skipping 10 matching lines...) Expand all Loading... |
89 FX_BOOL DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); | 96 FX_BOOL DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); |
90 FX_BOOL DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm); | 97 FX_BOOL DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm); |
91 FX_BOOL DoSize(CFWL_MsgSize* pMsg); | 98 FX_BOOL DoSize(CFWL_MsgSize* pMsg); |
92 FX_BOOL DoWindowMove(CFWL_MsgWindowMove* pMsg, IFWL_Widget* pMessageForm); | 99 FX_BOOL DoWindowMove(CFWL_MsgWindowMove* pMsg, IFWL_Widget* pMessageForm); |
93 FX_BOOL DoDragFiles(CFWL_MsgDropFiles* pMsg, IFWL_Widget* pMessageForm); | 100 FX_BOOL DoDragFiles(CFWL_MsgDropFiles* pMsg, IFWL_Widget* pMessageForm); |
94 FX_BOOL DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); | 101 FX_BOOL DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); |
95 void MouseSecondary(CFWL_MsgMouse* pMsg); | 102 void MouseSecondary(CFWL_MsgMouse* pMsg); |
96 FX_BOOL IsValidMessage(CFWL_Message* pMessage); | 103 FX_BOOL IsValidMessage(CFWL_Message* pMessage); |
97 IFWL_Widget* GetMessageForm(IFWL_Widget* pDstTarget); | 104 IFWL_Widget* GetMessageForm(IFWL_Widget* pDstTarget); |
98 void ClearInvalidEventTargets(FX_BOOL bRemoveAll); | 105 void ClearInvalidEventTargets(FX_BOOL bRemoveAll); |
99 CFX_ArrayTemplate<CFWL_TargetImp*> m_forms; | 106 |
| 107 CFX_ArrayTemplate<CFWL_WidgetImp*> m_forms; |
100 CFX_ArrayTemplate<CFWL_Message*> m_noteQueue; | 108 CFX_ArrayTemplate<CFWL_Message*> m_noteQueue; |
101 CFX_ArrayTemplate<IFWL_NoteLoop*> m_noteLoopQueue; | 109 CFX_ArrayTemplate<CFWL_NoteLoop*> m_noteLoopQueue; |
102 CFX_MapPtrToPtr m_eventTargets; | 110 CFX_MapPtrToPtr m_eventTargets; |
103 int32_t m_sendEventCalled; | 111 int32_t m_sendEventCalled; |
104 IFWL_Widget* m_pHover; | 112 IFWL_Widget* m_pHover; |
105 IFWL_Widget* m_pFocus; | 113 IFWL_Widget* m_pFocus; |
106 IFWL_Widget* m_pGrab; | 114 IFWL_Widget* m_pGrab; |
107 CFWL_NoteLoop* m_pNoteLoop; | 115 CFWL_NoteLoop* m_pNoteLoop; |
108 }; | 116 }; |
109 | 117 |
110 class CFWL_EventTarget { | 118 class CFWL_EventTarget { |
111 public: | 119 public: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 IFWL_ToolTipTarget* pCurTarget; | 155 IFWL_ToolTipTarget* pCurTarget; |
148 CFWL_ToolTipImp* m_pToolTipImp; | 156 CFWL_ToolTipImp* m_pToolTipImp; |
149 CFWL_CoreToolTipDP* m_ToolTipDp; | 157 CFWL_CoreToolTipDP* m_ToolTipDp; |
150 CFX_ArrayTemplate<IFWL_ToolTipTarget*> m_arrWidget; | 158 CFX_ArrayTemplate<IFWL_ToolTipTarget*> m_arrWidget; |
151 | 159 |
152 private: | 160 private: |
153 static CFWL_ToolTipContainer* s_pInstance; | 161 static CFWL_ToolTipContainer* s_pInstance; |
154 }; | 162 }; |
155 | 163 |
156 #endif // XFA_FWL_CORE_FWL_NOTEIMP_H_ | 164 #endif // XFA_FWL_CORE_FWL_NOTEIMP_H_ |
OLD | NEW |