declared interfaces and more wrappers
This commit is contained in:
@@ -3,26 +3,35 @@ use std::io;
|
||||
use wayland_server::client::Client;
|
||||
use wayland_server::display::Display;
|
||||
use wayland_server::global::{Global, GlobalState};
|
||||
|
||||
use wayland_server::interface::{Interface, Output};
|
||||
use wayland_server::resource::Resource;
|
||||
|
||||
struct State {
|
||||
|
||||
output_interface: Interface<Output>,
|
||||
}
|
||||
impl State {
|
||||
pub fn new() -> Self {
|
||||
Self { output_interface: Interface::<Output>::new() }
|
||||
}
|
||||
}
|
||||
impl GlobalState for State {
|
||||
fn handle_output_bind(&self, client: Client, version: u32, id: u32) {
|
||||
todo!()
|
||||
fn handle_output_bind(&self, client: &Client, _version: u32, id: u32) -> io::Result<()>{
|
||||
let resource = Resource::new(&client, id, &self.output_interface)?;
|
||||
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
// Creating a compositor State
|
||||
let state = State {};
|
||||
let state = State::new();
|
||||
|
||||
// create a wayland display
|
||||
let display = Display::new()?;
|
||||
|
||||
// get the global registry
|
||||
let global = Global::new(&display, state)?;
|
||||
let _global = Global::new(&display, state)?;
|
||||
|
||||
println!("Running wayland_display on {}", display.get_name());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user