2020-12-15 16:39:11 +00:00
|
|
|
use ruffle_core::backend::ui::UiBackend;
|
2021-01-07 20:24:58 +00:00
|
|
|
use std::rc::Rc;
|
|
|
|
use tinyfiledialogs::{message_box_ok, MessageBoxIcon};
|
|
|
|
use winit::window::Window;
|
2020-12-15 16:39:11 +00:00
|
|
|
|
2021-01-07 20:24:58 +00:00
|
|
|
pub struct DesktopUiBackend {
|
|
|
|
window: Rc<Window>,
|
|
|
|
}
|
2020-12-15 16:39:11 +00:00
|
|
|
|
|
|
|
impl DesktopUiBackend {
|
2021-01-07 20:24:58 +00:00
|
|
|
pub fn new(window: Rc<Window>) -> Self {
|
|
|
|
Self { window }
|
2020-12-15 16:39:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl UiBackend for DesktopUiBackend {
|
2021-01-06 00:41:47 +00:00
|
|
|
fn is_fullscreen(&self) -> bool {
|
2021-01-07 20:24:58 +00:00
|
|
|
self.window.fullscreen().is_some()
|
2021-01-06 00:41:47 +00:00
|
|
|
}
|
|
|
|
|
2020-12-15 16:39:11 +00:00
|
|
|
fn message(&self, message: &str) {
|
|
|
|
message_box_ok("Ruffle", message, MessageBoxIcon::Info)
|
|
|
|
}
|
|
|
|
}
|