1
0
Fork 0
forked from wry/wry

autocommit 2022-02-06 19:56:51 CET

This commit is contained in:
Julian Orth 2022-02-06 19:56:51 +01:00
parent 1fdff156ec
commit 3f50b0c75e
37 changed files with 452 additions and 439 deletions

View file

@ -1,4 +1,4 @@
use crate::client::DynEventFormatter;
use crate::client::{Client};
use crate::object::Object;
use std::rc::Rc;
use thiserror::Error;
@ -6,16 +6,17 @@ use crate::wire::wl_callback::*;
use crate::wire::WlCallbackId;
pub struct WlCallback {
client: Rc<Client>,
id: WlCallbackId,
}
impl WlCallback {
pub fn new(id: WlCallbackId) -> Self {
Self { id }
pub fn new(id: WlCallbackId, client: &Rc<Client>) -> Self {
Self { client: client.clone(), id }
}
pub fn done(self: &Rc<Self>) -> DynEventFormatter {
Box::new(Done { self_id: self.id, callback_data: 0 })
pub fn send_done(&self) {
self.client.event(Done { self_id: self.id, callback_data: 0 });
}
}