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 _FWL_EVENT_H | 7 #ifndef _FWL_EVENT_H |
8 #define _FWL_EVENT_H | 8 #define _FWL_EVENT_H |
9 | 9 |
10 #include "fpdfview.h" | 10 #include "fpdfview.h" |
11 | 11 |
12 typedef int» » » FPDF_INT32; | 12 typedef int FPDF_INT32; |
13 typedef unsigned int FPDF_UINT32; | 13 typedef unsigned int FPDF_UINT32; |
14 typedef float» » FPDF_FLOAT; | 14 typedef float FPDF_FLOAT; |
15 //event type | 15 // event type |
16 typedef enum | 16 typedef enum { |
17 { | 17 FWL_EVENTTYPE_Mouse = 0, |
18 » FWL_EVENTTYPE_Mouse = 0», | 18 FWL_EVENTTYPE_MouseWheel, |
19 » FWL_EVENTTYPE_MouseWheel,» | 19 FWL_EVENTTYPE_Key, |
20 » FWL_EVENTTYPE_Key» » , | |
21 } FWL_EVENTTYPE; | 20 } FWL_EVENTTYPE; |
22 | 21 |
23 //key flag | 22 // key flag |
24 typedef enum | 23 typedef enum { |
25 { | 24 FWL_EVENTFLAG_ShiftKey = 1 << 0, |
26 » FWL_EVENTFLAG_ShiftKey» » » = 1 << 0, | 25 FWL_EVENTFLAG_ControlKey = 1 << 1, |
27 » FWL_EVENTFLAG_ControlKey» » = 1 << 1, | 26 FWL_EVENTFLAG_AltKey = 1 << 2, |
28 FWL_EVENTFLAG_AltKey» » » = 1 << 2, | 27 FWL_EVENTFLAG_MetaKey = 1 << 3, |
29 FWL_EVENTFLAG_MetaKey» » » = 1 << 3, | 28 FWL_EVENTFLAG_KeyPad = 1 << 4, |
30 FWL_EVENTFLAG_KeyPad» » » = 1 << 4, | 29 FWL_EVENTFLAG_AutoRepeat = 1 << 5, |
31 FWL_EVENTFLAG_AutoRepeat» » = 1 << 5, | 30 FWL_EVENTFLAG_LeftButtonDown = 1 << 6, |
32 FWL_EVENTFLAG_LeftButtonDown» = 1 << 6, | 31 FWL_EVENTFLAG_MiddleButtonDown = 1 << 7, |
33 FWL_EVENTFLAG_MiddleButtonDown» = 1 << 7, | 32 FWL_EVENTFLAG_RightButtonDown = 1 << 8, |
34 FWL_EVENTFLAG_RightButtonDown» = 1 << 8, | 33 } FWL_EVENTFLAG; |
35 } FWL_EVENTFLAG; | |
36 | 34 |
37 // Mouse message command | 35 // Mouse message command |
38 typedef enum | 36 typedef enum { |
39 { | 37 FWL_EVENTMOUSECMD_LButtonDown = 1, |
40 » FWL_EVENTMOUSECMD_LButtonDown =»1» ,» | 38 FWL_EVENTMOUSECMD_LButtonUp, |
41 » FWL_EVENTMOUSECMD_LButtonUp» » » , | 39 FWL_EVENTMOUSECMD_LButtonDblClk, |
42 » FWL_EVENTMOUSECMD_LButtonDblClk»» , | 40 FWL_EVENTMOUSECMD_RButtonDown, |
43 » FWL_EVENTMOUSECMD_RButtonDown» » , | 41 FWL_EVENTMOUSECMD_RButtonUp, |
44 » FWL_EVENTMOUSECMD_RButtonUp» » » , | 42 FWL_EVENTMOUSECMD_RButtonDblClk, |
45 » FWL_EVENTMOUSECMD_RButtonDblClk»» , | 43 FWL_EVENTMOUSECMD_MButtonDown, |
46 » FWL_EVENTMOUSECMD_MButtonDown» » , | 44 FWL_EVENTMOUSECMD_MButtonUp, |
47 » FWL_EVENTMOUSECMD_MButtonUp» » » , | 45 FWL_EVENTMOUSECMD_MButtonDblClk, |
48 » FWL_EVENTMOUSECMD_MButtonDblClk»» , | 46 FWL_EVENTMOUSECMD_MouseMove, |
49 » FWL_EVENTMOUSECMD_MouseMove» » » , | 47 FWL_EVENTMOUSECMD_MouseEnter, |
50 » FWL_EVENTMOUSECMD_MouseEnter» » , | 48 FWL_EVENTMOUSECMD_MouseHover, |
51 » FWL_EVENTMOUSECMD_MouseHover» » , | 49 FWL_EVENTMOUSECMD_MouseLeave, |
52 » FWL_EVENTMOUSECMD_MouseLeave» » , | |
53 } FWL_EVENT_MOUSECMD; | 50 } FWL_EVENT_MOUSECMD; |
54 | 51 |
55 //mouse event | 52 // mouse event |
56 struct FWL_EVENT_MOUSE | 53 struct FWL_EVENT_MOUSE { |
57 { | 54 FPDF_UINT32 command; |
58 » FPDF_UINT32 command; | 55 FPDF_DWORD flag; |
59 » FPDF_DWORD flag; | 56 FPDF_FLOAT x; |
60 » FPDF_FLOAT x; | 57 FPDF_FLOAT y; |
61 » FPDF_FLOAT y; | |
62 }; | 58 }; |
63 | 59 |
64 //mouse wheel | 60 // mouse wheel |
65 struct FWL_EVENT_MOUSEWHEEL | 61 struct FWL_EVENT_MOUSEWHEEL { |
66 {» | 62 FPDF_DWORD flag; |
67 » FPDF_DWORD flag; | 63 FPDF_FLOAT x; |
68 » FPDF_FLOAT x; | 64 FPDF_FLOAT y; |
69 » FPDF_FLOAT y; | 65 FPDF_FLOAT deltaX; |
70 » FPDF_FLOAT deltaX; | 66 FPDF_FLOAT deltaY; |
71 FPDF_FLOAT deltaY; | |
72 }; | 67 }; |
73 | 68 |
74 //virtual keycode | 69 // virtual keycode |
75 typedef enum | 70 typedef enum { |
76 { | 71 FWL_VKEY_Back = 0x08, |
77 FWL_VKEY_Back»» = 0x08, | 72 FWL_VKEY_Tab = 0x09, |
78 FWL_VKEY_Tab» » = 0x09, | 73 FWL_VKEY_Clear = 0x0C, |
79 FWL_VKEY_Clear» = 0x0C, | 74 FWL_VKEY_Return = 0x0D, |
80 FWL_VKEY_Return» = 0x0D, | 75 FWL_VKEY_Shift = 0x10, |
81 FWL_VKEY_Shift» = 0x10, | 76 FWL_VKEY_Control = 0x11, |
82 FWL_VKEY_Control» = 0x11, | 77 FWL_VKEY_Menu = 0x12, |
83 FWL_VKEY_Menu»» = 0x12, | 78 FWL_VKEY_Pause = 0x13, |
84 FWL_VKEY_Pause» = 0x13, | 79 FWL_VKEY_Capital = 0x14, |
85 FWL_VKEY_Capital» = 0x14, | 80 FWL_VKEY_Kana = 0x15, |
86 FWL_VKEY_Kana»» = 0x15, | 81 FWL_VKEY_Hangul = 0x15, |
87 FWL_VKEY_Hangul» = 0x15, | 82 FWL_VKEY_Junja = 0x17, |
88 FWL_VKEY_Junja» = 0x17, | 83 FWL_VKEY_Final = 0x18, |
89 FWL_VKEY_Final» = 0x18, | 84 FWL_VKEY_Hanja = 0x19, |
90 FWL_VKEY_Hanja» = 0x19, | 85 FWL_VKEY_Kanji = 0x19, |
91 FWL_VKEY_Kanji» = 0x19, | 86 FWL_VKEY_Escape = 0x1B, |
92 FWL_VKEY_Escape» = 0x1B, | 87 FWL_VKEY_Convert = 0x1C, |
93 FWL_VKEY_Convert» = 0x1C, | |
94 FWL_VKEY_NonConvert = 0x1D, | 88 FWL_VKEY_NonConvert = 0x1D, |
95 FWL_VKEY_Accept» = 0x1E, | 89 FWL_VKEY_Accept = 0x1E, |
96 FWL_VKEY_ModeChange = 0x1F, | 90 FWL_VKEY_ModeChange = 0x1F, |
97 FWL_VKEY_Space = 0x20, | 91 FWL_VKEY_Space = 0x20, |
98 FWL_VKEY_Prior = 0x21, | 92 FWL_VKEY_Prior = 0x21, |
99 FWL_VKEY_Next = 0x22, | 93 FWL_VKEY_Next = 0x22, |
100 FWL_VKEY_End = 0x23, | 94 FWL_VKEY_End = 0x23, |
101 FWL_VKEY_Home = 0x24, | 95 FWL_VKEY_Home = 0x24, |
102 FWL_VKEY_Left = 0x25, | 96 FWL_VKEY_Left = 0x25, |
103 FWL_VKEY_Up = 0x26, | 97 FWL_VKEY_Up = 0x26, |
104 FWL_VKEY_Right = 0x27, | 98 FWL_VKEY_Right = 0x27, |
105 FWL_VKEY_Down = 0x28, | 99 FWL_VKEY_Down = 0x28, |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 FWL_VKEY_Exsel = 0xF8, | 231 FWL_VKEY_Exsel = 0xF8, |
238 FWL_VKEY_Ereof = 0xF9, | 232 FWL_VKEY_Ereof = 0xF9, |
239 FWL_VKEY_Play = 0xFA, | 233 FWL_VKEY_Play = 0xFA, |
240 FWL_VKEY_Zoom = 0xFB, | 234 FWL_VKEY_Zoom = 0xFB, |
241 FWL_VKEY_NoName = 0xFC, | 235 FWL_VKEY_NoName = 0xFC, |
242 FWL_VKEY_PA1 = 0xFD, | 236 FWL_VKEY_PA1 = 0xFD, |
243 FWL_VKEY_OEM_Clear = 0xFE, | 237 FWL_VKEY_OEM_Clear = 0xFE, |
244 FWL_VKEY_Unknown = 0, | 238 FWL_VKEY_Unknown = 0, |
245 } FWL_VKEYCODE; | 239 } FWL_VKEYCODE; |
246 | 240 |
247 //key event command | 241 // key event command |
248 typedef enum | 242 typedef enum { |
249 { | 243 FWL_EVENTKEYCMD_KeyDown = 1, |
250 » FWL_EVENTKEYCMD_KeyDown = 1» , | 244 FWL_EVENTKEYCMD_KeyUp, |
251 » FWL_EVENTKEYCMD_KeyUp» » , | 245 FWL_EVENTKEYCMD_Char, |
252 » FWL_EVENTKEYCMD_Char» » , | |
253 } FWL_EVENTKEYCMD; | 246 } FWL_EVENTKEYCMD; |
254 | 247 |
255 //key event | 248 // key event |
256 struct FWL_EVENT_KEY | 249 struct FWL_EVENT_KEY { |
257 { | 250 FPDF_UINT32 command; |
258 » FPDF_UINT32 command; | 251 FPDF_DWORD flag; |
259 » FPDF_DWORD flag; | 252 union { |
260 » union | 253 // Virtual key code. |
261 » { | 254 FPDF_UINT32 vkcode; |
262 » » //Virtual key code. | 255 // Character code. |
263 » » FPDF_UINT32 vkcode; | 256 FPDF_DWORD charcode; |
264 » » //Character code. | 257 } code; |
265 » » FPDF_DWORD charcode; | |
266 » }code; | |
267 }; | 258 }; |
268 | 259 |
269 //event type | 260 // event type |
270 struct FWL_EVENT | 261 struct FWL_EVENT { |
271 { | 262 // structure size. |
272 » //structure size. | 263 FPDF_UINT32 size; |
273 » FPDF_UINT32 size; | 264 // FWL_EVENTTYPE. |
274 » //FWL_EVENTTYPE. | 265 FPDF_UINT32 type; |
275 FPDF_UINT32 type; | 266 union { |
276 » union | 267 struct FWL_EVENT_MOUSE mouse; |
277 » { | 268 struct FWL_EVENT_MOUSEWHEEL wheel; |
278 » » struct FWL_EVENT_MOUSE mouse; | 269 struct FWL_EVENT_KEY key; |
279 » » struct FWL_EVENT_MOUSEWHEEL wheel; | 270 } s; |
280 » » struct FWL_EVENT_KEY key; | 271 }; |
281 » }s; | |
282 }; | |
283 | 272 |
284 #endif //_FWL_EVENT_H | 273 #endif //_FWL_EVENT_H |
285 | |
286 | |
OLD | NEW |