1/* 2 * synergy -- mouse and keyboard sharing utility 3 * Copyright (C) 2013-2016 Symless Ltd. 4 * 5 * This package is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * found in the file LICENSE that should have accompanied this file. 8 * 9 * This package is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 */ 14 15#import "platform/OSXPasteboardPeeker.h" 16 17#import <Foundation/Foundation.h> 18#import <CoreData/CoreData.h> 19#import <Cocoa/Cocoa.h> 20 21CFStringRef 22getDraggedFileURL() 23{ 24 NSString* pbName = NSDragPboard; 25 NSPasteboard* pboard = [NSPasteboard pasteboardWithName:pbName]; 26 27 NSMutableString* string; 28 string = [[NSMutableString alloc] initWithCapacity:0]; 29 30 NSArray* files = [pboard propertyListForType:NSFilenamesPboardType]; 31 for (id file in files) { 32 [string appendString: (NSString*)file]; 33 [string appendString: @"\0"]; 34 } 35 36 return (CFStringRef)string; 37} 38