2018-12-15 20:58:43 +00:00
|
|
|
#![warn(missing_docs, rust_2018_idioms)]
|
2021-04-28 22:31:49 +00:00
|
|
|
// Allow acronyms like EGL
|
|
|
|
#![allow(clippy::upper_case_acronyms)]
|
|
|
|
|
2018-10-30 12:56:30 +00:00
|
|
|
//! **Smithay: the Wayland compositor smithy**
|
2017-04-12 19:31:31 +00:00
|
|
|
//!
|
2018-12-08 12:40:07 +00:00
|
|
|
//! Most entry points in the modules can take an optional [`slog::Logger`](::slog::Logger) as argument
|
2020-07-10 10:50:58 +00:00
|
|
|
//! that will be used as a drain for logging. If `None` is provided, the behavior depends on
|
|
|
|
//! whether the `slog-stdlog` is enabled. If yes, the module will log to the global logger of the
|
|
|
|
//! `log` crate. If not, the logs will discarded. This cargo feature is part of the default set of
|
|
|
|
//! features of Smithay.
|
2017-04-12 19:31:31 +00:00
|
|
|
|
2018-12-13 17:48:54 +00:00
|
|
|
#[doc(hidden)]
|
|
|
|
pub extern crate nix;
|
2017-12-09 16:32:22 +00:00
|
|
|
|
2017-03-07 10:53:57 +00:00
|
|
|
pub mod backend;
|
2017-09-22 08:46:00 +00:00
|
|
|
pub mod utils;
|
2019-02-05 16:26:09 +00:00
|
|
|
#[cfg(feature = "wayland_frontend")]
|
2018-09-24 22:32:09 +00:00
|
|
|
pub mod wayland;
|
2017-04-12 19:31:31 +00:00
|
|
|
|
2020-04-15 15:56:26 +00:00
|
|
|
pub mod signaling;
|
|
|
|
|
2018-04-30 19:28:17 +00:00
|
|
|
#[cfg(feature = "xwayland")]
|
|
|
|
pub mod xwayland;
|
|
|
|
|
2018-12-13 17:48:54 +00:00
|
|
|
pub mod reexports;
|
|
|
|
|
2020-07-10 10:50:58 +00:00
|
|
|
#[cfg(feature = "slog-stdlog")]
|
2021-06-23 18:01:28 +00:00
|
|
|
#[allow(dead_code)]
|
2020-07-10 10:50:58 +00:00
|
|
|
fn slog_or_fallback<L>(logger: L) -> ::slog::Logger
|
2017-06-20 09:31:18 +00:00
|
|
|
where
|
|
|
|
L: Into<Option<::slog::Logger>>,
|
2017-04-12 19:31:31 +00:00
|
|
|
{
|
|
|
|
use slog::Drain;
|
2017-09-05 17:50:22 +00:00
|
|
|
logger
|
|
|
|
.into()
|
2021-06-23 18:01:28 +00:00
|
|
|
.unwrap_or_else(|| ::slog::Logger::root(::slog_stdlog::StdLog.fuse(), slog::o!()))
|
2017-04-12 19:31:31 +00:00
|
|
|
}
|
2020-07-10 10:50:58 +00:00
|
|
|
|
|
|
|
#[cfg(not(feature = "slog-stdlog"))]
|
2021-06-23 18:01:28 +00:00
|
|
|
#[allow(dead_code)]
|
2020-07-10 10:50:58 +00:00
|
|
|
fn slog_or_fallback<L>(logger: L) -> ::slog::Logger
|
|
|
|
where
|
|
|
|
L: Into<Option<::slog::Logger>>,
|
|
|
|
{
|
|
|
|
logger
|
|
|
|
.into()
|
2021-06-23 18:01:28 +00:00
|
|
|
.unwrap_or_else(|| ::slog::Logger::root(::slog::Discard, slog::o!()))
|
2020-07-10 10:50:58 +00:00
|
|
|
}
|