Purge underscored header file barriers
[platform/core/uifw/dali-toolkit.git] / plugins / dali-script-v8 / src / utils / v8-utils.h
index e8933be..177360f 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_V8PLUGIN_V8_UTILS_H__
-#define __DALI_V8PLUGIN_V8_UTILS_H__
+#ifndef DALI_V8PLUGIN_V8_UTILS_H
+#define DALI_V8PLUGIN_V8_UTILS_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.
@@ -46,9 +46,11 @@ enum
   PARAMETER_1 = 1,   ///< second parameter of a function call
   PARAMETER_2 = 2,   ///< third parameter of a function call
   PARAMETER_3 = 3,   ///< forth parameter of a function call
+  PARAMETER_4 = 4,   ///< fifth parameter of a function call
 };
 
 #define DALI_SCRIPT_EXCEPTION( isolate, message ) V8Utils::ScriptError( __FUNCTION__ , isolate, message );
+#define DALI_SCRIPT_WARNING( message ) V8Utils::ScriptWarning( __FUNCTION__ , message );
 
 namespace V8Utils
 {
@@ -95,6 +97,14 @@ void GetFileName( const std::string& fullPathName, std::string& fileName);
 void GetModuleName( const std::string& fileName, std::string& moduleName );
 
 /**
+ * Compare whether two DALi property maps are identical
+ * @param[in] map1 The first property map to be compared
+ * @param[in] map2 The second property map to be compared
+ * @return true if the two specified property maps are identical or false if not.
+ */
+bool IsPropertyMapIdentical(Property::Map map1, Property::Map map2);
+
+/**
  * Report an exception by writing as a warning to the Dali Log
  *
  * @param[in] try_catch The v8 TryCatch exception object
@@ -132,17 +142,14 @@ std::string GetJavaScriptFunctionName(  const char* functionName );
  std::string PropertyNameToJavaScriptName(const std::string& hyphenatedName);
 
 /**
- * Convert camelCase to hyphenated to (Wrapper property name to Dali property)
- * E.g. anchorPoint to "anchor-point"
- * @param[in] camelCase a std::string camelCase
- * @return a hyphenated std::string conversion
+ * Script error, throws an exception
  */
- std::string JavaScriptNameToPropertyName(const std::string& camelCase);
+void ScriptError( const char* function, v8::Isolate* isolate, std::string errorString );
 
 /**
- * Script error, throws an exception
+ * Script warning
  */
-void ScriptError( const char* function, v8::Isolate* isolate, std::string errorString );
+void ScriptWarning( const char* function, std::string warningString );
 
 /**
  * @return in the value is a boolean primitive or a boolean object
@@ -194,7 +201,7 @@ Property::Value GetPropertyValueFromObject( bool& found, v8::Isolate* isolate, c
 /**
  * Given a JavaScript object with
  * @param [in] object JavaScrript object
- * @return DALi ProperyMap from the  JavaScript object
+ * @return DALi ProperyMap from the JavaScript object
  */
 Property::Map GetPropertyMapFromObject( v8::Isolate* isolate, const v8::Local<v8::Object>& object);
 
@@ -251,6 +258,13 @@ bool GetBooleanParameter( unsigned int index, bool& found, v8::Isolate* isolate,
 /**
  * @param [in] index parameter index, e.g. callMyFunc( index0, index1, index2).
  * @param[out] found whether the parameter was found
+ * @return ArrayBufferView from the JavaScript function arguments
+ */
+void* GetArrayBufferViewParameter( unsigned int index, bool& found, v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args  );
+
+/**
+ * @param [in] index parameter index, e.g. callMyFunc( index0, index1, index2).
+ * @param[out] found whether the parameter was found
  * @return DALi Handle value from the JavaScript function arguments
  */
 Handle GetHandleParameter( unsigned int index, bool& found, v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args  );
@@ -369,5 +383,5 @@ void ReadIntegerArguments( bool& foundAllArguments, int* data, int dataSize, con
 } // namespace Dali
 
 
-#endif // __DALI_V8PLUGIN_V8_UTILS_H__
+#endif // DALI_V8PLUGIN_V8_UTILS_H