[aseprite] 189/308: Open files from Finder in Skia/OSX port
Tobias Hansen
thansen at moszumanska.debian.org
Tue Mar 8 02:45:09 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 40c834f50ac465a1b54a2f887bb38d60c7b3acda
Author: David Capello <davidcapello at gmail.com>
Date: Fri Jan 29 16:07:39 2016 -0300
Open files from Finder in Skia/OSX port
---
src/she/osx/app_delegate.h | 3 ++-
src/she/osx/app_delegate.mm | 17 +++++++++++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/she/osx/app_delegate.h b/src/she/osx/app_delegate.h
index ba87441..29d3b38 100644
--- a/src/she/osx/app_delegate.h
+++ b/src/she/osx/app_delegate.h
@@ -1,5 +1,5 @@
// SHE library
-// Copyright (C) 2012-2015 David Capello
+// Copyright (C) 2012-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@@ -14,6 +14,7 @@
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender;
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)app;
- (void)applicationWillTerminate:(NSNotification*)notification;
+- (BOOL)application:(NSApplication*)app openFile:(NSString*)filename;
@end
#endif
diff --git a/src/she/osx/app_delegate.mm b/src/she/osx/app_delegate.mm
index b97239d..c7a8296 100644
--- a/src/she/osx/app_delegate.mm
+++ b/src/she/osx/app_delegate.mm
@@ -1,5 +1,5 @@
// SHE library
-// Copyright (C) 2012-2015 David Capello
+// Copyright (C) 2012-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@@ -33,7 +33,20 @@
{
she::Event ev;
ev.setType(she::Event::CloseDisplay);
- she::instance()->eventQueue()->queueEvent(ev);
+ she::queue_event(ev);
+}
+
+- (BOOL)application:(NSApplication*)app openFile:(NSString*)filename
+{
+ she::Event ev;
+ ev.setType(she::Event::DropFiles);
+
+ std::vector<std::string> files;
+ files.push_back([filename UTF8String]);
+
+ ev.setFiles(files);
+ she::queue_event(ev);
+ return YES;
}
@end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list