Initial commit: Media viewer project structure and files
This commit is contained in:
1 parent
fc8e56da41
commit
9a64fd2618
11 files changed
+928
-1
No files matched your search
+54
@@ -0,0 +1,54 @@
|
||||
//! Media Viewer Library - Windows 11 Style Native Application
|
||||
|
||||
// Re-export the modules for easy access
|
||||
pub mod media_handler;
|
||||
pub mod ui;
|
||||
|
||||
// Main application structure
|
||||
pub struct MediaViewer {
|
||||
// Application state
|
||||
current_file: Option<String>,
|
||||
is_fullscreen: bool,
|
||||
}
|
||||
|
||||
impl MediaViewer {
|
||||
/// Create a new media viewer instance
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
current_file: None,
|
||||
is_fullscreen: false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Load a media file
|
||||
pub fn load_file(&mut self, path: &str) -> Result<(), String> {
|
||||
// In a real implementation, this would validate and load the file
|
||||
self.current_file = Some(path.to_string());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Display the loaded media
|
||||
pub fn display(&self) {
|
||||
println!("Displaying media from: {:?}", self.current_file);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_media_viewer_creation() {
|
||||
let viewer = MediaViewer::new();
|
||||
assert!(viewer.current_file.is_none());
|
||||
assert_eq!(viewer.is_fullscreen, false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_load_file() {
|
||||
let mut viewer = MediaViewer::new();
|
||||
let result = viewer.load_file("test.png");
|
||||
assert!(result.is_ok());
|
||||
assert_eq!(viewer.current_file, Some("test.png".to_string()));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user