mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Add lib.rs, become a mixed lib-bin crate
Will be used for visual tests.
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ use smithay::output::Output;
|
|||||||
use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
|
use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
|
||||||
|
|
||||||
use crate::input::CompositorMod;
|
use crate::input::CompositorMod;
|
||||||
use crate::Niri;
|
use crate::niri::Niri;
|
||||||
|
|
||||||
pub mod tty;
|
pub mod tty;
|
||||||
pub use tty::Tty;
|
pub use tty::Tty;
|
||||||
|
|||||||
+1
-2
@@ -48,10 +48,9 @@ use wayland_protocols::wp::presentation_time::server::wp_presentation_feedback;
|
|||||||
|
|
||||||
use super::RenderResult;
|
use super::RenderResult;
|
||||||
use crate::frame_clock::FrameClock;
|
use crate::frame_clock::FrameClock;
|
||||||
use crate::niri::{RedrawState, State};
|
use crate::niri::{Niri, RedrawState, State};
|
||||||
use crate::render_helpers::AsGlesRenderer;
|
use crate::render_helpers::AsGlesRenderer;
|
||||||
use crate::utils::get_monotonic_time;
|
use crate::utils::get_monotonic_time;
|
||||||
use crate::Niri;
|
|
||||||
|
|
||||||
const SUPPORTED_COLOR_FORMATS: &[Fourcc] = &[Fourcc::Argb8888, Fourcc::Abgr8888];
|
const SUPPORTED_COLOR_FORMATS: &[Fourcc] = &[Fourcc::Argb8888, Fourcc::Abgr8888];
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ use smithay::reexports::winit::dpi::LogicalSize;
|
|||||||
use smithay::reexports::winit::window::WindowBuilder;
|
use smithay::reexports::winit::window::WindowBuilder;
|
||||||
|
|
||||||
use super::RenderResult;
|
use super::RenderResult;
|
||||||
use crate::niri::{RedrawState, State};
|
use crate::niri::{Niri, RedrawState, State};
|
||||||
use crate::utils::get_monotonic_time;
|
use crate::utils::get_monotonic_time;
|
||||||
use crate::Niri;
|
|
||||||
|
|
||||||
pub struct Winit {
|
pub struct Winit {
|
||||||
config: Rc<RefCell<Config>>,
|
config: Rc<RefCell<Config>>,
|
||||||
|
|||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
#[macro_use]
|
||||||
|
extern crate tracing;
|
||||||
|
|
||||||
|
pub mod animation;
|
||||||
|
pub mod backend;
|
||||||
|
pub mod config_error_notification;
|
||||||
|
pub mod cursor;
|
||||||
|
#[cfg(feature = "dbus")]
|
||||||
|
pub mod dbus;
|
||||||
|
pub mod exit_confirm_dialog;
|
||||||
|
pub mod frame_clock;
|
||||||
|
pub mod handlers;
|
||||||
|
pub mod hotkey_overlay;
|
||||||
|
pub mod input;
|
||||||
|
pub mod ipc;
|
||||||
|
pub mod layout;
|
||||||
|
pub mod niri;
|
||||||
|
pub mod protocols;
|
||||||
|
pub mod render_helpers;
|
||||||
|
pub mod screenshot_ui;
|
||||||
|
pub mod utils;
|
||||||
|
pub mod watcher;
|
||||||
|
|
||||||
|
#[cfg(not(feature = "xdp-gnome-screencast"))]
|
||||||
|
pub mod dummy_pw_utils;
|
||||||
|
#[cfg(feature = "xdp-gnome-screencast")]
|
||||||
|
pub mod pw_utils;
|
||||||
|
|
||||||
|
#[cfg(not(feature = "xdp-gnome-screencast"))]
|
||||||
|
pub use dummy_pw_utils as pw_utils;
|
||||||
|
|
||||||
|
#[derive(clap::Subcommand)]
|
||||||
|
pub enum Msg {
|
||||||
|
/// List connected outputs.
|
||||||
|
Outputs,
|
||||||
|
}
|
||||||
+7
-39
@@ -1,31 +1,6 @@
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate tracing;
|
extern crate tracing;
|
||||||
|
|
||||||
mod animation;
|
|
||||||
mod backend;
|
|
||||||
mod config_error_notification;
|
|
||||||
mod cursor;
|
|
||||||
#[cfg(feature = "dbus")]
|
|
||||||
mod dbus;
|
|
||||||
mod exit_confirm_dialog;
|
|
||||||
mod frame_clock;
|
|
||||||
mod handlers;
|
|
||||||
mod hotkey_overlay;
|
|
||||||
mod input;
|
|
||||||
mod ipc;
|
|
||||||
mod layout;
|
|
||||||
mod niri;
|
|
||||||
mod protocols;
|
|
||||||
mod render_helpers;
|
|
||||||
mod screenshot_ui;
|
|
||||||
mod utils;
|
|
||||||
mod watcher;
|
|
||||||
|
|
||||||
#[cfg(not(feature = "xdp-gnome-screencast"))]
|
|
||||||
mod dummy_pw_utils;
|
|
||||||
#[cfg(feature = "xdp-gnome-screencast")]
|
|
||||||
mod pw_utils;
|
|
||||||
|
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::fs::{self, File};
|
use std::fs::{self, File};
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
@@ -35,21 +10,20 @@ use std::{env, mem};
|
|||||||
|
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use directories::ProjectDirs;
|
use directories::ProjectDirs;
|
||||||
#[cfg(not(feature = "xdp-gnome-screencast"))]
|
|
||||||
use dummy_pw_utils as pw_utils;
|
|
||||||
use git_version::git_version;
|
use git_version::git_version;
|
||||||
use niri::{Niri, State};
|
#[cfg(feature = "dbus")]
|
||||||
|
use niri::dbus;
|
||||||
|
use niri::ipc::client::handle_msg;
|
||||||
|
use niri::niri::State;
|
||||||
|
use niri::utils::{cause_panic, spawn, REMOVE_ENV_RUST_BACKTRACE, REMOVE_ENV_RUST_LIB_BACKTRACE};
|
||||||
|
use niri::watcher::Watcher;
|
||||||
|
use niri::{animation, Msg};
|
||||||
use niri_config::Config;
|
use niri_config::Config;
|
||||||
use portable_atomic::Ordering;
|
use portable_atomic::Ordering;
|
||||||
use sd_notify::NotifyState;
|
use sd_notify::NotifyState;
|
||||||
use smithay::reexports::calloop::{self, EventLoop};
|
use smithay::reexports::calloop::{self, EventLoop};
|
||||||
use smithay::reexports::wayland_server::Display;
|
use smithay::reexports::wayland_server::Display;
|
||||||
use tracing_subscriber::EnvFilter;
|
use tracing_subscriber::EnvFilter;
|
||||||
use utils::spawn;
|
|
||||||
use watcher::Watcher;
|
|
||||||
|
|
||||||
use crate::ipc::client::handle_msg;
|
|
||||||
use crate::utils::{cause_panic, REMOVE_ENV_RUST_BACKTRACE, REMOVE_ENV_RUST_LIB_BACKTRACE};
|
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[command(author, version = version(), about, long_about = None)]
|
#[command(author, version = version(), about, long_about = None)]
|
||||||
@@ -88,12 +62,6 @@ enum Sub {
|
|||||||
Panic,
|
Panic,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Subcommand)]
|
|
||||||
pub enum Msg {
|
|
||||||
/// List connected outputs.
|
|
||||||
Outputs,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
// Set backtrace defaults if not set.
|
// Set backtrace defaults if not set.
|
||||||
if env::var_os("RUST_BACKTRACE").is_none() {
|
if env::var_os("RUST_BACKTRACE").is_none() {
|
||||||
|
|||||||
Reference in New Issue
Block a user