X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=plugins%2Fdali-script-v8%2Fsrc%2Fmodule-loader%2Fmodule-loader.h;h=1ef369206b6d94c45cbcb452fc347b815ef3513b;hp=085f33febd1a0bb4a78d9676ad66df23f603bbf2;hb=b694e7e2ae624e206e1548b1a863c554eb9cd4d7;hpb=2d1ba388f9a941d273e95d729b9662cc1cdad822 diff --git a/plugins/dali-script-v8/src/module-loader/module-loader.h b/plugins/dali-script-v8/src/module-loader/module-loader.h index 085f33f..1ef3692 100644 --- a/plugins/dali-script-v8/src/module-loader/module-loader.h +++ b/plugins/dali-script-v8/src/module-loader/module-loader.h @@ -1,8 +1,8 @@ -#ifndef __DALI_V8PLUGIN_MODULE_LOADER_H__ -#define __DALI_V8PLUGIN_MODULE_LOADER_H__ +#ifndef DALI_V8PLUGIN_MODULE_LOADER_H +#define DALI_V8PLUGIN_MODULE_LOADER_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,18 +64,21 @@ class ModuleLoader public: /** - * Constructor + * @brief Constructor + * @param[in] isolate v8 isolate + * @param[in] daliObject dali exports object, used when developer does require('dali'); */ ModuleLoader(); /** - * non virtual destructor, not intended as a base class + * @brief non virtual destructor, not intended as a base class */ ~ModuleLoader(); /** - * Execute a script from a file + * @brief Execute a script from a file + * @param[in] isolate v8 isolate * @param[in] fileName file name * @return true on success, false on failure * @@ -84,7 +87,8 @@ public: /** - * Execute a script + * @brief Execute a script + * @param[in] isolate v8 isolate * @param[in] sourceCode source code to run * @param[in] sourceFileName source file name * @return true on success, false on failure @@ -95,9 +99,21 @@ public: /** - * Implements JavaScript Require functionality + * @brief Implements JavaScript Require functionality + * @param[in] args arguments passed to require. The return value is set using args.GetReturnValue().Set( */ - void Require(const v8::FunctionCallbackInfo< v8::Value >& args, v8::Persistent& globalObjectTemplate ); + void Require( const v8::FunctionCallbackInfo< v8::Value >& args ); + + /** + * @brief + * Stores a pre compiled object as a module. + * Currently used for storing the Dali object, so the developer can + * perform var dali = require('dali'); + * @param[in] isolate v8 isolate + * @param[in] exportObject export object + * @param[in] name module name, used for the require('name') lookup + */ + void StorePreBuiltModule( v8::Isolate* isolate, v8::Local& exportObject, const std::string& name ); private: @@ -111,13 +127,13 @@ private: const std::string& sourceFileName ); /** - * Store information about the current script + * @brief Store information about the current script * @param[in] sourceFileName source file name */ void StoreScriptInfo( const std::string& sourceFileName ); /** - * Store module information + * @brief Store module information * @param[in] sourceFileName source file name * @return module object */ @@ -128,7 +144,7 @@ private: v8::Local& moduleExportsObject ); /** - * Find a module + * @brief Find a module * @param[in] moduleName module name * @return module */ @@ -141,9 +157,8 @@ private: }; - } // namespace V8Plugin } // namespace Dali -#endif // header MODULE_LOADER +#endif // DALI_V8PLUGIN_MODULE_LOADER_H