-
Notifications
You must be signed in to change notification settings - Fork 103
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
Web GUI extension #416
Comments
I think a moderately opinionated option 2 is a good choice I wonder if the approach is to add a header called gui_webview.h which doesnt contain a host or plugin extension but instead defines the struct clap_web view and the gui constant and then use the gui extension with that object (which as you suggest probably contains two things which look like event queues and two things which look like streams) my gut is that the easier it is for a clap gui to advertise the web view in a way which is consistent with the gui extension the easier it will be for devs which is why I sht away from a totally separate extension. But I haven’t written a web plugin yet so this is just thoughts not answers |
I also reckon option 2 would be neater. What's the process for trying to move this forward - writing a strawman |
I'm skeptical that the webview is the right direction, though it could be tried...
I think WASI 0.3 will bring wgu and webcanvas. But then we'd also need the windowing system events (mouse, keyboard, ...). And it is imaginable that this comes with a later update of WASI, we'd just need to be patient and wait. On the architecture side, I don't think it is reasonable to expect every host to implement wasm support.
To me the real and first milestone is the adapter plugin + headless wasm plugins. |
@abique I've obviously explained something badly. 😅 Hosts wouldn't need to support WASM, or have a JS engine. WASM would be an alternative target (akin to Windows/Mac/Linux), for in-browser use. The native builds of the plugin would run exactly as normal - internally they'd probably have a thin wrapper setting up a system-provided webview (e.g. using CHOC) and forwarding messages, but that's not the host's concern. Also, in the browser the WASM runs in a non-GUI context ( Here's a sketch of what I was thinking - I think the rightmost one is the adapter plugin you mentioned, but it's completely optional. |
Ah I didn't understand your goal. I'd be in favor of one or many dedicated extension(s) for |
As for the web gui, I'm not sure how it is supposed to work, but as you said it is about having a frame or a div and then the plugin is autonomous for rendering and dealing with user events. You could make a single ext just for that |
I'm looking to build CLAP plugins as WASM bundles, where all the CLAP API calls are exported from the WASM module. This looks (so far) like it would just work, which would be absolutely awesome.
One piece of the puzzle I haven't figured out the UI. So far, my effects specify a page to open inside an
<iframe>
, and that web-page posts state updates which are translated into custom (non-CLAP) function calls.Option 1: dedicated extension
I would love to have an official CLAP extension to:
clap_ostream_t
again?)Option 2: webview API type for
clap.gui
This would mean adding a
clap_webview *webview
member to theclap_window
union, and aCLAP_WINDOW_API_...
constant.The
clap_webview
would need to contain a (host-provided) method for posting messages, and registering a (plugin-provided) listener for incoming messages. On the other hand, all the scaling/sizing stuff is already inclap.gui
.With either of these options, the plugin's
clap.gui
implementation (for native GUIs) could set up the webview and then translate messages to/from the other API.The text was updated successfully, but these errors were encountered: