package wayland
Module Proxy.Service_handlerSource
Handlers for services (objects added via the registry).
An ('a, 'v, 'role) t handles incoming messages for a service object of type 'a.
val attach_proxy :
('a, [ `Unknown ], 'role) proxy ->
['a, [> `V1 ] as 'v, 'role] t ->
('a, 'v, 'role) proxyattach_proxy p t sets t as the handler for p.
Any method argument that corresponds to a new object will arrive as a half-initialsed proxy (created by the generated bindings using accept_new). This function must be called immediately (before switching threads or using the proxy) so that any future events addressed to this object can be handled.
Like attach_proxy, but ignores the resulting proxy. Useful if the object only needs to respond to messages from the peer, but otherwise doesn't do anything.
If the version rules turn out to be too restrictive, this can be used to disable them. Using this incorrectly may lead to a protocol error (such as receiving an event for which no handler was registered).
Functions for use by generated code
val accept_new :
(_, 'v, [< `Client | `Server ] as 'role) proxy ->
int32 ->
(module Metadata.S with type t = 'a) ->
version:int32 ->
('a, [ `Unknown ], 'role) proxyaccept_new parent id metadata ~version registers a new object, with an ID allocated by the peer.
The generated bindings call this when receiving a new object, before passsing the resulting half-initialised proxy to the application code.