|
@@ -28,7 +28,6 @@ pub use tauri_macros::{command, generate_handler};
|
|
|
|
|
|
pub mod api;
|
|
|
pub(crate) mod app;
|
|
|
-/// Async runtime.
|
|
|
pub mod async_runtime;
|
|
|
pub mod command;
|
|
|
/// The Tauri API endpoints.
|
|
@@ -38,16 +37,16 @@ mod event;
|
|
|
mod hooks;
|
|
|
mod manager;
|
|
|
pub mod plugin;
|
|
|
-/// Tauri window.
|
|
|
pub mod window;
|
|
|
use tauri_runtime as runtime;
|
|
|
-/// The Tauri-specific settings for your runtime e.g. notification permission status.
|
|
|
pub mod settings;
|
|
|
mod state;
|
|
|
#[cfg(feature = "updater")]
|
|
|
#[cfg_attr(doc_cfg, doc(cfg(feature = "updater")))]
|
|
|
pub mod updater;
|
|
|
|
|
|
+pub use tauri_utils as utils;
|
|
|
+
|
|
|
#[cfg(feature = "wry")]
|
|
|
#[cfg_attr(doc_cfg, doc(cfg(feature = "wry")))]
|
|
|
pub use tauri_runtime_wry::Wry;
|
|
@@ -72,8 +71,21 @@ pub use runtime::menu::CustomMenuItem;
|
|
|
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
|
|
pub use runtime::{menu::NativeImage, ActivationPolicy};
|
|
|
|
|
|
+#[cfg(feature = "system-tray")]
|
|
|
+#[cfg_attr(doc_cfg, doc(cfg(feature = "system-tray")))]
|
|
|
+pub use {
|
|
|
+ self::app::tray::{SystemTrayEvent, SystemTrayHandle},
|
|
|
+ self::runtime::{
|
|
|
+ menu::{SystemTrayMenu, SystemTrayMenuItem, SystemTraySubmenu},
|
|
|
+ SystemTray,
|
|
|
+ },
|
|
|
+};
|
|
|
+pub use {
|
|
|
+ self::app::WindowMenuEvent,
|
|
|
+ self::runtime::menu::{Menu, MenuItem, Submenu},
|
|
|
+ self::window::menu::MenuEvent,
|
|
|
+};
|
|
|
pub use {
|
|
|
- self::api::assets::Assets,
|
|
|
self::app::{App, AppHandle, Builder, CloseRequestApi, Event, GlobalWindowEvent, PathResolver},
|
|
|
self::hooks::{
|
|
|
Invoke, InvokeError, InvokeHandler, InvokeMessage, InvokeResolver, InvokeResponse, OnPageLoad,
|
|
@@ -88,26 +100,12 @@ pub use {
|
|
|
ClipboardManager, GlobalShortcutManager, Icon, RunIteration, Runtime, UserAttentionType,
|
|
|
},
|
|
|
self::state::{State, StateManager},
|
|
|
- self::window::{Monitor, Window},
|
|
|
-};
|
|
|
-#[cfg(feature = "system-tray")]
|
|
|
-#[cfg_attr(doc_cfg, doc(cfg(feature = "system-tray")))]
|
|
|
-pub use {
|
|
|
- self::app::tray::{SystemTrayEvent, SystemTrayHandle},
|
|
|
- self::runtime::{
|
|
|
- menu::{SystemTrayMenu, SystemTrayMenuItem, SystemTraySubmenu},
|
|
|
- SystemTray,
|
|
|
+ self::utils::{
|
|
|
+ assets::Assets,
|
|
|
+ config::{Config, WindowUrl},
|
|
|
+ PackageInfo,
|
|
|
},
|
|
|
-};
|
|
|
-pub use {
|
|
|
- self::app::WindowMenuEvent,
|
|
|
- self::runtime::menu::{Menu, MenuItem, Submenu},
|
|
|
- self::window::menu::MenuEvent,
|
|
|
-};
|
|
|
-
|
|
|
-pub use tauri_utils::{
|
|
|
- config::{Config, WindowUrl},
|
|
|
- PackageInfo,
|
|
|
+ self::window::{Monitor, Window},
|
|
|
};
|
|
|
|
|
|
/// Reads the config file at compile time and generates a [`Context`] based on its content.
|
|
@@ -154,7 +152,7 @@ pub struct Context<A: Assets> {
|
|
|
pub(crate) assets: Arc<A>,
|
|
|
pub(crate) default_window_icon: Option<Vec<u8>>,
|
|
|
pub(crate) system_tray_icon: Option<Icon>,
|
|
|
- pub(crate) package_info: crate::api::PackageInfo,
|
|
|
+ pub(crate) package_info: crate::PackageInfo,
|
|
|
pub(crate) _info_plist: (),
|
|
|
}
|
|
|
|
|
@@ -220,13 +218,13 @@ impl<A: Assets> Context<A> {
|
|
|
|
|
|
/// Package information.
|
|
|
#[inline(always)]
|
|
|
- pub fn package_info(&self) -> &crate::api::PackageInfo {
|
|
|
+ pub fn package_info(&self) -> &crate::PackageInfo {
|
|
|
&self.package_info
|
|
|
}
|
|
|
|
|
|
/// A mutable reference to the package information.
|
|
|
#[inline(always)]
|
|
|
- pub fn package_info_mut(&mut self) -> &mut crate::api::PackageInfo {
|
|
|
+ pub fn package_info_mut(&mut self) -> &mut crate::PackageInfo {
|
|
|
&mut self.package_info
|
|
|
}
|
|
|
|
|
@@ -237,7 +235,7 @@ impl<A: Assets> Context<A> {
|
|
|
assets: Arc<A>,
|
|
|
default_window_icon: Option<Vec<u8>>,
|
|
|
system_tray_icon: Option<Icon>,
|
|
|
- package_info: crate::api::PackageInfo,
|
|
|
+ package_info: crate::PackageInfo,
|
|
|
info_plist: (),
|
|
|
) -> Self {
|
|
|
Self {
|