diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2019-05-29 13:16:23 -0700 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2019-05-30 12:53:47 -0700 |
commit | 9a31f6fe7adfa50c66e22a7b456ebe495e6101f5 (patch) | |
tree | 9d153086175b5466569d8d0ffe4cc3d589c95cff /components/script/dom | |
parent | 1c07b0f416f2e7d5530a0597bc86d41c6aeeb36a (diff) | |
download | servo-9a31f6fe7adfa50c66e22a7b456ebe495e6101f5.tar.gz servo-9a31f6fe7adfa50c66e22a7b456ebe495e6101f5.zip |
Add blank FakeXRDeviceController interface
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/fakexrdevicecontroller.rs | 34 | ||||
-rw-r--r-- | components/script/dom/mod.rs | 1 | ||||
-rw-r--r-- | components/script/dom/webidls/FakeXRDeviceController.webidl | 49 |
3 files changed, 84 insertions, 0 deletions
diff --git a/components/script/dom/fakexrdevicecontroller.rs b/components/script/dom/fakexrdevicecontroller.rs new file mode 100644 index 00000000000..181de822fc7 --- /dev/null +++ b/components/script/dom/fakexrdevicecontroller.rs @@ -0,0 +1,34 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +use crate::dom::bindings::codegen::Bindings::FakeXRDeviceControllerBinding; +use crate::dom::bindings::reflector::{reflect_dom_object, Reflector}; +use crate::dom::bindings::root::DomRoot; +use crate::dom::globalscope::GlobalScope; +use dom_struct::dom_struct; + +#[dom_struct] +pub struct FakeXRDeviceController { + reflector: Reflector, +} + +impl FakeXRDeviceController { + pub fn new_inherited() -> FakeXRDeviceController { + FakeXRDeviceController { + reflector: Reflector::new(), + } + } + + pub fn new(global: &GlobalScope) -> DomRoot<FakeXRDeviceController> { + reflect_dom_object( + Box::new(FakeXRDeviceController::new_inherited()), + global, + FakeXRDeviceControllerBinding::Wrap, + ) + } +} diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index c3fcedf48ed..cf8d8a49389 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -301,6 +301,7 @@ pub mod eventsource; pub mod eventtarget; pub mod extendableevent; pub mod extendablemessageevent; +pub mod fakexrdevicecontroller; pub mod file; pub mod filelist; pub mod filereader; diff --git a/components/script/dom/webidls/FakeXRDeviceController.webidl b/components/script/dom/webidls/FakeXRDeviceController.webidl new file mode 100644 index 00000000000..dbeb93428d7 --- /dev/null +++ b/components/script/dom/webidls/FakeXRDeviceController.webidl @@ -0,0 +1,49 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +// https://github.com/immersive-web/webxr-test-api/ + +[Exposed=Window, Pref="dom.webxr.test"] +interface FakeXRDeviceController { + // Creates and attaches a XRFrameOfReference of the type specified to the device. + // void setFrameOfReference(XRFrameOfReferenceType, FakeXRFrameOfReferenceInit); + + // // Sets the values to be used for subsequent + // // requestAnimationFrame() callbacks. + // void setViews(Array<FakeXRViewInit> views); + + // void setViewerOrigin(FakeXRRigidTransform origin); + + // Simulates the user activating the reset pose on a device. + // void simulateResetPose(); + + // Simulates the platform ending the sessions. + // void simulateForcedEndSessions(); + + // Simulates devices focusing and blurring sessions. + // void simulateBlurSession(XRSession); + // void simulateFocusSession(XRSession); + + // void setBoundsGeometry(Array<FakeXRBoundsPoint> boundsCoodinates)l + + // Promise<FakeXRInputSourceController> + // simulateInputSourceConnection(FakeXRInputSourceInit); +}; + +dictionary FakeXRViewInit { + required XREye eye; + // https://immersive-web.github.io/webxr/#view-projection-matrix + required sequence<float> projectionMatrix; + // https://immersive-web.github.io/webxr/#view-offset + required FakeXRRigidTransform viewOffset; +}; + +dictionary FakeXRBoundsPoint { + double x; double z; +}; + +dictionary FakeXRRigidTransform { + required sequence<float> position; + required sequence<float> orientation; +}; |