config: allow retrieving the modes
This commit is contained in:
parent
2ab7b43f74
commit
558bea47b7
8 changed files with 73 additions and 3 deletions
|
|
@ -2,7 +2,12 @@ pub mod client;
|
|||
pub mod ipc;
|
||||
mod logging;
|
||||
|
||||
use {bincode::Options, std::marker::PhantomData};
|
||||
use {
|
||||
crate::video::Mode,
|
||||
bincode::Options,
|
||||
serde::{Deserialize, Serialize},
|
||||
std::marker::PhantomData,
|
||||
};
|
||||
|
||||
pub const VERSION: u32 = 1;
|
||||
|
||||
|
|
@ -36,3 +41,20 @@ pub fn bincode_ops() -> impl Options {
|
|||
pub trait Config {
|
||||
extern "C" fn configure();
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct WireMode {
|
||||
pub width: i32,
|
||||
pub height: i32,
|
||||
pub refresh_millihz: u32,
|
||||
}
|
||||
|
||||
impl WireMode {
|
||||
pub fn to_mode(self) -> Mode {
|
||||
Mode {
|
||||
width: self.width,
|
||||
height: self.height,
|
||||
refresh_millihz: self.refresh_millihz,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue