webview.rs 945 B

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