Expose API for setting window size / title from Orca apps #47
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What sort of API are you thinking? Do you want to share the
oc_window_*
API between the runtime API and the internals? Or have a simpler one for the runtime, similar to how theoc_surface_*
API works?I'll propose the latter so we have something concrete to talk about:
Following the same kind of conventions as other "indirect" bindings (e.g.
oc_runtime_log
), we could have a native sideoc_runtime_window_set_title()
/oc_runtime_window_set_size()
that calls the internaloc_window_set_title()
/oc_window_set_size()
, and the wasm3 stub can be generated from core_api.json.Also maybe it would be more consistent if we'd pass an
oc_str8
for the window title? (and also a bit easier to check in the binding code)Btw I'm not super happy with the
oc_runtime_xxx
naming conventions for "functions exposed by the runtime that just marshall arguments and forwards to internal APIs". But the_stub
suffix is already taken by the auto-generated wasm3 binding code.Feel free to propose another naming if you have a better idea!
This sounds good, I wasn't thinking about the potential conflict with the stub name. I'll take a crack at this today/tomorrow.
Bad naming ideas to spur better naming ideas:
ocr_window_set_title
(OrCa Runtime)_oc_window_set_title
(or__oc_window_set_title
)oc_window_set_title_
(even better)OC_window_set_size
(like Go but cooler)More seriously, I think it's fine for the naming to be a bit more verbose as long as users don't see the clumsier names.
Also seriously, I think it's a bit odd that the binding would go
oc_window_set_title
->oc_runtime_window_set_title
->oc_window_set_title
. Seems like it would make more sense for the internal-est function to have a different name, and for the stub and the WASM import to share the same name? (Perhaps I'm misunderstanding.)Or
oc_internal_window_set_title
The situation is that some functions on the host and guest side "do the same thing" (hence the same name) but don't take exactly the same parameters (e.g. we don't expose the window API directly, so the window handle is implicit for orca apps), or some checks need to happen in between (e.g. for
oc_io_wait_single_req
we need to "re-root" absolute paths to the private data folder).Other bad naming ideas:
oc_window_set_title_guard
oc_window_set_title_bridge
For this change, I wound up going with
oc_runtime_window_set_title()
oc_runtime_window_set_size()
Since the names follow existing conventions. We can do a naming pass later if desired.
PR #61
Should we close this now that #61 is in?
Oh yep, didn't see it wasn't closed automatically