Add support for generating dummy DeviceIDs and WindowIDs (#738)

* Add support for generating dummy DeviceIDs and WindowIDs

* Fix linux

* Improve docs and move dummy to unsafe

* Strengthen guarantees a bit

* Add backticks to CHANGELOG.md

Co-Authored-By: Xaeroxe <xaeroxe@amethyst-engine.org>
This commit is contained in:
Jacob Kiesel 2018-12-21 09:51:48 -07:00 committed by Osspial
parent 45a4281413
commit 9ae75c0c03
11 changed files with 121 additions and 0 deletions

View file

@ -66,12 +66,24 @@ pub enum WindowId {
Wayland(wayland::WindowId),
}
impl WindowId {
pub unsafe fn dummy() -> Self {
WindowId::X(x11::WindowId::dummy())
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum DeviceId {
X(x11::DeviceId),
Wayland(wayland::DeviceId),
}
impl DeviceId {
pub unsafe fn dummy() -> Self {
DeviceId::X(x11::DeviceId::dummy())
}
}
#[derive(Debug, Clone)]
pub enum MonitorId {
X(x11::MonitorId),