1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
use crate::MimeInfo;
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
glib::wrapper! {
#[doc(alias = "WebKitPlugin")]
pub struct Plugin(Object<ffi::WebKitPlugin, ffi::WebKitPluginClass>);
match fn {
type_ => || ffi::webkit_plugin_get_type(),
}
}
impl Plugin {
pub const NONE: Option<&'static Plugin> = None;
}
pub trait PluginExt: 'static {
#[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
#[doc(alias = "webkit_plugin_get_description")]
#[doc(alias = "get_description")]
fn description(&self) -> Option<glib::GString>;
#[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
#[doc(alias = "webkit_plugin_get_mime_info_list")]
#[doc(alias = "get_mime_info_list")]
fn mime_info_list(&self) -> Vec<MimeInfo>;
#[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
#[doc(alias = "webkit_plugin_get_name")]
#[doc(alias = "get_name")]
fn name(&self) -> Option<glib::GString>;
#[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
#[doc(alias = "webkit_plugin_get_path")]
#[doc(alias = "get_path")]
fn path(&self) -> Option<glib::GString>;
}
impl<O: IsA<Plugin>> PluginExt for O {
fn description(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::webkit_plugin_get_description(
self.as_ref().to_glib_none().0,
))
}
}
fn mime_info_list(&self) -> Vec<MimeInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::webkit_plugin_get_mime_info_list(
self.as_ref().to_glib_none().0,
))
}
}
fn name(&self) -> Option<glib::GString> {
unsafe { from_glib_none(ffi::webkit_plugin_get_name(self.as_ref().to_glib_none().0)) }
}
fn path(&self) -> Option<glib::GString> {
unsafe { from_glib_none(ffi::webkit_plugin_get_path(self.as_ref().to_glib_none().0)) }
}
}
impl fmt::Display for Plugin {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Plugin")
}
}