Files
rs-dublinbus/src/renderer/structs.rs
T
2026-05-24 07:36:43 +01:00

35 lines
741 B
Rust

use sdl3::{Sdl, pixels::Color, render::Canvas, ttf::Font, video::Window};
use serde::{Serialize, Deserialize};
pub struct Screen<'a> {
pub(crate) canvas: Box<Canvas<Window>>,
pub(crate) font: Box<Font<'a>>,
pub(crate) color: Color,
pub(crate) context: Box<Sdl>
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct Prefs {
#[serde(rename = "font-path")]
pub font_path: String,
#[serde(rename = "width")]
pub screen_width: u32,
#[serde(rename = "height")]
pub screen_height: u32,
}
pub struct DisplayEntry {
pub route: String,
pub destination: String,
pub departure_time: u32,
}
pub struct DisplayData {
pub lines: Vec<DisplayEntry>,
pub status: Option<String>
}