all: remove control center in its entirety
This commit is contained in:
parent
1dfd6169f8
commit
769d12a525
97 changed files with 59 additions and 10580 deletions
|
|
@ -12,9 +12,8 @@ use {
|
|||
usr_jay_screencast::UsrJayScreencast,
|
||||
usr_jay_select_toplevel::UsrJaySelectToplevel,
|
||||
usr_jay_select_workspace::UsrJaySelectWorkspace,
|
||||
usr_jay_sync_file_surface::UsrJaySyncFileSurface,
|
||||
usr_jay_workspace_watcher::UsrJayWorkspaceWatcher, usr_wl_output::UsrWlOutput,
|
||||
usr_wl_seat::UsrWlSeat, usr_wl_surface::UsrWlSurface,
|
||||
usr_wl_seat::UsrWlSeat,
|
||||
},
|
||||
usr_object::UsrObject,
|
||||
},
|
||||
|
|
@ -189,20 +188,6 @@ impl UsrJayCompositor {
|
|||
obj
|
||||
}
|
||||
|
||||
pub fn get_sync_file_surface(&self, surface: &UsrWlSurface) -> Rc<UsrJaySyncFileSurface> {
|
||||
let obj = Rc::new(UsrJaySyncFileSurface {
|
||||
id: self.con.id(),
|
||||
con: self.con.clone(),
|
||||
version: self.version,
|
||||
});
|
||||
self.con.request(GetSyncFileSurface {
|
||||
self_id: self.id,
|
||||
id: obj.id,
|
||||
surface: surface.id,
|
||||
});
|
||||
self.con.add_object(obj.clone());
|
||||
obj
|
||||
}
|
||||
}
|
||||
|
||||
impl JayCompositorEventHandler for UsrJayCompositor {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
use {
|
||||
crate::{
|
||||
gfx_api::FdSync,
|
||||
object::Version,
|
||||
wire::{JaySyncFileSurfaceId, jay_sync_file_surface::*},
|
||||
wl_usr::{
|
||||
UsrCon, usr_ifs::usr_jay_sync_file_release::UsrJaySyncFileRelease,
|
||||
usr_object::UsrObject,
|
||||
},
|
||||
wl_usr::{UsrCon, usr_object::UsrObject},
|
||||
},
|
||||
std::{convert::Infallible, rc::Rc},
|
||||
};
|
||||
|
|
@ -17,37 +13,6 @@ pub struct UsrJaySyncFileSurface {
|
|||
pub version: Version,
|
||||
}
|
||||
|
||||
impl UsrJaySyncFileSurface {
|
||||
pub fn set_acquire(&self, sf: Option<&FdSync>) {
|
||||
match sf.and_then(|s| s.get_sync_file()) {
|
||||
None => {
|
||||
self.con.request(SetAcquireImmediate { self_id: self.id });
|
||||
}
|
||||
Some(sf) => {
|
||||
self.con.request(SetAcquireAsync {
|
||||
self_id: self.id,
|
||||
sync_file: sf.0.clone(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_release(&self) -> Rc<UsrJaySyncFileRelease> {
|
||||
let obj = Rc::new(UsrJaySyncFileRelease {
|
||||
id: self.con.id(),
|
||||
con: self.con.clone(),
|
||||
owner: Default::default(),
|
||||
version: self.version,
|
||||
});
|
||||
self.con.request(GetRelease {
|
||||
self_id: self.id,
|
||||
release: obj.id,
|
||||
});
|
||||
self.con.add_object(obj.clone());
|
||||
obj
|
||||
}
|
||||
}
|
||||
|
||||
impl JaySyncFileSurfaceEventHandler for UsrJaySyncFileSurface {
|
||||
type Error = Infallible;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use {
|
|||
wire::{WlDataDeviceId, wl_data_device::*},
|
||||
wl_usr::{
|
||||
UsrCon,
|
||||
usr_ifs::{usr_wl_data_offer::UsrWlDataOffer, usr_wl_data_source::UsrWlDataSource},
|
||||
usr_ifs::usr_wl_data_offer::UsrWlDataOffer,
|
||||
usr_object::UsrObject,
|
||||
},
|
||||
},
|
||||
|
|
@ -20,16 +20,6 @@ pub struct UsrWlDataDevice {
|
|||
pub selection: CloneCell<Option<Rc<UsrWlDataOffer>>>,
|
||||
}
|
||||
|
||||
impl UsrWlDataDevice {
|
||||
pub fn set_selection(&self, serial: u32, source: &UsrWlDataSource) {
|
||||
self.con.request(SetSelection {
|
||||
self_id: self.id,
|
||||
source: source.id,
|
||||
serial,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl WlDataDeviceEventHandler for UsrWlDataDevice {
|
||||
type Error = Infallible;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,14 +2,7 @@ use {
|
|||
crate::{
|
||||
object::Version,
|
||||
wire::{WlDataDeviceManagerId, wl_data_device_manager::*},
|
||||
wl_usr::{
|
||||
UsrCon,
|
||||
usr_ifs::{
|
||||
usr_wl_data_device::UsrWlDataDevice, usr_wl_data_source::UsrWlDataSource,
|
||||
usr_wl_seat::UsrWlSeat,
|
||||
},
|
||||
usr_object::UsrObject,
|
||||
},
|
||||
wl_usr::{UsrCon, usr_object::UsrObject},
|
||||
},
|
||||
std::{convert::Infallible, rc::Rc},
|
||||
};
|
||||
|
|
@ -20,40 +13,6 @@ pub struct UsrWlDataDeviceManager {
|
|||
pub version: Version,
|
||||
}
|
||||
|
||||
impl UsrWlDataDeviceManager {
|
||||
pub fn create_data_source(&self) -> Rc<UsrWlDataSource> {
|
||||
let obj = Rc::new(UsrWlDataSource {
|
||||
id: self.con.id(),
|
||||
con: self.con.clone(),
|
||||
owner: Default::default(),
|
||||
version: self.version,
|
||||
});
|
||||
self.con.request(CreateDataSource {
|
||||
self_id: self.id,
|
||||
id: obj.id,
|
||||
});
|
||||
self.con.add_object(obj.clone());
|
||||
obj
|
||||
}
|
||||
|
||||
pub fn get_data_device(&self, seat: &UsrWlSeat) -> Rc<UsrWlDataDevice> {
|
||||
let obj = Rc::new(UsrWlDataDevice {
|
||||
id: self.con.id(),
|
||||
con: self.con.clone(),
|
||||
version: self.version,
|
||||
offer: Default::default(),
|
||||
selection: Default::default(),
|
||||
});
|
||||
self.con.request(GetDataDevice {
|
||||
self_id: self.id,
|
||||
id: obj.id,
|
||||
seat: seat.id,
|
||||
});
|
||||
self.con.add_object(obj.clone());
|
||||
obj
|
||||
}
|
||||
}
|
||||
|
||||
impl WlDataDeviceManagerEventHandler for UsrWlDataDeviceManager {
|
||||
type Error = Infallible;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use {
|
|||
},
|
||||
ahash::AHashSet,
|
||||
std::{cell::RefCell, convert::Infallible, rc::Rc},
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
|
||||
pub struct UsrWlDataOffer {
|
||||
|
|
@ -16,16 +15,6 @@ pub struct UsrWlDataOffer {
|
|||
pub mime_types: RefCell<AHashSet<String>>,
|
||||
}
|
||||
|
||||
impl UsrWlDataOffer {
|
||||
pub fn receive(&self, mime_type: &str, fd: &Rc<OwnedFd>) {
|
||||
self.con.request(Receive {
|
||||
self_id: self.id,
|
||||
mime_type,
|
||||
fd: fd.clone(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl WlDataOfferEventHandler for UsrWlDataOffer {
|
||||
type Error = Infallible;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,15 +20,6 @@ pub trait UsrWlDataSourceOwner {
|
|||
fn send(&self, mime_type: &str, fd: Rc<OwnedFd>);
|
||||
}
|
||||
|
||||
impl UsrWlDataSource {
|
||||
pub fn offer(&self, mime_type: &str) {
|
||||
self.con.request(Offer {
|
||||
self_id: self.id,
|
||||
mime_type,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl WlDataSourceEventHandler for UsrWlDataSource {
|
||||
type Error = Infallible;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ use {
|
|||
ifs::wl_seat::wl_pointer::PendingScroll,
|
||||
object::Version,
|
||||
utils::clonecell::CloneCell,
|
||||
wire::{WlPointerId, WlSurfaceId, wl_pointer::*},
|
||||
wl_usr::{UsrCon, usr_ifs::usr_wl_surface::UsrWlSurface, usr_object::UsrObject},
|
||||
wire::{WlPointerId, wl_pointer::*},
|
||||
wl_usr::{UsrCon, usr_object::UsrObject},
|
||||
},
|
||||
std::{cell::Cell, convert::Infallible, rc::Rc},
|
||||
};
|
||||
|
|
@ -40,18 +40,6 @@ pub trait UsrWlPointerOwner {
|
|||
}
|
||||
}
|
||||
|
||||
impl UsrWlPointer {
|
||||
pub fn set_cursor(&self, serial: u32, cursor: Option<&UsrWlSurface>, hot_x: i32, hot_y: i32) {
|
||||
self.con.request(SetCursor {
|
||||
self_id: self.id,
|
||||
serial,
|
||||
surface: cursor.map(|c| c.id).unwrap_or(WlSurfaceId::NONE),
|
||||
hotspot_x: hot_x,
|
||||
hotspot_y: hot_y,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl WlPointerEventHandler for UsrWlPointer {
|
||||
type Error = Infallible;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use {
|
|||
wire::{WlSeatId, wl_seat::*},
|
||||
wl_usr::{
|
||||
UsrCon,
|
||||
usr_ifs::{usr_wl_keyboard::UsrWlKeyboard, usr_wl_pointer::UsrWlPointer},
|
||||
usr_ifs::usr_wl_pointer::UsrWlPointer,
|
||||
usr_object::UsrObject,
|
||||
},
|
||||
},
|
||||
|
|
@ -47,21 +47,6 @@ impl UsrWlSeat {
|
|||
ptr
|
||||
}
|
||||
|
||||
pub fn get_keyboard(&self) -> Rc<UsrWlKeyboard> {
|
||||
let kb = Rc::new(UsrWlKeyboard {
|
||||
id: self.con.id(),
|
||||
con: self.con.clone(),
|
||||
keyboard: Default::default(),
|
||||
owner: Default::default(),
|
||||
version: self.version,
|
||||
});
|
||||
self.con.add_object(kb.clone());
|
||||
self.con.request(GetKeyboard {
|
||||
self_id: self.id,
|
||||
id: kb.id,
|
||||
});
|
||||
kb
|
||||
}
|
||||
}
|
||||
|
||||
impl WlSeatEventHandler for UsrWlSeat {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use {
|
||||
crate::{
|
||||
cursor::KnownCursor,
|
||||
object::Version,
|
||||
wire::{WpCursorShapeDeviceV1Id, wp_cursor_shape_device_v1::*},
|
||||
wl_usr::{UsrCon, usr_object::UsrObject},
|
||||
|
|
@ -14,16 +13,6 @@ pub struct UsrWpCursorShapeDeviceV1 {
|
|||
pub version: Version,
|
||||
}
|
||||
|
||||
impl UsrWpCursorShapeDeviceV1 {
|
||||
pub fn set_shape(&self, serial: u32, cursor: KnownCursor) {
|
||||
self.con.request(SetShape {
|
||||
self_id: self.id,
|
||||
serial,
|
||||
shape: cursor.to_shape(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl WpCursorShapeDeviceV1EventHandler for UsrWpCursorShapeDeviceV1 {
|
||||
type Error = Infallible;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,7 @@ use {
|
|||
crate::{
|
||||
object::Version,
|
||||
wire::{WpCursorShapeManagerV1Id, wp_cursor_shape_manager_v1::*},
|
||||
wl_usr::{
|
||||
UsrCon,
|
||||
usr_ifs::{
|
||||
usr_wl_pointer::UsrWlPointer,
|
||||
usr_wp_cursor_shape_device_v1::UsrWpCursorShapeDeviceV1,
|
||||
},
|
||||
usr_object::UsrObject,
|
||||
},
|
||||
wl_usr::{UsrCon, usr_object::UsrObject},
|
||||
},
|
||||
std::{convert::Infallible, rc::Rc},
|
||||
};
|
||||
|
|
@ -20,23 +13,6 @@ pub struct UsrWpCursorShapeManagerV1 {
|
|||
pub version: Version,
|
||||
}
|
||||
|
||||
impl UsrWpCursorShapeManagerV1 {
|
||||
pub fn get_pointer(&self, pointer: &UsrWlPointer) -> Rc<UsrWpCursorShapeDeviceV1> {
|
||||
let obj = Rc::new(UsrWpCursorShapeDeviceV1 {
|
||||
id: self.con.id(),
|
||||
con: self.con.clone(),
|
||||
version: self.version,
|
||||
});
|
||||
self.con.request(GetPointer {
|
||||
self_id: self.id,
|
||||
cursor_shape_device: obj.id,
|
||||
pointer: pointer.id,
|
||||
});
|
||||
self.con.add_object(obj.clone());
|
||||
obj
|
||||
}
|
||||
}
|
||||
|
||||
impl WpCursorShapeManagerV1EventHandler for UsrWpCursorShapeManagerV1 {
|
||||
type Error = Infallible;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use {
|
|||
object::Version,
|
||||
utils::clonecell::CloneCell,
|
||||
wire::{XdgSurfaceId, xdg_surface::*},
|
||||
wl_usr::{UsrCon, usr_ifs::usr_xdg_toplevel::UsrXdgToplevel, usr_object::UsrObject},
|
||||
wl_usr::{UsrCon, usr_object::UsrObject},
|
||||
},
|
||||
std::{convert::Infallible, rc::Rc},
|
||||
};
|
||||
|
|
@ -21,23 +21,6 @@ pub trait UsrXdgSurfaceOwner {
|
|||
}
|
||||
}
|
||||
|
||||
impl UsrXdgSurface {
|
||||
pub fn get_toplevel(&self) -> Rc<UsrXdgToplevel> {
|
||||
let obj = Rc::new(UsrXdgToplevel {
|
||||
id: self.con.id(),
|
||||
con: self.con.clone(),
|
||||
owner: Default::default(),
|
||||
version: self.version,
|
||||
});
|
||||
self.con.request(GetToplevel {
|
||||
self_id: self.id,
|
||||
id: obj.id,
|
||||
});
|
||||
self.con.add_object(obj.clone());
|
||||
obj
|
||||
}
|
||||
}
|
||||
|
||||
impl XdgSurfaceEventHandler for UsrXdgSurface {
|
||||
type Error = Infallible;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use {
|
|||
crate::{
|
||||
object::Version,
|
||||
utils::clonecell::CloneCell,
|
||||
wire::{WlOutputId, XdgToplevelId, xdg_toplevel::*},
|
||||
wire::{XdgToplevelId, xdg_toplevel::*},
|
||||
wl_usr::{UsrCon, usr_object::UsrObject},
|
||||
},
|
||||
std::{convert::Infallible, rc::Rc},
|
||||
|
|
@ -15,29 +15,6 @@ pub struct UsrXdgToplevel {
|
|||
pub version: Version,
|
||||
}
|
||||
|
||||
impl UsrXdgToplevel {
|
||||
pub fn set_title(&self, title: &str) {
|
||||
self.con.request(SetTitle {
|
||||
self_id: self.id,
|
||||
title,
|
||||
});
|
||||
}
|
||||
|
||||
pub fn set_fullscreen(&self, fullscreen: bool) {
|
||||
match fullscreen {
|
||||
true => {
|
||||
self.con.request(SetFullscreen {
|
||||
self_id: self.id,
|
||||
output: WlOutputId::NONE,
|
||||
});
|
||||
}
|
||||
false => {
|
||||
self.con.request(UnsetFullscreen { self_id: self.id });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait UsrXdgToplevelOwner {
|
||||
fn configure(&self, width: i32, height: i32) {
|
||||
let _ = width;
|
||||
|
|
@ -49,8 +26,6 @@ pub trait UsrXdgToplevelOwner {
|
|||
}
|
||||
}
|
||||
|
||||
impl UsrXdgToplevel {}
|
||||
|
||||
impl XdgToplevelEventHandler for UsrXdgToplevel {
|
||||
type Error = Infallible;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@ use {
|
|||
crate::{
|
||||
object::Version,
|
||||
wire::{XdgWmBaseId, xdg_wm_base::*},
|
||||
wl_usr::{
|
||||
UsrCon,
|
||||
usr_ifs::{usr_wl_surface::UsrWlSurface, usr_xdg_surface::UsrXdgSurface},
|
||||
usr_object::UsrObject,
|
||||
},
|
||||
wl_usr::{UsrCon, usr_object::UsrObject},
|
||||
},
|
||||
std::{convert::Infallible, rc::Rc},
|
||||
};
|
||||
|
|
@ -17,24 +13,6 @@ pub struct UsrXdgWmBase {
|
|||
pub version: Version,
|
||||
}
|
||||
|
||||
impl UsrXdgWmBase {
|
||||
pub fn get_xdg_surface(&self, surface: &UsrWlSurface) -> Rc<UsrXdgSurface> {
|
||||
let obj = Rc::new(UsrXdgSurface {
|
||||
id: self.con.id(),
|
||||
con: self.con.clone(),
|
||||
owner: Default::default(),
|
||||
version: self.version,
|
||||
});
|
||||
self.con.request(GetXdgSurface {
|
||||
self_id: self.id,
|
||||
id: obj.id,
|
||||
surface: surface.id,
|
||||
});
|
||||
self.con.add_object(obj.clone());
|
||||
obj
|
||||
}
|
||||
}
|
||||
|
||||
impl XdgWmBaseEventHandler for UsrXdgWmBase {
|
||||
type Error = Infallible;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
use {
|
||||
crate::{
|
||||
format::Format,
|
||||
object::Version,
|
||||
video::Modifier,
|
||||
wire::{ZwpLinuxBufferParamsV1Id, zwp_linux_buffer_params_v1::*},
|
||||
wl_usr::{UsrCon, usr_ifs::usr_wl_buffer::UsrWlBuffer, usr_object::UsrObject},
|
||||
wl_usr::{UsrCon, usr_object::UsrObject},
|
||||
},
|
||||
std::{convert::Infallible, rc::Rc},
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
|
||||
pub struct UsrZwpLinuxBufferParamsV1 {
|
||||
|
|
@ -16,45 +13,6 @@ pub struct UsrZwpLinuxBufferParamsV1 {
|
|||
pub version: Version,
|
||||
}
|
||||
|
||||
impl UsrZwpLinuxBufferParamsV1 {
|
||||
pub fn add(
|
||||
&self,
|
||||
fd: &Rc<OwnedFd>,
|
||||
plane_idx: usize,
|
||||
offset: u32,
|
||||
stride: u32,
|
||||
modifier: Modifier,
|
||||
) {
|
||||
self.con.request(Add {
|
||||
self_id: self.id,
|
||||
fd: fd.clone(),
|
||||
plane_idx: plane_idx as u32,
|
||||
offset,
|
||||
stride,
|
||||
modifier,
|
||||
});
|
||||
}
|
||||
|
||||
pub fn create_immed(&self, width: i32, height: i32, format: &Format) -> Rc<UsrWlBuffer> {
|
||||
let obj = Rc::new(UsrWlBuffer {
|
||||
id: self.con.id(),
|
||||
con: self.con.clone(),
|
||||
owner: Default::default(),
|
||||
version: self.version,
|
||||
});
|
||||
self.con.request(CreateImmed {
|
||||
self_id: self.id,
|
||||
buffer_id: obj.id,
|
||||
width,
|
||||
height,
|
||||
format: format.drm,
|
||||
flags: 0,
|
||||
});
|
||||
self.con.add_object(obj.clone());
|
||||
obj
|
||||
}
|
||||
}
|
||||
|
||||
impl ZwpLinuxBufferParamsV1EventHandler for UsrZwpLinuxBufferParamsV1 {
|
||||
type Error = Infallible;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
use {
|
||||
crate::{
|
||||
object::Version,
|
||||
video::dmabuf::DmaBuf,
|
||||
wire::{ZwpLinuxDmabufV1Id, zwp_linux_dmabuf_v1::*},
|
||||
wl_usr::{
|
||||
UsrCon,
|
||||
usr_ifs::{
|
||||
usr_wl_buffer::UsrWlBuffer,
|
||||
usr_zwp_linux_buffer_params_v1::UsrZwpLinuxBufferParamsV1,
|
||||
},
|
||||
usr_object::UsrObject,
|
||||
},
|
||||
wl_usr::{UsrCon, usr_object::UsrObject},
|
||||
},
|
||||
std::{convert::Infallible, rc::Rc},
|
||||
};
|
||||
|
|
@ -21,27 +13,6 @@ pub struct UsrZwpLinuxDmabufV1 {
|
|||
pub version: Version,
|
||||
}
|
||||
|
||||
impl UsrZwpLinuxDmabufV1 {
|
||||
pub fn create_buffer(&self, buffer: &DmaBuf) -> Rc<UsrWlBuffer> {
|
||||
let params = Rc::new(UsrZwpLinuxBufferParamsV1 {
|
||||
id: self.con.id(),
|
||||
con: self.con.clone(),
|
||||
version: self.version,
|
||||
});
|
||||
self.con.request(CreateParams {
|
||||
self_id: self.id,
|
||||
params_id: params.id,
|
||||
});
|
||||
self.con.add_object(params.clone());
|
||||
for (idx, plane) in buffer.planes.iter().enumerate() {
|
||||
params.add(&plane.fd, idx, plane.offset, plane.stride, buffer.modifier);
|
||||
}
|
||||
let obj = params.create_immed(buffer.width, buffer.height, &buffer.format);
|
||||
self.con.remove_obj(&*params);
|
||||
obj
|
||||
}
|
||||
}
|
||||
|
||||
impl ZwpLinuxDmabufV1EventHandler for UsrZwpLinuxDmabufV1 {
|
||||
type Error = Infallible;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue