Squash of 7 yoda commits forming the fork pivot: -255cf7ccrename: libcosmic -> libcosmic-yoda (fork 0.1.0-yoda) -8701aa31feat(yoda): Wayland-only cut — drop winit and x11 features -6736a596yoda: soft-fork pivot — keep Cargo name 'libcosmic' for dep unification -3e23d087yoda: re-apply hard rename — libcosmic -> libcosmic-yoda (0.1.0-yoda) -aec3eb61yoda: ungate remaining winit+wayland combined cfgs -8ab7b158yoda-v2: color_picker Theme ref + context_menu/menu ungate winit -8d1d8739yoda: drop x11 defaults on iced_winit + iced_tiny_skia
37 lines
844 B
Rust
37 lines
844 B
Rust
// Copyright 2023 System76 <info@system76.com>
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
use crate::app;
|
|
#[cfg(feature = "single-instance")]
|
|
use crate::dbus_activation;
|
|
|
|
pub const fn app<M>(message: M) -> Action<M> {
|
|
Action::App(message)
|
|
}
|
|
pub const fn cosmic<M>(message: app::Action) -> Action<M> {
|
|
Action::Cosmic(message)
|
|
}
|
|
|
|
pub const fn none<M>() -> Action<M> {
|
|
Action::None
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
#[must_use]
|
|
pub enum Action<M> {
|
|
/// Messages from the application, for the application.
|
|
App(M),
|
|
/// Internal messages to be handled by libcosmic.
|
|
Cosmic(app::Action),
|
|
#[cfg(feature = "single-instance")]
|
|
/// Dbus activation messages
|
|
DbusActivation(dbus_activation::Message),
|
|
/// Do nothing
|
|
None,
|
|
}
|
|
|
|
impl<M> From<M> for Action<M> {
|
|
fn from(value: M) -> Self {
|
|
Self::App(value)
|
|
}
|
|
}
|