1
0
Fork 0
forked from wry/wry

autocommit 2022-01-29 15:55:49 CET

This commit is contained in:
Julian Orth 2022-01-29 15:55:49 +01:00
parent 3d7c8ccdbf
commit 11d3604de4
40 changed files with 576 additions and 180 deletions

View file

@ -1,8 +1,8 @@
use std::ffi::CString;
use crate::client::{Client, DynEventFormatter};
use crate::globals::{Global, GlobalName};
use crate::object::{Interface, Object, ObjectId};
use crate::utils::buffd::MsgParser;
use std::ffi::CString;
use std::rc::Rc;
pub use types::*;
@ -85,9 +85,7 @@ impl WlDrmObj {
}
fn authenticated(self: &Rc<Self>) -> DynEventFormatter {
Box::new(Authenticated {
obj: self.clone(),
})
Box::new(Authenticated { obj: self.clone() })
}
fn capabilities(self: &Rc<Self>, value: u32) -> DynEventFormatter {
@ -108,7 +106,10 @@ impl WlDrmObj {
Err(CreateBufferError::Unsupported)
}
fn create_planar_buffer(self: &Rc<Self>, parser: MsgParser<'_, '_>) -> Result<(), CreatePlanarBufferError> {
fn create_planar_buffer(
self: &Rc<Self>,
parser: MsgParser<'_, '_>,
) -> Result<(), CreatePlanarBufferError> {
let _req: CreatePlanarBuffer = self.client.parse(&**self, parser)?;
Err(CreatePlanarBufferError::Unsupported)
}

View file

@ -1,12 +1,12 @@
use std::ffi::CString;
use crate::client::{ClientError, EventFormatter, RequestParser};
use crate::ifs::wl_buffer::WlBufferId;
use crate::ifs::wl_drm::{WlDrmObj, AUTHENTICATED, CAPABILITIES, DEVICE, FORMAT};
use crate::object::Object;
use crate::utils::buffd::{MsgFormatter, MsgParser, MsgParserError};
use std::ffi::CString;
use std::fmt::{Debug, Formatter};
use std::rc::Rc;
use thiserror::Error;
use crate::ifs::wl_drm::{AUTHENTICATED, CAPABILITIES, DEVICE, FORMAT, WlDrmObj};
#[derive(Debug, Error)]
pub enum WlDrmError {
@ -19,7 +19,7 @@ pub enum WlDrmError {
#[error(transparent)]
ClientError(Box<ClientError>),
}
efrom!(WlDrmError, ClientError, ClientError);
efrom!(WlDrmError, ClientError);
#[derive(Debug, Error)]
pub enum AuthenticateError {
@ -162,8 +162,7 @@ pub(super) struct Format {
}
impl EventFormatter for Format {
fn format(self: Box<Self>, fmt: &mut MsgFormatter<'_>) {
fmt.header(self.obj.id, FORMAT)
.uint(self.format);
fmt.header(self.obj.id, FORMAT).uint(self.format);
}
fn obj(&self) -> &dyn Object {
&*self.obj
@ -171,11 +170,7 @@ impl EventFormatter for Format {
}
impl Debug for Format {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
f,
"format(format: {})",
self.format,
)
write!(f, "format(format: {})", self.format,)
}
}
@ -192,10 +187,7 @@ impl EventFormatter for Authenticated {
}
impl Debug for Authenticated {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
f,
"authenticated()",
)
write!(f, "authenticated()",)
}
}
@ -205,8 +197,7 @@ pub(super) struct Capabilities {
}
impl EventFormatter for Capabilities {
fn format(self: Box<Self>, fmt: &mut MsgFormatter<'_>) {
fmt.header(self.obj.id, CAPABILITIES)
.uint(self.value);
fmt.header(self.obj.id, CAPABILITIES).uint(self.value);
}
fn obj(&self) -> &dyn Object {
&*self.obj
@ -214,10 +205,6 @@ impl EventFormatter for Capabilities {
}
impl Debug for Capabilities {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
f,
"capabilities(value: {})",
self.value,
)
write!(f, "capabilities(value: {})", self.value,)
}
}