plugin

Top  Previous  Next

It is possible to build fully function plugins using Lua and Javascript. The backend code is written in Lua and has full access to the lua state. The front-end is written in Javascript. There are a few examples on how to do this in the Lua directory.

 

Plugin Description files

To define a script plugin you need to create a plugin description file. These have the extension "plugin". For example the file UPB/upb.plugin. These files are parsed using Lua but do not contain the full lua state. There are a few fields that should be in there.

name

The name of the plugin

description

The description of the plugin

backEndComponentManager

This is a boolean that indicates if the backend has a component manager.

backEndScriptName

The name of the script that contains the backend code.

frontEndComponentManager

This is a boolean indicating if the front-end has a component manager

frontEndIncludes

This is an array of strings that list the javascript files that should be loaded before the front-end script. This allows you to keep your code organized over several files instead of piling everything into one javascript file.

frontEndScriptName

This is the filename of the script containing the front-end script, relative to the lua directory.

id

The ID of the plugin. Make sure you do not use duplicate IDs.

 

Front end scripts

For now we'll refer you to the pio1\plugin.js and UPB\plugin.js files as examples of how to do this. The examples use .ui files, these can be created with the QtCreator.

Back end scripts

For now we'll refer you to the pio1\plugin.lua and UPB\plugin.lua files as examples of how to do this.