This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyActivity extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
} | |
interface A1 {} | |
interface A2 {} | |
interface A3 {} | |
interface A4 {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option 1, | |
statements -> <Rule 11, tokens 1 .. 8> | |
statement -> <Rule 2, tokens 1 .. 1> | |
expression -> <Rule 343, tokens 1 .. 1> | |
prefix_expression -> <Rule 347, tokens 1 .. 1> | |
prefix_operator_opt -> <Rule 348, empty> | |
postfix_expression -> <Rule 424, tokens 1 .. 1> | |
primary_expression -> <Rule 362, tokens 1 .. 1> | |
"ID" <tokens 1 .. 1> | |
generic_argument_clause_opt -> <Rule 363, empty> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
static NSString * reuseIdentifier = @"cell"; | |
MGSwipeTableCell * cell = [self.tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; | |
if (!cell) { | |
cell = [[MGSwipeTableCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier]; | |
} | |
cell.textLabel.text = @"Title"; | |
cell.detailTextLabel.text = @"Description"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait VRService: Send { | |
fn initialize(&mut self) -> Result<(), String>; | |
fn fetch_devices(&mut self) -> Result<Vec<VRDevicePtr>, String>; | |
fn is_available(&self) -> bool; | |
fn poll_events(&self) -> Vec<VRDisplayEvent>; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while let Ok(msg) = self.receiver.recv() { | |
match msg { | |
WebVRMsg::RegisterContext(context) => { | |
self.handle_register_context(context); | |
self.schedule_poll_events(); | |
}, | |
WebVRMsg::UnregisterContext(context) => { | |
self.handle_unregister_context(context); | |
}, | |
WebVRMsg::PollEvents(sender) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub enum VRCompositorCommand { | |
Create(VRCompositorId), | |
SyncPoses(VRCompositorId, f64, f64, IpcSender<Result<Vec<u8>,()>>), | |
SubmitFrame(VRCompositorId, [f32; 4], [f32; 4]), | |
Release(VRCompositorId) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Creates a typed JS array from a Rust slice | |
pub fn slice_to_array_buffer_view<T>(cx: *mut JSContext, data: &[T]) -> *mut JSObject | |
where T: ArrayBufferViewContents | |
{ | |
unsafe { | |
let js_object = T::new(cx, data.len() as u32); | |
assert!(!js_object.is_null()); | |
update_array_buffer_view(js_object, data); | |
js_object | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait VRDevice: Send + Sync { | |
// Returns unique device identifier. | |
fn device_id(&self) -> u64; | |
// Returns the current display data. | |
fn display_data(&self) -> VRDisplayData; | |
// Returns the inmediate VRFrameData of the HMD. | |
// Should be used when not presenting to the device. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[dom_struct] | |
pub struct VRDisplay { | |
eventtarget: EventTarget, | |
#[ignore_heap_size_of = "Defined in rust-webvr"] | |
display: DOMRefCell<WebVRDisplayData>, | |
depth_near: Cell<f64>, | |
depth_far: Cell<f64>, | |
presenting: Cell<bool>, | |
left_eye_params: MutHeap<JS<VREyeParameters>>, | |
right_eye_params: MutHeap<JS<VREyeParameters>>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trait object that handles WebVR commands. | |
// Receives the texture_id associated to the WebGLContext. | |
pub trait VRCompositorHandler: Send { | |
fn handle(&mut self, command: VRCompositorCommand, texture_id: Option<u32>); | |
} |
OlderNewer