author | erikj |
Thu, 07 Jun 2012 18:05:09 -0700 | |
changeset 12813 | c10ab96dcf41 |
parent 12047 | 320a714614e9 |
child 16734 | da1901d79073 |
permissions | -rw-r--r-- |
12047 | 1 |
/* |
2 |
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package sun.lwawt.macosx; |
|
27 |
||
12813
c10ab96dcf41
7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents:
12047
diff
changeset
|
28 |
import javax.tools.annotation.GenerateNativeHeader; |
c10ab96dcf41
7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents:
12047
diff
changeset
|
29 |
|
c10ab96dcf41
7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents:
12047
diff
changeset
|
30 |
/* No native methods here, but the constants are needed in the supporting JNI code */ |
c10ab96dcf41
7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents:
12047
diff
changeset
|
31 |
@GenerateNativeHeader |
12047 | 32 |
public final class CocoaConstants { |
33 |
private CocoaConstants(){} |
|
34 |
||
35 |
//from the NSEvent class reference: |
|
36 |
public final static int NSLeftMouseDown = 1; |
|
37 |
public final static int NSLeftMouseUp = 2; |
|
38 |
public final static int NSRightMouseDown = 3; |
|
39 |
public final static int NSRightMouseUp = 4; |
|
40 |
public final static int NSMouseMoved = 5; |
|
41 |
public final static int NSLeftMouseDragged = 6; |
|
42 |
public final static int NSRightMouseDragged = 7; |
|
43 |
public final static int NSMouseEntered = 8; |
|
44 |
public final static int NSMouseExited = 9; |
|
45 |
public final static int NSKeyDown = 10; |
|
46 |
public final static int NSKeyUp = 11; |
|
47 |
public final static int NSFlagsChanged = 12; |
|
48 |
||
49 |
public final static int NSScrollWheel = 22; |
|
50 |
public final static int NSOtherMouseDown = 25; |
|
51 |
public final static int NSOtherMouseUp = 26; |
|
52 |
public final static int NSOtherMouseDragged = 27; |
|
53 |
||
54 |
public final static int AllLeftMouseEventsMask = |
|
55 |
1 << NSLeftMouseDown | |
|
56 |
1 << NSLeftMouseUp | |
|
57 |
1 << NSLeftMouseDragged; |
|
58 |
||
59 |
public final static int AllRightMouseEventsMask = |
|
60 |
1 << NSRightMouseDown | |
|
61 |
1 << NSRightMouseUp | |
|
62 |
1 << NSRightMouseDragged; |
|
63 |
||
64 |
public final static int AllOtherMouseEventsMask = |
|
65 |
1 << NSOtherMouseDown | |
|
66 |
1 << NSOtherMouseUp | |
|
67 |
1 << NSOtherMouseDragged; |
|
68 |
||
69 |
/* |
|
70 |
NSAppKitDefined = 13, |
|
71 |
NSSystemDefined = 14, |
|
72 |
NSApplicationDefined = 15, |
|
73 |
NSPeriodic = 16, |
|
74 |
NSCursorUpdate = 17, |
|
75 |
NSScrollWheel = 22, |
|
76 |
NSTabletPoint = 23, |
|
77 |
NSTabletProximity = 24, |
|
78 |
NSEventTypeGesture = 29, |
|
79 |
NSEventTypeMagnify = 30, |
|
80 |
NSEventTypeSwipe = 31, |
|
81 |
NSEventTypeRotate = 18, |
|
82 |
NSEventTypeBeginGesture = 19, |
|
83 |
NSEventTypeEndGesture = 20 |
|
84 |
*/ |
|
85 |
||
86 |
// See http://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html |
|
87 |
||
88 |
public final static int kCGMouseButtonLeft = 0; |
|
89 |
public final static int kCGMouseButtonRight = 1; |
|
90 |
public final static int kCGMouseButtonCenter = 2; |
|
91 |
||
92 |
// See https://wiki.mozilla.org/NPAPI:CocoaEventModel |
|
93 |
||
94 |
public final static int NPCocoaEventDrawRect = 1; |
|
95 |
public final static int NPCocoaEventMouseDown = 2; |
|
96 |
public final static int NPCocoaEventMouseUp = 3; |
|
97 |
public final static int NPCocoaEventMouseMoved = 4; |
|
98 |
public final static int NPCocoaEventMouseEntered = 5; |
|
99 |
public final static int NPCocoaEventMouseExited = 6; |
|
100 |
public final static int NPCocoaEventMouseDragged = 7; |
|
101 |
public final static int NPCocoaEventKeyDown = 8; |
|
102 |
public final static int NPCocoaEventKeyUp = 9; |
|
103 |
public final static int NPCocoaEventFlagsChanged = 10; |
|
104 |
public final static int NPCocoaEventFocusChanged = 11; |
|
105 |
public final static int NPCocoaEventWindowFocusChanged = 12; |
|
106 |
public final static int NPCocoaEventScrollWheel = 13; |
|
107 |
public final static int NPCocoaEventTextInput = 14; |
|
108 |
} |