1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Merge pull request #290 from TomHarte/DragAndDrop

Adds drag and drop receivership to the SDL target.
This commit is contained in:
Thomas Harte 2017-11-19 15:21:25 -08:00 committed by GitHub
commit 9961d13e2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -169,8 +169,6 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
for(NSPasteboardItem *item in [[sender draggingPasteboard] pasteboardItems])
{
NSURL *URL = [NSURL URLWithString:[item stringForType:(__bridge NSString *)kUTTypeFileURL]];
NSLog(@"%@", URL);
[self.delegate openGLView:self didReceiveFileAtURL:URL];
}
return YES;

View File

@ -339,6 +339,11 @@ int main(int argc, char *argv[]) {
}
break;
case SDL_DROPFILE: {
StaticAnalyser::Media media = StaticAnalyser::GetMedia(event.drop.file);
machine->configuration_target()->insert_media(media);
} break;
case SDL_KEYDOWN:
case SDL_KEYUP: {
KeyboardMachine::Machine *keyboard_machine = machine->keyboard_machine();