pub mod setting;
pub mod window_type;
pub use setting::SettingValue;
pub use window_type::WindowTypeValue;
#[derive(
Debug,
Default,
Clone,
PartialOrd,
Ord,
PartialEq,
Eq,
serde::Serialize,
serde::Deserialize,
)]
pub struct Uid(pub i32);
#[derive(
Clone,
Debug,
Default,
PartialEq,
PartialOrd,
serde::Serialize,
serde::Deserialize,
)]
#[serde(rename_all = "PascalCase")]
pub struct P3 {
pub x: f64,
pub y: f64,
pub z: f64,
}
#[derive(
Clone,
Debug,
Default,
PartialEq,
PartialOrd,
serde::Serialize,
serde::Deserialize,
)]
#[serde(rename_all = "camelCase", transparent)]
pub struct Pos(pub P3);
#[derive(
Clone,
Debug,
Default,
PartialEq,
PartialOrd,
serde::Serialize,
serde::Deserialize,
)]
#[serde(rename_all = "camelCase", transparent)]
pub struct Rot(pub P3);
serde_with::with_prefix!(prefix_pos "pos");
serde_with::with_prefix!(prefix_rot "rot");
serde_with::with_prefix!(prefix_center "center");
serde_with::with_prefix!(prefix_extents "extents");
#[derive(
Clone,
Debug,
PartialEq,
PartialOrd,
serde::Serialize,
serde::Deserialize,
)]
#[serde(rename_all = "camelCase")]
pub struct OVROverlayTransform {
#[serde(flatten, with = "prefix_pos")]
pub pos: Pos,
#[serde(flatten, with = "prefix_rot")]
pub rot: Rot,
pub size: f64,
pub opacity: f64,
pub curvature: f64,
pub framerate: i32,
pub eco_mode: bool,
pub look_hiding: bool,
pub attached_device: i32,
pub should_save: bool,
}
impl Default for OVROverlayTransform {
fn default() -> Self {
Self {
pos: Default::default(),
rot: Default::default(),
size: 0.25,
opacity: 1.,
curvature: 0.,
framerate: 60,
eco_mode: true,
look_hiding: false,
attached_device: 0,
should_save: false,
}
}
}
#[derive(
Clone,
Debug,
Default,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
serde::Serialize,
serde::Deserialize,
)]
#[serde(rename_all = "camelCase")]
pub struct OVRWebContents {
url: String,
pub width: i32,
pub height: i32,
}
impl OVRWebContents {
pub fn url(&self) -> &str {
&self.url
}
pub fn url_mut(&mut self) -> &mut String {
&mut self.url
}
}
#[derive(
Clone,
Debug,
Default,
PartialEq,
PartialOrd,
serde::Serialize,
serde::Deserialize,
)]
#[serde(rename_all = "camelCase")]
pub struct OVROverlayBounds {
#[serde(flatten, with = "prefix_center")]
pub center: Pos,
#[serde(flatten, with = "prefix_extents")]
pub extents: Pos,
}
#[derive(
Clone,
Debug,
Default,
PartialEq,
PartialOrd,
serde::Serialize,
serde::Deserialize,
)]
#[serde(rename_all = "camelCase")]
pub struct OVRFingerCurls {
pub thumb: f64,
pub index: f64,
pub middle: f64,
pub ring: f64,
pub pinky: f64,
}
#[derive(
Clone,
Debug,
Default,
PartialEq,
PartialOrd,
serde::Serialize,
serde::Deserialize,
)]
#[serde(rename_all = "camelCase")]
pub struct OVRDeviceUpdate {
pub active: bool,
#[serde(flatten, with = "prefix_pos")]
pub pos: Pos,
#[serde(flatten, with = "prefix_rot")]
pub rot: Rot,
pub trigger_down: bool,
pub window_move_down: bool,
pub edit_mode_down: bool,
pub trackpad_x: f64,
pub trackpad_y: f64,
}
#[derive(
Clone,
Debug,
Default,
PartialEq,
PartialOrd,
serde::Serialize,
serde::Deserialize,
)]
#[serde(rename_all = "camelCase")]
pub struct OVRTransformUpdate {
#[serde(flatten, with = "prefix_pos")]
pub pos: Pos,
#[serde(flatten, with = "prefix_rot")]
pub rot: Rot,
pub size: f64,
pub width: i32,
pub height: i32,
}
#[derive(
Clone,
Debug,
Default,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
serde::Serialize,
serde::Deserialize,
)]
#[serde(rename_all = "camelCase")]
pub struct KeyValuePairI32String {
pub name: Option<i32>,
value: Option<String>,
}
impl KeyValuePairI32String {
pub fn value(&self) -> Option<&str> {
self.value.as_deref()
}
pub fn value_mut(&mut self) -> Option<&mut str> {
self.value.as_deref_mut()
}
}