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_ToolTipImp; | 35 class CFWL_ToolTipImp; |
26 class CFWL_WidgetImp; | 36 class CFWL_WidgetImp; |
27 class IFWL_ToolTipTarget; | 37 class IFWL_ToolTipTarget; |
28 | 38 |
29 class CFWL_NoteLoop : public IFWL_NoteLoop { | 39 class CFWL_NoteLoop { |
30 public: | 40 public: |
31 CFWL_NoteLoop(CFWL_WidgetImp* pForm = nullptr); | 41 CFWL_NoteLoop(CFWL_WidgetImp* pForm = nullptr); |
32 ~CFWL_NoteLoop() override {} | 42 ~CFWL_NoteLoop() {} |
33 | 43 |
34 // IFWL_NoteLoop: | 44 FWL_ERR Idle(int32_t count); |
35 FWL_ERR Idle(int32_t count) override; | |
36 | |
37 CFWL_WidgetImp* GetForm(); | 45 CFWL_WidgetImp* GetForm(); |
38 FX_BOOL ContinueModal(); | 46 FX_BOOL ContinueModal(); |
39 FWL_ERR EndModalLoop(); | 47 FWL_ERR EndModalLoop(); |
40 FWL_ERR SetMainForm(CFWL_WidgetImp* pForm); | 48 FWL_ERR SetMainForm(CFWL_WidgetImp* pForm); |
41 | 49 |
42 protected: | 50 protected: |
43 void GenerateCommondEvent(uint32_t dwCommand); | 51 void GenerateCommondEvent(uint32_t dwCommand); |
44 | 52 |
45 CFWL_WidgetImp* m_pForm; | 53 CFWL_WidgetImp* m_pForm; |
46 FX_BOOL m_bContinueModal; | 54 FX_BOOL m_bContinueModal; |
47 }; | 55 }; |
48 | 56 |
49 class CFWL_NoteDriver : public IFWL_NoteDriver { | 57 class CFWL_NoteDriver { |
50 public: | 58 public: |
51 CFWL_NoteDriver(); | 59 CFWL_NoteDriver(); |
52 ~CFWL_NoteDriver() override; | 60 ~CFWL_NoteDriver(); |
53 | 61 |
54 // IFWL_NoteDriver: | 62 FX_BOOL SendEvent(CFWL_Event* pNote); |
55 FX_BOOL SendEvent(CFWL_Event* pNote) override; | |
56 FWL_ERR RegisterEventTarget(IFWL_Widget* pListener, | 63 FWL_ERR RegisterEventTarget(IFWL_Widget* pListener, |
57 IFWL_Widget* pEventSource = nullptr, | 64 IFWL_Widget* pEventSource = nullptr, |
58 uint32_t dwFilter = FWL_EVENT_ALL_MASK) override; | 65 uint32_t dwFilter = FWL_EVENT_ALL_MASK); |
59 FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener) override; | 66 FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener); |
60 void ClearEventTargets(FX_BOOL bRemoveAll) override; | 67 void ClearEventTargets(FX_BOOL bRemoveAll); |
61 IFWL_Thread* GetOwnerThread() const override; | 68 IFWL_App* GetOwnerThread() const; |
62 FWL_ERR PushNoteLoop(IFWL_NoteLoop* pNoteLoop) override; | 69 FWL_ERR PushNoteLoop(CFWL_NoteLoop* pNoteLoop); |
63 IFWL_NoteLoop* PopNoteLoop() override; | 70 CFWL_NoteLoop* PopNoteLoop(); |
64 IFWL_Widget* GetFocus() override; | 71 IFWL_Widget* GetFocus(); |
65 FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE) override; | 72 FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE); |
66 void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet) override; | 73 void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet); |
67 FWL_ERR Run() override; | 74 FWL_ERR Run(); |
68 | 75 |
69 IFWL_Widget* GetHover(); | 76 IFWL_Widget* GetHover(); |
70 void SetHover(IFWL_Widget* pHover); | 77 void SetHover(IFWL_Widget* pHover); |
71 void NotifyTargetHide(IFWL_Widget* pNoteTarget); | 78 void NotifyTargetHide(IFWL_Widget* pNoteTarget); |
72 void NotifyTargetDestroy(IFWL_Widget* pNoteTarget); | 79 void NotifyTargetDestroy(IFWL_Widget* pNoteTarget); |
73 FWL_ERR RegisterForm(CFWL_WidgetImp* pForm); | 80 FWL_ERR RegisterForm(CFWL_WidgetImp* pForm); |
74 FWL_ERR UnRegisterForm(CFWL_WidgetImp* pForm); | 81 FWL_ERR UnRegisterForm(CFWL_WidgetImp* pForm); |
75 FX_BOOL QueueMessage(CFWL_Message* pMessage); | 82 FX_BOOL QueueMessage(CFWL_Message* pMessage); |
76 FX_BOOL UnqueueMessage(CFWL_NoteLoop* pNoteLoop); | 83 FX_BOOL UnqueueMessage(CFWL_NoteLoop* pNoteLoop); |
77 CFWL_NoteLoop* GetTopLoop(); | 84 CFWL_NoteLoop* GetTopLoop(); |
(...skipping 10 matching lines...) Expand all Loading... | |
88 FX_BOOL DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); | 95 FX_BOOL DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); |
89 FX_BOOL DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm); | 96 FX_BOOL DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm); |
90 FX_BOOL DoSize(CFWL_MsgSize* pMsg); | 97 FX_BOOL DoSize(CFWL_MsgSize* pMsg); |
91 FX_BOOL DoWindowMove(CFWL_MsgWindowMove* pMsg, IFWL_Widget* pMessageForm); | 98 FX_BOOL DoWindowMove(CFWL_MsgWindowMove* pMsg, IFWL_Widget* pMessageForm); |
92 FX_BOOL DoDragFiles(CFWL_MsgDropFiles* pMsg, IFWL_Widget* pMessageForm); | 99 FX_BOOL DoDragFiles(CFWL_MsgDropFiles* pMsg, IFWL_Widget* pMessageForm); |
93 FX_BOOL DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); | 100 FX_BOOL DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm); |
94 void MouseSecondary(CFWL_MsgMouse* pMsg); | 101 void MouseSecondary(CFWL_MsgMouse* pMsg); |
95 FX_BOOL IsValidMessage(CFWL_Message* pMessage); | 102 FX_BOOL IsValidMessage(CFWL_Message* pMessage); |
96 IFWL_Widget* GetMessageForm(IFWL_Widget* pDstTarget); | 103 IFWL_Widget* GetMessageForm(IFWL_Widget* pDstTarget); |
97 void ClearInvalidEventTargets(FX_BOOL bRemoveAll); | 104 void ClearInvalidEventTargets(FX_BOOL bRemoveAll); |
98 CFX_PtrArray m_forms; | 105 CFX_PtrArray m_forms; |
Tom Sepez
2016/04/27 20:23:34
nit: blank line here while we're at it.
dsinclair
2016/04/27 20:58:55
Done.
| |
99 CFX_PtrArray m_noteQueue; | 106 CFX_PtrArray m_noteQueue; |
100 CFX_PtrArray m_noteLoopQueue; | 107 CFX_PtrArray m_noteLoopQueue; |
101 CFX_MapPtrToPtr m_eventTargets; | 108 CFX_MapPtrToPtr m_eventTargets; |
102 int32_t m_sendEventCalled; | 109 int32_t m_sendEventCalled; |
103 IFWL_Widget* m_pHover; | 110 IFWL_Widget* m_pHover; |
104 IFWL_Widget* m_pFocus; | 111 IFWL_Widget* m_pFocus; |
105 IFWL_Widget* m_pGrab; | 112 IFWL_Widget* m_pGrab; |
106 CFWL_NoteLoop* m_pNoteLoop; | 113 CFWL_NoteLoop* m_pNoteLoop; |
107 }; | 114 }; |
108 | 115 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 IFWL_ToolTipTarget* pCurTarget; | 153 IFWL_ToolTipTarget* pCurTarget; |
147 CFWL_ToolTipImp* m_pToolTipImp; | 154 CFWL_ToolTipImp* m_pToolTipImp; |
148 CFWL_CoreToolTipDP* m_ToolTipDp; | 155 CFWL_CoreToolTipDP* m_ToolTipDp; |
149 CFX_PtrArray m_arrWidget; | 156 CFX_PtrArray m_arrWidget; |
150 | 157 |
151 private: | 158 private: |
152 static CFWL_ToolTipContainer* s_pInstance; | 159 static CFWL_ToolTipContainer* s_pInstance; |
153 }; | 160 }; |
154 | 161 |
155 #endif // XFA_FWL_CORE_FWL_NOTEIMP_H_ | 162 #endif // XFA_FWL_CORE_FWL_NOTEIMP_H_ |
OLD | NEW |