Ocean
JavaScript.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_INTERACTION_JS_JAVA_SCRIPT_H
9 #define META_OCEAN_INTERACTION_JS_JAVA_SCRIPT_H
10 
11 #include "ocean/base/Base.h"
12 
14 
15 #include <v8.h>
16 
17 namespace Ocean
18 {
19 
20 namespace Interaction
21 {
22 
23 namespace JavaScript
24 {
25 
26 /**
27  * @ingroup interaction
28  * @defgroup interactionjs Ocean Interaction JavaScript Library
29  * @{
30  * The Ocean Interaction JavaScript Library implements a java script interaction library.<br>
31  * @}
32  */
33 
34 /**
35  * @namespace Ocean::Interaction::JavaScript Namespace of the Interaction JavaScript library.<p>
36  * The Namespace Ocean::Interaction::JavaScript is used in the entire Ocean Interaction JavaScript Library.
37  */
38 
39 // Defines OCEAN_INTERACTION_JS_EXPORT for dll export and import.
40 #if defined(_WINDOWS) && defined(OCEAN_RUNTIME_SHARED)
41  #ifdef USE_OCEAN_INTERACTION_JS_EXPORT
42  #define OCEAN_INTERACTION_JS_EXPORT __declspec(dllexport)
43  #else
44  #define OCEAN_INTERACTION_JS_EXPORT __declspec(dllimport)
45  #endif
46 #else
47  #define OCEAN_INTERACTION_JS_EXPORT
48 #endif
49 
50 // Defines OCEAN_V8_VERSION according to the given V8 version, 5.3 equals to 50300
51 #define OCEAN_V8_VERSION (V8_MAJOR_VERSION * 10000 + V8_MINOR_VERSION * 100)
52 
53 /**
54  * Returns the name of this interaction library.
55  * @ingroup interactionjs
56  */
57 OCEAN_INTERACTION_JS_EXPORT std::string nameJavaScriptLibrary();
58 
59 #ifdef OCEAN_RUNTIME_STATIC
60 
61 /**
62  * Registers this JavaScript interaction library at the global interaction manager.
63  * This function calls JSLibrary::registerLibrary() only.
64  * @ingroup interactionjs
65  */
67 
68 /**
69  * Unregisters this JavaScript interaction library at the global interaction manager.
70  * This function calls JSLibrary::unregisterLibrary() only.
71  * @return True, if succeeded
72  * @ingroup interactionjs
73  */
75 
76 #endif // OCEAN_RUNTIME_STATIC
77 
78 } // namespace JavaScript
79 
80 } // namespace Interaction
81 
82 } // namespace Ocean
83 
84 #endif // META_OCEAN_INTERACTION_JS_JAVA_SCRIPT_H
OCEAN_INTERACTION_JS_EXPORT std::string nameJavaScriptLibrary()
Returns the name of this interaction library.
void registerJavaScriptLibrary()
Registers this JavaScript interaction library at the global interaction manager.
bool unregisterJavaScriptLibrary()
Unregisters this JavaScript interaction library at the global interaction manager.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15