2016-04-19 19:31:36 +02:00
|
|
|
#![cfg(any(target_os = "android"))]
|
|
|
|
|
|
2020-05-06 15:27:49 +02:00
|
|
|
use crate::{
|
|
|
|
|
event_loop::{EventLoop, EventLoopWindowTarget},
|
|
|
|
|
window::{Window, WindowBuilder},
|
|
|
|
|
};
|
|
|
|
|
use ndk::configuration::Configuration;
|
|
|
|
|
use ndk_glue::Rect;
|
2016-04-19 19:31:36 +02:00
|
|
|
|
2019-02-05 10:30:33 -05:00
|
|
|
/// Additional methods on `EventLoop` that are specific to Android.
|
2020-05-06 15:27:49 +02:00
|
|
|
pub trait EventLoopExtAndroid {}
|
2018-02-15 14:09:14 +01:00
|
|
|
|
2020-05-06 15:27:49 +02:00
|
|
|
impl<T> EventLoopExtAndroid for EventLoop<T> {}
|
|
|
|
|
|
|
|
|
|
/// Additional methods on `EventLoopWindowTarget` that are specific to Android.
|
|
|
|
|
pub trait EventLoopWindowTargetExtAndroid {}
|
2018-02-15 14:09:14 +01:00
|
|
|
|
2016-04-19 19:31:36 +02:00
|
|
|
/// Additional methods on `Window` that are specific to Android.
|
2019-02-05 10:30:33 -05:00
|
|
|
pub trait WindowExtAndroid {
|
2020-05-06 15:27:49 +02:00
|
|
|
fn content_rect(&self) -> Rect;
|
|
|
|
|
|
|
|
|
|
fn config(&self) -> Configuration;
|
2016-04-19 19:31:36 +02:00
|
|
|
}
|
|
|
|
|
|
2019-02-05 10:30:33 -05:00
|
|
|
impl WindowExtAndroid for Window {
|
2020-05-06 15:27:49 +02:00
|
|
|
fn content_rect(&self) -> Rect {
|
|
|
|
|
self.window.content_rect()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn config(&self) -> Configuration {
|
|
|
|
|
self.window.config()
|
2016-04-19 19:31:36 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-06 15:27:49 +02:00
|
|
|
impl<T> EventLoopWindowTargetExtAndroid for EventLoopWindowTarget<T> {}
|
|
|
|
|
|
2016-04-19 19:31:36 +02:00
|
|
|
/// Additional methods on `WindowBuilder` that are specific to Android.
|
2019-06-21 11:33:15 -04:00
|
|
|
pub trait WindowBuilderExtAndroid {}
|
2016-04-19 19:31:36 +02:00
|
|
|
|
2019-06-21 11:33:15 -04:00
|
|
|
impl WindowBuilderExtAndroid for WindowBuilder {}
|