zng_view/
config.rs

1use zng_view_api::config::{
2    AnimationsConfig, ChromeConfig, ColorsConfig, FontAntiAliasing, KeyRepeatConfig, LocaleConfig, MultiClickConfig, TouchConfig,
3};
4
5#[cfg(windows)]
6mod windows;
7#[cfg(windows)]
8use windows as platform;
9
10#[cfg(target_os = "macos")]
11mod macos;
12#[cfg(target_os = "macos")]
13use macos as platform;
14
15#[cfg(target_os = "android")]
16mod android;
17#[cfg(target_os = "android")]
18use android as platform;
19
20#[cfg(any(
21    target_os = "linux",
22    target_os = "dragonfly",
23    target_os = "freebsd",
24    target_os = "netbsd",
25    target_os = "openbsd"
26))]
27mod dconf;
28#[cfg(any(
29    target_os = "linux",
30    target_os = "dragonfly",
31    target_os = "freebsd",
32    target_os = "netbsd",
33    target_os = "openbsd"
34))]
35use dconf as platform;
36
37mod other;
38#[cfg(not(any(
39    windows,
40    target_os = "macos",
41    target_os = "linux",
42    target_os = "dragonfly",
43    target_os = "freebsd",
44    target_os = "netbsd",
45    target_os = "openbsd",
46    target_os = "android",
47)))]
48use other as platform;
49
50pub fn font_aa() -> FontAntiAliasing {
51    platform::font_aa()
52}
53
54pub fn multi_click_config() -> MultiClickConfig {
55    platform::multi_click_config()
56}
57
58pub fn animations_config() -> AnimationsConfig {
59    platform::animations_config()
60}
61
62pub fn key_repeat_config() -> KeyRepeatConfig {
63    platform::key_repeat_config()
64}
65
66pub fn touch_config() -> TouchConfig {
67    platform::touch_config()
68}
69
70pub fn colors_config() -> ColorsConfig {
71    platform::colors_config()
72}
73
74pub fn locale_config() -> LocaleConfig {
75    platform::locale_config()
76}
77
78pub fn chrome_config() -> ChromeConfig {
79    platform::chrome_config()
80}
81
82/// Return handle must be called on exit.
83#[must_use]
84pub fn spawn_listener(event_loop: crate::AppEventSender) -> Option<Box<dyn FnOnce()>> {
85    platform::spawn_listener(event_loop)
86}