mirror of
https://github.com/neovide/neovide.git
synced 2026-09-10 07:16:25 -04:00
feat: refactor project structure for platform-specific code - part 1
- add the `platform` module - move the `macos` module from `window` to `platform` - add a new `mod.rs` file in the `platform` directory - update import paths for `macos` module in `renderer` and `vsync_macos_display_link` files - update import paths in the `window` module
This commit is contained in:
parent
0ea39b7737
commit
ee8e77eb00
|
|
@ -22,6 +22,7 @@ mod dimensions;
|
|||
mod editor;
|
||||
mod error_handling;
|
||||
mod frame;
|
||||
mod platform;
|
||||
mod profiling;
|
||||
mod renderer;
|
||||
mod running_tracker;
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ use crate::{
|
|||
};
|
||||
use crate::{cmd_line::CmdLineSettings, error_msg, frame::Frame};
|
||||
|
||||
use super::{WindowSettings, WindowSettingsChanged};
|
||||
use crate::window::{WindowSettings, WindowSettingsChanged};
|
||||
|
||||
static NEOVIDE_ICON_PATH: &[u8] =
|
||||
include_bytes!("../../extra/osx/Neovide.app/Contents/Resources/Neovide.icns");
|
||||
include_bytes!("../../../extra/osx/Neovide.app/Contents/Resources/Neovide.icns");
|
||||
|
||||
define_class!(
|
||||
// A view to simulate the double-click-to-zoom effect for `--frame transparency`.
|
||||
2
src/platform/mod.rs
Normal file
2
src/platform/mod.rs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#[cfg(target_os = "macos")]
|
||||
pub mod macos;
|
||||
|
|
@ -20,9 +20,10 @@ use skia_safe::{
|
|||
use winit::{event_loop::EventLoopProxy, window::Window};
|
||||
|
||||
use crate::{
|
||||
platform::macos::get_ns_window,
|
||||
profiling::tracy_gpu_zone,
|
||||
renderer::{RendererSettings, SkiaRenderer, VSync},
|
||||
window::{macos::get_ns_window, UserEvent},
|
||||
window::UserEvent,
|
||||
};
|
||||
|
||||
use super::Settings;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use crate::window::UserEvent;
|
|||
|
||||
use std::{ffi::c_void, marker::PhantomPinned, pin::Pin, ptr::NonNull};
|
||||
|
||||
use crate::{profiling::tracy_zone, window::macos::get_ns_window};
|
||||
use crate::{platform::macos::get_ns_window, profiling::tracy_zone};
|
||||
|
||||
use objc2_core_foundation::CFRetained;
|
||||
use objc2_core_graphics::CGDirectDisplayID;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ mod update_loop;
|
|||
mod window_wrapper;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub mod macos;
|
||||
use crate::platform::macos;
|
||||
#[cfg(target_os = "macos")]
|
||||
use crate::platform::macos::register_file_handler;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
use std::env;
|
||||
|
|
@ -33,9 +35,6 @@ use winit::platform::windows::WindowAttributesExtWindows;
|
|||
#[cfg(target_os = "macos")]
|
||||
use winit::platform::macos::EventLoopBuilderExtMacOS;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
use macos::register_file_handler;
|
||||
|
||||
use image::{load_from_memory, GenericImageView, Pixel};
|
||||
use keyboard_manager::KeyboardManager;
|
||||
use mouse_manager::MouseManager;
|
||||
|
|
|
|||
Loading…
Reference in a new issue