1 /* 2 * Copyright (c) 2011, 2014, 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 #import "CDataTransferer.h" 27 #include "sun_lwawt_macosx_CDataTransferer.h" 28 29 #import <AppKit/AppKit.h> 30 #import <JavaNativeFoundation/JavaNativeFoundation.h> 31 #import "jni_util.h" 32 33 #include "ThreadUtilities.h" 34 35 36 // ***** NOTE ***** This dictionary corresponds to the static array predefinedClipboardNames 37 // in CDataTransferer.java. 38 NSMutableDictionary *sStandardMappings = nil; 39 40 NSMutableDictionary *getMappingTable() { 41 if (sStandardMappings == nil) { 42 sStandardMappings = [[NSMutableDictionary alloc] init]; 43 [sStandardMappings setObject:NSStringPboardType 44 forKey:[NSNumber numberWithLong:sun_lwawt_macosx_CDataTransferer_CF_STRING]]; 45 [sStandardMappings setObject:NSFilenamesPboardType 46 forKey:[NSNumber numberWithLong:sun_lwawt_macosx_CDataTransferer_CF_FILE]]; 47 [sStandardMappings setObject:NSTIFFPboardType 48 forKey:[NSNumber numberWithLong:sun_lwawt_macosx_CDataTransferer_CF_TIFF]]; 49 [sStandardMappings setObject:NSRTFPboardType 50 forKey:[NSNumber numberWithLong:sun_lwawt_macosx_CDataTransferer_CF_RICH_TEXT]]; 51 [sStandardMappings setObject:NSHTMLPboardType 52 forKey:[NSNumber numberWithLong:sun_lwawt_macosx_CDataTransferer_CF_HTML]]; 53 [sStandardMappings setObject:NSPDFPboardType | 1 /* 2 * Copyright (c) 2011, 2015, 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 #import "CDataTransferer.h" 27 #include "sun_lwawt_macosx_CDataTransferer.h" 28 29 #import "jni_util.h" 30 31 #import <JavaNativeFoundation/JavaNativeFoundation.h> 32 33 34 // ***** NOTE ***** This dictionary corresponds to the static array predefinedClipboardNames 35 // in CDataTransferer.java. 36 NSMutableDictionary *sStandardMappings = nil; 37 38 NSMutableDictionary *getMappingTable() { 39 if (sStandardMappings == nil) { 40 sStandardMappings = [[NSMutableDictionary alloc] init]; 41 [sStandardMappings setObject:NSStringPboardType 42 forKey:[NSNumber numberWithLong:sun_lwawt_macosx_CDataTransferer_CF_STRING]]; 43 [sStandardMappings setObject:NSFilenamesPboardType 44 forKey:[NSNumber numberWithLong:sun_lwawt_macosx_CDataTransferer_CF_FILE]]; 45 [sStandardMappings setObject:NSTIFFPboardType 46 forKey:[NSNumber numberWithLong:sun_lwawt_macosx_CDataTransferer_CF_TIFF]]; 47 [sStandardMappings setObject:NSRTFPboardType 48 forKey:[NSNumber numberWithLong:sun_lwawt_macosx_CDataTransferer_CF_RICH_TEXT]]; 49 [sStandardMappings setObject:NSHTMLPboardType 50 forKey:[NSNumber numberWithLong:sun_lwawt_macosx_CDataTransferer_CF_HTML]]; 51 [sStandardMappings setObject:NSPDFPboardType |