chore: import from winit-core instead of the top-level crate
Reproduce with:
find ./src/platform_impl -type f -exec sed -i '' 's/crate::/winit_core::/g' {} \;
find ./src/platform_impl -type f -exec sed -i '' 's/winit_core::platform/crate::platform/g' {} \;
find ./src/platform_impl -type f -exec sed -i '' 's/winit_core::dpi::/dpi::/g' {} \;
cargo +nightly fmt
This commit is contained in:
parent
03c01e038b
commit
c846f67bcb
79 changed files with 428 additions and 417 deletions
|
|
@ -4,6 +4,9 @@ use std::ffi::c_char;
|
|||
use std::ops::Deref;
|
||||
use std::ptr::{self, NonNull};
|
||||
|
||||
use winit_core::keyboard::{
|
||||
Key, KeyCode, KeyLocation, NamedKey, NativeKey, NativeKeyCode, PhysicalKey,
|
||||
};
|
||||
#[cfg(x11_platform)]
|
||||
use x11_dl::xlib_xcb::xcb_connection_t;
|
||||
use xkb::XKB_MOD_INVALID;
|
||||
|
|
@ -14,7 +17,6 @@ use xkbcommon_dl::{
|
|||
#[cfg(wayland_platform)]
|
||||
use {memmap2::MmapOptions, std::os::unix::io::OwnedFd};
|
||||
|
||||
use crate::keyboard::{Key, KeyCode, KeyLocation, NamedKey, NativeKey, NativeKeyCode, PhysicalKey};
|
||||
#[cfg(x11_platform)]
|
||||
use crate::platform_impl::common::xkb::XKBXH;
|
||||
use crate::platform_impl::common::xkb::{XkbContext, XKBH};
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ use std::sync::LazyLock;
|
|||
|
||||
use smol_str::SmolStr;
|
||||
use tracing::warn;
|
||||
use winit_core::event::{ElementState, KeyEvent};
|
||||
use winit_core::keyboard::{Key, KeyLocation};
|
||||
use xkbcommon_dl::{
|
||||
self as xkb, xkb_compose_status, xkb_context, xkb_context_flags, xkbcommon_compose_handle,
|
||||
xkbcommon_handle, XkbCommon, XkbCommonCompose,
|
||||
|
|
@ -15,9 +17,6 @@ use xkbcommon_dl::{
|
|||
#[cfg(x11_platform)]
|
||||
use {x11_dl::xlib_xcb::xcb_connection_t, xkbcommon_dl::x11::xkbcommon_x11_handle};
|
||||
|
||||
use crate::event::{ElementState, KeyEvent};
|
||||
use crate::keyboard::{Key, KeyLocation};
|
||||
|
||||
mod compose;
|
||||
mod keymap;
|
||||
mod state;
|
||||
|
|
|
|||
|
|
@ -177,13 +177,13 @@ pub struct ModifiersState {
|
|||
pub num_lock: bool,
|
||||
}
|
||||
|
||||
impl From<ModifiersState> for crate::keyboard::ModifiersState {
|
||||
fn from(mods: ModifiersState) -> crate::keyboard::ModifiersState {
|
||||
let mut to_mods = crate::keyboard::ModifiersState::empty();
|
||||
to_mods.set(crate::keyboard::ModifiersState::SHIFT, mods.shift);
|
||||
to_mods.set(crate::keyboard::ModifiersState::CONTROL, mods.ctrl);
|
||||
to_mods.set(crate::keyboard::ModifiersState::ALT, mods.alt);
|
||||
to_mods.set(crate::keyboard::ModifiersState::META, mods.logo);
|
||||
impl From<ModifiersState> for winit_core::keyboard::ModifiersState {
|
||||
fn from(mods: ModifiersState) -> winit_core::keyboard::ModifiersState {
|
||||
let mut to_mods = winit_core::keyboard::ModifiersState::empty();
|
||||
to_mods.set(winit_core::keyboard::ModifiersState::SHIFT, mods.shift);
|
||||
to_mods.set(winit_core::keyboard::ModifiersState::CONTROL, mods.ctrl);
|
||||
to_mods.set(winit_core::keyboard::ModifiersState::ALT, mods.alt);
|
||||
to_mods.set(winit_core::keyboard::ModifiersState::META, mods.logo);
|
||||
to_mods
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue