all: remove dead code
This commit is contained in:
parent
a20008d446
commit
8cee61122e
32 changed files with 9 additions and 145 deletions
|
|
@ -24,6 +24,7 @@ linear_ids!(DrmDeviceIds, DrmDeviceId);
|
|||
|
||||
pub trait Backend {
|
||||
fn run(self: Rc<Self>) -> SpawnedFuture<Result<(), Box<dyn Error>>>;
|
||||
#[cfg_attr(not(feature = "it"), allow(dead_code))]
|
||||
fn into_any(self: Rc<Self>) -> Rc<dyn Any>;
|
||||
|
||||
fn switch_to(&self, vtnr: u32) {
|
||||
|
|
|
|||
|
|
@ -222,8 +222,6 @@ pub enum ResetStatus {
|
|||
}
|
||||
|
||||
pub trait GfxFramebuffer: Debug {
|
||||
fn as_any(&self) -> &dyn Any;
|
||||
|
||||
fn take_render_ops(&self) -> Vec<GfxApiOpt>;
|
||||
|
||||
fn physical_size(&self) -> (i32, i32);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ use {
|
|||
theme::Color,
|
||||
},
|
||||
std::{
|
||||
any::Any,
|
||||
cell::Cell,
|
||||
fmt::{Debug, Formatter},
|
||||
mem,
|
||||
|
|
@ -100,10 +99,6 @@ impl Framebuffer {
|
|||
}
|
||||
|
||||
impl GfxFramebuffer for Framebuffer {
|
||||
fn as_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
|
||||
fn take_render_ops(&self) -> Vec<GfxApiOpt> {
|
||||
mem::take(&mut *self.ctx.gfx_ops.borrow_mut())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use {
|
|||
ash::{
|
||||
extensions::khr::{ExternalFenceFd, ExternalMemoryFd, ExternalSemaphoreFd, PushDescriptor},
|
||||
vk::{
|
||||
DeviceCreateInfo, DeviceMemory, DeviceQueueCreateInfo, ExtExternalMemoryDmaBufFn,
|
||||
DeviceCreateInfo, DeviceQueueCreateInfo, ExtExternalMemoryDmaBufFn,
|
||||
ExtImageDrmFormatModifierFn, ExtPhysicalDeviceDrmFn, ExtQueueFamilyForeignFn,
|
||||
ExternalSemaphoreFeatureFlags, ExternalSemaphoreHandleTypeFlags,
|
||||
ExternalSemaphoreProperties, KhrDriverPropertiesFn, KhrExternalFenceFdFn,
|
||||
|
|
@ -84,16 +84,6 @@ impl VulkanDevice {
|
|||
}
|
||||
}
|
||||
|
||||
struct FreeMem<'a>(&'a Device, DeviceMemory);
|
||||
|
||||
impl<'a> Drop for FreeMem<'a> {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
self.0.free_memory(self.1, None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanInstance {
|
||||
fn get_device_extensions(&self, phy_dev: PhysicalDevice) -> Result<Extensions, VulkanError> {
|
||||
unsafe {
|
||||
|
|
|
|||
|
|
@ -27,11 +27,6 @@ pub struct VulkanFormat {
|
|||
pub features: FormatFeatureFlags,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct VulkanFormatFeatures {
|
||||
pub linear_sampling: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct VulkanModifier {
|
||||
pub modifier: Modifier,
|
||||
|
|
|
|||
|
|
@ -516,10 +516,6 @@ impl Debug for VulkanImage {
|
|||
}
|
||||
|
||||
impl GfxFramebuffer for VulkanImage {
|
||||
fn as_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
|
||||
fn take_render_ops(&self) -> Vec<GfxApiOpt> {
|
||||
self.render_ops.take()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1023,9 +1023,6 @@ impl Debug for VulkanRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TmpShmTexture(pub i32, pub i32);
|
||||
|
||||
impl VulkanImage {
|
||||
fn assert_device(&self, device: &Device) {
|
||||
assert_eq!(
|
||||
|
|
|
|||
|
|
@ -116,7 +116,6 @@ pub trait GlobalBase {
|
|||
pub trait Global: GlobalBase {
|
||||
fn singleton(&self) -> bool;
|
||||
fn version(&self) -> u32;
|
||||
fn break_loops(&self) {}
|
||||
fn required_caps(&self) -> ClientCaps {
|
||||
ClientCaps::none()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,6 @@ pub trait DynDataOffer: 'static {
|
|||
fn offer_id(&self) -> DataOfferId;
|
||||
fn client_id(&self) -> ClientId;
|
||||
fn send_offer(&self, mime_type: &str);
|
||||
fn destroy(&self);
|
||||
fn cancel(&self);
|
||||
fn get_seat(&self) -> Rc<WlSeatGlobal>;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,10 +64,6 @@ impl DynDataOffer for WlDataOffer {
|
|||
WlDataOffer::send_offer(self, mime_type);
|
||||
}
|
||||
|
||||
fn destroy(&self) {
|
||||
destroy_data_offer::<ClipboardIpc>(self);
|
||||
}
|
||||
|
||||
fn cancel(&self) {
|
||||
cancel_offer::<ClipboardIpc>(self);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use {
|
|||
client::ClientId,
|
||||
ifs::{
|
||||
ipc::{
|
||||
cancel_offer, destroy_data_offer,
|
||||
cancel_offer,
|
||||
x_data_device::{XClipboardIpc, XIpcDevice, XPrimarySelectionIpc},
|
||||
DataOffer, DataOfferId, DynDataOffer, IpcLocation, OfferData,
|
||||
},
|
||||
|
|
@ -50,13 +50,6 @@ impl DynDataOffer for XDataOffer {
|
|||
})
|
||||
}
|
||||
|
||||
fn destroy(&self) {
|
||||
match self.location {
|
||||
IpcLocation::Clipboard => destroy_data_offer::<XClipboardIpc>(self),
|
||||
IpcLocation::PrimarySelection => destroy_data_offer::<XPrimarySelectionIpc>(self),
|
||||
}
|
||||
}
|
||||
|
||||
fn cancel(&self) {
|
||||
match self.location {
|
||||
IpcLocation::Clipboard => cancel_offer::<XClipboardIpc>(self),
|
||||
|
|
|
|||
|
|
@ -50,13 +50,6 @@ impl DynDataOffer for ZwlrDataControlOfferV1 {
|
|||
ZwlrDataControlOfferV1::send_offer(self, mime_type)
|
||||
}
|
||||
|
||||
fn destroy(&self) {
|
||||
match self.location {
|
||||
IpcLocation::Clipboard => destroy_data_offer::<WlrClipboardIpc>(self),
|
||||
IpcLocation::PrimarySelection => destroy_data_offer::<WlrPrimarySelectionIpc>(self),
|
||||
}
|
||||
}
|
||||
|
||||
fn cancel(&self) {
|
||||
match self.location {
|
||||
IpcLocation::Clipboard => cancel_offer::<WlrClipboardIpc>(self),
|
||||
|
|
|
|||
|
|
@ -50,10 +50,6 @@ impl DynDataOffer for ZwpPrimarySelectionOfferV1 {
|
|||
ZwpPrimarySelectionOfferV1::send_offer(self, mime_type);
|
||||
}
|
||||
|
||||
fn destroy(&self) {
|
||||
destroy_data_offer::<PrimarySelectionIpc>(self);
|
||||
}
|
||||
|
||||
fn cancel(&self) {
|
||||
cancel_offer::<PrimarySelectionIpc>(self);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,10 +241,6 @@ impl Global for WlOutputGlobal {
|
|||
fn version(&self) -> u32 {
|
||||
OUTPUT_VERSION
|
||||
}
|
||||
|
||||
fn break_loops(&self) {
|
||||
self.bindings.borrow_mut().clear();
|
||||
}
|
||||
}
|
||||
|
||||
dedicated_add_global!(WlOutputGlobal, outputs);
|
||||
|
|
|
|||
|
|
@ -1203,12 +1203,6 @@ impl Global for WlSeatGlobal {
|
|||
fn version(&self) -> u32 {
|
||||
9
|
||||
}
|
||||
|
||||
fn break_loops(&self) {
|
||||
self.bindings.borrow_mut().clear();
|
||||
self.queue_link.take();
|
||||
self.tree_changed_handler.take();
|
||||
}
|
||||
}
|
||||
|
||||
dedicated_add_global!(WlSeatGlobal, seats);
|
||||
|
|
|
|||
|
|
@ -339,10 +339,6 @@ trait SurfaceExt {
|
|||
}
|
||||
}
|
||||
|
||||
fn update_subsurface_parent_extents(&self) {
|
||||
// nothing
|
||||
}
|
||||
|
||||
fn subsurface_parent(&self) -> Option<Rc<WlSurface>> {
|
||||
None
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,10 +85,6 @@ impl Global for WpDrmLeaseDeviceV1Global {
|
|||
1
|
||||
}
|
||||
|
||||
fn break_loops(&self) {
|
||||
self.bindings.clear();
|
||||
}
|
||||
|
||||
fn required_caps(&self) -> ClientCaps {
|
||||
CAP_DRM_LEASE
|
||||
}
|
||||
|
|
|
|||
|
|
@ -467,33 +467,9 @@ macro_rules! fatal {
|
|||
|
||||
macro_rules! stacked_node_impl {
|
||||
() => {
|
||||
fn stacked_as_node(&self) -> &dyn Node {
|
||||
self
|
||||
}
|
||||
|
||||
fn stacked_into_node(self: Rc<Self>) -> Rc<dyn Node> {
|
||||
self
|
||||
}
|
||||
|
||||
fn stacked_into_dyn(self: Rc<Self>) -> Rc<dyn StackedNode> {
|
||||
self
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
macro_rules! containing_node_impl {
|
||||
() => {
|
||||
fn cnode_as_node(&self) -> &dyn Node {
|
||||
self
|
||||
}
|
||||
|
||||
fn cnode_into_node(self: Rc<Self>) -> Rc<dyn Node> {
|
||||
self
|
||||
}
|
||||
|
||||
fn cnode_into_dyn(self: Rc<Self>) -> Rc<dyn ContainingNode> {
|
||||
self
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ impl Display for ObjectId {
|
|||
pub trait ObjectBase {
|
||||
fn id(&self) -> ObjectId;
|
||||
fn version(&self) -> Version;
|
||||
#[cfg_attr(not(feature = "it"), allow(dead_code))]
|
||||
fn into_any(self: Rc<Self>) -> Rc<dyn Any>;
|
||||
fn handle_request(
|
||||
self: Rc<Self>,
|
||||
|
|
|
|||
|
|
@ -799,10 +799,6 @@ pub struct spa_meta_cursor {
|
|||
|
||||
unsafe impl Pod for spa_meta_cursor {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct spa_meta_control {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct spa_meta_busy {
|
||||
|
|
|
|||
|
|
@ -345,6 +345,7 @@ pub trait Handle: RequestParser<'static> {
|
|||
R: 'static,
|
||||
H: for<'a> Fn(&R, Self::Generic<'a>) + 'static;
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn handle2<R, F, H>(tl: &Rc<ToolClient>, id: impl Into<ObjectId>, r: R, h: H)
|
||||
where
|
||||
R: 'static,
|
||||
|
|
|
|||
|
|
@ -358,10 +358,6 @@ pub trait Node: 'static {
|
|||
None
|
||||
}
|
||||
|
||||
fn node_into_output(self: Rc<Self>) -> Option<Rc<OutputNode>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn node_into_surface(self: Rc<Self>) -> Option<Rc<WlSurface>> {
|
||||
None
|
||||
}
|
||||
|
|
@ -380,10 +376,6 @@ pub trait Node: 'static {
|
|||
false
|
||||
}
|
||||
|
||||
fn node_is_output(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn node_is_float(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1342,8 +1342,6 @@ impl Node for ContainerNode {
|
|||
}
|
||||
|
||||
impl ContainingNode for ContainerNode {
|
||||
containing_node_impl!();
|
||||
|
||||
fn cnode_replace_child(self: Rc<Self>, old: &dyn Node, new: Rc<dyn ToplevelNode>) {
|
||||
let node = match self.child_nodes.borrow_mut().remove(&old.node_id()) {
|
||||
Some(c) => c,
|
||||
|
|
|
|||
|
|
@ -4,10 +4,6 @@ use {
|
|||
};
|
||||
|
||||
pub trait ContainingNode: Node {
|
||||
fn cnode_as_node(&self) -> &dyn Node;
|
||||
fn cnode_into_node(self: Rc<Self>) -> Rc<dyn Node>;
|
||||
fn cnode_into_dyn(self: Rc<Self>) -> Rc<dyn ContainingNode>;
|
||||
|
||||
fn cnode_replace_child(self: Rc<Self>, old: &dyn Node, new: Rc<dyn ToplevelNode>);
|
||||
fn cnode_remove_child(self: Rc<Self>, child: &dyn Node) {
|
||||
self.cnode_remove_child2(child, false);
|
||||
|
|
|
|||
|
|
@ -586,8 +586,6 @@ impl Node for FloatNode {
|
|||
}
|
||||
|
||||
impl ContainingNode for FloatNode {
|
||||
containing_node_impl!();
|
||||
|
||||
fn cnode_replace_child(self: Rc<Self>, _old: &dyn Node, new: Rc<dyn ToplevelNode>) {
|
||||
self.discard_child_properties();
|
||||
self.child.set(Some(new.clone()));
|
||||
|
|
|
|||
|
|
@ -912,14 +912,6 @@ impl Node for OutputNode {
|
|||
fn node_on_pointer_motion(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, x: Fixed, y: Fixed) {
|
||||
self.pointer_move(seat, x.round_down(), y.round_down());
|
||||
}
|
||||
|
||||
fn node_into_output(self: Rc<Self>) -> Option<Rc<OutputNode>> {
|
||||
Some(self.clone())
|
||||
}
|
||||
|
||||
fn node_is_output(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
pub fn calculate_logical_size(
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
use {crate::tree::Node, std::rc::Rc};
|
||||
|
||||
pub trait StackedNode: Node {
|
||||
fn stacked_as_node(&self) -> &dyn Node;
|
||||
fn stacked_into_node(self: Rc<Self>) -> Rc<dyn Node>;
|
||||
fn stacked_into_dyn(self: Rc<Self>) -> Rc<dyn StackedNode>;
|
||||
fn stacked_prepare_set_visible(&self) {
|
||||
// nothing
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,8 +291,6 @@ impl Node for WorkspaceNode {
|
|||
}
|
||||
|
||||
impl ContainingNode for WorkspaceNode {
|
||||
containing_node_impl!();
|
||||
|
||||
fn cnode_replace_child(self: Rc<Self>, old: &dyn Node, new: Rc<dyn ToplevelNode>) {
|
||||
if let Some(container) = self.container.get() {
|
||||
if container.node_id() == old.node_id() {
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ impl Display for OsError {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(not(feature = "it"), allow(dead_code))]
|
||||
pub trait OsErrorExt {
|
||||
type Container;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ pub trait Try: Sized {
|
|||
where
|
||||
F: FnOnce() -> Result<(), Self>;
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn tria<F>(f: F) -> Tria<Self, F>
|
||||
where
|
||||
F: Future<Output = Result<(), Self>>;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
use crate::utils::ptr_ext::PtrExt;
|
||||
|
||||
#[cfg_attr(not(feature = "it"), allow(dead_code))]
|
||||
pub trait WindowsExt<T> {
|
||||
type Windows<'a, const N: usize>: Iterator<Item = &'a [T; N]>
|
||||
where
|
||||
Self: 'a,
|
||||
T: 'a;
|
||||
|
||||
#[cfg_attr(not(feature = "rc_tracking"), allow(dead_code))]
|
||||
fn array_windows_ext<'a, const N: usize>(&'a self) -> Self::Windows<'a, N>;
|
||||
fn array_chunks_ext<'a, const N: usize>(&'a self) -> &'a [[T; N]];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,19 +106,3 @@ impl<T> DespanExt for Option<Spanned<T>> {
|
|||
self.map(|v| v.value.into())
|
||||
}
|
||||
}
|
||||
|
||||
pub trait SpannedResultExt1: Sized {
|
||||
type T;
|
||||
type E;
|
||||
|
||||
fn map_spanned<U, F: FnOnce(Self::T) -> U>(self, f: F) -> Result<Spanned<U>, Self::E>;
|
||||
}
|
||||
|
||||
impl<T, E> SpannedResultExt1 for Result<Spanned<T>, E> {
|
||||
type T = T;
|
||||
type E = E;
|
||||
|
||||
fn map_spanned<U, F: FnOnce(Self::T) -> U>(self, f: F) -> Result<Spanned<U>, Self::E> {
|
||||
self.map(|v| v.map(f))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue