[aseprite] 05/64: script: Add app.exit() function

Tobias Hansen thansen at moszumanska.debian.org
Tue Jun 21 14:43:00 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 af7c6e0fa9ff02dd29ba15af723c530e77bebcf1
Author: David Capello <davidcapello at gmail.com>
Date:   Fri May 6 16:49:43 2016 -0300

    script: Add app.exit() function
---
 src/app/script/app_object.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/app/script/app_object.cpp b/src/app/script/app_object.cpp
index 7294510..0e73801 100644
--- a/src/app/script/app_object.cpp
+++ b/src/app/script/app_object.cpp
@@ -52,6 +52,13 @@ script::result_t App_open(script::ContextHandle handle)
   return 1;
 }
 
+script::result_t App_exit(script::ContextHandle handle)
+{
+  Command* exitCommand = CommandsModule::instance()->getCommandByName(CommandId::Exit);
+  UIContext::instance()->executeCommand(exitCommand);
+  return 0;
+}
+
 script::result_t App_get_activeSprite(script::ContextHandle handle)
 {
   script::Context ctx(handle);
@@ -93,6 +100,7 @@ script::result_t App_get_version(script::ContextHandle handle)
 
 const script::FunctionEntry App_methods[] = {
   { "open", App_open, 1 },
+  { "exit", App_exit, 1 },
   { nullptr, nullptr, 0 }
 };
 

-- 
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