kazari 0.0.1

A no_std GUI software stack (Work-in-Progress)
Documentation
//! The wl_data_device_manager is a singleton global object that provides access to
//! inter-client data transfer mechanisms such as copy-and-paste and drag-and-drop.
//! these mechanisms are tied to a wl_seat and this interface lets a client get a
//! wl_data_device corresponding to a wl_seat. depending on the version bound, the
//! objects created from the bound wl_data_device_manager object will have different
//! requirements for functioning properly. see wl_data_source.set_actions,
//! wl_data_offer.accept and wl_data_offer.finish for details.

//
//
//              GENERATED BY OUR WAYLAND-SCANNER. DO NOT EDIT!
//
//

#![allow(unused)]
#![allow(clippy::from_over_into)]
#![allow(clippy::match_single_binding)]

use crate::wl::{
    Array, Connection, Handle, Interface, Message, NewId, ObjectId, Opcode, Payload, PayloadType,
    RawMessage, SendError,
};
use alloc::rc::Rc;
use alloc::string::String;
use core::cell::RefCell;
use smallvec::smallvec;

use crate::wl::protocols::common::wl_buffer::WlBuffer;
use crate::wl::protocols::common::wl_callback::WlCallback;
use crate::wl::protocols::common::wl_compositor::WlCompositor;
use crate::wl::protocols::common::wl_data_device::WlDataDevice;

use crate::wl::protocols::common::wl_data_device_manager::*;
use crate::wl::protocols::common::wl_data_offer::WlDataOffer;
use crate::wl::protocols::common::wl_data_source::WlDataSource;
use crate::wl::protocols::common::wl_display::WlDisplay;
use crate::wl::protocols::common::wl_keyboard::WlKeyboard;
use crate::wl::protocols::common::wl_output::WlOutput;
use crate::wl::protocols::common::wl_pointer::WlPointer;
use crate::wl::protocols::common::wl_region::WlRegion;
use crate::wl::protocols::common::wl_registry::WlRegistry;
use crate::wl::protocols::common::wl_seat::WlSeat;
use crate::wl::protocols::common::wl_shell::WlShell;
use crate::wl::protocols::common::wl_shell_surface::WlShellSurface;
use crate::wl::protocols::common::wl_shm::WlShm;
use crate::wl::protocols::common::wl_shm_pool::WlShmPool;
use crate::wl::protocols::common::wl_subcompositor::WlSubcompositor;
use crate::wl::protocols::common::wl_subsurface::WlSubsurface;
use crate::wl::protocols::common::wl_surface::WlSurface;
use crate::wl::protocols::common::wl_touch::WlTouch;
use crate::wl::protocols::common::xdg_popup::XdgPopup;
use crate::wl::protocols::common::xdg_positioner::XdgPositioner;
use crate::wl::protocols::common::xdg_surface::XdgSurface;
use crate::wl::protocols::common::xdg_toplevel::XdgToplevel;
use crate::wl::protocols::common::xdg_wm_base::XdgWmBase;

pub trait WlDataDeviceManagerExt {
    /// Create a new data source.
    fn create_data_source(&self, id: NewId) -> Result<(), SendError>;
    /// Create a new data device for a given seat.
    fn get_data_device(&self, id: NewId, seat: WlSeat) -> Result<(), SendError>;
}

impl WlDataDeviceManagerExt for WlDataDeviceManager {
    /// Create a new data source.
    fn create_data_source(&self, id: NewId) -> Result<(), SendError> {
        self.connection()
            .borrow_mut()
            .send(Request::CreateDataSource { id }.into_raw(self.id()))
    }
    /// Create a new data device for a given seat.
    fn get_data_device(&self, id: NewId, seat: WlSeat) -> Result<(), SendError> {
        self.connection()
            .borrow_mut()
            .send(Request::GetDataDevice { id, seat }.into_raw(self.id()))
    }
}