webview.rs 711 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2019-2021 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. use std::rc::Rc;
  13. pub type Webview = Rc<webkit2gtk::WebView>;
  14. }
  15. #[cfg(target_os = "macos")]
  16. mod imp {
  17. use cocoa::base::id;
  18. pub struct Webview {
  19. pub webview: id,
  20. pub manager: id,
  21. pub ns_window: id,
  22. }
  23. }
  24. #[cfg(windows)]
  25. mod imp {
  26. use webview2_com::Microsoft::Web::WebView2::Win32::ICoreWebView2Controller;
  27. pub struct Webview {
  28. pub controller: ICoreWebView2Controller,
  29. }
  30. }
  31. pub use imp::*;