> Le 26 oct. 2021 à 11:50, Stéphane LOS <stephane....@slo-ist.fr> a écrit :
> 
> Hello there,
> 
> justGage in one of the libraries used by the Node-RED Dashboard :
> https://flows.nodered.org/node/node-red-dashboard
> https://toorshia.github.io/justgage/
> 
> It looks pretty simple and it should not be too difficult to create a Gnoga 
> plugin but I've looked the other plugins and I miss some guidelines on the 
> low level mechanisms of Gnoga.
> 
> I won't give up any soon but a little help would be nice.
> 
> I'm looking also on adding charting library. justGage is my first attempt.


Hello Stéphane,

That's nice plugin outcome ;-)

There isn't any standalone guidelines but when writing Pixi plugin I was 
inspired by those written by David.

When creating the PIXI plugin I went through the following steps:

First I wrote the complete specification at once, for instance with sprites:
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi-sprite.ads

The Load_PIXI procedure is used to load the needed stuff for the Javascript 
part of the plugin.
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi.ads#l53

The chosen type of your plugin object may be:
- Gnoga.Gui.Base.Base_Type
- Gnoga.Gui.Element.Element_Type
- Gnoga.Gui.View.View_Type
It depends on which set of API you want to inherit to write the implementation 
part of the plugin.

I chose Gnoga.Gui.Element.Element_Type:
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi.ads#l60
 but it might be Gnoga.Gui.Base.Base_Type:
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi.ads#l64

Then comes the creation procedure of the GUI 
object.https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi-sprite.ads#l70

All specific API subroutines which follow are split in properties:
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi-sprite.ads#l70
and methods:
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi-sprite.ads#l264

Let be inspired by your Javascript API:
https://github.com/toorshia/justgage#methods

On the implementation side:
The Load_PIXI procedure is implemented with the plugin script.
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi.adb#l46

The Create procedure is somewhat special :
- set the object ID with a new one
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi.adb#l68
- set the connection ID to the window ID (seem not needed with next step)
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi.adb#l69
- attach the object to message system
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi.adb#l70
- initialize the object on Javascript side
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi.adb#l72
- fire the message child added to the parent
https://sourceforge.net/p/gnoga/code/ci/dev_1.6/tree/components/pixi/src/gnoga-gui-plugin-pixi.adb#l80

Then implements your API using the ones of Gnoga.

If you want to use the message system, ask me.

HTH, Pascal.
https://blady.pagesperso-orange.fr




_______________________________________________
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to