Implement script-to-host messaging #33
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: canary/canary-rs#33
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?
Add a new ABI function (
panel_send_message
) to send messages (as byte pointers plus byte length) back to a panel (identified with the ID given duringbind_panel
).The host-side
ScriptAbi
struct will need to have aVecDeque
ofVec<u8>
s for each panel ID. Thepanel_send_message
function will push a copied byte array from the script to the deque.canary::Panel
will need a new function to read messages (pop messages from the deque) from the script. Usage looks like:Signature is
Panel::recv_message(&self) -> Option<Vec<u8>>
.Magpie will need a new
MagpieClientMsg
kind to send messages to the client. Panel messages should be flushed after every event (update
,draw
, etc.). The window store will need to send messages received back to the IPC thread using a new variant ofIpcMessage
.magpie::protocol::Messenger
already implements the client-side packet receiving logic.