5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/dali.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <dali-toolkit/devel-api/scripting/script.h>
25 #include <dali-toolkit/devel-api/builder/builder.h>
28 * Example app that can load both JSON and JavaScript files from command line
29 * E.g. scripting.example my-first.js my-first.json
30 * See dali-demo/resources/scripts for example JSON and JavaScript files
32 class Launcher: public Dali::ConnectionTracker
38 * @param application application
39 * @param layoutFileName JSON file to run
40 * @param scriptFileName JavaScript file to run
42 Launcher( Dali::Application application, std::string layoutFileName, std::string scriptFileName );
52 void Create( Dali::Application& application );
55 * @brief run application MainLoop
61 Dali::Toolkit::Script mScript; ///< Used to load and execute JavaScript
62 Dali::Toolkit::Builder mBuilder; ///< Used to parse JSON
63 Dali::Application mApplication; ///< application
64 std::string mJSONFileName; ///< JSON filename
65 std::string mJavaScriptFileName; ///< JavaScript filename