diff --git a/examples/client.rs b/examples/client.rs index 4bc9d61..78c50a8 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -56,7 +56,20 @@ impl Dispatcher for Display { } } -impl WlDisplay for Display {} +impl WlDisplay for Display { + async fn error( + &self, + object_id: waynest::wire::ObjectId, + code: u32, + message: String, + ) -> waynest::client::Result<()> { + todo!() + } + + async fn delete_id(&self, id: u32) -> waynest::client::Result<()> { + todo!() + } +} #[tokio::main] async fn main() -> Result<()> { diff --git a/gen/src/client.rs b/gen/src/client.rs index 486ddca..0834b64 100644 --- a/gen/src/client.rs +++ b/gen/src/client.rs @@ -29,6 +29,7 @@ pub fn generate_client_code(current: &[Pair], pairs: &[Pair]) -> TokenStream { let enums = write_enums(&interface); let requests = write_requests(pairs, pair, interface); + let events = write_events(pairs, pair, interface); let imports = if requests.is_empty() { quote! {} @@ -61,7 +62,7 @@ pub fn generate_client_code(current: &[Pair], pairs: &[Pair]) -> TokenStream { } #(#requests)* - // #(#events)* + #(#events)* } } }) @@ -180,3 +181,36 @@ fn write_requests(pairs: &[Pair], pair: &Pair, interface: &Interface) -> Vec Vec { + let mut requests = Vec::new(); + + for request in &interface.events { + let docs = description_to_docs(request.description.as_ref()); + let name = make_ident(request.name.to_snek_case()); + let mut args = vec![ + quote! {&self }, + // quote! {object: &crate::server::Object}, + // quote! {client: &mut crate::server::Client}, + ]; + + for arg in &request.args { + let mut ty = arg.to_rust_type_token(arg.find_protocol(pairs).as_ref().unwrap_or(pair)); + + if arg.allow_null { + ty = quote! {Option<#ty>}; + } + + let name = make_ident(arg.name.to_snek_case()); + + args.push(quote! {#name: #ty}) + } + + requests.push(quote! { + #(#docs)* + async fn #name(#(#args),*) -> crate::client::Result<()>; + }); + } + + requests +} diff --git a/src/client/protocol/core.rs b/src/client/protocol/core.rs index b8f782f..6404d7f 100644 --- a/src/client/protocol/core.rs +++ b/src/client/protocol/core.rs @@ -96,6 +96,25 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "The error event is sent out when a fatal (non-recoverable)"] + #[doc = "error has occurred. The object_id argument is the object"] + #[doc = "where the error occurred, most often in response to a request"] + #[doc = "to that object. The code identifies the error and is defined"] + #[doc = "by the object interface. As such, each interface defines its"] + #[doc = "own set of error codes. The message is a brief description"] + #[doc = "of the error, for (debugging) convenience."] + async fn error( + &self, + object_id: crate::wire::ObjectId, + code: u32, + message: String, + ) -> crate::client::Result<()>; + #[doc = "This event is used internally by the object ID management"] + #[doc = "logic. When a client deletes an object that it had created,"] + #[doc = "the server will send this event to acknowledge that it has"] + #[doc = "seen the delete request. When the client receives this event,"] + #[doc = "it will know that it can safely reuse the object ID."] + async fn delete_id(&self, id: u32) -> crate::client::Result<()>; } } #[doc = "The singleton global registry object. The server has a number of"] @@ -153,6 +172,28 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "Notify the client of global objects."] + #[doc = ""] + #[doc = "The event notifies the client that a global object with"] + #[doc = "the given name is now available, and it implements the"] + #[doc = "given version of the given interface."] + async fn global( + &self, + name: u32, + interface: String, + version: u32, + ) -> crate::client::Result<()>; + #[doc = "Notify the client of removed global objects."] + #[doc = ""] + #[doc = "This event notifies the client that the global identified"] + #[doc = "by name is no longer available. If the client bound to"] + #[doc = "the global using the bind request, the client should now"] + #[doc = "destroy that object."] + #[doc = ""] + #[doc = "The object remains valid and requests to the object will be"] + #[doc = "ignored until the client destroys it, to avoid races between"] + #[doc = "the global going away and a client sending a request to it."] + async fn global_remove(&self, name: u32) -> crate::client::Result<()>; } } #[doc = "Clients can handle the 'done' event to get notified when"] @@ -175,6 +216,8 @@ pub mod wayland { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "Notify the client when the related request is done."] + async fn done(&self, callback_data: u32) -> crate::client::Result<()>; } } #[doc = "A compositor. This object is a singleton global. The"] @@ -801,6 +844,10 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "Informs the client about a valid pixel format that"] + #[doc = "can be used for buffers. Known formats include"] + #[doc = "argb8888 and xrgb8888."] + async fn format(&self, format: Format) -> crate::client::Result<()>; } } #[doc = "A buffer provides the content for a wl_surface. Buffers are"] @@ -850,6 +897,19 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent when this wl_buffer is no longer used by the compositor."] + #[doc = "The client is now free to reuse or destroy this buffer and its"] + #[doc = "backing storage."] + #[doc = ""] + #[doc = "If a client receives a release event before the frame callback"] + #[doc = "requested in the same wl_surface.commit that attaches this"] + #[doc = "wl_buffer to a surface, then the client is immediately free to"] + #[doc = "reuse the buffer and its backing storage, and does not need a"] + #[doc = "second buffer for the next surface content update. Typically"] + #[doc = "this is possible, when the compositor maintains a copy of the"] + #[doc = "wl_surface contents, e.g. as a GL texture. This is an important"] + #[doc = "optimization for GL(ES) compositors with wl_shm clients."] + async fn release(&self) -> crate::client::Result<()>; } } #[doc = "A wl_data_offer represents a piece of data offered for transfer"] @@ -1049,6 +1109,56 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent immediately after creating the wl_data_offer object. One"] + #[doc = "event per offered mime type."] + async fn offer(&self, mime_type: String) -> crate::client::Result<()>; + #[doc = "This event indicates the actions offered by the data source. It"] + #[doc = "will be sent immediately after creating the wl_data_offer object,"] + #[doc = "or anytime the source side changes its offered actions through"] + #[doc = "wl_data_source.set_actions."] + async fn source_actions( + &self, + source_actions : super :: super :: super :: core :: wayland :: wl_data_device_manager :: DndAction, + ) -> crate::client::Result<()>; + #[doc = "This event indicates the action selected by the compositor after"] + #[doc = "matching the source/destination side actions. Only one action (or"] + #[doc = "none) will be offered here."] + #[doc = ""] + #[doc = "This event can be emitted multiple times during the drag-and-drop"] + #[doc = "operation in response to destination side action changes through"] + #[doc = "wl_data_offer.set_actions."] + #[doc = ""] + #[doc = "This event will no longer be emitted after wl_data_device.drop"] + #[doc = "happened on the drag-and-drop destination, the client must"] + #[doc = "honor the last action received, or the last preferred one set"] + #[doc = "through wl_data_offer.set_actions when handling an \"ask\" action."] + #[doc = ""] + #[doc = "Compositors may also change the selected action on the fly, mainly"] + #[doc = "in response to keyboard modifier changes during the drag-and-drop"] + #[doc = "operation."] + #[doc = ""] + #[doc = "The most recent action received is always the valid one. Prior to"] + #[doc = "receiving wl_data_device.drop, the chosen action may change (e.g."] + #[doc = "due to keyboard modifiers being pressed). At the time of receiving"] + #[doc = "wl_data_device.drop the drag-and-drop destination must honor the"] + #[doc = "last action received."] + #[doc = ""] + #[doc = "Action changes may still happen after wl_data_device.drop,"] + #[doc = "especially on \"ask\" actions, where the drag-and-drop destination"] + #[doc = "may choose another action afterwards. Action changes happening"] + #[doc = "at this stage are always the result of inter-client negotiation, the"] + #[doc = "compositor shall no longer be able to induce a different action."] + #[doc = ""] + #[doc = "Upon \"ask\" actions, it is expected that the drag-and-drop destination"] + #[doc = "may potentially choose a different action and/or mime type,"] + #[doc = "based on wl_data_offer.source_actions and finally chosen by the"] + #[doc = "user (e.g. popping up a menu with the available options). The"] + #[doc = "final wl_data_offer.set_actions and wl_data_offer.accept requests"] + #[doc = "must happen before the call to wl_data_offer.finish."] + async fn action( + &self, + dnd_action: super::super::super::core::wayland::wl_data_device_manager::DndAction, + ) -> crate::client::Result<()>; } } #[doc = "The wl_data_source object is the source side of a wl_data_offer."] @@ -1149,6 +1259,86 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent when a target accepts pointer_focus or motion events. If"] + #[doc = "a target does not accept any of the offered types, type is NULL."] + #[doc = ""] + #[doc = "Used for feedback during drag-and-drop."] + async fn target(&self, mime_type: Option) -> crate::client::Result<()>; + #[doc = "Request for data from the client. Send the data as the"] + #[doc = "specified mime type over the passed file descriptor, then"] + #[doc = "close it."] + async fn send( + &self, + mime_type: String, + fd: rustix::fd::OwnedFd, + ) -> crate::client::Result<()>; + #[doc = "This data source is no longer valid. There are several reasons why"] + #[doc = "this could happen:"] + #[doc = ""] + #[doc = "- The data source has been replaced by another data source."] + #[doc = "- The drag-and-drop operation was performed, but the drop destination"] + #[doc = "did not accept any of the mime types offered through"] + #[doc = "wl_data_source.target."] + #[doc = "- The drag-and-drop operation was performed, but the drop destination"] + #[doc = "did not select any of the actions present in the mask offered through"] + #[doc = "wl_data_source.action."] + #[doc = "- The drag-and-drop operation was performed but didn't happen over a"] + #[doc = "surface."] + #[doc = "- The compositor cancelled the drag-and-drop operation (e.g. compositor"] + #[doc = "dependent timeouts to avoid stale drag-and-drop transfers)."] + #[doc = ""] + #[doc = "The client should clean up and destroy this data source."] + #[doc = ""] + #[doc = "For objects of version 2 or older, wl_data_source.cancelled will"] + #[doc = "only be emitted if the data source was replaced by another data"] + #[doc = "source."] + async fn cancelled(&self) -> crate::client::Result<()>; + #[doc = "The user performed the drop action. This event does not indicate"] + #[doc = "acceptance, wl_data_source.cancelled may still be emitted afterwards"] + #[doc = "if the drop destination does not accept any mime type."] + #[doc = ""] + #[doc = "However, this event might however not be received if the compositor"] + #[doc = "cancelled the drag-and-drop operation before this event could happen."] + #[doc = ""] + #[doc = "Note that the data_source may still be used in the future and should"] + #[doc = "not be destroyed here."] + async fn dnd_drop_performed(&self) -> crate::client::Result<()>; + #[doc = "The drop destination finished interoperating with this data"] + #[doc = "source, so the client is now free to destroy this data source and"] + #[doc = "free all associated data."] + #[doc = ""] + #[doc = "If the action used to perform the operation was \"move\", the"] + #[doc = "source can now delete the transferred data."] + async fn dnd_finished(&self) -> crate::client::Result<()>; + #[doc = "This event indicates the action selected by the compositor after"] + #[doc = "matching the source/destination side actions. Only one action (or"] + #[doc = "none) will be offered here."] + #[doc = ""] + #[doc = "This event can be emitted multiple times during the drag-and-drop"] + #[doc = "operation, mainly in response to destination side changes through"] + #[doc = "wl_data_offer.set_actions, and as the data device enters/leaves"] + #[doc = "surfaces."] + #[doc = ""] + #[doc = "It is only possible to receive this event after"] + #[doc = "wl_data_source.dnd_drop_performed if the drag-and-drop operation"] + #[doc = "ended in an \"ask\" action, in which case the final wl_data_source.action"] + #[doc = "event will happen immediately before wl_data_source.dnd_finished."] + #[doc = ""] + #[doc = "Compositors may also change the selected action on the fly, mainly"] + #[doc = "in response to keyboard modifier changes during the drag-and-drop"] + #[doc = "operation."] + #[doc = ""] + #[doc = "The most recent action received is always the valid one. The chosen"] + #[doc = "action may change alongside negotiation (e.g. an \"ask\" action can turn"] + #[doc = "into a \"move\" operation), so the effects of the final action must"] + #[doc = "always be applied in wl_data_offer.dnd_finished."] + #[doc = ""] + #[doc = "Clients can trigger cursor surface changes from this point, so"] + #[doc = "they reflect the current action."] + async fn action( + &self, + dnd_action: super::super::super::core::wayland::wl_data_device_manager::DndAction, + ) -> crate::client::Result<()>; } } #[doc = "There is one wl_data_device per seat which can be obtained"] @@ -1279,6 +1469,70 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "The data_offer event introduces a new wl_data_offer object,"] + #[doc = "which will subsequently be used in either the"] + #[doc = "data_device.enter event (for drag-and-drop) or the"] + #[doc = "data_device.selection event (for selections). Immediately"] + #[doc = "following the data_device.data_offer event, the new data_offer"] + #[doc = "object will send out data_offer.offer events to describe the"] + #[doc = "mime types it offers."] + async fn data_offer(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event is sent when an active drag-and-drop pointer enters"] + #[doc = "a surface owned by the client. The position of the pointer at"] + #[doc = "enter time is provided by the x and y arguments, in surface-local"] + #[doc = "coordinates."] + async fn enter( + &self, + serial: u32, + surface: crate::wire::ObjectId, + x: crate::wire::Fixed, + y: crate::wire::Fixed, + id: Option, + ) -> crate::client::Result<()>; + #[doc = "This event is sent when the drag-and-drop pointer leaves the"] + #[doc = "surface and the session ends. The client must destroy the"] + #[doc = "wl_data_offer introduced at enter time at this point."] + async fn leave(&self) -> crate::client::Result<()>; + #[doc = "This event is sent when the drag-and-drop pointer moves within"] + #[doc = "the currently focused surface. The new position of the pointer"] + #[doc = "is provided by the x and y arguments, in surface-local"] + #[doc = "coordinates."] + async fn motion( + &self, + time: u32, + x: crate::wire::Fixed, + y: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "The event is sent when a drag-and-drop operation is ended"] + #[doc = "because the implicit grab is removed."] + #[doc = ""] + #[doc = "The drag-and-drop destination is expected to honor the last action"] + #[doc = "received through wl_data_offer.action, if the resulting action is"] + #[doc = "\"copy\" or \"move\", the destination can still perform"] + #[doc = "wl_data_offer.receive requests, and is expected to end all"] + #[doc = "transfers with a wl_data_offer.finish request."] + #[doc = ""] + #[doc = "If the resulting action is \"ask\", the action will not be considered"] + #[doc = "final. The drag-and-drop destination is expected to perform one last"] + #[doc = "wl_data_offer.set_actions request, or wl_data_offer.destroy in order"] + #[doc = "to cancel the operation."] + async fn drop(&self) -> crate::client::Result<()>; + #[doc = "The selection event is sent out to notify the client of a new"] + #[doc = "wl_data_offer for the selection for this device. The"] + #[doc = "data_device.data_offer and the data_offer.offer events are"] + #[doc = "sent out immediately before this event to introduce the data"] + #[doc = "offer object. The selection event is sent to a client"] + #[doc = "immediately before receiving keyboard focus and when a new"] + #[doc = "selection is set while the client has keyboard focus. The"] + #[doc = "data_offer is valid until a new data_offer or NULL is received"] + #[doc = "or until the client loses keyboard focus. Switching surface with"] + #[doc = "keyboard focus within the same client doesn't mean a new selection"] + #[doc = "will be sent. The client must destroy the previous selection"] + #[doc = "data_offer, if any, upon receiving this event."] + async fn selection( + &self, + id: Option, + ) -> crate::client::Result<()>; } } #[doc = "The wl_data_device_manager is a singleton global object that"] @@ -1763,6 +2017,36 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "Ping a client to check if it is receiving events and sending"] + #[doc = "requests. A client is expected to reply with a pong request."] + async fn ping(&self, serial: u32) -> crate::client::Result<()>; + #[doc = "The configure event asks the client to resize its surface."] + #[doc = ""] + #[doc = "The size is a hint, in the sense that the client is free to"] + #[doc = "ignore it if it doesn't resize, pick a smaller size (to"] + #[doc = "satisfy aspect ratio or resize in steps of NxM pixels)."] + #[doc = ""] + #[doc = "The edges parameter provides a hint about how the surface"] + #[doc = "was resized. The client may use this information to decide"] + #[doc = "how to adjust its content to the new size (e.g. a scrolling"] + #[doc = "area might adjust its content position to leave the viewable"] + #[doc = "content unmoved)."] + #[doc = ""] + #[doc = "The client is free to dismiss all but the last configure"] + #[doc = "event it received."] + #[doc = ""] + #[doc = "The width and height arguments specify the size of the window"] + #[doc = "in surface-local coordinates."] + async fn configure( + &self, + edges: Resize, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "The popup_done event is sent out when a popup grab is broken,"] + #[doc = "that is, when the user clicks a surface that doesn't belong"] + #[doc = "to the client owning the popup surface."] + async fn popup_done(&self) -> crate::client::Result<()>; } } #[doc = "A surface is a rectangular area that may be displayed on zero"] @@ -2308,6 +2592,48 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "This is emitted whenever a surface's creation, movement, or resizing"] + #[doc = "results in some part of it being within the scanout region of an"] + #[doc = "output."] + #[doc = ""] + #[doc = "Note that a surface may be overlapping with zero or more outputs."] + async fn enter(&self, output: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This is emitted whenever a surface's creation, movement, or resizing"] + #[doc = "results in it no longer having any part of it within the scanout region"] + #[doc = "of an output."] + #[doc = ""] + #[doc = "Clients should not use the number of outputs the surface is on for frame"] + #[doc = "throttling purposes. The surface might be hidden even if no leave event"] + #[doc = "has been sent, and the compositor might expect new surface content"] + #[doc = "updates even if no enter event has been sent. The frame event should be"] + #[doc = "used instead."] + async fn leave(&self, output: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event indicates the preferred buffer scale for this surface. It is"] + #[doc = "sent whenever the compositor's preference changes."] + #[doc = ""] + #[doc = "Before receiving this event the preferred buffer scale for this surface"] + #[doc = "is 1."] + #[doc = ""] + #[doc = "It is intended that scaling aware clients use this event to scale their"] + #[doc = "content and use wl_surface.set_buffer_scale to indicate the scale they"] + #[doc = "have rendered with. This allows clients to supply a higher detail"] + #[doc = "buffer."] + #[doc = ""] + #[doc = "The compositor shall emit a scale value greater than 0."] + async fn preferred_buffer_scale(&self, factor: i32) -> crate::client::Result<()>; + #[doc = "This event indicates the preferred buffer transform for this surface."] + #[doc = "It is sent whenever the compositor's preference changes."] + #[doc = ""] + #[doc = "Before receiving this event the preferred buffer transform for this"] + #[doc = "surface is normal."] + #[doc = ""] + #[doc = "Applying this transformation to the surface buffer contents and using"] + #[doc = "wl_surface.set_buffer_transform might allow the compositor to use the"] + #[doc = "surface buffer more efficiently."] + async fn preferred_buffer_transform( + &self, + transform: super::super::super::core::wayland::wl_output::Transform, + ) -> crate::client::Result<()>; } } #[doc = "A seat is a group of keyboards, pointer and touch devices. This"] @@ -2437,6 +2763,48 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "This is emitted whenever a seat gains or loses the pointer,"] + #[doc = "keyboard or touch capabilities. The argument is a capability"] + #[doc = "enum containing the complete set of capabilities this seat has."] + #[doc = ""] + #[doc = "When the pointer capability is added, a client may create a"] + #[doc = "wl_pointer object using the wl_seat.get_pointer request. This object"] + #[doc = "will receive pointer events until the capability is removed in the"] + #[doc = "future."] + #[doc = ""] + #[doc = "When the pointer capability is removed, a client should destroy the"] + #[doc = "wl_pointer objects associated with the seat where the capability was"] + #[doc = "removed, using the wl_pointer.release request. No further pointer"] + #[doc = "events will be received on these objects."] + #[doc = ""] + #[doc = "In some compositors, if a seat regains the pointer capability and a"] + #[doc = "client has a previously obtained wl_pointer object of version 4 or"] + #[doc = "less, that object may start sending pointer events again. This"] + #[doc = "behavior is considered a misinterpretation of the intended behavior"] + #[doc = "and must not be relied upon by the client. wl_pointer objects of"] + #[doc = "version 5 or later must not send events if created before the most"] + #[doc = "recent event notifying the client of an added pointer capability."] + #[doc = ""] + #[doc = "The above behavior also applies to wl_keyboard and wl_touch with the"] + #[doc = "keyboard and touch capabilities, respectively."] + async fn capabilities(&self, capabilities: Capability) -> crate::client::Result<()>; + #[doc = "In a multi-seat configuration the seat name can be used by clients to"] + #[doc = "help identify which physical devices the seat represents."] + #[doc = ""] + #[doc = "The seat name is a UTF-8 string with no convention defined for its"] + #[doc = "contents. Each name is unique among all wl_seat globals. The name is"] + #[doc = "only guaranteed to be unique for the current compositor instance."] + #[doc = ""] + #[doc = "The same seat names are used for all clients. Thus, the name can be"] + #[doc = "shared across processes to refer to a specific wl_seat global."] + #[doc = ""] + #[doc = "The name event is sent after binding to the seat global. This event is"] + #[doc = "only sent once per seat object, and the name does not change over the"] + #[doc = "lifetime of the wl_seat global."] + #[doc = ""] + #[doc = "Compositors may re-use the same seat name if the wl_seat global is"] + #[doc = "destroyed and re-created later."] + async fn name(&self, name: String) -> crate::client::Result<()>; } } #[doc = "The wl_pointer interface represents one or more input devices,"] @@ -2653,6 +3021,250 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "Notification that this seat's pointer is focused on a certain"] + #[doc = "surface."] + #[doc = ""] + #[doc = "When a seat's focus enters a surface, the pointer image"] + #[doc = "is undefined and a client should respond to this event by setting"] + #[doc = "an appropriate pointer image with the set_cursor request."] + async fn enter( + &self, + serial: u32, + surface: crate::wire::ObjectId, + surface_x: crate::wire::Fixed, + surface_y: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "Notification that this seat's pointer is no longer focused on"] + #[doc = "a certain surface."] + #[doc = ""] + #[doc = "The leave notification is sent before the enter notification"] + #[doc = "for the new focus."] + async fn leave( + &self, + serial: u32, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "Notification of pointer location change. The arguments"] + #[doc = "surface_x and surface_y are the location relative to the"] + #[doc = "focused surface."] + async fn motion( + &self, + time: u32, + surface_x: crate::wire::Fixed, + surface_y: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "Mouse button click and release notifications."] + #[doc = ""] + #[doc = "The location of the click is given by the last motion or"] + #[doc = "enter event."] + #[doc = "The time argument is a timestamp with millisecond"] + #[doc = "granularity, with an undefined base."] + #[doc = ""] + #[doc = "The button is a button code as defined in the Linux kernel's"] + #[doc = "linux/input-event-codes.h header file, e.g. BTN_LEFT."] + #[doc = ""] + #[doc = "Any 16-bit button code value is reserved for future additions to the"] + #[doc = "kernel's event code list. All other button codes above 0xFFFF are"] + #[doc = "currently undefined but may be used in future versions of this"] + #[doc = "protocol."] + async fn button( + &self, + serial: u32, + time: u32, + button: u32, + state: ButtonState, + ) -> crate::client::Result<()>; + #[doc = "Scroll and other axis notifications."] + #[doc = ""] + #[doc = "For scroll events (vertical and horizontal scroll axes), the"] + #[doc = "value parameter is the length of a vector along the specified"] + #[doc = "axis in a coordinate space identical to those of motion events,"] + #[doc = "representing a relative movement along the specified axis."] + #[doc = ""] + #[doc = "For devices that support movements non-parallel to axes multiple"] + #[doc = "axis events will be emitted."] + #[doc = ""] + #[doc = "When applicable, for example for touch pads, the server can"] + #[doc = "choose to emit scroll events where the motion vector is"] + #[doc = "equivalent to a motion event vector."] + #[doc = ""] + #[doc = "When applicable, a client can transform its content relative to the"] + #[doc = "scroll distance."] + async fn axis( + &self, + time: u32, + axis: Axis, + value: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "Indicates the end of a set of events that logically belong together."] + #[doc = "A client is expected to accumulate the data in all events within the"] + #[doc = "frame before proceeding."] + #[doc = ""] + #[doc = "All wl_pointer events before a wl_pointer.frame event belong"] + #[doc = "logically together. For example, in a diagonal scroll motion the"] + #[doc = "compositor will send an optional wl_pointer.axis_source event, two"] + #[doc = "wl_pointer.axis events (horizontal and vertical) and finally a"] + #[doc = "wl_pointer.frame event. The client may use this information to"] + #[doc = "calculate a diagonal vector for scrolling."] + #[doc = ""] + #[doc = "When multiple wl_pointer.axis events occur within the same frame,"] + #[doc = "the motion vector is the combined motion of all events."] + #[doc = "When a wl_pointer.axis and a wl_pointer.axis_stop event occur within"] + #[doc = "the same frame, this indicates that axis movement in one axis has"] + #[doc = "stopped but continues in the other axis."] + #[doc = "When multiple wl_pointer.axis_stop events occur within the same"] + #[doc = "frame, this indicates that these axes stopped in the same instance."] + #[doc = ""] + #[doc = "A wl_pointer.frame event is sent for every logical event group,"] + #[doc = "even if the group only contains a single wl_pointer event."] + #[doc = "Specifically, a client may get a sequence: motion, frame, button,"] + #[doc = "frame, axis, frame, axis_stop, frame."] + #[doc = ""] + #[doc = "The wl_pointer.enter and wl_pointer.leave events are logical events"] + #[doc = "generated by the compositor and not the hardware. These events are"] + #[doc = "also grouped by a wl_pointer.frame. When a pointer moves from one"] + #[doc = "surface to another, a compositor should group the"] + #[doc = "wl_pointer.leave event within the same wl_pointer.frame."] + #[doc = "However, a client must not rely on wl_pointer.leave and"] + #[doc = "wl_pointer.enter being in the same wl_pointer.frame."] + #[doc = "Compositor-specific policies may require the wl_pointer.leave and"] + #[doc = "wl_pointer.enter event being split across multiple wl_pointer.frame"] + #[doc = "groups."] + async fn frame(&self) -> crate::client::Result<()>; + #[doc = "Source information for scroll and other axes."] + #[doc = ""] + #[doc = "This event does not occur on its own. It is sent before a"] + #[doc = "wl_pointer.frame event and carries the source information for"] + #[doc = "all events within that frame."] + #[doc = ""] + #[doc = "The source specifies how this event was generated. If the source is"] + #[doc = "wl_pointer.axis_source.finger, a wl_pointer.axis_stop event will be"] + #[doc = "sent when the user lifts the finger off the device."] + #[doc = ""] + #[doc = "If the source is wl_pointer.axis_source.wheel,"] + #[doc = "wl_pointer.axis_source.wheel_tilt or"] + #[doc = "wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event may"] + #[doc = "or may not be sent. Whether a compositor sends an axis_stop event"] + #[doc = "for these sources is hardware-specific and implementation-dependent;"] + #[doc = "clients must not rely on receiving an axis_stop event for these"] + #[doc = "scroll sources and should treat scroll sequences from these scroll"] + #[doc = "sources as unterminated by default."] + #[doc = ""] + #[doc = "This event is optional. If the source is unknown for a particular"] + #[doc = "axis event sequence, no event is sent."] + #[doc = "Only one wl_pointer.axis_source event is permitted per frame."] + #[doc = ""] + #[doc = "The order of wl_pointer.axis_discrete and wl_pointer.axis_source is"] + #[doc = "not guaranteed."] + async fn axis_source(&self, axis_source: AxisSource) -> crate::client::Result<()>; + #[doc = "Stop notification for scroll and other axes."] + #[doc = ""] + #[doc = "For some wl_pointer.axis_source types, a wl_pointer.axis_stop event"] + #[doc = "is sent to notify a client that the axis sequence has terminated."] + #[doc = "This enables the client to implement kinetic scrolling."] + #[doc = "See the wl_pointer.axis_source documentation for information on when"] + #[doc = "this event may be generated."] + #[doc = ""] + #[doc = "Any wl_pointer.axis events with the same axis_source after this"] + #[doc = "event should be considered as the start of a new axis motion."] + #[doc = ""] + #[doc = "The timestamp is to be interpreted identical to the timestamp in the"] + #[doc = "wl_pointer.axis event. The timestamp value may be the same as a"] + #[doc = "preceding wl_pointer.axis event."] + async fn axis_stop(&self, time: u32, axis: Axis) -> crate::client::Result<()>; + #[doc = "Discrete step information for scroll and other axes."] + #[doc = ""] + #[doc = "This event carries the axis value of the wl_pointer.axis event in"] + #[doc = "discrete steps (e.g. mouse wheel clicks)."] + #[doc = ""] + #[doc = "This event is deprecated with wl_pointer version 8 - this event is not"] + #[doc = "sent to clients supporting version 8 or later."] + #[doc = ""] + #[doc = "This event does not occur on its own, it is coupled with a"] + #[doc = "wl_pointer.axis event that represents this axis value on a"] + #[doc = "continuous scale. The protocol guarantees that each axis_discrete"] + #[doc = "event is always followed by exactly one axis event with the same"] + #[doc = "axis number within the same wl_pointer.frame. Note that the protocol"] + #[doc = "allows for other events to occur between the axis_discrete and"] + #[doc = "its coupled axis event, including other axis_discrete or axis"] + #[doc = "events. A wl_pointer.frame must not contain more than one axis_discrete"] + #[doc = "event per axis type."] + #[doc = ""] + #[doc = "This event is optional; continuous scrolling devices"] + #[doc = "like two-finger scrolling on touchpads do not have discrete"] + #[doc = "steps and do not generate this event."] + #[doc = ""] + #[doc = "The discrete value carries the directional information. e.g. a value"] + #[doc = "of -2 is two steps towards the negative direction of this axis."] + #[doc = ""] + #[doc = "The axis number is identical to the axis number in the associated"] + #[doc = "axis event."] + #[doc = ""] + #[doc = "The order of wl_pointer.axis_discrete and wl_pointer.axis_source is"] + #[doc = "not guaranteed."] + async fn axis_discrete(&self, axis: Axis, discrete: i32) -> crate::client::Result<()>; + #[doc = "Discrete high-resolution scroll information."] + #[doc = ""] + #[doc = "This event carries high-resolution wheel scroll information,"] + #[doc = "with each multiple of 120 representing one logical scroll step"] + #[doc = "(a wheel detent). For example, an axis_value120 of 30 is one quarter of"] + #[doc = "a logical scroll step in the positive direction, a value120 of"] + #[doc = "-240 are two logical scroll steps in the negative direction within the"] + #[doc = "same hardware event."] + #[doc = "Clients that rely on discrete scrolling should accumulate the"] + #[doc = "value120 to multiples of 120 before processing the event."] + #[doc = ""] + #[doc = "The value120 must not be zero."] + #[doc = ""] + #[doc = "This event replaces the wl_pointer.axis_discrete event in clients"] + #[doc = "supporting wl_pointer version 8 or later."] + #[doc = ""] + #[doc = "Where a wl_pointer.axis_source event occurs in the same"] + #[doc = "wl_pointer.frame, the axis source applies to this event."] + #[doc = ""] + #[doc = "The order of wl_pointer.axis_value120 and wl_pointer.axis_source is"] + #[doc = "not guaranteed."] + async fn axis_value120(&self, axis: Axis, value120: i32) -> crate::client::Result<()>; + #[doc = "Relative directional information of the entity causing the axis"] + #[doc = "motion."] + #[doc = ""] + #[doc = "For a wl_pointer.axis event, the wl_pointer.axis_relative_direction"] + #[doc = "event specifies the movement direction of the entity causing the"] + #[doc = "wl_pointer.axis event. For example:"] + #[doc = "- if a user's fingers on a touchpad move down and this"] + #[doc = "causes a wl_pointer.axis vertical_scroll down event, the physical"] + #[doc = "direction is 'identical'"] + #[doc = "- if a user's fingers on a touchpad move down and this causes a"] + #[doc = "wl_pointer.axis vertical_scroll up scroll up event ('natural"] + #[doc = "scrolling'), the physical direction is 'inverted'."] + #[doc = ""] + #[doc = "A client may use this information to adjust scroll motion of"] + #[doc = "components. Specifically, enabling natural scrolling causes the"] + #[doc = "content to change direction compared to traditional scrolling."] + #[doc = "Some widgets like volume control sliders should usually match the"] + #[doc = "physical direction regardless of whether natural scrolling is"] + #[doc = "active. This event enables clients to match the scroll direction of"] + #[doc = "a widget to the physical direction."] + #[doc = ""] + #[doc = "This event does not occur on its own, it is coupled with a"] + #[doc = "wl_pointer.axis event that represents this axis value."] + #[doc = "The protocol guarantees that each axis_relative_direction event is"] + #[doc = "always followed by exactly one axis event with the same"] + #[doc = "axis number within the same wl_pointer.frame. Note that the protocol"] + #[doc = "allows for other events to occur between the axis_relative_direction"] + #[doc = "and its coupled axis event."] + #[doc = ""] + #[doc = "The axis number is identical to the axis number in the associated"] + #[doc = "axis event."] + #[doc = ""] + #[doc = "The order of wl_pointer.axis_relative_direction,"] + #[doc = "wl_pointer.axis_discrete and wl_pointer.axis_source is not"] + #[doc = "guaranteed."] + async fn axis_relative_direction( + &self, + axis: Axis, + direction: AxisRelativeDirection, + ) -> crate::client::Result<()>; } } #[doc = "The wl_keyboard interface represents one or more keyboards"] @@ -2736,6 +3348,108 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event provides a file descriptor to the client which can be"] + #[doc = "memory-mapped in read-only mode to provide a keyboard mapping"] + #[doc = "description."] + #[doc = ""] + #[doc = "From version 7 onwards, the fd must be mapped with MAP_PRIVATE by"] + #[doc = "the recipient, as MAP_SHARED may fail."] + async fn keymap( + &self, + format: KeymapFormat, + fd: rustix::fd::OwnedFd, + size: u32, + ) -> crate::client::Result<()>; + #[doc = "Notification that this seat's keyboard focus is on a certain"] + #[doc = "surface."] + #[doc = ""] + #[doc = "The compositor must send the wl_keyboard.modifiers event after this"] + #[doc = "event."] + #[doc = ""] + #[doc = "In the wl_keyboard logical state, this event sets the active surface to"] + #[doc = "the surface argument and the keys currently logically down to the keys"] + #[doc = "in the keys argument. The compositor must not send this event if the"] + #[doc = "wl_keyboard already had an active surface immediately before this event."] + async fn enter( + &self, + serial: u32, + surface: crate::wire::ObjectId, + keys: Vec, + ) -> crate::client::Result<()>; + #[doc = "Notification that this seat's keyboard focus is no longer on"] + #[doc = "a certain surface."] + #[doc = ""] + #[doc = "The leave notification is sent before the enter notification"] + #[doc = "for the new focus."] + #[doc = ""] + #[doc = "In the wl_keyboard logical state, this event resets all values to their"] + #[doc = "defaults. The compositor must not send this event if the active surface"] + #[doc = "of the wl_keyboard was not equal to the surface argument immediately"] + #[doc = "before this event."] + async fn leave( + &self, + serial: u32, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "A key was pressed or released."] + #[doc = "The time argument is a timestamp with millisecond"] + #[doc = "granularity, with an undefined base."] + #[doc = ""] + #[doc = "The key is a platform-specific key code that can be interpreted"] + #[doc = "by feeding it to the keyboard mapping (see the keymap event)."] + #[doc = ""] + #[doc = "If this event produces a change in modifiers, then the resulting"] + #[doc = "wl_keyboard.modifiers event must be sent after this event."] + #[doc = ""] + #[doc = "In the wl_keyboard logical state, this event adds the key to the keys"] + #[doc = "currently logically down (if the state argument is pressed) or removes"] + #[doc = "the key from the keys currently logically down (if the state argument is"] + #[doc = "released). The compositor must not send this event if the wl_keyboard"] + #[doc = "did not have an active surface immediately before this event. The"] + #[doc = "compositor must not send this event if state is pressed (resp. released)"] + #[doc = "and the key was already logically down (resp. was not logically down)"] + #[doc = "immediately before this event."] + async fn key( + &self, + serial: u32, + time: u32, + key: u32, + state: KeyState, + ) -> crate::client::Result<()>; + #[doc = "Notifies clients that the modifier and/or group state has"] + #[doc = "changed, and it should update its local state."] + #[doc = ""] + #[doc = "The compositor may send this event without a surface of the client"] + #[doc = "having keyboard focus, for example to tie modifier information to"] + #[doc = "pointer focus instead. If a modifier event with pressed modifiers is sent"] + #[doc = "without a prior enter event, the client can assume the modifier state is"] + #[doc = "valid until it receives the next wl_keyboard.modifiers event. In order to"] + #[doc = "reset the modifier state again, the compositor can send a"] + #[doc = "wl_keyboard.modifiers event with no pressed modifiers."] + #[doc = ""] + #[doc = "In the wl_keyboard logical state, this event updates the modifiers and"] + #[doc = "group."] + async fn modifiers( + &self, + serial: u32, + mods_depressed: u32, + mods_latched: u32, + mods_locked: u32, + group: u32, + ) -> crate::client::Result<()>; + #[doc = "Informs the client about the keyboard's repeat rate and delay."] + #[doc = ""] + #[doc = "This event is sent as soon as the wl_keyboard object has been created,"] + #[doc = "and is guaranteed to be received by the client before any key press"] + #[doc = "event."] + #[doc = ""] + #[doc = "Negative values for either rate or delay are illegal. A rate of zero"] + #[doc = "will disable any repeating (regardless of the value of delay)."] + #[doc = ""] + #[doc = "This event can be sent later on as well with a new value if necessary,"] + #[doc = "so clients should continue listening for the event past the creation"] + #[doc = "of wl_keyboard."] + async fn repeat_info(&self, rate: i32, delay: i32) -> crate::client::Result<()>; } } #[doc = "The wl_touch interface represents a touchscreen"] @@ -2774,6 +3488,108 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "A new touch point has appeared on the surface. This touch point is"] + #[doc = "assigned a unique ID. Future events from this touch point reference"] + #[doc = "this ID. The ID ceases to be valid after a touch up event and may be"] + #[doc = "reused in the future."] + async fn down( + &self, + serial: u32, + time: u32, + surface: crate::wire::ObjectId, + id: i32, + x: crate::wire::Fixed, + y: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "The touch point has disappeared. No further events will be sent for"] + #[doc = "this touch point and the touch point's ID is released and may be"] + #[doc = "reused in a future touch down event."] + async fn up(&self, serial: u32, time: u32, id: i32) -> crate::client::Result<()>; + #[doc = "A touch point has changed coordinates."] + async fn motion( + &self, + time: u32, + id: i32, + x: crate::wire::Fixed, + y: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "Indicates the end of a set of events that logically belong together."] + #[doc = "A client is expected to accumulate the data in all events within the"] + #[doc = "frame before proceeding."] + #[doc = ""] + #[doc = "A wl_touch.frame terminates at least one event but otherwise no"] + #[doc = "guarantee is provided about the set of events within a frame. A client"] + #[doc = "must assume that any state not updated in a frame is unchanged from the"] + #[doc = "previously known state."] + async fn frame(&self) -> crate::client::Result<()>; + #[doc = "Sent if the compositor decides the touch stream is a global"] + #[doc = "gesture. No further events are sent to the clients from that"] + #[doc = "particular gesture. Touch cancellation applies to all touch points"] + #[doc = "currently active on this client's surface. The client is"] + #[doc = "responsible for finalizing the touch points, future touch points on"] + #[doc = "this surface may reuse the touch point ID."] + #[doc = ""] + #[doc = "No frame event is required after the cancel event."] + async fn cancel(&self) -> crate::client::Result<()>; + #[doc = "Sent when a touchpoint has changed its shape."] + #[doc = ""] + #[doc = "This event does not occur on its own. It is sent before a"] + #[doc = "wl_touch.frame event and carries the new shape information for"] + #[doc = "any previously reported, or new touch points of that frame."] + #[doc = ""] + #[doc = "Other events describing the touch point such as wl_touch.down,"] + #[doc = "wl_touch.motion or wl_touch.orientation may be sent within the"] + #[doc = "same wl_touch.frame. A client should treat these events as a single"] + #[doc = "logical touch point update. The order of wl_touch.shape,"] + #[doc = "wl_touch.orientation and wl_touch.motion is not guaranteed."] + #[doc = "A wl_touch.down event is guaranteed to occur before the first"] + #[doc = "wl_touch.shape event for this touch ID but both events may occur within"] + #[doc = "the same wl_touch.frame."] + #[doc = ""] + #[doc = "A touchpoint shape is approximated by an ellipse through the major and"] + #[doc = "minor axis length. The major axis length describes the longer diameter"] + #[doc = "of the ellipse, while the minor axis length describes the shorter"] + #[doc = "diameter. Major and minor are orthogonal and both are specified in"] + #[doc = "surface-local coordinates. The center of the ellipse is always at the"] + #[doc = "touchpoint location as reported by wl_touch.down or wl_touch.move."] + #[doc = ""] + #[doc = "This event is only sent by the compositor if the touch device supports"] + #[doc = "shape reports. The client has to make reasonable assumptions about the"] + #[doc = "shape if it did not receive this event."] + async fn shape( + &self, + id: i32, + major: crate::wire::Fixed, + minor: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "Sent when a touchpoint has changed its orientation."] + #[doc = ""] + #[doc = "This event does not occur on its own. It is sent before a"] + #[doc = "wl_touch.frame event and carries the new shape information for"] + #[doc = "any previously reported, or new touch points of that frame."] + #[doc = ""] + #[doc = "Other events describing the touch point such as wl_touch.down,"] + #[doc = "wl_touch.motion or wl_touch.shape may be sent within the"] + #[doc = "same wl_touch.frame. A client should treat these events as a single"] + #[doc = "logical touch point update. The order of wl_touch.shape,"] + #[doc = "wl_touch.orientation and wl_touch.motion is not guaranteed."] + #[doc = "A wl_touch.down event is guaranteed to occur before the first"] + #[doc = "wl_touch.orientation event for this touch ID but both events may occur"] + #[doc = "within the same wl_touch.frame."] + #[doc = ""] + #[doc = "The orientation describes the clockwise angle of a touchpoint's major"] + #[doc = "axis to the positive surface y-axis and is normalized to the -180 to"] + #[doc = "+180 degree range. The granularity of orientation depends on the touch"] + #[doc = "device, some devices only support binary rotation values between 0 and"] + #[doc = "90 degrees."] + #[doc = ""] + #[doc = "This event is only sent by the compositor if the touch device supports"] + #[doc = "orientation reports."] + async fn orientation( + &self, + id: i32, + orientation: crate::wire::Fixed, + ) -> crate::client::Result<()>; } } #[doc = "An output describes part of the compositor geometry. The"] @@ -2899,6 +3715,146 @@ pub mod wayland { .await .map_err(crate::client::Error::IoError) } + #[doc = "The geometry event describes geometric properties of the output."] + #[doc = "The event is sent when binding to the output object and whenever"] + #[doc = "any of the properties change."] + #[doc = ""] + #[doc = "The physical size can be set to zero if it doesn't make sense for this"] + #[doc = "output (e.g. for projectors or virtual outputs)."] + #[doc = ""] + #[doc = "The geometry event will be followed by a done event (starting from"] + #[doc = "version 2)."] + #[doc = ""] + #[doc = "Clients should use wl_surface.preferred_buffer_transform instead of the"] + #[doc = "transform advertised by this event to find the preferred buffer"] + #[doc = "transform to use for a surface."] + #[doc = ""] + #[doc = "Note: wl_output only advertises partial information about the output"] + #[doc = "position and identification. Some compositors, for instance those not"] + #[doc = "implementing a desktop-style output layout or those exposing virtual"] + #[doc = "outputs, might fake this information. Instead of using x and y, clients"] + #[doc = "should use xdg_output.logical_position. Instead of using make and model,"] + #[doc = "clients should use name and description."] + async fn geometry( + &self, + x: i32, + y: i32, + physical_width: i32, + physical_height: i32, + subpixel: Subpixel, + make: String, + model: String, + transform: Transform, + ) -> crate::client::Result<()>; + #[doc = "The mode event describes an available mode for the output."] + #[doc = ""] + #[doc = "The event is sent when binding to the output object and there"] + #[doc = "will always be one mode, the current mode. The event is sent"] + #[doc = "again if an output changes mode, for the mode that is now"] + #[doc = "current. In other words, the current mode is always the last"] + #[doc = "mode that was received with the current flag set."] + #[doc = ""] + #[doc = "Non-current modes are deprecated. A compositor can decide to only"] + #[doc = "advertise the current mode and never send other modes. Clients"] + #[doc = "should not rely on non-current modes."] + #[doc = ""] + #[doc = "The size of a mode is given in physical hardware units of"] + #[doc = "the output device. This is not necessarily the same as"] + #[doc = "the output size in the global compositor space. For instance,"] + #[doc = "the output may be scaled, as described in wl_output.scale,"] + #[doc = "or transformed, as described in wl_output.transform. Clients"] + #[doc = "willing to retrieve the output size in the global compositor"] + #[doc = "space should use xdg_output.logical_size instead."] + #[doc = ""] + #[doc = "The vertical refresh rate can be set to zero if it doesn't make"] + #[doc = "sense for this output (e.g. for virtual outputs)."] + #[doc = ""] + #[doc = "The mode event will be followed by a done event (starting from"] + #[doc = "version 2)."] + #[doc = ""] + #[doc = "Clients should not use the refresh rate to schedule frames. Instead,"] + #[doc = "they should use the wl_surface.frame event or the presentation-time"] + #[doc = "protocol."] + #[doc = ""] + #[doc = "Note: this information is not always meaningful for all outputs. Some"] + #[doc = "compositors, such as those exposing virtual outputs, might fake the"] + #[doc = "refresh rate or the size."] + async fn mode( + &self, + flags: Mode, + width: i32, + height: i32, + refresh: i32, + ) -> crate::client::Result<()>; + #[doc = "This event is sent after all other properties have been"] + #[doc = "sent after binding to the output object and after any"] + #[doc = "other property changes done after that. This allows"] + #[doc = "changes to the output properties to be seen as"] + #[doc = "atomic, even if they happen via multiple events."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event contains scaling geometry information"] + #[doc = "that is not in the geometry event. It may be sent after"] + #[doc = "binding the output object or if the output scale changes"] + #[doc = "later. The compositor will emit a non-zero, positive"] + #[doc = "value for scale. If it is not sent, the client should"] + #[doc = "assume a scale of 1."] + #[doc = ""] + #[doc = "A scale larger than 1 means that the compositor will"] + #[doc = "automatically scale surface buffers by this amount"] + #[doc = "when rendering. This is used for very high resolution"] + #[doc = "displays where applications rendering at the native"] + #[doc = "resolution would be too small to be legible."] + #[doc = ""] + #[doc = "Clients should use wl_surface.preferred_buffer_scale"] + #[doc = "instead of this event to find the preferred buffer"] + #[doc = "scale to use for a surface."] + #[doc = ""] + #[doc = "The scale event will be followed by a done event."] + async fn scale(&self, factor: i32) -> crate::client::Result<()>; + #[doc = "Many compositors will assign user-friendly names to their outputs, show"] + #[doc = "them to the user, allow the user to refer to an output, etc. The client"] + #[doc = "may wish to know this name as well to offer the user similar behaviors."] + #[doc = ""] + #[doc = "The name is a UTF-8 string with no convention defined for its contents."] + #[doc = "Each name is unique among all wl_output globals. The name is only"] + #[doc = "guaranteed to be unique for the compositor instance."] + #[doc = ""] + #[doc = "The same output name is used for all clients for a given wl_output"] + #[doc = "global. Thus, the name can be shared across processes to refer to a"] + #[doc = "specific wl_output global."] + #[doc = ""] + #[doc = "The name is not guaranteed to be persistent across sessions, thus cannot"] + #[doc = "be used to reliably identify an output in e.g. configuration files."] + #[doc = ""] + #[doc = "Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do"] + #[doc = "not assume that the name is a reflection of an underlying DRM connector,"] + #[doc = "X11 connection, etc."] + #[doc = ""] + #[doc = "The name event is sent after binding the output object. This event is"] + #[doc = "only sent once per output object, and the name does not change over the"] + #[doc = "lifetime of the wl_output global."] + #[doc = ""] + #[doc = "Compositors may re-use the same output name if the wl_output global is"] + #[doc = "destroyed and re-created later. Compositors should avoid re-using the"] + #[doc = "same name if possible."] + #[doc = ""] + #[doc = "The name event will be followed by a done event."] + async fn name(&self, name: String) -> crate::client::Result<()>; + #[doc = "Many compositors can produce human-readable descriptions of their"] + #[doc = "outputs. The client may wish to know this description as well, e.g. for"] + #[doc = "output selection purposes."] + #[doc = ""] + #[doc = "The description is a UTF-8 string with no convention defined for its"] + #[doc = "contents. The description is not guaranteed to be unique among all"] + #[doc = "wl_output globals. Examples might include 'Foocorp 11\" Display' or"] + #[doc = "'Virtual X11 output via :1'."] + #[doc = ""] + #[doc = "The description event is sent after binding the output object and"] + #[doc = "whenever the description changes. The description is optional, and may"] + #[doc = "not be sent at all."] + #[doc = ""] + #[doc = "The description event will be followed by a done event."] + async fn description(&self, description: String) -> crate::client::Result<()>; } } #[doc = "A region object describes an area."] diff --git a/src/client/protocol/cosmic.rs b/src/client/protocol/cosmic.rs index a32f689..5f086ab 100644 --- a/src/client/protocol/cosmic.rs +++ b/src/client/protocol/cosmic.rs @@ -103,6 +103,8 @@ pub mod cosmic_atspi_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Produces an fd that can be used with libei to monitor keyboard input."] + async fn key_events_eis(&self, fd: rustix::fd::OwnedFd) -> crate::client::Result<()>; } } } @@ -554,6 +556,33 @@ pub mod cosmic_output_management_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This events describes the scale of the head in the global compositor"] + #[doc = "space multiplied by 1000 for additional precision."] + #[doc = ""] + #[doc = "It is only sent if the output is enabled."] + async fn scale_1000(&self, scale_1000: i32) -> crate::client::Result<()>; + #[doc = "This events describes that the head is mirroring another."] + #[doc = "In these cases `name` contains the unique name of the matching `zwlr_output_head_v1`."] + #[doc = "If the name is null, no head is being mirrored onto this one."] + #[doc = ""] + #[doc = "For mirrored heads the `position`-event is meaningless."] + #[doc = ""] + #[doc = "It is only sent if the output is enabled."] + async fn mirroring(&self, name: Option) -> crate::client::Result<()>; + #[doc = "This events describes if adaptive_sync is available for this head."] + #[doc = ""] + #[doc = "It is only sent if the output is enabled."] + async fn adaptive_sync_available( + &self, + available: AdaptiveSyncAvailability, + ) -> crate::client::Result<()>; + #[doc = "This events describes the adaptive_sync state of this head."] + #[doc = ""] + #[doc = "It is only sent if the output is enabled."] + async fn adaptive_sync_ext( + &self, + state: AdaptiveSyncStateExt, + ) -> crate::client::Result<()>; } } #[doc = "Extension to zwlr_output_configuration_v1."] @@ -645,6 +674,14 @@ pub mod cosmic_output_management_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event indicates that the configuration is no longer available."] + #[doc = ""] + #[doc = "This usually happens when the original configuration was `cancelled`, `suceeded` or `failed`."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy this object."] + #[doc = ""] + #[doc = "The configration object becomes inert and any requests other than `destroy` will be ignored."] + async fn finished(&self) -> crate::client::Result<()>; } } #[doc = "Extension to zwlr_output_configuration_head_v1."] @@ -823,6 +860,50 @@ pub mod cosmic_overlap_notify_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "A ext_foreign_toplevel_handle_v1 has entered the surface area."] + #[doc = ""] + #[doc = "This event will be emitted once for every ext_foreign_toplevel_handle_v1"] + #[doc = "representing this toplevel."] + #[doc = ""] + #[doc = "Compositors are free to update the overlapping area by sending additional"] + #[doc = "`toplevel_enter` events for the same toplevel without sending `toplevel_leave`"] + #[doc = "in between."] + async fn toplevel_enter( + &self, + toplevel: crate::wire::ObjectId, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "A ext_foreign_toplevel_handle_v1 has left the surface area."] + #[doc = ""] + #[doc = "This event will be emitted once for every ext_foreign_toplevel_handle_v1"] + #[doc = "representing this toplevel."] + async fn toplevel_leave( + &self, + toplevel: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "A zwlr_layer_surface_v1 has entered the surface area."] + #[doc = ""] + #[doc = "Compositors are free to update the overlapping area by sending additional"] + #[doc = "`layer_enter` events for the same surface without sending `layer_leave`"] + #[doc = "in between."] + #[doc = ""] + #[doc = "The overlapping region is given surface-relative to the zwlr_layer_surface_v1"] + #[doc = "used to create this notification object."] + async fn layer_enter( + &self, + identifier: String, + exclusive: u32, + layer : super :: super :: super :: wlr :: wlr_layer_shell_unstable_v1 :: zwlr_layer_shell_v1 :: Layer, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "A zwlr_layer_surface_v1 has left the surface area."] + async fn layer_leave(&self, identifier: String) -> crate::client::Result<()>; } } } @@ -1016,6 +1097,49 @@ pub mod cosmic_screencopy_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Provides the dimensions of the source image in buffer pixel coordinates."] + #[doc = ""] + #[doc = "The client must attach buffers that match this size."] + async fn buffer_size(&self, width: u32, height: u32) -> crate::client::Result<()>; + #[doc = "Provides the format that must be used for shared-memory buffers."] + #[doc = ""] + #[doc = "This event may be emitted multiple times, in which case the client may"] + #[doc = "choose any given format."] + async fn shm_format(&self, format: u32) -> crate::client::Result<()>; + #[doc = "This event advertises the device buffers must be allocated on for"] + #[doc = "dma-buf buffers."] + #[doc = ""] + #[doc = "In general the device is a DRM node. The DRM node type (primary vs."] + #[doc = "render) is unspecified. Clients must not rely on the compositor sending"] + #[doc = "a particular node type. Clients cannot check two devices for equality"] + #[doc = "by comparing the dev_t value."] + async fn dmabuf_device(&self, device: Vec) -> crate::client::Result<()>; + #[doc = "Provides the format that must be used for dma-buf buffers."] + #[doc = ""] + #[doc = "The client may choose any of the modifiers advertised in the array of"] + #[doc = "64-bit unsigned integers."] + #[doc = ""] + #[doc = "This event may be emitted multiple times, in which case the client may"] + #[doc = "choose any given format."] + async fn dmabuf_format( + &self, + format: u32, + modifiers: Vec, + ) -> crate::client::Result<()>; + #[doc = "This event is sent once when all buffer constraint events have been"] + #[doc = "sent."] + #[doc = ""] + #[doc = "The compositor must always end a batch of buffer constraint events with"] + #[doc = "this event, regardless of whether it sends the initial constraints or"] + #[doc = "an update."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event indicates that the capture session has stopped and is no"] + #[doc = "longer available. This can happen in a number of cases, e.g. when the"] + #[doc = "underlying source is destroyed, if the user decides to end the screen"] + #[doc = "capture, or if an unrecoverable runtime error has occurred."] + #[doc = ""] + #[doc = "The client should destroy the session after receiving this event."] + async fn stopped(&self) -> crate::client::Result<()>; } } #[doc = "This object represents a screen capture frame."] @@ -1189,6 +1313,53 @@ pub mod cosmic_screencopy_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent before the ready event and holds the transform of"] + #[doc = "the source buffer."] + async fn transform( + &self, + transform: super::super::super::core::wayland::wl_output::Transform, + ) -> crate::client::Result<()>; + #[doc = "This event is sent before the ready event. It may be generated multiple"] + #[doc = "times to describe a region."] + #[doc = ""] + #[doc = "The first captured frame in a session will always carry full damage."] + #[doc = "Subsequent frames' damaged regions describe which parts of the buffer"] + #[doc = "have changed since the last ready event."] + #[doc = ""] + #[doc = "These coordinates originate in the upper left corner of the buffer."] + async fn damage( + &self, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "This event indicates the time at which the frame is presented to the"] + #[doc = "output in system monotonic time. This event is sent before the ready"] + #[doc = "event."] + #[doc = ""] + #[doc = "The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,"] + #[doc = "each component being an unsigned 32-bit value. Whole seconds are in"] + #[doc = "tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,"] + #[doc = "and the additional fractional part in tv_nsec as nanoseconds. Hence,"] + #[doc = "for valid timestamps tv_nsec must be in [0, 999999999]."] + async fn presentation_time( + &self, + tv_sec_hi: u32, + tv_sec_lo: u32, + tv_nsec: u32, + ) -> crate::client::Result<()>; + #[doc = "Called as soon as the frame is copied, indicating it is available"] + #[doc = "for reading."] + #[doc = ""] + #[doc = "The buffer may be re-used by the client after this event."] + #[doc = ""] + #[doc = "After receiving this event, the client must destroy the object."] + async fn ready(&self) -> crate::client::Result<()>; + #[doc = "This event indicates that the attempted frame copy has failed."] + #[doc = ""] + #[doc = "After receiving this event, the client must destroy the object."] + async fn failed(&self, reason: FailureReason) -> crate::client::Result<()>; } } #[doc = "This object represents a cursor capture session. It extends the base"] @@ -1270,6 +1441,38 @@ pub mod cosmic_screencopy_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent when a cursor enters the captured area. It shall be generated"] + #[doc = "before the \"position\" and \"hotspot\" events when and only when a cursor"] + #[doc = "enters the area."] + #[doc = ""] + #[doc = "The cursor enters the captured area when the cursor image intersects"] + #[doc = "with the captured area. Note, this is different from e.g."] + #[doc = "wl_pointer.enter."] + async fn enter(&self) -> crate::client::Result<()>; + #[doc = "Sent when a cursor leaves the captured area. No \"position\" or \"hotspot\""] + #[doc = "event is generated for the cursor until the cursor enters the captured"] + #[doc = "area again."] + async fn leave(&self) -> crate::client::Result<()>; + #[doc = "Cursors outside the image source do not get captured and no event will"] + #[doc = "be generated for them."] + #[doc = ""] + #[doc = "The given position is the position of the cursor's hotspot and it is"] + #[doc = "relative to the main buffer's top left corner in transformed buffer"] + #[doc = "pixel coordinates."] + #[doc = ""] + #[doc = "The position coordinates are relative to the main buffer's upper left"] + #[doc = "corner. The coordinates may be negative or greater than the main buffer"] + #[doc = "size."] + async fn position(&self, x: i32, y: i32) -> crate::client::Result<()>; + #[doc = "The hotspot describes the offset between the cursor image and the"] + #[doc = "position of the input device."] + #[doc = ""] + #[doc = "The given coordinates are the hotspot's offset from the origin in"] + #[doc = "buffer coordinates."] + #[doc = ""] + #[doc = "Clients should not apply the hotspot immediately: the hotspot becomes"] + #[doc = "effective when the next zcosmic_screencopy_frame_v2.ready event is received."] + async fn hotspot(&self, x: i32, y: i32) -> crate::client::Result<()>; } } } @@ -1343,6 +1546,32 @@ pub mod cosmic_toplevel_info_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is never emitted for clients binding version 2"] + #[doc = "of this protocol, they should use `get_cosmic_toplevel` instead."] + #[doc = ""] + #[doc = "This event is emitted for clients binding version 1 whenever a"] + #[doc = "new toplevel window is created. It is emitted for all toplevels,"] + #[doc = "regardless of the app that has created them."] + #[doc = ""] + #[doc = "All initial properties of the toplevel (title, app_id, states, etc.)"] + #[doc = "will be sent immediately after this event via the corresponding"] + #[doc = "events in zcosmic_toplevel_handle_v1."] + async fn toplevel(&self, toplevel: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event indicates that the compositor is done sending events"] + #[doc = "to the zcosmic_toplevel_info_v1. The server will destroy the"] + #[doc = "object immediately after sending this request, so it will become"] + #[doc = "invalid and the client should free any resources associated with it."] + #[doc = ""] + #[doc = "Note: This event is emitted immediately after calling `stop` for"] + #[doc = "clients binding version 2 of this protocol for backwards compatibility."] + async fn finished(&self) -> crate::client::Result<()>; + #[doc = "This event is sent after all changes for currently active"] + #[doc = "zcosmic_toplevel_handle_v1 have been sent."] + #[doc = ""] + #[doc = "This allows changes to multiple zcosmic_toplevel_handle_v1 handles"] + #[doc = "and their properties to be seen as atomic, even if they happen via"] + #[doc = "multiple events."] + async fn done(&self) -> crate::client::Result<()>; } } #[doc = "A zcosmic_toplevel_handle_v1 object represents an open toplevel"] @@ -1410,6 +1639,84 @@ pub mod cosmic_toplevel_info_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The server will emit no further events on the"] + #[doc = "zcosmic_toplevel_handle_v1 after this event. Any requests received"] + #[doc = "aside from the destroy request will be ignored. Upon receiving this"] + #[doc = "event, the client should make the destroy request to allow freeing"] + #[doc = "of resources."] + #[doc = ""] + #[doc = "Note: This event will not be emitted for clients binding version 2"] + #[doc = "of this protocol, as `ext_foreign_toplevel_handle_v1.closed` is"] + #[doc = "equivalent."] + async fn closed(&self) -> crate::client::Result<()>; + #[doc = "This event is sent after all changes in the toplevel state have"] + #[doc = "been sent."] + #[doc = ""] + #[doc = "This allows changes to the zcosmic_toplevel_handle_v1 properties"] + #[doc = "to be seen as atomic, even if they happen via multiple events."] + #[doc = ""] + #[doc = "Note: this is is not sent after the closed event."] + #[doc = ""] + #[doc = "Note: This event will not be emitted for clients binding version 2"] + #[doc = "of this protocol, as `ext_foreign_toplevel_handle_v1.done` is"] + #[doc = "equivalent."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event is emitted whenever the title of the toplevel changes."] + #[doc = ""] + #[doc = "Note: This event will not be emitted for clients binding version 2"] + #[doc = "of this protocol, as `ext_foreign_toplevel_handle_v1.title` is"] + #[doc = "equivalent."] + async fn title(&self, title: String) -> crate::client::Result<()>; + #[doc = "This event is emitted whenever the app_id of the toplevel changes."] + #[doc = ""] + #[doc = "Note: This event will not be emitted for clients binding version 2"] + #[doc = "of this protocol, as `ext_foreign_toplevel_handle_v1.app_id` is"] + #[doc = "equivalent."] + async fn app_id(&self, app_id: String) -> crate::client::Result<()>; + #[doc = "This event is emitted whenever the toplevel becomes visible on the"] + #[doc = "given output. A toplevel may be visible on multiple outputs."] + async fn output_enter( + &self, + output: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "This event is emitted whenever the toplevel is no longer visible"] + #[doc = "on a given output. It is guaranteed that an output_enter event with"] + #[doc = "the same output has been emitted before this event."] + async fn output_leave( + &self, + output: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "This event is emitted whenever the toplevel becomes visible on the"] + #[doc = "given workspace. A toplevel may be visible on multiple workspaces."] + async fn workspace_enter( + &self, + workspace: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "This event is emitted whenever the toplevel is no longer visible"] + #[doc = "on a given workspace. It is guaranteed that an workspace_enter event with"] + #[doc = "the same workspace has been emitted before this event."] + async fn workspace_leave( + &self, + workspace: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "This event is emitted once on creation of the"] + #[doc = "zcosmic_toplevel_handle_v1 and again whenever the state of the"] + #[doc = "toplevel changes."] + async fn state(&self, state: Vec) -> crate::client::Result<()>; + #[doc = "Emitted when the geometry of a toplevel (it's position and/or size)"] + #[doc = "relative to the provided output has changed."] + #[doc = ""] + #[doc = "This event is emitted once on creation of the"] + #[doc = "zcosmic_toplevel_handle_v1 for every entered output and again"] + #[doc = "whenever the geometry of the toplevel changes relative to any output."] + async fn geometry( + &self, + output: crate::wire::ObjectId, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; } } } @@ -1762,6 +2069,23 @@ pub mod cosmic_toplevel_management_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event advertises the capabilities supported by the compositor. If"] + #[doc = "a capability isn't supported, clients should hide or disable the UI"] + #[doc = "elements that expose this functionality. For instance, if the"] + #[doc = "compositor doesn't advertise support for closing toplevels, a button"] + #[doc = "triggering the close request should not be displayed."] + #[doc = ""] + #[doc = "The compositor will ignore requests it doesn't support. For instance,"] + #[doc = "a compositor which doesn't advertise support for closing toplevels will ignore"] + #[doc = "close requests."] + #[doc = ""] + #[doc = "Compositors must send this event once after creation of an"] + #[doc = "zcosmic_toplevel_manager_v1 . When the capabilities change, compositors"] + #[doc = "must send this event again."] + #[doc = ""] + #[doc = "The capabilities are sent as an array of 32-bit unsigned integers in"] + #[doc = "native endianness."] + async fn capabilities(&self, capabilities: Vec) -> crate::client::Result<()>; } } } diff --git a/src/client/protocol/frog.rs b/src/client/protocol/frog.rs index 9167835..07392f5 100644 --- a/src/client/protocol/frog.rs +++ b/src/client/protocol/frog.rs @@ -276,6 +276,27 @@ pub mod frog_color_management_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Current preferred metadata for a surface."] + #[doc = "The application should use this information to tone-map its buffers"] + #[doc = "to this target before committing."] + #[doc = ""] + #[doc = "This metadata does not necessarily correspond to any physical output, but"] + #[doc = "rather what the compositor thinks would be best for a given surface."] + async fn preferred_metadata( + &self, + transfer_function: TransferFunction, + output_display_primary_red_x: u32, + output_display_primary_red_y: u32, + output_display_primary_green_x: u32, + output_display_primary_green_y: u32, + output_display_primary_blue_x: u32, + output_display_primary_blue_y: u32, + output_white_point_x: u32, + output_white_point_y: u32, + max_luminance: u32, + min_luminance: u32, + max_full_frame_luminance: u32, + ) -> crate::client::Result<()>; } } } diff --git a/src/client/protocol/hyprland.rs b/src/client/protocol/hyprland.rs index 2569b7c..7cd72a7 100644 --- a/src/client/protocol/hyprland.rs +++ b/src/client/protocol/hyprland.rs @@ -281,6 +281,9 @@ pub mod hyprland_focus_grab_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent when an active grab is cancelled by the compositor,"] + #[doc = "regardless of cause."] + async fn cleared(&self) -> crate::client::Result<()>; } } } @@ -403,6 +406,24 @@ pub mod hyprland_global_shortcuts_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The keystroke was pressed."] + #[doc = ""] + #[doc = "tv_ values hold the timestamp of the occurrence."] + async fn pressed( + &self, + tv_sec_hi: u32, + tv_sec_lo: u32, + tv_nsec: u32, + ) -> crate::client::Result<()>; + #[doc = "The keystroke was released."] + #[doc = ""] + #[doc = "tv_ values hold the timestamp of the occurrence."] + async fn released( + &self, + tv_sec_hi: u32, + tv_sec_lo: u32, + tv_nsec: u32, + ) -> crate::client::Result<()>; } } } @@ -601,6 +622,72 @@ pub mod hyprland_toplevel_export_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Provides information about wl_shm buffer parameters that need to be"] + #[doc = "used for this frame. This event is sent once after the frame is created"] + #[doc = "if wl_shm buffers are supported."] + async fn buffer( + &self, + format: super::super::super::core::wayland::wl_shm::Format, + width: u32, + height: u32, + stride: u32, + ) -> crate::client::Result<()>; + #[doc = "This event is sent right before the ready event when ignore_damage was"] + #[doc = "not set. It may be generated multiple times for each copy"] + #[doc = "request."] + #[doc = ""] + #[doc = "The arguments describe a box around an area that has changed since the"] + #[doc = "last copy request that was derived from the current screencopy manager"] + #[doc = "instance."] + #[doc = ""] + #[doc = "The union of all regions received between the call to copy"] + #[doc = "and a ready event is the total damage since the prior ready event."] + async fn damage( + &self, + x: u32, + y: u32, + width: u32, + height: u32, + ) -> crate::client::Result<()>; + #[doc = "Provides flags about the frame. This event is sent once before the"] + #[doc = "\"ready\" event."] + async fn flags(&self, flags: Flags) -> crate::client::Result<()>; + #[doc = "Called as soon as the frame is copied, indicating it is available"] + #[doc = "for reading. This event includes the time at which presentation happened"] + #[doc = "at."] + #[doc = ""] + #[doc = "The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,"] + #[doc = "each component being an unsigned 32-bit value. Whole seconds are in"] + #[doc = "tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,"] + #[doc = "and the additional fractional part in tv_nsec as nanoseconds. Hence,"] + #[doc = "for valid timestamps tv_nsec must be in [0, 999999999]. The seconds part"] + #[doc = "may have an arbitrary offset at start."] + #[doc = ""] + #[doc = "After receiving this event, the client should destroy the object."] + async fn ready( + &self, + tv_sec_hi: u32, + tv_sec_lo: u32, + tv_nsec: u32, + ) -> crate::client::Result<()>; + #[doc = "This event indicates that the attempted frame copy has failed."] + #[doc = ""] + #[doc = "After receiving this event, the client should destroy the object."] + async fn failed(&self) -> crate::client::Result<()>; + #[doc = "Provides information about linux-dmabuf buffer parameters that need to"] + #[doc = "be used for this frame. This event is sent once after the frame is"] + #[doc = "created if linux-dmabuf buffers are supported."] + async fn linux_dmabuf( + &self, + format: u32, + width: u32, + height: u32, + ) -> crate::client::Result<()>; + #[doc = "This event is sent once after all buffer events have been sent."] + #[doc = ""] + #[doc = "The client should proceed to create a buffer of one of the supported"] + #[doc = "types, and send a \"copy\" request."] + async fn buffer_done(&self) -> crate::client::Result<()>; } } } diff --git a/src/client/protocol/ivi.rs b/src/client/protocol/ivi.rs index f701c38..709888b 100644 --- a/src/client/protocol/ivi.rs +++ b/src/client/protocol/ivi.rs @@ -31,6 +31,18 @@ pub mod ivi_application { .await .map_err(crate::client::Error::IoError) } + #[doc = "The configure event asks the client to resize its surface."] + #[doc = ""] + #[doc = "The size is a hint, in the sense that the client is free to"] + #[doc = "ignore it if it doesn't resize, pick a smaller size (to"] + #[doc = "satisfy aspect ratio or resize in steps of NxM pixels)."] + #[doc = ""] + #[doc = "The client is free to dismiss all but the last configure"] + #[doc = "event it received."] + #[doc = ""] + #[doc = "The width and height arguments specify the size of the window"] + #[doc = "in surface local coordinates."] + async fn configure(&self, width: i32, height: i32) -> crate::client::Result<()>; } } #[doc = "This interface is exposed as a global singleton."] @@ -184,6 +196,38 @@ pub mod ivi_input { .await .map_err(crate::client::Error::IoError) } + async fn seat_created( + &self, + name: String, + capabilities: u32, + is_default: i32, + ) -> crate::client::Result<()>; + async fn seat_capabilities( + &self, + name: String, + capabilities: u32, + ) -> crate::client::Result<()>; + async fn seat_destroyed(&self, name: String) -> crate::client::Result<()>; + #[doc = "The new input focus state is provided in argument enabled:"] + #[doc = "If enabled is ILM_TRUE, this surface now has input focus enabled."] + #[doc = "If enabled is not ILM_TRUE, this surface no longer has input focus."] + async fn input_focus( + &self, + surface: u32, + device: u32, + enabled: i32, + ) -> crate::client::Result<()>; + #[doc = "A surface has changed its input acceptance for a specific seat."] + #[doc = "If argument 'accepted' is ILM_TRUE, the surface now accepts"] + #[doc = "the seat."] + #[doc = "If argument 'accepted' is not ILM_TRUE, the surface no longer"] + #[doc = "accepts the seat."] + async fn input_acceptance( + &self, + surface: u32, + seat: String, + accepted: i32, + ) -> crate::client::Result<()>; } } } @@ -324,6 +368,14 @@ pub mod ivi_wm { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent immediately after creating the ivi_wm_screen object."] + async fn screen_id(&self, id: u32) -> crate::client::Result<()>; + #[doc = "A layer is added to the render order lisf of the screen"] + async fn layer_added(&self, layer_id: u32) -> crate::client::Result<()>; + #[doc = "Sent immediately after creating the ivi_wm_screen object."] + async fn connector_name(&self, process_name: String) -> crate::client::Result<()>; + #[doc = "The error event is sent out when an error has occurred."] + async fn error(&self, error: u32, message: String) -> crate::client::Result<()>; } } #[doc = "An ivi_screenshot object receives a single \"done\" or \"error\" event."] @@ -378,6 +430,11 @@ pub mod ivi_wm { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "This event notifies the filling data to buffer is done. The client"] + #[doc = "can handle the buffer. This also provide the time of dumping data."] + async fn done(&self, timestamp: u32) -> crate::client::Result<()>; + #[doc = "The error event is sent when the screenshot could not be created."] + async fn error(&self, error: Error, message: String) -> crate::client::Result<()>; } } #[allow(clippy::too_many_arguments)] @@ -942,6 +999,130 @@ pub mod ivi_wm { .await .map_err(crate::client::Error::IoError) } + #[doc = "The new visibility state is provided in argument visibility."] + #[doc = "If visibility is 0, the surface has become invisible."] + #[doc = "If visibility is not 0, the surface has become visible."] + async fn surface_visibility( + &self, + surface_id: u32, + visibility: i32, + ) -> crate::client::Result<()>; + #[doc = "The new visibility state is provided in argument visibility."] + #[doc = "If visibility is 0, the layer has become invisible."] + #[doc = "If visibility is not 0, the layer has become visible."] + async fn layer_visibility( + &self, + layer_id: u32, + visibility: i32, + ) -> crate::client::Result<()>; + #[doc = "The new opacity state is provided in argument opacity."] + #[doc = "The valid range for opactiy is 0.0 (fully transparent) to 1.0 (fully opaque)."] + async fn surface_opacity( + &self, + surface_id: u32, + opacity: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "The new opacity state is provided in argument opacity."] + #[doc = "The valid range for opactiy is 0.0 (fully transparent) to 1.0 (fully opaque)."] + async fn layer_opacity( + &self, + layer_id: u32, + opacity: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "The scanout region of the surface content has changed."] + #[doc = "The new values for source rectangle are provided by"] + #[doc = "x: new horizontal start position of scanout area within the surface"] + #[doc = "y: new vertical start position of scanout area within the surface"] + #[doc = "width: new width of scanout area within the surface"] + #[doc = "height: new height of scanout area within the surface"] + async fn surface_source_rectangle( + &self, + surface_id: u32, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "The scanout region of the layer content has changed."] + #[doc = "The new values for source rectangle are provided by"] + #[doc = "x: new horizontal start position of scanout area within the layer"] + #[doc = "y: new vertical start position of scanout area within the layer"] + #[doc = "width: new width of scanout area within the layer"] + #[doc = "height: new height of scanout area within the layer"] + async fn layer_source_rectangle( + &self, + layer_id: u32, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "The new values for source rectangle are provided by"] + #[doc = "x: new horizontal start position of surface within the layer"] + #[doc = "y: new vertical start position of surface within the layer"] + #[doc = "width : new width of surface within the layer"] + #[doc = "height: new height of surface within the layer"] + async fn surface_destination_rectangle( + &self, + surface_id: u32, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "The new values for source rectangle are provided by"] + #[doc = "x: new horizontal start position of layer within the screen"] + #[doc = "y: new vertical start position of layer within the screen"] + #[doc = "width : new width of layer within the screen"] + #[doc = "height: new height of layer within the screen"] + async fn layer_destination_rectangle( + &self, + layer_id: u32, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + async fn surface_created(&self, surface_id: u32) -> crate::client::Result<()>; + async fn layer_created(&self, layer_id: u32) -> crate::client::Result<()>; + async fn surface_destroyed(&self, surface_id: u32) -> crate::client::Result<()>; + async fn layer_destroyed(&self, layer_id: u32) -> crate::client::Result<()>; + #[doc = "The error event is sent out when an error has occurred."] + async fn surface_error( + &self, + object_id: u32, + error: u32, + message: String, + ) -> crate::client::Result<()>; + #[doc = "The error event is sent out when an error has occurred."] + async fn layer_error( + &self, + object_id: u32, + error: u32, + message: String, + ) -> crate::client::Result<()>; + #[doc = "The client providing content for this surface modified size of the surface."] + #[doc = "The modified surface size is provided by arguments width and height."] + async fn surface_size( + &self, + surface_id: u32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "The information contained in this event is essential for monitoring, debugging,"] + #[doc = "logging and tracing support in IVI systems."] + async fn surface_stats( + &self, + surface_id: u32, + frame_count: u32, + pid: u32, + ) -> crate::client::Result<()>; + #[doc = "A surface is added to the render order of the layer"] + async fn layer_surface_added( + &self, + layer_id: u32, + surface_id: u32, + ) -> crate::client::Result<()>; } } } diff --git a/src/client/protocol/plasma.rs b/src/client/protocol/plasma.rs index 9adcc7c..c03c4f6 100644 --- a/src/client/protocol/plasma.rs +++ b/src/client/protocol/plasma.rs @@ -641,6 +641,15 @@ pub mod fullscreen_shell { .await .map_err(crate::client::Error::IoError) } + #[doc = "Advertises a single capability of the compositor."] + #[doc = ""] + #[doc = "When the wl_fullscreen_shell interface is bound, this event is emitted"] + #[doc = "once for each capability advertised. Valid capabilities are given by"] + #[doc = "the wl_fullscreen_shell.capability enum. If clients want to take"] + #[doc = "advantage of any of these capabilities, they should use a"] + #[doc = "wl_display.sync request immediately after binding to ensure that they"] + #[doc = "receive all the capability events."] + async fn capability(&self, capability: u32) -> crate::client::Result<()>; } } #[allow(clippy::too_many_arguments)] @@ -658,6 +667,27 @@ pub mod fullscreen_shell { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "This event indicates that the attempted mode switch operation was"] + #[doc = "successful. A surface of the size requested in the mode switch"] + #[doc = "will fill the output without scaling."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy the"] + #[doc = "wl_fullscreen_shell_mode_feedback object."] + async fn mode_successful(&self) -> crate::client::Result<()>; + #[doc = "This event indicates that the attempted mode switch operation"] + #[doc = "failed. This may be because the requested output mode is not"] + #[doc = "possible or it may mean that the compositor does not want to allow it."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy the"] + #[doc = "wl_fullscreen_shell_mode_feedback object."] + async fn mode_failed(&self) -> crate::client::Result<()>; + #[doc = "This event indicates that the attempted mode switch operation was"] + #[doc = "cancelled. Most likely this is because the client requested a"] + #[doc = "second mode switch before the first one completed."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy the"] + #[doc = "wl_fullscreen_shell_mode_feedback object."] + async fn present_cancelled(&self) -> crate::client::Result<()>; } } } @@ -750,6 +780,8 @@ pub mod idle { .await .map_err(crate::client::Error::IoError) } + async fn idle(&self) -> crate::client::Result<()>; + async fn resumed(&self) -> crate::client::Result<()>; } } } @@ -834,6 +866,7 @@ pub mod keystate { .await .map_err(crate::client::Error::IoError) } + async fn state_changed(&self, key: u32, state: u32) -> crate::client::Result<()>; } } } @@ -1187,6 +1220,11 @@ pub mod outputmanagement { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent after the server has successfully applied the changes."] + #[doc = "."] + async fn applied(&self) -> crate::client::Result<()>; + #[doc = "Sent if the server rejects the changes or failed to apply them."] + async fn failed(&self) -> crate::client::Result<()>; } } } @@ -1357,6 +1395,139 @@ pub mod org_kde_kwin_outputdevice { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "The geometry event describes geometric properties of the output."] + #[doc = "The event is sent when binding to the output object and whenever"] + #[doc = "any of the properties change."] + async fn geometry( + &self, + x: i32, + y: i32, + physical_width: i32, + physical_height: i32, + subpixel: i32, + make: String, + model: String, + transform: i32, + ) -> crate::client::Result<()>; + #[doc = "The mode event describes an available mode for the output."] + #[doc = ""] + #[doc = "When the client binds to the outputdevice object, the server sends this"] + #[doc = "event once for every available mode the outputdevice can be operated by."] + #[doc = ""] + #[doc = "There will always be at least one event sent out on initial binding,"] + #[doc = "which represents the current mode."] + #[doc = ""] + #[doc = "Later on if an output changes its mode the event is sent again, whereby"] + #[doc = "this event represents the mode that has now become current. In other"] + #[doc = "words, the current mode is always represented by the latest event sent"] + #[doc = "with the current flag set."] + #[doc = ""] + #[doc = "The size of a mode is given in physical hardware units of the output device."] + #[doc = "This is not necessarily the same as the output size in the global compositor"] + #[doc = "space. For instance, the output may be scaled, as described in"] + #[doc = "org_kde_kwin_outputdevice.scale, or transformed, as described in"] + #[doc = "org_kde_kwin_outputdevice.transform."] + #[doc = ""] + #[doc = "The id can be used to refer to a mode when calling set_mode on an"] + #[doc = "org_kde_kwin_outputconfiguration object."] + async fn mode( + &self, + flags: u32, + width: i32, + height: i32, + refresh: i32, + mode_id: i32, + ) -> crate::client::Result<()>; + #[doc = "This event is sent after all other properties have been"] + #[doc = "sent on binding to the output object as well as after any"] + #[doc = "other output property change have been applied later on."] + #[doc = "This allows to see changes to the output properties as atomic,"] + #[doc = "even if multiple events successively announce them."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event contains scaling geometry information"] + #[doc = "that is not in the geometry event. It may be sent after"] + #[doc = "binding the output object or if the output scale changes"] + #[doc = "later. If it is not sent, the client should assume a"] + #[doc = "scale of 1."] + #[doc = ""] + #[doc = "A scale larger than 1 means that the compositor will"] + #[doc = "automatically scale surface buffers by this amount"] + #[doc = "when rendering. This is used for high resolution"] + #[doc = "displays where applications rendering at the native"] + #[doc = "resolution would be too small to be legible."] + #[doc = ""] + #[doc = "It is intended that scaling aware clients track the"] + #[doc = "current output of a surface, and if it is on a scaled"] + #[doc = "output it should use wl_surface.set_buffer_scale with"] + #[doc = "the scale of the output. That way the compositor can"] + #[doc = "avoid scaling the surface, and the client can supply"] + #[doc = "a higher detail image."] + async fn scale(&self, factor: i32) -> crate::client::Result<()>; + #[doc = "The edid event encapsulates the EDID data for the outputdevice."] + #[doc = ""] + #[doc = "The event is sent when binding to the output object. The EDID"] + #[doc = "data may be empty, in which case this event is sent anyway."] + #[doc = "If the EDID information is empty, you can fall back to the name"] + #[doc = "et al. properties of the outputdevice."] + async fn edid(&self, raw: String) -> crate::client::Result<()>; + #[doc = "The enabled event notifies whether this output is currently"] + #[doc = "enabled and used for displaying content by the server."] + #[doc = "The event is sent when binding to the output object and"] + #[doc = "whenever later on an output changes its state by becoming"] + #[doc = "enabled or disabled."] + async fn enabled(&self, enabled: i32) -> crate::client::Result<()>; + #[doc = "The uuid can be used to identify the output. It's controlled by"] + #[doc = "the server entirely. The server should make sure the uuid is"] + #[doc = "persistent across restarts. An empty uuid is considered invalid."] + async fn uuid(&self, uuid: String) -> crate::client::Result<()>; + #[doc = "This event contains scaling geometry information"] + #[doc = "that is not in the geometry event. It may be sent after"] + #[doc = "binding the output object or if the output scale changes"] + #[doc = "later. If it is not sent, the client should assume a"] + #[doc = "scale of 1."] + #[doc = ""] + #[doc = "A scale larger than 1 means that the compositor will"] + #[doc = "automatically scale surface buffers by this amount"] + #[doc = "when rendering. This is used for high resolution"] + #[doc = "displays where applications rendering at the native"] + #[doc = "resolution would be too small to be legible."] + #[doc = ""] + #[doc = "It is intended that scaling aware clients track the"] + #[doc = "current output of a surface, and if it is on a scaled"] + #[doc = "output it should use wl_surface.set_buffer_scale with"] + #[doc = "the scale of the output. That way the compositor can"] + #[doc = "avoid scaling the surface, and the client can supply"] + #[doc = "a higher detail image."] + #[doc = ""] + #[doc = "wl_output will keep the output scale as an integer. In every situation except"] + #[doc = "configuring the window manager you want to use that."] + async fn scalef(&self, factor: crate::wire::Fixed) -> crate::client::Result<()>; + #[doc = "Describes the color intensity profile of the output."] + #[doc = "Commonly used for gamma/color correction."] + #[doc = ""] + #[doc = "The array contains all color ramp values of the output."] + #[doc = "For example on 8bit screens there are 256 of them."] + #[doc = ""] + #[doc = "The array elements are unsigned 16bit integers."] + async fn colorcurves( + &self, + red: Vec, + green: Vec, + blue: Vec, + ) -> crate::client::Result<()>; + #[doc = "Serial ID of the monitor, sent on startup before the first done event."] + async fn serial_number(&self, serial_number: String) -> crate::client::Result<()>; + #[doc = "EISA ID of the monitor, sent on startup before the first done event."] + async fn eisa_id(&self, eisa_id: String) -> crate::client::Result<()>; + #[doc = "What capabilities this device has, sent on startup before the first"] + #[doc = "done event."] + async fn capabilities(&self, flags: Capability) -> crate::client::Result<()>; + #[doc = "Overscan value of the monitor in percent, sent on startup before the"] + #[doc = "first done event."] + async fn overscan(&self, overscan: u32) -> crate::client::Result<()>; + #[doc = "What policy the compositor will employ regarding its use of variable"] + #[doc = "refresh rate."] + async fn vrr_policy(&self, vrr_policy: VrrPolicy) -> crate::client::Result<()>; } } } @@ -1413,6 +1584,11 @@ pub mod remote_access { .await .map_err(crate::client::Error::IoError) } + async fn buffer_ready( + &self, + id: i32, + output: crate::wire::ObjectId, + ) -> crate::client::Result<()>; } } #[allow(clippy::too_many_arguments)] @@ -1443,6 +1619,14 @@ pub mod remote_access { .await .map_err(crate::client::Error::IoError) } + async fn gbm_handle( + &self, + fd: rustix::fd::OwnedFd, + width: u32, + height: u32, + stride: u32, + format: u32, + ) -> crate::client::Result<()>; } } } @@ -1620,6 +1804,13 @@ pub mod server_decoration { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is emitted directly after binding the interface. It contains"] + #[doc = "the default mode for the decoration. When a new server decoration object"] + #[doc = "is created this new object will be in the default mode until the first"] + #[doc = "request_mode is requested."] + #[doc = ""] + #[doc = "The server may change the default mode at any time."] + async fn default_mode(&self, mode: u32) -> crate::client::Result<()>; } } #[allow(clippy::too_many_arguments)] @@ -1688,6 +1879,20 @@ pub mod server_decoration { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is emitted directly after the decoration is created and"] + #[doc = "represents the base decoration policy by the server. E.g. a server"] + #[doc = "which wants all surfaces to be client-side decorated will send Client,"] + #[doc = "a server which wants server-side decoration will send Server."] + #[doc = ""] + #[doc = "The client can request a different mode through the decoration request."] + #[doc = "The server will acknowledge this by another event with the same mode. So"] + #[doc = "even if a server prefers server-side decoration it's possible to force a"] + #[doc = "client-side decoration."] + #[doc = ""] + #[doc = "The server may emit this event at any time. In this case the client can"] + #[doc = "again request a different mode. It's the responsibility of the server to"] + #[doc = "prevent a feedback loop."] + async fn mode(&self, mode: u32) -> crate::client::Result<()>; } } } @@ -2297,6 +2502,13 @@ pub mod surface_extension { .await .map_err(crate::client::Error::IoError) } + async fn onscreen_visibility(&self, visible: i32) -> crate::client::Result<()>; + async fn set_generic_property( + &self, + name: String, + value: Vec, + ) -> crate::client::Result<()>; + async fn close(&self) -> crate::client::Result<()>; } } } @@ -2736,6 +2948,150 @@ pub mod text_input_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Notification that this seat's text-input focus is on a certain surface."] + #[doc = ""] + #[doc = "When the seat has the keyboard capability the text-input focus follows"] + #[doc = "the keyboard focus."] + async fn enter( + &self, + serial: u32, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "Notification that this seat's text-input focus is no longer on"] + #[doc = "a certain surface."] + #[doc = ""] + #[doc = "The leave notification is sent before the enter notification"] + #[doc = "for the new focus."] + #[doc = ""] + #[doc = "When the seat has the keyboard capability the text-input focus follows"] + #[doc = "the keyboard focus."] + async fn leave( + &self, + serial: u32, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "Notification that the visibility of the input panel (virtual keyboard)"] + #[doc = "changed."] + #[doc = ""] + #[doc = "The rectangle x, y, width, height defines the area overlapped by the"] + #[doc = "input panel (virtual keyboard) on the surface having the text"] + #[doc = "focus in surface local coordinates."] + #[doc = ""] + #[doc = "That can be used to make sure widgets are visible and not covered by"] + #[doc = "a virtual keyboard."] + async fn input_panel_state( + &self, + state: InputPanelVisibility, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "Notify when a new composing text (pre-edit) should be set around the"] + #[doc = "current cursor position. Any previously set composing text should"] + #[doc = "be removed."] + #[doc = ""] + #[doc = "The commit text can be used to replace the composing text in some cases"] + #[doc = "(for example when losing focus)."] + #[doc = ""] + #[doc = "The text input should also handle all preedit_style and preedit_cursor"] + #[doc = "events occurring directly before preedit_string."] + async fn preedit_string( + &self, + text: String, + commit: String, + ) -> crate::client::Result<()>; + #[doc = "Sets styling information on composing text. The style is applied for"] + #[doc = "length bytes from index relative to the beginning of the composing"] + #[doc = "text (as byte offset). Multiple styles can be applied to a composing"] + #[doc = "text by sending multiple preedit_styling events."] + #[doc = ""] + #[doc = "This event is handled as part of a following preedit_string event."] + async fn preedit_styling( + &self, + index: u32, + length: u32, + style: PreeditStyle, + ) -> crate::client::Result<()>; + #[doc = "Sets the cursor position inside the composing text (as byte"] + #[doc = "offset) relative to the start of the composing text. When index is a"] + #[doc = "negative number no cursor is shown."] + #[doc = ""] + #[doc = "When no preedit_cursor event is sent the cursor will be at the end of"] + #[doc = "the composing text by default."] + #[doc = ""] + #[doc = "This event is handled as part of a following preedit_string event."] + async fn preedit_cursor(&self, index: i32) -> crate::client::Result<()>; + #[doc = "Notify when text should be inserted into the editor widget. The text to"] + #[doc = "commit could be either just a single character after a key press or the"] + #[doc = "result of some composing (pre-edit). It could be also an empty text"] + #[doc = "when some text should be removed (see delete_surrounding_text) or when"] + #[doc = "the input cursor should be moved (see cursor_position)."] + #[doc = ""] + #[doc = "Any previously set composing text should be removed."] + async fn commit_string(&self, text: String) -> crate::client::Result<()>; + #[doc = "Notify when the cursor or anchor position should be modified."] + #[doc = ""] + #[doc = "This event should be handled as part of a following commit_string"] + #[doc = "event."] + #[doc = ""] + #[doc = "The text between anchor and index should be selected."] + async fn cursor_position(&self, index: i32, anchor: i32) -> crate::client::Result<()>; + #[doc = "Notify when the text around the current cursor position should be"] + #[doc = "deleted. BeforeLength and afterLength is the length (in bytes) of text"] + #[doc = "before and after the current cursor position (excluding the selection)"] + #[doc = "to delete."] + #[doc = ""] + #[doc = "This event should be handled as part of a following commit_string"] + #[doc = "or preedit_string event."] + async fn delete_surrounding_text( + &self, + before_length: u32, + after_length: u32, + ) -> crate::client::Result<()>; + #[doc = "Transfer an array of 0-terminated modifiers names. The position in"] + #[doc = "the array is the index of the modifier as used in the modifiers"] + #[doc = "bitmask in the keysym event."] + async fn modifiers_map(&self, map: Vec) -> crate::client::Result<()>; + #[doc = "Notify when a key event was sent. Key events should not be used"] + #[doc = "for normal text input operations, which should be done with"] + #[doc = "commit_string, delete_surrounding_text, etc. The key event follows"] + #[doc = "the wl_keyboard key event convention. Sym is a XKB keysym, state a"] + #[doc = "wl_keyboard key_state. Modifiers are a mask for effective modifiers"] + #[doc = "(where the modifier indices are set by the modifiers_map event)"] + async fn keysym( + &self, + time: u32, + sym: u32, + state: u32, + modifiers: u32, + ) -> crate::client::Result<()>; + #[doc = "Sets the language of the input text. The \"language\" argument is a RFC-3066"] + #[doc = "format language tag."] + async fn language(&self, language: String) -> crate::client::Result<()>; + #[doc = "Sets the text direction of input text."] + #[doc = ""] + #[doc = "It is mainly needed for showing input cursor on correct side of the"] + #[doc = "editor when there is no input yet done and making sure neutral"] + #[doc = "direction text is laid out properly."] + async fn text_direction(&self, direction: TextDirection) -> crate::client::Result<()>; + #[doc = "Configure what amount of surrounding text is expected by the"] + #[doc = "input method. The surrounding text will be sent in the"] + #[doc = "set_surrounding_text request on the following state information updates."] + async fn configure_surrounding_text( + &self, + before_cursor: i32, + after_cursor: i32, + ) -> crate::client::Result<()>; + #[doc = "The input method changed on compositor side, which invalidates all"] + #[doc = "current state information. New state information should be sent from"] + #[doc = "the client via state requests (set_surrounding_text,"] + #[doc = "set_content_hint, ...) and update_state."] + async fn input_method_changed( + &self, + serial: u32, + flags: u32, + ) -> crate::client::Result<()>; } } #[doc = "A factory for text-input objects. This object is a global singleton."] @@ -3196,6 +3552,106 @@ pub mod text { .await .map_err(crate::client::Error::IoError) } + #[doc = "Notify the text-input object when it received focus. Typically in"] + #[doc = "response to an activate request."] + async fn enter(&self, surface: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "Notify the text-input object when it lost focus. Either in response"] + #[doc = "to a deactivate request or when the assigned surface lost focus or was"] + #[doc = "destroyed."] + async fn leave(&self) -> crate::client::Result<()>; + #[doc = "Transfer an array of 0-terminated modifiers names. The position in"] + #[doc = "the array is the index of the modifier as used in the modifiers"] + #[doc = "bitmask in the keysym event."] + async fn modifiers_map(&self, map: Vec) -> crate::client::Result<()>; + #[doc = "Notify when the visibility state of the input panel changed."] + async fn input_panel_state(&self, state: u32) -> crate::client::Result<()>; + #[doc = "Notify when a new composing text (pre-edit) should be set around the"] + #[doc = "current cursor position. Any previously set composing text should"] + #[doc = "be removed."] + #[doc = ""] + #[doc = "The commit text can be used to replace the preedit text on reset"] + #[doc = "(for example on unfocus)."] + #[doc = ""] + #[doc = "The text input should also handle all preedit_style and preedit_cursor"] + #[doc = "events occurring directly before preedit_string."] + async fn preedit_string( + &self, + serial: u32, + text: String, + commit: String, + ) -> crate::client::Result<()>; + #[doc = "Sets styling information on composing text. The style is applied for"] + #[doc = "length bytes from index relative to the beginning of the composing"] + #[doc = "text (as byte offset). Multiple styles can"] + #[doc = "be applied to a composing text by sending multiple preedit_styling"] + #[doc = "events."] + #[doc = ""] + #[doc = "This event is handled as part of a following preedit_string event."] + async fn preedit_styling( + &self, + index: u32, + length: u32, + style: u32, + ) -> crate::client::Result<()>; + #[doc = "Sets the cursor position inside the composing text (as byte"] + #[doc = "offset) relative to the start of the composing text. When index is a"] + #[doc = "negative number no cursor is shown."] + #[doc = ""] + #[doc = "This event is handled as part of a following preedit_string event."] + async fn preedit_cursor(&self, index: i32) -> crate::client::Result<()>; + #[doc = "Notify when text should be inserted into the editor widget. The text to"] + #[doc = "commit could be either just a single character after a key press or the"] + #[doc = "result of some composing (pre-edit). It could be also an empty text"] + #[doc = "when some text should be removed (see delete_surrounding_text) or when"] + #[doc = "the input cursor should be moved (see cursor_position)."] + #[doc = ""] + #[doc = "Any previously set composing text should be removed."] + async fn commit_string(&self, serial: u32, text: String) -> crate::client::Result<()>; + #[doc = "Notify when the cursor or anchor position should be modified."] + #[doc = ""] + #[doc = "This event should be handled as part of a following commit_string"] + #[doc = "event."] + async fn cursor_position(&self, index: i32, anchor: i32) -> crate::client::Result<()>; + #[doc = "Notify when the text around the current cursor position should be"] + #[doc = "deleted."] + #[doc = ""] + #[doc = "Index is relative to the current cursor (in bytes)."] + #[doc = "Length is the length of deleted text (in bytes)."] + #[doc = ""] + #[doc = "This event should be handled as part of a following commit_string"] + #[doc = "event."] + async fn delete_surrounding_text( + &self, + index: i32, + length: u32, + ) -> crate::client::Result<()>; + #[doc = "Notify when a key event was sent. Key events should not be used"] + #[doc = "for normal text input operations, which should be done with"] + #[doc = "commit_string, delete_surrounding_text, etc. The key event follows"] + #[doc = "the wl_keyboard key event convention. Sym is a XKB keysym, state a"] + #[doc = "wl_keyboard key_state. Modifiers are a mask for effective modifiers"] + #[doc = "(where the modifier indices are set by the modifiers_map event)"] + async fn keysym( + &self, + serial: u32, + time: u32, + sym: u32, + state: u32, + modifiers: u32, + ) -> crate::client::Result<()>; + #[doc = "Sets the language of the input text. The \"language\" argument is a RFC-3066"] + #[doc = "format language tag."] + async fn language(&self, serial: u32, language: String) -> crate::client::Result<()>; + #[doc = "Sets the text direction of input text."] + #[doc = ""] + #[doc = "It is mainly needed for showing input cursor on correct side of the"] + #[doc = "editor when there is no input yet done and making sure neutral"] + #[doc = "direction text is laid out properly."] + async fn text_direction( + &self, + serial: u32, + direction: u32, + ) -> crate::client::Result<()>; } } #[doc = "A factory for text-input objects. This object is a global singleton."] @@ -3478,6 +3934,21 @@ pub mod dpms { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event gets pushed on binding the resource and indicates whether the wl_output"] + #[doc = "supports DPMS. There are operation modes of a Wayland server where DPMS might not"] + #[doc = "make sense (e.g. nested compositors)."] + async fn supported(&self, supported: u32) -> crate::client::Result<()>; + #[doc = "This mode gets pushed on binding the resource and provides the currently used"] + #[doc = "DPMS mode. It also gets pushed if DPMS is not supported for the wl_output, in that"] + #[doc = "case the value will be On."] + #[doc = ""] + #[doc = "The event is also pushed whenever the state changes."] + async fn mode(&self, mode: u32) -> crate::client::Result<()>; + #[doc = "This event gets pushed on binding the resource once all other states are pushed."] + #[doc = ""] + #[doc = "In addition it gets pushed whenever a state changes to tell the client that all"] + #[doc = "state changes have been pushed."] + async fn done(&self) -> crate::client::Result<()>; } } } @@ -3981,6 +4452,140 @@ pub mod kde_output_device_v2 { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "The geometry event describes geometric properties of the output."] + #[doc = "The event is sent when binding to the output object and whenever"] + #[doc = "any of the properties change."] + async fn geometry( + &self, + x: i32, + y: i32, + physical_width: i32, + physical_height: i32, + subpixel: i32, + make: String, + model: String, + transform: i32, + ) -> crate::client::Result<()>; + #[doc = "This event describes the mode currently in use for this head. It is only"] + #[doc = "sent if the output is enabled."] + async fn current_mode(&self, mode: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "The mode event describes an available mode for the output."] + #[doc = ""] + #[doc = "When the client binds to the output_device object, the server sends this"] + #[doc = "event once for every available mode the output_device can be operated by."] + #[doc = ""] + #[doc = "There will always be at least one event sent out on initial binding,"] + #[doc = "which represents the current mode."] + #[doc = ""] + #[doc = "Later if an output changes, its mode event is sent again for the"] + #[doc = "eventual added modes and lastly the current mode. In other words, the"] + #[doc = "current mode is always represented by the latest event sent with the current"] + #[doc = "flag set."] + #[doc = ""] + #[doc = "The size of a mode is given in physical hardware units of the output device."] + #[doc = "This is not necessarily the same as the output size in the global compositor"] + #[doc = "space. For instance, the output may be scaled, as described in"] + #[doc = "kde_output_device_v2.scale, or transformed, as described in"] + #[doc = "kde_output_device_v2.transform."] + async fn mode(&self, mode: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event is sent after all other properties have been"] + #[doc = "sent on binding to the output object as well as after any"] + #[doc = "other output property change have been applied later on."] + #[doc = "This allows to see changes to the output properties as atomic,"] + #[doc = "even if multiple events successively announce them."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event contains scaling geometry information"] + #[doc = "that is not in the geometry event. It may be sent after"] + #[doc = "binding the output object or if the output scale changes"] + #[doc = "later. If it is not sent, the client should assume a"] + #[doc = "scale of 1."] + #[doc = ""] + #[doc = "A scale larger than 1 means that the compositor will"] + #[doc = "automatically scale surface buffers by this amount"] + #[doc = "when rendering. This is used for high resolution"] + #[doc = "displays where applications rendering at the native"] + #[doc = "resolution would be too small to be legible."] + #[doc = ""] + #[doc = "It is intended that scaling aware clients track the"] + #[doc = "current output of a surface, and if it is on a scaled"] + #[doc = "output it should use wl_surface.set_buffer_scale with"] + #[doc = "the scale of the output. That way the compositor can"] + #[doc = "avoid scaling the surface, and the client can supply"] + #[doc = "a higher detail image."] + async fn scale(&self, factor: crate::wire::Fixed) -> crate::client::Result<()>; + #[doc = "The edid event encapsulates the EDID data for the outputdevice."] + #[doc = ""] + #[doc = "The event is sent when binding to the output object. The EDID"] + #[doc = "data may be empty, in which case this event is sent anyway."] + #[doc = "If the EDID information is empty, you can fall back to the name"] + #[doc = "et al. properties of the outputdevice."] + async fn edid(&self, raw: String) -> crate::client::Result<()>; + #[doc = "The enabled event notifies whether this output is currently"] + #[doc = "enabled and used for displaying content by the server."] + #[doc = "The event is sent when binding to the output object and"] + #[doc = "whenever later on an output changes its state by becoming"] + #[doc = "enabled or disabled."] + async fn enabled(&self, enabled: i32) -> crate::client::Result<()>; + #[doc = "The uuid can be used to identify the output. It's controlled by"] + #[doc = "the server entirely. The server should make sure the uuid is"] + #[doc = "persistent across restarts. An empty uuid is considered invalid."] + async fn uuid(&self, uuid: String) -> crate::client::Result<()>; + #[doc = "Serial ID of the monitor, sent on startup before the first done event."] + async fn serial_number(&self, serial_number: String) -> crate::client::Result<()>; + #[doc = "EISA ID of the monitor, sent on startup before the first done event."] + async fn eisa_id(&self, eisa_id: String) -> crate::client::Result<()>; + #[doc = "What capabilities this device has, sent on startup before the first"] + #[doc = "done event."] + async fn capabilities(&self, flags: Capability) -> crate::client::Result<()>; + #[doc = "Overscan value of the monitor in percent, sent on startup before the"] + #[doc = "first done event."] + async fn overscan(&self, overscan: u32) -> crate::client::Result<()>; + #[doc = "What policy the compositor will employ regarding its use of variable"] + #[doc = "refresh rate."] + async fn vrr_policy(&self, vrr_policy: VrrPolicy) -> crate::client::Result<()>; + #[doc = "What rgb range the compositor is using for this output"] + async fn rgb_range(&self, rgb_range: RgbRange) -> crate::client::Result<()>; + #[doc = "Name of the output, it's useful to cross-reference to an zxdg_output_v1 and ultimately QScreen"] + async fn name(&self, name: String) -> crate::client::Result<()>; + #[doc = "Whether or not high dynamic range is enabled for this output"] + async fn high_dynamic_range(&self, hdr_enabled: u32) -> crate::client::Result<()>; + #[doc = "If high dynamic range is used, this value defines the brightness in nits for content"] + #[doc = "that's in standard dynamic range format. Note that while the value is in nits, that"] + #[doc = "doesn't necessarily translate to the same brightness on the screen."] + async fn sdr_brightness(&self, sdr_brightness: u32) -> crate::client::Result<()>; + #[doc = "Whether or not the use of a wide color gamut is enabled for this output"] + async fn wide_color_gamut(&self, wcg_enabled: u32) -> crate::client::Result<()>; + async fn auto_rotate_policy( + &self, + policy: AutoRotatePolicy, + ) -> crate::client::Result<()>; + async fn icc_profile_path(&self, profile_path: String) -> crate::client::Result<()>; + async fn brightness_metadata( + &self, + max_peak_brightness: u32, + max_frame_average_brightness: u32, + min_brightness: u32, + ) -> crate::client::Result<()>; + async fn brightness_overrides( + &self, + max_peak_brightness: i32, + max_average_brightness: i32, + min_brightness: i32, + ) -> crate::client::Result<()>; + #[doc = "This can be used to provide the colors users assume sRGB applications should have based on the"] + #[doc = "default experience on many modern sRGB screens."] + async fn sdr_gamut_wideness(&self, gamut_wideness: u32) -> crate::client::Result<()>; + async fn color_profile_source( + &self, + source: ColorProfileSource, + ) -> crate::client::Result<()>; + #[doc = "This is the brightness modifier of the output. It doesn't specify"] + #[doc = "any absolute values, but is merely a multiplier on top of other"] + #[doc = "brightness values, like sdr_brightness and brightness_metadata."] + #[doc = "0 is the minimum brightness (not completely dark) and 10000 is"] + #[doc = "the maximum brightness."] + #[doc = "This is currently only supported / meaningful while HDR is active."] + async fn brightness(&self, brightness: u32) -> crate::client::Result<()>; } } #[doc = "This object describes an output mode."] @@ -4006,6 +4611,20 @@ pub mod kde_output_device_v2 { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "This event describes the mode size. The size is given in physical"] + #[doc = "hardware units of the output device. This is not necessarily the same as"] + #[doc = "the output size in the global compositor space. For instance, the output"] + #[doc = "may be scaled or transformed."] + async fn size(&self, width: i32, height: i32) -> crate::client::Result<()>; + #[doc = "This event describes the mode's fixed vertical refresh rate. It is only"] + #[doc = "sent if the mode has a fixed refresh rate."] + async fn refresh(&self, refresh: i32) -> crate::client::Result<()>; + #[doc = "This event advertises this mode as preferred."] + async fn preferred(&self) -> crate::client::Result<()>; + #[doc = "The compositor will destroy the object immediately after sending this"] + #[doc = "event, so it will become invalid and the client should release any"] + #[doc = "resources associated with it."] + async fn removed(&self) -> crate::client::Result<()>; } } } @@ -4641,6 +5260,11 @@ pub mod kde_output_management_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent after the server has successfully applied the changes."] + #[doc = "."] + async fn applied(&self) -> crate::client::Result<()>; + #[doc = "Sent if the server rejects the changes or failed to apply them."] + async fn failed(&self) -> crate::client::Result<()>; } } } @@ -4681,6 +5305,10 @@ pub mod kde_output_order_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Specifies the output identified by their wl_output.name."] + async fn output(&self, output_name: String) -> crate::client::Result<()>; + #[doc = "Specifies that the output list is complete. On the next output event, a new list begins."] + async fn done(&self) -> crate::client::Result<()>; } } } @@ -4721,6 +5349,8 @@ pub mod kde_primary_output_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Specifies which output is the primary one identified by their uuid. See kde_output_device_v2 uuid event for more information about it."] + async fn primary_output(&self, output_name: String) -> crate::client::Result<()>; } } } @@ -5004,6 +5634,19 @@ pub mod org_kde_plasma_virtual_desktop { .await .map_err(crate::client::Error::IoError) } + async fn desktop_created( + &self, + desktop_id: String, + position: u32, + ) -> crate::client::Result<()>; + async fn desktop_removed(&self, desktop_id: String) -> crate::client::Result<()>; + #[doc = "This event is sent after all other properties has been"] + #[doc = "sent after binding to the desktop manager object and after any"] + #[doc = "other property changes done after that. This allows"] + #[doc = "changes to the org_kde_plasma_virtual_desktop_management properties to be seen as"] + #[doc = "atomic, even if they happen via multiple events."] + async fn done(&self) -> crate::client::Result<()>; + async fn rows(&self, rows: u32) -> crate::client::Result<()>; } } #[allow(clippy::too_many_arguments)] @@ -5038,6 +5681,23 @@ pub mod org_kde_plasma_virtual_desktop { .await .map_err(crate::client::Error::IoError) } + #[doc = "The format of the id is decided by the compositor implementation. A desktop id univocally identifies a virtual desktop and must be guaranteed to never exist two desktops with the same id. The format of the string id is up to the server implementation."] + async fn desktop_id(&self, desktop_id: String) -> crate::client::Result<()>; + async fn name(&self, name: String) -> crate::client::Result<()>; + #[doc = "The desktop will be the new \"current\" desktop of the system. The server may support either one virtual desktop active at a time, or other combinations such as one virtual desktop active per screen."] + #[doc = "Windows associated to this virtual desktop will be shown."] + async fn activated(&self) -> crate::client::Result<()>; + #[doc = "Windows that were associated only to this desktop will be hidden."] + async fn deactivated(&self) -> crate::client::Result<()>; + #[doc = "This event is sent after all other properties has been"] + #[doc = "sent after binding to the desktop object and after any"] + #[doc = "other property changes done after that. This allows"] + #[doc = "changes to the org_kde_plasma_virtual_desktop properties to be seen as"] + #[doc = "atomic, even if they happen via multiple events."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This virtual desktop has just been removed by the server:"] + #[doc = "All windows will lose the association to this desktop."] + async fn removed(&self) -> crate::client::Result<()>; } } } @@ -5478,6 +6138,10 @@ pub mod plasma_shell { .await .map_err(crate::client::Error::IoError) } + #[doc = "An auto-hiding panel got hidden by the compositor."] + async fn auto_hidden_panel_hidden(&self) -> crate::client::Result<()>; + #[doc = "An auto-hiding panel got shown by the compositor."] + async fn auto_hidden_panel_shown(&self) -> crate::client::Result<()>; } } } @@ -5654,6 +6318,26 @@ pub mod plasma_window_management { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event will be sent whenever the show desktop mode changes. E.g. when it is entered"] + #[doc = "or left."] + #[doc = ""] + #[doc = "On binding the interface the current state is sent."] + async fn show_desktop_changed(&self, state: u32) -> crate::client::Result<()>; + #[doc = "This event will be sent immediately after a window is mapped."] + async fn window(&self, id: u32) -> crate::client::Result<()>; + #[doc = "This event will be sent when stacking order changed and on bind."] + #[doc = ""] + #[doc = "With version 17 this event is deprecated and will no longer be sent."] + async fn stacking_order_changed(&self, ids: Vec) -> crate::client::Result<()>; + #[doc = "This event will be sent when stacking order changed and on bind."] + #[doc = ""] + #[doc = "With version 17 this event is deprecated and will no longer be sent."] + async fn stacking_order_uuid_changed(&self, uuids: String) + -> crate::client::Result<()>; + #[doc = "This event will be sent immediately after a window is mapped."] + async fn window_with_uuid(&self, id: u32, uuid: String) -> crate::client::Result<()>; + #[doc = "This event will be sent when stacking order changed."] + async fn stacking_order_changed_2(&self) -> crate::client::Result<()>; } } #[doc = "Manages and control an application window."] @@ -5944,6 +6628,87 @@ pub mod plasma_window_management { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event will be sent as soon as the window title is changed."] + async fn title_changed(&self, title: String) -> crate::client::Result<()>; + #[doc = "This event will be sent as soon as the application"] + #[doc = "identifier is changed."] + async fn app_id_changed(&self, app_id: String) -> crate::client::Result<()>; + #[doc = "This event will be sent as soon as the window state changes."] + #[doc = ""] + #[doc = "Values for state argument are described by org_kde_plasma_window_management.state."] + async fn state_changed(&self, flags: u32) -> crate::client::Result<()>; + #[doc = "DEPRECATED: use virtual_desktop_entered and virtual_desktop_left instead"] + #[doc = "This event will be sent when a window is moved to another"] + #[doc = "virtual desktop."] + #[doc = ""] + #[doc = "It is not sent if it becomes visible on all virtual desktops though."] + async fn virtual_desktop_changed(&self, number: i32) -> crate::client::Result<()>; + #[doc = "This event will be sent whenever the themed icon name changes. May be null."] + async fn themed_icon_name_changed(&self, name: String) -> crate::client::Result<()>; + #[doc = "This event will be sent immediately after the window is closed"] + #[doc = "and its surface is unmapped."] + async fn unmapped(&self) -> crate::client::Result<()>; + #[doc = "This event will be sent immediately after all initial state been sent to the client."] + #[doc = "If the Plasma window is already unmapped, the unmapped event will be sent before the"] + #[doc = "initial_state event."] + async fn initial_state(&self) -> crate::client::Result<()>; + #[doc = "This event will be sent whenever the parent window of this org_kde_plasma_window changes."] + #[doc = "The passed parent is another org_kde_plasma_window and this org_kde_plasma_window is a"] + #[doc = "transient window to the parent window. If the parent argument is null, this"] + #[doc = "org_kde_plasma_window does not have a parent window."] + async fn parent_window( + &self, + parent: Option, + ) -> crate::client::Result<()>; + #[doc = "This event will be sent whenever the window geometry of this org_kde_plasma_window changes."] + #[doc = "The coordinates are in absolute coordinates of the windowing system."] + async fn geometry( + &self, + x: i32, + y: i32, + width: u32, + height: u32, + ) -> crate::client::Result<()>; + #[doc = "This event will be sent whenever the icon of the window changes, but there is no themed"] + #[doc = "icon name. Common examples are Xwayland windows which have a pixmap based icon."] + #[doc = ""] + #[doc = "The client can request the icon using get_icon."] + async fn icon_changed(&self) -> crate::client::Result<()>; + #[doc = "This event will be sent when the compositor has set the process id this window belongs to."] + #[doc = "This should be set once before the initial_state is sent."] + async fn pid_changed(&self, pid: u32) -> crate::client::Result<()>; + #[doc = "This event will be sent when the window has entered a new virtual desktop. The window can be on more than one desktop, or none: then is considered on all of them."] + async fn virtual_desktop_entered(&self, id: String) -> crate::client::Result<()>; + #[doc = "This event will be sent when the window left a virtual desktop. If the window leaves all desktops, it can be considered on all."] + #[doc = "If the window gets manually added on all desktops, the server has to send virtual_desktop_left for every previous desktop it was in for the window to be really considered on all desktops."] + async fn virtual_desktop_left(&self, is: String) -> crate::client::Result<()>; + #[doc = "This event will be sent after the application menu"] + #[doc = "for the window has changed."] + async fn application_menu( + &self, + service_name: String, + object_path: String, + ) -> crate::client::Result<()>; + #[doc = "This event will be sent when the window has entered an activity. The window can be on more than one activity, or none: then is considered on all of them."] + async fn activity_entered(&self, id: String) -> crate::client::Result<()>; + #[doc = "This event will be sent when the window left an activity. If the window leaves all activities, it will be considered on all."] + #[doc = "If the window gets manually added on all activities, the server has to send activity_left for every previous activity it was in for the window to be really considered on all activities."] + async fn activity_left(&self, id: String) -> crate::client::Result<()>; + #[doc = "This event will be sent when the X11 resource name of the window has changed."] + #[doc = "This is only set for XWayland windows."] + async fn resource_name_changed( + &self, + resource_name: String, + ) -> crate::client::Result<()>; + #[doc = "This event will be sent whenever the window geometry of this org_kde_plasma_window changes."] + #[doc = "The coordinates are in absolute coordinates of the windowing system."] + async fn client_geometry( + &self, + x: i32, + y: i32, + width: u32, + height: u32, + ) -> crate::client::Result<()>; } } #[doc = "The activation manager interface provides a way to get notified"] @@ -5981,6 +6746,10 @@ pub mod plasma_window_management { .await .map_err(crate::client::Error::IoError) } + #[doc = "Will be issued when an app is set to be activated. It offers"] + #[doc = "an instance of org_kde_plasma_activation that will tell us the app_id"] + #[doc = "and the extent of the activation."] + async fn activation(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; } } #[allow(clippy::too_many_arguments)] @@ -6013,6 +6782,8 @@ pub mod plasma_window_management { .await .map_err(crate::client::Error::IoError) } + async fn app_id(&self, app_id: String) -> crate::client::Result<()>; + async fn finished(&self) -> crate::client::Result<()>; } } #[doc = "When this object is created, the compositor sends a window event for"] @@ -6033,6 +6804,8 @@ pub mod plasma_window_management { _ => Err(crate::client::Error::UnknownOpcode), } } + async fn window(&self, uuid: String) -> crate::client::Result<()>; + async fn done(&self) -> crate::client::Result<()>; } } } @@ -6228,6 +7001,9 @@ pub mod zkde_screencast_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + async fn closed(&self) -> crate::client::Result<()>; + async fn created(&self, node: u32) -> crate::client::Result<()>; + async fn failed(&self, error: String) -> crate::client::Result<()>; } } } diff --git a/src/client/protocol/stable.rs b/src/client/protocol/stable.rs index 114ab4b..2366df6 100644 --- a/src/client/protocol/stable.rs +++ b/src/client/protocol/stable.rs @@ -162,6 +162,47 @@ pub mod linux_dmabuf_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event advertises one buffer format that the server supports."] + #[doc = "All the supported formats are advertised once when the client"] + #[doc = "binds to this interface. A roundtrip after binding guarantees"] + #[doc = "that the client has received all supported formats."] + #[doc = ""] + #[doc = "For the definition of the format codes, see the"] + #[doc = "zwp_linux_buffer_params_v1::create request."] + #[doc = ""] + #[doc = "Starting version 4, the format event is deprecated and must not be"] + #[doc = "sent by compositors. Instead, use get_default_feedback or"] + #[doc = "get_surface_feedback."] + async fn format(&self, format: u32) -> crate::client::Result<()>; + #[doc = "This event advertises the formats that the server supports, along with"] + #[doc = "the modifiers supported for each format. All the supported modifiers"] + #[doc = "for all the supported formats are advertised once when the client"] + #[doc = "binds to this interface. A roundtrip after binding guarantees that"] + #[doc = "the client has received all supported format-modifier pairs."] + #[doc = ""] + #[doc = "For legacy support, DRM_FORMAT_MOD_INVALID (that is, modifier_hi =="] + #[doc = "0x00ffffff and modifier_lo == 0xffffffff) is allowed in this event."] + #[doc = "It indicates that the server can support the format with an implicit"] + #[doc = "modifier. When a plane has DRM_FORMAT_MOD_INVALID as its modifier, it"] + #[doc = "is as if no explicit modifier is specified. The effective modifier"] + #[doc = "will be derived from the dmabuf."] + #[doc = ""] + #[doc = "A compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for"] + #[doc = "a given format supports both explicit modifiers and implicit modifiers."] + #[doc = ""] + #[doc = "For the definition of the format and modifier codes, see the"] + #[doc = "zwp_linux_buffer_params_v1::create and zwp_linux_buffer_params_v1::add"] + #[doc = "requests."] + #[doc = ""] + #[doc = "Starting version 4, the modifier event is deprecated and must not be"] + #[doc = "sent by compositors. Instead, use get_default_feedback or"] + #[doc = "get_surface_feedback."] + async fn modifier( + &self, + format: u32, + modifier_hi: u32, + modifier_lo: u32, + ) -> crate::client::Result<()>; } } #[doc = "This temporary object is a collection of dmabufs and other"] @@ -423,6 +464,19 @@ pub mod linux_dmabuf_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event indicates that the attempted buffer creation was"] + #[doc = "successful. It provides the new wl_buffer referencing the dmabuf(s)."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy the"] + #[doc = "zwp_linux_buffer_params_v1 object."] + async fn created(&self, buffer: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event indicates that the attempted buffer creation has"] + #[doc = "failed. It usually means that one of the dmabuf constraints"] + #[doc = "has not been fulfilled."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy the"] + #[doc = "zwp_linux_buffer_params_v1 object."] + async fn failed(&self) -> crate::client::Result<()>; } } #[doc = "This object advertises dmabuf parameters feedback. This includes the"] @@ -487,6 +541,121 @@ pub mod linux_dmabuf_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent after all parameters of a wp_linux_dmabuf_feedback"] + #[doc = "object have been sent."] + #[doc = ""] + #[doc = "This allows changes to the wp_linux_dmabuf_feedback parameters to be"] + #[doc = "seen as atomic, even if they happen via multiple events."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event provides a file descriptor which can be memory-mapped to"] + #[doc = "access the format and modifier table."] + #[doc = ""] + #[doc = "The table contains a tightly packed array of consecutive format +"] + #[doc = "modifier pairs. Each pair is 16 bytes wide. It contains a format as a"] + #[doc = "32-bit unsigned integer, followed by 4 bytes of unused padding, and a"] + #[doc = "modifier as a 64-bit unsigned integer. The native endianness is used."] + #[doc = ""] + #[doc = "The client must map the file descriptor in read-only private mode."] + #[doc = ""] + #[doc = "Compositors are not allowed to mutate the table file contents once this"] + #[doc = "event has been sent. Instead, compositors must create a new, separate"] + #[doc = "table file and re-send feedback parameters. Compositors are allowed to"] + #[doc = "store duplicate format + modifier pairs in the table."] + async fn format_table( + &self, + fd: rustix::fd::OwnedFd, + size: u32, + ) -> crate::client::Result<()>; + #[doc = "This event advertises the main device that the server prefers to use"] + #[doc = "when direct scan-out to the target device isn't possible. The"] + #[doc = "advertised main device may be different for each"] + #[doc = "wp_linux_dmabuf_feedback object, and may change over time."] + #[doc = ""] + #[doc = "There is exactly one main device. The compositor must send at least"] + #[doc = "one preference tranche with tranche_target_device equal to main_device."] + #[doc = ""] + #[doc = "Clients need to create buffers that the main device can import and"] + #[doc = "read from, otherwise creating the dmabuf wl_buffer will fail (see the"] + #[doc = "wp_linux_buffer_params.create and create_immed requests for details)."] + #[doc = "The main device will also likely be kept active by the compositor,"] + #[doc = "so clients can use it instead of waking up another device for power"] + #[doc = "savings."] + #[doc = ""] + #[doc = "In general the device is a DRM node. The DRM node type (primary vs."] + #[doc = "render) is unspecified. Clients must not rely on the compositor sending"] + #[doc = "a particular node type. Clients cannot check two devices for equality"] + #[doc = "by comparing the dev_t value."] + #[doc = ""] + #[doc = "If explicit modifiers are not supported and the client performs buffer"] + #[doc = "allocations on a different device than the main device, then the client"] + #[doc = "must force the buffer to have a linear layout."] + async fn main_device(&self, device: Vec) -> crate::client::Result<()>; + #[doc = "This event splits tranche_target_device and tranche_formats events in"] + #[doc = "preference tranches. It is sent after a set of tranche_target_device"] + #[doc = "and tranche_formats events; it represents the end of a tranche. The"] + #[doc = "next tranche will have a lower preference."] + async fn tranche_done(&self) -> crate::client::Result<()>; + #[doc = "This event advertises the target device that the server prefers to use"] + #[doc = "for a buffer created given this tranche. The advertised target device"] + #[doc = "may be different for each preference tranche, and may change over time."] + #[doc = ""] + #[doc = "There is exactly one target device per tranche."] + #[doc = ""] + #[doc = "The target device may be a scan-out device, for example if the"] + #[doc = "compositor prefers to directly scan-out a buffer created given this"] + #[doc = "tranche. The target device may be a rendering device, for example if"] + #[doc = "the compositor prefers to texture from said buffer."] + #[doc = ""] + #[doc = "The client can use this hint to allocate the buffer in a way that makes"] + #[doc = "it accessible from the target device, ideally directly. The buffer must"] + #[doc = "still be accessible from the main device, either through direct import"] + #[doc = "or through a potentially more expensive fallback path. If the buffer"] + #[doc = "can't be directly imported from the main device then clients must be"] + #[doc = "prepared for the compositor changing the tranche priority or making"] + #[doc = "wl_buffer creation fail (see the wp_linux_buffer_params.create and"] + #[doc = "create_immed requests for details)."] + #[doc = ""] + #[doc = "If the device is a DRM node, the DRM node type (primary vs. render) is"] + #[doc = "unspecified. Clients must not rely on the compositor sending a"] + #[doc = "particular node type. Clients cannot check two devices for equality by"] + #[doc = "comparing the dev_t value."] + #[doc = ""] + #[doc = "This event is tied to a preference tranche, see the tranche_done event."] + async fn tranche_target_device(&self, device: Vec) -> crate::client::Result<()>; + #[doc = "This event advertises the format + modifier combinations that the"] + #[doc = "compositor supports."] + #[doc = ""] + #[doc = "It carries an array of indices, each referring to a format + modifier"] + #[doc = "pair in the last received format table (see the format_table event)."] + #[doc = "Each index is a 16-bit unsigned integer in native endianness."] + #[doc = ""] + #[doc = "For legacy support, DRM_FORMAT_MOD_INVALID is an allowed modifier."] + #[doc = "It indicates that the server can support the format with an implicit"] + #[doc = "modifier. When a buffer has DRM_FORMAT_MOD_INVALID as its modifier, it"] + #[doc = "is as if no explicit modifier is specified. The effective modifier"] + #[doc = "will be derived from the dmabuf."] + #[doc = ""] + #[doc = "A compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for"] + #[doc = "a given format supports both explicit modifiers and implicit modifiers."] + #[doc = ""] + #[doc = "Compositors must not send duplicate format + modifier pairs within the"] + #[doc = "same tranche or across two different tranches with the same target"] + #[doc = "device and flags."] + #[doc = ""] + #[doc = "This event is tied to a preference tranche, see the tranche_done event."] + #[doc = ""] + #[doc = "For the definition of the format and modifier codes, see the"] + #[doc = "wp_linux_buffer_params.create request."] + async fn tranche_formats(&self, indices: Vec) -> crate::client::Result<()>; + #[doc = "This event sets tranche-specific flags."] + #[doc = ""] + #[doc = "The scanout flag is a hint that direct scan-out may be attempted by the"] + #[doc = "compositor on the target device if the client appropriately allocates a"] + #[doc = "buffer. How to allocate a buffer that can be scanned out on the target"] + #[doc = "device is implementation-defined."] + #[doc = ""] + #[doc = "This event is tied to a preference tranche, see the tranche_done event."] + async fn tranche_flags(&self, flags: TrancheFlags) -> crate::client::Result<()>; } } } @@ -588,6 +757,35 @@ pub mod presentation_time { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event tells the client in which clock domain the"] + #[doc = "compositor interprets the timestamps used by the presentation"] + #[doc = "extension. This clock is called the presentation clock."] + #[doc = ""] + #[doc = "The compositor sends this event when the client binds to the"] + #[doc = "presentation interface. The presentation clock does not change"] + #[doc = "during the lifetime of the client connection."] + #[doc = ""] + #[doc = "The clock identifier is platform dependent. On POSIX platforms, the"] + #[doc = "identifier value is one of the clockid_t values accepted by"] + #[doc = "clock_gettime(). clock_gettime() is defined by POSIX.1-2001."] + #[doc = ""] + #[doc = "Timestamps in this clock domain are expressed as tv_sec_hi,"] + #[doc = "tv_sec_lo, tv_nsec triples, each component being an unsigned"] + #[doc = "32-bit value. Whole seconds are in tv_sec which is a 64-bit"] + #[doc = "value combined from tv_sec_hi and tv_sec_lo, and the"] + #[doc = "additional fractional part in tv_nsec as nanoseconds. Hence,"] + #[doc = "for valid timestamps tv_nsec must be in [0, 999999999]."] + #[doc = ""] + #[doc = "Note that clock_id applies only to the presentation clock,"] + #[doc = "and implies nothing about e.g. the timestamps used in the"] + #[doc = "Wayland core protocol input events."] + #[doc = ""] + #[doc = "Compositors should prefer a clock which does not jump and is"] + #[doc = "not slewed e.g. by NTP. The absolute value of the clock is"] + #[doc = "irrelevant. Precision of one millisecond or better is"] + #[doc = "recommended. Clients must be able to query the current clock"] + #[doc = "value directly, not by asking the compositor."] + async fn clock_id(&self, clk_id: u32) -> crate::client::Result<()>; } } #[doc = "A presentation_feedback object returns an indication that a"] @@ -623,6 +821,72 @@ pub mod presentation_time { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "As presentation can be synchronized to only one output at a"] + #[doc = "time, this event tells which output it was. This event is only"] + #[doc = "sent prior to the presented event."] + #[doc = ""] + #[doc = "As clients may bind to the same global wl_output multiple"] + #[doc = "times, this event is sent for each bound instance that matches"] + #[doc = "the synchronized output. If a client has not bound to the"] + #[doc = "right wl_output global at all, this event is not sent."] + async fn sync_output(&self, output: crate::wire::ObjectId) + -> crate::client::Result<()>; + #[doc = "The associated content update was displayed to the user at the"] + #[doc = "indicated time (tv_sec_hi/lo, tv_nsec). For the interpretation of"] + #[doc = "the timestamp, see presentation.clock_id event."] + #[doc = ""] + #[doc = "The timestamp corresponds to the time when the content update"] + #[doc = "turned into light the first time on the surface's main output."] + #[doc = "Compositors may approximate this from the framebuffer flip"] + #[doc = "completion events from the system, and the latency of the"] + #[doc = "physical display path if known."] + #[doc = ""] + #[doc = "This event is preceded by all related sync_output events"] + #[doc = "telling which output's refresh cycle the feedback corresponds"] + #[doc = "to, i.e. the main output for the surface. Compositors are"] + #[doc = "recommended to choose the output containing the largest part"] + #[doc = "of the wl_surface, or keeping the output they previously"] + #[doc = "chose. Having a stable presentation output association helps"] + #[doc = "clients predict future output refreshes (vblank)."] + #[doc = ""] + #[doc = "The 'refresh' argument gives the compositor's prediction of how"] + #[doc = "many nanoseconds after tv_sec, tv_nsec the very next output"] + #[doc = "refresh may occur. This is to further aid clients in"] + #[doc = "predicting future refreshes, i.e., estimating the timestamps"] + #[doc = "targeting the next few vblanks. If such prediction cannot"] + #[doc = "usefully be done, the argument is zero."] + #[doc = ""] + #[doc = "For version 2 and later, if the output does not have a constant"] + #[doc = "refresh rate, explicit video mode switches excluded, then the"] + #[doc = "refresh argument must be either an appropriate rate picked by the"] + #[doc = "compositor (e.g. fastest rate), or 0 if no such rate exists."] + #[doc = "For version 1, if the output does not have a constant refresh rate,"] + #[doc = "the refresh argument must be zero."] + #[doc = ""] + #[doc = "The 64-bit value combined from seq_hi and seq_lo is the value"] + #[doc = "of the output's vertical retrace counter when the content"] + #[doc = "update was first scanned out to the display. This value must"] + #[doc = "be compatible with the definition of MSC in"] + #[doc = "GLX_OML_sync_control specification. Note, that if the display"] + #[doc = "path has a non-zero latency, the time instant specified by"] + #[doc = "this counter may differ from the timestamp's."] + #[doc = ""] + #[doc = "If the output does not have a concept of vertical retrace or a"] + #[doc = "refresh cycle, or the output device is self-refreshing without"] + #[doc = "a way to query the refresh count, then the arguments seq_hi"] + #[doc = "and seq_lo must be zero."] + async fn presented( + &self, + tv_sec_hi: u32, + tv_sec_lo: u32, + tv_nsec: u32, + refresh: u32, + seq_hi: u32, + seq_lo: u32, + flags: Kind, + ) -> crate::client::Result<()>; + #[doc = "The content update was never displayed to the user."] + async fn discarded(&self) -> crate::client::Result<()>; } } } @@ -791,6 +1055,27 @@ pub mod tablet_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent whenever a new tablet becomes available on this"] + #[doc = "seat. This event only provides the object id of the tablet, any"] + #[doc = "static information about the tablet (device name, vid/pid, etc.) is"] + #[doc = "sent through the wp_tablet interface."] + async fn tablet_added(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event is sent whenever a tool that has not previously been used"] + #[doc = "with a tablet comes into use. This event only provides the object id"] + #[doc = "of the tool; any static information about the tool (capabilities,"] + #[doc = "type, etc.) is sent through the wp_tablet_tool interface."] + async fn tool_added(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event is sent whenever a new pad is known to the system. Typically,"] + #[doc = "pads are physically attached to tablets and a pad_added event is"] + #[doc = "sent immediately after the wp_tablet_seat.tablet_added."] + #[doc = "However, some standalone pad devices logically attach to tablets at"] + #[doc = "runtime, and the client must wait for wp_tablet_pad.enter to know"] + #[doc = "the tablet a pad is attached to."] + #[doc = ""] + #[doc = "This event only provides the object id of the pad. All further"] + #[doc = "features (buttons, strips, rings) are sent through the wp_tablet_pad"] + #[doc = "interface."] + async fn pad_added(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; } } #[doc = "An object that represents a physical tool that has been, or is"] @@ -1010,6 +1295,203 @@ pub mod tablet_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The tool type is the high-level type of the tool and usually decides"] + #[doc = "the interaction expected from this tool."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn r#type(&self, tool_type: Type) -> crate::client::Result<()>; + #[doc = "If the physical tool can be identified by a unique 64-bit serial"] + #[doc = "number, this event notifies the client of this serial number."] + #[doc = ""] + #[doc = "If multiple tablets are available in the same seat and the tool is"] + #[doc = "uniquely identifiable by the serial number, that tool may move"] + #[doc = "between tablets."] + #[doc = ""] + #[doc = "Otherwise, if the tool has no serial number and this event is"] + #[doc = "missing, the tool is tied to the tablet it first comes into"] + #[doc = "proximity with. Even if the physical tool is used on multiple"] + #[doc = "tablets, separate wp_tablet_tool objects will be created, one per"] + #[doc = "tablet."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn hardware_serial( + &self, + hardware_serial_hi: u32, + hardware_serial_lo: u32, + ) -> crate::client::Result<()>; + #[doc = "This event notifies the client of a hardware id available on this tool."] + #[doc = ""] + #[doc = "The hardware id is a device-specific 64-bit id that provides extra"] + #[doc = "information about the tool in use, beyond the wl_tool.type"] + #[doc = "enumeration. The format of the id is specific to tablets made by"] + #[doc = "Wacom Inc. For example, the hardware id of a Wacom Grip"] + #[doc = "Pen (a stylus) is 0x802."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn hardware_id_wacom( + &self, + hardware_id_hi: u32, + hardware_id_lo: u32, + ) -> crate::client::Result<()>; + #[doc = "This event notifies the client of any capabilities of this tool,"] + #[doc = "beyond the main set of x/y axes and tip up/down detection."] + #[doc = ""] + #[doc = "One event is sent for each extra capability available on this tool."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn capability(&self, capability: Capability) -> crate::client::Result<()>; + #[doc = "This event signals the end of the initial burst of descriptive"] + #[doc = "events. A client may consider the static description of the tool to"] + #[doc = "be complete and finalize initialization of the tool."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event is sent when the tool is removed from the system and will"] + #[doc = "send no further events. Should the physical tool come back into"] + #[doc = "proximity later, a new wp_tablet_tool object will be created."] + #[doc = ""] + #[doc = "It is compositor-dependent when a tool is removed. A compositor may"] + #[doc = "remove a tool on proximity out, tablet removal or any other reason."] + #[doc = "A compositor may also keep a tool alive until shutdown."] + #[doc = ""] + #[doc = "If the tool is currently in proximity, a proximity_out event will be"] + #[doc = "sent before the removed event. See wp_tablet_tool.proximity_out for"] + #[doc = "the handling of any buttons logically down."] + #[doc = ""] + #[doc = "When this event is received, the client must wp_tablet_tool.destroy"] + #[doc = "the object."] + async fn removed(&self) -> crate::client::Result<()>; + #[doc = "Notification that this tool is focused on a certain surface."] + #[doc = ""] + #[doc = "This event can be received when the tool has moved from one surface to"] + #[doc = "another, or when the tool has come back into proximity above the"] + #[doc = "surface."] + #[doc = ""] + #[doc = "If any button is logically down when the tool comes into proximity,"] + #[doc = "the respective button event is sent after the proximity_in event but"] + #[doc = "within the same frame as the proximity_in event."] + async fn proximity_in( + &self, + serial: u32, + tablet: crate::wire::ObjectId, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "Notification that this tool has either left proximity, or is no"] + #[doc = "longer focused on a certain surface."] + #[doc = ""] + #[doc = "When the tablet tool leaves proximity of the tablet, button release"] + #[doc = "events are sent for each button that was held down at the time of"] + #[doc = "leaving proximity. These events are sent before the proximity_out"] + #[doc = "event but within the same wp_tablet.frame."] + #[doc = ""] + #[doc = "If the tool stays within proximity of the tablet, but the focus"] + #[doc = "changes from one surface to another, a button release event may not"] + #[doc = "be sent until the button is actually released or the tool leaves the"] + #[doc = "proximity of the tablet."] + async fn proximity_out(&self) -> crate::client::Result<()>; + #[doc = "Sent whenever the tablet tool comes in contact with the surface of the"] + #[doc = "tablet."] + #[doc = ""] + #[doc = "If the tool is already in contact with the tablet when entering the"] + #[doc = "input region, the client owning said region will receive a"] + #[doc = "wp_tablet.proximity_in event, followed by a wp_tablet.down"] + #[doc = "event and a wp_tablet.frame event."] + #[doc = ""] + #[doc = "Note that this event describes logical contact, not physical"] + #[doc = "contact. On some devices, a compositor may not consider a tool in"] + #[doc = "logical contact until a minimum physical pressure threshold is"] + #[doc = "exceeded."] + async fn down(&self, serial: u32) -> crate::client::Result<()>; + #[doc = "Sent whenever the tablet tool stops making contact with the surface of"] + #[doc = "the tablet, or when the tablet tool moves out of the input region"] + #[doc = "and the compositor grab (if any) is dismissed."] + #[doc = ""] + #[doc = "If the tablet tool moves out of the input region while in contact"] + #[doc = "with the surface of the tablet and the compositor does not have an"] + #[doc = "ongoing grab on the surface, the client owning said region will"] + #[doc = "receive a wp_tablet.up event, followed by a wp_tablet.proximity_out"] + #[doc = "event and a wp_tablet.frame event. If the compositor has an ongoing"] + #[doc = "grab on this device, this event sequence is sent whenever the grab"] + #[doc = "is dismissed in the future."] + #[doc = ""] + #[doc = "Note that this event describes logical contact, not physical"] + #[doc = "contact. On some devices, a compositor may not consider a tool out"] + #[doc = "of logical contact until physical pressure falls below a specific"] + #[doc = "threshold."] + async fn up(&self) -> crate::client::Result<()>; + #[doc = "Sent whenever a tablet tool moves."] + async fn motion( + &self, + x: crate::wire::Fixed, + y: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "Sent whenever the pressure axis on a tool changes. The value of this"] + #[doc = "event is normalized to a value between 0 and 65535."] + #[doc = ""] + #[doc = "Note that pressure may be nonzero even when a tool is not in logical"] + #[doc = "contact. See the down and up events for more details."] + async fn pressure(&self, pressure: u32) -> crate::client::Result<()>; + #[doc = "Sent whenever the distance axis on a tool changes. The value of this"] + #[doc = "event is normalized to a value between 0 and 65535."] + #[doc = ""] + #[doc = "Note that distance may be nonzero even when a tool is not in logical"] + #[doc = "contact. See the down and up events for more details."] + async fn distance(&self, distance: u32) -> crate::client::Result<()>; + #[doc = "Sent whenever one or both of the tilt axes on a tool change. Each tilt"] + #[doc = "value is in degrees, relative to the z-axis of the tablet."] + #[doc = "The angle is positive when the top of a tool tilts along the"] + #[doc = "positive x or y axis."] + async fn tilt( + &self, + tilt_x: crate::wire::Fixed, + tilt_y: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "Sent whenever the z-rotation axis on the tool changes. The"] + #[doc = "rotation value is in degrees clockwise from the tool's"] + #[doc = "logical neutral position."] + async fn rotation(&self, degrees: crate::wire::Fixed) -> crate::client::Result<()>; + #[doc = "Sent whenever the slider position on the tool changes. The"] + #[doc = "value is normalized between -65535 and 65535, with 0 as the logical"] + #[doc = "neutral position of the slider."] + #[doc = ""] + #[doc = "The slider is available on e.g. the Wacom Airbrush tool."] + async fn slider(&self, position: i32) -> crate::client::Result<()>; + #[doc = "Sent whenever the wheel on the tool emits an event. This event"] + #[doc = "contains two values for the same axis change. The degrees value is"] + #[doc = "in the same orientation as the wl_pointer.vertical_scroll axis. The"] + #[doc = "clicks value is in discrete logical clicks of the mouse wheel. This"] + #[doc = "value may be zero if the movement of the wheel was less"] + #[doc = "than one logical click."] + #[doc = ""] + #[doc = "Clients should choose either value and avoid mixing degrees and"] + #[doc = "clicks. The compositor may accumulate values smaller than a logical"] + #[doc = "click and emulate click events when a certain threshold is met."] + #[doc = "Thus, wl_tablet_tool.wheel events with non-zero clicks values may"] + #[doc = "have different degrees values."] + async fn wheel( + &self, + degrees: crate::wire::Fixed, + clicks: i32, + ) -> crate::client::Result<()>; + #[doc = "Sent whenever a button on the tool is pressed or released."] + #[doc = ""] + #[doc = "If a button is held down when the tool moves in or out of proximity,"] + #[doc = "button events are generated by the compositor. See"] + #[doc = "wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for"] + #[doc = "details."] + async fn button( + &self, + serial: u32, + button: u32, + state: ButtonState, + ) -> crate::client::Result<()>; + #[doc = "Marks the end of a series of axis and/or button updates from the"] + #[doc = "tablet. The Wayland protocol requires axis updates to be sent"] + #[doc = "sequentially, however all events within a frame should be considered"] + #[doc = "one hardware event."] + async fn frame(&self, time: u32) -> crate::client::Result<()>; } } #[doc = "The wp_tablet interface represents one graphics tablet device. The"] @@ -1049,6 +1531,47 @@ pub mod tablet_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "A descriptive name for the tablet device."] + #[doc = ""] + #[doc = "If the device has no descriptive name, this event is not sent."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet.done event."] + async fn name(&self, name: String) -> crate::client::Result<()>; + #[doc = "The USB vendor and product IDs for the tablet device."] + #[doc = ""] + #[doc = "If the device has no USB vendor/product ID, this event is not sent."] + #[doc = "This can happen for virtual devices or non-USB devices, for instance."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet.done event."] + async fn id(&self, vid: u32, pid: u32) -> crate::client::Result<()>; + #[doc = "A system-specific device path that indicates which device is behind"] + #[doc = "this wp_tablet. This information may be used to gather additional"] + #[doc = "information about the device, e.g. through libwacom."] + #[doc = ""] + #[doc = "A device may have more than one device path. If so, multiple"] + #[doc = "wp_tablet.path events are sent. A device may be emulated and not"] + #[doc = "have a device path, and in that case this event will not be sent."] + #[doc = ""] + #[doc = "The format of the path is unspecified, it may be a device node, a"] + #[doc = "sysfs path, or some other identifier. It is up to the client to"] + #[doc = "identify the string provided."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet.done event."] + async fn path(&self, path: String) -> crate::client::Result<()>; + #[doc = "This event is sent immediately to signal the end of the initial"] + #[doc = "burst of descriptive events. A client may consider the static"] + #[doc = "description of the tablet to be complete and finalize initialization"] + #[doc = "of the tablet."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "Sent when the tablet has been removed from the system. When a tablet"] + #[doc = "is removed, some tools may be removed."] + #[doc = ""] + #[doc = "When this event is received, the client must wp_tablet.destroy"] + #[doc = "the object."] + async fn removed(&self) -> crate::client::Result<()>; } } #[doc = "A circular interaction area, such as the touch ring on the Wacom Intuos"] @@ -1141,6 +1664,49 @@ pub mod tablet_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Source information for ring events."] + #[doc = ""] + #[doc = "This event does not occur on its own. It is sent before a"] + #[doc = "wp_tablet_pad_ring.frame event and carries the source information"] + #[doc = "for all events within that frame."] + #[doc = ""] + #[doc = "The source specifies how this event was generated. If the source is"] + #[doc = "wp_tablet_pad_ring.source.finger, a wp_tablet_pad_ring.stop event"] + #[doc = "will be sent when the user lifts the finger off the device."] + #[doc = ""] + #[doc = "This event is optional. If the source is unknown for an interaction,"] + #[doc = "no event is sent."] + async fn source(&self, source: Source) -> crate::client::Result<()>; + #[doc = "Sent whenever the angle on a ring changes."] + #[doc = ""] + #[doc = "The angle is provided in degrees clockwise from the logical"] + #[doc = "north of the ring in the pad's current rotation."] + async fn angle(&self, degrees: crate::wire::Fixed) -> crate::client::Result<()>; + #[doc = "Stop notification for ring events."] + #[doc = ""] + #[doc = "For some wp_tablet_pad_ring.source types, a wp_tablet_pad_ring.stop"] + #[doc = "event is sent to notify a client that the interaction with the ring"] + #[doc = "has terminated. This enables the client to implement kinetic scrolling."] + #[doc = "See the wp_tablet_pad_ring.source documentation for information on"] + #[doc = "when this event may be generated."] + #[doc = ""] + #[doc = "Any wp_tablet_pad_ring.angle events with the same source after this"] + #[doc = "event should be considered as the start of a new interaction."] + async fn stop(&self) -> crate::client::Result<()>; + #[doc = "Indicates the end of a set of ring events that logically belong"] + #[doc = "together. A client is expected to accumulate the data in all events"] + #[doc = "within the frame before proceeding."] + #[doc = ""] + #[doc = "All wp_tablet_pad_ring events before a wp_tablet_pad_ring.frame event belong"] + #[doc = "logically together. For example, on termination of a finger interaction"] + #[doc = "on a ring the compositor will send a wp_tablet_pad_ring.source event,"] + #[doc = "a wp_tablet_pad_ring.stop event and a wp_tablet_pad_ring.frame event."] + #[doc = ""] + #[doc = "A wp_tablet_pad_ring.frame event is sent for every logical event"] + #[doc = "group, even if the group only contains a single wp_tablet_pad_ring"] + #[doc = "event. Specifically, a client may get a sequence: angle, frame,"] + #[doc = "angle, frame, etc."] + async fn frame(&self, time: u32) -> crate::client::Result<()>; } } #[doc = "A linear interaction area, such as the strips found in Wacom Cintiq"] @@ -1233,6 +1799,51 @@ pub mod tablet_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Source information for strip events."] + #[doc = ""] + #[doc = "This event does not occur on its own. It is sent before a"] + #[doc = "wp_tablet_pad_strip.frame event and carries the source information"] + #[doc = "for all events within that frame."] + #[doc = ""] + #[doc = "The source specifies how this event was generated. If the source is"] + #[doc = "wp_tablet_pad_strip.source.finger, a wp_tablet_pad_strip.stop event"] + #[doc = "will be sent when the user lifts their finger off the device."] + #[doc = ""] + #[doc = "This event is optional. If the source is unknown for an interaction,"] + #[doc = "no event is sent."] + async fn source(&self, source: Source) -> crate::client::Result<()>; + #[doc = "Sent whenever the position on a strip changes."] + #[doc = ""] + #[doc = "The position is normalized to a range of [0, 65535], the 0-value"] + #[doc = "represents the top-most and/or left-most position of the strip in"] + #[doc = "the pad's current rotation."] + async fn position(&self, position: u32) -> crate::client::Result<()>; + #[doc = "Stop notification for strip events."] + #[doc = ""] + #[doc = "For some wp_tablet_pad_strip.source types, a wp_tablet_pad_strip.stop"] + #[doc = "event is sent to notify a client that the interaction with the strip"] + #[doc = "has terminated. This enables the client to implement kinetic"] + #[doc = "scrolling. See the wp_tablet_pad_strip.source documentation for"] + #[doc = "information on when this event may be generated."] + #[doc = ""] + #[doc = "Any wp_tablet_pad_strip.position events with the same source after this"] + #[doc = "event should be considered as the start of a new interaction."] + async fn stop(&self) -> crate::client::Result<()>; + #[doc = "Indicates the end of a set of events that represent one logical"] + #[doc = "hardware strip event. A client is expected to accumulate the data"] + #[doc = "in all events within the frame before proceeding."] + #[doc = ""] + #[doc = "All wp_tablet_pad_strip events before a wp_tablet_pad_strip.frame event belong"] + #[doc = "logically together. For example, on termination of a finger interaction"] + #[doc = "on a strip the compositor will send a wp_tablet_pad_strip.source event,"] + #[doc = "a wp_tablet_pad_strip.stop event and a wp_tablet_pad_strip.frame"] + #[doc = "event."] + #[doc = ""] + #[doc = "A wp_tablet_pad_strip.frame event is sent for every logical event"] + #[doc = "group, even if the group only contains a single wp_tablet_pad_strip"] + #[doc = "event. Specifically, a client may get a sequence: position, frame,"] + #[doc = "position, frame, etc."] + async fn frame(&self, time: u32) -> crate::client::Result<()>; } } #[doc = "A pad group describes a distinct (sub)set of buttons, rings and strips"] @@ -1286,6 +1897,82 @@ pub mod tablet_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent on wp_tablet_pad_group initialization to announce the available"] + #[doc = "buttons in the group. Button indices start at 0, a button may only be"] + #[doc = "in one group at a time."] + #[doc = ""] + #[doc = "This event is first sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad_group.done event."] + #[doc = ""] + #[doc = "Some buttons are reserved by the compositor. These buttons may not be"] + #[doc = "assigned to any wp_tablet_pad_group. Compositors may broadcast this"] + #[doc = "event in the case of changes to the mapping of these reserved buttons."] + #[doc = "If the compositor happens to reserve all buttons in a group, this event"] + #[doc = "will be sent with an empty array."] + async fn buttons(&self, buttons: Vec) -> crate::client::Result<()>; + #[doc = "Sent on wp_tablet_pad_group initialization to announce available rings."] + #[doc = "One event is sent for each ring available on this pad group."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad_group.done event."] + async fn ring(&self, ring: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "Sent on wp_tablet_pad initialization to announce available strips."] + #[doc = "One event is sent for each strip available on this pad group."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad_group.done event."] + async fn strip(&self, strip: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "Sent on wp_tablet_pad_group initialization to announce that the pad"] + #[doc = "group may switch between modes. A client may use a mode to store a"] + #[doc = "specific configuration for buttons, rings and strips and use the"] + #[doc = "wl_tablet_pad_group.mode_switch event to toggle between these"] + #[doc = "configurations. Mode indices start at 0."] + #[doc = ""] + #[doc = "Switching modes is compositor-dependent. See the"] + #[doc = "wp_tablet_pad_group.mode_switch event for more details."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad_group.done event. This event is only sent when more than"] + #[doc = "more than one mode is available."] + async fn modes(&self, modes: u32) -> crate::client::Result<()>; + #[doc = "This event is sent immediately to signal the end of the initial"] + #[doc = "burst of descriptive events. A client may consider the static"] + #[doc = "description of the tablet to be complete and finalize initialization"] + #[doc = "of the tablet group."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "Notification that the mode was switched."] + #[doc = ""] + #[doc = "A mode applies to all buttons, rings and strips in a group"] + #[doc = "simultaneously, but a client is not required to assign different actions"] + #[doc = "for each mode. For example, a client may have mode-specific button"] + #[doc = "mappings but map the ring to vertical scrolling in all modes. Mode"] + #[doc = "indices start at 0."] + #[doc = ""] + #[doc = "Switching modes is compositor-dependent. The compositor may provide"] + #[doc = "visual cues to the user about the mode, e.g. by toggling LEDs on"] + #[doc = "the tablet device. Mode-switching may be software-controlled or"] + #[doc = "controlled by one or more physical buttons. For example, on a Wacom"] + #[doc = "Intuos Pro, the button inside the ring may be assigned to switch"] + #[doc = "between modes."] + #[doc = ""] + #[doc = "The compositor will also send this event after wp_tablet_pad.enter on"] + #[doc = "each group in order to notify of the current mode. Groups that only"] + #[doc = "feature one mode will use mode=0 when emitting this event."] + #[doc = ""] + #[doc = "If a button action in the new mode differs from the action in the"] + #[doc = "previous mode, the client should immediately issue a"] + #[doc = "wp_tablet_pad.set_feedback request for each changed button."] + #[doc = ""] + #[doc = "If a ring or strip action in the new mode differs from the action"] + #[doc = "in the previous mode, the client should immediately issue a"] + #[doc = "wp_tablet_ring.set_feedback or wp_tablet_strip.set_feedback request"] + #[doc = "for each changed ring or strip."] + async fn mode_switch( + &self, + time: u32, + serial: u32, + mode: u32, + ) -> crate::client::Result<()>; } } #[doc = "A pad device is a set of buttons, rings and strips"] @@ -1404,6 +2091,62 @@ pub mod tablet_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent on wp_tablet_pad initialization to announce available groups."] + #[doc = "One event is sent for each pad group available."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad.done event. At least one group will be announced."] + async fn group(&self, pad_group: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "A system-specific device path that indicates which device is behind"] + #[doc = "this wp_tablet_pad. This information may be used to gather additional"] + #[doc = "information about the device, e.g. through libwacom."] + #[doc = ""] + #[doc = "The format of the path is unspecified, it may be a device node, a"] + #[doc = "sysfs path, or some other identifier. It is up to the client to"] + #[doc = "identify the string provided."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad.done event."] + async fn path(&self, path: String) -> crate::client::Result<()>; + #[doc = "Sent on wp_tablet_pad initialization to announce the available"] + #[doc = "buttons."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad.done event. This event is only sent when at least one"] + #[doc = "button is available."] + async fn buttons(&self, buttons: u32) -> crate::client::Result<()>; + #[doc = "This event signals the end of the initial burst of descriptive"] + #[doc = "events. A client may consider the static description of the pad to"] + #[doc = "be complete and finalize initialization of the pad."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "Sent whenever the physical state of a button changes."] + async fn button( + &self, + time: u32, + button: u32, + state: ButtonState, + ) -> crate::client::Result<()>; + #[doc = "Notification that this pad is focused on the specified surface."] + async fn enter( + &self, + serial: u32, + tablet: crate::wire::ObjectId, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "Notification that this pad is no longer focused on the specified"] + #[doc = "surface."] + async fn leave( + &self, + serial: u32, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "Sent when the pad has been removed from the system. When a tablet"] + #[doc = "is removed its pad(s) will be removed too."] + #[doc = ""] + #[doc = "When this event is received, the client must destroy all rings, strips"] + #[doc = "and groups that were offered by this pad, and issue wp_tablet_pad.destroy"] + #[doc = "the pad itself."] + async fn removed(&self) -> crate::client::Result<()>; } } } @@ -1793,6 +2536,20 @@ pub mod xdg_shell { .await .map_err(crate::client::Error::IoError) } + #[doc = "The ping event asks the client if it's still alive. Pass the"] + #[doc = "serial specified in the event back to the compositor by sending"] + #[doc = "a \"pong\" request back with the specified serial. See xdg_wm_base.pong."] + #[doc = ""] + #[doc = "Compositors can use this to determine if the client is still"] + #[doc = "alive. It's unspecified what will happen if the client doesn't"] + #[doc = "respond to the ping request, or in what timeframe. Clients should"] + #[doc = "try to respond in a reasonable amount of time. The “unresponsive”"] + #[doc = "error is provided for compositors that wish to disconnect unresponsive"] + #[doc = "clients."] + #[doc = ""] + #[doc = "A compositor is free to ping in any way it wants, but a client must"] + #[doc = "always respond to any xdg_wm_base object it created."] + async fn ping(&self, serial: u32) -> crate::client::Result<()>; } } #[doc = "The xdg_positioner provides a collection of rules for the placement of a"] @@ -2404,6 +3161,23 @@ pub mod xdg_shell { .await .map_err(crate::client::Error::IoError) } + #[doc = "The configure event marks the end of a configure sequence. A configure"] + #[doc = "sequence is a set of one or more events configuring the state of the"] + #[doc = "xdg_surface, including the final xdg_surface.configure event."] + #[doc = ""] + #[doc = "Where applicable, xdg_surface surface roles will during a configure"] + #[doc = "sequence extend this event as a latched state sent as events before the"] + #[doc = "xdg_surface.configure event. Such events should be considered to make up"] + #[doc = "a set of atomically applied configuration states, where the"] + #[doc = "xdg_surface.configure commits the accumulated state."] + #[doc = ""] + #[doc = "Clients should arrange their surface for the new states, and then send"] + #[doc = "an ack_configure request with the serial sent in this configure event at"] + #[doc = "some point before committing the new surface."] + #[doc = ""] + #[doc = "If the client receives multiple configure events before it can respond"] + #[doc = "to one, it is free to discard all but the last event it received."] + async fn configure(&self, serial: u32) -> crate::client::Result<()>; } } #[doc = "This interface defines an xdg_surface role which allows a surface to,"] @@ -3041,6 +3815,77 @@ pub mod xdg_shell { .await .map_err(crate::client::Error::IoError) } + #[doc = "This configure event asks the client to resize its toplevel surface or"] + #[doc = "to change its state. The configured state should not be applied"] + #[doc = "immediately. See xdg_surface.configure for details."] + #[doc = ""] + #[doc = "The width and height arguments specify a hint to the window"] + #[doc = "about how its surface should be resized in window geometry"] + #[doc = "coordinates. See set_window_geometry."] + #[doc = ""] + #[doc = "If the width or height arguments are zero, it means the client"] + #[doc = "should decide its own window dimension. This may happen when the"] + #[doc = "compositor needs to configure the state of the surface but doesn't"] + #[doc = "have any information about any previous or expected dimension."] + #[doc = ""] + #[doc = "The states listed in the event specify how the width/height"] + #[doc = "arguments should be interpreted, and possibly how it should be"] + #[doc = "drawn."] + #[doc = ""] + #[doc = "Clients must send an ack_configure in response to this event. See"] + #[doc = "xdg_surface.configure and xdg_surface.ack_configure for details."] + async fn configure( + &self, + width: i32, + height: i32, + states: Vec, + ) -> crate::client::Result<()>; + #[doc = "The close event is sent by the compositor when the user"] + #[doc = "wants the surface to be closed. This should be equivalent to"] + #[doc = "the user clicking the close button in client-side decorations,"] + #[doc = "if your application has any."] + #[doc = ""] + #[doc = "This is only a request that the user intends to close the"] + #[doc = "window. The client may choose to ignore this request, or show"] + #[doc = "a dialog to ask the user to save their data, etc."] + async fn close(&self) -> crate::client::Result<()>; + #[doc = "The configure_bounds event may be sent prior to a xdg_toplevel.configure"] + #[doc = "event to communicate the bounds a window geometry size is recommended"] + #[doc = "to constrain to."] + #[doc = ""] + #[doc = "The passed width and height are in surface coordinate space. If width"] + #[doc = "and height are 0, it means bounds is unknown and equivalent to as if no"] + #[doc = "configure_bounds event was ever sent for this surface."] + #[doc = ""] + #[doc = "The bounds can for example correspond to the size of a monitor excluding"] + #[doc = "any panels or other shell components, so that a surface isn't created in"] + #[doc = "a way that it cannot fit."] + #[doc = ""] + #[doc = "The bounds may change at any point, and in such a case, a new"] + #[doc = "xdg_toplevel.configure_bounds will be sent, followed by"] + #[doc = "xdg_toplevel.configure and xdg_surface.configure."] + async fn configure_bounds(&self, width: i32, height: i32) -> crate::client::Result<()>; + #[doc = "This event advertises the capabilities supported by the compositor. If"] + #[doc = "a capability isn't supported, clients should hide or disable the UI"] + #[doc = "elements that expose this functionality. For instance, if the"] + #[doc = "compositor doesn't advertise support for minimized toplevels, a button"] + #[doc = "triggering the set_minimized request should not be displayed."] + #[doc = ""] + #[doc = "The compositor will ignore requests it doesn't support. For instance,"] + #[doc = "a compositor which doesn't advertise support for minimized will ignore"] + #[doc = "set_minimized requests."] + #[doc = ""] + #[doc = "Compositors must send this event once before the first"] + #[doc = "xdg_surface.configure event. When the capabilities change, compositors"] + #[doc = "must send this event again and then send an xdg_surface.configure"] + #[doc = "event."] + #[doc = ""] + #[doc = "The configured state should not be applied immediately. See"] + #[doc = "xdg_surface.configure for details."] + #[doc = ""] + #[doc = "The capabilities are sent as an array of 32-bit unsigned integers in"] + #[doc = "native endianness."] + async fn wm_capabilities(&self, capabilities: Vec) -> crate::client::Result<()>; } } #[doc = "A popup surface is a short-lived, temporary surface. It can be used to"] @@ -3210,6 +4055,45 @@ pub mod xdg_shell { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event asks the popup surface to configure itself given the"] + #[doc = "configuration. The configured state should not be applied immediately."] + #[doc = "See xdg_surface.configure for details."] + #[doc = ""] + #[doc = "The x and y arguments represent the position the popup was placed at"] + #[doc = "given the xdg_positioner rule, relative to the upper left corner of the"] + #[doc = "window geometry of the parent surface."] + #[doc = ""] + #[doc = "For version 2 or older, the configure event for an xdg_popup is only"] + #[doc = "ever sent once for the initial configuration. Starting with version 3,"] + #[doc = "it may be sent again if the popup is setup with an xdg_positioner with"] + #[doc = "set_reactive requested, or in response to xdg_popup.reposition requests."] + async fn configure( + &self, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "The popup_done event is sent out when a popup is dismissed by the"] + #[doc = "compositor. The client should destroy the xdg_popup object at this"] + #[doc = "point."] + async fn popup_done(&self) -> crate::client::Result<()>; + #[doc = "The repositioned event is sent as part of a popup configuration"] + #[doc = "sequence, together with xdg_popup.configure and lastly"] + #[doc = "xdg_surface.configure to notify the completion of a reposition request."] + #[doc = ""] + #[doc = "The repositioned event is to notify about the completion of a"] + #[doc = "xdg_popup.reposition request. The token argument is the token passed"] + #[doc = "in the xdg_popup.reposition request."] + #[doc = ""] + #[doc = "Immediately after this event is emitted, xdg_popup.configure and"] + #[doc = "xdg_surface.configure will be sent with the updated size and position,"] + #[doc = "as well as a new configure serial."] + #[doc = ""] + #[doc = "The client should optionally update the content of the popup, but must"] + #[doc = "acknowledge the new popup configuration for the new position to take"] + #[doc = "effect. See xdg_surface.ack_configure for details."] + async fn repositioned(&self, token: u32) -> crate::client::Result<()>; } } } diff --git a/src/client/protocol/staging.rs b/src/client/protocol/staging.rs index 7187952..e4cbab5 100644 --- a/src/client/protocol/staging.rs +++ b/src/client/protocol/staging.rs @@ -892,6 +892,39 @@ pub mod drm_lease_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The compositor will send this event when the wp_drm_lease_device_v1"] + #[doc = "global is bound, although there are no guarantees as to how long this"] + #[doc = "takes - the compositor might need to wait until regaining DRM master."] + #[doc = "The included fd is a non-master DRM file descriptor opened for this"] + #[doc = "device and the compositor must not authenticate it."] + #[doc = "The purpose of this event is to give the client the ability to"] + #[doc = "query DRM and discover information which may help them pick the"] + #[doc = "appropriate DRM device or select the appropriate connectors therein."] + async fn drm_fd(&self, fd: rustix::fd::OwnedFd) -> crate::client::Result<()>; + #[doc = "The compositor will use this event to advertise connectors available for"] + #[doc = "lease by clients. This object may be passed into a lease request to"] + #[doc = "indicate the client would like to lease that connector, see"] + #[doc = "wp_drm_lease_request_v1.request_connector for details. While the"] + #[doc = "compositor will make a best effort to not send disconnected connectors,"] + #[doc = "no guarantees can be made."] + #[doc = ""] + #[doc = "The compositor must send the drm_fd event before sending connectors."] + #[doc = "After the drm_fd event it will send all available connectors but may"] + #[doc = "send additional connectors at any time."] + async fn connector(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "The compositor will send this event to indicate that it has sent all"] + #[doc = "currently available connectors after the client binds to the global or"] + #[doc = "when it updates the connector list, for example on hotplug, drm master"] + #[doc = "change or when a leased connector becomes available again. It will"] + #[doc = "similarly send this event to group wp_drm_lease_connector_v1.withdrawn"] + #[doc = "events of connectors of this device."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event is sent in response to the release request and indicates"] + #[doc = "that the compositor is done sending connector events."] + #[doc = "The compositor will destroy this object immediately after sending the"] + #[doc = "event and it will become invalid. The client should release any"] + #[doc = "resources associated with this device after receiving this event."] + async fn released(&self) -> crate::client::Result<()>; } } #[doc = "Represents a DRM connector which is available for lease. These objects are"] @@ -934,6 +967,41 @@ pub mod drm_lease_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The compositor sends this event once the connector is created to"] + #[doc = "indicate the name of this connector. This will not change for the"] + #[doc = "duration of the Wayland session, but is not guaranteed to be consistent"] + #[doc = "between sessions."] + #[doc = ""] + #[doc = "If the compositor supports wl_output version 4 and this connector"] + #[doc = "corresponds to a wl_output, the compositor should use the same name as"] + #[doc = "for the wl_output."] + async fn name(&self, name: String) -> crate::client::Result<()>; + #[doc = "The compositor sends this event once the connector is created to provide"] + #[doc = "a human-readable description for this connector, which may be presented"] + #[doc = "to the user. The compositor may send this event multiple times over the"] + #[doc = "lifetime of this object to reflect changes in the description."] + async fn description(&self, description: String) -> crate::client::Result<()>; + #[doc = "The compositor sends this event once the connector is created to"] + #[doc = "indicate the DRM object ID which represents the underlying connector"] + #[doc = "that is being offered. Note that the final lease may include additional"] + #[doc = "object IDs, such as CRTCs and planes."] + async fn connector_id(&self, connector_id: u32) -> crate::client::Result<()>; + #[doc = "This event is sent after all properties of a connector have been sent."] + #[doc = "This allows changes to the properties to be seen as atomic even if they"] + #[doc = "happen via multiple events."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "Sent to indicate that the compositor will no longer honor requests for"] + #[doc = "DRM leases which include this connector. The client may still issue a"] + #[doc = "lease request including this connector, but the compositor will send"] + #[doc = "wp_drm_lease_v1.finished without issuing a lease fd. Compositors are"] + #[doc = "encouraged to send this event when they lose access to connector, for"] + #[doc = "example when the connector is hot-unplugged, when the connector gets"] + #[doc = "leased to a client or when the compositor loses DRM master."] + #[doc = ""] + #[doc = "If a client holds a lease for the connector, the status of the lease"] + #[doc = "remains the same. The client should destroy the object after receiving"] + #[doc = "this event."] + async fn withdrawn(&self) -> crate::client::Result<()>; } } #[doc = "A client that wishes to lease DRM resources will attach the list of"] @@ -1073,6 +1141,28 @@ pub mod drm_lease_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event returns a file descriptor suitable for use with DRM-related"] + #[doc = "ioctls. The client should use drmModeGetLease to enumerate the DRM"] + #[doc = "objects which have been leased to them. The compositor guarantees it"] + #[doc = "will not use the leased DRM objects itself until it sends the finished"] + #[doc = "event. If the compositor cannot or will not grant a lease for the"] + #[doc = "requested connectors, it will not send this event, instead sending the"] + #[doc = "finished event."] + #[doc = ""] + #[doc = "The compositor will send this event at most once during this objects"] + #[doc = "lifetime."] + async fn lease_fd(&self, leased_fd: rustix::fd::OwnedFd) -> crate::client::Result<()>; + #[doc = "The compositor uses this event to either reject a lease request, or if"] + #[doc = "it previously sent a lease_fd, to notify the client that the lease has"] + #[doc = "been revoked. If the client requires a new lease, they should destroy"] + #[doc = "this object and submit a new lease request. The compositor will send"] + #[doc = "no further events for this object after sending the finish event."] + #[doc = "Compositors should revoke the lease when any of the leased resources"] + #[doc = "become unavailable, namely when a hot-unplug occurs or when the"] + #[doc = "compositor loses DRM master. Compositors may advertise the connector"] + #[doc = "for leasing again, if the resource is available, by sending the"] + #[doc = "connector event through the wp_drm_lease_device_v1 interface."] + async fn finished(&self) -> crate::client::Result<()>; } } } @@ -1168,6 +1258,21 @@ pub mod ext_foreign_toplevel_list_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is emitted whenever a new toplevel window is created. It is"] + #[doc = "emitted for all toplevels, regardless of the app that has created them."] + #[doc = ""] + #[doc = "All initial properties of the toplevel (identifier, title, app_id) will be sent"] + #[doc = "immediately after this event using the corresponding events for"] + #[doc = "ext_foreign_toplevel_handle_v1. The compositor will use the"] + #[doc = "ext_foreign_toplevel_handle_v1.done event to indicate when all data has"] + #[doc = "been sent."] + async fn toplevel(&self, toplevel: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event indicates that the compositor is done sending events"] + #[doc = "to this object. The client should destroy the object."] + #[doc = "See ext_foreign_toplevel_list_v1.destroy for more information."] + #[doc = ""] + #[doc = "The compositor must not send any more toplevel events after this event."] + async fn finished(&self) -> crate::client::Result<()>; } } #[doc = "A ext_foreign_toplevel_handle_v1 object represents a mapped toplevel"] @@ -1213,6 +1318,55 @@ pub mod ext_foreign_toplevel_list_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The server will emit no further events on the ext_foreign_toplevel_handle_v1"] + #[doc = "after this event. Any requests received aside from the destroy request must"] + #[doc = "be ignored. Upon receiving this event, the client should destroy the handle."] + #[doc = ""] + #[doc = "Other protocols which extend the ext_foreign_toplevel_handle_v1"] + #[doc = "interface must also ignore requests other than destructors."] + async fn closed(&self) -> crate::client::Result<()>; + #[doc = "This event is sent after all changes in the toplevel state have"] + #[doc = "been sent."] + #[doc = ""] + #[doc = "This allows changes to the ext_foreign_toplevel_handle_v1 properties"] + #[doc = "to be atomically applied. Other protocols which extend the"] + #[doc = "ext_foreign_toplevel_handle_v1 interface may use this event to also"] + #[doc = "atomically apply any pending state."] + #[doc = ""] + #[doc = "This event must not be sent after the ext_foreign_toplevel_handle_v1.closed"] + #[doc = "event."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "The title of the toplevel has changed."] + #[doc = ""] + #[doc = "The configured state must not be applied immediately. See"] + #[doc = "ext_foreign_toplevel_handle_v1.done for details."] + async fn title(&self, title: String) -> crate::client::Result<()>; + #[doc = "The app id of the toplevel has changed."] + #[doc = ""] + #[doc = "The configured state must not be applied immediately. See"] + #[doc = "ext_foreign_toplevel_handle_v1.done for details."] + async fn app_id(&self, app_id: String) -> crate::client::Result<()>; + #[doc = "This identifier is used to check if two or more toplevel handles belong"] + #[doc = "to the same toplevel."] + #[doc = ""] + #[doc = "The identifier is useful for command line tools or privileged clients"] + #[doc = "which may need to reference an exact toplevel across processes or"] + #[doc = "instances of the ext_foreign_toplevel_list_v1 global."] + #[doc = ""] + #[doc = "The compositor must only send this event when the handle is created."] + #[doc = ""] + #[doc = "The identifier must be unique per toplevel and it's handles. Two different"] + #[doc = "toplevels must not have the same identifier. The identifier is only valid"] + #[doc = "as long as the toplevel is mapped. If the toplevel is unmapped the identifier"] + #[doc = "must not be reused. An identifier must not be reused by the compositor to"] + #[doc = "ensure there are no races when sharing identifiers between processes."] + #[doc = ""] + #[doc = "An identifier is a string that contains up to 32 printable ASCII bytes."] + #[doc = "An identifier must not be an empty string. It is recommended that a"] + #[doc = "compositor includes an opaque generation value in identifiers. How the"] + #[doc = "generation value is used when generating the identifier is implementation"] + #[doc = "dependent."] + async fn identifier(&self, identifier: String) -> crate::client::Result<()>; } } } @@ -1327,6 +1481,17 @@ pub mod ext_idle_notify_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent when the notification object becomes idle."] + #[doc = ""] + #[doc = "It's a compositor protocol error to send this event twice without a"] + #[doc = "resumed event in-between."] + async fn idled(&self) -> crate::client::Result<()>; + #[doc = "This event is sent when the notification object stops being idle."] + #[doc = ""] + #[doc = "It's a compositor protocol error to send this event twice without an"] + #[doc = "idled event in-between. It's a compositor protocol error to send this"] + #[doc = "event prior to any idled event."] + async fn resumed(&self) -> crate::client::Result<()>; } } } @@ -1720,6 +1885,52 @@ pub mod ext_image_copy_capture_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Provides the dimensions of the source image in buffer pixel coordinates."] + #[doc = ""] + #[doc = "The client must attach buffers that match this size."] + async fn buffer_size(&self, width: u32, height: u32) -> crate::client::Result<()>; + #[doc = "Provides the format that must be used for shared-memory buffers."] + #[doc = ""] + #[doc = "This event may be emitted multiple times, in which case the client may"] + #[doc = "choose any given format."] + async fn shm_format( + &self, + format: super::super::super::core::wayland::wl_shm::Format, + ) -> crate::client::Result<()>; + #[doc = "This event advertises the device buffers must be allocated on for"] + #[doc = "dma-buf buffers."] + #[doc = ""] + #[doc = "In general the device is a DRM node. The DRM node type (primary vs."] + #[doc = "render) is unspecified. Clients must not rely on the compositor sending"] + #[doc = "a particular node type. Clients cannot check two devices for equality"] + #[doc = "by comparing the dev_t value."] + async fn dmabuf_device(&self, device: Vec) -> crate::client::Result<()>; + #[doc = "Provides the format that must be used for dma-buf buffers."] + #[doc = ""] + #[doc = "The client may choose any of the modifiers advertised in the array of"] + #[doc = "64-bit unsigned integers."] + #[doc = ""] + #[doc = "This event may be emitted multiple times, in which case the client may"] + #[doc = "choose any given format."] + async fn dmabuf_format( + &self, + format: u32, + modifiers: Vec, + ) -> crate::client::Result<()>; + #[doc = "This event is sent once when all buffer constraint events have been"] + #[doc = "sent."] + #[doc = ""] + #[doc = "The compositor must always end a batch of buffer constraint events with"] + #[doc = "this event, regardless of whether it sends the initial constraints or"] + #[doc = "an update."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event indicates that the capture session has stopped and is no"] + #[doc = "longer available. This can happen in a number of cases, e.g. when the"] + #[doc = "underlying source is destroyed, if the user decides to end the image"] + #[doc = "capture, or if an unrecoverable runtime error has occurred."] + #[doc = ""] + #[doc = "The client should destroy the session after receiving this event."] + async fn stopped(&self) -> crate::client::Result<()>; } } #[doc = "This object represents an image capture frame."] @@ -1895,6 +2106,53 @@ pub mod ext_image_copy_capture_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent before the ready event and holds the transform that"] + #[doc = "the compositor has applied to the buffer contents."] + async fn transform( + &self, + transform: super::super::super::core::wayland::wl_output::Transform, + ) -> crate::client::Result<()>; + #[doc = "This event is sent before the ready event. It may be generated multiple"] + #[doc = "times to describe a region."] + #[doc = ""] + #[doc = "The first captured frame in a session will always carry full damage."] + #[doc = "Subsequent frames' damaged regions describe which parts of the buffer"] + #[doc = "have changed since the last ready event."] + #[doc = ""] + #[doc = "These coordinates originate in the upper left corner of the buffer."] + async fn damage( + &self, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "This event indicates the time at which the frame is presented to the"] + #[doc = "output in system monotonic time. This event is sent before the ready"] + #[doc = "event."] + #[doc = ""] + #[doc = "The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,"] + #[doc = "each component being an unsigned 32-bit value. Whole seconds are in"] + #[doc = "tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,"] + #[doc = "and the additional fractional part in tv_nsec as nanoseconds. Hence,"] + #[doc = "for valid timestamps tv_nsec must be in [0, 999999999]."] + async fn presentation_time( + &self, + tv_sec_hi: u32, + tv_sec_lo: u32, + tv_nsec: u32, + ) -> crate::client::Result<()>; + #[doc = "Called as soon as the frame is copied, indicating it is available"] + #[doc = "for reading."] + #[doc = ""] + #[doc = "The buffer may be re-used by the client after this event."] + #[doc = ""] + #[doc = "After receiving this event, the client must destroy the object."] + async fn ready(&self) -> crate::client::Result<()>; + #[doc = "This event indicates that the attempted frame copy has failed."] + #[doc = ""] + #[doc = "After receiving this event, the client must destroy the object."] + async fn failed(&self, reason: FailureReason) -> crate::client::Result<()>; } } #[doc = "This object represents a cursor capture session. It extends the base"] @@ -1976,6 +2234,37 @@ pub mod ext_image_copy_capture_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent when a cursor enters the captured area. It shall be generated"] + #[doc = "before the \"position\" and \"hotspot\" events when and only when a cursor"] + #[doc = "enters the area."] + #[doc = ""] + #[doc = "The cursor enters the captured area when the cursor image intersects"] + #[doc = "with the captured area. Note, this is different from e.g."] + #[doc = "wl_pointer.enter."] + async fn enter(&self) -> crate::client::Result<()>; + #[doc = "Sent when a cursor leaves the captured area. No \"position\" or \"hotspot\""] + #[doc = "event is generated for the cursor until the cursor enters the captured"] + #[doc = "area again."] + async fn leave(&self) -> crate::client::Result<()>; + #[doc = "Cursors outside the image capture source do not get captured and no"] + #[doc = "event will be generated for them."] + #[doc = ""] + #[doc = "The given position is the position of the cursor's hotspot and it is"] + #[doc = "relative to the main buffer's top left corner in transformed buffer"] + #[doc = "pixel coordinates. The coordinates may be negative or greater than the"] + #[doc = "main buffer size."] + async fn position(&self, x: i32, y: i32) -> crate::client::Result<()>; + #[doc = "The hotspot describes the offset between the cursor image and the"] + #[doc = "position of the input device."] + #[doc = ""] + #[doc = "The given coordinates are the hotspot's offset from the origin in"] + #[doc = "buffer coordinates."] + #[doc = ""] + #[doc = "Clients should not apply the hotspot immediately: the hotspot becomes"] + #[doc = "effective when the next ext_image_copy_capture_frame_v1.ready event is received."] + #[doc = ""] + #[doc = "Compositors may delay this event until the client captures a new frame."] + async fn hotspot(&self, x: i32, y: i32) -> crate::client::Result<()>; } } } @@ -2232,6 +2521,39 @@ pub mod ext_session_lock_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This client is now responsible for displaying graphics while the"] + #[doc = "session is locked and deciding when to unlock the session."] + #[doc = ""] + #[doc = "The locked event must not be sent until a new \"locked\" frame has been"] + #[doc = "presented on all outputs and no security sensitive normal/unlocked"] + #[doc = "content is possibly visible."] + #[doc = ""] + #[doc = "If this event is sent, making the destroy request is a protocol error,"] + #[doc = "the lock object must be destroyed using the unlock_and_destroy request."] + async fn locked(&self) -> crate::client::Result<()>; + #[doc = "The compositor has decided that the session lock should be destroyed"] + #[doc = "as it will no longer be used by the compositor. Exactly when this"] + #[doc = "event is sent is compositor policy, but it must never be sent more"] + #[doc = "than once for a given session lock object."] + #[doc = ""] + #[doc = "This might be sent because there is already another ext_session_lock_v1"] + #[doc = "object held by a client, or the compositor has decided to deny the"] + #[doc = "request to lock the session for some other reason. This might also"] + #[doc = "be sent because the compositor implements some alternative, secure"] + #[doc = "way to authenticate and unlock the session."] + #[doc = ""] + #[doc = "The finished event should be sent immediately on creation of this"] + #[doc = "object if the compositor decides that the locked event will not"] + #[doc = "be sent."] + #[doc = ""] + #[doc = "If the locked event is sent on creation of this object the finished"] + #[doc = "event may still be sent at some later time in this object's"] + #[doc = "lifetime. This is compositor policy."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should make either the destroy"] + #[doc = "request or the unlock_and_destroy request, depending on whether or"] + #[doc = "not the locked event was received on this object."] + async fn finished(&self) -> crate::client::Result<()>; } } #[doc = "The client may use lock surfaces to display a screensaver, render a"] @@ -2351,6 +2673,18 @@ pub mod ext_session_lock_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent once on binding the interface and may be sent again"] + #[doc = "at the compositor's discretion, for example if output geometry changes."] + #[doc = ""] + #[doc = "The width and height are in surface-local coordinates and are exact"] + #[doc = "requirements. Failing to match these surface dimensions in the next"] + #[doc = "commit after acking a configure is a protocol error."] + async fn configure( + &self, + serial: u32, + width: u32, + height: u32, + ) -> crate::client::Result<()>; } } } @@ -2461,6 +2795,21 @@ pub mod ext_transient_seat_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event advertises the global name for the wl_seat to be used with"] + #[doc = "wl_registry_bind."] + #[doc = ""] + #[doc = "It is sent exactly once, immediately after the transient seat is created"] + #[doc = "and the new \"wl_seat\" global is advertised, if and only if the creation"] + #[doc = "of the transient seat was allowed."] + async fn ready(&self, global_name: u32) -> crate::client::Result<()>; + #[doc = "The event informs the client that the compositor denied its request to"] + #[doc = "create a transient seat."] + #[doc = ""] + #[doc = "It is sent exactly once, immediately after the transient seat object is"] + #[doc = "created, if and only if the creation of the transient seat was denied."] + #[doc = ""] + #[doc = "After receiving this event, the client should destroy the object."] + async fn denied(&self) -> crate::client::Result<()>; } } } @@ -2793,6 +3142,11 @@ pub mod fractional_scale_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Notification of a new preferred scale for this surface that the"] + #[doc = "compositor suggests that the client should use."] + #[doc = ""] + #[doc = "The sent scale is the numerator of a fraction with a denominator of 120."] + async fn preferred_scale(&self, scale: u32) -> crate::client::Result<()>; } } } @@ -3966,6 +4320,9 @@ pub mod xdg_activation_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The 'done' event contains the unique token of this activation request"] + #[doc = "and notifies that the provider is done."] + async fn done(&self, token: String) -> crate::client::Result<()>; } } } @@ -4504,6 +4861,21 @@ pub mod xdg_toplevel_icon_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event indicates an icon size the compositor prefers to be"] + #[doc = "available if the client has scalable icons and can render to any size."] + #[doc = ""] + #[doc = "When the 'xdg_toplevel_icon_manager_v1' object is created, the"] + #[doc = "compositor may send one or more 'icon_size' events to describe the list"] + #[doc = "of preferred icon sizes. If the compositor has no size preference, it"] + #[doc = "may not send any 'icon_size' event, and it is up to the client to"] + #[doc = "decide a suitable icon size."] + #[doc = ""] + #[doc = "A sequence of 'icon_size' events must be finished with a 'done' event."] + #[doc = "If the compositor has no size preferences, it must still send the"] + #[doc = "'done' event, without any preceding 'icon_size' events."] + async fn icon_size(&self, size: i32) -> crate::client::Result<()>; + #[doc = "This event is sent after all 'icon_size' events have been sent."] + async fn done(&self) -> crate::client::Result<()>; } } #[doc = "This interface defines a toplevel icon."] diff --git a/src/client/protocol/unstable.rs b/src/client/protocol/unstable.rs index 37a500f..7fd197a 100644 --- a/src/client/protocol/unstable.rs +++ b/src/client/protocol/unstable.rs @@ -263,6 +263,15 @@ pub mod fullscreen_shell_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Advertises a single capability of the compositor."] + #[doc = ""] + #[doc = "When the wl_fullscreen_shell interface is bound, this event is emitted"] + #[doc = "once for each capability advertised. Valid capabilities are given by"] + #[doc = "the wl_fullscreen_shell.capability enum. If clients want to take"] + #[doc = "advantage of any of these capabilities, they should use a"] + #[doc = "wl_display.sync request immediately after binding to ensure that they"] + #[doc = "receive all the capability events."] + async fn capability(&self, capability: Capability) -> crate::client::Result<()>; } } #[allow(clippy::too_many_arguments)] @@ -280,6 +289,27 @@ pub mod fullscreen_shell_unstable_v1 { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "This event indicates that the attempted mode switch operation was"] + #[doc = "successful. A surface of the size requested in the mode switch"] + #[doc = "will fill the output without scaling."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy the"] + #[doc = "wl_fullscreen_shell_mode_feedback object."] + async fn mode_successful(&self) -> crate::client::Result<()>; + #[doc = "This event indicates that the attempted mode switch operation"] + #[doc = "failed. This may be because the requested output mode is not"] + #[doc = "possible or it may mean that the compositor does not want to allow it."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy the"] + #[doc = "wl_fullscreen_shell_mode_feedback object."] + async fn mode_failed(&self) -> crate::client::Result<()>; + #[doc = "This event indicates that the attempted mode switch operation was"] + #[doc = "cancelled. Most likely this is because the client requested a"] + #[doc = "second mode switch before the first one completed."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy the"] + #[doc = "wl_fullscreen_shell_mode_feedback object."] + async fn present_cancelled(&self) -> crate::client::Result<()>; } } } @@ -764,6 +794,22 @@ pub mod input_method_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The plain surrounding text around the input position. Cursor is the"] + #[doc = "position in bytes within the surrounding text relative to the beginning"] + #[doc = "of the text. Anchor is the position in bytes of the selection anchor"] + #[doc = "within the surrounding text relative to the beginning of the text. If"] + #[doc = "there is no selected text then anchor is the same as cursor."] + async fn surrounding_text( + &self, + text: String, + cursor: u32, + anchor: u32, + ) -> crate::client::Result<()>; + async fn reset(&self) -> crate::client::Result<()>; + async fn content_type(&self, hint: u32, purpose: u32) -> crate::client::Result<()>; + async fn invoke_action(&self, button: u32, index: u32) -> crate::client::Result<()>; + async fn commit_state(&self, serial: u32) -> crate::client::Result<()>; + async fn preferred_language(&self, language: String) -> crate::client::Result<()>; } } #[doc = "An input method object is responsible for composing text in response to"] @@ -785,6 +831,14 @@ pub mod input_method_unstable_v1 { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "A text input was activated. Creates an input method context object"] + #[doc = "which allows communication with the text input."] + async fn activate(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "The text input corresponding to the context argument was deactivated."] + #[doc = "The input method context should be destroyed after deactivation is"] + #[doc = "handled."] + async fn deactivate(&self, context: crate::wire::ObjectId) + -> crate::client::Result<()>; } } #[doc = "Only one client can bind this interface at a time."] @@ -1065,6 +1119,26 @@ pub mod input_timestamps_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The timestamp event is associated with the first subsequent input event"] + #[doc = "carrying a timestamp which belongs to the set of input events this"] + #[doc = "object is subscribed to."] + #[doc = ""] + #[doc = "The timestamp provided by this event is a high-resolution version of"] + #[doc = "the timestamp argument of the associated input event. The provided"] + #[doc = "timestamp is in the same clock domain and is at least as accurate as"] + #[doc = "the associated input event timestamp."] + #[doc = ""] + #[doc = "The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,"] + #[doc = "each component being an unsigned 32-bit value. Whole seconds are in"] + #[doc = "tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,"] + #[doc = "and the additional fractional part in tv_nsec as nanoseconds. Hence,"] + #[doc = "for valid timestamps tv_nsec must be in [0, 999999999]."] + async fn timestamp( + &self, + tv_sec_hi: u32, + tv_sec_lo: u32, + tv_nsec: u32, + ) -> crate::client::Result<()>; } } } @@ -1227,6 +1301,21 @@ pub mod keyboard_shortcuts_inhibit_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event indicates that the shortcut inhibitor is active."] + #[doc = ""] + #[doc = "The compositor sends this event every time compositor shortcuts"] + #[doc = "are inhibited on behalf of the surface. When active, the client"] + #[doc = "may receive input events normally reserved by the compositor"] + #[doc = "(see zwp_keyboard_shortcuts_inhibitor_v1)."] + #[doc = ""] + #[doc = "This occurs typically when the initial request \"inhibit_shortcuts\""] + #[doc = "first becomes active or when the user instructs the compositor to"] + #[doc = "re-enable and existing shortcuts inhibitor using any mechanism"] + #[doc = "offered by the compositor."] + async fn active(&self) -> crate::client::Result<()>; + #[doc = "This event indicates that the shortcuts inhibitor is inactive,"] + #[doc = "normal shortcuts processing is restored by the compositor."] + async fn inactive(&self) -> crate::client::Result<()>; } } } @@ -1397,6 +1486,47 @@ pub mod linux_dmabuf_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event advertises one buffer format that the server supports."] + #[doc = "All the supported formats are advertised once when the client"] + #[doc = "binds to this interface. A roundtrip after binding guarantees"] + #[doc = "that the client has received all supported formats."] + #[doc = ""] + #[doc = "For the definition of the format codes, see the"] + #[doc = "zwp_linux_buffer_params_v1::create request."] + #[doc = ""] + #[doc = "Starting version 4, the format event is deprecated and must not be"] + #[doc = "sent by compositors. Instead, use get_default_feedback or"] + #[doc = "get_surface_feedback."] + async fn format(&self, format: u32) -> crate::client::Result<()>; + #[doc = "This event advertises the formats that the server supports, along with"] + #[doc = "the modifiers supported for each format. All the supported modifiers"] + #[doc = "for all the supported formats are advertised once when the client"] + #[doc = "binds to this interface. A roundtrip after binding guarantees that"] + #[doc = "the client has received all supported format-modifier pairs."] + #[doc = ""] + #[doc = "For legacy support, DRM_FORMAT_MOD_INVALID (that is, modifier_hi =="] + #[doc = "0x00ffffff and modifier_lo == 0xffffffff) is allowed in this event."] + #[doc = "It indicates that the server can support the format with an implicit"] + #[doc = "modifier. When a plane has DRM_FORMAT_MOD_INVALID as its modifier, it"] + #[doc = "is as if no explicit modifier is specified. The effective modifier"] + #[doc = "will be derived from the dmabuf."] + #[doc = ""] + #[doc = "A compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for"] + #[doc = "a given format supports both explicit modifiers and implicit modifiers."] + #[doc = ""] + #[doc = "For the definition of the format and modifier codes, see the"] + #[doc = "zwp_linux_buffer_params_v1::create and zwp_linux_buffer_params_v1::add"] + #[doc = "requests."] + #[doc = ""] + #[doc = "Starting version 4, the modifier event is deprecated and must not be"] + #[doc = "sent by compositors. Instead, use get_default_feedback or"] + #[doc = "get_surface_feedback."] + async fn modifier( + &self, + format: u32, + modifier_hi: u32, + modifier_lo: u32, + ) -> crate::client::Result<()>; } } #[doc = "This temporary object is a collection of dmabufs and other"] @@ -1658,6 +1788,19 @@ pub mod linux_dmabuf_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event indicates that the attempted buffer creation was"] + #[doc = "successful. It provides the new wl_buffer referencing the dmabuf(s)."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy the"] + #[doc = "zwp_linux_buffer_params_v1 object."] + async fn created(&self, buffer: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event indicates that the attempted buffer creation has"] + #[doc = "failed. It usually means that one of the dmabuf constraints"] + #[doc = "has not been fulfilled."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy the"] + #[doc = "zwp_linux_buffer_params_v1 object."] + async fn failed(&self) -> crate::client::Result<()>; } } #[doc = "This object advertises dmabuf parameters feedback. This includes the"] @@ -1722,6 +1865,121 @@ pub mod linux_dmabuf_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent after all parameters of a wp_linux_dmabuf_feedback"] + #[doc = "object have been sent."] + #[doc = ""] + #[doc = "This allows changes to the wp_linux_dmabuf_feedback parameters to be"] + #[doc = "seen as atomic, even if they happen via multiple events."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event provides a file descriptor which can be memory-mapped to"] + #[doc = "access the format and modifier table."] + #[doc = ""] + #[doc = "The table contains a tightly packed array of consecutive format +"] + #[doc = "modifier pairs. Each pair is 16 bytes wide. It contains a format as a"] + #[doc = "32-bit unsigned integer, followed by 4 bytes of unused padding, and a"] + #[doc = "modifier as a 64-bit unsigned integer. The native endianness is used."] + #[doc = ""] + #[doc = "The client must map the file descriptor in read-only private mode."] + #[doc = ""] + #[doc = "Compositors are not allowed to mutate the table file contents once this"] + #[doc = "event has been sent. Instead, compositors must create a new, separate"] + #[doc = "table file and re-send feedback parameters. Compositors are allowed to"] + #[doc = "store duplicate format + modifier pairs in the table."] + async fn format_table( + &self, + fd: rustix::fd::OwnedFd, + size: u32, + ) -> crate::client::Result<()>; + #[doc = "This event advertises the main device that the server prefers to use"] + #[doc = "when direct scan-out to the target device isn't possible. The"] + #[doc = "advertised main device may be different for each"] + #[doc = "wp_linux_dmabuf_feedback object, and may change over time."] + #[doc = ""] + #[doc = "There is exactly one main device. The compositor must send at least"] + #[doc = "one preference tranche with tranche_target_device equal to main_device."] + #[doc = ""] + #[doc = "Clients need to create buffers that the main device can import and"] + #[doc = "read from, otherwise creating the dmabuf wl_buffer will fail (see the"] + #[doc = "wp_linux_buffer_params.create and create_immed requests for details)."] + #[doc = "The main device will also likely be kept active by the compositor,"] + #[doc = "so clients can use it instead of waking up another device for power"] + #[doc = "savings."] + #[doc = ""] + #[doc = "In general the device is a DRM node. The DRM node type (primary vs."] + #[doc = "render) is unspecified. Clients must not rely on the compositor sending"] + #[doc = "a particular node type. Clients cannot check two devices for equality"] + #[doc = "by comparing the dev_t value."] + #[doc = ""] + #[doc = "If explicit modifiers are not supported and the client performs buffer"] + #[doc = "allocations on a different device than the main device, then the client"] + #[doc = "must force the buffer to have a linear layout."] + async fn main_device(&self, device: Vec) -> crate::client::Result<()>; + #[doc = "This event splits tranche_target_device and tranche_formats events in"] + #[doc = "preference tranches. It is sent after a set of tranche_target_device"] + #[doc = "and tranche_formats events; it represents the end of a tranche. The"] + #[doc = "next tranche will have a lower preference."] + async fn tranche_done(&self) -> crate::client::Result<()>; + #[doc = "This event advertises the target device that the server prefers to use"] + #[doc = "for a buffer created given this tranche. The advertised target device"] + #[doc = "may be different for each preference tranche, and may change over time."] + #[doc = ""] + #[doc = "There is exactly one target device per tranche."] + #[doc = ""] + #[doc = "The target device may be a scan-out device, for example if the"] + #[doc = "compositor prefers to directly scan-out a buffer created given this"] + #[doc = "tranche. The target device may be a rendering device, for example if"] + #[doc = "the compositor prefers to texture from said buffer."] + #[doc = ""] + #[doc = "The client can use this hint to allocate the buffer in a way that makes"] + #[doc = "it accessible from the target device, ideally directly. The buffer must"] + #[doc = "still be accessible from the main device, either through direct import"] + #[doc = "or through a potentially more expensive fallback path. If the buffer"] + #[doc = "can't be directly imported from the main device then clients must be"] + #[doc = "prepared for the compositor changing the tranche priority or making"] + #[doc = "wl_buffer creation fail (see the wp_linux_buffer_params.create and"] + #[doc = "create_immed requests for details)."] + #[doc = ""] + #[doc = "If the device is a DRM node, the DRM node type (primary vs. render) is"] + #[doc = "unspecified. Clients must not rely on the compositor sending a"] + #[doc = "particular node type. Clients cannot check two devices for equality by"] + #[doc = "comparing the dev_t value."] + #[doc = ""] + #[doc = "This event is tied to a preference tranche, see the tranche_done event."] + async fn tranche_target_device(&self, device: Vec) -> crate::client::Result<()>; + #[doc = "This event advertises the format + modifier combinations that the"] + #[doc = "compositor supports."] + #[doc = ""] + #[doc = "It carries an array of indices, each referring to a format + modifier"] + #[doc = "pair in the last received format table (see the format_table event)."] + #[doc = "Each index is a 16-bit unsigned integer in native endianness."] + #[doc = ""] + #[doc = "For legacy support, DRM_FORMAT_MOD_INVALID is an allowed modifier."] + #[doc = "It indicates that the server can support the format with an implicit"] + #[doc = "modifier. When a buffer has DRM_FORMAT_MOD_INVALID as its modifier, it"] + #[doc = "is as if no explicit modifier is specified. The effective modifier"] + #[doc = "will be derived from the dmabuf."] + #[doc = ""] + #[doc = "A compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for"] + #[doc = "a given format supports both explicit modifiers and implicit modifiers."] + #[doc = ""] + #[doc = "Compositors must not send duplicate format + modifier pairs within the"] + #[doc = "same tranche or across two different tranches with the same target"] + #[doc = "device and flags."] + #[doc = ""] + #[doc = "This event is tied to a preference tranche, see the tranche_done event."] + #[doc = ""] + #[doc = "For the definition of the format and modifier codes, see the"] + #[doc = "wp_linux_buffer_params.create request."] + async fn tranche_formats(&self, indices: Vec) -> crate::client::Result<()>; + #[doc = "This event sets tranche-specific flags."] + #[doc = ""] + #[doc = "The scanout flag is a hint that direct scan-out may be attempted by the"] + #[doc = "compositor on the target device if the client appropriately allocates a"] + #[doc = "buffer. How to allocate a buffer that can be scanned out on the target"] + #[doc = "device is implementation-defined."] + #[doc = ""] + #[doc = "This event is tied to a preference tranche, see the tranche_done event."] + async fn tranche_flags(&self, flags: TrancheFlags) -> crate::client::Result<()>; } } } @@ -2036,6 +2294,31 @@ pub mod zwp_linux_explicit_synchronization_unstable_v1 { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "Sent when the compositor has finalised its usage of the associated"] + #[doc = "buffer for the relevant commit, providing a dma_fence which will be"] + #[doc = "signaled when all operations by the compositor on that buffer for that"] + #[doc = "commit have finished."] + #[doc = ""] + #[doc = "Once the fence has signaled, and assuming the associated buffer is not"] + #[doc = "pending release from other wl_surface.commit requests, no additional"] + #[doc = "explicit or implicit synchronization is required to safely reuse or"] + #[doc = "destroy the buffer."] + #[doc = ""] + #[doc = "This event destroys the zwp_linux_buffer_release_v1 object."] + async fn fenced_release(&self, fence: rustix::fd::OwnedFd) + -> crate::client::Result<()>; + #[doc = "Sent when the compositor has finalised its usage of the associated"] + #[doc = "buffer for the relevant commit, and either performed no operations"] + #[doc = "using it, or has a guarantee that all its operations on that buffer for"] + #[doc = "that commit have finished."] + #[doc = ""] + #[doc = "Once this event is received, and assuming the associated buffer is not"] + #[doc = "pending release from other wl_surface.commit requests, no additional"] + #[doc = "explicit or implicit synchronization is required to safely reuse or"] + #[doc = "destroy the buffer."] + #[doc = ""] + #[doc = "This event destroys the zwp_linux_buffer_release_v1 object."] + async fn immediate_release(&self) -> crate::client::Result<()>; } } } @@ -2345,6 +2628,15 @@ pub mod pointer_constraints_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Notification that the pointer lock of the seat's pointer is activated."] + async fn locked(&self) -> crate::client::Result<()>; + #[doc = "Notification that the pointer lock of the seat's pointer is no longer"] + #[doc = "active. If this is a oneshot pointer lock (see"] + #[doc = "wp_pointer_constraints.lifetime) this object is now defunct and should"] + #[doc = "be destroyed. If this is a persistent pointer lock (see"] + #[doc = "wp_pointer_constraints.lifetime) this pointer lock may again"] + #[doc = "reactivate in the future."] + async fn unlocked(&self) -> crate::client::Result<()>; } } #[doc = "The wp_confined_pointer interface represents a confined pointer state."] @@ -2422,6 +2714,16 @@ pub mod pointer_constraints_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Notification that the pointer confinement of the seat's pointer is"] + #[doc = "activated."] + async fn confined(&self) -> crate::client::Result<()>; + #[doc = "Notification that the pointer confinement of the seat's pointer is no"] + #[doc = "longer active. If this is a oneshot pointer confinement (see"] + #[doc = "wp_pointer_constraints.lifetime) this object is now defunct and should"] + #[doc = "be destroyed. If this is a persistent pointer confinement (see"] + #[doc = "wp_pointer_constraints.lifetime) this pointer confinement may again"] + #[doc = "reactivate in the future."] + async fn unconfined(&self) -> crate::client::Result<()>; } } } @@ -2584,6 +2886,39 @@ pub mod pointer_gestures_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent when a multi-finger swipe gesture is detected"] + #[doc = "on the device."] + async fn begin( + &self, + serial: u32, + time: u32, + surface: crate::wire::ObjectId, + fingers: u32, + ) -> crate::client::Result<()>; + #[doc = "This event is sent when a multi-finger swipe gesture changes the"] + #[doc = "position of the logical center."] + #[doc = ""] + #[doc = "The dx and dy coordinates are relative coordinates of the logical"] + #[doc = "center of the gesture compared to the previous event."] + async fn update( + &self, + time: u32, + dx: crate::wire::Fixed, + dy: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "This event is sent when a multi-finger swipe gesture ceases to"] + #[doc = "be valid. This may happen when one or more fingers are lifted or"] + #[doc = "the gesture is cancelled."] + #[doc = ""] + #[doc = "When a gesture is cancelled, the client should undo state changes"] + #[doc = "caused by this gesture. What causes a gesture to be cancelled is"] + #[doc = "implementation-dependent."] + async fn end( + &self, + serial: u32, + time: u32, + cancelled: i32, + ) -> crate::client::Result<()>; } } #[doc = "A pinch gesture object notifies a client about a multi-finger pinch"] @@ -2629,6 +2964,48 @@ pub mod pointer_gestures_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent when a multi-finger pinch gesture is detected"] + #[doc = "on the device."] + async fn begin( + &self, + serial: u32, + time: u32, + surface: crate::wire::ObjectId, + fingers: u32, + ) -> crate::client::Result<()>; + #[doc = "This event is sent when a multi-finger pinch gesture changes the"] + #[doc = "position of the logical center, the rotation or the relative scale."] + #[doc = ""] + #[doc = "The dx and dy coordinates are relative coordinates in the"] + #[doc = "surface coordinate space of the logical center of the gesture."] + #[doc = ""] + #[doc = "The scale factor is an absolute scale compared to the"] + #[doc = "pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers"] + #[doc = "are now twice as far apart as on pointer_gesture_pinch.begin."] + #[doc = ""] + #[doc = "The rotation is the relative angle in degrees clockwise compared to the previous"] + #[doc = "pointer_gesture_pinch.begin or pointer_gesture_pinch.update event."] + async fn update( + &self, + time: u32, + dx: crate::wire::Fixed, + dy: crate::wire::Fixed, + scale: crate::wire::Fixed, + rotation: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "This event is sent when a multi-finger pinch gesture ceases to"] + #[doc = "be valid. This may happen when one or more fingers are lifted or"] + #[doc = "the gesture is cancelled."] + #[doc = ""] + #[doc = "When a gesture is cancelled, the client should undo state changes"] + #[doc = "caused by this gesture. What causes a gesture to be cancelled is"] + #[doc = "implementation-dependent."] + async fn end( + &self, + serial: u32, + time: u32, + cancelled: i32, + ) -> crate::client::Result<()>; } } #[doc = "A hold gesture object notifies a client about a single- or"] @@ -2676,6 +3053,29 @@ pub mod pointer_gestures_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent when a hold gesture is detected on the device."] + async fn begin( + &self, + serial: u32, + time: u32, + surface: crate::wire::ObjectId, + fingers: u32, + ) -> crate::client::Result<()>; + #[doc = "This event is sent when a hold gesture ceases to"] + #[doc = "be valid. This may happen when the holding fingers are lifted or"] + #[doc = "the gesture is cancelled, for example if the fingers move past an"] + #[doc = "implementation-defined threshold, the finger count changes or the hold"] + #[doc = "gesture changes into a different type of gesture."] + #[doc = ""] + #[doc = "When a gesture is cancelled, the client may need to undo state changes"] + #[doc = "caused by this gesture. What causes a gesture to be cancelled is"] + #[doc = "implementation-dependent."] + async fn end( + &self, + serial: u32, + time: u32, + cancelled: i32, + ) -> crate::client::Result<()>; } } } @@ -2853,6 +3253,25 @@ pub mod wp_primary_selection_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Introduces a new wp_primary_selection_offer object that may be used"] + #[doc = "to receive the current primary selection. Immediately following this"] + #[doc = "event, the new wp_primary_selection_offer object will send"] + #[doc = "wp_primary_selection_offer.offer events to describe the offered mime"] + #[doc = "types."] + async fn data_offer(&self, offer: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "The wp_primary_selection_device.selection event is sent to notify the"] + #[doc = "client of a new primary selection. This event is sent after the"] + #[doc = "wp_primary_selection.data_offer event introducing this object, and after"] + #[doc = "the offer has announced its mimetypes through"] + #[doc = "wp_primary_selection_offer.offer."] + #[doc = ""] + #[doc = "The data_offer is valid until a new offer or NULL is received"] + #[doc = "or until the client loses keyboard focus. The client must destroy the"] + #[doc = "previous selection data_offer, if any, upon receiving this event."] + async fn selection( + &self, + id: Option, + ) -> crate::client::Result<()>; } } #[doc = "A wp_primary_selection_offer represents an offer to transfer the contents"] @@ -2915,6 +3334,11 @@ pub mod wp_primary_selection_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent immediately after creating announcing the"] + #[doc = "wp_primary_selection_offer through"] + #[doc = "wp_primary_selection_device.data_offer. One event is sent per offered"] + #[doc = "mime type."] + async fn offer(&self, mime_type: String) -> crate::client::Result<()>; } } #[doc = "The source side of a wp_primary_selection_offer, it provides a way to"] @@ -2966,6 +3390,17 @@ pub mod wp_primary_selection_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Request for the current primary selection contents from the client."] + #[doc = "Send the specified mime type over the passed file descriptor, then"] + #[doc = "close it."] + async fn send( + &self, + mime_type: String, + fd: rustix::fd::OwnedFd, + ) -> crate::client::Result<()>; + #[doc = "This primary selection source is no longer valid. The client should"] + #[doc = "clean up and destroy this primary selection source."] + async fn cancelled(&self) -> crate::client::Result<()>; } } } @@ -3081,6 +3516,45 @@ pub mod relative_pointer_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Relative x/y pointer motion from the pointer of the seat associated with"] + #[doc = "this object."] + #[doc = ""] + #[doc = "A relative motion is in the same dimension as regular wl_pointer motion"] + #[doc = "events, except they do not represent an absolute position. For example,"] + #[doc = "moving a pointer from (x, y) to (x', y') would have the equivalent"] + #[doc = "relative motion (x' - x, y' - y). If a pointer motion caused the"] + #[doc = "absolute pointer position to be clipped by for example the edge of the"] + #[doc = "monitor, the relative motion is unaffected by the clipping and will"] + #[doc = "represent the unclipped motion."] + #[doc = ""] + #[doc = "This event also contains non-accelerated motion deltas. The"] + #[doc = "non-accelerated delta is, when applicable, the regular pointer motion"] + #[doc = "delta as it was before having applied motion acceleration and other"] + #[doc = "transformations such as normalization."] + #[doc = ""] + #[doc = "Note that the non-accelerated delta does not represent 'raw' events as"] + #[doc = "they were read from some device. Pointer motion acceleration is device-"] + #[doc = "and configuration-specific and non-accelerated deltas and accelerated"] + #[doc = "deltas may have the same value on some devices."] + #[doc = ""] + #[doc = "Relative motions are not coupled to wl_pointer.motion events, and can be"] + #[doc = "sent in combination with such events, but also independently. There may"] + #[doc = "also be scenarios where wl_pointer.motion is sent, but there is no"] + #[doc = "relative motion. The order of an absolute and relative motion event"] + #[doc = "originating from the same physical motion is not guaranteed."] + #[doc = ""] + #[doc = "If the client needs button events or focus state, it can receive them"] + #[doc = "from a wl_pointer object of the same seat that the wp_relative_pointer"] + #[doc = "object is associated with."] + async fn relative_motion( + &self, + utime_hi: u32, + utime_lo: u32, + dx: crate::wire::Fixed, + dy: crate::wire::Fixed, + dx_unaccel: crate::wire::Fixed, + dy_unaccel: crate::wire::Fixed, + ) -> crate::client::Result<()>; } } } @@ -3258,6 +3732,16 @@ pub mod tablet_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent whenever a new tablet becomes available on this"] + #[doc = "seat. This event only provides the object id of the tablet, any"] + #[doc = "static information about the tablet (device name, vid/pid, etc.) is"] + #[doc = "sent through the wp_tablet interface."] + async fn tablet_added(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event is sent whenever a tool that has not previously been used"] + #[doc = "with a tablet comes into use. This event only provides the object id"] + #[doc = "of the tool; any static information about the tool (capabilities,"] + #[doc = "type, etc.) is sent through the wp_tablet_tool interface."] + async fn tool_added(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; } } #[doc = "An object that represents a physical tool that has been, or is"] @@ -3479,6 +3963,195 @@ pub mod tablet_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The tool type is the high-level type of the tool and usually decides"] + #[doc = "the interaction expected from this tool."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn r#type(&self, tool_type: Type) -> crate::client::Result<()>; + #[doc = "If the physical tool can be identified by a unique 64-bit serial"] + #[doc = "number, this event notifies the client of this serial number."] + #[doc = ""] + #[doc = "If multiple tablets are available in the same seat and the tool is"] + #[doc = "uniquely identifiable by the serial number, that tool may move"] + #[doc = "between tablets."] + #[doc = ""] + #[doc = "Otherwise, if the tool has no serial number and this event is"] + #[doc = "missing, the tool is tied to the tablet it first comes into"] + #[doc = "proximity with. Even if the physical tool is used on multiple"] + #[doc = "tablets, separate wp_tablet_tool objects will be created, one per"] + #[doc = "tablet."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn hardware_serial( + &self, + hardware_serial_hi: u32, + hardware_serial_lo: u32, + ) -> crate::client::Result<()>; + #[doc = "This event notifies the client of a hardware id available on this tool."] + #[doc = ""] + #[doc = "The hardware id is a device-specific 64-bit id that provides extra"] + #[doc = "information about the tool in use, beyond the wl_tool.type"] + #[doc = "enumeration. The format of the id is specific to tablets made by"] + #[doc = "Wacom Inc. For example, the hardware id of a Wacom Grip"] + #[doc = "Pen (a stylus) is 0x802."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn hardware_id_wacom( + &self, + hardware_id_hi: u32, + hardware_id_lo: u32, + ) -> crate::client::Result<()>; + #[doc = "This event notifies the client of any capabilities of this tool,"] + #[doc = "beyond the main set of x/y axes and tip up/down detection."] + #[doc = ""] + #[doc = "One event is sent for each extra capability available on this tool."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn capability(&self, capability: Capability) -> crate::client::Result<()>; + #[doc = "This event signals the end of the initial burst of descriptive"] + #[doc = "events. A client may consider the static description of the tool to"] + #[doc = "be complete and finalize initialization of the tool."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event is sent when the tool is removed from the system and will"] + #[doc = "send no further events. Should the physical tool come back into"] + #[doc = "proximity later, a new wp_tablet_tool object will be created."] + #[doc = ""] + #[doc = "It is compositor-dependent when a tool is removed. A compositor may"] + #[doc = "remove a tool on proximity out, tablet removal or any other reason."] + #[doc = "A compositor may also keep a tool alive until shutdown."] + #[doc = ""] + #[doc = "If the tool is currently in proximity, a proximity_out event will be"] + #[doc = "sent before the removed event. See wp_tablet_tool.proximity_out for"] + #[doc = "the handling of any buttons logically down."] + #[doc = ""] + #[doc = "When this event is received, the client must wp_tablet_tool.destroy"] + #[doc = "the object."] + async fn removed(&self) -> crate::client::Result<()>; + #[doc = "Notification that this tool is focused on a certain surface."] + #[doc = ""] + #[doc = "This event can be received when the tool has moved from one surface to"] + #[doc = "another, or when the tool has come back into proximity above the"] + #[doc = "surface."] + #[doc = ""] + #[doc = "If any button is logically down when the tool comes into proximity,"] + #[doc = "the respective button event is sent after the proximity_in event but"] + #[doc = "within the same frame as the proximity_in event."] + async fn proximity_in( + &self, + serial: u32, + tablet: crate::wire::ObjectId, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "Notification that this tool has either left proximity, or is no"] + #[doc = "longer focused on a certain surface."] + #[doc = ""] + #[doc = "When the tablet tool leaves proximity of the tablet, button release"] + #[doc = "events are sent for each button that was held down at the time of"] + #[doc = "leaving proximity. These events are sent before the proximity_out"] + #[doc = "event but within the same wp_tablet.frame."] + #[doc = ""] + #[doc = "If the tool stays within proximity of the tablet, but the focus"] + #[doc = "changes from one surface to another, a button release event may not"] + #[doc = "be sent until the button is actually released or the tool leaves the"] + #[doc = "proximity of the tablet."] + async fn proximity_out(&self) -> crate::client::Result<()>; + #[doc = "Sent whenever the tablet tool comes in contact with the surface of the"] + #[doc = "tablet."] + #[doc = ""] + #[doc = "If the tool is already in contact with the tablet when entering the"] + #[doc = "input region, the client owning said region will receive a"] + #[doc = "wp_tablet.proximity_in event, followed by a wp_tablet.down"] + #[doc = "event and a wp_tablet.frame event."] + #[doc = ""] + #[doc = "Note that this event describes logical contact, not physical"] + #[doc = "contact. On some devices, a compositor may not consider a tool in"] + #[doc = "logical contact until a minimum physical pressure threshold is"] + #[doc = "exceeded."] + async fn down(&self, serial: u32) -> crate::client::Result<()>; + #[doc = "Sent whenever the tablet tool stops making contact with the surface of"] + #[doc = "the tablet, or when the tablet tool moves out of the input region"] + #[doc = "and the compositor grab (if any) is dismissed."] + #[doc = ""] + #[doc = "If the tablet tool moves out of the input region while in contact"] + #[doc = "with the surface of the tablet and the compositor does not have an"] + #[doc = "ongoing grab on the surface, the client owning said region will"] + #[doc = "receive a wp_tablet.up event, followed by a wp_tablet.proximity_out"] + #[doc = "event and a wp_tablet.frame event. If the compositor has an ongoing"] + #[doc = "grab on this device, this event sequence is sent whenever the grab"] + #[doc = "is dismissed in the future."] + #[doc = ""] + #[doc = "Note that this event describes logical contact, not physical"] + #[doc = "contact. On some devices, a compositor may not consider a tool out"] + #[doc = "of logical contact until physical pressure falls below a specific"] + #[doc = "threshold."] + async fn up(&self) -> crate::client::Result<()>; + #[doc = "Sent whenever a tablet tool moves."] + async fn motion( + &self, + x: crate::wire::Fixed, + y: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "Sent whenever the pressure axis on a tool changes. The value of this"] + #[doc = "event is normalized to a value between 0 and 65535."] + #[doc = ""] + #[doc = "Note that pressure may be nonzero even when a tool is not in logical"] + #[doc = "contact. See the down and up events for more details."] + async fn pressure(&self, pressure: u32) -> crate::client::Result<()>; + #[doc = "Sent whenever the distance axis on a tool changes. The value of this"] + #[doc = "event is normalized to a value between 0 and 65535."] + #[doc = ""] + #[doc = "Note that distance may be nonzero even when a tool is not in logical"] + #[doc = "contact. See the down and up events for more details."] + async fn distance(&self, distance: u32) -> crate::client::Result<()>; + #[doc = "Sent whenever one or both of the tilt axes on a tool change. Each tilt"] + #[doc = "value is in 0.01 of a degree, relative to the z-axis of the tablet."] + #[doc = "The angle is positive when the top of a tool tilts along the"] + #[doc = "positive x or y axis."] + async fn tilt(&self, tilt_x: i32, tilt_y: i32) -> crate::client::Result<()>; + #[doc = "Sent whenever the z-rotation axis on the tool changes. The"] + #[doc = "rotation value is in 0.01 of a degree clockwise from the tool's"] + #[doc = "logical neutral position."] + async fn rotation(&self, degrees: i32) -> crate::client::Result<()>; + #[doc = "Sent whenever the slider position on the tool changes. The"] + #[doc = "value is normalized between -65535 and 65535, with 0 as the logical"] + #[doc = "neutral position of the slider."] + #[doc = ""] + #[doc = "The slider is available on e.g. the Wacom Airbrush tool."] + async fn slider(&self, position: i32) -> crate::client::Result<()>; + #[doc = "Sent whenever the wheel on the tool emits an event. This event"] + #[doc = "contains two values for the same axis change. The degrees value is"] + #[doc = "in 0.01 of a degree in the same orientation as the"] + #[doc = "wl_pointer.vertical_scroll axis. The clicks value is in discrete"] + #[doc = "logical clicks of the mouse wheel. This value may be zero if the"] + #[doc = "movement of the wheel was less than one logical click."] + #[doc = ""] + #[doc = "Clients should choose either value and avoid mixing degrees and"] + #[doc = "clicks. The compositor may accumulate values smaller than a logical"] + #[doc = "click and emulate click events when a certain threshold is met."] + #[doc = "Thus, wl_tablet_tool.wheel events with non-zero clicks values may"] + #[doc = "have different degrees values."] + async fn wheel(&self, degrees: i32, clicks: i32) -> crate::client::Result<()>; + #[doc = "Sent whenever a button on the tool is pressed or released."] + #[doc = ""] + #[doc = "If a button is held down when the tool moves in or out of proximity,"] + #[doc = "button events are generated by the compositor. See"] + #[doc = "wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for"] + #[doc = "details."] + async fn button( + &self, + serial: u32, + button: u32, + state: ButtonState, + ) -> crate::client::Result<()>; + #[doc = "Marks the end of a series of axis and/or button updates from the"] + #[doc = "tablet. The Wayland protocol requires axis updates to be sent"] + #[doc = "sequentially, however all events within a frame should be considered"] + #[doc = "one hardware event."] + async fn frame(&self, time: u32) -> crate::client::Result<()>; } } #[doc = "The wp_tablet interface represents one graphics tablet device. The"] @@ -3518,6 +4191,38 @@ pub mod tablet_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet.done event."] + async fn name(&self, name: String) -> crate::client::Result<()>; + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet.done event."] + async fn id(&self, vid: u32, pid: u32) -> crate::client::Result<()>; + #[doc = "A system-specific device path that indicates which device is behind"] + #[doc = "this wp_tablet. This information may be used to gather additional"] + #[doc = "information about the device, e.g. through libwacom."] + #[doc = ""] + #[doc = "A device may have more than one device path. If so, multiple"] + #[doc = "wp_tablet.path events are sent. A device may be emulated and not"] + #[doc = "have a device path, and in that case this event will not be sent."] + #[doc = ""] + #[doc = "The format of the path is unspecified, it may be a device node, a"] + #[doc = "sysfs path, or some other identifier. It is up to the client to"] + #[doc = "identify the string provided."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet.done event."] + async fn path(&self, path: String) -> crate::client::Result<()>; + #[doc = "This event is sent immediately to signal the end of the initial"] + #[doc = "burst of descriptive events. A client may consider the static"] + #[doc = "description of the tablet to be complete and finalize initialization"] + #[doc = "of the tablet."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "Sent when the tablet has been removed from the system. When a tablet"] + #[doc = "is removed, some tools may be removed."] + #[doc = ""] + #[doc = "When this event is received, the client must wp_tablet.destroy"] + #[doc = "the object."] + async fn removed(&self) -> crate::client::Result<()>; } } } @@ -3690,6 +4395,27 @@ pub mod tablet_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent whenever a new tablet becomes available on this"] + #[doc = "seat. This event only provides the object id of the tablet, any"] + #[doc = "static information about the tablet (device name, vid/pid, etc.) is"] + #[doc = "sent through the wp_tablet interface."] + async fn tablet_added(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event is sent whenever a tool that has not previously been used"] + #[doc = "with a tablet comes into use. This event only provides the object id"] + #[doc = "of the tool; any static information about the tool (capabilities,"] + #[doc = "type, etc.) is sent through the wp_tablet_tool interface."] + async fn tool_added(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event is sent whenever a new pad is known to the system. Typically,"] + #[doc = "pads are physically attached to tablets and a pad_added event is"] + #[doc = "sent immediately after the wp_tablet_seat.tablet_added."] + #[doc = "However, some standalone pad devices logically attach to tablets at"] + #[doc = "runtime, and the client must wait for wp_tablet_pad.enter to know"] + #[doc = "the tablet a pad is attached to."] + #[doc = ""] + #[doc = "This event only provides the object id of the pad. All further"] + #[doc = "features (buttons, strips, rings) are sent through the wp_tablet_pad"] + #[doc = "interface."] + async fn pad_added(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; } } #[doc = "An object that represents a physical tool that has been, or is"] @@ -3909,6 +4635,203 @@ pub mod tablet_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The tool type is the high-level type of the tool and usually decides"] + #[doc = "the interaction expected from this tool."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn r#type(&self, tool_type: Type) -> crate::client::Result<()>; + #[doc = "If the physical tool can be identified by a unique 64-bit serial"] + #[doc = "number, this event notifies the client of this serial number."] + #[doc = ""] + #[doc = "If multiple tablets are available in the same seat and the tool is"] + #[doc = "uniquely identifiable by the serial number, that tool may move"] + #[doc = "between tablets."] + #[doc = ""] + #[doc = "Otherwise, if the tool has no serial number and this event is"] + #[doc = "missing, the tool is tied to the tablet it first comes into"] + #[doc = "proximity with. Even if the physical tool is used on multiple"] + #[doc = "tablets, separate wp_tablet_tool objects will be created, one per"] + #[doc = "tablet."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn hardware_serial( + &self, + hardware_serial_hi: u32, + hardware_serial_lo: u32, + ) -> crate::client::Result<()>; + #[doc = "This event notifies the client of a hardware id available on this tool."] + #[doc = ""] + #[doc = "The hardware id is a device-specific 64-bit id that provides extra"] + #[doc = "information about the tool in use, beyond the wl_tool.type"] + #[doc = "enumeration. The format of the id is specific to tablets made by"] + #[doc = "Wacom Inc. For example, the hardware id of a Wacom Grip"] + #[doc = "Pen (a stylus) is 0x802."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn hardware_id_wacom( + &self, + hardware_id_hi: u32, + hardware_id_lo: u32, + ) -> crate::client::Result<()>; + #[doc = "This event notifies the client of any capabilities of this tool,"] + #[doc = "beyond the main set of x/y axes and tip up/down detection."] + #[doc = ""] + #[doc = "One event is sent for each extra capability available on this tool."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_tool.done event."] + async fn capability(&self, capability: Capability) -> crate::client::Result<()>; + #[doc = "This event signals the end of the initial burst of descriptive"] + #[doc = "events. A client may consider the static description of the tool to"] + #[doc = "be complete and finalize initialization of the tool."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event is sent when the tool is removed from the system and will"] + #[doc = "send no further events. Should the physical tool come back into"] + #[doc = "proximity later, a new wp_tablet_tool object will be created."] + #[doc = ""] + #[doc = "It is compositor-dependent when a tool is removed. A compositor may"] + #[doc = "remove a tool on proximity out, tablet removal or any other reason."] + #[doc = "A compositor may also keep a tool alive until shutdown."] + #[doc = ""] + #[doc = "If the tool is currently in proximity, a proximity_out event will be"] + #[doc = "sent before the removed event. See wp_tablet_tool.proximity_out for"] + #[doc = "the handling of any buttons logically down."] + #[doc = ""] + #[doc = "When this event is received, the client must wp_tablet_tool.destroy"] + #[doc = "the object."] + async fn removed(&self) -> crate::client::Result<()>; + #[doc = "Notification that this tool is focused on a certain surface."] + #[doc = ""] + #[doc = "This event can be received when the tool has moved from one surface to"] + #[doc = "another, or when the tool has come back into proximity above the"] + #[doc = "surface."] + #[doc = ""] + #[doc = "If any button is logically down when the tool comes into proximity,"] + #[doc = "the respective button event is sent after the proximity_in event but"] + #[doc = "within the same frame as the proximity_in event."] + async fn proximity_in( + &self, + serial: u32, + tablet: crate::wire::ObjectId, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "Notification that this tool has either left proximity, or is no"] + #[doc = "longer focused on a certain surface."] + #[doc = ""] + #[doc = "When the tablet tool leaves proximity of the tablet, button release"] + #[doc = "events are sent for each button that was held down at the time of"] + #[doc = "leaving proximity. These events are sent before the proximity_out"] + #[doc = "event but within the same wp_tablet.frame."] + #[doc = ""] + #[doc = "If the tool stays within proximity of the tablet, but the focus"] + #[doc = "changes from one surface to another, a button release event may not"] + #[doc = "be sent until the button is actually released or the tool leaves the"] + #[doc = "proximity of the tablet."] + async fn proximity_out(&self) -> crate::client::Result<()>; + #[doc = "Sent whenever the tablet tool comes in contact with the surface of the"] + #[doc = "tablet."] + #[doc = ""] + #[doc = "If the tool is already in contact with the tablet when entering the"] + #[doc = "input region, the client owning said region will receive a"] + #[doc = "wp_tablet.proximity_in event, followed by a wp_tablet.down"] + #[doc = "event and a wp_tablet.frame event."] + #[doc = ""] + #[doc = "Note that this event describes logical contact, not physical"] + #[doc = "contact. On some devices, a compositor may not consider a tool in"] + #[doc = "logical contact until a minimum physical pressure threshold is"] + #[doc = "exceeded."] + async fn down(&self, serial: u32) -> crate::client::Result<()>; + #[doc = "Sent whenever the tablet tool stops making contact with the surface of"] + #[doc = "the tablet, or when the tablet tool moves out of the input region"] + #[doc = "and the compositor grab (if any) is dismissed."] + #[doc = ""] + #[doc = "If the tablet tool moves out of the input region while in contact"] + #[doc = "with the surface of the tablet and the compositor does not have an"] + #[doc = "ongoing grab on the surface, the client owning said region will"] + #[doc = "receive a wp_tablet.up event, followed by a wp_tablet.proximity_out"] + #[doc = "event and a wp_tablet.frame event. If the compositor has an ongoing"] + #[doc = "grab on this device, this event sequence is sent whenever the grab"] + #[doc = "is dismissed in the future."] + #[doc = ""] + #[doc = "Note that this event describes logical contact, not physical"] + #[doc = "contact. On some devices, a compositor may not consider a tool out"] + #[doc = "of logical contact until physical pressure falls below a specific"] + #[doc = "threshold."] + async fn up(&self) -> crate::client::Result<()>; + #[doc = "Sent whenever a tablet tool moves."] + async fn motion( + &self, + x: crate::wire::Fixed, + y: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "Sent whenever the pressure axis on a tool changes. The value of this"] + #[doc = "event is normalized to a value between 0 and 65535."] + #[doc = ""] + #[doc = "Note that pressure may be nonzero even when a tool is not in logical"] + #[doc = "contact. See the down and up events for more details."] + async fn pressure(&self, pressure: u32) -> crate::client::Result<()>; + #[doc = "Sent whenever the distance axis on a tool changes. The value of this"] + #[doc = "event is normalized to a value between 0 and 65535."] + #[doc = ""] + #[doc = "Note that distance may be nonzero even when a tool is not in logical"] + #[doc = "contact. See the down and up events for more details."] + async fn distance(&self, distance: u32) -> crate::client::Result<()>; + #[doc = "Sent whenever one or both of the tilt axes on a tool change. Each tilt"] + #[doc = "value is in degrees, relative to the z-axis of the tablet."] + #[doc = "The angle is positive when the top of a tool tilts along the"] + #[doc = "positive x or y axis."] + async fn tilt( + &self, + tilt_x: crate::wire::Fixed, + tilt_y: crate::wire::Fixed, + ) -> crate::client::Result<()>; + #[doc = "Sent whenever the z-rotation axis on the tool changes. The"] + #[doc = "rotation value is in degrees clockwise from the tool's"] + #[doc = "logical neutral position."] + async fn rotation(&self, degrees: crate::wire::Fixed) -> crate::client::Result<()>; + #[doc = "Sent whenever the slider position on the tool changes. The"] + #[doc = "value is normalized between -65535 and 65535, with 0 as the logical"] + #[doc = "neutral position of the slider."] + #[doc = ""] + #[doc = "The slider is available on e.g. the Wacom Airbrush tool."] + async fn slider(&self, position: i32) -> crate::client::Result<()>; + #[doc = "Sent whenever the wheel on the tool emits an event. This event"] + #[doc = "contains two values for the same axis change. The degrees value is"] + #[doc = "in the same orientation as the wl_pointer.vertical_scroll axis. The"] + #[doc = "clicks value is in discrete logical clicks of the mouse wheel. This"] + #[doc = "value may be zero if the movement of the wheel was less"] + #[doc = "than one logical click."] + #[doc = ""] + #[doc = "Clients should choose either value and avoid mixing degrees and"] + #[doc = "clicks. The compositor may accumulate values smaller than a logical"] + #[doc = "click and emulate click events when a certain threshold is met."] + #[doc = "Thus, wl_tablet_tool.wheel events with non-zero clicks values may"] + #[doc = "have different degrees values."] + async fn wheel( + &self, + degrees: crate::wire::Fixed, + clicks: i32, + ) -> crate::client::Result<()>; + #[doc = "Sent whenever a button on the tool is pressed or released."] + #[doc = ""] + #[doc = "If a button is held down when the tool moves in or out of proximity,"] + #[doc = "button events are generated by the compositor. See"] + #[doc = "wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for"] + #[doc = "details."] + async fn button( + &self, + serial: u32, + button: u32, + state: ButtonState, + ) -> crate::client::Result<()>; + #[doc = "Marks the end of a series of axis and/or button updates from the"] + #[doc = "tablet. The Wayland protocol requires axis updates to be sent"] + #[doc = "sequentially, however all events within a frame should be considered"] + #[doc = "one hardware event."] + async fn frame(&self, time: u32) -> crate::client::Result<()>; } } #[doc = "The wp_tablet interface represents one graphics tablet device. The"] @@ -3948,6 +4871,47 @@ pub mod tablet_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "A descriptive name for the tablet device."] + #[doc = ""] + #[doc = "If the device has no descriptive name, this event is not sent."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet.done event."] + async fn name(&self, name: String) -> crate::client::Result<()>; + #[doc = "The USB vendor and product IDs for the tablet device."] + #[doc = ""] + #[doc = "If the device has no USB vendor/product ID, this event is not sent."] + #[doc = "This can happen for virtual devices or non-USB devices, for instance."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet.done event."] + async fn id(&self, vid: u32, pid: u32) -> crate::client::Result<()>; + #[doc = "A system-specific device path that indicates which device is behind"] + #[doc = "this wp_tablet. This information may be used to gather additional"] + #[doc = "information about the device, e.g. through libwacom."] + #[doc = ""] + #[doc = "A device may have more than one device path. If so, multiple"] + #[doc = "wp_tablet.path events are sent. A device may be emulated and not"] + #[doc = "have a device path, and in that case this event will not be sent."] + #[doc = ""] + #[doc = "The format of the path is unspecified, it may be a device node, a"] + #[doc = "sysfs path, or some other identifier. It is up to the client to"] + #[doc = "identify the string provided."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet.done event."] + async fn path(&self, path: String) -> crate::client::Result<()>; + #[doc = "This event is sent immediately to signal the end of the initial"] + #[doc = "burst of descriptive events. A client may consider the static"] + #[doc = "description of the tablet to be complete and finalize initialization"] + #[doc = "of the tablet."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "Sent when the tablet has been removed from the system. When a tablet"] + #[doc = "is removed, some tools may be removed."] + #[doc = ""] + #[doc = "When this event is received, the client must wp_tablet.destroy"] + #[doc = "the object."] + async fn removed(&self) -> crate::client::Result<()>; } } #[doc = "A circular interaction area, such as the touch ring on the Wacom Intuos"] @@ -4040,6 +5004,49 @@ pub mod tablet_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Source information for ring events."] + #[doc = ""] + #[doc = "This event does not occur on its own. It is sent before a"] + #[doc = "wp_tablet_pad_ring.frame event and carries the source information"] + #[doc = "for all events within that frame."] + #[doc = ""] + #[doc = "The source specifies how this event was generated. If the source is"] + #[doc = "wp_tablet_pad_ring.source.finger, a wp_tablet_pad_ring.stop event"] + #[doc = "will be sent when the user lifts the finger off the device."] + #[doc = ""] + #[doc = "This event is optional. If the source is unknown for an interaction,"] + #[doc = "no event is sent."] + async fn source(&self, source: Source) -> crate::client::Result<()>; + #[doc = "Sent whenever the angle on a ring changes."] + #[doc = ""] + #[doc = "The angle is provided in degrees clockwise from the logical"] + #[doc = "north of the ring in the pad's current rotation."] + async fn angle(&self, degrees: crate::wire::Fixed) -> crate::client::Result<()>; + #[doc = "Stop notification for ring events."] + #[doc = ""] + #[doc = "For some wp_tablet_pad_ring.source types, a wp_tablet_pad_ring.stop"] + #[doc = "event is sent to notify a client that the interaction with the ring"] + #[doc = "has terminated. This enables the client to implement kinetic scrolling."] + #[doc = "See the wp_tablet_pad_ring.source documentation for information on"] + #[doc = "when this event may be generated."] + #[doc = ""] + #[doc = "Any wp_tablet_pad_ring.angle events with the same source after this"] + #[doc = "event should be considered as the start of a new interaction."] + async fn stop(&self) -> crate::client::Result<()>; + #[doc = "Indicates the end of a set of ring events that logically belong"] + #[doc = "together. A client is expected to accumulate the data in all events"] + #[doc = "within the frame before proceeding."] + #[doc = ""] + #[doc = "All wp_tablet_pad_ring events before a wp_tablet_pad_ring.frame event belong"] + #[doc = "logically together. For example, on termination of a finger interaction"] + #[doc = "on a ring the compositor will send a wp_tablet_pad_ring.source event,"] + #[doc = "a wp_tablet_pad_ring.stop event and a wp_tablet_pad_ring.frame event."] + #[doc = ""] + #[doc = "A wp_tablet_pad_ring.frame event is sent for every logical event"] + #[doc = "group, even if the group only contains a single wp_tablet_pad_ring"] + #[doc = "event. Specifically, a client may get a sequence: angle, frame,"] + #[doc = "angle, frame, etc."] + async fn frame(&self, time: u32) -> crate::client::Result<()>; } } #[doc = "A linear interaction area, such as the strips found in Wacom Cintiq"] @@ -4132,6 +5139,51 @@ pub mod tablet_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Source information for strip events."] + #[doc = ""] + #[doc = "This event does not occur on its own. It is sent before a"] + #[doc = "wp_tablet_pad_strip.frame event and carries the source information"] + #[doc = "for all events within that frame."] + #[doc = ""] + #[doc = "The source specifies how this event was generated. If the source is"] + #[doc = "wp_tablet_pad_strip.source.finger, a wp_tablet_pad_strip.stop event"] + #[doc = "will be sent when the user lifts their finger off the device."] + #[doc = ""] + #[doc = "This event is optional. If the source is unknown for an interaction,"] + #[doc = "no event is sent."] + async fn source(&self, source: Source) -> crate::client::Result<()>; + #[doc = "Sent whenever the position on a strip changes."] + #[doc = ""] + #[doc = "The position is normalized to a range of [0, 65535], the 0-value"] + #[doc = "represents the top-most and/or left-most position of the strip in"] + #[doc = "the pad's current rotation."] + async fn position(&self, position: u32) -> crate::client::Result<()>; + #[doc = "Stop notification for strip events."] + #[doc = ""] + #[doc = "For some wp_tablet_pad_strip.source types, a wp_tablet_pad_strip.stop"] + #[doc = "event is sent to notify a client that the interaction with the strip"] + #[doc = "has terminated. This enables the client to implement kinetic"] + #[doc = "scrolling. See the wp_tablet_pad_strip.source documentation for"] + #[doc = "information on when this event may be generated."] + #[doc = ""] + #[doc = "Any wp_tablet_pad_strip.position events with the same source after this"] + #[doc = "event should be considered as the start of a new interaction."] + async fn stop(&self) -> crate::client::Result<()>; + #[doc = "Indicates the end of a set of events that represent one logical"] + #[doc = "hardware strip event. A client is expected to accumulate the data"] + #[doc = "in all events within the frame before proceeding."] + #[doc = ""] + #[doc = "All wp_tablet_pad_strip events before a wp_tablet_pad_strip.frame event belong"] + #[doc = "logically together. For example, on termination of a finger interaction"] + #[doc = "on a strip the compositor will send a wp_tablet_pad_strip.source event,"] + #[doc = "a wp_tablet_pad_strip.stop event and a wp_tablet_pad_strip.frame"] + #[doc = "event."] + #[doc = ""] + #[doc = "A wp_tablet_pad_strip.frame event is sent for every logical event"] + #[doc = "group, even if the group only contains a single wp_tablet_pad_strip"] + #[doc = "event. Specifically, a client may get a sequence: position, frame,"] + #[doc = "position, frame, etc."] + async fn frame(&self, time: u32) -> crate::client::Result<()>; } } #[doc = "A pad group describes a distinct (sub)set of buttons, rings and strips"] @@ -4185,6 +5237,82 @@ pub mod tablet_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent on wp_tablet_pad_group initialization to announce the available"] + #[doc = "buttons in the group. Button indices start at 0, a button may only be"] + #[doc = "in one group at a time."] + #[doc = ""] + #[doc = "This event is first sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad_group.done event."] + #[doc = ""] + #[doc = "Some buttons are reserved by the compositor. These buttons may not be"] + #[doc = "assigned to any wp_tablet_pad_group. Compositors may broadcast this"] + #[doc = "event in the case of changes to the mapping of these reserved buttons."] + #[doc = "If the compositor happens to reserve all buttons in a group, this event"] + #[doc = "will be sent with an empty array."] + async fn buttons(&self, buttons: Vec) -> crate::client::Result<()>; + #[doc = "Sent on wp_tablet_pad_group initialization to announce available rings."] + #[doc = "One event is sent for each ring available on this pad group."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad_group.done event."] + async fn ring(&self, ring: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "Sent on wp_tablet_pad initialization to announce available strips."] + #[doc = "One event is sent for each strip available on this pad group."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad_group.done event."] + async fn strip(&self, strip: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "Sent on wp_tablet_pad_group initialization to announce that the pad"] + #[doc = "group may switch between modes. A client may use a mode to store a"] + #[doc = "specific configuration for buttons, rings and strips and use the"] + #[doc = "wl_tablet_pad_group.mode_switch event to toggle between these"] + #[doc = "configurations. Mode indices start at 0."] + #[doc = ""] + #[doc = "Switching modes is compositor-dependent. See the"] + #[doc = "wp_tablet_pad_group.mode_switch event for more details."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad_group.done event. This event is only sent when more than"] + #[doc = "more than one mode is available."] + async fn modes(&self, modes: u32) -> crate::client::Result<()>; + #[doc = "This event is sent immediately to signal the end of the initial"] + #[doc = "burst of descriptive events. A client may consider the static"] + #[doc = "description of the tablet to be complete and finalize initialization"] + #[doc = "of the tablet group."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "Notification that the mode was switched."] + #[doc = ""] + #[doc = "A mode applies to all buttons, rings and strips in a group"] + #[doc = "simultaneously, but a client is not required to assign different actions"] + #[doc = "for each mode. For example, a client may have mode-specific button"] + #[doc = "mappings but map the ring to vertical scrolling in all modes. Mode"] + #[doc = "indices start at 0."] + #[doc = ""] + #[doc = "Switching modes is compositor-dependent. The compositor may provide"] + #[doc = "visual cues to the client about the mode, e.g. by toggling LEDs on"] + #[doc = "the tablet device. Mode-switching may be software-controlled or"] + #[doc = "controlled by one or more physical buttons. For example, on a Wacom"] + #[doc = "Intuos Pro, the button inside the ring may be assigned to switch"] + #[doc = "between modes."] + #[doc = ""] + #[doc = "The compositor will also send this event after wp_tablet_pad.enter on"] + #[doc = "each group in order to notify of the current mode. Groups that only"] + #[doc = "feature one mode will use mode=0 when emitting this event."] + #[doc = ""] + #[doc = "If a button action in the new mode differs from the action in the"] + #[doc = "previous mode, the client should immediately issue a"] + #[doc = "wp_tablet_pad.set_feedback request for each changed button."] + #[doc = ""] + #[doc = "If a ring or strip action in the new mode differs from the action"] + #[doc = "in the previous mode, the client should immediately issue a"] + #[doc = "wp_tablet_ring.set_feedback or wp_tablet_strip.set_feedback request"] + #[doc = "for each changed ring or strip."] + async fn mode_switch( + &self, + time: u32, + serial: u32, + mode: u32, + ) -> crate::client::Result<()>; } } #[doc = "A pad device is a set of buttons, rings and strips"] @@ -4303,6 +5431,62 @@ pub mod tablet_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent on wp_tablet_pad initialization to announce available groups."] + #[doc = "One event is sent for each pad group available."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad.done event. At least one group will be announced."] + async fn group(&self, pad_group: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "A system-specific device path that indicates which device is behind"] + #[doc = "this wp_tablet_pad. This information may be used to gather additional"] + #[doc = "information about the device, e.g. through libwacom."] + #[doc = ""] + #[doc = "The format of the path is unspecified, it may be a device node, a"] + #[doc = "sysfs path, or some other identifier. It is up to the client to"] + #[doc = "identify the string provided."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad.done event."] + async fn path(&self, path: String) -> crate::client::Result<()>; + #[doc = "Sent on wp_tablet_pad initialization to announce the available"] + #[doc = "buttons."] + #[doc = ""] + #[doc = "This event is sent in the initial burst of events before the"] + #[doc = "wp_tablet_pad.done event. This event is only sent when at least one"] + #[doc = "button is available."] + async fn buttons(&self, buttons: u32) -> crate::client::Result<()>; + #[doc = "This event signals the end of the initial burst of descriptive"] + #[doc = "events. A client may consider the static description of the pad to"] + #[doc = "be complete and finalize initialization of the pad."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "Sent whenever the physical state of a button changes."] + async fn button( + &self, + time: u32, + button: u32, + state: ButtonState, + ) -> crate::client::Result<()>; + #[doc = "Notification that this pad is focused on the specified surface."] + async fn enter( + &self, + serial: u32, + tablet: crate::wire::ObjectId, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "Notification that this pad is no longer focused on the specified"] + #[doc = "surface."] + async fn leave( + &self, + serial: u32, + surface: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "Sent when the pad has been removed from the system. When a tablet"] + #[doc = "is removed its pad(s) will be removed too."] + #[doc = ""] + #[doc = "When this event is received, the client must destroy all rings, strips"] + #[doc = "and groups that were offered by this pad, and issue wp_tablet_pad.destroy"] + #[doc = "the pad itself."] + async fn removed(&self) -> crate::client::Result<()>; } } } @@ -4677,6 +5861,106 @@ pub mod text_input_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Notify the text_input object when it received focus. Typically in"] + #[doc = "response to an activate request."] + async fn enter(&self, surface: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "Notify the text_input object when it lost focus. Either in response"] + #[doc = "to a deactivate request or when the assigned surface lost focus or was"] + #[doc = "destroyed."] + async fn leave(&self) -> crate::client::Result<()>; + #[doc = "Transfer an array of 0-terminated modifier names. The position in"] + #[doc = "the array is the index of the modifier as used in the modifiers"] + #[doc = "bitmask in the keysym event."] + async fn modifiers_map(&self, map: Vec) -> crate::client::Result<()>; + #[doc = "Notify when the visibility state of the input panel changed."] + async fn input_panel_state(&self, state: u32) -> crate::client::Result<()>; + #[doc = "Notify when a new composing text (pre-edit) should be set around the"] + #[doc = "current cursor position. Any previously set composing text should"] + #[doc = "be removed."] + #[doc = ""] + #[doc = "The commit text can be used to replace the preedit text on reset"] + #[doc = "(for example on unfocus)."] + #[doc = ""] + #[doc = "The text input should also handle all preedit_style and preedit_cursor"] + #[doc = "events occurring directly before preedit_string."] + async fn preedit_string( + &self, + serial: u32, + text: String, + commit: String, + ) -> crate::client::Result<()>; + #[doc = "Sets styling information on composing text. The style is applied for"] + #[doc = "length bytes from index relative to the beginning of the composing"] + #[doc = "text (as byte offset). Multiple styles can"] + #[doc = "be applied to a composing text by sending multiple preedit_styling"] + #[doc = "events."] + #[doc = ""] + #[doc = "This event is handled as part of a following preedit_string event."] + async fn preedit_styling( + &self, + index: u32, + length: u32, + style: PreeditStyle, + ) -> crate::client::Result<()>; + #[doc = "Sets the cursor position inside the composing text (as byte"] + #[doc = "offset) relative to the start of the composing text. When index is a"] + #[doc = "negative number no cursor is shown."] + #[doc = ""] + #[doc = "This event is handled as part of a following preedit_string event."] + async fn preedit_cursor(&self, index: i32) -> crate::client::Result<()>; + #[doc = "Notify when text should be inserted into the editor widget. The text to"] + #[doc = "commit could be either just a single character after a key press or the"] + #[doc = "result of some composing (pre-edit). It could also be an empty text"] + #[doc = "when some text should be removed (see delete_surrounding_text) or when"] + #[doc = "the input cursor should be moved (see cursor_position)."] + #[doc = ""] + #[doc = "Any previously set composing text should be removed."] + async fn commit_string(&self, serial: u32, text: String) -> crate::client::Result<()>; + #[doc = "Notify when the cursor or anchor position should be modified."] + #[doc = ""] + #[doc = "This event should be handled as part of a following commit_string"] + #[doc = "event."] + async fn cursor_position(&self, index: i32, anchor: i32) -> crate::client::Result<()>; + #[doc = "Notify when the text around the current cursor position should be"] + #[doc = "deleted."] + #[doc = ""] + #[doc = "Index is relative to the current cursor (in bytes)."] + #[doc = "Length is the length of deleted text (in bytes)."] + #[doc = ""] + #[doc = "This event should be handled as part of a following commit_string"] + #[doc = "event."] + async fn delete_surrounding_text( + &self, + index: i32, + length: u32, + ) -> crate::client::Result<()>; + #[doc = "Notify when a key event was sent. Key events should not be used"] + #[doc = "for normal text input operations, which should be done with"] + #[doc = "commit_string, delete_surrounding_text, etc. The key event follows"] + #[doc = "the wl_keyboard key event convention. Sym is an XKB keysym, state a"] + #[doc = "wl_keyboard key_state. Modifiers are a mask for effective modifiers"] + #[doc = "(where the modifier indices are set by the modifiers_map event)"] + async fn keysym( + &self, + serial: u32, + time: u32, + sym: u32, + state: u32, + modifiers: u32, + ) -> crate::client::Result<()>; + #[doc = "Sets the language of the input text. The \"language\" argument is an"] + #[doc = "RFC-3066 format language tag."] + async fn language(&self, serial: u32, language: String) -> crate::client::Result<()>; + #[doc = "Sets the text direction of input text."] + #[doc = ""] + #[doc = "It is mainly needed for showing an input cursor on the correct side of"] + #[doc = "the editor when there is no input done yet and making sure neutral"] + #[doc = "direction text is laid out properly."] + async fn text_direction( + &self, + serial: u32, + direction: TextDirection, + ) -> crate::client::Result<()>; } } #[doc = "A factory for text_input objects. This object is a global singleton."] @@ -5116,6 +6400,107 @@ pub mod text_input_unstable_v3 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Notification that this seat's text-input focus is on a certain surface."] + #[doc = ""] + #[doc = "If client has created multiple text input objects, compositor must send"] + #[doc = "this event to all of them."] + #[doc = ""] + #[doc = "When the seat has the keyboard capability the text-input focus follows"] + #[doc = "the keyboard focus. This event sets the current surface for the"] + #[doc = "text-input object."] + async fn enter(&self, surface: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "Notification that this seat's text-input focus is no longer on a"] + #[doc = "certain surface. The client should reset any preedit string previously"] + #[doc = "set."] + #[doc = ""] + #[doc = "The leave notification clears the current surface. It is sent before"] + #[doc = "the enter notification for the new focus. After leave event, compositor"] + #[doc = "must ignore requests from any text input instances until next enter"] + #[doc = "event."] + #[doc = ""] + #[doc = "When the seat has the keyboard capability the text-input focus follows"] + #[doc = "the keyboard focus."] + async fn leave(&self, surface: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "Notify when a new composing text (pre-edit) should be set at the"] + #[doc = "current cursor position. Any previously set composing text must be"] + #[doc = "removed. Any previously existing selected text must be removed."] + #[doc = ""] + #[doc = "The argument text contains the pre-edit string buffer."] + #[doc = ""] + #[doc = "The parameters cursor_begin and cursor_end are counted in bytes"] + #[doc = "relative to the beginning of the submitted text buffer. Cursor should"] + #[doc = "be hidden when both are equal to -1."] + #[doc = ""] + #[doc = "They could be represented by the client as a line if both values are"] + #[doc = "the same, or as a text highlight otherwise."] + #[doc = ""] + #[doc = "Values set with this event are double-buffered. They must be applied"] + #[doc = "and reset to initial on the next zwp_text_input_v3.done event."] + #[doc = ""] + #[doc = "The initial value of text is an empty string, and cursor_begin,"] + #[doc = "cursor_end and cursor_hidden are all 0."] + async fn preedit_string( + &self, + text: Option, + cursor_begin: i32, + cursor_end: i32, + ) -> crate::client::Result<()>; + #[doc = "Notify when text should be inserted into the editor widget. The text to"] + #[doc = "commit could be either just a single character after a key press or the"] + #[doc = "result of some composing (pre-edit)."] + #[doc = ""] + #[doc = "Values set with this event are double-buffered. They must be applied"] + #[doc = "and reset to initial on the next zwp_text_input_v3.done event."] + #[doc = ""] + #[doc = "The initial value of text is an empty string."] + async fn commit_string(&self, text: Option) -> crate::client::Result<()>; + #[doc = "Notify when the text around the current cursor position should be"] + #[doc = "deleted."] + #[doc = ""] + #[doc = "Before_length and after_length are the number of bytes before and after"] + #[doc = "the current cursor index (excluding the selection) to delete."] + #[doc = ""] + #[doc = "If a preedit text is present, in effect before_length is counted from"] + #[doc = "the beginning of it, and after_length from its end (see done event"] + #[doc = "sequence)."] + #[doc = ""] + #[doc = "Values set with this event are double-buffered. They must be applied"] + #[doc = "and reset to initial on the next zwp_text_input_v3.done event."] + #[doc = ""] + #[doc = "The initial values of both before_length and after_length are 0."] + async fn delete_surrounding_text( + &self, + before_length: u32, + after_length: u32, + ) -> crate::client::Result<()>; + #[doc = "Instruct the application to apply changes to state requested by the"] + #[doc = "preedit_string, commit_string and delete_surrounding_text events. The"] + #[doc = "state relating to these events is double-buffered, and each one"] + #[doc = "modifies the pending state. This event replaces the current state with"] + #[doc = "the pending state."] + #[doc = ""] + #[doc = "The application must proceed by evaluating the changes in the following"] + #[doc = "order:"] + #[doc = ""] + #[doc = "1. Replace existing preedit string with the cursor."] + #[doc = "2. Delete requested surrounding text."] + #[doc = "3. Insert commit string with the cursor at its end."] + #[doc = "4. Calculate surrounding text to send."] + #[doc = "5. Insert new preedit text in cursor position."] + #[doc = "6. Place cursor inside preedit text."] + #[doc = ""] + #[doc = "The serial number reflects the last state of the zwp_text_input_v3"] + #[doc = "object known to the compositor. The value of the serial argument must"] + #[doc = "be equal to the number of commit requests already issued on that object."] + #[doc = ""] + #[doc = "When the client receives a done event with a serial different than the"] + #[doc = "number of past commit requests, it must proceed with evaluating and"] + #[doc = "applying the changes as normal, except it should not change the current"] + #[doc = "state of the zwp_text_input_v3 object. All pending state requests"] + #[doc = "(set_surrounding_text, set_content_type and set_cursor_rectangle) on"] + #[doc = "the zwp_text_input_v3 object should be sent and committed after"] + #[doc = "receiving a zwp_text_input_v3.done event with a matching serial."] + async fn done(&self, serial: u32) -> crate::client::Result<()>; } } #[doc = "A factory for text-input objects. This object is a global singleton."] @@ -5388,6 +6773,14 @@ pub mod xdg_decoration_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The configure event configures the effective decoration mode. The"] + #[doc = "configured state should not be applied immediately. Clients must send an"] + #[doc = "ack_configure in response to this event. See xdg_surface.configure and"] + #[doc = "xdg_surface.ack_configure for details."] + #[doc = ""] + #[doc = "A configure event can be sent at any time. The specified mode must be"] + #[doc = "obeyed by the client."] + async fn configure(&self, mode: Mode) -> crate::client::Result<()>; } } } @@ -5573,6 +6966,11 @@ pub mod xdg_foreign_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The handle event contains the unique handle of this exported surface"] + #[doc = "reference. It may be shared with any client, which then can use it to"] + #[doc = "import the surface by calling xdg_importer.import. A handle may be"] + #[doc = "used to import the surface multiple times."] + async fn handle(&self, handle: String) -> crate::client::Result<()>; } } #[doc = "An xdg_imported object represents an imported reference to surface exported"] @@ -5628,6 +7026,11 @@ pub mod xdg_foreign_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The imported surface handle has been destroyed and any relationship set"] + #[doc = "up has been invalidated. This may happen for various reasons, for"] + #[doc = "example if the exported surface or the exported surface handle has been"] + #[doc = "destroyed, if the handle used for importing was invalid."] + async fn destroyed(&self) -> crate::client::Result<()>; } } } @@ -5832,6 +7235,11 @@ pub mod xdg_foreign_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The handle event contains the unique handle of this exported surface"] + #[doc = "reference. It may be shared with any client, which then can use it to"] + #[doc = "import the surface by calling xdg_importer.import_toplevel. A handle"] + #[doc = "may be used to import the surface multiple times."] + async fn handle(&self, handle: String) -> crate::client::Result<()>; } } #[doc = "An xdg_imported object represents an imported reference to surface exported"] @@ -5906,6 +7314,11 @@ pub mod xdg_foreign_unstable_v2 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The imported surface handle has been destroyed and any relationship set"] + #[doc = "up has been invalidated. This may happen for various reasons, for"] + #[doc = "example if the exported surface or the exported surface handle has been"] + #[doc = "destroyed, if the handle used for importing was invalid."] + async fn destroyed(&self) -> crate::client::Result<()>; } } } @@ -6030,6 +7443,95 @@ pub mod xdg_output_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The position event describes the location of the wl_output within"] + #[doc = "the global compositor space."] + #[doc = ""] + #[doc = "The logical_position event is sent after creating an xdg_output"] + #[doc = "(see xdg_output_manager.get_xdg_output) and whenever the location"] + #[doc = "of the output changes within the global compositor space."] + async fn logical_position(&self, x: i32, y: i32) -> crate::client::Result<()>; + #[doc = "The logical_size event describes the size of the output in the"] + #[doc = "global compositor space."] + #[doc = ""] + #[doc = "Most regular Wayland clients should not pay attention to the"] + #[doc = "logical size and would rather rely on xdg_shell interfaces."] + #[doc = ""] + #[doc = "Some clients such as Xwayland, however, need this to configure"] + #[doc = "their surfaces in the global compositor space as the compositor"] + #[doc = "may apply a different scale from what is advertised by the output"] + #[doc = "scaling property (to achieve fractional scaling, for example)."] + #[doc = ""] + #[doc = "For example, for a wl_output mode 3840×2160 and a scale factor 2:"] + #[doc = ""] + #[doc = "- A compositor not scaling the monitor viewport in its compositing space"] + #[doc = "will advertise a logical size of 3840×2160,"] + #[doc = ""] + #[doc = "- A compositor scaling the monitor viewport with scale factor 2 will"] + #[doc = "advertise a logical size of 1920×1080,"] + #[doc = ""] + #[doc = "- A compositor scaling the monitor viewport using a fractional scale of"] + #[doc = "1.5 will advertise a logical size of 2560×1440."] + #[doc = ""] + #[doc = "For example, for a wl_output mode 1920×1080 and a 90 degree rotation,"] + #[doc = "the compositor will advertise a logical size of 1080x1920."] + #[doc = ""] + #[doc = "The logical_size event is sent after creating an xdg_output"] + #[doc = "(see xdg_output_manager.get_xdg_output) and whenever the logical"] + #[doc = "size of the output changes, either as a result of a change in the"] + #[doc = "applied scale or because of a change in the corresponding output"] + #[doc = "mode(see wl_output.mode) or transform (see wl_output.transform)."] + async fn logical_size(&self, width: i32, height: i32) -> crate::client::Result<()>; + #[doc = "This event is sent after all other properties of an xdg_output"] + #[doc = "have been sent."] + #[doc = ""] + #[doc = "This allows changes to the xdg_output properties to be seen as"] + #[doc = "atomic, even if they happen via multiple events."] + #[doc = ""] + #[doc = "For objects version 3 onwards, this event is deprecated. Compositors"] + #[doc = "are not required to send it anymore and must send wl_output.done"] + #[doc = "instead."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "Many compositors will assign names to their outputs, show them to the"] + #[doc = "user, allow them to be configured by name, etc. The client may wish to"] + #[doc = "know this name as well to offer the user similar behaviors."] + #[doc = ""] + #[doc = "The naming convention is compositor defined, but limited to"] + #[doc = "alphanumeric characters and dashes (-). Each name is unique among all"] + #[doc = "wl_output globals, but if a wl_output global is destroyed the same name"] + #[doc = "may be reused later. The names will also remain consistent across"] + #[doc = "sessions with the same hardware and software configuration."] + #[doc = ""] + #[doc = "Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do"] + #[doc = "not assume that the name is a reflection of an underlying DRM"] + #[doc = "connector, X11 connection, etc."] + #[doc = ""] + #[doc = "The name event is sent after creating an xdg_output (see"] + #[doc = "xdg_output_manager.get_xdg_output). This event is only sent once per"] + #[doc = "xdg_output, and the name does not change over the lifetime of the"] + #[doc = "wl_output global."] + #[doc = ""] + #[doc = "This event is deprecated, instead clients should use wl_output.name."] + #[doc = "Compositors must still support this event."] + async fn name(&self, name: String) -> crate::client::Result<()>; + #[doc = "Many compositors can produce human-readable descriptions of their"] + #[doc = "outputs. The client may wish to know this description as well, to"] + #[doc = "communicate the user for various purposes."] + #[doc = ""] + #[doc = "The description is a UTF-8 string with no convention defined for its"] + #[doc = "contents. Examples might include 'Foocorp 11\" Display' or 'Virtual X11"] + #[doc = "output via :1'."] + #[doc = ""] + #[doc = "The description event is sent after creating an xdg_output (see"] + #[doc = "xdg_output_manager.get_xdg_output) and whenever the description"] + #[doc = "changes. The description is optional, and may not be sent at all."] + #[doc = ""] + #[doc = "For objects of version 2 and lower, this event is only sent once per"] + #[doc = "xdg_output, and the description does not change over the lifetime of"] + #[doc = "the wl_output global."] + #[doc = ""] + #[doc = "This event is deprecated, instead clients should use"] + #[doc = "wl_output.description. Compositors must still support this event."] + async fn description(&self, description: String) -> crate::client::Result<()>; } } } @@ -6213,6 +7715,18 @@ pub mod xdg_shell_unstable_v5 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The ping event asks the client if it's still alive. Pass the"] + #[doc = "serial specified in the event back to the compositor by sending"] + #[doc = "a \"pong\" request back with the specified serial."] + #[doc = ""] + #[doc = "Compositors can use this to determine if the client is still"] + #[doc = "alive. It's unspecified what will happen if the client doesn't"] + #[doc = "respond to the ping request, or in what timeframe. Clients should"] + #[doc = "try to respond in a reasonable amount of time."] + #[doc = ""] + #[doc = "A compositor is free to ping in any way it wants, but a client must"] + #[doc = "always respond to any xdg_shell object it created."] + async fn ping(&self, serial: u32) -> crate::client::Result<()>; } } #[doc = "An interface that may be implemented by a wl_surface, for"] @@ -6734,6 +8248,46 @@ pub mod xdg_shell_unstable_v5 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The configure event asks the client to resize its surface or to"] + #[doc = "change its state."] + #[doc = ""] + #[doc = "The width and height arguments specify a hint to the window"] + #[doc = "about how its surface should be resized in window geometry"] + #[doc = "coordinates. See set_window_geometry."] + #[doc = ""] + #[doc = "If the width or height arguments are zero, it means the client"] + #[doc = "should decide its own window dimension. This may happen when the"] + #[doc = "compositor need to configure the state of the surface but doesn't"] + #[doc = "have any information about any previous or expected dimension."] + #[doc = ""] + #[doc = "The states listed in the event specify how the width/height"] + #[doc = "arguments should be interpreted, and possibly how it should be"] + #[doc = "drawn."] + #[doc = ""] + #[doc = "Clients should arrange their surface for the new size and"] + #[doc = "states, and then send a ack_configure request with the serial"] + #[doc = "sent in this configure event at some point before committing"] + #[doc = "the new surface."] + #[doc = ""] + #[doc = "If the client receives multiple configure events before it"] + #[doc = "can respond to one, it is free to discard all but the last"] + #[doc = "event it received."] + async fn configure( + &self, + width: i32, + height: i32, + states: Vec, + serial: u32, + ) -> crate::client::Result<()>; + #[doc = "The close event is sent by the compositor when the user"] + #[doc = "wants the surface to be closed. This should be equivalent to"] + #[doc = "the user clicking the close button in client-side decorations,"] + #[doc = "if your application has any..."] + #[doc = ""] + #[doc = "This is only a request that the user intends to close your"] + #[doc = "window. The client may choose to ignore this request, or show"] + #[doc = "a dialog to ask the user to save their data..."] + async fn close(&self) -> crate::client::Result<()>; } } #[doc = "A popup surface is a short-lived, temporary surface that can be"] @@ -6820,6 +8374,10 @@ pub mod xdg_shell_unstable_v5 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The popup_done event is sent out when a popup is dismissed by the"] + #[doc = "compositor. The client should destroy the xdg_popup object at this"] + #[doc = "point."] + async fn popup_done(&self) -> crate::client::Result<()>; } } } @@ -6954,6 +8512,18 @@ pub mod xdg_shell_unstable_v6 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The ping event asks the client if it's still alive. Pass the"] + #[doc = "serial specified in the event back to the compositor by sending"] + #[doc = "a \"pong\" request back with the specified serial. See xdg_shell.ping."] + #[doc = ""] + #[doc = "Compositors can use this to determine if the client is still"] + #[doc = "alive. It's unspecified what will happen if the client doesn't"] + #[doc = "respond to the ping request, or in what timeframe. Clients should"] + #[doc = "try to respond in a reasonable amount of time."] + #[doc = ""] + #[doc = "A compositor is free to ping in any way it wants, but a client must"] + #[doc = "always respond to any xdg_shell object it created."] + async fn ping(&self, serial: u32) -> crate::client::Result<()>; } } #[doc = "The xdg_positioner provides a collection of rules for the placement of a"] @@ -7410,6 +8980,23 @@ pub mod xdg_shell_unstable_v6 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The configure event marks the end of a configure sequence. A configure"] + #[doc = "sequence is a set of one or more events configuring the state of the"] + #[doc = "xdg_surface, including the final xdg_surface.configure event."] + #[doc = ""] + #[doc = "Where applicable, xdg_surface surface roles will during a configure"] + #[doc = "sequence extend this event as a latched state sent as events before the"] + #[doc = "xdg_surface.configure event. Such events should be considered to make up"] + #[doc = "a set of atomically applied configuration states, where the"] + #[doc = "xdg_surface.configure commits the accumulated state."] + #[doc = ""] + #[doc = "Clients should arrange their surface for the new states, and then send"] + #[doc = "an ack_configure request with the serial sent in this configure event at"] + #[doc = "some point before committing the new surface."] + #[doc = ""] + #[doc = "If the client receives multiple configure events before it can respond"] + #[doc = "to one, it is free to discard all but the last event it received."] + async fn configure(&self, serial: u32) -> crate::client::Result<()>; } } #[doc = "This interface defines an xdg_surface role which allows a surface to,"] @@ -7928,6 +9515,40 @@ pub mod xdg_shell_unstable_v6 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This configure event asks the client to resize its toplevel surface or"] + #[doc = "to change its state. The configured state should not be applied"] + #[doc = "immediately. See xdg_surface.configure for details."] + #[doc = ""] + #[doc = "The width and height arguments specify a hint to the window"] + #[doc = "about how its surface should be resized in window geometry"] + #[doc = "coordinates. See set_window_geometry."] + #[doc = ""] + #[doc = "If the width or height arguments are zero, it means the client"] + #[doc = "should decide its own window dimension. This may happen when the"] + #[doc = "compositor needs to configure the state of the surface but doesn't"] + #[doc = "have any information about any previous or expected dimension."] + #[doc = ""] + #[doc = "The states listed in the event specify how the width/height"] + #[doc = "arguments should be interpreted, and possibly how it should be"] + #[doc = "drawn."] + #[doc = ""] + #[doc = "Clients must send an ack_configure in response to this event. See"] + #[doc = "xdg_surface.configure and xdg_surface.ack_configure for details."] + async fn configure( + &self, + width: i32, + height: i32, + states: Vec, + ) -> crate::client::Result<()>; + #[doc = "The close event is sent by the compositor when the user"] + #[doc = "wants the surface to be closed. This should be equivalent to"] + #[doc = "the user clicking the close button in client-side decorations,"] + #[doc = "if your application has any."] + #[doc = ""] + #[doc = "This is only a request that the user intends to close the"] + #[doc = "window. The client may choose to ignore this request, or show"] + #[doc = "a dialog to ask the user to save their data, etc."] + async fn close(&self) -> crate::client::Result<()>; } } #[doc = "A popup surface is a short-lived, temporary surface. It can be used to"] @@ -8070,6 +9691,24 @@ pub mod xdg_shell_unstable_v6 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event asks the popup surface to configure itself given the"] + #[doc = "configuration. The configured state should not be applied immediately."] + #[doc = "See xdg_surface.configure for details."] + #[doc = ""] + #[doc = "The x and y arguments represent the position the popup was placed at"] + #[doc = "given the xdg_positioner rule, relative to the upper left corner of the"] + #[doc = "window geometry of the parent surface."] + async fn configure( + &self, + x: i32, + y: i32, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "The popup_done event is sent out when a popup is dismissed by the"] + #[doc = "compositor. The client should destroy the xdg_popup object at this"] + #[doc = "point."] + async fn popup_done(&self) -> crate::client::Result<()>; } } } diff --git a/src/client/protocol/weston.rs b/src/client/protocol/weston.rs index d7d36c8..0baebeb 100644 --- a/src/client/protocol/weston.rs +++ b/src/client/protocol/weston.rs @@ -362,6 +362,26 @@ pub mod color_management_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "When this object is created, it shall immediately send this event once"] + #[doc = "for each rendering intent the compositor supports."] + async fn supported_intent( + &self, + render_intent: RenderIntent, + ) -> crate::client::Result<()>; + #[doc = "When this object is created, it shall immediately send this event once"] + #[doc = "for each compositor supported feature listed in the enumeration."] + async fn supported_feature(&self, feature: Feature) -> crate::client::Result<()>; + #[doc = "When this object is created, it shall immediately send this event once"] + #[doc = "for each named transfer function the compositor supports with the"] + #[doc = "parametric image description creator."] + async fn supported_tf_named(&self, tf: TransferFunction) -> crate::client::Result<()>; + #[doc = "When this object is created, it shall immediately send this event once"] + #[doc = "for each named set of primaries the compositor supports with the"] + #[doc = "parametric image description creator."] + async fn supported_primaries_named( + &self, + primaries: Primaries, + ) -> crate::client::Result<()>; } } #[doc = "A xx_color_management_output_v4 describes the color properties of an"] @@ -450,6 +470,14 @@ pub mod color_management_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent whenever the image description of the output changed,"] + #[doc = "followed by one wl_output.done event common to output events across all"] + #[doc = "extensions."] + #[doc = ""] + #[doc = "If the client wants to use the updated image description, it needs to do"] + #[doc = "get_image_description again, because image description objects are"] + #[doc = "immutable."] + async fn image_description_changed(&self) -> crate::client::Result<()>; } } #[doc = "A xx_color_management_surface_v4 allows the client to set the color"] @@ -673,6 +701,22 @@ pub mod color_management_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The preferred image description is the one which likely has the most"] + #[doc = "performance and/or quality benefits for the compositor if used by the"] + #[doc = "client for its wl_surface contents. This event is sent whenever the"] + #[doc = "compositor changes the wl_surface's preferred image description."] + #[doc = ""] + #[doc = "This event is merely a notification. When the client wants to know"] + #[doc = "what the preferred image description is, it shall use the get_preferred"] + #[doc = "request."] + #[doc = ""] + #[doc = "The preferred image description is not automatically used for anything."] + #[doc = "It is only a hint, and clients may set any valid image description with"] + #[doc = "set_image_description but there might be performance and color accuracy"] + #[doc = "improvements by providing the wl_surface contents in the preferred"] + #[doc = "image description. Therefore clients that can, should render according"] + #[doc = "to the preferred image description"] + async fn preferred_changed(&self) -> crate::client::Result<()>; } } #[doc = "This type of object is used for collecting all the information required"] @@ -1426,6 +1470,44 @@ pub mod color_management_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "If creating a xx_image_description_v4 object fails for a reason that is"] + #[doc = "not defined as a protocol error, this event is sent."] + #[doc = ""] + #[doc = "The requests that create image description objects define whether and"] + #[doc = "when this can occur. Only such creation requests can trigger this event."] + #[doc = "This event cannot be triggered after the image description was"] + #[doc = "successfully formed."] + #[doc = ""] + #[doc = "Once this event has been sent, the xx_image_description_v4 object will"] + #[doc = "never become ready and it can only be destroyed."] + async fn failed(&self, cause: Cause, msg: String) -> crate::client::Result<()>; + #[doc = "Once this event has been sent, the xx_image_description_v4 object is"] + #[doc = "deemed \"ready\". Ready objects can be used to send requests and can be"] + #[doc = "used through other interfaces."] + #[doc = ""] + #[doc = "Every ready xx_image_description_v4 protocol object refers to an"] + #[doc = "underlying image description record in the compositor. Multiple protocol"] + #[doc = "objects may end up referring to the same record. Clients may identify"] + #[doc = "these \"copies\" by comparing their id numbers: if the numbers from two"] + #[doc = "protocol objects are identical, the protocol objects refer to the same"] + #[doc = "image description record. Two different image description records"] + #[doc = "cannot have the same id number simultaneously. The id number does not"] + #[doc = "change during the lifetime of the image description record."] + #[doc = ""] + #[doc = "The id number is valid only as long as the protocol object is alive. If"] + #[doc = "all protocol objects referring to the same image description record are"] + #[doc = "destroyed, the id number may be recycled for a different image"] + #[doc = "description record."] + #[doc = ""] + #[doc = "Image description id number is not a protocol object id. Zero is"] + #[doc = "reserved as an invalid id number. It shall not be possible for a client"] + #[doc = "to refer to an image description by its id number in protocol. The id"] + #[doc = "numbers might not be portable between Wayland connections."] + #[doc = ""] + #[doc = "This identity allows clients to de-duplicate image description records"] + #[doc = "and avoid get_information request if they already have the image"] + #[doc = "description information."] + async fn ready(&self, identity: u32) -> crate::client::Result<()>; } } #[doc = "Sends all matching events describing an image description object exactly"] @@ -1451,6 +1533,117 @@ pub mod color_management_v1 { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "Signals the end of information events and destroys the object."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "The icc argument provides a file descriptor to the client which may be"] + #[doc = "memory-mapped to provide the ICC profile matching the image description."] + #[doc = "The fd is read-only, and if mapped then it must be mapped with"] + #[doc = "MAP_PRIVATE by the client."] + #[doc = ""] + #[doc = "The ICC profile version and other details are determined by the"] + #[doc = "compositor. There is no provision for a client to ask for a specific"] + #[doc = "kind of a profile."] + async fn icc_file( + &self, + icc: rustix::fd::OwnedFd, + icc_size: u32, + ) -> crate::client::Result<()>; + #[doc = "Delivers the primary color volume primaries and white point using CIE"] + #[doc = "1931 xy chromaticity coordinates."] + #[doc = ""] + #[doc = "Each coordinate value is multiplied by 10000 to get the argument value"] + #[doc = "to carry precision of 4 decimals."] + async fn primaries( + &self, + r_x: i32, + r_y: i32, + g_x: i32, + g_y: i32, + b_x: i32, + b_y: i32, + w_x: i32, + w_y: i32, + ) -> crate::client::Result<()>; + #[doc = "Delivers the primary color volume primaries and white point using an"] + #[doc = "explicitly enumerated named set."] + async fn primaries_named( + &self, + primaries : super :: super :: super :: weston :: color_management_v1 :: xx_color_manager_v4 :: Primaries, + ) -> crate::client::Result<()>; + #[doc = "The color component transfer characteristic of this image description is"] + #[doc = "a pure power curve. This event provides the exponent of the power"] + #[doc = "function. This curve represents the conversion from electrical to"] + #[doc = "optical pixel or color values."] + #[doc = ""] + #[doc = "The curve exponent has been multiplied by 10000 to get the argument eexp"] + #[doc = "value to carry the precision of 4 decimals."] + async fn tf_power(&self, eexp: u32) -> crate::client::Result<()>; + #[doc = "Delivers the transfer characteristic using an explicitly enumerated"] + #[doc = "named function."] + async fn tf_named( + &self, + tf : super :: super :: super :: weston :: color_management_v1 :: xx_color_manager_v4 :: TransferFunction, + ) -> crate::client::Result<()>; + #[doc = "Delivers the primary color volume luminance range and the reference"] + #[doc = "white luminance level."] + #[doc = ""] + #[doc = "The minimum luminance is multiplied by 10000 to get the argument"] + #[doc = "'min_lum' value and carries precision of 4 decimals. The maximum"] + #[doc = "luminance and reference white luminance values are unscaled."] + async fn luminances( + &self, + min_lum: u32, + max_lum: u32, + reference_lum: u32, + ) -> crate::client::Result<()>; + #[doc = "Provides the color primaries and white point of the target color volume"] + #[doc = "using CIE 1931 xy chromaticity coordinates. This is compatible with the"] + #[doc = "SMPTE ST 2086 definition of HDR static metadata for mastering displays."] + #[doc = ""] + #[doc = "While primary color volume is about how color is encoded, the target"] + #[doc = "color volume is the actually displayable color volume. If target color"] + #[doc = "volume is equal to the primary color volume, then this event is not"] + #[doc = "sent."] + #[doc = ""] + #[doc = "Each coordinate value is multiplied by 10000 to get the argument value"] + #[doc = "to carry precision of 4 decimals."] + async fn target_primaries( + &self, + r_x: i32, + r_y: i32, + g_x: i32, + g_y: i32, + b_x: i32, + b_y: i32, + w_x: i32, + w_y: i32, + ) -> crate::client::Result<()>; + #[doc = "Provides the luminance range that the image description is targeting as"] + #[doc = "the minimum and maximum absolute luminance L. This is compatible with"] + #[doc = "the SMPTE ST 2086 definition of HDR static metadata."] + #[doc = ""] + #[doc = "This luminance range is only theoretical and may not correspond to the"] + #[doc = "luminance of light emitted on an actual display."] + #[doc = ""] + #[doc = "Min L value is multiplied by 10000 to get the argument min_lum value and"] + #[doc = "carry precision of 4 decimals. Max L value is unscaled for max_lum."] + async fn target_luminance( + &self, + min_lum: u32, + max_lum: u32, + ) -> crate::client::Result<()>; + #[doc = "Provides the targeted max_cll of the image description. max_cll is"] + #[doc = "defined by CTA-861-H."] + #[doc = ""] + #[doc = "This luminance is only theoretical and may not correspond to the"] + #[doc = "luminance of light emitted on an actual display."] + async fn target_max_cll(&self, max_cll: u32) -> crate::client::Result<()>; + #[doc = "Provides the targeted max_fall of the image description. max_fall is"] + #[doc = "defined by CTA-861-H."] + #[doc = ""] + #[doc = "This luminance is only theoretical and may not correspond to the"] + #[doc = "luminance of light emitted on an actual display."] + async fn target_max_fall(&self, max_fall: u32) -> crate::client::Result<()>; } } } @@ -1486,6 +1679,18 @@ pub mod ivi_application { .await .map_err(crate::client::Error::IoError) } + #[doc = "The configure event asks the client to resize its surface."] + #[doc = ""] + #[doc = "The size is a hint, in the sense that the client is free to"] + #[doc = "ignore it if it doesn't resize, pick a smaller size (to"] + #[doc = "satisfy aspect ratio or resize in steps of NxM pixels)."] + #[doc = ""] + #[doc = "The client is free to dismiss all but the last configure"] + #[doc = "event it received."] + #[doc = ""] + #[doc = "The width and height arguments specify the size of the window"] + #[doc = "in surface-local coordinates."] + async fn configure(&self, width: i32, height: i32) -> crate::client::Result<()>; } } #[doc = "This interface is exposed as a global singleton."] @@ -1707,6 +1912,7 @@ pub mod ivi_hmi_controller { .await .map_err(crate::client::Error::IoError) } + async fn workspace_end_control(&self, is_controlled: i32) -> crate::client::Result<()>; } } } @@ -2046,6 +2252,31 @@ pub mod weston_content_protection { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is sent to the client to inform about the actual protection"] + #[doc = "level for its surface in the relax mode."] + #[doc = ""] + #[doc = "The 'type' argument indicates what that current level of content"] + #[doc = "protection that the server has currently established."] + #[doc = ""] + #[doc = "The 'status' event is first sent, when a weston_protected_surface is"] + #[doc = "created."] + #[doc = ""] + #[doc = "Until this event is sent for the first time, the client should assume"] + #[doc = "that its contents are not secure, and the type is 'unprotected'."] + #[doc = ""] + #[doc = "Possible reasons the content protection status can change is due to"] + #[doc = "change in censored-visibility mode from enforced to relaxed, a new"] + #[doc = "connector being added, movement of window to another output, or,"] + #[doc = "the client attaching a buffer too large for what the server may secure."] + #[doc = "However, it is not limited to these reasons."] + #[doc = ""] + #[doc = "A client may want to listen to this event and lower the resolution of"] + #[doc = "their content until it can successfully be shown securely."] + #[doc = ""] + #[doc = "In case of \"enforce\" mode, the client will not get any status event."] + #[doc = "If the mode is then changed to \"relax\", the client will receive the"] + #[doc = "status event."] + async fn status(&self, r#type: Type) -> crate::client::Result<()>; } } } @@ -2128,6 +2359,15 @@ pub mod weston_debug { .await .map_err(crate::client::Error::IoError) } + #[doc = "Advertises an available debug scope which the client may be able to"] + #[doc = "bind to. No information is provided by the server about the content"] + #[doc = "contained within the debug streams provided by the scope, once a"] + #[doc = "client has subscribed."] + async fn available( + &self, + name: String, + description: Option, + ) -> crate::client::Result<()>; } } #[doc = "Represents one subscribed debug stream, created with"] @@ -2169,6 +2409,21 @@ pub mod weston_debug { .await .map_err(crate::client::Error::IoError) } + #[doc = "The server has successfully finished writing to and has closed the"] + #[doc = "associated file descriptor."] + #[doc = ""] + #[doc = "This event is delivered only for one-shot debug streams where the"] + #[doc = "server dumps some data and stop. This is never delivered for"] + #[doc = "continuous debbug streams because they by definition never complete."] + async fn complete(&self) -> crate::client::Result<()>; + #[doc = "The server has stopped writing to and has closed the"] + #[doc = "associated file descriptor. The data already written to the file"] + #[doc = "descriptor is correct, but it may be truncated."] + #[doc = ""] + #[doc = "This event may be delivered at any time and for any kind of debug"] + #[doc = "stream. It may be due to a failure in or shutdown of the server."] + #[doc = "The message argument may provide a hint of the reason."] + async fn failure(&self, message: Option) -> crate::client::Result<()>; } } } @@ -2383,6 +2638,22 @@ pub mod weston_desktop { .await .map_err(crate::client::Error::IoError) } + async fn configure( + &self, + edges: u32, + surface: crate::wire::ObjectId, + width: i32, + height: i32, + ) -> crate::client::Result<()>; + #[doc = "Tell the client we want it to create and set the lock surface, which is"] + #[doc = "a GUI asking the user to unlock the screen. The lock surface is"] + #[doc = "announced with 'set_lock_surface'. Whether or not the client actually"] + #[doc = "implements locking, it MUST send 'unlock' request to let the normal"] + #[doc = "desktop resume."] + async fn prepare_lock_surface(&self) -> crate::client::Result<()>; + #[doc = "This event will be sent immediately before a fake enter event on the"] + #[doc = "grab surface."] + async fn grab_cursor(&self, cursor: u32) -> crate::client::Result<()>; } } #[doc = "Only one client can bind this interface at a time."] @@ -2732,6 +3003,45 @@ pub mod weston_output_capture { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event delivers the pixel format that should be used for the"] + #[doc = "image buffer. Any buffer is incompatible if it does not have"] + #[doc = "this pixel format."] + #[doc = ""] + #[doc = "The format modifier is linear (DRM_FORMAT_MOD_LINEAR)."] + #[doc = ""] + #[doc = "This is an initial event, and sent whenever the required format"] + #[doc = "changes."] + async fn format(&self, drm_format: u32) -> crate::client::Result<()>; + #[doc = "This event delivers the size that should be used for the"] + #[doc = "image buffer. Any buffer is incompatible if it does not have"] + #[doc = "this size."] + #[doc = ""] + #[doc = "Row alignment of the buffer must be 4 bytes, and it must not contain"] + #[doc = "further row padding. Otherwise the buffer is unsupported."] + #[doc = ""] + #[doc = "This is an initial event, and sent whenever the required size"] + #[doc = "changes."] + async fn size(&self, width: i32, height: i32) -> crate::client::Result<()>; + #[doc = "This event is emitted as a response to 'capture' request when it"] + #[doc = "has successfully completed."] + #[doc = ""] + #[doc = "If the buffer used in the shot is a dmabuf, the client also needs to"] + #[doc = "wait for any implicit fences on it before accessing the contents."] + async fn complete(&self) -> crate::client::Result<()>; + #[doc = "This event is emitted as a response to 'capture' request when it"] + #[doc = "cannot succeed due to an incompatible buffer. The client has already"] + #[doc = "received the events delivering the new buffer parameters. The client"] + #[doc = "should retry the capture with the new buffer parameters."] + async fn retry(&self) -> crate::client::Result<()>; + #[doc = "This event is emitted as a response to 'capture' request when it"] + #[doc = "has failed for reasons other than an incompatible buffer. The reasons"] + #[doc = "may include: unsupported buffer type, unsupported buffer stride,"] + #[doc = "unsupported image source, the image source (output) was removed, or"] + #[doc = "compositor policy denied the capture."] + #[doc = ""] + #[doc = "The string 'msg' may contain a human-readable explanation of the"] + #[doc = "failure to aid debugging."] + async fn failed(&self, msg: Option) -> crate::client::Result<()>; } } } @@ -2995,6 +3305,11 @@ pub mod weston_test { .await .map_err(crate::client::Error::IoError) } + async fn pointer_position( + &self, + x: crate::wire::Fixed, + y: crate::wire::Fixed, + ) -> crate::client::Result<()>; } } #[doc = "This is a global singleton interface for Weston internal tests."] @@ -3076,6 +3391,7 @@ pub mod weston_test { .await .map_err(crate::client::Error::IoError) } + async fn finished(&self) -> crate::client::Result<()>; } } } @@ -3227,6 +3543,19 @@ pub mod weston_touch_calibration { .await .map_err(crate::client::Error::IoError) } + #[doc = "When a client binds to weston_touch_calibration, one touch_device event"] + #[doc = "is sent for each touchscreen that is available to be calibrated. This"] + #[doc = "is the only time the event is sent. Touch devices added in the"] + #[doc = "compositor will not generate events for existing"] + #[doc = "weston_touch_calibration objects."] + #[doc = ""] + #[doc = "An event carries the touch device identification and the associated"] + #[doc = "output or head (display connector) name."] + #[doc = ""] + #[doc = "On platforms using udev, the device identification is the udev sys"] + #[doc = "path. It is an absolute path and starts with the sys mount point."] + async fn touch_device(&self, device: String, head: String) + -> crate::client::Result<()>; } } #[doc = "On creation, this object is tied to a specific touch device. The"] @@ -3346,6 +3675,64 @@ pub mod weston_touch_calibration { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event tells the client what size to make the surface. The client"] + #[doc = "must obey the size exactly on the next commit with a wl_buffer."] + #[doc = ""] + #[doc = "This event shall be sent once as a response to creating a"] + #[doc = "weston_touch_calibrator object."] + async fn configure(&self, width: i32, height: i32) -> crate::client::Result<()>; + #[doc = "This is sent when the compositor wants to cancel the calibration and"] + #[doc = "drop the touch device grab. The compositor unmaps the surface, if it"] + #[doc = "was mapped."] + #[doc = ""] + #[doc = "The weston_touch_calibrator object will not send any more events. The"] + #[doc = "client should destroy it."] + async fn cancel_calibration(&self) -> crate::client::Result<()>; + #[doc = "For whatever reason, a touch event resulting from a user action cannot"] + #[doc = "be used for calibration. The client should show feedback to the user"] + #[doc = "that the touch was rejected."] + #[doc = ""] + #[doc = "Possible causes for this event include the user touching a wrong"] + #[doc = "touchscreen when there are multiple ones present. This is particularly"] + #[doc = "useful when the touchscreens are cloned and there is no other way to"] + #[doc = "identify which screen the user should be touching."] + #[doc = ""] + #[doc = "Another cause could be a touch device that sends coordinates beyond its"] + #[doc = "declared range. If motion takes a touch point outside the range, the"] + #[doc = "compositor should also send 'cancel' event to undo the touch-down."] + async fn invalid_touch(&self) -> crate::client::Result<()>; + #[doc = "A new touch point has appeared on the surface. This touch point is"] + #[doc = "assigned a unique ID. Future events from this touch point reference"] + #[doc = "this ID. The ID ceases to be valid after a touch up event and may be"] + #[doc = "reused in the future."] + #[doc = ""] + #[doc = "For the coordinate units, see weston_touch_calibrator."] + async fn down(&self, time: u32, id: i32, x: u32, y: u32) -> crate::client::Result<()>; + #[doc = "The touch point has disappeared. No further events will be sent for"] + #[doc = "this touch point and the touch point's ID is released and may be"] + #[doc = "reused in a future touch down event."] + async fn up(&self, time: u32, id: i32) -> crate::client::Result<()>; + #[doc = "A touch point has changed coordinates."] + #[doc = ""] + #[doc = "For the coordinate units, see weston_touch_calibrator."] + async fn motion(&self, time: u32, id: i32, x: u32, y: u32) + -> crate::client::Result<()>; + #[doc = "Indicates the end of a set of events that logically belong together."] + #[doc = "A client is expected to accumulate the data in all events within the"] + #[doc = "frame before proceeding."] + #[doc = ""] + #[doc = "A wl_touch.frame terminates at least one event but otherwise no"] + #[doc = "guarantee is provided about the set of events within a frame. A client"] + #[doc = "must assume that any state not updated in a frame is unchanged from the"] + #[doc = "previously known state."] + async fn frame(&self) -> crate::client::Result<()>; + #[doc = "Sent if the compositor decides the touch stream is a global"] + #[doc = "gesture. No further events are sent to the clients from that"] + #[doc = "particular gesture. Touch cancellation applies to all touch points"] + #[doc = "currently active on this client's surface. The client is"] + #[doc = "responsible for finalizing the touch points, future touch points on"] + #[doc = "this surface may reuse the touch point ID."] + async fn cancel(&self) -> crate::client::Result<()>; } } #[allow(clippy::too_many_arguments)] @@ -3363,6 +3750,14 @@ pub mod weston_touch_calibration { _ => Err(crate::client::Error::UnknownOpcode), } } + #[doc = "This event returns the conversion result from surface coordinates to"] + #[doc = "the expected touch device coordinates."] + #[doc = ""] + #[doc = "For details, see weston_touch_calibrator.convert. For the coordinate"] + #[doc = "units, see weston_touch_calibrator."] + #[doc = ""] + #[doc = "This event destroys the weston_touch_coordinate object."] + async fn result(&self, x: u32, y: u32) -> crate::client::Result<()>; } } } diff --git a/src/client/protocol/wlr.rs b/src/client/protocol/wlr.rs index bd0301a..dd949e9 100644 --- a/src/client/protocol/wlr.rs +++ b/src/client/protocol/wlr.rs @@ -190,6 +190,51 @@ pub mod wlr_data_control_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The data_offer event introduces a new wlr_data_control_offer object,"] + #[doc = "which will subsequently be used in either the"] + #[doc = "wlr_data_control_device.selection event (for the regular clipboard"] + #[doc = "selections) or the wlr_data_control_device.primary_selection event (for"] + #[doc = "the primary clipboard selections). Immediately following the"] + #[doc = "wlr_data_control_device.data_offer event, the new data_offer object"] + #[doc = "will send out wlr_data_control_offer.offer events to describe the MIME"] + #[doc = "types it offers."] + async fn data_offer(&self, id: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "The selection event is sent out to notify the client of a new"] + #[doc = "wlr_data_control_offer for the selection for this device. The"] + #[doc = "wlr_data_control_device.data_offer and the wlr_data_control_offer.offer"] + #[doc = "events are sent out immediately before this event to introduce the data"] + #[doc = "offer object. The selection event is sent to a client when a new"] + #[doc = "selection is set. The wlr_data_control_offer is valid until a new"] + #[doc = "wlr_data_control_offer or NULL is received. The client must destroy the"] + #[doc = "previous selection wlr_data_control_offer, if any, upon receiving this"] + #[doc = "event."] + #[doc = ""] + #[doc = "The first selection event is sent upon binding the"] + #[doc = "wlr_data_control_device object."] + async fn selection( + &self, + id: Option, + ) -> crate::client::Result<()>; + #[doc = "This data control object is no longer valid and should be destroyed by"] + #[doc = "the client."] + async fn finished(&self) -> crate::client::Result<()>; + #[doc = "The primary_selection event is sent out to notify the client of a new"] + #[doc = "wlr_data_control_offer for the primary selection for this device. The"] + #[doc = "wlr_data_control_device.data_offer and the wlr_data_control_offer.offer"] + #[doc = "events are sent out immediately before this event to introduce the data"] + #[doc = "offer object. The primary_selection event is sent to a client when a"] + #[doc = "new primary selection is set. The wlr_data_control_offer is valid until"] + #[doc = "a new wlr_data_control_offer or NULL is received. The client must"] + #[doc = "destroy the previous primary selection wlr_data_control_offer, if any,"] + #[doc = "upon receiving this event."] + #[doc = ""] + #[doc = "If the compositor supports primary selection, the first"] + #[doc = "primary_selection event is sent upon binding the"] + #[doc = "wlr_data_control_device object."] + async fn primary_selection( + &self, + id: Option, + ) -> crate::client::Result<()>; } } #[doc = "The wlr_data_control_source object is the source side of a"] @@ -261,6 +306,18 @@ pub mod wlr_data_control_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Request for data from the client. Send the data as the specified MIME"] + #[doc = "type over the passed file descriptor, then close it."] + async fn send( + &self, + mime_type: String, + fd: rustix::fd::OwnedFd, + ) -> crate::client::Result<()>; + #[doc = "This data source is no longer valid. The data source has been replaced"] + #[doc = "by another data source."] + #[doc = ""] + #[doc = "The client should clean up and destroy this data source."] + async fn cancelled(&self) -> crate::client::Result<()>; } } #[doc = "A wlr_data_control_offer represents a piece of data offered for transfer"] @@ -323,6 +380,9 @@ pub mod wlr_data_control_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent immediately after creating the wlr_data_control_offer object."] + #[doc = "One event per offered MIME type."] + async fn offer(&self, mime_type: String) -> crate::client::Result<()>; } } } @@ -481,6 +541,67 @@ pub mod wlr_export_dmabuf_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Main event supplying the client with information about the frame. If the"] + #[doc = "capture didn't fail, this event is always emitted first before any other"] + #[doc = "events."] + #[doc = ""] + #[doc = "This event is followed by a number of \"object\" as specified by the"] + #[doc = "\"num_objects\" argument."] + async fn frame( + &self, + width: u32, + height: u32, + offset_x: u32, + offset_y: u32, + buffer_flags: u32, + flags: Flags, + format: u32, + mod_high: u32, + mod_low: u32, + num_objects: u32, + ) -> crate::client::Result<()>; + #[doc = "Event which serves to supply the client with the file descriptors"] + #[doc = "containing the data for each object."] + #[doc = ""] + #[doc = "After receiving this event, the client must always close the file"] + #[doc = "descriptor as soon as they're done with it and even if the frame fails."] + async fn object( + &self, + index: u32, + fd: rustix::fd::OwnedFd, + size: u32, + offset: u32, + stride: u32, + plane_index: u32, + ) -> crate::client::Result<()>; + #[doc = "This event is sent as soon as the frame is presented, indicating it is"] + #[doc = "available for reading. This event includes the time at which"] + #[doc = "presentation happened at."] + #[doc = ""] + #[doc = "The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,"] + #[doc = "each component being an unsigned 32-bit value. Whole seconds are in"] + #[doc = "tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,"] + #[doc = "and the additional fractional part in tv_nsec as nanoseconds. Hence,"] + #[doc = "for valid timestamps tv_nsec must be in [0, 999999999]. The seconds part"] + #[doc = "may have an arbitrary offset at start."] + #[doc = ""] + #[doc = "After receiving this event, the client should destroy this object."] + async fn ready( + &self, + tv_sec_hi: u32, + tv_sec_lo: u32, + tv_nsec: u32, + ) -> crate::client::Result<()>; + #[doc = "If the capture failed or if the frame is no longer valid after the"] + #[doc = "\"frame\" event has been emitted, this event will be used to inform the"] + #[doc = "client to scrap the frame."] + #[doc = ""] + #[doc = "If the failure is temporary, the client may capture again the same"] + #[doc = "source. If the failure is permanent, any further attempts to capture the"] + #[doc = "same source will fail again."] + #[doc = ""] + #[doc = "After receiving this event, the client should destroy this object."] + async fn cancel(&self, reason: CancelReason) -> crate::client::Result<()>; } } } @@ -525,6 +646,19 @@ pub mod wlr_foreign_toplevel_management_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is emitted whenever a new toplevel window is created. It"] + #[doc = "is emitted for all toplevels, regardless of the app that has created"] + #[doc = "them."] + #[doc = ""] + #[doc = "All initial details of the toplevel(title, app_id, states, etc.) will"] + #[doc = "be sent immediately after this event via the corresponding events in"] + #[doc = "zwlr_foreign_toplevel_handle_v1."] + async fn toplevel(&self, toplevel: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event indicates that the compositor is done sending events to the"] + #[doc = "zwlr_foreign_toplevel_manager_v1. The server will destroy the object"] + #[doc = "immediately after sending this request, so it will become invalid and"] + #[doc = "the client should free any resources associated with it."] + async fn finished(&self) -> crate::client::Result<()>; } } #[doc = "A zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel"] @@ -794,6 +928,45 @@ pub mod wlr_foreign_toplevel_management_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event is emitted whenever the title of the toplevel changes."] + async fn title(&self, title: String) -> crate::client::Result<()>; + #[doc = "This event is emitted whenever the app-id of the toplevel changes."] + async fn app_id(&self, app_id: String) -> crate::client::Result<()>; + #[doc = "This event is emitted whenever the toplevel becomes visible on"] + #[doc = "the given output. A toplevel may be visible on multiple outputs."] + async fn output_enter( + &self, + output: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "This event is emitted whenever the toplevel stops being visible on"] + #[doc = "the given output. It is guaranteed that an entered-output event"] + #[doc = "with the same output has been emitted before this event."] + async fn output_leave( + &self, + output: crate::wire::ObjectId, + ) -> crate::client::Result<()>; + #[doc = "This event is emitted immediately after the zlw_foreign_toplevel_handle_v1"] + #[doc = "is created and each time the toplevel state changes, either because of a"] + #[doc = "compositor action or because of a request in this protocol."] + async fn state(&self, state: Vec) -> crate::client::Result<()>; + #[doc = "This event is sent after all changes in the toplevel state have been"] + #[doc = "sent."] + #[doc = ""] + #[doc = "This allows changes to the zwlr_foreign_toplevel_handle_v1 properties"] + #[doc = "to be seen as atomic, even if they happen via multiple events."] + async fn done(&self) -> crate::client::Result<()>; + #[doc = "This event means the toplevel has been destroyed. It is guaranteed there"] + #[doc = "won't be any more events for this zwlr_foreign_toplevel_handle_v1. The"] + #[doc = "toplevel itself becomes inert so any requests will be ignored except the"] + #[doc = "destroy request."] + async fn closed(&self) -> crate::client::Result<()>; + #[doc = "This event is emitted whenever the parent of the toplevel changes."] + #[doc = ""] + #[doc = "No event is emitted when the parent handle is destroyed by the client."] + async fn parent( + &self, + parent: Option, + ) -> crate::client::Result<()>; } } } @@ -942,6 +1115,19 @@ pub mod wlr_gamma_control_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Advertise the size of each gamma ramp."] + #[doc = ""] + #[doc = "This event is sent immediately when the gamma control object is created."] + async fn gamma_size(&self, size: u32) -> crate::client::Result<()>; + #[doc = "This event indicates that the gamma control is no longer valid. This"] + #[doc = "can happen for a number of reasons, including:"] + #[doc = "- The output doesn't support gamma tables"] + #[doc = "- Setting the gamma tables failed"] + #[doc = "- Another client already has exclusive gamma control for this output"] + #[doc = "- The compositor has transferred gamma control to another client"] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy this object."] + async fn failed(&self) -> crate::client::Result<()>; } } } @@ -1536,6 +1722,38 @@ pub mod wlr_layer_shell_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "The configure event asks the client to resize its surface."] + #[doc = ""] + #[doc = "Clients should arrange their surface for the new states, and then send"] + #[doc = "an ack_configure request with the serial sent in this configure event at"] + #[doc = "some point before committing the new surface."] + #[doc = ""] + #[doc = "The client is free to dismiss all but the last configure event it"] + #[doc = "received."] + #[doc = ""] + #[doc = "The width and height arguments specify the size of the window in"] + #[doc = "surface-local coordinates."] + #[doc = ""] + #[doc = "The size is a hint, in the sense that the client is free to ignore it if"] + #[doc = "it doesn't resize, pick a smaller size (to satisfy aspect ratio or"] + #[doc = "resize in steps of NxM pixels). If the client picks a smaller size and"] + #[doc = "is anchored to two opposite anchors (e.g. 'top' and 'bottom'), the"] + #[doc = "surface will be centered on this axis."] + #[doc = ""] + #[doc = "If the width or height arguments are zero, it means the client should"] + #[doc = "decide its own window dimension."] + async fn configure( + &self, + serial: u32, + width: u32, + height: u32, + ) -> crate::client::Result<()>; + #[doc = "The closed event is sent by the compositor when the surface will no"] + #[doc = "longer be shown. The output may have been destroyed or the user may"] + #[doc = "have asked for it to be removed. Further changes to the surface will be"] + #[doc = "ignored. The client should destroy the resource after receiving this"] + #[doc = "event, and create a new surface if they so choose."] + async fn closed(&self) -> crate::client::Result<()>; } } } @@ -1634,6 +1852,27 @@ pub mod wlr_output_management_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event introduces a new head. This happens whenever a new head"] + #[doc = "appears (e.g. a monitor is plugged in) or after the output manager is"] + #[doc = "bound."] + async fn head(&self, head: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event is sent after all information has been sent after binding to"] + #[doc = "the output manager object and after any subsequent changes. This applies"] + #[doc = "to child head and mode objects as well. In other words, this event is"] + #[doc = "sent whenever a head or mode is created or destroyed and whenever one of"] + #[doc = "their properties has been changed. Not all state is re-sent each time"] + #[doc = "the current configuration changes: only the actual changes are sent."] + #[doc = ""] + #[doc = "This allows changes to the output configuration to be seen as atomic,"] + #[doc = "even if they happen via multiple events."] + #[doc = ""] + #[doc = "A serial is sent to be used in a future create_configuration request."] + async fn done(&self, serial: u32) -> crate::client::Result<()>; + #[doc = "This event indicates that the compositor is done sending manager events."] + #[doc = "The compositor will destroy the object immediately after sending this"] + #[doc = "event, so it will become invalid and the client should release any"] + #[doc = "resources associated with it."] + async fn finished(&self) -> crate::client::Result<()>; } } #[doc = "A head is an output device. The difference between a wl_output object and"] @@ -1698,6 +1937,147 @@ pub mod wlr_output_management_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event describes the head name."] + #[doc = ""] + #[doc = "The naming convention is compositor defined, but limited to alphanumeric"] + #[doc = "characters and dashes (-). Each name is unique among all wlr_output_head"] + #[doc = "objects, but if a wlr_output_head object is destroyed the same name may"] + #[doc = "be reused later. The names will also remain consistent across sessions"] + #[doc = "with the same hardware and software configuration."] + #[doc = ""] + #[doc = "Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do"] + #[doc = "not assume that the name is a reflection of an underlying DRM"] + #[doc = "connector, X11 connection, etc."] + #[doc = ""] + #[doc = "If the compositor implements the xdg-output protocol and this head is"] + #[doc = "enabled, the xdg_output.name event must report the same name."] + #[doc = ""] + #[doc = "The name event is sent after a wlr_output_head object is created. This"] + #[doc = "event is only sent once per object, and the name does not change over"] + #[doc = "the lifetime of the wlr_output_head object."] + async fn name(&self, name: String) -> crate::client::Result<()>; + #[doc = "This event describes a human-readable description of the head."] + #[doc = ""] + #[doc = "The description is a UTF-8 string with no convention defined for its"] + #[doc = "contents. Examples might include 'Foocorp 11\" Display' or 'Virtual X11"] + #[doc = "output via :1'. However, do not assume that the name is a reflection of"] + #[doc = "the make, model, serial of the underlying DRM connector or the display"] + #[doc = "name of the underlying X11 connection, etc."] + #[doc = ""] + #[doc = "If the compositor implements xdg-output and this head is enabled,"] + #[doc = "the xdg_output.description must report the same description."] + #[doc = ""] + #[doc = "The description event is sent after a wlr_output_head object is created."] + #[doc = "This event is only sent once per object, and the description does not"] + #[doc = "change over the lifetime of the wlr_output_head object."] + async fn description(&self, description: String) -> crate::client::Result<()>; + #[doc = "This event describes the physical size of the head. This event is only"] + #[doc = "sent if the head has a physical size (e.g. is not a projector or a"] + #[doc = "virtual device)."] + #[doc = ""] + #[doc = "The physical size event is sent after a wlr_output_head object is created. This"] + #[doc = "event is only sent once per object, and the physical size does not change over"] + #[doc = "the lifetime of the wlr_output_head object."] + async fn physical_size(&self, width: i32, height: i32) -> crate::client::Result<()>; + #[doc = "This event introduces a mode for this head. It is sent once per"] + #[doc = "supported mode."] + async fn mode(&self, mode: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This event describes whether the head is enabled. A disabled head is not"] + #[doc = "mapped to a region of the global compositor space."] + #[doc = ""] + #[doc = "When a head is disabled, some properties (current_mode, position,"] + #[doc = "transform and scale) are irrelevant."] + async fn enabled(&self, enabled: i32) -> crate::client::Result<()>; + #[doc = "This event describes the mode currently in use for this head. It is only"] + #[doc = "sent if the output is enabled."] + async fn current_mode(&self, mode: crate::wire::ObjectId) -> crate::client::Result<()>; + #[doc = "This events describes the position of the head in the global compositor"] + #[doc = "space. It is only sent if the output is enabled."] + async fn position(&self, x: i32, y: i32) -> crate::client::Result<()>; + #[doc = "This event describes the transformation currently applied to the head."] + #[doc = "It is only sent if the output is enabled."] + async fn transform( + &self, + transform: super::super::super::core::wayland::wl_output::Transform, + ) -> crate::client::Result<()>; + #[doc = "This events describes the scale of the head in the global compositor"] + #[doc = "space. It is only sent if the output is enabled."] + async fn scale(&self, scale: crate::wire::Fixed) -> crate::client::Result<()>; + #[doc = "This event indicates that the head is no longer available. The head"] + #[doc = "object becomes inert. Clients should send a destroy request and release"] + #[doc = "any resources associated with it."] + async fn finished(&self) -> crate::client::Result<()>; + #[doc = "This event describes the manufacturer of the head."] + #[doc = ""] + #[doc = "This must report the same make as the wl_output interface does in its"] + #[doc = "geometry event."] + #[doc = ""] + #[doc = "Together with the model and serial_number events the purpose is to"] + #[doc = "allow clients to recognize heads from previous sessions and for example"] + #[doc = "load head-specific configurations back."] + #[doc = ""] + #[doc = "It is not guaranteed this event will be ever sent. A reason for that"] + #[doc = "can be that the compositor does not have information about the make of"] + #[doc = "the head or the definition of a make is not sensible in the current"] + #[doc = "setup, for example in a virtual session. Clients can still try to"] + #[doc = "identify the head by available information from other events but should"] + #[doc = "be aware that there is an increased risk of false positives."] + #[doc = ""] + #[doc = "If sent, the make event is sent after a wlr_output_head object is"] + #[doc = "created and only sent once per object. The make does not change over"] + #[doc = "the lifetime of the wlr_output_head object."] + #[doc = ""] + #[doc = "It is not recommended to display the make string in UI to users. For"] + #[doc = "that the string provided by the description event should be preferred."] + async fn make(&self, make: String) -> crate::client::Result<()>; + #[doc = "This event describes the model of the head."] + #[doc = ""] + #[doc = "This must report the same model as the wl_output interface does in its"] + #[doc = "geometry event."] + #[doc = ""] + #[doc = "Together with the make and serial_number events the purpose is to"] + #[doc = "allow clients to recognize heads from previous sessions and for example"] + #[doc = "load head-specific configurations back."] + #[doc = ""] + #[doc = "It is not guaranteed this event will be ever sent. A reason for that"] + #[doc = "can be that the compositor does not have information about the model of"] + #[doc = "the head or the definition of a model is not sensible in the current"] + #[doc = "setup, for example in a virtual session. Clients can still try to"] + #[doc = "identify the head by available information from other events but should"] + #[doc = "be aware that there is an increased risk of false positives."] + #[doc = ""] + #[doc = "If sent, the model event is sent after a wlr_output_head object is"] + #[doc = "created and only sent once per object. The model does not change over"] + #[doc = "the lifetime of the wlr_output_head object."] + #[doc = ""] + #[doc = "It is not recommended to display the model string in UI to users. For"] + #[doc = "that the string provided by the description event should be preferred."] + async fn model(&self, model: String) -> crate::client::Result<()>; + #[doc = "This event describes the serial number of the head."] + #[doc = ""] + #[doc = "Together with the make and model events the purpose is to allow clients"] + #[doc = "to recognize heads from previous sessions and for example load head-"] + #[doc = "specific configurations back."] + #[doc = ""] + #[doc = "It is not guaranteed this event will be ever sent. A reason for that"] + #[doc = "can be that the compositor does not have information about the serial"] + #[doc = "number of the head or the definition of a serial number is not sensible"] + #[doc = "in the current setup. Clients can still try to identify the head by"] + #[doc = "available information from other events but should be aware that there"] + #[doc = "is an increased risk of false positives."] + #[doc = ""] + #[doc = "If sent, the serial number event is sent after a wlr_output_head object"] + #[doc = "is created and only sent once per object. The serial number does not"] + #[doc = "change over the lifetime of the wlr_output_head object."] + #[doc = ""] + #[doc = "It is not recommended to display the serial_number string in UI to"] + #[doc = "users. For that the string provided by the description event should be"] + #[doc = "preferred."] + async fn serial_number(&self, serial_number: String) -> crate::client::Result<()>; + #[doc = "This event describes whether adaptive sync is currently enabled for"] + #[doc = "the head or not. Adaptive sync is also known as Variable Refresh"] + #[doc = "Rate or VRR."] + async fn adaptive_sync(&self, state: AdaptiveSyncState) -> crate::client::Result<()>; } } #[doc = "This object describes an output mode."] @@ -1738,6 +2118,20 @@ pub mod wlr_output_management_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "This event describes the mode size. The size is given in physical"] + #[doc = "hardware units of the output device. This is not necessarily the same as"] + #[doc = "the output size in the global compositor space. For instance, the output"] + #[doc = "may be scaled or transformed."] + async fn size(&self, width: i32, height: i32) -> crate::client::Result<()>; + #[doc = "This event describes the mode's fixed vertical refresh rate. It is only"] + #[doc = "sent if the mode has a fixed refresh rate."] + async fn refresh(&self, refresh: i32) -> crate::client::Result<()>; + #[doc = "This event advertises this mode as preferred."] + async fn preferred(&self) -> crate::client::Result<()>; + #[doc = "This event indicates that the mode is no longer available. The mode"] + #[doc = "object becomes inert. Clients should send a destroy request and release"] + #[doc = "any resources associated with it."] + async fn finished(&self) -> crate::client::Result<()>; } } #[doc = "This object is used by the client to describe a full output configuration."] @@ -1890,6 +2284,29 @@ pub mod wlr_output_management_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Sent after the compositor has successfully applied the changes or"] + #[doc = "tested them."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy this object."] + #[doc = ""] + #[doc = "If the current configuration has changed, events to describe the changes"] + #[doc = "will be sent followed by a wlr_output_manager.done event."] + async fn succeeded(&self) -> crate::client::Result<()>; + #[doc = "Sent if the compositor rejects the changes or failed to apply them. The"] + #[doc = "compositor should revert any changes made by the apply request that"] + #[doc = "triggered this event."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy this object."] + async fn failed(&self) -> crate::client::Result<()>; + #[doc = "Sent if the compositor cancels the configuration because the state of an"] + #[doc = "output changed and the client has outdated information (e.g. after an"] + #[doc = "output has been hotplugged)."] + #[doc = ""] + #[doc = "The client can create a new configuration with a newer serial and try"] + #[doc = "again."] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy this object."] + async fn cancelled(&self) -> crate::client::Result<()>; } } #[doc = "This object is used by the client to update a single head's configuration."] @@ -2226,6 +2643,24 @@ pub mod wlr_output_power_management_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Report the power management mode change of an output."] + #[doc = ""] + #[doc = "The mode event is sent after an output changed its power"] + #[doc = "management mode. The reason can be a client using set_mode or the"] + #[doc = "compositor deciding to change an output's mode."] + #[doc = "This event is also sent immediately when the object is created"] + #[doc = "so the client is informed about the current power management mode."] + async fn mode(&self, mode: Mode) -> crate::client::Result<()>; + #[doc = "This event indicates that the output power management mode control"] + #[doc = "is no longer valid. This can happen for a number of reasons,"] + #[doc = "including:"] + #[doc = "- The output doesn't support power management"] + #[doc = "- Another client already has exclusive power management mode control"] + #[doc = "for this output"] + #[doc = "- The output disappeared"] + #[doc = ""] + #[doc = "Upon receiving this event, the client should destroy this object."] + async fn failed(&self) -> crate::client::Result<()>; } } } @@ -2446,6 +2881,72 @@ pub mod wlr_screencopy_unstable_v1 { .await .map_err(crate::client::Error::IoError) } + #[doc = "Provides information about wl_shm buffer parameters that need to be"] + #[doc = "used for this frame. This event is sent once after the frame is created"] + #[doc = "if wl_shm buffers are supported."] + async fn buffer( + &self, + format: super::super::super::core::wayland::wl_shm::Format, + width: u32, + height: u32, + stride: u32, + ) -> crate::client::Result<()>; + #[doc = "Provides flags about the frame. This event is sent once before the"] + #[doc = "\"ready\" event."] + async fn flags(&self, flags: Flags) -> crate::client::Result<()>; + #[doc = "Called as soon as the frame is copied, indicating it is available"] + #[doc = "for reading. This event includes the time at which presentation happened"] + #[doc = "at."] + #[doc = ""] + #[doc = "The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,"] + #[doc = "each component being an unsigned 32-bit value. Whole seconds are in"] + #[doc = "tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,"] + #[doc = "and the additional fractional part in tv_nsec as nanoseconds. Hence,"] + #[doc = "for valid timestamps tv_nsec must be in [0, 999999999]. The seconds part"] + #[doc = "may have an arbitrary offset at start."] + #[doc = ""] + #[doc = "After receiving this event, the client should destroy the object."] + async fn ready( + &self, + tv_sec_hi: u32, + tv_sec_lo: u32, + tv_nsec: u32, + ) -> crate::client::Result<()>; + #[doc = "This event indicates that the attempted frame copy has failed."] + #[doc = ""] + #[doc = "After receiving this event, the client should destroy the object."] + async fn failed(&self) -> crate::client::Result<()>; + #[doc = "This event is sent right before the ready event when copy_with_damage is"] + #[doc = "requested. It may be generated multiple times for each copy_with_damage"] + #[doc = "request."] + #[doc = ""] + #[doc = "The arguments describe a box around an area that has changed since the"] + #[doc = "last copy request that was derived from the current screencopy manager"] + #[doc = "instance."] + #[doc = ""] + #[doc = "The union of all regions received between the call to copy_with_damage"] + #[doc = "and a ready event is the total damage since the prior ready event."] + async fn damage( + &self, + x: u32, + y: u32, + width: u32, + height: u32, + ) -> crate::client::Result<()>; + #[doc = "Provides information about linux-dmabuf buffer parameters that need to"] + #[doc = "be used for this frame. This event is sent once after the frame is"] + #[doc = "created if linux-dmabuf buffers are supported."] + async fn linux_dmabuf( + &self, + format: u32, + width: u32, + height: u32, + ) -> crate::client::Result<()>; + #[doc = "This event is sent once after all buffer events have been sent."] + #[doc = ""] + #[doc = "The client should proceed to create a buffer of one of the supported"] + #[doc = "types, and send a \"copy\" request."] + async fn buffer_done(&self) -> crate::client::Result<()>; } } } diff --git a/src/server/listener.rs b/src/server/listener.rs index e7f9b4e..435249d 100644 --- a/src/server/listener.rs +++ b/src/server/listener.rs @@ -44,7 +44,7 @@ impl Listener { pub fn new_with_path>(path: P) -> Result { if !path.as_ref().exists() { // FIXME: add a proper error - return Err(Error::Internal); + // return Err(Error::Internal); } // FIXME: actually implement this