wayland_protocols_async/zwlr_output_management_v1/output/
output_configuration.rs

1use wayland_client::{Connection, Dispatch, Proxy, QueueHandle};
2use wayland_protocols_wlr::output_management::v1::client::zwlr_output_configuration_v1::{ZwlrOutputConfigurationV1, self};
3
4use crate::zwlr_output_management_v1::handler::OutputManagementEvent;
5
6use crate::zwlr_output_management_v1::handler::OutputManagementState;
7
8impl Dispatch<ZwlrOutputConfigurationV1, ()> for OutputManagementState {
9    fn event(
10        state: &mut Self,
11        mode: &ZwlrOutputConfigurationV1,
12        event: <ZwlrOutputConfigurationV1 as Proxy>::Event,
13        _data: &(),
14        _conn: &Connection,
15        _handle: &QueueHandle<Self>,
16    ) {
17        match event {
18            zwlr_output_configuration_v1::Event::Succeeded => {
19                state.dispatch_event(OutputManagementEvent::ConfigurationSucceeded);
20            }
21            zwlr_output_configuration_v1::Event::Failed => {
22                state.dispatch_event(OutputManagementEvent::ConfigurationFailed);
23            }
24            zwlr_output_configuration_v1::Event::Cancelled => {
25                state.dispatch_event(OutputManagementEvent::ConfigurationCancelled);
26            }
27            _ => {},
28        }
29    }
30}