| 1 | //! Core interfaces of the protocol |
| 2 | //! |
| 3 | //! This module contains hard-coded interfaces for `wl_display`, `wl_registry` and `wl_callback`. |
| 4 | //! These interfaces are frozen in the protocol and can never change. They are the only interfaces |
| 5 | //! which the backends need to be aware of in particular. |
| 6 | |
| 7 | use crate::protocol::{AllowNull, ArgumentType, Interface, MessageDesc, ANONYMOUS_INTERFACE}; |
| 8 | |
| 9 | /// Interface `wl_display` |
| 10 | pub static WL_DISPLAY_INTERFACE: Interface = Interface { |
| 11 | name: "wl_display" , |
| 12 | version: 1, |
| 13 | requests: &[ |
| 14 | MessageDesc { |
| 15 | name: "sync" , |
| 16 | since: 1, |
| 17 | is_destructor: false, |
| 18 | signature: &[ArgumentType::NewId], |
| 19 | child_interface: Some(&WL_CALLBACK_INTERFACE), |
| 20 | arg_interfaces: &[], |
| 21 | }, |
| 22 | MessageDesc { |
| 23 | name: "get_registry" , |
| 24 | since: 1, |
| 25 | is_destructor: false, |
| 26 | signature: &[ArgumentType::NewId], |
| 27 | child_interface: Some(&WL_REGISTRY_INTERFACE), |
| 28 | arg_interfaces: &[], |
| 29 | }, |
| 30 | ], |
| 31 | events: &[ |
| 32 | MessageDesc { |
| 33 | name: "error" , |
| 34 | since: 1, |
| 35 | is_destructor: false, |
| 36 | signature: &[ |
| 37 | ArgumentType::Object(AllowNull::No), |
| 38 | ArgumentType::Uint, |
| 39 | ArgumentType::Str(AllowNull::No), |
| 40 | ], |
| 41 | child_interface: None, |
| 42 | arg_interfaces: &[&ANONYMOUS_INTERFACE], |
| 43 | }, |
| 44 | MessageDesc { |
| 45 | name: "delete_id" , |
| 46 | since: 1, |
| 47 | is_destructor: false, |
| 48 | signature: &[ArgumentType::Uint], |
| 49 | child_interface: None, |
| 50 | arg_interfaces: &[], |
| 51 | }, |
| 52 | ], |
| 53 | c_ptr: None, |
| 54 | }; |
| 55 | |
| 56 | /// Interface `wl_registry` |
| 57 | pub static WL_REGISTRY_INTERFACE: Interface = Interface { |
| 58 | name: "wl_registry" , |
| 59 | version: 1, |
| 60 | requests: &[MessageDesc { |
| 61 | name: "bind" , |
| 62 | since: 1, |
| 63 | is_destructor: false, |
| 64 | signature: &[ |
| 65 | ArgumentType::Uint, |
| 66 | ArgumentType::Str(AllowNull::No), |
| 67 | ArgumentType::Uint, |
| 68 | ArgumentType::NewId, |
| 69 | ], |
| 70 | child_interface: None, |
| 71 | arg_interfaces: &[], |
| 72 | }], |
| 73 | events: &[ |
| 74 | MessageDesc { |
| 75 | name: "global" , |
| 76 | since: 1, |
| 77 | is_destructor: false, |
| 78 | signature: &[ArgumentType::Uint, ArgumentType::Str(AllowNull::No), ArgumentType::Uint], |
| 79 | child_interface: None, |
| 80 | arg_interfaces: &[], |
| 81 | }, |
| 82 | MessageDesc { |
| 83 | name: "global_remove" , |
| 84 | since: 1, |
| 85 | is_destructor: false, |
| 86 | signature: &[ArgumentType::Uint], |
| 87 | child_interface: None, |
| 88 | arg_interfaces: &[], |
| 89 | }, |
| 90 | ], |
| 91 | c_ptr: None, |
| 92 | }; |
| 93 | |
| 94 | /// Interface `wl_callback` |
| 95 | pub static WL_CALLBACK_INTERFACE: Interface = Interface { |
| 96 | name: "wl_callback" , |
| 97 | version: 1, |
| 98 | requests: &[], |
| 99 | events: &[MessageDesc { |
| 100 | name: "done" , |
| 101 | since: 1, |
| 102 | is_destructor: true, |
| 103 | signature: &[ArgumentType::Uint], |
| 104 | child_interface: None, |
| 105 | arg_interfaces: &[], |
| 106 | }], |
| 107 | c_ptr: None, |
| 108 | }; |
| 109 | |