use std::fmt;
use std::fmt::Debug;
use winit::dpi::PhysicalSize;
pub mod error;
pub mod event;
pub mod graphic;
pub mod msgbox;
pub mod os;
pub mod rframe;
pub mod widget;
pub mod theme;
pub mod wgpu;
pub enum ResponseType {
None,
Ok,
Yes,
No,
Cancel,
Close,
}
pub enum CursorIcon {
Arrow,
ScrollAll,
CrossHair,
Help,
Hand,
NotAllowed,
Progress
}
pub enum WindowButton {
Close,
Maximize,
Minimize,
}
pub struct RSGTError {
error: _RSGTError
}
impl RSGTError {
pub fn illegal_argument(str:&'static str) -> Self {
Self {
error: _RSGTError::IllegalArgument(str)
}
}
}
enum _RSGTError {
IllegalArgument(&'static str)
}
impl _RSGTError {
pub fn description(&self) -> &'static str {
match self {
_RSGTError::IllegalArgument(s) => {s}
}
}
}
impl fmt::Display for RSGTError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match &self.error {
_RSGTError::IllegalArgument(s) => f.write_str(s),
}
}
}
impl Debug for RSGTError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use std::f64::consts::PI;
f.write_fmt(format_args!("{}", self.error.description()))
}
}
pub struct Size<T>(pub T,pub T);
impl From<Size<u32>> for PhysicalSize<u32> {
fn from(value: Size<u32>) -> Self {
Self {
width: value.0,
height: value.1,
}
}
}