deskflow/src/lib/platform/OSXPasteboardPeeker.m

32 lines
846 B
Mathematica
Raw Normal View History

/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2013 - 2016 Symless Ltd.
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
#import "platform/OSXPasteboardPeeker.h"
#import <Cocoa/Cocoa.h>
2024-12-18 01:42:03 +00:00
#import <CoreData/CoreData.h>
#import <Foundation/Foundation.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
2024-12-18 01:42:03 +00:00
CFStringRef getDraggedFileURL()
{
2024-12-18 01:42:03 +00:00
NSString *pbName = NSDragPboard;
NSPasteboard *pboard = [NSPasteboard pasteboardWithName:pbName];
NSMutableString *string;
string = [[NSMutableString alloc] initWithCapacity:0];
NSArray *files = [pboard propertyListForType:NSFilenamesPboardType];
for (id file in files) {
[string appendString:(NSString *)file];
[string appendString:@"\0"];
}
2024-12-18 01:42:03 +00:00
return (CFStringRef)string;
}