![]() |
BSB Developer Docs
|
JavaScript application library. More...
#include "js_app_manifest.h"Go to the source code of this file.
Data Structures | |
| struct | JsAppIconPath |
| Application icon path descriptor structure. More... | |
| struct | JsAppPathInfo |
| Application paths descriptor structure. More... | |
| struct | JsAppInfo |
| JsApp information structure. More... | |
Typedefs | |
| typedef struct JsApp | JsApp |
| JsApp opaque type. | |
Functions | |
| JsApp * | js_app_alloc (void) |
| Create a JsApp instance. | |
| void | js_app_free (JsApp *instance) |
| Delete a JsApp instance. | |
| bool | js_app_load_from_directory (JsApp *instance, const char *dir_path) |
| Load a JsApp instance from a special directory structure. | |
| bool | js_app_get_info (const JsApp *instance, JsAppInfo *info) |
| Get the application information. | |
JavaScript application library.
A JS application type contains the entirety of the information that is needed to properly display and run a JavaScript application.
The JS application is loaded from a directory with the following structure:
The only two required files are:
appmeta/manifest.json - The application manifest.scripts/main.js - The application entry point script.Additionally, the top-level directory name MUST be the same as the id field in manifest.json.
All sub-folders besides appmeta and scripts are free-form and may or may not be present depending on the application.
| JsApp * js_app_alloc | ( | void | ) |
Create a JsApp instance.
| void js_app_free | ( | JsApp * | instance | ) |
Delete a JsApp instance.
| [in,out] | instance | pointer to the instance to be deleted |
Get the application information.
| [in] | instance | pointer to the instance to be queried |
| [out] | info | pointer to the output structure to be filled out with info (must be allocated) |
true if valid information was present, false otherwise | bool js_app_load_from_directory | ( | JsApp * | instance, |
| const char * | dir_path ) |
Load a JsApp instance from a special directory structure.
| [in,out] | instance | pointer to the instance to be loaded |
| [in] | dir_path | zero-terminated string containing the path to the directory |
true if the application was loaded successfully, false otherwise