1
0
Fork 0
forked from wry/wry

wayland: implement wl-fixes

This commit is contained in:
Julian Orth 2024-04-24 17:25:27 +02:00
parent f36993eb6e
commit b13dd08991
14 changed files with 183 additions and 3 deletions

View file

@ -19,7 +19,8 @@ use {
test_toplevel_drag_manager::TestToplevelDragManager,
test_viewporter::TestViewporter,
test_virtual_keyboard_manager::TestVirtualKeyboardManager,
test_xdg_activation::TestXdgActivation, test_xdg_base::TestXdgWmBase,
test_wl_fixes::TestWlFixes, test_xdg_activation::TestXdgActivation,
test_xdg_base::TestXdgWmBase,
},
test_object::TestObject,
test_transport::TestTransport,
@ -58,6 +59,7 @@ pub struct TestRegistrySingletons {
pub zwp_virtual_keyboard_manager_v1: u32,
pub zwp_input_method_manager_v2: u32,
pub zwp_text_input_manager_v3: u32,
pub wl_fixes: u32,
}
pub struct TestRegistry {
@ -85,6 +87,7 @@ pub struct TestRegistry {
pub virtual_keyboard_manager: CloneCell<Option<Rc<TestVirtualKeyboardManager>>>,
pub input_method_manager: CloneCell<Option<Rc<TestInputMethodManager>>>,
pub text_input_manager: CloneCell<Option<Rc<TestTextInputManager>>>,
pub wl_fixes: CloneCell<Option<Rc<TestWlFixes>>>,
pub seats: CopyHashMap<GlobalName, Rc<WlSeatGlobal>>,
}
@ -156,6 +159,7 @@ impl TestRegistry {
zwp_virtual_keyboard_manager_v1,
zwp_input_method_manager_v2,
zwp_text_input_manager_v3,
wl_fixes,
};
self.singletons.set(Some(singletons.clone()));
Ok(singletons)
@ -271,6 +275,7 @@ impl TestRegistry {
1,
TestTextInputManager
);
create_singleton!(get_wl_fixes, wl_fixes, wl_fixes, 1, TestWlFixes);
pub fn bind<O: TestObject>(
&self,

View file

@ -0,0 +1,38 @@
use {
crate::{
it::{
test_error::TestResult, test_ifs::test_registry::TestRegistry, test_object::TestObject,
test_transport::TestTransport,
},
wire::{wl_fixes::*, WlFixesId},
},
std::rc::Rc,
};
pub struct TestWlFixes {
pub id: WlFixesId,
pub tran: Rc<TestTransport>,
}
impl TestWlFixes {
pub fn new(tran: &Rc<TestTransport>) -> Self {
Self {
id: tran.id(),
tran: tran.clone(),
}
}
pub fn destroy_registry(&self, registry: &TestRegistry) -> TestResult {
self.tran.send(DestroyRegistry {
self_id: self.id,
registry: registry.id,
})?;
Ok(())
}
}
test_object! {
TestWlFixes, WlFixes;
}
impl TestObject for TestWlFixes {}