-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Universal Plugin System using standard IO #553
Comments
This issue #557 was about adding a plugin directly inside LazPaint in Pascal. The core of the plugin is nice and tidy but this required to modify many files to have the integration in the interface. Maybe this could be adapted so that it becomes more general and involve less files to add one window. The interface could be also generated programmatically, and all the relevant code put in one single file and class. |
Instead of standard IO why don't use a client / server approach? |
With that we can use HTML5Canvas to draw, any javascript library, like 3D libraries and so on, in the end we transmit the final bitmap / final layer.. |
Another way without an API on the side of LazPaint, is using standard IO, make a server tp serve the webpage and an API say with python or deno, the api then sends the data using standard IO, but I'm not sure if possible |
It makes sense. Basically, this would be a plugin provider that in facts set up a bridge between LazPaint and an API. During this lapse of time, plugins can interact via the API. The plugin provider could as well open the adequate webpage or launch the adequate script specific to the plugin. From LazPaint point of view, this would be like a regular plugin provider. The pros:
The cons:
|
I prefer Lazpaint has the API inside. Get Layer: you give an index, say 0, and it returns layer count, blend mode, opacity and bitmap or vectors content. Put Layer: with the power to send a bitmap or a vector. Set blend mode, opacity and layer position. Say I have 4 layers. I can add the new one in the middle, so I send layer 2. A parameter that says I want to replace or add a new layer. And if you want add plurals: Get Layer(s) and Put Layer(s). For more than a single layer at a time. Get Layers returns all layers in an array. Put Layers updates all given layers in an array. If it fails or there are missing properties it must return a proper error message. What do you think? |
A way to launch the plugin is with python. When it launched from the menu it closes it connection with lazpaint and opens a web server. It launches the webpage. Lazpaint can provide the IP of the API with IO. So no hardcoded port is needed. |
About installing new plug in. Program files is by default not writable. |
Hi Lainz, Thank you for the detailed insights and thoughts on the integration with the API. About the idea of have 2 end points for exchanging layer data, while it keeps things simple, it would limit what the plugin can do. This is all fine for a raster plugin, but I would like them to be able to do anything that is possible with LazPaint. Having said that, the concept of having few endpoints isn't necessarily counterproductive. A single endpoint handling a call to a script function with parameters provided as JSON can indeed simplify implementation and also be quite flexible. Otherwise it would make sense to have one endpoint for each script function, still the parameters provided as JSON. For the launching method with Python, your idea sounds feasible. Though when thinking this through, in particular keeping the synchronization with the plugin, it is not so simple and probably a similar effort as making a server API within LazPaint. I am considering sockets, that could be used just like IO to communicate between LazPaint and a plugin and provide a status so that if the plugin is interrupted, LazPaint could give back access to the user interface. You highlight a practical issue that the default |
Thanks for considering usefull my ideas. Yes a single endpoint with parameters will do. |
Here is the API demo: It changes the sides of a bgrashape from a website. |
Thank you so much for sharing this demo. That's a great base to make the http API. Clicking on the numeric field on the webpage updates the LCL application. That is wonderful. And it works seamlessly on MacOS. I will create a thread for this development. |
The goal of the Universal Plugin System is to enhance LazPaint's capabilities by enabling third-party plugin integrations. The primary mechanism for interaction is via Standard I/O, with LazPaint acting as a server to facilitate communication with plugin providers.
Plugin Providers: These are intermediary programs that
Communication Protocol:
Basic Flow for Common Plugins:
Error Handling:
To consider:
The text was updated successfully, but these errors were encountered: