Path: blob/master/src/java.desktop/macosx/native/libawt_lwawt/awt/DnDUtilities.h
41152 views
/*1* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#ifndef DnDUtilities_h26#define DnDUtilities_h2728#import <Cocoa/Cocoa.h>29#include <jni.h>3031@interface DnDUtilities : NSObject {32}3334// Common methods:35+ (NSString *) javaPboardType;3637// Dragging action mapping:38+ (jint)mapNSDragOperationToJava:(NSDragOperation)dragOperation;39+ (NSDragOperation)mapJavaDragOperationToNS:(jint)dragOperation;40+ (jint)mapNSDragOperationMaskToJava:(NSDragOperation)dragOperation;41+ (jint)narrowJavaDropActions:(jint)actions;4243// Mouse and key modifiers mapping:44+ (NSUInteger)mapJavaExtModifiersToNSMouseDownButtons:(jint)modifiers;45+ (NSUInteger)mapJavaExtModifiersToNSMouseUpButtons:(jint)modifiers;4647// Specialized key and mouse modifiers mapping (for operationChanged)48+ (jint)extractJavaExtKeyModifiersFromJavaExtModifiers:(jint)modifiers;49+ (jint)extractJavaExtMouseModifiersFromJavaExtModifiers:(jint)modifiers;5051// Getting the state of the current Drag52+ (NSDragOperation)nsDragOperationForModifiers:(NSUInteger)modifiers;53+ (jint) javaKeyModifiersForNSDragOperation:(NSDragOperation)dragOp;54@end555657// Global debugging flag (for drag-and-drop) - this can be overriden locally per file:58#ifndef DND_DEBUG59// #define DND_DEBUG TRUE60#endif6162#if DND_DEBUG63// Turn DLog (debug log) on for debugging:64#define DLog(arg1) NSLog(arg1)65#define DLog2(arg1, arg2) NSLog(arg1, arg2)66#define DLog3(arg1, arg2, arg3) NSLog(arg1, arg2, arg3)67#define DLog4(arg1, arg2, arg3, arg4) NSLog(arg1, arg2, arg3, arg4)68#define DLog5(arg1, arg2, arg3, arg4, arg5) NSLog(arg1, arg2, arg3, arg4, arg5)69#define DLog6(arg1, arg2, arg3, arg4, arg5, arg6) NSLog(arg1, arg2, arg3, arg4, arg5, arg6)70#else71#define DLog(arg1);72#define DLog2(arg1, arg2);73#define DLog3(arg1, arg2, arg3);74#define DLog4(arg1, arg2, arg3, arg4);75#define DLog5(arg1, arg2, arg3, arg4, arg5);76#define DLog6(arg1, arg2, arg3, arg4, arg5, arg6);77#endif7879#endif // DnDUtilities_h808182