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