123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361(* This file was generated automatically by wayland-scanner-ocaml *)[@@@ocaml.warning"-27"]openstructmoduleImports=structincludeGtk_primary_selection_protoincludeWayland.Wayland_protoendmoduleProxy=Wayland.ProxymoduleMsg=Wayland.MsgmoduleFixed=Wayland.FixedmoduleIface_reg=Wayland.Iface_regmoduleS=Wayland.Send(** X primary selection emulation.
The primary selection device manager is a singleton global object that
provides access to the primary selection. It allows to create
wp_primary_selection_source objects, as well as retrieving the per-seat
wp_primary_selection_device objects. *)moduleGtk_primary_selection_device_manager=structtype'vt=([`Gtk_primary_selection_device_manager],'v,[`Server])Proxy.t(** {2 Version 1} *)(**/**)classvirtual['v]_handlers_unsafe=object(_self:(_,'v,_)#Proxy.Handler.t)methoduser_data=S.No_datamethodmetadata=(moduleGtk_primary_selection_proto.Gtk_primary_selection_device_manager)methodmax_version=1lmethodprivatevirtualon_create_source:[>]t->([`Gtk_primary_selection_source],'v,[`Server])Proxy.t->unitmethodprivatevirtualon_get_device:[>]t->([`Gtk_primary_selection_device],'v,[`Server])Proxy.t->seat:([`Wl_seat],[>Imports.Wl_seat.versions],[`Server])Proxy.t->unitmethodprivatevirtualon_destroy:[>]t->unitmethoddispatch(_proxy:'vt)_msg=let_proxy=Proxy.cast_version_proxyinmatchMsg.op_msgwith|0->letid:([`Gtk_primary_selection_source],_,_)Proxy.t=Msg.get_int_msg|>Proxy.Handler.accept_new_proxy(moduleImports.Gtk_primary_selection_source)in_self#on_create_source_proxyid|1->letid:([`Gtk_primary_selection_device],_,_)Proxy.t=Msg.get_int_msg|>Proxy.Handler.accept_new_proxy(moduleImports.Gtk_primary_selection_device)inletseat:([`Wl_seat],_,_)Proxy.t=letProxy.Proxyp=Msg.get_int_msg|>Proxy.lookup_other_proxyinmatchProxy.typwith|Imports.Wl_seat.T->p|_->Proxy.wrong_type~parent:_proxy~expected:"wl_seat"pin_self#on_get_device_proxyid~seat|2->Proxy.shutdown_recv_proxy;_self#on_destroy_proxy|_->assertfalseend(**/**)(** {2 Handlers}
Note: Servers will always want to use [v1].
*)(** Handler for a proxy with version >= 1. *)classvirtual['v]v1=object(_:(_,'v,_)#Proxy.Service_handler.t)(**/**)inherit[[<`V1]as'v]_handlers_unsafe(**/**)methodprivatevirtualon_create_source:[>`V1]t->([`Gtk_primary_selection_source],'v,[`Server])Proxy.t->unit(** Create a new primary selection source.
Create a new primary selection source. *)methodprivatevirtualon_get_device:[>`V1]t->([`Gtk_primary_selection_device],'v,[`Server])Proxy.t->seat:([`Wl_seat],[>Imports.Wl_seat.versions],[`Server])Proxy.t->unit(** Create a new primary selection device.
Create a new data device for a given seat. *)methodprivatevirtualon_destroy:[>`V1]t->unit(** Destroy the primary selection device manager.
Destroy the primary selection device manager. *)methodmin_version=1lmethodbind_version:[`V1]=`V1endendmoduleGtk_primary_selection_device=structtype'vt=([`Gtk_primary_selection_device],'v,[`Server])Proxy.t(** {2 Version 1} *)(** Advertise a new primary selection.
The wp_primary_selection_device.selection event is sent to notify the
client of a new primary selection. This event is sent after the
wp_primary_selection.data_offer event introducing this object, and after
the offer has announced its mimetypes through
wp_primary_selection_offer.offer.
The data_offer is valid until a new offer or NULL is received
or until the client loses keyboard focus. The client must destroy the
previous selection data_offer, if any, upon receiving this event. *)letselection(_t:([<`V1]as'v)t)(id:([`Gtk_primary_selection_offer],_,[`Server])Proxy.toption)=let_msg=Proxy.alloc_t~op:1~ints:1~strings:[]~arrays:[]inMsg.add_int_msg(Proxy.id_optid);Proxy.send_t_msg(** Introduce a new wp_primary_selection_offer.
Introduces a new wp_primary_selection_offer object that may be used
to receive the current primary selection. Immediately following this
event, the new wp_primary_selection_offer object will send
wp_primary_selection_offer.offer events to describe the offered mime
types. *)letdata_offer(_t:([<`V1]as'v)t)(offer:([`Gtk_primary_selection_offer],'v,[`Server])#Proxy.Handler.t)=let__offer=Proxy.spawn_tofferinlet_msg=Proxy.alloc_t~op:0~ints:1~strings:[]~arrays:[]inMsg.add_int_msg(Proxy.id__offer);Proxy.send_t_msg;__offer(**/**)classvirtual['v]_handlers_unsafe=object(_self:(_,'v,_)#Proxy.Handler.t)methoduser_data=S.No_datamethodmetadata=(moduleGtk_primary_selection_proto.Gtk_primary_selection_device)methodmax_version=1lmethodprivatevirtualon_set_selection:[>]t->source:([`Gtk_primary_selection_source],[>Imports.Gtk_primary_selection_source.versions],[`Server])Proxy.toption->serial:int32->unitmethodprivatevirtualon_destroy:[>]t->unitmethoddispatch(_proxy:'vt)_msg=let_proxy=Proxy.cast_version_proxyinmatchMsg.op_msgwith|0->letsource:([`Gtk_primary_selection_source],_,_)Proxy.toption=matchMsg.get_int_msgwith|0l->None|id->letProxy.Proxyp=Proxy.lookup_other_proxyidinmatchProxy.typwith|Imports.Gtk_primary_selection_source.T->Somep|_->Proxy.wrong_type~parent:_proxy~expected:"gtk_primary_selection_source"pinletserial=Msg.get_int_msgin_self#on_set_selection_proxy~source~serial|1->Proxy.shutdown_recv_proxy;_self#on_destroy_proxy|_->assertfalseend(**/**)(** {2 Handlers}
Note: Servers will always want to use [v1].
*)(** Handler for a proxy with version >= 1. *)classvirtual['v]v1=object(_:(_,'v,_)#Proxy.Service_handler.t)(**/**)inherit[[<`V1]as'v]_handlers_unsafe(**/**)methodprivatevirtualon_set_selection:[>`V1]t->source:([`Gtk_primary_selection_source],[>Imports.Gtk_primary_selection_source.versions],[`Server])Proxy.toption->serial:int32->unit(** Set the primary selection.
Replaces the current selection. The previous owner of the primary selection
will receive a wp_primary_selection_source.cancelled event.
To unset the selection, set the source to NULL. *)methodprivatevirtualon_destroy:[>`V1]t->unit(** Destroy the primary selection device.
Destroy the primary selection device. *)methodmin_version=1lendend(** Offer to transfer primary selection contents.
A wp_primary_selection_offer represents an offer to transfer the contents
of the primary selection clipboard to the client. Similar to
wl_data_offer, the offer also describes the mime types that the source
will transferthat the
data can be converted to and provides the mechanisms for transferring the
data directly to the client. *)moduleGtk_primary_selection_offer=structtype'vt=([`Gtk_primary_selection_offer],'v,[`Server])Proxy.t(** {2 Version 1} *)(** Advertise offered mime type.
Sent immediately after creating announcing the wp_primary_selection_offer
through wp_primary_selection_device.data_offer. One event is sent per
offered mime type. *)letoffer(_t:([<`V1]as'v)t)~mime_type=let_msg=Proxy.alloc_t~op:0~ints:1~strings:[(Somemime_type)]~arrays:[]inMsg.add_string_msgmime_type;Proxy.send_t_msg(**/**)classvirtual['v]_handlers_unsafe=object(_self:(_,'v,_)#Proxy.Handler.t)methoduser_data=S.No_datamethodmetadata=(moduleGtk_primary_selection_proto.Gtk_primary_selection_offer)methodmax_version=1lmethodprivatevirtualon_receive:[>]t->mime_type:string->fd:Unix.file_descr->unitmethodprivatevirtualon_destroy:[>]t->unitmethoddispatch(_proxy:'vt)_msg=let_proxy=Proxy.cast_version_proxyinmatchMsg.op_msgwith|0->letmime_type=Msg.get_string_msginletfd=Msg.get_fd_msgin_self#on_receive_proxy~mime_type~fd|1->Proxy.shutdown_recv_proxy;_self#on_destroy_proxy|_->assertfalseend(**/**)(** {2 Handlers}
Note: Servers will always want to use [v1].
*)(** Handler for a proxy with version >= 1. *)classvirtual['v]v1=object(_:(_,'v,_)#Proxy.Service_handler.t)(**/**)inherit[[<`V1]as'v]_handlers_unsafe(**/**)methodprivatevirtualon_receive:[>`V1]t->mime_type:string->fd:Unix.file_descr->unit(** Request that the data is transferred.
To transfer the contents of the primary selection clipboard, the client
issues this request and indicates the mime type that it wants to
receive. The transfer happens through the passed file descriptor
(typically created with the pipe system call). The source client writes
the data in the mime type representation requested and then closes the
file descriptor.
The receiving client reads from the read end of the pipe until EOF and
closes its end, at which point the transfer is complete. *)methodprivatevirtualon_destroy:[>`V1]t->unit(** Destroy the primary selection offer.
Destroy the primary selection offer. *)methodmin_version=1lendend(** Offer to replace the contents of the primary selection.
The source side of a wp_primary_selection_offer, it provides a way to
describe the offered data and respond to requests to transfer the
requested contents of the primary selection clipboard. *)moduleGtk_primary_selection_source=structtype'vt=([`Gtk_primary_selection_source],'v,[`Server])Proxy.t(** {2 Version 1} *)(** Request for primary selection contents was canceled.
This primary selection source is no longer valid. The client should
clean up and destroy this primary selection source. *)letcancelled(_t:([<`V1]as'v)t)=let_msg=Proxy.alloc_t~op:1~ints:0~strings:[]~arrays:[]inProxy.send_t_msg(** Send the primary selection contents.
Request for the current primary selection contents from the client.
Send the specified mime type over the passed file descriptor, then
close it. *)letsend(_t:([<`V1]as'v)t)~mime_type~fd=let_msg=Proxy.alloc_t~op:0~ints:2~strings:[(Somemime_type)]~arrays:[]inMsg.add_string_msgmime_type;Msg.add_fd_msgfd;Proxy.send_t_msg(**/**)classvirtual['v]_handlers_unsafe=object(_self:(_,'v,_)#Proxy.Handler.t)methoduser_data=S.No_datamethodmetadata=(moduleGtk_primary_selection_proto.Gtk_primary_selection_source)methodmax_version=1lmethodprivatevirtualon_offer:[>]t->mime_type:string->unitmethodprivatevirtualon_destroy:[>]t->unitmethoddispatch(_proxy:'vt)_msg=let_proxy=Proxy.cast_version_proxyinmatchMsg.op_msgwith|0->letmime_type=Msg.get_string_msgin_self#on_offer_proxy~mime_type|1->Proxy.shutdown_recv_proxy;_self#on_destroy_proxy|_->assertfalseend(**/**)(** {2 Handlers}
Note: Servers will always want to use [v1].
*)(** Handler for a proxy with version >= 1. *)classvirtual['v]v1=object(_:(_,'v,_)#Proxy.Service_handler.t)(**/**)inherit[[<`V1]as'v]_handlers_unsafe(**/**)methodprivatevirtualon_offer:[>`V1]t->mime_type:string->unit(** Add an offered mime type.
This request adds a mime type to the set of mime types advertised to
targets. Can be called several times to offer multiple types. *)methodprivatevirtualon_destroy:[>`V1]t->unit(** Destroy the primary selection source.
Destroy the primary selection source. *)methodmin_version=1lendend