Merge "Do not reposition the text's popup when buttons are pressed." into devel/master
[platform/core/uifw/dali-toolkit.git] / plugins / dali-script-v8 / src / dali-script-v8.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #include "dali-script-v8.h"
18
19 // EXTERNAL INCLUDES
20 #include <iostream>
21 #include <fstream>
22 #include <dali/integration-api/debug.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-script-v8.h>
26 #include <dali-wrapper.h>
27 #include <utils/v8-utils.h>
28
29 // The plugin factories
30 extern "C" DALI_EXPORT_API Dali::Toolkit::ScriptPlugin* CreateScriptPlugin(void)
31 {
32   return new Dali::V8Plugin::DaliScriptV8;
33 }
34
35 extern "C" DALI_EXPORT_API void DestroyScriptPlugin(Dali::Toolkit::ScriptPlugin* plugin)
36 {
37   delete plugin;
38 }
39
40 namespace Dali
41 {
42 namespace V8Plugin
43 {
44
45 DaliScriptV8::DaliScriptV8()
46 {
47 }
48
49 DaliScriptV8::~DaliScriptV8()
50 {
51   DaliWrapper::Get().Shutdown();
52 }
53
54 void DaliScriptV8::SetFlags(const std::string& s)
55 {
56   DaliWrapper::Get().SetFlagsFromString(s);
57 }
58
59 bool DaliScriptV8::ExecuteBuffer(const std::string& buffer, const std::string& filename)
60 {
61   return DaliWrapper::Get().ExecuteBuffer(buffer, filename);
62 }
63
64 bool DaliScriptV8::ExecuteFile(const std::string& filename)
65 {
66   return DaliWrapper::Get().ExecuteFile( filename );
67 }
68
69 }  // namespace V8Plugin
70
71 }  // namespace Dali
72