-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64f6154
commit 9b5eb9d
Showing
16 changed files
with
797 additions
and
246 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,69 @@ | ||
use crate::wayland::core::surface::{Surface, WlSurface}; | ||
use super::surface::WL_SURFACE_REGISTRY; | ||
use crate::wayland::core::surface::Surface; | ||
pub use waynest::server::protocol::core::wayland::wl_compositor::*; | ||
use waynest::{ | ||
server::{Client, Dispatcher, Object, Result}, | ||
server::{ | ||
protocol::core::wayland::{wl_region::WlRegion, wl_surface::WlSurface}, | ||
Client, Dispatcher, Object, Result, | ||
}, | ||
wire::ObjectId, | ||
}; | ||
|
||
#[derive(Debug, Dispatcher, Default)] | ||
pub struct Compositor; | ||
|
||
impl WlCompositor for Compositor { | ||
async fn create_surface( | ||
&self, | ||
_object: &Object, | ||
client: &mut Client, | ||
id: ObjectId, | ||
) -> Result<()> { | ||
client.insert(Surface::default().into_object(id)); | ||
let surface = Surface::new(client).into_object(id); | ||
WL_SURFACE_REGISTRY.add_raw(&surface.as_dispatcher()?); | ||
client.insert(surface); | ||
|
||
Ok(()) | ||
} | ||
|
||
async fn create_region( | ||
&self, | ||
_object: &Object, | ||
client: &mut Client, | ||
id: ObjectId, | ||
) -> Result<()> { | ||
client.insert(Region::default().into_object(id)); | ||
Ok(()) | ||
} | ||
} | ||
|
||
#[derive(Debug, Dispatcher, Default)] | ||
pub struct Region {} | ||
impl WlRegion for Region { | ||
async fn add( | ||
&self, | ||
_object: &Object, | ||
_client: &mut Client, | ||
_id: ObjectId, | ||
_x: i32, | ||
_y: i32, | ||
_width: i32, | ||
_height: i32, | ||
) -> Result<()> { | ||
todo!() | ||
Ok(()) | ||
} | ||
|
||
async fn subtract( | ||
&self, | ||
_object: &Object, | ||
_client: &mut Client, | ||
_x: i32, | ||
_y: i32, | ||
_width: i32, | ||
_height: i32, | ||
) -> Result<()> { | ||
Ok(()) | ||
} | ||
|
||
async fn destroy(&self, _object: &Object, _client: &mut Client) -> Result<()> { | ||
Ok(()) | ||
} | ||
} |
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
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
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
Oops, something went wrong.