1 | use core::ffi::c_void;
|
2 | use core::ptr::NonNull;
|
3 |
|
4 | /// Raw display handle for the Redox operating system.
|
5 | #[non_exhaustive ]
|
6 | #[derive (Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
7 | pub struct OrbitalDisplayHandle {}
|
8 |
|
9 | impl OrbitalDisplayHandle {
|
10 | /// Create a new empty display handle.
|
11 | ///
|
12 | ///
|
13 | /// # Example
|
14 | ///
|
15 | /// ```
|
16 | /// # use raw_window_handle::OrbitalDisplayHandle;
|
17 | /// let handle = OrbitalDisplayHandle::new();
|
18 | /// ```
|
19 | pub fn new() -> Self {
|
20 | Self {}
|
21 | }
|
22 | }
|
23 |
|
24 | /// Raw window handle for the Redox operating system.
|
25 | #[non_exhaustive ]
|
26 | #[derive (Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
27 | pub struct OrbitalWindowHandle {
|
28 | /// A pointer to an orbclient window.
|
29 | // TODO(madsmtm): I think this is a file descriptor, so perhaps it should
|
30 | // actually use `std::os::fd::RawFd`, or some sort of integer instead?
|
31 | pub window: NonNull<c_void>,
|
32 | }
|
33 |
|
34 | impl OrbitalWindowHandle {
|
35 | /// Create a new handle to a window.
|
36 | ///
|
37 | ///
|
38 | /// # Example
|
39 | ///
|
40 | /// ```
|
41 | /// # use core::ptr::NonNull;
|
42 | /// # use raw_window_handle::OrbitalWindowHandle;
|
43 | /// # type Window = ();
|
44 | /// #
|
45 | /// let window: NonNull<Window>;
|
46 | /// # window = NonNull::from(&());
|
47 | /// let mut handle = OrbitalWindowHandle::new(window.cast());
|
48 | /// ```
|
49 | pub fn new(window: NonNull<c_void>) -> Self {
|
50 | Self { window }
|
51 | }
|
52 | }
|
53 | |