tauri_runtime_wry/
webview.rs

1// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
2// SPDX-License-Identifier: Apache-2.0
3// SPDX-License-Identifier: MIT
4
5#[cfg(any(
6  target_os = "linux",
7  target_os = "dragonfly",
8  target_os = "freebsd",
9  target_os = "netbsd",
10  target_os = "openbsd"
11))]
12mod imp {
13  pub type Webview = webkit2gtk::WebView;
14}
15
16#[cfg(target_vendor = "apple")]
17mod imp {
18  use std::ffi::c_void;
19
20  pub struct Webview {
21    pub webview: *mut c_void,
22    pub manager: *mut c_void,
23    #[cfg(target_os = "macos")]
24    pub ns_window: *mut c_void,
25    #[cfg(target_os = "ios")]
26    pub view_controller: *mut c_void,
27  }
28}
29
30#[cfg(windows)]
31mod imp {
32  use webview2_com::Microsoft::Web::WebView2::Win32::ICoreWebView2Controller;
33  pub struct Webview {
34    pub controller: ICoreWebView2Controller,
35  }
36}
37
38#[cfg(target_os = "android")]
39mod imp {
40  use wry::JniHandle;
41  pub type Webview = JniHandle;
42}
43
44pub use imp::*;