This topic describes how you can use the Message Template Generator in the Tizen Studio to help you implement messaging between the JavaScript and Native Client components in a Native Client application.
In a Native Client (NaCl) application, the NaCl module and the JavaScript component must be able to communicate with each other. The JavaScript component uses the JavaScript messaging API, while the NaCl module uses the PostMessage() function to send messages and the HandleMessage() function to receive them.
PostMessage()
HandleMessage()
The Tizen Studio can generate and insert code stubs for messaging functions, so you can focus on implementing the communication logic. For information on implementing messaging in NaCl applications, see Messaging System.
To generate message handling code templates:
In the "Project Explorer" view, right-click the TV application project or NaCl project, and select "NaCl > Add Messages".
Define the NaCl module name, and the NaCl and JavaScript source files to add code templates to.
id
<embed>
To define a new message:
To delete a message, select it from the list, and click "Delete".
To generate and insert the message code templates into the source code, click "Generate".
For each defined message, the Message Template Generator creates the following code:
PostMessage_<message_name>()
send_<message_name>()
HandleMessage_<message_name>()
onReceive_<message_name>()
The generated code also includes stubs for documentation in Doxygen and JSDoc styles.