Skip to content

Commit

Permalink
Add Display impl for few more KMS objects
Browse files Browse the repository at this point in the history
  • Loading branch information
bwidawsk authored and Drakulix committed Apr 18, 2024
1 parent 9208993 commit 695183d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/control/crtc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ pub struct Info {
pub(crate) gamma_length: u32,
}

impl std::fmt::Display for Info {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CRTC {}", self.handle.0)
}
}

impl Info {
/// Returns the handle to this CRTC.
pub fn handle(&self) -> Handle {
Expand Down
6 changes: 6 additions & 0 deletions src/control/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ pub struct Info {
pub(crate) pos_clones: u32,
}

impl std::fmt::Display for Info {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Encoder {}", self.handle.0)
}
}

impl Info {
/// Returns the handle to this encoder.
pub fn handle(&self) -> Handle {
Expand Down
6 changes: 6 additions & 0 deletions src/control/framebuffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ pub struct Info {
pub(crate) buffer: Option<buffer::Handle>,
}

impl std::fmt::Display for Info {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Framebuffer {}", self.handle.0)
}
}

impl Info {
/// Returns the handle to this framebuffer.
pub fn handle(&self) -> Handle {
Expand Down
6 changes: 6 additions & 0 deletions src/control/plane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ pub struct Info {
pub(crate) formats: Vec<u32>,
}

impl std::fmt::Display for Info {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Plane {}", self.handle.0)
}
}

impl Info {
/// Returns the handle to this plane.
pub fn handle(&self) -> Handle {
Expand Down

0 comments on commit 695183d

Please sign in to comment.