diff --git a/Cargo.toml b/Cargo.toml index 3fcd0289..a4a10b9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "webkit2gtk" -version = "0.2.1" +version = "0.2.2" authors = ["The Gtk-rs Project Developers"] categories = ["api-bindings", "gui"] @@ -32,6 +32,18 @@ v2_16 = ["v2_14", "webkit2gtk-sys/v2_16"] bitflags = "^0.9" libc = "^0.2" +[dependencies.cairo-rs] +git = "https://github.com/gtk-rs/cairo" +version = "^0.2.0" + +[dependencies.gdk] +git = "https://github.com/gtk-rs/gdk" +version = "^0.6.0" + +[dependencies.gdk-sys] +git = "https://github.com/gtk-rs/sys" +version = "^0.4.0" + [dependencies.gio] git = "https://github.com/gtk-rs/gio" version = "^0.2.0" diff --git a/Gir.toml b/Gir.toml index 26d6bb80..42ff1498 100644 --- a/Gir.toml +++ b/Gir.toml @@ -12,7 +12,6 @@ external_libraries = [ ] generate = [ - "WebKit2.AuthenticationRequest", "WebKit2.AuthenticationScheme", "WebKit2.BackForwardList", "WebKit2.BackForwardListItem", @@ -24,6 +23,7 @@ generate = [ "WebKit2.CookieAcceptPolicy", "WebKit2.CookieManager", "WebKit2.CookiePersistentStorage", + "WebKit2.Credential", "WebKit2.CredentialPersistence", "WebKit2.Download", "WebKit2.DownloadError", @@ -36,6 +36,7 @@ generate = [ "WebKit2.FindOptions", "WebKit2.FormSubmissionRequest", "WebKit2.GeolocationPermissionRequest", + "WebKit2.HardwareAccelerationPolicy", "WebKit2.HitTestResult", "WebKit2.HitTestResultContext", "WebKit2.InsecureContentEvent", @@ -43,9 +44,11 @@ generate = [ "WebKit2.JavascriptError", "WebKit2.JavascriptResult", "WebKit2.LoadEvent", + "WebKit2.MimeInfo", "WebKit2.NavigationPolicyDecision", "WebKit2.NavigationType", "WebKit2.NetworkError", + "WebKit2.NetworkProxyMode", "WebKit2.Notification", "WebKit2.NotificationPermissionRequest", "WebKit2.PermissionRequest", @@ -55,6 +58,7 @@ generate = [ "WebKit2.PolicyDecisionType", "WebKit2.PolicyError", "WebKit2.ProcessModel", + "WebKit2.PrintCustomWidget", "WebKit2.PrintError", "WebKit2.PrintOperation", "WebKit2.PrintOperationResponse", @@ -62,6 +66,7 @@ generate = [ "WebKit2.SaveMode", "WebKit2.ScriptDialogType", "WebKit2.SecurityManager", + "WebKit2.SecurityOrigin", "WebKit2.Settings", "WebKit2.SnapshotError", "WebKit2.SnapshotOptions", @@ -74,18 +79,31 @@ generate = [ "WebKit2.UserScriptInjectionTime", "WebKit2.UserStyleLevel", "WebKit2.UserStyleSheet", - "WebKit2.WebContext", "WebKit2.WebInspector", "WebKit2.WebResource", + "WebKit2.WebsiteDataTypes", + "WebKit2.WebViewBase", + "WebKit2.WebViewSessionState", "WebKit2.WebsiteDataManager", "WebKit2.WindowProperties", ] manual = [ + "cairo.Surface", + "Gdk.Event", + "Gdk.Rectangle", + "Gdk.RGBA", + "Gio.Cancellable", + "Gio.TlsCertificate", + "Gio.TlsCertificateFlags", + "GLib.Bytes", "GLib.Error", + "GLib.List", "GLib.Variant", "GObject.Object", + #"Gtk.Action", "Gtk.Container", + "Gtk.FileFilter", "Gtk.PageSetup", "Gtk.PrintSettings", "Gtk.Widget", @@ -95,6 +113,27 @@ manual = [ "WebKit2.ScriptDialog", ] +[[object]] +name = "WebKit2.AuthenticationRequest" +status = "generate" + [[object.function]] + name = "authenticate" + ignore = true + +[[object]] +name = "WebKit2.WebContext" +status = "generate" + [[object.function]] + name = "set_network_proxy_settings" + ignore = true + +[[object]] +name = "WebKit2.NetworkProxySettings" +status = "generate" + [[object.function]] + name = "new" + ignore = true + [[object]] name = "WebKit2.URISchemeRequest" status = "generate" diff --git a/src/auto/authentication_request.rs b/src/auto/authentication_request.rs index ae6df55d..107671ff 100644 --- a/src/auto/authentication_request.rs +++ b/src/auto/authentication_request.rs @@ -1,8 +1,10 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT #[cfg(feature = "v2_2")] use AuthenticationScheme; +#[cfg(feature = "v2_2")] +use Credential; use ffi; use glib; #[cfg(feature = "v2_2")] @@ -31,9 +33,6 @@ glib_wrapper! { } pub trait AuthenticationRequestExt { - //#[cfg(feature = "v2_2")] - //fn authenticate<'a, P: Into>>(&self, credential: P); - #[cfg(feature = "v2_2")] fn can_save_credentials(&self) -> bool; @@ -46,8 +45,8 @@ pub trait AuthenticationRequestExt { #[cfg(feature = "v2_2")] fn get_port(&self) -> u32; - //#[cfg(feature = "v2_2")] - //fn get_proposed_credential(&self) -> /*Ignored*/Option; + #[cfg(feature = "v2_2")] + fn get_proposed_credential(&self) -> Option; #[cfg(feature = "v2_2")] fn get_realm(&self) -> Option; @@ -66,11 +65,6 @@ pub trait AuthenticationRequestExt { } impl + IsA> AuthenticationRequestExt for O { - //#[cfg(feature = "v2_2")] - //fn authenticate<'a, P: Into>>(&self, credential: P) { - // unsafe { TODO: call ffi::webkit_authentication_request_authenticate() } - //} - #[cfg(feature = "v2_2")] fn can_save_credentials(&self) -> bool { unsafe { @@ -99,10 +93,12 @@ impl + IsA> AuthenticationRe } } - //#[cfg(feature = "v2_2")] - //fn get_proposed_credential(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::webkit_authentication_request_get_proposed_credential() } - //} + #[cfg(feature = "v2_2")] + fn get_proposed_credential(&self) -> Option { + unsafe { + from_glib_full(ffi::webkit_authentication_request_get_proposed_credential(self.to_glib_none().0)) + } + } #[cfg(feature = "v2_2")] fn get_realm(&self) -> Option { diff --git a/src/auto/back_forward_list.rs b/src/auto/back_forward_list.rs index a42a6fc6..3ee0e0e6 100644 --- a/src/auto/back_forward_list.rs +++ b/src/auto/back_forward_list.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use BackForwardListItem; diff --git a/src/auto/back_forward_list_item.rs b/src/auto/back_forward_list_item.rs index 848ebff5..2572e18b 100644 --- a/src/auto/back_forward_list_item.rs +++ b/src/auto/back_forward_list_item.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/color_chooser_request.rs b/src/auto/color_chooser_request.rs index b4df779a..e49ae7fe 100644 --- a/src/auto/color_chooser_request.rs +++ b/src/auto/color_chooser_request.rs @@ -1,8 +1,10 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; +use gdk; use glib; +use glib::Value; use glib::object::Downcast; use glib::object::IsA; use glib::signal::SignalHandlerId; @@ -30,18 +32,18 @@ pub trait ColorChooserRequestExt { #[cfg(feature = "v2_8")] fn finish(&self); - //#[cfg(feature = "v2_8")] - //fn get_element_rectangle(&self, rect: /*Ignored*/gdk::Rectangle); + #[cfg(feature = "v2_8")] + fn get_element_rectangle(&self) -> gdk::Rectangle; - //#[cfg(feature = "v2_8")] - //fn get_rgba(&self, rgba: /*Ignored*/gdk::RGBA); + #[cfg(feature = "v2_8")] + fn get_rgba(&self) -> gdk::RGBA; - //#[cfg(feature = "v2_8")] - //fn set_rgba(&self, rgba: /*Ignored*/&gdk::RGBA); + #[cfg(feature = "v2_8")] + fn set_rgba(&self, rgba: &gdk::RGBA); - //fn get_property_rgba(&self) -> /*Ignored*/Option; + fn get_property_rgba(&self) -> Option; - //fn set_property_rgba(&self, rgba: /*Ignored*/Option<&gdk::RGBA>); + fn set_property_rgba(&self, rgba: Option<&gdk::RGBA>); #[cfg(feature = "v2_8")] fn connect_finished(&self, f: F) -> SignalHandlerId; @@ -64,34 +66,44 @@ impl + IsA> ColorChooserReques } } - //#[cfg(feature = "v2_8")] - //fn get_element_rectangle(&self, rect: /*Ignored*/gdk::Rectangle) { - // unsafe { TODO: call ffi::webkit_color_chooser_request_get_element_rectangle() } - //} - - //#[cfg(feature = "v2_8")] - //fn get_rgba(&self, rgba: /*Ignored*/gdk::RGBA) { - // unsafe { TODO: call ffi::webkit_color_chooser_request_get_rgba() } - //} - - //#[cfg(feature = "v2_8")] - //fn set_rgba(&self, rgba: /*Ignored*/&gdk::RGBA) { - // unsafe { TODO: call ffi::webkit_color_chooser_request_set_rgba() } - //} - - //fn get_property_rgba(&self) -> /*Ignored*/Option { - // let mut value = Value::from(None::<&/*Ignored*/gdk::RGBA>); - // unsafe { - // gobject_ffi::g_object_get_property(self.to_glib_none().0, "rgba".to_glib_none().0, value.to_glib_none_mut().0); - // } - // value.get() - //} - - //fn set_property_rgba(&self, rgba: /*Ignored*/Option<&gdk::RGBA>) { - // unsafe { - // gobject_ffi::g_object_set_property(self.to_glib_none().0, "rgba".to_glib_none().0, Value::from(rgba).to_glib_none().0); - // } - //} + #[cfg(feature = "v2_8")] + fn get_element_rectangle(&self) -> gdk::Rectangle { + unsafe { + let mut rect = gdk::Rectangle::uninitialized(); + ffi::webkit_color_chooser_request_get_element_rectangle(self.to_glib_none().0, rect.to_glib_none_mut().0); + rect + } + } + + #[cfg(feature = "v2_8")] + fn get_rgba(&self) -> gdk::RGBA { + unsafe { + let mut rgba = gdk::RGBA::uninitialized(); + ffi::webkit_color_chooser_request_get_rgba(self.to_glib_none().0, rgba.to_glib_none_mut().0); + rgba + } + } + + #[cfg(feature = "v2_8")] + fn set_rgba(&self, rgba: &gdk::RGBA) { + unsafe { + ffi::webkit_color_chooser_request_set_rgba(self.to_glib_none().0, rgba.to_glib_none().0); + } + } + + fn get_property_rgba(&self) -> Option { + let mut value = Value::from(None::<&gdk::RGBA>); + unsafe { + gobject_ffi::g_object_get_property(self.to_glib_none().0, "rgba".to_glib_none().0, value.to_glib_none_mut().0); + } + value.get() + } + + fn set_property_rgba(&self, rgba: Option<&gdk::RGBA>) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "rgba".to_glib_none().0, Value::from(rgba).to_glib_none().0); + } + } #[cfg(feature = "v2_8")] fn connect_finished(&self, f: F) -> SignalHandlerId { diff --git a/src/auto/context_menu.rs b/src/auto/context_menu.rs index c1d75068..cdb0f986 100644 --- a/src/auto/context_menu.rs +++ b/src/auto/context_menu.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ContextMenuItem; diff --git a/src/auto/context_menu_item.rs b/src/auto/context_menu_item.rs index 9250ff36..25e6d69d 100644 --- a/src/auto/context_menu_item.rs +++ b/src/auto/context_menu_item.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ContextMenu; diff --git a/src/auto/cookie_manager.rs b/src/auto/cookie_manager.rs index f7764fed..314ba157 100644 --- a/src/auto/cookie_manager.rs +++ b/src/auto/cookie_manager.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use CookieAcceptPolicy; @@ -30,11 +30,11 @@ pub trait CookieManagerExt { fn delete_cookies_for_domain(&self, domain: &str); - //fn get_accept_policy<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R); + //fn get_accept_policy<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R); //fn get_accept_policy_finish>(&self, result: &P) -> Result; - //fn get_domains_with_cookies<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R); + //fn get_domains_with_cookies<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R); //fn get_domains_with_cookies_finish>(&self, result: &P) -> Result, Error>; @@ -58,7 +58,7 @@ impl + IsA> CookieManagerExt for O { } } - //fn get_accept_policy<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R) { + //fn get_accept_policy<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_cookie_manager_get_accept_policy() } //} @@ -66,7 +66,7 @@ impl + IsA> CookieManagerExt for O { // unsafe { TODO: call ffi::webkit_cookie_manager_get_accept_policy_finish() } //} - //fn get_domains_with_cookies<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R) { + //fn get_domains_with_cookies<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_cookie_manager_get_domains_with_cookies() } //} diff --git a/src/auto/credential.rs b/src/auto/credential.rs new file mode 100644 index 00000000..44e9960e --- /dev/null +++ b/src/auto/credential.rs @@ -0,0 +1,59 @@ +// This file was generated by gir (7484d29) from gir-files (71d73f0) +// DO NOT EDIT + +#[cfg(feature = "v2_2")] +use CredentialPersistence; +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct Credential(Boxed); + + match fn { + copy => |ptr| ffi::webkit_credential_copy(mut_override(ptr)), + free => |ptr| ffi::webkit_credential_free(ptr), + get_type => || ffi::webkit_credential_get_type(), + } +} + +impl Credential { + #[cfg(feature = "v2_2")] + pub fn new(username: &str, password: &str, persistence: CredentialPersistence) -> Credential { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::webkit_credential_new(username.to_glib_none().0, password.to_glib_none().0, persistence.to_glib())) + } + } + + #[cfg(feature = "v2_2")] + pub fn get_password(&mut self) -> Option { + unsafe { + from_glib_none(ffi::webkit_credential_get_password(self.to_glib_none_mut().0)) + } + } + + #[cfg(feature = "v2_2")] + pub fn get_persistence(&mut self) -> CredentialPersistence { + unsafe { + from_glib(ffi::webkit_credential_get_persistence(self.to_glib_none_mut().0)) + } + } + + #[cfg(feature = "v2_2")] + pub fn get_username(&mut self) -> Option { + unsafe { + from_glib_none(ffi::webkit_credential_get_username(self.to_glib_none_mut().0)) + } + } + + #[cfg(feature = "v2_2")] + pub fn has_password(&mut self) -> bool { + unsafe { + from_glib(ffi::webkit_credential_has_password(self.to_glib_none_mut().0)) + } + } +} diff --git a/src/auto/download.rs b/src/auto/download.rs index 50d27040..7b085c1a 100644 --- a/src/auto/download.rs +++ b/src/auto/download.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use Error; diff --git a/src/auto/editor_state.rs b/src/auto/editor_state.rs index 303ebe2e..2acb69d7 100644 --- a/src/auto/editor_state.rs +++ b/src/auto/editor_state.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/enums.rs b/src/auto/enums.rs index 02dd94b0..e00362e3 100644 --- a/src/auto/enums.rs +++ b/src/auto/enums.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; @@ -688,6 +688,73 @@ impl SetValue for FaviconDatabaseError { } } +#[cfg(feature = "v2_16")] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum HardwareAccelerationPolicy { + OnDemand, + Always, + Never, + #[doc(hidden)] + __Unknown(i32), +} + +#[cfg(feature = "v2_16")] +#[doc(hidden)] +impl ToGlib for HardwareAccelerationPolicy { + type GlibType = ffi::WebKitHardwareAccelerationPolicy; + + fn to_glib(&self) -> ffi::WebKitHardwareAccelerationPolicy { + match *self { + HardwareAccelerationPolicy::OnDemand => ffi::WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND, + HardwareAccelerationPolicy::Always => ffi::WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS, + HardwareAccelerationPolicy::Never => ffi::WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER, + HardwareAccelerationPolicy::__Unknown(value) => unsafe{std::mem::transmute(value)} + } + } +} + +#[cfg(feature = "v2_16")] +#[doc(hidden)] +impl FromGlib for HardwareAccelerationPolicy { + fn from_glib(value: ffi::WebKitHardwareAccelerationPolicy) -> Self { + skip_assert_initialized!(); + match value as i32 { + 0 => HardwareAccelerationPolicy::OnDemand, + 1 => HardwareAccelerationPolicy::Always, + 2 => HardwareAccelerationPolicy::Never, + value => HardwareAccelerationPolicy::__Unknown(value), + } + } +} + +#[cfg(feature = "v2_16")] +impl StaticType for HardwareAccelerationPolicy { + fn static_type() -> Type { + unsafe { from_glib(ffi::webkit_hardware_acceleration_policy_get_type()) } + } +} + +#[cfg(feature = "v2_16")] +impl<'a> FromValueOptional<'a> for HardwareAccelerationPolicy { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +#[cfg(feature = "v2_16")] +impl<'a> FromValue<'a> for HardwareAccelerationPolicy { + unsafe fn from_value(value: &Value) -> Self { + from_glib(std::mem::transmute::(gobject_ffi::g_value_get_enum(value.to_glib_none().0))) + } +} + +#[cfg(feature = "v2_16")] +impl SetValue for HardwareAccelerationPolicy { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32) + } +} + #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub enum InsecureContentEvent { Run, @@ -1039,6 +1106,73 @@ impl SetValue for NetworkError { } } +#[cfg(feature = "v2_16")] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum NetworkProxyMode { + Default, + NoProxy, + Custom, + #[doc(hidden)] + __Unknown(i32), +} + +#[cfg(feature = "v2_16")] +#[doc(hidden)] +impl ToGlib for NetworkProxyMode { + type GlibType = ffi::WebKitNetworkProxyMode; + + fn to_glib(&self) -> ffi::WebKitNetworkProxyMode { + match *self { + NetworkProxyMode::Default => ffi::WEBKIT_NETWORK_PROXY_MODE_DEFAULT, + NetworkProxyMode::NoProxy => ffi::WEBKIT_NETWORK_PROXY_MODE_NO_PROXY, + NetworkProxyMode::Custom => ffi::WEBKIT_NETWORK_PROXY_MODE_CUSTOM, + NetworkProxyMode::__Unknown(value) => unsafe{std::mem::transmute(value)} + } + } +} + +#[cfg(feature = "v2_16")] +#[doc(hidden)] +impl FromGlib for NetworkProxyMode { + fn from_glib(value: ffi::WebKitNetworkProxyMode) -> Self { + skip_assert_initialized!(); + match value as i32 { + 0 => NetworkProxyMode::Default, + 1 => NetworkProxyMode::NoProxy, + 2 => NetworkProxyMode::Custom, + value => NetworkProxyMode::__Unknown(value), + } + } +} + +#[cfg(feature = "v2_16")] +impl StaticType for NetworkProxyMode { + fn static_type() -> Type { + unsafe { from_glib(ffi::webkit_network_proxy_mode_get_type()) } + } +} + +#[cfg(feature = "v2_16")] +impl<'a> FromValueOptional<'a> for NetworkProxyMode { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +#[cfg(feature = "v2_16")] +impl<'a> FromValue<'a> for NetworkProxyMode { + unsafe fn from_value(value: &Value) -> Self { + from_glib(std::mem::transmute::(gobject_ffi::g_value_get_enum(value.to_glib_none().0))) + } +} + +#[cfg(feature = "v2_16")] +impl SetValue for NetworkProxyMode { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32) + } +} + #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub enum PluginError { Failed, diff --git a/src/auto/favicon_database.rs b/src/auto/favicon_database.rs index d172bf82..b866c9ad 100644 --- a/src/auto/favicon_database.rs +++ b/src/auto/favicon_database.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; @@ -27,9 +27,9 @@ glib_wrapper! { pub trait FaviconDatabaseExt { fn clear(&self); - //fn get_favicon<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, page_uri: &str, cancellable: P, callback: Q, user_data: R); + //fn get_favicon<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, page_uri: &str, cancellable: P, callback: Q, user_data: R); - //fn get_favicon_finish>(&self, result: &P) -> Result; + //fn get_favicon_finish>(&self, result: &P) -> Result; fn get_favicon_uri(&self, page_uri: &str) -> Option; @@ -43,11 +43,11 @@ impl + IsA> FaviconDatabaseExt for } } - //fn get_favicon<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, page_uri: &str, cancellable: P, callback: Q, user_data: R) { + //fn get_favicon<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, page_uri: &str, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_favicon_database_get_favicon() } //} - //fn get_favicon_finish>(&self, result: &P) -> Result { + //fn get_favicon_finish>(&self, result: &P) -> Result { // unsafe { TODO: call ffi::webkit_favicon_database_get_favicon_finish() } //} diff --git a/src/auto/file_chooser_request.rs b/src/auto/file_chooser_request.rs index d08bae29..fbe96aac 100644 --- a/src/auto/file_chooser_request.rs +++ b/src/auto/file_chooser_request.rs @@ -1,8 +1,9 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; use glib; +use glib::Value; use glib::object::Downcast; use glib::object::IsA; use glib::signal::SignalHandlerId; @@ -10,6 +11,7 @@ use glib::signal::connect; use glib::translate::*; use glib_ffi; use gobject_ffi; +use gtk; use std::boxed::Box as Box_; use std::mem; use std::mem::transmute; @@ -28,7 +30,7 @@ pub trait FileChooserRequestExt { fn get_mime_types(&self) -> Vec; - //fn get_mime_types_filter(&self) -> /*Ignored*/Option; + fn get_mime_types_filter(&self) -> Option; fn get_select_multiple(&self) -> bool; @@ -36,7 +38,7 @@ pub trait FileChooserRequestExt { fn select_files(&self, files: &[&str]); - //fn get_property_filter(&self) -> /*Ignored*/Option; + fn get_property_filter(&self) -> Option; fn connect_property_filter_notify(&self, f: F) -> SignalHandlerId; @@ -60,9 +62,11 @@ impl + IsA> FileChooserRequestE } } - //fn get_mime_types_filter(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::webkit_file_chooser_request_get_mime_types_filter() } - //} + fn get_mime_types_filter(&self) -> Option { + unsafe { + from_glib_none(ffi::webkit_file_chooser_request_get_mime_types_filter(self.to_glib_none().0)) + } + } fn get_select_multiple(&self) -> bool { unsafe { @@ -82,13 +86,13 @@ impl + IsA> FileChooserRequestE } } - //fn get_property_filter(&self) -> /*Ignored*/Option { - // let mut value = Value::from(None::<&/*Ignored*/gtk::FileFilter>); - // unsafe { - // gobject_ffi::g_object_get_property(self.to_glib_none().0, "filter".to_glib_none().0, value.to_glib_none_mut().0); - // } - // value.get() - //} + fn get_property_filter(&self) -> Option { + let mut value = Value::from(None::<>k::FileFilter>); + unsafe { + gobject_ffi::g_object_get_property(self.to_glib_none().0, "filter".to_glib_none().0, value.to_glib_none_mut().0); + } + value.get() + } fn connect_property_filter_notify(&self, f: F) -> SignalHandlerId { unsafe { diff --git a/src/auto/find_controller.rs b/src/auto/find_controller.rs index c250162c..917579cb 100644 --- a/src/auto/find_controller.rs +++ b/src/auto/find_controller.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use WebView; diff --git a/src/auto/flags.rs b/src/auto/flags.rs index bf7d5c6d..d8a74c63 100644 --- a/src/auto/flags.rs +++ b/src/auto/flags.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; @@ -220,3 +220,66 @@ impl SetValue for SnapshotOptions { } } +#[cfg(feature = "v2_16")] +bitflags! { + pub struct WebsiteDataTypes: u32 { + const WEBSITE_DATA_MEMORY_CACHE = 1; + const WEBSITE_DATA_DISK_CACHE = 2; + const WEBSITE_DATA_OFFLINE_APPLICATION_CACHE = 4; + const WEBSITE_DATA_SESSION_STORAGE = 8; + const WEBSITE_DATA_LOCAL_STORAGE = 16; + const WEBSITE_DATA_WEBSQL_DATABASES = 32; + const WEBSITE_DATA_INDEXEDDB_DATABASES = 64; + const WEBSITE_DATA_PLUGIN_DATA = 128; + const WEBSITE_DATA_COOKIES = 256; + const WEBSITE_DATA_ALL = 511; + } +} + +#[cfg(feature = "v2_16")] +#[doc(hidden)] +impl ToGlib for WebsiteDataTypes { + type GlibType = ffi::WebKitWebsiteDataTypes; + + fn to_glib(&self) -> ffi::WebKitWebsiteDataTypes { + ffi::WebKitWebsiteDataTypes::from_bits_truncate(self.bits()) + } +} + +#[cfg(feature = "v2_16")] +#[doc(hidden)] +impl FromGlib for WebsiteDataTypes { + fn from_glib(value: ffi::WebKitWebsiteDataTypes) -> WebsiteDataTypes { + skip_assert_initialized!(); + WebsiteDataTypes::from_bits_truncate(value.bits()) + } +} + +#[cfg(feature = "v2_16")] +impl StaticType for WebsiteDataTypes { + fn static_type() -> Type { + unsafe { from_glib(ffi::webkit_website_data_types_get_type()) } + } +} + +#[cfg(feature = "v2_16")] +impl<'a> FromValueOptional<'a> for WebsiteDataTypes { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +#[cfg(feature = "v2_16")] +impl<'a> FromValue<'a> for WebsiteDataTypes { + unsafe fn from_value(value: &Value) -> Self { + from_glib(ffi::WebKitWebsiteDataTypes::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0))) + } +} + +#[cfg(feature = "v2_16")] +impl SetValue for WebsiteDataTypes { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits()) + } +} + diff --git a/src/auto/form_submission_request.rs b/src/auto/form_submission_request.rs index 03e7033d..e7865af5 100644 --- a/src/auto/form_submission_request.rs +++ b/src/auto/form_submission_request.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/geolocation_permission_request.rs b/src/auto/geolocation_permission_request.rs index f53fc699..705be58f 100644 --- a/src/auto/geolocation_permission_request.rs +++ b/src/auto/geolocation_permission_request.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use PermissionRequest; diff --git a/src/auto/hit_test_result.rs b/src/auto/hit_test_result.rs index 7070166a..d88d447c 100644 --- a/src/auto/hit_test_result.rs +++ b/src/auto/hit_test_result.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/install_missing_media_plugins_permission_request.rs b/src/auto/install_missing_media_plugins_permission_request.rs index 1ca81399..cd0c0efb 100644 --- a/src/auto/install_missing_media_plugins_permission_request.rs +++ b/src/auto/install_missing_media_plugins_permission_request.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use PermissionRequest; diff --git a/src/auto/javascript_result.rs b/src/auto/javascript_result.rs index ef7d0d4d..377d96d4 100644 --- a/src/auto/javascript_result.rs +++ b/src/auto/javascript_result.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/mime_info.rs b/src/auto/mime_info.rs new file mode 100644 index 00000000..05939d97 --- /dev/null +++ b/src/auto/mime_info.rs @@ -0,0 +1,39 @@ +// This file was generated by gir (7484d29) from gir-files (71d73f0) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct MimeInfo(Shared); + + match fn { + ref => |ptr| ffi::webkit_mime_info_ref(ptr), + unref => |ptr| ffi::webkit_mime_info_unref(ptr), + get_type => || ffi::webkit_mime_info_get_type(), + } +} + +impl MimeInfo { + pub fn get_description(&self) -> Option { + unsafe { + from_glib_none(ffi::webkit_mime_info_get_description(self.to_glib_none().0)) + } + } + + pub fn get_extensions(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_none(ffi::webkit_mime_info_get_extensions(self.to_glib_none().0)) + } + } + + pub fn get_mime_type(&self) -> Option { + unsafe { + from_glib_none(ffi::webkit_mime_info_get_mime_type(self.to_glib_none().0)) + } + } +} diff --git a/src/auto/mod.rs b/src/auto/mod.rs index 5c21df70..38a215d6 100644 --- a/src/auto/mod.rs +++ b/src/auto/mod.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT #[cfg(feature = "v2_2")] @@ -102,6 +102,13 @@ mod policy_decision; pub use self::policy_decision::PolicyDecision; pub use self::policy_decision::PolicyDecisionExt; +#[cfg(feature = "v2_16")] +mod print_custom_widget; +#[cfg(feature = "v2_16")] +pub use self::print_custom_widget::PrintCustomWidget; +#[cfg(feature = "v2_16")] +pub use self::print_custom_widget::PrintCustomWidgetExt; + mod print_operation; pub use self::print_operation::PrintOperation; pub use self::print_operation::PrintOperationExt; @@ -157,6 +164,9 @@ mod web_view; pub use self::web_view::WebView; pub use self::web_view::WebViewExt; +mod web_view_base; +pub use self::web_view_base::WebViewBase; + #[cfg(feature = "v2_10")] mod website_data_manager; #[cfg(feature = "v2_10")] @@ -168,14 +178,32 @@ mod window_properties; pub use self::window_properties::WindowProperties; pub use self::window_properties::WindowPropertiesExt; +#[cfg(feature = "v2_2")] +mod credential; +#[cfg(feature = "v2_2")] +pub use self::credential::Credential; + mod javascript_result; pub use self::javascript_result::JavascriptResult; +mod mime_info; +pub use self::mime_info::MimeInfo; + #[cfg(feature = "v2_6")] mod navigation_action; #[cfg(feature = "v2_6")] pub use self::navigation_action::NavigationAction; +#[cfg(feature = "v2_16")] +mod network_proxy_settings; +#[cfg(feature = "v2_16")] +pub use self::network_proxy_settings::NetworkProxySettings; + +#[cfg(feature = "v2_16")] +mod security_origin; +#[cfg(feature = "v2_16")] +pub use self::security_origin::SecurityOrigin; + #[cfg(feature = "v2_6")] mod user_script; #[cfg(feature = "v2_6")] @@ -186,6 +214,11 @@ mod user_style_sheet; #[cfg(feature = "v2_6")] pub use self::user_style_sheet::UserStyleSheet; +#[cfg(feature = "v2_12")] +mod web_view_session_state; +#[cfg(feature = "v2_12")] +pub use self::web_view_session_state::WebViewSessionState; + mod enums; #[cfg(feature = "v2_2")] pub use self::enums::AuthenticationScheme; @@ -197,11 +230,15 @@ pub use self::enums::CookiePersistentStorage; pub use self::enums::CredentialPersistence; pub use self::enums::DownloadError; pub use self::enums::FaviconDatabaseError; +#[cfg(feature = "v2_16")] +pub use self::enums::HardwareAccelerationPolicy; pub use self::enums::InsecureContentEvent; pub use self::enums::JavascriptError; pub use self::enums::LoadEvent; pub use self::enums::NavigationType; pub use self::enums::NetworkError; +#[cfg(feature = "v2_16")] +pub use self::enums::NetworkProxyMode; pub use self::enums::PluginError; pub use self::enums::PolicyDecisionType; pub use self::enums::PolicyError; @@ -253,6 +290,28 @@ pub use self::flags::SnapshotOptions; pub use self::flags::SNAPSHOT_OPTIONS_NONE; pub use self::flags::SNAPSHOT_OPTIONS_INCLUDE_SELECTION_HIGHLIGHTING; pub use self::flags::SNAPSHOT_OPTIONS_TRANSPARENT_BACKGROUND; +#[cfg(feature = "v2_16")] +pub use self::flags::WebsiteDataTypes; +#[cfg(feature = "v2_16")] +pub use self::flags::WEBSITE_DATA_MEMORY_CACHE; +#[cfg(feature = "v2_16")] +pub use self::flags::WEBSITE_DATA_DISK_CACHE; +#[cfg(feature = "v2_16")] +pub use self::flags::WEBSITE_DATA_OFFLINE_APPLICATION_CACHE; +#[cfg(feature = "v2_16")] +pub use self::flags::WEBSITE_DATA_SESSION_STORAGE; +#[cfg(feature = "v2_16")] +pub use self::flags::WEBSITE_DATA_LOCAL_STORAGE; +#[cfg(feature = "v2_16")] +pub use self::flags::WEBSITE_DATA_WEBSQL_DATABASES; +#[cfg(feature = "v2_16")] +pub use self::flags::WEBSITE_DATA_INDEXEDDB_DATABASES; +#[cfg(feature = "v2_16")] +pub use self::flags::WEBSITE_DATA_PLUGIN_DATA; +#[cfg(feature = "v2_16")] +pub use self::flags::WEBSITE_DATA_COOKIES; +#[cfg(feature = "v2_16")] +pub use self::flags::WEBSITE_DATA_ALL; #[doc(hidden)] pub mod traits { @@ -281,6 +340,8 @@ pub mod traits { pub use super::PermissionRequestExt; pub use super::PluginExt; pub use super::PolicyDecisionExt; + #[cfg(feature = "v2_16")] + pub use super::PrintCustomWidgetExt; pub use super::PrintOperationExt; pub use super::ResponsePolicyDecisionExt; pub use super::SecurityManagerExt; diff --git a/src/auto/navigation_action.rs b/src/auto/navigation_action.rs index 4fc9082c..ff1106b9 100644 --- a/src/auto/navigation_action.rs +++ b/src/auto/navigation_action.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT #[cfg(feature = "v2_6")] diff --git a/src/auto/navigation_policy_decision.rs b/src/auto/navigation_policy_decision.rs index 59fb54ce..3a8d028f 100644 --- a/src/auto/navigation_policy_decision.rs +++ b/src/auto/navigation_policy_decision.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT #[cfg(feature = "v2_6")] diff --git a/src/auto/network_proxy_settings.rs b/src/auto/network_proxy_settings.rs new file mode 100644 index 00000000..772365e7 --- /dev/null +++ b/src/auto/network_proxy_settings.rs @@ -0,0 +1,28 @@ +// This file was generated by gir (7484d29) from gir-files (71d73f0) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct NetworkProxySettings(Boxed); + + match fn { + copy => |ptr| ffi::webkit_network_proxy_settings_copy(mut_override(ptr)), + free => |ptr| ffi::webkit_network_proxy_settings_free(ptr), + get_type => || ffi::webkit_network_proxy_settings_get_type(), + } +} + +impl NetworkProxySettings { + #[cfg(feature = "v2_16")] + pub fn add_proxy_for_scheme(&mut self, scheme: &str, proxy_uri: &str) { + unsafe { + ffi::webkit_network_proxy_settings_add_proxy_for_scheme(self.to_glib_none_mut().0, scheme.to_glib_none().0, proxy_uri.to_glib_none().0); + } + } +} diff --git a/src/auto/notification.rs b/src/auto/notification.rs index 6fd82d7b..106c6a9e 100644 --- a/src/auto/notification.rs +++ b/src/auto/notification.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/notification_permission_request.rs b/src/auto/notification_permission_request.rs index d793f9d3..e00b7892 100644 --- a/src/auto/notification_permission_request.rs +++ b/src/auto/notification_permission_request.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use PermissionRequest; diff --git a/src/auto/permission_request.rs b/src/auto/permission_request.rs index 777a2a9c..3bbe27d2 100644 --- a/src/auto/permission_request.rs +++ b/src/auto/permission_request.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/plugin.rs b/src/auto/plugin.rs index de765522..bb30f46a 100644 --- a/src/auto/plugin.rs +++ b/src/auto/plugin.rs @@ -1,6 +1,7 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT +use MimeInfo; use ffi; use glib::object::IsA; use glib::translate::*; @@ -20,7 +21,7 @@ glib_wrapper! { pub trait PluginExt { fn get_description(&self) -> Option; - //fn get_mime_info_list(&self) -> /*Ignored*/Vec; + fn get_mime_info_list(&self) -> Vec; fn get_name(&self) -> Option; @@ -34,9 +35,11 @@ impl> PluginExt for O { } } - //fn get_mime_info_list(&self) -> /*Ignored*/Vec { - // unsafe { TODO: call ffi::webkit_plugin_get_mime_info_list() } - //} + fn get_mime_info_list(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_none(ffi::webkit_plugin_get_mime_info_list(self.to_glib_none().0)) + } + } fn get_name(&self) -> Option { unsafe { diff --git a/src/auto/policy_decision.rs b/src/auto/policy_decision.rs index fd1f6830..01959a4f 100644 --- a/src/auto/policy_decision.rs +++ b/src/auto/policy_decision.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/print_custom_widget.rs b/src/auto/print_custom_widget.rs new file mode 100644 index 00000000..6191b2c2 --- /dev/null +++ b/src/auto/print_custom_widget.rs @@ -0,0 +1,147 @@ +// This file was generated by gir (7484d29) from gir-files (71d73f0) +// DO NOT EDIT + +use ffi; +use glib; +#[cfg(feature = "v2_16")] +use glib::object::Downcast; +use glib::object::IsA; +#[cfg(feature = "v2_16")] +use glib::signal::SignalHandlerId; +#[cfg(feature = "v2_16")] +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +#[cfg(feature = "v2_16")] +use gtk; +#[cfg(feature = "v2_16")] +use gtk_ffi; +#[cfg(feature = "v2_16")] +use std::boxed::Box as Box_; +use std::mem; +#[cfg(feature = "v2_16")] +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct PrintCustomWidget(Object); + + match fn { + get_type => || ffi::webkit_print_custom_widget_get_type(), + } +} + +impl PrintCustomWidget { + #[cfg(feature = "v2_16")] + pub fn new>(widget: &P, title: &str) -> PrintCustomWidget { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::webkit_print_custom_widget_new(widget.to_glib_none().0, title.to_glib_none().0)) + } + } +} + +pub trait PrintCustomWidgetExt { + #[cfg(feature = "v2_16")] + fn get_title(&self) -> Option; + + #[cfg(feature = "v2_16")] + fn get_widget(&self) -> Option; + + #[cfg(feature = "v2_16")] + fn connect_apply(&self, f: F) -> SignalHandlerId; + + #[cfg(feature = "v2_16")] + fn connect_update(&self, f: F) -> SignalHandlerId; + + #[cfg(feature = "v2_16")] + fn connect_property_title_notify(&self, f: F) -> SignalHandlerId; + + #[cfg(feature = "v2_16")] + fn connect_property_widget_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> PrintCustomWidgetExt for O { + #[cfg(feature = "v2_16")] + fn get_title(&self) -> Option { + unsafe { + from_glib_none(ffi::webkit_print_custom_widget_get_title(self.to_glib_none().0)) + } + } + + #[cfg(feature = "v2_16")] + fn get_widget(&self) -> Option { + unsafe { + from_glib_none(ffi::webkit_print_custom_widget_get_widget(self.to_glib_none().0)) + } + } + + #[cfg(feature = "v2_16")] + fn connect_apply(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "apply", + transmute(apply_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + #[cfg(feature = "v2_16")] + fn connect_update(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "update", + transmute(update_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + #[cfg(feature = "v2_16")] + fn connect_property_title_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::title", + transmute(notify_title_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + #[cfg(feature = "v2_16")] + fn connect_property_widget_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::widget", + transmute(notify_widget_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +#[cfg(feature = "v2_16")] +unsafe extern "C" fn apply_trampoline

(this: *mut ffi::WebKitPrintCustomWidget, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&PrintCustomWidget::from_glib_borrow(this).downcast_unchecked()) +} + +#[cfg(feature = "v2_16")] +unsafe extern "C" fn update_trampoline

(this: *mut ffi::WebKitPrintCustomWidget, page_setup: *mut gtk_ffi::GtkPageSetup, print_settings: *mut gtk_ffi::GtkPrintSettings, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, >k::PageSetup, >k::PrintSettings) + 'static) = transmute(f); + f(&PrintCustomWidget::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(page_setup), &from_glib_borrow(print_settings)) +} + +#[cfg(feature = "v2_16")] +unsafe extern "C" fn notify_title_trampoline

(this: *mut ffi::WebKitPrintCustomWidget, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&PrintCustomWidget::from_glib_borrow(this).downcast_unchecked()) +} + +#[cfg(feature = "v2_16")] +unsafe extern "C" fn notify_widget_trampoline

(this: *mut ffi::WebKitPrintCustomWidget, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&PrintCustomWidget::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/src/auto/print_operation.rs b/src/auto/print_operation.rs index 0ad74811..7da21c2f 100644 --- a/src/auto/print_operation.rs +++ b/src/auto/print_operation.rs @@ -1,7 +1,9 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use Error; +#[cfg(feature = "v2_16")] +use PrintCustomWidget; use PrintOperationResponse; use WebView; use ffi; @@ -52,8 +54,8 @@ pub trait PrintOperationExt { fn get_property_web_view(&self) -> Option; - //#[cfg(feature = "v2_16")] - //fn connect_create_custom_widget(&self, f: F) -> SignalHandlerId; + #[cfg(feature = "v2_16")] + fn connect_create_custom_widget PrintCustomWidget + 'static>(&self, f: F) -> SignalHandlerId; fn connect_failed(&self, f: F) -> SignalHandlerId; @@ -113,10 +115,14 @@ impl + IsA> PrintOperationExt for O value.get() } - //#[cfg(feature = "v2_16")] - //fn connect_create_custom_widget(&self, f: F) -> SignalHandlerId { - // Ignored return value WebKit2.PrintCustomWidget - //} + #[cfg(feature = "v2_16")] + fn connect_create_custom_widget PrintCustomWidget + 'static>(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_ PrintCustomWidget + 'static>> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "create-custom-widget", + transmute(create_custom_widget_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } fn connect_failed(&self, f: F) -> SignalHandlerId { unsafe { @@ -159,6 +165,14 @@ impl + IsA> PrintOperationExt for O } } +#[cfg(feature = "v2_16")] +unsafe extern "C" fn create_custom_widget_trampoline

(this: *mut ffi::WebKitPrintOperation, f: glib_ffi::gpointer) -> *mut ffi::WebKitPrintCustomWidget +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) -> PrintCustomWidget + 'static) = transmute(f); + f(&PrintOperation::from_glib_borrow(this).downcast_unchecked()).to_glib_full() +} + unsafe extern "C" fn failed_trampoline

(this: *mut ffi::WebKitPrintOperation, error: *mut glib_ffi::GError, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); diff --git a/src/auto/response_policy_decision.rs b/src/auto/response_policy_decision.rs index b35734d2..bada267b 100644 --- a/src/auto/response_policy_decision.rs +++ b/src/auto/response_policy_decision.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use PolicyDecision; diff --git a/src/auto/security_manager.rs b/src/auto/security_manager.rs index 35c49583..6317de07 100644 --- a/src/auto/security_manager.rs +++ b/src/auto/security_manager.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/security_origin.rs b/src/auto/security_origin.rs new file mode 100644 index 00000000..c5b075ec --- /dev/null +++ b/src/auto/security_origin.rs @@ -0,0 +1,80 @@ +// This file was generated by gir (7484d29) from gir-files (71d73f0) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::fmt; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct SecurityOrigin(Shared); + + match fn { + ref => |ptr| ffi::webkit_security_origin_ref(ptr), + unref => |ptr| ffi::webkit_security_origin_unref(ptr), + get_type => || ffi::webkit_security_origin_get_type(), + } +} + +impl SecurityOrigin { + #[cfg(feature = "v2_16")] + pub fn new(protocol: &str, host: &str, port: u16) -> SecurityOrigin { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::webkit_security_origin_new(protocol.to_glib_none().0, host.to_glib_none().0, port)) + } + } + + #[cfg(feature = "v2_16")] + pub fn new_for_uri(uri: &str) -> SecurityOrigin { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::webkit_security_origin_new_for_uri(uri.to_glib_none().0)) + } + } + + #[cfg(feature = "v2_16")] + pub fn get_host(&self) -> Option { + unsafe { + from_glib_none(ffi::webkit_security_origin_get_host(self.to_glib_none().0)) + } + } + + #[cfg(feature = "v2_16")] + pub fn get_port(&self) -> u16 { + unsafe { + ffi::webkit_security_origin_get_port(self.to_glib_none().0) + } + } + + #[cfg(feature = "v2_16")] + pub fn get_protocol(&self) -> Option { + unsafe { + from_glib_none(ffi::webkit_security_origin_get_protocol(self.to_glib_none().0)) + } + } + + #[cfg(feature = "v2_16")] + pub fn is_opaque(&self) -> bool { + unsafe { + from_glib(ffi::webkit_security_origin_is_opaque(self.to_glib_none().0)) + } + } + + #[cfg(feature = "v2_16")] + fn to_string(&self) -> String { + unsafe { + from_glib_full(ffi::webkit_security_origin_to_string(self.to_glib_none().0)) + } + } +} + +impl fmt::Display for SecurityOrigin { + #[inline] + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", self.to_string()) + } +} diff --git a/src/auto/settings.rs b/src/auto/settings.rs index 5933f421..8ec9ba5a 100644 --- a/src/auto/settings.rs +++ b/src/auto/settings.rs @@ -1,6 +1,8 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT +#[cfg(feature = "v2_16")] +use HardwareAccelerationPolicy; use ffi; use glib; use glib::object::Downcast; @@ -124,8 +126,8 @@ pub trait SettingsExt { fn get_fantasy_font_family(&self) -> Option; - //#[cfg(feature = "v2_16")] - //fn get_hardware_acceleration_policy(&self) -> /*Ignored*/HardwareAccelerationPolicy; + #[cfg(feature = "v2_16")] + fn get_hardware_acceleration_policy(&self) -> HardwareAccelerationPolicy; fn get_javascript_can_access_clipboard(&self) -> bool; @@ -234,8 +236,8 @@ pub trait SettingsExt { fn set_fantasy_font_family(&self, fantasy_font_family: &str); - //#[cfg(feature = "v2_16")] - //fn set_hardware_acceleration_policy(&self, policy: /*Ignored*/HardwareAccelerationPolicy); + #[cfg(feature = "v2_16")] + fn set_hardware_acceleration_policy(&self, policy: HardwareAccelerationPolicy); fn set_javascript_can_access_clipboard(&self, enabled: bool); @@ -606,10 +608,12 @@ impl + IsA> SettingsExt for O { } } - //#[cfg(feature = "v2_16")] - //fn get_hardware_acceleration_policy(&self) -> /*Ignored*/HardwareAccelerationPolicy { - // unsafe { TODO: call ffi::webkit_settings_get_hardware_acceleration_policy() } - //} + #[cfg(feature = "v2_16")] + fn get_hardware_acceleration_policy(&self) -> HardwareAccelerationPolicy { + unsafe { + from_glib(ffi::webkit_settings_get_hardware_acceleration_policy(self.to_glib_none().0)) + } + } fn get_javascript_can_access_clipboard(&self) -> bool { unsafe { @@ -918,10 +922,12 @@ impl + IsA> SettingsExt for O { } } - //#[cfg(feature = "v2_16")] - //fn set_hardware_acceleration_policy(&self, policy: /*Ignored*/HardwareAccelerationPolicy) { - // unsafe { TODO: call ffi::webkit_settings_set_hardware_acceleration_policy() } - //} + #[cfg(feature = "v2_16")] + fn set_hardware_acceleration_policy(&self, policy: HardwareAccelerationPolicy) { + unsafe { + ffi::webkit_settings_set_hardware_acceleration_policy(self.to_glib_none().0, policy.to_glib()); + } + } fn set_javascript_can_access_clipboard(&self, enabled: bool) { unsafe { diff --git a/src/auto/uri_request.rs b/src/auto/uri_request.rs index 67a55746..ab5d0527 100644 --- a/src/auto/uri_request.rs +++ b/src/auto/uri_request.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/uri_response.rs b/src/auto/uri_response.rs index 4b5ed1c2..777dbbcf 100644 --- a/src/auto/uri_response.rs +++ b/src/auto/uri_response.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/uri_scheme_request.rs b/src/auto/uri_scheme_request.rs index bc23099b..af9af07f 100644 --- a/src/auto/uri_scheme_request.rs +++ b/src/auto/uri_scheme_request.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT #[cfg(feature = "v2_2")] diff --git a/src/auto/user_content_manager.rs b/src/auto/user_content_manager.rs index a9bdc619..bada8b83 100644 --- a/src/auto/user_content_manager.rs +++ b/src/auto/user_content_manager.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT #[cfg(feature = "v2_8")] diff --git a/src/auto/user_media_permission_request.rs b/src/auto/user_media_permission_request.rs index 4b0a8156..4f02a6dd 100644 --- a/src/auto/user_media_permission_request.rs +++ b/src/auto/user_media_permission_request.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use PermissionRequest; diff --git a/src/auto/user_script.rs b/src/auto/user_script.rs index 08a0adb7..71842a58 100644 --- a/src/auto/user_script.rs +++ b/src/auto/user_script.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT #[cfg(feature = "v2_6")] diff --git a/src/auto/user_style_sheet.rs b/src/auto/user_style_sheet.rs index 3672ee9e..4ef42cbd 100644 --- a/src/auto/user_style_sheet.rs +++ b/src/auto/user_style_sheet.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT #[cfg(feature = "v2_6")] diff --git a/src/auto/web_context.rs b/src/auto/web_context.rs index 2df5adc6..dc855b96 100644 --- a/src/auto/web_context.rs +++ b/src/auto/web_context.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use CacheModel; @@ -8,10 +8,14 @@ use FaviconDatabase; #[cfg(feature = "v2_4")] use ProcessModel; use SecurityManager; +#[cfg(feature = "v2_16")] +use SecurityOrigin; use TLSErrorsPolicy; #[cfg(feature = "v2_10")] use WebsiteDataManager; use ffi; +#[cfg(feature = "v2_6")] +use gio; use glib; #[cfg(feature = "v2_8")] use glib::Value; @@ -76,8 +80,8 @@ impl Default for WebContext { } pub trait WebContextExt { - //#[cfg(feature = "v2_6")] - //fn allow_tls_certificate_for_host(&self, certificate: /*Ignored*/&gio::TlsCertificate, host: &str); + #[cfg(feature = "v2_6")] + fn allow_tls_certificate_for_host(&self, certificate: &gio::TlsCertificate, host: &str); fn clear_cache(&self); @@ -91,7 +95,7 @@ pub trait WebContextExt { fn get_favicon_database_directory(&self) -> Option; - //fn get_plugins<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R); + //fn get_plugins<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R); //fn get_plugins_finish>(&self, result: &P) -> Result, Error>; @@ -112,8 +116,8 @@ pub trait WebContextExt { #[cfg(feature = "v2_10")] fn get_website_data_manager(&self) -> Option; - //#[cfg(feature = "v2_16")] - //fn initialize_notification_permissions(&self, allowed_origins: /*Ignored*/&[&SecurityOrigin], disallowed_origins: /*Ignored*/&[&SecurityOrigin]); + #[cfg(feature = "v2_16")] + fn initialize_notification_permissions(&self, allowed_origins: &[&SecurityOrigin], disallowed_origins: &[&SecurityOrigin]); #[cfg(feature = "v2_16")] fn is_ephemeral(&self) -> bool; @@ -130,9 +134,6 @@ pub trait WebContextExt { fn set_favicon_database_directory<'a, P: Into>>(&self, path: P); - //#[cfg(feature = "v2_16")] - //fn set_network_proxy_settings<'a, P: Into>>(&self, proxy_mode: /*Ignored*/NetworkProxyMode, proxy_settings: P); - fn set_preferred_languages(&self, languages: &[&str]); #[cfg(feature = "v2_4")] @@ -171,10 +172,12 @@ pub trait WebContextExt { } impl + IsA> WebContextExt for O { - //#[cfg(feature = "v2_6")] - //fn allow_tls_certificate_for_host(&self, certificate: /*Ignored*/&gio::TlsCertificate, host: &str) { - // unsafe { TODO: call ffi::webkit_web_context_allow_tls_certificate_for_host() } - //} + #[cfg(feature = "v2_6")] + fn allow_tls_certificate_for_host(&self, certificate: &gio::TlsCertificate, host: &str) { + unsafe { + ffi::webkit_web_context_allow_tls_certificate_for_host(self.to_glib_none().0, certificate.to_glib_none().0, host.to_glib_none().0); + } + } fn clear_cache(&self) { unsafe { @@ -212,7 +215,7 @@ impl + IsA> WebContextExt for O { } } - //fn get_plugins<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R) { + //fn get_plugins<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_web_context_get_plugins() } //} @@ -265,10 +268,12 @@ impl + IsA> WebContextExt for O { } } - //#[cfg(feature = "v2_16")] - //fn initialize_notification_permissions(&self, allowed_origins: /*Ignored*/&[&SecurityOrigin], disallowed_origins: /*Ignored*/&[&SecurityOrigin]) { - // unsafe { TODO: call ffi::webkit_web_context_initialize_notification_permissions() } - //} + #[cfg(feature = "v2_16")] + fn initialize_notification_permissions(&self, allowed_origins: &[&SecurityOrigin], disallowed_origins: &[&SecurityOrigin]) { + unsafe { + ffi::webkit_web_context_initialize_notification_permissions(self.to_glib_none().0, allowed_origins.to_glib_none().0, disallowed_origins.to_glib_none().0); + } + } #[cfg(feature = "v2_16")] fn is_ephemeral(&self) -> bool { @@ -313,11 +318,6 @@ impl + IsA> WebContextExt for O { } } - //#[cfg(feature = "v2_16")] - //fn set_network_proxy_settings<'a, P: Into>>(&self, proxy_mode: /*Ignored*/NetworkProxyMode, proxy_settings: P) { - // unsafe { TODO: call ffi::webkit_web_context_set_network_proxy_settings() } - //} - fn set_preferred_languages(&self, languages: &[&str]) { unsafe { ffi::webkit_web_context_set_preferred_languages(self.to_glib_none().0, languages.to_glib_none().0); diff --git a/src/auto/web_inspector.rs b/src/auto/web_inspector.rs index 4ea7196b..9acbcec4 100644 --- a/src/auto/web_inspector.rs +++ b/src/auto/web_inspector.rs @@ -1,6 +1,7 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT +use WebViewBase; use ffi; use glib; use glib::object::Downcast; @@ -37,7 +38,7 @@ pub trait WebInspectorExt { fn get_inspected_uri(&self) -> Option; - //fn get_web_view(&self) -> /*Ignored*/Option; + fn get_web_view(&self) -> Option; fn is_attached(&self) -> bool; @@ -99,9 +100,11 @@ impl + IsA> WebInspectorExt for O { } } - //fn get_web_view(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::webkit_web_inspector_get_web_view() } - //} + fn get_web_view(&self) -> Option { + unsafe { + from_glib_none(ffi::webkit_web_inspector_get_web_view(self.to_glib_none().0)) + } + } fn is_attached(&self) -> bool { unsafe { diff --git a/src/auto/web_resource.rs b/src/auto/web_resource.rs index 83da96f0..44ef7cf2 100644 --- a/src/auto/web_resource.rs +++ b/src/auto/web_resource.rs @@ -1,10 +1,14 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use Error; use URIRequest; use URIResponse; use ffi; +#[cfg(feature = "v2_8")] +use gio; +#[cfg(feature = "v2_8")] +use gio_ffi; use glib; use glib::object::Downcast; use glib::object::IsA; @@ -27,7 +31,7 @@ glib_wrapper! { } pub trait WebResourceExt { - //fn get_data<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R); + //fn get_data<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R); //fn get_data_finish>(&self, result: &P) -> Result, Error>; @@ -37,8 +41,8 @@ pub trait WebResourceExt { fn connect_failed(&self, f: F) -> SignalHandlerId; - //#[cfg(feature = "v2_8")] - //fn connect_failed_with_tls_errors(&self, f: F) -> SignalHandlerId; + #[cfg(feature = "v2_8")] + fn connect_failed_with_tls_errors(&self, f: F) -> SignalHandlerId; fn connect_finished(&self, f: F) -> SignalHandlerId; @@ -52,7 +56,7 @@ pub trait WebResourceExt { } impl + IsA> WebResourceExt for O { - //fn get_data<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R) { + //fn get_data<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_web_resource_get_data() } //} @@ -80,11 +84,14 @@ impl + IsA> WebResourceExt for O { } } - //#[cfg(feature = "v2_8")] - //fn connect_failed_with_tls_errors(&self, f: F) -> SignalHandlerId { - // Ignored certificate: Gio.TlsCertificate - // Ignored errors: Gio.TlsCertificateFlags - //} + #[cfg(feature = "v2_8")] + fn connect_failed_with_tls_errors(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "failed-with-tls-errors", + transmute(failed_with_tls_errors_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } fn connect_finished(&self, f: F) -> SignalHandlerId { unsafe { @@ -134,6 +141,14 @@ where P: IsA { f(&WebResource::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(error)) } +#[cfg(feature = "v2_8")] +unsafe extern "C" fn failed_with_tls_errors_trampoline

(this: *mut ffi::WebKitWebResource, certificate: *mut gio_ffi::GTlsCertificate, errors: gio_ffi::GTlsCertificateFlags, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &gio::TlsCertificate, gio::TlsCertificateFlags) + 'static) = transmute(f); + f(&WebResource::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(certificate), from_glib(errors)) +} + unsafe extern "C" fn finished_trampoline

(this: *mut ffi::WebKitWebResource, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); diff --git a/src/auto/web_view.rs b/src/auto/web_view.rs index 132033f9..6eb2d5f7 100644 --- a/src/auto/web_view.rs +++ b/src/auto/web_view.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT #[cfg(feature = "v2_2")] @@ -7,6 +7,7 @@ use BackForwardList; use BackForwardListItem; #[cfg(feature = "v2_8")] use ColorChooserRequest; +use ContextMenu; use Download; #[cfg(feature = "v2_10")] use EditorState; @@ -33,10 +34,19 @@ use UserContentManager; use WebContext; use WebInspector; use WebResource; +use WebViewBase; +#[cfg(feature = "v2_12")] +use WebViewSessionState; #[cfg(feature = "v2_16")] use WebsiteDataManager; use WindowProperties; +use cairo; use ffi; +use gdk; +use gdk_ffi; +use gio; +#[cfg(feature = "v2_6")] +use gio_ffi; use glib; use glib::Value; use glib::object::Downcast; @@ -57,6 +67,7 @@ use std::ptr; glib_wrapper! { pub struct WebView(Object): [ + WebViewBase, gtk::Container => gtk_ffi::GtkContainer, gtk::Widget => gtk_ffi::GtkWidget, ]; @@ -105,7 +116,7 @@ impl Default for WebView { } pub trait WebViewExt { - //fn can_execute_editing_command<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, command: &str, cancellable: P, callback: Q, user_data: R); + //fn can_execute_editing_command<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, command: &str, cancellable: P, callback: Q, user_data: R); //fn can_execute_editing_command_finish>(&self, result: &P) -> Result<(), Error>; @@ -124,8 +135,8 @@ pub trait WebViewExt { fn get_back_forward_list(&self) -> Option; - //#[cfg(feature = "v2_8")] - //fn get_background_color(&self, rgba: /*Ignored*/gdk::RGBA); + #[cfg(feature = "v2_8")] + fn get_background_color(&self) -> gdk::RGBA; fn get_context(&self) -> Option; @@ -136,7 +147,7 @@ pub trait WebViewExt { fn get_estimated_load_progress(&self) -> f64; - //fn get_favicon(&self) -> /*Ignored*/Option; + fn get_favicon(&self) -> Option; fn get_find_controller(&self) -> Option; @@ -148,18 +159,18 @@ pub trait WebViewExt { fn get_page_id(&self) -> u64; - //#[cfg(feature = "v2_12")] - //fn get_session_state(&self) -> /*Ignored*/Option; + #[cfg(feature = "v2_12")] + fn get_session_state(&self) -> Option; fn get_settings(&self) -> Option; - //fn get_snapshot<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, region: SnapshotRegion, options: SnapshotOptions, cancellable: P, callback: Q, user_data: R); + //fn get_snapshot<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, region: SnapshotRegion, options: SnapshotOptions, cancellable: P, callback: Q, user_data: R); - //fn get_snapshot_finish>(&self, result: &P) -> Result; + //fn get_snapshot_finish>(&self, result: &P) -> Result; fn get_title(&self) -> Option; - //fn get_tls_info(&self, certificate: /*Ignored*/gio::TlsCertificate) -> Option; + fn get_tls_info(&self) -> Option<(gio::TlsCertificate, gio::TlsCertificateFlags)>; fn get_uri(&self) -> Option; @@ -191,8 +202,8 @@ pub trait WebViewExt { fn load_alternate_html<'a, P: Into>>(&self, content: &str, content_uri: &str, base_uri: P); - //#[cfg(feature = "v2_6")] - //fn load_bytes<'a, 'b, 'c, P: Into>, Q: Into>, R: Into>>(&self, bytes: /*Ignored*/&glib::Bytes, mime_type: P, encoding: Q, base_uri: R); + #[cfg(feature = "v2_6")] + fn load_bytes<'a, 'b, 'c, P: Into>, Q: Into>, R: Into>>(&self, bytes: &glib::Bytes, mime_type: P, encoding: Q, base_uri: R); fn load_html<'a, P: Into>>(&self, content: &str, base_uri: P); @@ -209,27 +220,27 @@ pub trait WebViewExt { fn reload_bypass_cache(&self); - //#[cfg(feature = "v2_12")] - //fn restore_session_state(&self, state: /*Ignored*/&WebViewSessionState); + #[cfg(feature = "v2_12")] + fn restore_session_state(&self, state: &WebViewSessionState); - //fn run_javascript<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, script: &str, cancellable: P, callback: Q, user_data: R); + //fn run_javascript<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, script: &str, cancellable: P, callback: Q, user_data: R); //fn run_javascript_finish>(&self, result: &P) -> Result; - //fn run_javascript_from_gresource<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, resource: &str, cancellable: P, callback: Q, user_data: R); + //fn run_javascript_from_gresource<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, resource: &str, cancellable: P, callback: Q, user_data: R); //fn run_javascript_from_gresource_finish>(&self, result: &P) -> Result; - //fn save<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, save_mode: SaveMode, cancellable: P, callback: Q, user_data: R); + //fn save<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, save_mode: SaveMode, cancellable: P, callback: Q, user_data: R); //fn save_finish>(&self, result: &P) -> Result; - //fn save_to_file<'a, 'b, P: IsA, Q: Into>, R: Into>, S: Into>>(&self, file: &P, save_mode: SaveMode, cancellable: Q, callback: R, user_data: S); + //fn save_to_file<'a, 'b, P: IsA, Q: Into>, R: Into>, S: Into>>(&self, file: &P, save_mode: SaveMode, cancellable: Q, callback: R, user_data: S); //fn save_to_file_finish>(&self, result: &P) -> Result<(), Error>; - //#[cfg(feature = "v2_8")] - //fn set_background_color(&self, rgba: /*Ignored*/&gdk::RGBA); + #[cfg(feature = "v2_8")] + fn set_background_color(&self, rgba: &gdk::RGBA); fn set_custom_charset<'a, P: Into>>(&self, charset: P); @@ -263,7 +274,7 @@ pub trait WebViewExt { fn connect_close(&self, f: F) -> SignalHandlerId; - //fn connect_context_menu(&self, f: F) -> SignalHandlerId; + fn connect_context_menu bool + 'static>(&self, f: F) -> SignalHandlerId; fn connect_context_menu_dismissed(&self, f: F) -> SignalHandlerId; @@ -282,8 +293,8 @@ pub trait WebViewExt { fn connect_load_failed bool + 'static>(&self, f: F) -> SignalHandlerId; - //#[cfg(feature = "v2_6")] - //fn connect_load_failed_with_tls_errors(&self, f: F) -> SignalHandlerId; + #[cfg(feature = "v2_6")] + fn connect_load_failed_with_tls_errors bool + 'static>(&self, f: F) -> SignalHandlerId; fn connect_mouse_target_changed(&self, f: F) -> SignalHandlerId; @@ -345,7 +356,7 @@ pub trait WebViewExt { } impl + IsA> WebViewExt for O { - //fn can_execute_editing_command<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, command: &str, cancellable: P, callback: Q, user_data: R) { + //fn can_execute_editing_command<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, command: &str, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_web_view_can_execute_editing_command() } //} @@ -396,10 +407,14 @@ impl + IsA> WebViewExt for O { } } - //#[cfg(feature = "v2_8")] - //fn get_background_color(&self, rgba: /*Ignored*/gdk::RGBA) { - // unsafe { TODO: call ffi::webkit_web_view_get_background_color() } - //} + #[cfg(feature = "v2_8")] + fn get_background_color(&self) -> gdk::RGBA { + unsafe { + let mut rgba = gdk::RGBA::uninitialized(); + ffi::webkit_web_view_get_background_color(self.to_glib_none().0, rgba.to_glib_none_mut().0); + rgba + } + } fn get_context(&self) -> Option { unsafe { @@ -426,9 +441,11 @@ impl + IsA> WebViewExt for O { } } - //fn get_favicon(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::webkit_web_view_get_favicon() } - //} + fn get_favicon(&self) -> Option { + unsafe { + from_glib_none(ffi::webkit_web_view_get_favicon(self.to_glib_none().0)) + } + } fn get_find_controller(&self) -> Option { unsafe { @@ -460,10 +477,12 @@ impl + IsA> WebViewExt for O { } } - //#[cfg(feature = "v2_12")] - //fn get_session_state(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::webkit_web_view_get_session_state() } - //} + #[cfg(feature = "v2_12")] + fn get_session_state(&self) -> Option { + unsafe { + from_glib_full(ffi::webkit_web_view_get_session_state(self.to_glib_none().0)) + } + } fn get_settings(&self) -> Option { unsafe { @@ -471,11 +490,11 @@ impl + IsA> WebViewExt for O { } } - //fn get_snapshot<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, region: SnapshotRegion, options: SnapshotOptions, cancellable: P, callback: Q, user_data: R) { + //fn get_snapshot<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, region: SnapshotRegion, options: SnapshotOptions, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_web_view_get_snapshot() } //} - //fn get_snapshot_finish>(&self, result: &P) -> Result { + //fn get_snapshot_finish>(&self, result: &P) -> Result { // unsafe { TODO: call ffi::webkit_web_view_get_snapshot_finish() } //} @@ -485,9 +504,14 @@ impl + IsA> WebViewExt for O { } } - //fn get_tls_info(&self, certificate: /*Ignored*/gio::TlsCertificate) -> Option { - // unsafe { TODO: call ffi::webkit_web_view_get_tls_info() } - //} + fn get_tls_info(&self) -> Option<(gio::TlsCertificate, gio::TlsCertificateFlags)> { + unsafe { + let mut certificate = ptr::null_mut(); + let mut errors = mem::uninitialized(); + let ret = from_glib(ffi::webkit_web_view_get_tls_info(self.to_glib_none().0, &mut certificate, &mut errors)); + if ret { Some((from_glib_none(certificate), from_glib(errors))) } else { None } + } + } fn get_uri(&self) -> Option { unsafe { @@ -573,10 +597,18 @@ impl + IsA> WebViewExt for O { } } - //#[cfg(feature = "v2_6")] - //fn load_bytes<'a, 'b, 'c, P: Into>, Q: Into>, R: Into>>(&self, bytes: /*Ignored*/&glib::Bytes, mime_type: P, encoding: Q, base_uri: R) { - // unsafe { TODO: call ffi::webkit_web_view_load_bytes() } - //} + #[cfg(feature = "v2_6")] + fn load_bytes<'a, 'b, 'c, P: Into>, Q: Into>, R: Into>>(&self, bytes: &glib::Bytes, mime_type: P, encoding: Q, base_uri: R) { + let mime_type = mime_type.into(); + let mime_type = mime_type.to_glib_none(); + let encoding = encoding.into(); + let encoding = encoding.to_glib_none(); + let base_uri = base_uri.into(); + let base_uri = base_uri.to_glib_none(); + unsafe { + ffi::webkit_web_view_load_bytes(self.to_glib_none().0, bytes.to_glib_none().0, mime_type.0, encoding.0, base_uri.0); + } + } fn load_html<'a, P: Into>>(&self, content: &str, base_uri: P) { let base_uri = base_uri.into(); @@ -623,12 +655,14 @@ impl + IsA> WebViewExt for O { } } - //#[cfg(feature = "v2_12")] - //fn restore_session_state(&self, state: /*Ignored*/&WebViewSessionState) { - // unsafe { TODO: call ffi::webkit_web_view_restore_session_state() } - //} + #[cfg(feature = "v2_12")] + fn restore_session_state(&self, state: &WebViewSessionState) { + unsafe { + ffi::webkit_web_view_restore_session_state(self.to_glib_none().0, state.to_glib_none().0); + } + } - //fn run_javascript<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, script: &str, cancellable: P, callback: Q, user_data: R) { + //fn run_javascript<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, script: &str, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_web_view_run_javascript() } //} @@ -636,7 +670,7 @@ impl + IsA> WebViewExt for O { // unsafe { TODO: call ffi::webkit_web_view_run_javascript_finish() } //} - //fn run_javascript_from_gresource<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, resource: &str, cancellable: P, callback: Q, user_data: R) { + //fn run_javascript_from_gresource<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, resource: &str, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_web_view_run_javascript_from_gresource() } //} @@ -644,7 +678,7 @@ impl + IsA> WebViewExt for O { // unsafe { TODO: call ffi::webkit_web_view_run_javascript_from_gresource_finish() } //} - //fn save<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, save_mode: SaveMode, cancellable: P, callback: Q, user_data: R) { + //fn save<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, save_mode: SaveMode, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_web_view_save() } //} @@ -652,7 +686,7 @@ impl + IsA> WebViewExt for O { // unsafe { TODO: call ffi::webkit_web_view_save_finish() } //} - //fn save_to_file<'a, 'b, P: IsA, Q: Into>, R: Into>, S: Into>>(&self, file: &P, save_mode: SaveMode, cancellable: Q, callback: R, user_data: S) { + //fn save_to_file<'a, 'b, P: IsA, Q: Into>, R: Into>, S: Into>>(&self, file: &P, save_mode: SaveMode, cancellable: Q, callback: R, user_data: S) { // unsafe { TODO: call ffi::webkit_web_view_save_to_file() } //} @@ -660,10 +694,12 @@ impl + IsA> WebViewExt for O { // unsafe { TODO: call ffi::webkit_web_view_save_to_file_finish() } //} - //#[cfg(feature = "v2_8")] - //fn set_background_color(&self, rgba: /*Ignored*/&gdk::RGBA) { - // unsafe { TODO: call ffi::webkit_web_view_set_background_color() } - //} + #[cfg(feature = "v2_8")] + fn set_background_color(&self, rgba: &gdk::RGBA) { + unsafe { + ffi::webkit_web_view_set_background_color(self.to_glib_none().0, rgba.to_glib_none().0); + } + } fn set_custom_charset<'a, P: Into>>(&self, charset: P) { let charset = charset.into(); @@ -765,9 +801,13 @@ impl + IsA> WebViewExt for O { } } - //fn connect_context_menu(&self, f: F) -> SignalHandlerId { - // Ignored event: Gdk.Event - //} + fn connect_context_menu bool + 'static>(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_ bool + 'static>> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "context-menu", + transmute(context_menu_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } fn connect_context_menu_dismissed(&self, f: F) -> SignalHandlerId { unsafe { @@ -834,11 +874,14 @@ impl + IsA> WebViewExt for O { } } - //#[cfg(feature = "v2_6")] - //fn connect_load_failed_with_tls_errors(&self, f: F) -> SignalHandlerId { - // Ignored certificate: Gio.TlsCertificate - // Ignored errors: Gio.TlsCertificateFlags - //} + #[cfg(feature = "v2_6")] + fn connect_load_failed_with_tls_errors bool + 'static>(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_ bool + 'static>> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "load-failed-with-tls-errors", + transmute(load_failed_with_tls_errors_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } fn connect_mouse_target_changed(&self, f: F) -> SignalHandlerId { unsafe { @@ -1064,6 +1107,13 @@ where P: IsA { f(&WebView::from_glib_borrow(this).downcast_unchecked()) } +unsafe extern "C" fn context_menu_trampoline

(this: *mut ffi::WebKitWebView, context_menu: *mut ffi::WebKitContextMenu, event: *mut gdk_ffi::GdkEvent, hit_test_result: *mut ffi::WebKitHitTestResult, f: glib_ffi::gpointer) -> glib_ffi::gboolean +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &ContextMenu, &gdk::Event, &HitTestResult) -> bool + 'static) = transmute(f); + f(&WebView::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(context_menu), &from_glib_none(event), &from_glib_borrow(hit_test_result)).to_glib() +} + unsafe extern "C" fn context_menu_dismissed_trampoline

(this: *mut ffi::WebKitWebView, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); @@ -1121,6 +1171,14 @@ where P: IsA { f(&WebView::from_glib_borrow(this).downcast_unchecked(), from_glib(load_event), &String::from_glib_none(failing_uri), &from_glib_borrow(error)).to_glib() } +#[cfg(feature = "v2_6")] +unsafe extern "C" fn load_failed_with_tls_errors_trampoline

(this: *mut ffi::WebKitWebView, failing_uri: *mut libc::c_char, certificate: *mut gio_ffi::GTlsCertificate, errors: gio_ffi::GTlsCertificateFlags, f: glib_ffi::gpointer) -> glib_ffi::gboolean +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &str, &gio::TlsCertificate, gio::TlsCertificateFlags) -> bool + 'static) = transmute(f); + f(&WebView::from_glib_borrow(this).downcast_unchecked(), &String::from_glib_none(failing_uri), &from_glib_borrow(certificate), from_glib(errors)).to_glib() +} + unsafe extern "C" fn mouse_target_changed_trampoline

(this: *mut ffi::WebKitWebView, hit_test_result: *mut ffi::WebKitHitTestResult, modifiers: libc::c_uint, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); diff --git a/src/auto/web_view_base.rs b/src/auto/web_view_base.rs new file mode 100644 index 00000000..13b33aa0 --- /dev/null +++ b/src/auto/web_view_base.rs @@ -0,0 +1,24 @@ +// This file was generated by gir (7484d29) from gir-files (71d73f0) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gtk; +use gtk_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct WebViewBase(Object): [ + gtk::Container => gtk_ffi::GtkContainer, + gtk::Widget => gtk_ffi::GtkWidget, + ]; + + match fn { + get_type => || ffi::webkit_web_view_base_get_type(), + } +} + +impl WebViewBase {} diff --git a/src/auto/web_view_session_state.rs b/src/auto/web_view_session_state.rs new file mode 100644 index 00000000..7141ee1b --- /dev/null +++ b/src/auto/web_view_session_state.rs @@ -0,0 +1,38 @@ +// This file was generated by gir (7484d29) from gir-files (71d73f0) +// DO NOT EDIT + +use ffi; +#[cfg(feature = "v2_12")] +use glib; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct WebViewSessionState(Shared); + + match fn { + ref => |ptr| ffi::webkit_web_view_session_state_ref(ptr), + unref => |ptr| ffi::webkit_web_view_session_state_unref(ptr), + get_type => || ffi::webkit_web_view_session_state_get_type(), + } +} + +impl WebViewSessionState { + #[cfg(feature = "v2_12")] + pub fn new(data: &glib::Bytes) -> WebViewSessionState { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::webkit_web_view_session_state_new(data.to_glib_none().0)) + } + } + + #[cfg(feature = "v2_12")] + pub fn serialize(&self) -> Option { + unsafe { + from_glib_full(ffi::webkit_web_view_session_state_serialize(self.to_glib_none().0)) + } + } +} diff --git a/src/auto/website_data_manager.rs b/src/auto/website_data_manager.rs index 67faa4d4..3a65867e 100644 --- a/src/auto/website_data_manager.rs +++ b/src/auto/website_data_manager.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT #[cfg(feature = "v2_16")] @@ -49,13 +49,13 @@ impl WebsiteDataManager { pub trait WebsiteDataManagerExt { //#[cfg(feature = "v2_16")] - //fn clear<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: /*Ignored*/WebsiteDataTypes, timespan: /*Ignored*/glib::TimeSpan, cancellable: P, callback: Q, user_data: R); + //fn clear<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: WebsiteDataTypes, timespan: /*Ignored*/glib::TimeSpan, cancellable: P, callback: Q, user_data: R); //#[cfg(feature = "v2_16")] //fn clear_finish>(&self, result: &P) -> Result<(), Error>; //#[cfg(feature = "v2_16")] - //fn fetch<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: /*Ignored*/WebsiteDataTypes, cancellable: P, callback: Q, user_data: R); + //fn fetch<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: WebsiteDataTypes, cancellable: P, callback: Q, user_data: R); //#[cfg(feature = "v2_16")] //fn fetch_finish>(&self, result: &P) -> Result, Error>; @@ -88,7 +88,7 @@ pub trait WebsiteDataManagerExt { fn is_ephemeral(&self) -> bool; //#[cfg(feature = "v2_16")] - //fn remove<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: /*Ignored*/WebsiteDataTypes, website_data: /*Ignored*/&[&WebsiteData], cancellable: P, callback: Q, user_data: R); + //fn remove<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: WebsiteDataTypes, website_data: /*Ignored*/&[&WebsiteData], cancellable: P, callback: Q, user_data: R); //#[cfg(feature = "v2_16")] //fn remove_finish>(&self, result: &P) -> Result<(), Error>; @@ -123,7 +123,7 @@ pub trait WebsiteDataManagerExt { impl + IsA> WebsiteDataManagerExt for O { //#[cfg(feature = "v2_16")] - //fn clear<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: /*Ignored*/WebsiteDataTypes, timespan: /*Ignored*/glib::TimeSpan, cancellable: P, callback: Q, user_data: R) { + //fn clear<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: WebsiteDataTypes, timespan: /*Ignored*/glib::TimeSpan, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_website_data_manager_clear() } //} @@ -133,7 +133,7 @@ impl + IsA> WebsiteDataManagerE //} //#[cfg(feature = "v2_16")] - //fn fetch<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: /*Ignored*/WebsiteDataTypes, cancellable: P, callback: Q, user_data: R) { + //fn fetch<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: WebsiteDataTypes, cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_website_data_manager_fetch() } //} @@ -206,7 +206,7 @@ impl + IsA> WebsiteDataManagerE } //#[cfg(feature = "v2_16")] - //fn remove<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: /*Ignored*/WebsiteDataTypes, website_data: /*Ignored*/&[&WebsiteData], cancellable: P, callback: Q, user_data: R) { + //fn remove<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, types: WebsiteDataTypes, website_data: /*Ignored*/&[&WebsiteData], cancellable: P, callback: Q, user_data: R) { // unsafe { TODO: call ffi::webkit_website_data_manager_remove() } //} diff --git a/src/auto/window_properties.rs b/src/auto/window_properties.rs index cab9caab..06171cca 100644 --- a/src/auto/window_properties.rs +++ b/src/auto/window_properties.rs @@ -1,7 +1,8 @@ -// This file was generated by gir (e95e5d8) from gir-files (857b8f5) +// This file was generated by gir (7484d29) from gir-files (71d73f0) // DO NOT EDIT use ffi; +use gdk; use glib; use glib::object::Downcast; use glib::object::IsA; @@ -26,7 +27,7 @@ glib_wrapper! { pub trait WindowPropertiesExt { fn get_fullscreen(&self) -> bool; - //fn get_geometry(&self, geometry: /*Ignored*/gdk::Rectangle); + fn get_geometry(&self) -> gdk::Rectangle; fn get_locationbar_visible(&self) -> bool; @@ -64,9 +65,13 @@ impl + IsA> WindowPropertiesExt f } } - //fn get_geometry(&self, geometry: /*Ignored*/gdk::Rectangle) { - // unsafe { TODO: call ffi::webkit_window_properties_get_geometry() } - //} + fn get_geometry(&self) -> gdk::Rectangle { + unsafe { + let mut geometry = gdk::Rectangle::uninitialized(); + ffi::webkit_window_properties_get_geometry(self.to_glib_none().0, geometry.to_glib_none_mut().0); + geometry + } + } fn get_locationbar_visible(&self) -> bool { unsafe { diff --git a/src/lib.rs b/src/lib.rs index 50d6dd69..97845c42 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,11 @@ #[macro_use] extern crate bitflags; -extern crate gio_sys; +extern crate cairo; +extern crate gdk; +extern crate gdk_sys as gdk_ffi; +extern crate gio; +extern crate gio_sys as gio_ffi; #[macro_use] extern crate glib; extern crate glib_sys as glib_ffi; diff --git a/src/web_view.rs b/src/web_view.rs index b45adf8c..4ff4d6fa 100644 --- a/src/web_view.rs +++ b/src/web_view.rs @@ -26,7 +26,7 @@ use std::mem::transmute; use std::ptr; use ffi; -use gio_sys::{self, GCancellable}; +use gio_ffi::{self, GCancellable}; use glib::{IsA, StaticType, error}; use glib::object::Downcast; use glib::signal::connect; @@ -40,7 +40,7 @@ use super::{JavascriptResult, WebContext, WebView}; #[cfg(feature = "v2_6")] use super::UserContentManager; -type AsyncCallback = Option; +type AsyncCallback = Option; fn connect_notify>(property_name: &str, view: &O, callback: F) { let callback: Box> = Box::new(Box::new(callback)); @@ -75,10 +75,12 @@ impl WebViewExtManual for O } } + // TODO: remove in favor of connect_property_title_notify(). fn connect_title_changed(&self, callback: F) { connect_notify("title", self, callback); } + // TODO: remove in favor of connect_property_uri_notify(). fn connect_uri_changed(&self, callback: F) { connect_notify("uri", self, callback); } @@ -95,7 +97,7 @@ impl WebViewExtManual for O } } -unsafe extern "C" fn async_ready_trampoline(this: *mut gobject_ffi::GObject, result: *mut gio_sys::GAsyncResult, f: glib_ffi::gpointer) { +unsafe extern "C" fn async_ready_trampoline(this: *mut gobject_ffi::GObject, result: *mut gio_ffi::GAsyncResult, f: glib_ffi::gpointer) { callback_guard!(); let mut error = ptr::null_mut(); let javascript_result = ffi::webkit_web_view_run_javascript_finish(this as *mut _, result, &mut error);