druid_shell/platform/linux.rs
1// Copyright 2021 The Druid Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Linux specific extensions.
16use crate::Clipboard;
17
18/// Linux specific extensions to [`Application`]
19///
20/// [`Application`]: crate::Application
21pub trait ApplicationExt {
22 /// Returns a handle to the primary system clipboard.
23 ///
24 /// This is useful for middle mouse paste.
25 fn primary_clipboard(&self) -> Clipboard;
26}
27
28#[cfg(test)]
29#[allow(unused_imports)]
30mod test {
31 use crate::Application;
32
33 use super::*;
34 use static_assertions as sa;
35 // TODO: impl ApplicationExt for wayland
36 #[cfg(not(feature = "wayland"))]
37 sa::assert_impl_all!(Application: ApplicationExt);
38}