1/* 2 * Copyright (c) 2011, 2013, 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 26package sun.lwawt.macosx; 27 28 29public final class CocoaConstants { 30 private CocoaConstants(){} 31 32 //from the NSEvent class reference: 33 public static final int NSLeftMouseDown = 1; 34 public static final int NSLeftMouseUp = 2; 35 public static final int NSRightMouseDown = 3; 36 public static final int NSRightMouseUp = 4; 37 public static final int NSMouseMoved = 5; 38 public static final int NSLeftMouseDragged = 6; 39 public static final int NSRightMouseDragged = 7; 40 public static final int NSMouseEntered = 8; 41 public static final int NSMouseExited = 9; 42 public static final int NSKeyDown = 10; 43 public static final int NSKeyUp = 11; 44 public static final int NSFlagsChanged = 12; 45 46 public static final int NSScrollWheel = 22; 47 public static final int NSOtherMouseDown = 25; 48 public static final int NSOtherMouseUp = 26; 49 public static final int NSOtherMouseDragged = 27; 50 51 public static final int AllLeftMouseEventsMask = 52 1 << NSLeftMouseDown | 53 1 << NSLeftMouseUp | 54 1 << NSLeftMouseDragged; 55 56 public static final int AllRightMouseEventsMask = 57 1 << NSRightMouseDown | 58 1 << NSRightMouseUp | 59 1 << NSRightMouseDragged; 60 61 public static final int AllOtherMouseEventsMask = 62 1 << NSOtherMouseDown | 63 1 << NSOtherMouseUp | 64 1 << NSOtherMouseDragged; 65 66 /* 67 NSAppKitDefined = 13, 68 NSSystemDefined = 14, 69 NSApplicationDefined = 15, 70 NSPeriodic = 16, 71 NSCursorUpdate = 17, 72 NSScrollWheel = 22, 73 NSTabletPoint = 23, 74 NSTabletProximity = 24, 75 NSEventTypeGesture = 29, 76 NSEventTypeMagnify = 30, 77 NSEventTypeSwipe = 31, 78 NSEventTypeRotate = 18, 79 NSEventTypeBeginGesture = 19, 80 NSEventTypeEndGesture = 20 81 */ 82 83 // See http://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html 84 85 public static final int kCGMouseButtonLeft = 0; 86 public static final int kCGMouseButtonRight = 1; 87 public static final int kCGMouseButtonCenter = 2; 88 89 // See https://wiki.mozilla.org/NPAPI:CocoaEventModel 90 91 public static final int NPCocoaEventDrawRect = 1; 92 public static final int NPCocoaEventMouseDown = 2; 93 public static final int NPCocoaEventMouseUp = 3; 94 public static final int NPCocoaEventMouseMoved = 4; 95 public static final int NPCocoaEventMouseEntered = 5; 96 public static final int NPCocoaEventMouseExited = 6; 97 public static final int NPCocoaEventMouseDragged = 7; 98 public static final int NPCocoaEventKeyDown = 8; 99 public static final int NPCocoaEventKeyUp = 9; 100 public static final int NPCocoaEventFlagsChanged = 10; 101 public static final int NPCocoaEventFocusChanged = 11; 102 public static final int NPCocoaEventWindowFocusChanged = 12; 103 public static final int NPCocoaEventScrollWheel = 13; 104 public static final int NPCocoaEventTextInput = 14; 105} 106