zaura_shell_server_protocol/
zaura_shell_server_protocol.rs

1// GENERATED FILE -- DO NOT EDIT
2//
3// Copyright 2017 The Chromium Authors.
4// 
5// Permission is hereby granted, free of charge, to any person obtaining a
6// copy of this software and associated documentation files (the "Software"),
7// to deal in the Software without restriction, including without limitation
8// the rights to use, copy, modify, merge, publish, distribute, sublicense,
9// and/or sell copies of the Software, and to permit persons to whom the
10// Software is furnished to do so, subject to the following conditions:
11// 
12// The above copyright notice and this permission notice (including the next
13// paragraph) shall be included in all copies or substantial portions of the
14// Software.
15// 
16// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22// DEALINGS IN THE SOFTWARE.
23
24#![allow(warnings)]
25#![allow(clippy::all)]
26use anyhow;
27#[allow(unused_imports)]
28use fuchsia_wayland_core::{Array, Enum, Fixed, NewId, NewObject};
29use fuchsia_wayland_core::{ArgKind, Arg, FromArgs, IntoMessage, Message,
30                            MessageGroupSpec, MessageHeader, MessageSpec, MessageType,
31                            ObjectId, EncodeError, DecodeError, Interface};
32pub mod zaura_shell {
33use super::*;
34
35/// aura_shell
36///
37/// The global interface exposing aura shell capabilities is used to
38/// instantiate an interface extension for a wl_surface object.
39/// This extended interface will then allow the client to use aura shell
40/// specific functionality.
41#[derive(Debug)]
42pub struct ZauraShell;
43
44impl Interface for ZauraShell {
45    const NAME: &'static str = "zaura_shell";
46    const VERSION: u32 = 8;
47    const REQUESTS: MessageGroupSpec = MessageGroupSpec(&[
48        // get_aura_surface
49        MessageSpec(&[
50            ArgKind::NewId,
51            ArgKind::Object,
52        ]),
53        // get_aura_output
54        MessageSpec(&[
55            ArgKind::NewId,
56            ArgKind::Object,
57        ]),
58    ]);
59    const EVENTS: MessageGroupSpec = MessageGroupSpec(&[
60    ]);
61    type Incoming = Request;
62    type Outgoing = Event;
63}
64
65#[derive(Debug)]
66pub enum Request {
67
68    /// extend surface interface for aura shell
69    ///
70    /// Instantiate an interface extension for the given wl_surface to
71    /// provide aura shell functionality. If the given wl_surface is not
72    /// associated with a shell surface, the shell_surface_missing protocol
73    /// error is raised.
74    GetAuraSurface {
75        /// the new aura surface interface id
76        id: NewObject<ZauraSurface>,
77        /// the surface
78        surface: ObjectId,
79    },
80
81    /// extend output interface for aura shell
82    ///
83    /// Instantiate an interface extension for the given wl_output to
84    /// provide aura shell functionality.
85    GetAuraOutput {
86        /// the new aura output interface id
87        id: NewObject<ZauraOutput>,
88        /// the output
89        output: ObjectId,
90    },
91}
92
93impl MessageType for Request {
94    fn log(&self, this: ObjectId) -> String {
95        match *self {
96            Request::GetAuraSurface {
97                ref id,
98                ref surface,
99            } => {
100                format!("zaura_shell@{:?}::get_aura_surface(id: {:?}, surface: {:?})", this, id, surface)
101            }
102            Request::GetAuraOutput {
103                ref id,
104                ref output,
105            } => {
106                format!("zaura_shell@{:?}::get_aura_output(id: {:?}, output: {:?})", this, id, output)
107            }
108        }
109    }
110    fn message_name(&self) -> &'static std::ffi::CStr{
111        match *self {
112            Request::GetAuraSurface { .. } => c"zaura_shell::get_aura_surface",
113            Request::GetAuraOutput { .. } => c"zaura_shell::get_aura_output",
114        }
115    }
116}
117#[derive(Debug)]
118pub enum Event {
119}
120
121impl MessageType for Event {
122    fn log(&self, this: ObjectId) -> String {
123        match *self {
124        }
125    }
126    fn message_name(&self) -> &'static std::ffi::CStr{
127        match *self {
128        }
129    }
130}
131impl IntoMessage for Event {
132    type Error = EncodeError;
133    fn into_message(self, id: u32) -> Result<Message, <Self as IntoMessage>::Error> {
134        let mut header = MessageHeader {
135            sender: id,
136            opcode: 0,
137            length: 0,
138        };
139        let mut msg = Message::new();
140        msg.write_header(&header)?;
141        match self {
142        }
143        header.length = msg.bytes().len() as u16;
144        msg.rewind();
145        msg.write_header(&header)?;
146        Ok(msg)
147    }
148}
149impl FromArgs for Request {
150    fn from_args(op: u16, mut args: Vec<Arg>) -> Result<Self, anyhow::Error> {
151        match op {
152        0 /* get_aura_surface */ => {
153            let mut iter = args.into_iter();
154            Ok(Request::GetAuraSurface {
155                id: iter.next()
156                                             .ok_or(DecodeError::InsufficientArgs)?
157                                             .as_new_id()?.into(),
158                surface: iter.next()
159                                             .ok_or(DecodeError::InsufficientArgs)?
160                                             .as_object()?,
161
162            })
163        },
164        1 /* get_aura_output */ => {
165            let mut iter = args.into_iter();
166            Ok(Request::GetAuraOutput {
167                id: iter.next()
168                                             .ok_or(DecodeError::InsufficientArgs)?
169                                             .as_new_id()?.into(),
170                output: iter.next()
171                                             .ok_or(DecodeError::InsufficientArgs)?
172                                             .as_object()?,
173
174            })
175        },
176        _ => {
177            Err(DecodeError::InvalidOpcode(op).into())
178        },
179        }
180    }
181}
182#[derive(Copy, Clone, Debug, Eq, PartialEq)]
183#[repr(u32)]
184pub enum Error {
185    /// the surface already has an aura surface object associated,
186    AuraSurfaceExists = 0,
187    /// the output already has an aura output object associated,
188    AuraOutputExists = 1,
189}
190
191impl Error {
192    pub fn from_bits(v: u32) -> Option<Self> {
193        match v {
194        0 => Some(Error::AuraSurfaceExists),
195        1 => Some(Error::AuraOutputExists),
196        _ => None,
197        }
198    }
199
200    pub fn bits(&self) -> u32 {
201        *self as u32
202    }
203}
204impl Into<Arg> for Error {
205    fn into(self) -> Arg {
206        Arg::Uint(self.bits())
207    }
208}
209} // mod zaura_shell
210
211pub use crate::zaura_shell::ZauraShell;
212pub use crate::zaura_shell::Request as ZauraShellRequest;
213pub use crate::zaura_shell::Event as ZauraShellEvent;
214pub mod zaura_surface {
215use super::*;
216
217/// aura shell interface to a wl_surface
218///
219/// An additional interface to a wl_surface object, which allows the
220/// client to access aura shell specific functionality for surface.
221#[derive(Debug)]
222pub struct ZauraSurface;
223
224impl Interface for ZauraSurface {
225    const NAME: &'static str = "zaura_surface";
226    const VERSION: u32 = 8;
227    const REQUESTS: MessageGroupSpec = MessageGroupSpec(&[
228        // set_frame
229        MessageSpec(&[
230            ArgKind::Uint,
231        ]),
232        // set_parent
233        MessageSpec(&[
234            ArgKind::Object,
235            ArgKind::Int,
236            ArgKind::Int,
237        ]),
238        // set_frame_colors
239        MessageSpec(&[
240            ArgKind::Uint,
241            ArgKind::Uint,
242        ]),
243        // set_startup_id
244        MessageSpec(&[
245            ArgKind::String,
246        ]),
247        // set_application_id
248        MessageSpec(&[
249            ArgKind::String,
250        ]),
251        // set_client_surface_id
252        MessageSpec(&[
253            ArgKind::Int,
254        ]),
255        // set_occlusion_tracking
256        MessageSpec(&[
257        ]),
258        // unset_occlusion_tracking
259        MessageSpec(&[
260        ]),
261    ]);
262    const EVENTS: MessageGroupSpec = MessageGroupSpec(&[
263        // occlusion_changed
264        MessageSpec(&[
265            ArgKind::Fixed,
266            ArgKind::Uint,
267        ]),
268    ]);
269    type Incoming = Request;
270    type Outgoing = Event;
271}
272
273#[derive(Debug)]
274pub enum Request {
275
276    /// request a frame for surface
277    ///
278    /// Suggests a surface should use a specific frame.
279    SetFrame {
280        /// the new frame type
281        type_: u32,
282    },
283
284    /// set the parent of this surface
285    ///
286    /// Set the "parent" of this surface. "x" and "y" arguments specify the
287    /// initial position for surface relative to parent.
288    SetParent {
289        parent: ObjectId,
290        x: i32,
291        y: i32,
292    },
293
294    /// set the frame colors of this surface
295    ///
296    /// Set the frame colors.
297    SetFrameColors {
298        /// 32 bit ARGB color value, not premultiplied
299        active_color: u32,
300        /// 32 bit ARGB color value, not premultiplied
301        inactive_color: u32,
302    },
303
304    /// set the startup ID of this surface
305    ///
306    /// Set the startup ID.
307    SetStartupId {
308        startup_id: String,
309    },
310
311    /// set the application ID of this surface
312    ///
313    /// Set the application ID.
314    SetApplicationId {
315        application_id: String,
316    },
317
318    /// set the client surface ID of this surface
319    ///
320    /// Set the identifier of the surface assigned by the client.
321    SetClientSurfaceId {
322        client_surface_id: i32,
323    },
324
325    /// set tracked occlusion region
326    ///
327    /// Sets occlusion tracking on this surface. The client will be updated with a
328    /// new occlusion fraction when the amount of occlusion of this surface changes.
329    SetOcclusionTracking,
330
331    /// unset tracked occlusion region
332    ///
333    /// Unsets occlusion tracking for this surface.
334    UnsetOcclusionTracking,
335}
336
337impl MessageType for Request {
338    fn log(&self, this: ObjectId) -> String {
339        match *self {
340            Request::SetFrame {
341                ref type_,
342            } => {
343                format!("zaura_surface@{:?}::set_frame(type: {:?})", this, type_)
344            }
345            Request::SetParent {
346                ref parent,
347                ref x,
348                ref y,
349            } => {
350                format!("zaura_surface@{:?}::set_parent(parent: {:?}, x: {:?}, y: {:?})", this, parent, x, y)
351            }
352            Request::SetFrameColors {
353                ref active_color,
354                ref inactive_color,
355            } => {
356                format!("zaura_surface@{:?}::set_frame_colors(active_color: {:?}, inactive_color: {:?})", this, active_color, inactive_color)
357            }
358            Request::SetStartupId {
359                ref startup_id,
360            } => {
361                format!("zaura_surface@{:?}::set_startup_id(startup_id: {:?})", this, startup_id)
362            }
363            Request::SetApplicationId {
364                ref application_id,
365            } => {
366                format!("zaura_surface@{:?}::set_application_id(application_id: {:?})", this, application_id)
367            }
368            Request::SetClientSurfaceId {
369                ref client_surface_id,
370            } => {
371                format!("zaura_surface@{:?}::set_client_surface_id(client_surface_id: {:?})", this, client_surface_id)
372            }
373            Request::SetOcclusionTracking {
374            } => {
375                format!("zaura_surface@{:?}::set_occlusion_tracking()", this)
376            }
377            Request::UnsetOcclusionTracking {
378            } => {
379                format!("zaura_surface@{:?}::unset_occlusion_tracking()", this)
380            }
381        }
382    }
383    fn message_name(&self) -> &'static std::ffi::CStr{
384        match *self {
385            Request::SetFrame { .. } => c"zaura_surface::set_frame",
386            Request::SetParent { .. } => c"zaura_surface::set_parent",
387            Request::SetFrameColors { .. } => c"zaura_surface::set_frame_colors",
388            Request::SetStartupId { .. } => c"zaura_surface::set_startup_id",
389            Request::SetApplicationId { .. } => c"zaura_surface::set_application_id",
390            Request::SetClientSurfaceId { .. } => c"zaura_surface::set_client_surface_id",
391            Request::SetOcclusionTracking { .. } => c"zaura_surface::set_occlusion_tracking",
392            Request::UnsetOcclusionTracking { .. } => c"zaura_surface::unset_occlusion_tracking",
393        }
394    }
395}
396#[derive(Debug)]
397pub enum Event {
398
399    /// Notifies on an occlusion change
400    ///
401    /// Notifies when there is a change in the amount this surface is occluded.
402    /// The occlusion update is sent as a fixed point number from 0 to 1, representing
403    /// the proportion of occlusion.
404    OcclusionChanged {
405        occlusion_fraction: Fixed,
406        occlusion_reason: u32,
407    },
408}
409
410impl MessageType for Event {
411    fn log(&self, this: ObjectId) -> String {
412        match *self {
413            Event::OcclusionChanged {
414                ref occlusion_fraction,
415                ref occlusion_reason,
416            } => {
417                format!("zaura_surface@{:?}::occlusion_changed(occlusion_fraction: {:?}, occlusion_reason: {:?})", this, occlusion_fraction, occlusion_reason)
418            }
419        }
420    }
421    fn message_name(&self) -> &'static std::ffi::CStr{
422        match *self {
423            Event::OcclusionChanged { .. } => c"zaura_surface::occlusion_changed",
424        }
425    }
426}
427impl IntoMessage for Event {
428    type Error = EncodeError;
429    fn into_message(self, id: u32) -> Result<Message, <Self as IntoMessage>::Error> {
430        let mut header = MessageHeader {
431            sender: id,
432            opcode: 0,
433            length: 0,
434        };
435        let mut msg = Message::new();
436        msg.write_header(&header)?;
437        match self {
438        Event::OcclusionChanged {
439            occlusion_fraction,
440            occlusion_reason,
441        } => {
442            msg.write_arg(Arg::Fixed(occlusion_fraction))?;
443            msg.write_arg(Arg::Uint(occlusion_reason))?;
444            header.opcode = 0;
445        },
446        }
447        header.length = msg.bytes().len() as u16;
448        msg.rewind();
449        msg.write_header(&header)?;
450        Ok(msg)
451    }
452}
453impl FromArgs for Request {
454    fn from_args(op: u16, mut args: Vec<Arg>) -> Result<Self, anyhow::Error> {
455        match op {
456        0 /* set_frame */ => {
457            let mut iter = args.into_iter();
458            Ok(Request::SetFrame {
459                type_: iter.next()
460                                             .ok_or(DecodeError::InsufficientArgs)?
461                                             .as_uint()?,
462
463            })
464        },
465        1 /* set_parent */ => {
466            let mut iter = args.into_iter();
467            Ok(Request::SetParent {
468                parent: iter.next()
469                                             .ok_or(DecodeError::InsufficientArgs)?
470                                             .as_object()?,
471                x: iter.next()
472                                             .ok_or(DecodeError::InsufficientArgs)?
473                                             .as_int()?,
474                y: iter.next()
475                                             .ok_or(DecodeError::InsufficientArgs)?
476                                             .as_int()?,
477
478            })
479        },
480        2 /* set_frame_colors */ => {
481            let mut iter = args.into_iter();
482            Ok(Request::SetFrameColors {
483                active_color: iter.next()
484                                             .ok_or(DecodeError::InsufficientArgs)?
485                                             .as_uint()?,
486                inactive_color: iter.next()
487                                             .ok_or(DecodeError::InsufficientArgs)?
488                                             .as_uint()?,
489
490            })
491        },
492        3 /* set_startup_id */ => {
493            let mut iter = args.into_iter();
494            Ok(Request::SetStartupId {
495                startup_id: iter.next()
496                                             .ok_or(DecodeError::InsufficientArgs)?
497                                             .as_string()?,
498
499            })
500        },
501        4 /* set_application_id */ => {
502            let mut iter = args.into_iter();
503            Ok(Request::SetApplicationId {
504                application_id: iter.next()
505                                             .ok_or(DecodeError::InsufficientArgs)?
506                                             .as_string()?,
507
508            })
509        },
510        5 /* set_client_surface_id */ => {
511            let mut iter = args.into_iter();
512            Ok(Request::SetClientSurfaceId {
513                client_surface_id: iter.next()
514                                             .ok_or(DecodeError::InsufficientArgs)?
515                                             .as_int()?,
516
517            })
518        },
519        6 /* set_occlusion_tracking */ => {
520            let mut iter = args.into_iter();
521            Ok(Request::SetOcclusionTracking {
522
523            })
524        },
525        7 /* unset_occlusion_tracking */ => {
526            let mut iter = args.into_iter();
527            Ok(Request::UnsetOcclusionTracking {
528
529            })
530        },
531        _ => {
532            Err(DecodeError::InvalidOpcode(op).into())
533        },
534        }
535    }
536}
537
538/// different frame types
539///
540/// Frame types that can be used to decorate a surface.
541#[derive(Copy, Clone, Debug, Eq, PartialEq)]
542#[repr(u32)]
543pub enum FrameType {
544    /// no frame,
545    None = 0,
546    /// caption with shadow,
547    Normal = 1,
548    /// shadow only,
549    Shadow = 2,
550}
551
552impl FrameType {
553    pub fn from_bits(v: u32) -> Option<Self> {
554        match v {
555        0 => Some(FrameType::None),
556        1 => Some(FrameType::Normal),
557        2 => Some(FrameType::Shadow),
558        _ => None,
559        }
560    }
561
562    pub fn bits(&self) -> u32 {
563        *self as u32
564    }
565}
566impl Into<Arg> for FrameType {
567    fn into(self) -> Arg {
568        Arg::Uint(self.bits())
569    }
570}
571
572/// occlusion change reason
573///
574/// Enum describing why an occlusion change happened. An occlusion change as a
575/// result of a user action could include things like the user moving a window,
576/// changing occlusion, or opening/closing a window, changing the occlusion.
577#[derive(Copy, Clone, Debug, Eq, PartialEq)]
578#[repr(u32)]
579pub enum OcclusionChangeReason {
580    /// occlusion changed as a result of a user action,
581    UserAction = 1,
582}
583
584impl OcclusionChangeReason {
585    pub fn from_bits(v: u32) -> Option<Self> {
586        match v {
587        1 => Some(OcclusionChangeReason::UserAction),
588        _ => None,
589        }
590    }
591
592    pub fn bits(&self) -> u32 {
593        *self as u32
594    }
595}
596impl Into<Arg> for OcclusionChangeReason {
597    fn into(self) -> Arg {
598        Arg::Uint(self.bits())
599    }
600}
601} // mod zaura_surface
602
603pub use crate::zaura_surface::ZauraSurface;
604pub use crate::zaura_surface::Request as ZauraSurfaceRequest;
605pub use crate::zaura_surface::Event as ZauraSurfaceEvent;
606pub mod zaura_output {
607use super::*;
608
609/// aura shell interface to a wl_output
610///
611/// An additional interface to a wl_output object, which allows the
612/// client to access aura shell specific functionality for output.
613#[derive(Debug)]
614pub struct ZauraOutput;
615
616impl Interface for ZauraOutput {
617    const NAME: &'static str = "zaura_output";
618    const VERSION: u32 = 6;
619    const REQUESTS: MessageGroupSpec = MessageGroupSpec(&[
620    ]);
621    const EVENTS: MessageGroupSpec = MessageGroupSpec(&[
622        // scale
623        MessageSpec(&[
624            ArgKind::Uint,
625            ArgKind::Uint,
626        ]),
627        // connection
628        MessageSpec(&[
629            ArgKind::Uint,
630        ]),
631        // device_scale_factor
632        MessageSpec(&[
633            ArgKind::Uint,
634        ]),
635    ]);
636    type Incoming = Request;
637    type Outgoing = Event;
638}
639
640#[derive(Debug)]
641pub enum Request {
642}
643
644impl MessageType for Request {
645    fn log(&self, this: ObjectId) -> String {
646        match *self {
647        }
648    }
649    fn message_name(&self) -> &'static std::ffi::CStr{
650        match *self {
651        }
652    }
653}
654#[derive(Debug)]
655pub enum Event {
656
657    /// advertise available scales for the output
658    ///
659    /// The scale event describes an available scale for the output.
660    /// 
661    /// The event is sent when binding to the output object and there
662    /// will always be one scale, the current scale. The event is sent
663    /// again if an output changes scale, for the scale that is now
664    /// current. In other words, the current scale is always the last
665    /// scale that was received with the current flag set.
666    Scale {
667        /// bitfield of scale flags
668        flags: ScaleProperty,
669        /// output scale
670        scale: ScaleFactor,
671    },
672
673    /// advertise connection for the output
674    ///
675    /// The connection event describes how the output is connected.
676    /// 
677    /// The event is sent when binding to the output object.
678    Connection {
679        /// output connection
680        connection: ConnectionType,
681    },
682
683    /// advertise device scale factor for the output
684    ///
685    /// This event describes the device specific scale factor for the output.
686    /// 
687    /// The device specific scale factor is not expected the change during
688    /// the lifetime of the output. And it is not limited to an integer value
689    /// like the scale factor provided by wl_output interface. The exact
690    /// contents scale used by the compositor can be determined by combining
691    /// this device scale factor with the current output scale.
692    /// 
693    /// The event is sent when binding to the output object.
694    DeviceScaleFactor {
695        /// output device scale factor
696        scale: ScaleFactor,
697    },
698}
699
700impl MessageType for Event {
701    fn log(&self, this: ObjectId) -> String {
702        match *self {
703            Event::Scale {
704                ref flags,
705                ref scale,
706            } => {
707                format!("zaura_output@{:?}::scale(flags: {:?}, scale: {:?})", this, flags, scale)
708            }
709            Event::Connection {
710                ref connection,
711            } => {
712                format!("zaura_output@{:?}::connection(connection: {:?})", this, connection)
713            }
714            Event::DeviceScaleFactor {
715                ref scale,
716            } => {
717                format!("zaura_output@{:?}::device_scale_factor(scale: {:?})", this, scale)
718            }
719        }
720    }
721    fn message_name(&self) -> &'static std::ffi::CStr{
722        match *self {
723            Event::Scale { .. } => c"zaura_output::scale",
724            Event::Connection { .. } => c"zaura_output::connection",
725            Event::DeviceScaleFactor { .. } => c"zaura_output::device_scale_factor",
726        }
727    }
728}
729impl IntoMessage for Event {
730    type Error = EncodeError;
731    fn into_message(self, id: u32) -> Result<Message, <Self as IntoMessage>::Error> {
732        let mut header = MessageHeader {
733            sender: id,
734            opcode: 0,
735            length: 0,
736        };
737        let mut msg = Message::new();
738        msg.write_header(&header)?;
739        match self {
740        Event::Scale {
741            flags,
742            scale,
743        } => {
744            msg.write_arg(Arg::Uint(flags.bits()))?;
745            msg.write_arg(Arg::Uint(scale.bits()))?;
746            header.opcode = 0;
747        },
748        Event::Connection {
749            connection,
750        } => {
751            msg.write_arg(Arg::Uint(connection.bits()))?;
752            header.opcode = 1;
753        },
754        Event::DeviceScaleFactor {
755            scale,
756        } => {
757            msg.write_arg(Arg::Uint(scale.bits()))?;
758            header.opcode = 2;
759        },
760        }
761        header.length = msg.bytes().len() as u16;
762        msg.rewind();
763        msg.write_header(&header)?;
764        Ok(msg)
765    }
766}
767impl FromArgs for Request {
768    fn from_args(op: u16, mut args: Vec<Arg>) -> Result<Self, anyhow::Error> {
769        match op {
770        _ => {
771            Err(DecodeError::InvalidOpcode(op).into())
772        },
773        }
774    }
775}
776::bitflags::bitflags! {
777
778    /// scale information
779    ///
780    /// These flags describe properties of an output scale.
781    /// They are used in the flags bitfield of the scale event.
782    #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
783    pub struct ScaleProperty: u32 {
784        /// indicates this is the current scale,
785        const Current = 1;
786        /// indicates this is the preferred scale,
787        const Preferred = 2;
788    }
789}
790impl Into<Arg> for ScaleProperty {
791    fn into(self) -> Arg {
792        Arg::Uint(self.bits())
793    }
794}
795#[derive(Copy, Clone, Debug, Eq, PartialEq)]
796#[repr(u32)]
797pub enum ScaleFactor {
798    _0400 = 400,
799    _0500 = 500,
800    _0550 = 550,
801    _0600 = 600,
802    _0625 = 625,
803    _0650 = 650,
804    _0700 = 700,
805    _0750 = 750,
806    _0800 = 800,
807    _0850 = 850,
808    _0900 = 900,
809    _0950 = 950,
810    _1000 = 1000,
811    _1050 = 1050,
812    _1100 = 1100,
813    _1150 = 1150,
814    _1125 = 1125,
815    _1200 = 1200,
816    _1250 = 1250,
817    _1300 = 1300,
818    _1400 = 1400,
819    _1450 = 1450,
820    _1500 = 1500,
821    _1600 = 1600,
822    _1750 = 1750,
823    _1800 = 1800,
824    _2000 = 2000,
825    _2200 = 2200,
826    _2250 = 2250,
827    _2500 = 2500,
828    _2750 = 2750,
829    _3000 = 3000,
830    _3500 = 3500,
831    _4000 = 4000,
832    _4500 = 4500,
833    _5000 = 5000,
834}
835
836impl ScaleFactor {
837    pub fn from_bits(v: u32) -> Option<Self> {
838        match v {
839        400 => Some(ScaleFactor::_0400),
840        500 => Some(ScaleFactor::_0500),
841        550 => Some(ScaleFactor::_0550),
842        600 => Some(ScaleFactor::_0600),
843        625 => Some(ScaleFactor::_0625),
844        650 => Some(ScaleFactor::_0650),
845        700 => Some(ScaleFactor::_0700),
846        750 => Some(ScaleFactor::_0750),
847        800 => Some(ScaleFactor::_0800),
848        850 => Some(ScaleFactor::_0850),
849        900 => Some(ScaleFactor::_0900),
850        950 => Some(ScaleFactor::_0950),
851        1000 => Some(ScaleFactor::_1000),
852        1050 => Some(ScaleFactor::_1050),
853        1100 => Some(ScaleFactor::_1100),
854        1150 => Some(ScaleFactor::_1150),
855        1125 => Some(ScaleFactor::_1125),
856        1200 => Some(ScaleFactor::_1200),
857        1250 => Some(ScaleFactor::_1250),
858        1300 => Some(ScaleFactor::_1300),
859        1400 => Some(ScaleFactor::_1400),
860        1450 => Some(ScaleFactor::_1450),
861        1500 => Some(ScaleFactor::_1500),
862        1600 => Some(ScaleFactor::_1600),
863        1750 => Some(ScaleFactor::_1750),
864        1800 => Some(ScaleFactor::_1800),
865        2000 => Some(ScaleFactor::_2000),
866        2200 => Some(ScaleFactor::_2200),
867        2250 => Some(ScaleFactor::_2250),
868        2500 => Some(ScaleFactor::_2500),
869        2750 => Some(ScaleFactor::_2750),
870        3000 => Some(ScaleFactor::_3000),
871        3500 => Some(ScaleFactor::_3500),
872        4000 => Some(ScaleFactor::_4000),
873        4500 => Some(ScaleFactor::_4500),
874        5000 => Some(ScaleFactor::_5000),
875        _ => None,
876        }
877    }
878
879    pub fn bits(&self) -> u32 {
880        *self as u32
881    }
882}
883impl Into<Arg> for ScaleFactor {
884    fn into(self) -> Arg {
885        Arg::Uint(self.bits())
886    }
887}
888#[derive(Copy, Clone, Debug, Eq, PartialEq)]
889#[repr(u32)]
890pub enum ConnectionType {
891    Unknown = 0,
892    Internal = 1,
893}
894
895impl ConnectionType {
896    pub fn from_bits(v: u32) -> Option<Self> {
897        match v {
898        0 => Some(ConnectionType::Unknown),
899        1 => Some(ConnectionType::Internal),
900        _ => None,
901        }
902    }
903
904    pub fn bits(&self) -> u32 {
905        *self as u32
906    }
907}
908impl Into<Arg> for ConnectionType {
909    fn into(self) -> Arg {
910        Arg::Uint(self.bits())
911    }
912}
913} // mod zaura_output
914
915pub use crate::zaura_output::ZauraOutput;
916pub use crate::zaura_output::Request as ZauraOutputRequest;
917pub use crate::zaura_output::Event as ZauraOutputEvent;