cosmic/
lib.rs

1// Copyright 2022 System76 <info@system76.com>
2// SPDX-License-Identifier: MPL-2.0
3
4#![allow(clippy::module_name_repetitions)]
5#![cfg_attr(target_os = "redox", feature(lazy_cell))]
6#![cfg_attr(docsrs, feature(doc_auto_cfg))]
7
8/// Recommended default imports.
9pub mod prelude {
10    #[cfg(feature = "winit")]
11    pub use crate::ApplicationExt;
12    pub use crate::ext::*;
13    pub use crate::{Also, Apply, Element, Renderer, Task, Theme};
14}
15
16pub use apply::{Also, Apply};
17
18/// Actions are managed internally by the cosmic runtime.
19pub mod action;
20pub use action::Action;
21
22pub mod anim;
23
24#[cfg(feature = "winit")]
25pub mod app;
26#[cfg(feature = "winit")]
27#[doc(inline)]
28pub use app::{Application, ApplicationExt};
29
30#[cfg(feature = "applet")]
31pub mod applet;
32
33pub mod command;
34
35/// State which is managed by the cosmic runtime.
36pub mod core;
37#[doc(inline)]
38pub use core::Core;
39
40pub mod config;
41
42#[doc(inline)]
43pub use cosmic_config;
44
45#[doc(inline)]
46pub use cosmic_theme;
47
48#[cfg(feature = "single-instance")]
49pub mod dbus_activation;
50#[cfg(feature = "single-instance")]
51pub use dbus_activation::DbusActivation;
52
53#[cfg(feature = "desktop")]
54pub mod desktop;
55
56#[cfg(any(feature = "xdg-portal", feature = "rfd"))]
57pub mod dialog;
58
59pub mod executor;
60#[cfg(feature = "tokio")]
61pub use executor::single::Executor as SingleThreadExecutor;
62
63mod ext;
64
65pub mod font;
66
67#[doc(inline)]
68pub use iced;
69
70pub mod icon_theme;
71pub mod keyboard_nav;
72
73mod localize;
74
75#[cfg(all(target_env = "gnu", not(target_os = "windows")))]
76pub(crate) mod malloc;
77
78#[cfg(all(feature = "process", not(windows)))]
79pub mod process;
80
81#[doc(inline)]
82#[cfg(all(feature = "wayland", target_os = "linux"))]
83pub use cctk;
84
85pub mod surface;
86
87pub use iced::Task;
88pub mod task;
89
90pub mod theme;
91
92pub mod scroll;
93
94#[doc(inline)]
95pub use theme::{Theme, style};
96
97pub mod widget;
98type Plain = iced_core::text::paragraph::Plain<<Renderer as iced_core::text::Renderer>::Paragraph>;
99type Paragraph = <Renderer as iced_core::text::Renderer>::Paragraph;
100pub type Renderer = iced::Renderer;
101pub type Element<'a, Message> = iced::Element<'a, Message, crate::Theme, Renderer>;