![]() |
BasicExternalObject.cpp File ReferenceDetailed DescriptionThe sample shows how to implement a basic external object and to extend the JavaScript DOM.The sample demonstrates how to pass simple data types back to JavaScript from the External Object such as Strings, booleans, integers and scripts. All of the exported functions that are available to JavaScript take 3 arguments:
See SoSharedLibDefs.h for error codes and return types See Using the Sample Projects for information on how to build the library See Installing External Objects for information on how to install and use the library Definition in file BasicExternalObject.cpp.
Go to the source code of this file.
Function Documentation
accepts a single parameter of true or false. This methods returns a string to JavaScript describing the value that was passed in as an argument. To call from JavaScript:
myObj.acceptBoolean(true);
If the arguments are not correct then a bad argument error code is returned.
Definition at line 243 of file BasicExternalObject.cpp. References TaggedData_s::data, getNewBuffer(), TaggedData_s::intval, kESErrBadArgumentList, kESErrOK, kTypeBool, kTypeString, TaggedData_s::string, and TaggedData_s::type.
Appends a string onto the passed argument. This function only accepts a single argument, a String. The passed argument is appended with another string and then returned back to the scripting environment. To call from JavaScript:
myObj.appendString("A String");
If the arguments are not correct then a bad argument error code is returned.
Definition at line 164 of file BasicExternalObject.cpp. References TaggedData_s::data, getNewBuffer(), kESErrBadArgumentList, kESErrOK, kTypeString, TaggedData_s::string, and TaggedData_s::type.
Free any string memory which has been returned as function result.
Definition at line 273 of file BasicExternalObject.cpp.
Returns the version number of the library. ExtendScript publishes this number as the version property of the object created by new ExternalObject. Definition at line 284 of file BasicExternalObject.cpp.
Initialize the library and return function signatures. These signatures have no effect on the arguments that can be passed to the functions. They are used by JavaScript to cast the arguments, and to populate the reflection interface. Definition at line 296 of file BasicExternalObject.cpp.
Terminate the library. Does any necessary clean up that is needed. Definition at line 306 of file BasicExternalObject.cpp.
Computes the average of passed integers. From JavaScript, this function can be called with any number of arguments. The passed arguments must be numbers and not strings. To call from JavaScript:
myObj.average(10, 20, 30); If the arguments are not correct then a bad argument error code is returned.
Definition at line 126 of file BasicExternalObject.cpp. References TaggedData_s::data, TaggedData_s::fltval, kESErrBadArgumentList, kESErrOK, kTypeDouble, and TaggedData_s::type.
Utility function to handle strings and memory clean up.
Definition at line 63 of file BasicExternalObject.cpp. Referenced by acceptBoolean(), appendString(), makeArray(), and myScript().
Create a three-element array as a script and returns that array. The return type is set to kTypeScript so when the string is returned to the scripting engine it will be evaluated and ran as a script. From JavaScript this methods accept zero arguments:
myObj.makeArray(); If the arguments are not correct then a bad argument error code is returned.
Definition at line 92 of file BasicExternalObject.cpp. References TaggedData_s::data, getNewBuffer(), kESErrBadArgumentList, kESErrOK, kTypeScript, TaggedData_s::string, and TaggedData_s::type.
Returns a script that creates a new menu within Bridge. The return type is set to kTypeScript so when the string is returned to the scripting engine it will be evaluated and ran as a script. The return script creates a new MenuElement named 'BEO Menu' in the Tools menu in Bridge. Function accepts any number of parameters of any data type but will ignore them. To call from JavaScript:
myObj.myScript();
Definition at line 210 of file BasicExternalObject.cpp. References TaggedData_s::data, getNewBuffer(), kESErrOK, kTypeScript, TaggedData_s::string, and TaggedData_s::type.
|
![]() |
|